Skip to content

Commit cb7ea48

Browse files
authored
docs: host the dev devframes in Nuxt DevTools v4 (#439)
1 parent cc6907c commit cb7ea48

6 files changed

Lines changed: 784 additions & 704 deletions

File tree

‎docs/nuxt.config.ts‎

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,25 @@ export default defineNuxtConfig({
3131
},
3232
},
3333

34-
// Dev only: production builds never resolve the hub or its devframes.
35-
// Factories defer the plugin imports, so `docs:build` needs no built workspace packages.
34+
// Dev only: mount the devframes into Nuxt DevTools. The imports are lazy,
35+
// so `docs:build` needs no built workspace packages.
3636
$development: {
37-
modules: [['@devframes/nuxt/hub', {
38-
quiet: true,
39-
devframes: [
40-
() => import('@devframes/plugin-a11y').then(m => m.createA11yDevframe()),
41-
() => import('@devframes/plugin-og').then(m => m.createOgDevframe({ defaultUrl: 'http://localhost:5175' })),
42-
],
43-
}]],
37+
// DevTools v4 sets `noExternals` to an array when it is unset. Nitro 2 reads
38+
// any truthy value as "inline everything" and fails on `playwright-core`.
39+
nitro: { noExternals: false },
40+
modules: [
41+
async () => {
42+
const [{ onDevtoolsReady }, { createA11yDevframe }, { createOgDevframe }] = await Promise.all([
43+
import('@nuxt/devtools-kit'),
44+
import('@devframes/plugin-a11y'),
45+
import('@devframes/plugin-og'),
46+
])
47+
onDevtoolsReady(async (kit) => {
48+
await kit.install(createA11yDevframe())
49+
await kit.install(createOgDevframe({ defaultUrl: 'http://localhost:5175' }))
50+
})
51+
},
52+
],
4453
},
4554

4655
app: {

‎docs/package.json‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
"shiki": "catalog:deps"
2525
},
2626
"devDependencies": {
27-
"@devframes/hub": "workspace:*",
28-
"@devframes/hub-ui": "workspace:*",
29-
"@devframes/nuxt": "workspace:*",
3027
"@devframes/plugin-a11y": "workspace:*",
3128
"@devframes/plugin-og": "workspace:*",
29+
"@nuxt/devtools-kit": "catalog:docs",
3230
"@types/d3-shape": "catalog:types",
3331
"devframe": "workspace:*"
3432
}

‎knip.jsonc‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@
5151
// referenced as the `@shikijs/magic-move/style.css` subpath in the
5252
// `nuxt.config.ts` `css` array; knip can't map that CSS-only subpath back
5353
// to the package, so it mis-reports the (genuinely-listed) dep as unlisted.
54-
//
55-
// `@devframes/nuxt` is named as a string in the `$development.modules`
56-
// array, and `@devframes/hub` / `@devframes/hub-ui` are its optional
57-
// peers (the dev hub and its default dock UI), so nothing imports them.
58-
"ignoreDependencies": ["ai", "@ai-sdk/vue", "@comark/nuxt.*", "@nuxt/ui.*", "@shikijs/magic-move", "@devframes/nuxt", "@devframes/hub", "@devframes/hub-ui"]
54+
"ignoreDependencies": ["ai", "@ai-sdk/vue", "@comark/nuxt.*", "@nuxt/ui.*", "@shikijs/magic-move"]
5955
},
6056
"examples/custom-hub-next": {
6157
// The React client build's root sits at `src/client` (`next dev

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"watch": "turbo watch build --concurrency=3",
2121
"play": "tsx scripts/play.ts",
2222
"dev": "tsx scripts/play.ts",
23-
"docs": "turbo run build --filter=devframe-docs^... && pnpm -C docs run docs",
23+
"docs": "turbo run build --filter=./packages/* --filter=./plugins/* && pnpm -C docs run docs",
2424
"docs:build": "pnpm -C docs run docs:build",
2525
"docs:serve": "pnpm -C docs run docs:serve",
2626
"storybook": "pnpm -C storybook dev",

0 commit comments

Comments
 (0)