@splendidlabz/astro
v5.2.10
Published
To use the our Astro components in your project, you need to add `noExternal` key to your `astro.config.mjs` file:
Readme
To use the our Astro components in your project, you need to add noExternal key to your astro.config.mjs file:
export default defineConfig({
vite: {
ssr: { noExternal: ['@splendidlabz/astro'] },
},
})Database Setup
This package uses Astro DB for database operations. To use the database features:
- Install required dependencies:
npm install @astrojs/db- Add @astrojs/db to your Astro config:
import { defineConfig } from 'astro/config'
import db from '@astrojs/db'
export default defineConfig({
integrations: [db()],
})- Configure your database in
astro.config.mjs:
export default defineConfig({
db: {
url: process.env.DATABASE_URL,
},
})- Create your database schema in
db/schema.js:
import { defineTable, column } from 'astro:db'
export const User = defineTable({
columns: {
id: column.text({ primaryKey: true }),
email: column.text({ unique: true }),
// ... other columns
},
})
// ... other tables- Configure your database in
db/config.js:
import { defineDb } from 'astro:db'
import * as schema from './schema.js'
export default defineDb({
tables: schema,
})