From 57140b04a217392de46c0722848b31d58ddb89b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Wed, 11 Nov 2026 15:03:49 +0000 Subject: [PATCH 1/2] chore: upgrade comark-content to v0.6.0 0.6.0 keeps `$` in content paths instead of spelling it out, so `$fetch.md` moves from `/api/utils/dollarfetch` to `/api/utils/$fetch` (and 2.x `$nuxt.md` from `dollarnuxt` to `$nuxt`). Redirect the old docs and raw Markdown URLs with a 301 and point internal links at the new paths. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cab2-3a25-7105-aff2-5e2968caf515 --- content/blog/14.nuxt-on-the-edge.md | 2 +- nuxt.config.ts | 16 ++++++++++++---- package.json | 2 +- pnpm-lock.yaml | 11 +++++------ pnpm-workspace.yaml | 2 +- .../l10n/docs/4.api/2.composables/use-fetch.md | 2 +- test/unit/docs.spec.ts | 4 ++-- 7 files changed, 23 insertions(+), 16 deletions(-) diff --git a/content/blog/14.nuxt-on-the-edge.md b/content/blog/14.nuxt-on-the-edge.md index 36951751b..b8aa49d36 100644 --- a/content/blog/14.nuxt-on-the-edge.md +++ b/content/blog/14.nuxt-on-the-edge.md @@ -86,7 +86,7 @@ const { data } = await useFetch('/api/hello') ``` -One important thing to note when we created [useFetch](/docs/api/composables/use-fetch) and [$fetch](/docs/api/utils/dollarfetch) is that during server-side rendering, if you call your API routes, it will emulate the request and call the function code directly: **avoiding an HTTP request and reducing page’s rendering time**. +One important thing to note when we created [useFetch](/docs/api/composables/use-fetch) and [$fetch](/docs/api/utils/$fetch) is that during server-side rendering, if you call your API routes, it will emulate the request and call the function code directly: **avoiding an HTTP request and reducing page’s rendering time**. In terms of developer experience, you will notice that when creating server files, the Nuxt server keeps running without rebuilding the Vue app. **This is because Nuxt 3 supports Hot Module Replacement (HMR) when creating API and server routes.** diff --git a/nuxt.config.ts b/nuxt.config.ts index 9896170ac..154964def 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -309,10 +309,10 @@ export default defineNuxtConfig({ '/docs/3.x/api/composables': { redirect: '/docs/3.x/api/composables/use-app-config', prerender: false }, '/docs/4.x/api/composables': { redirect: '/docs/4.x/api/composables/use-app-config', prerender: false }, '/docs/5.x/api/composables': { redirect: '/docs/5.x/api/composables/use-app-config', prerender: false }, - '/docs/api/utils': { redirect: '/docs/api/utils/dollarfetch', prerender: false }, - '/docs/3.x/api/utils': { redirect: '/docs/3.x/api/utils/dollarfetch', prerender: false }, - '/docs/4.x/api/utils': { redirect: '/docs/4.x/api/utils/dollarfetch', prerender: false }, - '/docs/5.x/api/utils': { redirect: '/docs/5.x/api/utils/dollarfetch', prerender: false }, + '/docs/api/utils': { redirect: '/docs/api/utils/$fetch', prerender: false }, + '/docs/3.x/api/utils': { redirect: '/docs/3.x/api/utils/$fetch', prerender: false }, + '/docs/4.x/api/utils': { redirect: '/docs/4.x/api/utils/$fetch', prerender: false }, + '/docs/5.x/api/utils': { redirect: '/docs/5.x/api/utils/$fetch', prerender: false }, '/docs/api/kit': { redirect: '/docs/api/kit/modules', prerender: false }, '/docs/3.x/api/kit': { redirect: '/docs/3.x/api/kit/modules', prerender: false }, '/docs/4.x/api/kit': { redirect: '/docs/4.x/api/kit/modules', prerender: false }, @@ -338,6 +338,14 @@ export default defineNuxtConfig({ '/docs/4.x/examples': { redirect: { to: '/docs/examples/hello-world', statusCode: 301 }, prerender: false }, '/docs/5.x/examples': { redirect: { to: '/docs/examples/hello-world', statusCode: 301 }, prerender: false }, '/docs/examples': { redirect: '/docs/examples/hello-world', prerender: false }, + // comark-content 0.6 keeps `$` in paths instead of spelling it out (`$fetch.md` was `dollarfetch`) + '/docs/2.x/api/internals/dollarnuxt': { redirect: { to: '/docs/2.x/api/internals/$nuxt', statusCode: 301 }, prerender: false }, + '/docs/3.x/api/utils/dollarfetch': { redirect: { to: '/docs/3.x/api/utils/$fetch', statusCode: 301 }, prerender: false }, + '/docs/4.x/api/utils/dollarfetch': { redirect: { to: '/docs/4.x/api/utils/$fetch', statusCode: 301 }, prerender: false }, + '/docs/5.x/api/utils/dollarfetch': { redirect: { to: '/docs/5.x/api/utils/$fetch', statusCode: 301 }, prerender: false }, + // Their Markdown, as `llms.txt` used to list it (only the versions served as raw Markdown) + '/raw/docs/3.x/api/utils/dollarfetch.md': { redirect: { to: '/raw/docs/3.x/api/utils/$fetch.md', statusCode: 301 }, prerender: false }, + '/raw/docs/4.x/api/utils/dollarfetch.md': { redirect: { to: '/raw/docs/4.x/api/utils/$fetch.md', statusCode: 301 }, prerender: false }, '/docs/examples/features': { redirect: '/docs/examples/features/auto-imports', prerender: false }, '/docs/examples/routing': { redirect: '/docs/examples/routing/middleware', prerender: false }, '/docs/examples/advanced': { redirect: '/docs/examples/advanced/config-extends', prerender: false }, diff --git a/package.json b/package.json index bf1c3e888..34ddd2c68 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "botid": "^1.5.12", "chat": "^4.44.0", "cobe": "2.0.1", - "comark-content": "^0.5.1", + "comark-content": "^0.6.0", "date-fns": "^4.4.0", "drizzle-orm": "^0.45.4", "eve": "^0.91.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fbab04e7a..700421d80 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -314,8 +314,8 @@ importers: specifier: 2.0.1 version: 2.0.1(patch_hash=2b377974f1a55a236275fd7de9361973b6acbfeea119d879ad64f3a9264ee1c7) comark-content: - specifier: ^0.5.1 - version: 0.5.1(forges@0.3.2)(rangi@2.2.0)(shiki@4.6.0)(unstorage@1.17.6(@vercel/functions@3.11.1(@aws-sdk/credential-provider-web-identity@3.972.49)(ws@8.22.2))(db0@0.3.4(@libsql/client@0.18.0)(drizzle-orm@0.45.4(@cloudflare/workers-types@4.20260702.1)(@libsql/client@0.18.0)(@opentelemetry/api@1.10.0)))(ioredis@5.11.1(supports-color@8.1.1))) + specifier: ^0.6.0 + version: 0.6.0(forges@0.3.2)(rangi@2.2.0)(shiki@4.6.0)(unstorage@1.17.6(@vercel/functions@3.11.1(@aws-sdk/credential-provider-web-identity@3.972.49)(ws@8.22.2))(db0@0.3.4(@libsql/client@0.18.0)(drizzle-orm@0.45.4(@cloudflare/workers-types@4.20260702.1)(@libsql/client@0.18.0)(@opentelemetry/api@1.10.0)))(ioredis@5.11.1(supports-color@8.1.1))) date-fns: specifier: ^4.4.0 version: 4.4.0 @@ -5843,8 +5843,8 @@ packages: colortranslator@5.0.0: resolution: {integrity: sha512-Z3UPUKasUVDFCDYAjP2fmlVRf1jFHJv1izAmPjiOa0OCIw1W7iC8PZ2GsoDa8uZv+mKyWopxxStT9q05+27h7w==} - comark-content@0.5.1: - resolution: {integrity: sha512-82XwzlkAwzfhOzTBlK7gtFi6am/N6rAjfe2wDtSzeR1zuOxxnjwKy4kFn7cnZ3J8uWZ4uGRO8vtnu+bSHXlbtg==} + comark-content@0.6.0: + resolution: {integrity: sha512-3W5TwelX17/20uuYYA1moHkUCUBS97d5Z+qrFyv4UwRPKtjapmN9kth49NuhItVp0RH6sV3Do+QhP5k4R6XtVg==} hasBin: true peerDependencies: forges: ^0.3.0 @@ -16821,13 +16821,12 @@ snapshots: colortranslator@5.0.0: {} - comark-content@0.5.1(forges@0.3.2)(rangi@2.2.0)(shiki@4.6.0)(unstorage@1.17.6(@vercel/functions@3.11.1(@aws-sdk/credential-provider-web-identity@3.972.49)(ws@8.22.2))(db0@0.3.4(@libsql/client@0.18.0)(drizzle-orm@0.45.4(@cloudflare/workers-types@4.20260702.1)(@libsql/client@0.18.0)(@opentelemetry/api@1.10.0)))(ioredis@5.11.1(supports-color@8.1.1))): + comark-content@0.6.0(forges@0.3.2)(rangi@2.2.0)(shiki@4.6.0)(unstorage@1.17.6(@vercel/functions@3.11.1(@aws-sdk/credential-provider-web-identity@3.972.49)(ws@8.22.2))(db0@0.3.4(@libsql/client@0.18.0)(drizzle-orm@0.45.4(@cloudflare/workers-types@4.20260702.1)(@libsql/client@0.18.0)(@opentelemetry/api@1.10.0)))(ioredis@5.11.1(supports-color@8.1.1))): dependencies: comark: 0.9.0(rangi@2.2.0)(shiki@4.6.0) hookable: 6.1.2 pathe: 2.0.3 picomatch: 4.0.7 - slugify: 1.6.9 ufo: 1.6.4 optionalDependencies: forges: 0.3.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 73f08d081..0b77edc63 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -38,7 +38,7 @@ minimumReleaseAgeExclude: - nuxt-auth-utils@0.6.1 - '@comark/vue@0.9.0 || 0.9.1' - comark@0.9.0 - - comark-content@0.5.1 + - comark-content@0.5.1 || 0.6.0 permissions: '@nuxtjs/sitemap': diff --git a/test/fixtures/l10n/docs/4.api/2.composables/use-fetch.md b/test/fixtures/l10n/docs/4.api/2.composables/use-fetch.md index fcf2b3cc5..6511c4f0b 100644 --- a/test/fixtures/l10n/docs/4.api/2.composables/use-fetch.md +++ b/test/fixtures/l10n/docs/4.api/2.composables/use-fetch.md @@ -8,7 +8,7 @@ links: size: xs --- -This composable provides a convenient wrapper around [`useAsyncData`](/docs/api/composables/use-async-data) and [`$fetch`](/docs/api/utils/dollarfetch). +This composable provides a convenient wrapper around [`useAsyncData`](/docs/api/composables/use-async-data) and [`$fetch`](/docs/api/utils/$fetch). It automatically generates a key for the request, provides type hints for request url based on server routes, and infers API response type. ::note diff --git a/test/unit/docs.spec.ts b/test/unit/docs.spec.ts index ba0cc5455..0fd98b0c5 100644 --- a/test/unit/docs.spec.ts +++ b/test/unit/docs.spec.ts @@ -92,10 +92,10 @@ describe('docsLinks', () => { it('versions the Nuxt 2 docs links, `$nuxt` slug included', () => { const { nodes } = rewrite('2.x', [ ['a', { href: '/docs/guide/concepts/views' }], - ['read-more', { to: '/docs/api/internals/dollarnuxt' }] + ['read-more', { to: '/docs/api/internals/$nuxt' }] ]) expect(nodes[0]![1]).toEqual({ href: '/docs/2.x/guide/concepts/views' }) - expect(nodes[1]![1]).toEqual({ to: '/docs/2.x/api/internals/dollarnuxt' }) + expect(nodes[1]![1]).toEqual({ to: '/docs/2.x/api/internals/$nuxt' }) }) }) From dab710833158be97260de97e43c3930af68d2594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Wed, 11 Nov 2026 15:23:52 +0000 Subject: [PATCH 2/2] fix(content): bump content cache version for comark-content v0.6.0 paths Cached manifests from v0.5 still hold `dollarfetch` paths at the same commit, so a deploy would serve them until the cache expires. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cab2-3a25-7105-aff2-5e2968caf515 --- server/utils/content/cache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils/content/cache.ts b/server/utils/content/cache.ts index 82e4ff41c..c58b549e0 100644 --- a/server/utils/content/cache.ts +++ b/server/utils/content/cache.ts @@ -17,7 +17,7 @@ function cacheAvailable(): boolean { /** * Bump when content parser/plugin changes (TODO: automate this) */ -export const CONTENT_PARSER_VERSION = 'v10' +export const CONTENT_PARSER_VERSION = 'v11' /** * Driver backing one instance's manifest, parsed bodies and snapshot artifacts.