diff --git a/docs/content/docs/1.getting-started/4.migration.md b/docs/content/docs/1.getting-started/4.migration.md index ebd29cc65..7da4d0e58 100644 --- a/docs/content/docs/1.getting-started/4.migration.md +++ b/docs/content/docs/1.getting-started/4.migration.md @@ -5,7 +5,7 @@ description: How to migrate from v2 to v3 Nuxt Content v3 has been rebuilt from the ground up, resulting in a new library with enhanced capabilities. While we've redesigned concepts and components in a similar way as Content v2, breaking changes are inevitable. -Don't worry, you don't need to modify your content files, We made sure that Content v3 handles content in the same way as Content v2. +Don't worry, you don't need to modify your content files. We made sure that Content v3 handles content in the same way as Content v2. ## Changes @@ -13,20 +13,20 @@ Don't worry, you don't need to modify your content files, We made sure that Cont - `queryContent()` API is replaced with new `queryCollection()` - New API is backed by SQL - - New API search contents within the specific collection + - New API searches contents within a specific collection - `fetchContentNavigation()` API is replaced with new `queryCollectionNavigation()` - Surroundings now has its own separate API `queryCollectionItemSurroundings()` - Document driven mode is fully dropped, meaning: - Markdown files will not convert to Nuxt pages automatically, you need to create pages, see [how](/docs/components/content-renderer#example) - `useContent()` composable is removed -- `searchContent()` is dropped in favor of new api `queryCollectionSearchSections` +- `searchContent()` is dropped in favor of new API `queryCollectionSearchSections` - Full text search can easily be done using this API See [Full-Text Search Snippets](/docs/advanced/fulltext-search) ### Rendering Components -- Every content should be rendered using `` component. ``, ``, `` and `` components are dropped in v3. +- All content should be rendered using `` component. ``, ``, `` and `` components are dropped in v3. - `` and `` components are not supported in v3. Instead components can simply use Vue's native `` component. - - One of the main reasons for existance of `` and `` was to manipulate content before rendering and removing wrapping paragraphs from slot content. This unwrapping behavior is now supported via `mdc-unwrap` attribute in `` component. example: `` + - One of the main reasons for existence of `` and `` was to manipulate content before rendering and removing wrapping paragraphs from slot content. This unwrapping behavior is now supported via `mdc-unwrap` attribute in `` component. example: `` - We consolidated the `ProsePre`, `ProseCode`, and `ProseCodeInline` components - `ProseCodeInline` is now `ProseCode` - `ProseCode` is now `ProsePre` @@ -34,7 +34,7 @@ Don't worry, you don't need to modify your content files, We made sure that Cont ### General Changes - `_dir.yml` files are renamed to `.navigation.yml` -- There is no source option in module options, instead you can define multiple source for your collections in `content.config.ts`. +- There is no source option in module options, instead you can define multiple sources for your collections in `content.config.ts`. - Document `._path` is now renamed to `.path`, likewise all internal fields with `_` prefix are removed or renamed. - `useContentHelpers()` is removed @@ -65,8 +65,8 @@ const { data: page } = await useAsyncData(route.path, () => { As we mentioned above, `queryContent` is dropped in favor of new collection based `queryCollection`. There are two main differences between these two: -1. `queryCollection` is building a query for SQL database. -2. `queryCollection` do the search only inside the specific collection. You should know the collection. +1. `queryCollection` is building a query for an SQL database. +2. `queryCollection` does the search only inside the specified collection. You should know the collection's name (key on config). ```ts [Find content with path] // Content v2 @@ -88,7 +88,7 @@ const v3Query = await queryCollection('content') ## Convert `queryContent().findSurround()` -Surround now has it's own separate API. +Surround now has its own separate API. ```ts const targetPath = '/docs' diff --git a/package.json b/package.json index fd38ee7d0..921106223 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "@types/ws": "^8.5.13", "csvtojson": "^2.0.10", "eslint": "^9.17.0", - "mdclint": "^0.0.1", + "mdclint": "^0.0.2", "micromark-util-types": "^2.0.1", "nuxt": "^3.14.1592", "release-it": "^17.10.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 85cb6e827..46314c26b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -197,8 +197,8 @@ importers: specifier: ^9.17.0 version: 9.17.0(jiti@2.4.1) mdclint: - specifier: ^0.0.1 - version: 0.0.1(eslint@9.17.0(jiti@2.4.1))(magicast@0.3.5) + specifier: ^0.0.2 + version: 0.0.2(eslint@9.17.0(jiti@2.4.1))(magicast@0.3.5) micromark-util-types: specifier: ^2.0.1 version: 2.0.1 @@ -5162,8 +5162,8 @@ packages: mdast-util-to-string@4.0.0: resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} - mdclint@0.0.1: - resolution: {integrity: sha512-A9lOHt0klk+NSu2EXGefjSKwLvb34iSQ62jzVyPIKNqgk8FtBHpNzzAEbg0XUO4fHS8oC6D5FtbOW9S+KdiFoA==} + mdclint@0.0.2: + resolution: {integrity: sha512-mmfIHVKUqvxFgrdxld9EG/lAMQqV4ZKagBia4oxGWRlc+J0VYli4b12FrYbF0ydDtqJNzXm4+a/mQ8UW5NbXvA==} hasBin: true peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -8863,7 +8863,7 @@ snapshots: tinyglobby: 0.2.10 unimport: 3.14.5(rollup@4.28.0) vite: 5.4.11(@types/node@22.10.2)(lightningcss@1.28.2)(terser@5.36.0) - vite-plugin-inspect: 0.8.9(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.28.0))(rollup@4.28.0)(vite@5.4.11(@types/node@22.10.2)(lightningcss@1.28.2)(terser@5.36.0)) + vite-plugin-inspect: 0.8.9(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(rollup@4.28.0)(vite@5.4.11(@types/node@22.10.2)(lightningcss@1.28.2)(terser@5.36.0)) vite-plugin-vue-inspector: 5.1.3(vite@5.4.11(@types/node@22.10.2)(lightningcss@1.28.2)(terser@5.36.0)) which: 3.0.1 ws: 8.18.0 @@ -13867,7 +13867,7 @@ snapshots: dependencies: '@types/mdast': 4.0.4 - mdclint@0.0.1(eslint@9.17.0(jiti@2.4.1))(magicast@0.3.5): + mdclint@0.0.2(eslint@9.17.0(jiti@2.4.1))(magicast@0.3.5): dependencies: c12: 2.0.1(magicast@0.3.5) citty: 0.1.6 @@ -17000,6 +17000,24 @@ snapshots: - rollup - supports-color + vite-plugin-inspect@0.8.9(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(rollup@4.28.0)(vite@5.4.11(@types/node@22.10.2)(lightningcss@1.28.2)(terser@5.36.0)): + dependencies: + '@antfu/utils': 0.7.10 + '@rollup/pluginutils': 5.1.3(rollup@4.28.0) + debug: 4.4.0 + error-stack-parser-es: 0.1.5 + fs-extra: 11.2.0 + open: 10.1.0 + perfect-debounce: 1.0.0 + picocolors: 1.1.1 + sirv: 3.0.0 + vite: 5.4.11(@types/node@22.10.2)(lightningcss@1.28.2)(terser@5.36.0) + optionalDependencies: + '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) + transitivePeerDependencies: + - rollup + - supports-color + vite-plugin-inspect@0.8.9(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.28.0))(rollup@4.28.0)(vite@5.4.11(@types/node@22.10.2)(lightningcss@1.28.2)(terser@5.36.0)): dependencies: '@antfu/utils': 0.7.10