Skip to content

Commit 6079f1b

Browse files
antfubotopencodeantfu
authored
feat(playgrounds): add ecosystem dogfooding playground for plan 04 (#1022)
Co-authored-by: opencode <noreply@opencode.ai> Co-authored-by: Anthony Fu <github@antfu.me>
1 parent 5f27cba commit 6079f1b

13 files changed

Lines changed: 12186 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: ecosystem-playground
2+
3+
# Manual-trigger only smoke check for playgrounds-ecosystem/modules/ — NOT
4+
# part of the default push/pull_request CI path. See
5+
# playgrounds-ecosystem/README.md and playgrounds-ecosystem/REPORTS.md for
6+
# context (nuxt/devtools#1022).
7+
on:
8+
workflow_dispatch:
9+
10+
jobs:
11+
smoke:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 15
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: pnpm/action-setup@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: lts/*
20+
- run: npm install -g corepack@latest
21+
- run: corepack enable
22+
# playgrounds-ecosystem/modules/ links @nuxt/devtools via
23+
# `link:../../packages/devtools` (this repo's own build, not the npm
24+
# registry) — so the root workspace needs to be installed + stubbed
25+
# first for that path to resolve. `prepare` (stub build) is enough:
26+
# Nuxt DevTools no-ops entirely outside `dev` mode
27+
# (packages/devtools/src/module-main.ts), so a `build` here can't
28+
# exercise anything devtools-specific anyway — this is purely a "does
29+
# the module combo still build" signal, not a full `pnpm build`.
30+
- run: pnpm install
31+
- run: pnpm run prepare
32+
- run: pnpm -C playgrounds-ecosystem/modules install
33+
- name: Build the module combo
34+
run: pnpm -C playgrounds-ecosystem/modules run build

‎eslint.config.mjs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export default antfu(
99
ignores: [
1010
'**/.generated/**',
1111
'**/plans/**/*.md',
12+
// Its own sealed pnpm workspace (see
13+
// playgrounds-ecosystem/modules/pnpm-workspace.yaml), opt-in and out of
14+
// the main lint/typecheck/test surface — see
15+
// plans/vite-devtools-integration/04-ecosystem-playgrounds.md
16+
'**/playgrounds-ecosystem/**',
1217
],
1318
},
1419
{

‎playgrounds-ecosystem/README.md‎

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Ecosystem dogfooding playground
2+
3+
Dogfoods the Nuxt DevTools integrations of three popular Nuxt modules — all in
4+
one combined app — against the **local** `@nuxt/devtools` (this repo's
5+
`packages/devtools`), for verification while working through
6+
[`plans/vite-devtools-integration/`](../plans/vite-devtools-integration/).
7+
8+
Modules covered, in [`modules/`](./modules/): `nuxt-og-image`, `@nuxt/scripts`,
9+
`@nuxt/fonts`. See [`REPORTS.md`](./REPORTS.md) for what was actually found
10+
running each of them — including `@nuxt/content` and `@nuxt/image`, which
11+
were tried and then removed: neither registers a DevTools tab in the versions
12+
tested, so there was nothing to dogfood against.
13+
14+
> Why one combined playground instead of one per module, and why only three of
15+
> the originally-considered seven modules? Grouping keeps the review surface
16+
> small (this repo's own `docs/` app already proves `@nuxt/content` +
17+
> `@nuxt/fonts` + `@nuxt/image` + `nuxt-og-image` coexist safely). Two were
18+
> dropped before implementation: `@nuxthub/core` (out of scope) and
19+
> `@nuxtjs/tailwindcss` (a real version conflict — it hard-depends on
20+
> Tailwind v3, while `nuxt-og-image` lists Tailwind v4 as an optional peer).
21+
> Two more, `@nuxt/content` and `@nuxt/image`, were built in and dogfooded
22+
> first, then dropped once that run showed neither has a DevTools tab to test
23+
> — see [`REPORTS.md`](./REPORTS.md#modules-removed-after-testing) for the
24+
> evidence. The former standalone "plan 04" doc this all comes from has since
25+
> been retired in favor of this directory being the living implementation —
26+
> see nuxt/devtools#1022 for the full history.
27+
28+
## Opt-in — not part of the main install or CI
29+
30+
This directory is **not** in the root `pnpm-workspace.yaml` `packages:` list,
31+
and `modules/` has its **own** `pnpm-workspace.yaml` + lockfile, sealed off
32+
from the root one. A plain `pnpm install` at the repo root never touches this
33+
directory.
34+
35+
`@nuxt/devtools` in `modules/package.json` is a
36+
`link:../../packages/devtools` dependency — **this repo's own build, never
37+
the npm registry** — so before installing this workspace, make sure the root
38+
one is installed and at least stubbed:
39+
40+
```sh
41+
pnpm install # repo root, if you haven't already
42+
pnpm run prepare # stubs packages/devtools/dist (fast; enough to resolve)
43+
pnpm -C playgrounds-ecosystem/modules install
44+
```
45+
46+
(Use `pnpm run build` instead of `prepare` if you want the real static
47+
DevTools client — see below.)
48+
49+
## Running it against the local devtools
50+
51+
```sh
52+
cd playgrounds-ecosystem/modules
53+
NUXT_DEVTOOLS_LOCAL=true pnpm run dev
54+
```
55+
56+
(`dev` already binds to `0.0.0.0` — see `package.json`.)
57+
58+
Omitting `NUXT_DEVTOOLS_LOCAL` still uses this repo's own `@nuxt/devtools`
59+
(via the `link:` dependency above), just without the special
60+
HMR-client-over-a-subprocess wrapper `../../local` provides — it serves
61+
whatever's currently built at `packages/devtools/dist/client`. If that's only
62+
a stub (`pnpm run prepare`), there's no client to serve and DevTools won't
63+
render; run `pnpm run build` at the repo root first to get the real static
64+
client, then this path shows the same UI without the dev-mode HMR overhead —
65+
useful for an A/B comparison against the `NUXT_DEVTOOLS_LOCAL=true` path.
66+
67+
## Opening DevTools and authorizing it
68+
69+
Vite DevTools 0.4 gates its connection behind a one-time authorization:
70+
71+
1. Open the app (`http://localhost:3000/`) in a browser.
72+
2. Click the small floating dock toggle (top-left) — it initially shows an
73+
amber **"Unauthorized"** badge.
74+
3. Find the line `devframe auth code NNNNNN` printed in the terminal running
75+
`nuxt dev`, and type those 6 digits into the prompt (or use the printed
76+
magic link instead).
77+
4. The dock now shows real entries: **Vite+** (Rolldown), **Nuxt DevTools**,
78+
**Inspect**, plus a **Settings** cog.
79+
80+
Click the Nuxt-logo entry to open the embedded Nuxt DevTools client. From
81+
there:
82+
83+
- **Overview → `N modules`** lists every installed module with its setup
84+
time — confirms all three ecosystem modules loaded.
85+
- Each module's own tab is **not** in the SideNav's visible icon strip — check
86+
the **"⋯" overflow menu** at the bottom of the SideNav. As of this report,
87+
that's where `nuxt-og-image`, `@nuxt/scripts`, and `@nuxt/fonts`'s tabs
88+
live.
89+
90+
Don't navigate directly to `http://localhost:3000/__nuxt_devtools__/client/`
91+
in a plain tab expecting the same result — that bypasses the RPC handshake the
92+
embedded dock sets up and breaks module detection (see `REPORTS.md`).
93+
94+
## Recording findings
95+
96+
Update [`REPORTS.md`](./REPORTS.md) with what you find: does a module's tab
97+
appear, does it load without console errors, does it show any Plan 00
98+
deprecation diagnostics, and an overall verdict. That report is the raw
99+
material for upstream issues/PRs to each module.
100+
101+
## Automated smoke check (optional, manual trigger only)
102+
103+
`.github/workflows/ecosystem-playground.yml` is `workflow_dispatch`-only — it
104+
installs the root workspace, stubs `packages/devtools` (`pnpm run prepare`),
105+
installs this workspace, and runs `nuxt build` as a cheap "did the module
106+
combo break" signal. It deliberately doesn't run the full `pnpm build` or set
107+
`NUXT_DEVTOOLS_LOCAL` — DevTools no-ops outside `dev` mode, so build-mode
108+
can't exercise anything devtools-specific anyway, and the cheap stub is
109+
enough for the module to resolve. It is **not** part of the default CI path;
110+
trigger it manually from the Actions tab when you want a sanity check without
111+
dogfooding by hand.

0 commit comments

Comments
 (0)