diff --git a/docs/content/docs/1.getting-started/3.configuration.md b/docs/content/docs/1.getting-started/3.configuration.md index 6fda89392..a2ae6985b 100644 --- a/docs/content/docs/1.getting-started/3.configuration.md +++ b/docs/content/docs/1.getting-started/3.configuration.md @@ -327,21 +327,21 @@ export default defineNuxtConfig({ ### `Postgres` -If you plan to deploy your application using PostgreSQL database you need to use the `postgres` database adapter. +If you plan to deploy your application using PostgreSQL database you need to use the `postgresql` database adapter. First, make sure to install the `pg` package: ```bash [Terminal] -npx npm i pg +npm i pg ``` -Then, configure the `postgres` adapter in your `nuxt.config.ts`: +Then, configure the `postgresql` adapter in your `nuxt.config.ts`: ```ts [nuxt.config.ts] export default defineNuxtConfig({ content: { database: { - type: 'postgres', + type: 'postgresql', url: process.env.POSTGRES_URL, /* Other options for `pg` */ } @@ -356,7 +356,7 @@ If you plan to deploy your application using a LibSQL database you need to use t First, make sure to install the `@libsql/client` package: ```bash [Terminal] -npx npm i @libsql/client +npm i @libsql/client ``` Then, configure the `libsql` adapter in your `nuxt.config.ts`: @@ -377,6 +377,33 @@ export default defineNuxtConfig({ The most popular LibSQL hosting services is [Turso](https://turso.tech/). :: +### `PGlite` + +If you plan to deploy your application using a PGlite database you need to use the `pglite` database adapter. + +First, make sure to install the `@electric-sql/pglite` package: + +```bash [Terminal] +npm i @electric-sql/pglite +``` + +Then, configure the `pglite` adapter in your `nuxt.config.ts`: + +```ts [nuxt.config.ts] +export default defineNuxtConfig({ + content: { + database: { + type: 'pglite', + dataDir: '.data/content/pglite' + } + } +}) +``` + +::note +We recommend to only use PGlite in development. +:: + ## `renderer` Configure content renderer. diff --git a/docs/content/docs/6.deploy/2.serverless.md b/docs/content/docs/6.deploy/2.serverless.md index 9faf0d6ee..2f6860380 100644 --- a/docs/content/docs/6.deploy/2.serverless.md +++ b/docs/content/docs/6.deploy/2.serverless.md @@ -32,7 +32,7 @@ Before deploying your project, you need to select a database service: export default defineNuxtConfig({ content: { database: { - type: 'postgres', + type: 'postgresql', url: process.env.POSTGRES_URL } } diff --git a/docs/nuxt.config.ts b/docs/nuxt.config.ts index 5d6f8d9be..17534e2ca 100644 --- a/docs/nuxt.config.ts +++ b/docs/nuxt.config.ts @@ -35,16 +35,16 @@ export default defineNuxtConfig({ return Object.assign(acc, { [from]: { redirect: to } }) }, {} as Record), }, - future: { - compatibilityVersion: 4, + nitro: { + compatibilityDate: { + // Don't generate observability routes + vercel: '2025-07-14', + }, }, hub: { - database: true, + database: 'sqlite', cache: true, }, - github: { - rootDir: 'docs', - }, llms: { domain: 'https://content.nuxt.com', title: 'Nuxt Content', diff --git a/docs/package.json b/docs/package.json index 193c684d7..34a66df4d 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,14 +5,16 @@ "build": "nuxt build" }, "dependencies": { + "@libsql/client": "^0.15.15", "@nuxt/content": "link:..", - "@nuxthub/core": "https://pkg.pr.new/@nuxthub/core@3d374d9", + "@nuxt/ui": "^4.1.0", + "@nuxthub/core": "npm:@nuxthub/core-nightly@1.0.0-20251028-004316-83d4099", "@nuxtjs/plausible": "^2.0.1", "@vueuse/nuxt": "^14.0.0", "better-sqlite3": "^12.4.1", - "docus": "https://pkg.pr.new/docus@1194", + "docus": "^5.2.1", + "drizzle-orm": "^0.44.7", "minisearch": "^7.2.0", - "@nuxt/ui": "^4.1.0", "nuxt": "^4.2.0" } } diff --git a/package.json b/package.json index b4efbe238..4494c673d 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,7 @@ "shiki": "^3.14.0", "slugify": "^1.6.6", "socket.io-client": "^4.8.1", + "std-env": "^3.10.0", "tar": "^7.5.1", "tinyglobby": "^0.2.15", "ufo": "^1.6.1", diff --git a/playground/content/0.index.md b/playground/content/0.index.md index 0e468f4ff..52cc06f46 100644 --- a/playground/content/0.index.md +++ b/playground/content/0.index.md @@ -5,8 +5,8 @@ date: 2024-09-23 ## 🎨 Documentations -- [Nuxt v3](/nuxt/getting-started/introduction) -- [Nuxt Content v2](/content-v2/getting-started/installation) +- [Nuxt](/nuxt/getting-started/introduction) +- [Nuxt Content](/content-v2/getting-started/installation) ## 🎨 Playground diff --git a/playground/nuxt.config.ts b/playground/nuxt.config.ts index ff5226d6f..99426e21b 100644 --- a/playground/nuxt.config.ts +++ b/playground/nuxt.config.ts @@ -1,13 +1,18 @@ export default defineNuxtConfig({ modules: [ '@nuxt/ui', - '@nuxt/content', '@nuxthub/core', + '@nuxt/content', ], content: { experimental: { nativeSqlite: true, }, + // Uncomment to use PGlite instead of SQLite + // database: { + // type: 'pglite', + // dataDir: '.data/content/pglite' // or omit for in-memory database + // }, build: { markdown: { remarkPlugins: { @@ -31,8 +36,10 @@ export default defineNuxtConfig({ }, }, }, - compatibilityDate: '2024-07-24', + compatibilityDate: '2025-10-15', hub: { - database: true, + database: 'sqlite', + // Or use PGlite with NuxtHub: + // database: 'postgresql', }, }) diff --git a/playground/package.json b/playground/package.json index fa0f6093e..70d44022a 100644 --- a/playground/package.json +++ b/playground/package.json @@ -3,16 +3,21 @@ "private": true, "type": "module", "scripts": { - "dev": "nuxi dev", - "build": "nuxi build", - "generate": "nuxi generate", + "dev": "nuxt dev", + "build": "nuxt build", + "generate": "nuxt generate", "dev:prepare": "nuxt prepare" }, "devDependencies": { + "@electric-sql/pglite": "^0.3.10", + "@libsql/client": "^0.15.15", "@nuxt/content": "latest", "@nuxt/ui": "^4.1.0", - "@nuxthub/core": "^0.9.0", + "@nuxthub/core": "npm:@nuxthub/core-nightly@1.0.0-20251028-004316-83d4099", + "better-sqlite3": "^12.4.1", + "drizzle-orm": "^0.44.7", "nuxt": "^4.2.0", + "pg": "^8.16.3", "remark-code-import": "^1.2.0", "shiki-transformer-color-highlight": "^1.0.0" } diff --git a/playground/pages/[...slug].vue b/playground/pages/[...slug].vue index 7087f5c8d..077fee703 100644 --- a/playground/pages/[...slug].vue +++ b/playground/pages/[...slug].vue @@ -2,11 +2,11 @@ const route = useRoute() const { data: navigation } = await useAsyncData('contents-list', () => queryCollectionNavigation('content')) -const { data } = await useAsyncData('posts' + route.path, async () => { +const { data } = await useAsyncData(() => 'posts' + route.path, async () => { return await queryCollection('content').path(route.path).first() }) -const { data: surround } = await useAsyncData('content-surround' + route.path, () => { +const { data: surround } = await useAsyncData(() => 'content-surround' + route.path, () => { return queryCollectionItemSurroundings('content', route.path, { before: 1, after: 1, @@ -17,6 +17,7 @@ const { data: surround } = await useAsyncData('content-surround' + route.path, (