feat(v4)!: remove global install and wizard package#943
Conversation
Deploying nuxt-devtools with
|
| Latest commit: |
4fa96c4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://98a05d39.nuxt-devtools.pages.dev |
| Branch Preview URL: | https://antfu-remove-global-wizard.nuxt-devtools.pages.dev |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR removes the Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Remove is-installed-globally dependency and global install detection logic. Remove @nuxt/devtools-wizard package entirely. Inline enablePages functionality directly as an RPC function in the general server module instead of going through the wizard system. This is a breaking change for v4 that simplifies the codebase and removes the wizard CLI tool. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
7bb59a1 to
1a3b5c8
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/devtools/src/server-rpc/general.ts`:
- Around line 245-248: The early return when existsSync(pathPageIndex) causes
the function (enablePages) to skip the subsequent patching of app.vue, so
NuxtPage isn't injected for projects that already have pages/index.vue; remove
or alter the short-circuit so that detecting an existing pages/index.vue only
skips creation of that file but does not return from the function, and ensure
the patching logic that updates pathAppVue (injecting <NuxtPage /> into app.vue)
always runs; apply the same change to the other similar block (the second
existsSync check) so both code paths perform app.vue patching even when pages
files already exist.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 76bdb25e-fea8-40ee-a456-6865ec53adbe
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (25)
docs/content/2.module/3.migration-v4.mdpackages/devtools-kit/src/_types/index.tspackages/devtools-kit/src/_types/integrations.tspackages/devtools-kit/src/_types/options.tspackages/devtools-kit/src/_types/rpc.tspackages/devtools-kit/src/_types/server-ctx.tspackages/devtools-kit/src/_types/wizard.tspackages/devtools-wizard/build.config.tspackages/devtools-wizard/cli.mjspackages/devtools-wizard/package.jsonpackages/devtools-wizard/src/builtin.tspackages/devtools-wizard/src/index.tspackages/devtools/cli.mjspackages/devtools/client/pages/modules/pages.vuepackages/devtools/package.jsonpackages/devtools/src/dirs.tspackages/devtools/src/module-main.tspackages/devtools/src/module.tspackages/devtools/src/server-rpc/general.tspackages/devtools/src/server-rpc/index.tspackages/devtools/src/server-rpc/npm.tspackages/devtools/src/server-rpc/wizard.tspackages/devtools/src/wizard/enable-pages.tspackages/devtools/src/wizard/index.tspnpm-workspace.yaml
💤 Files with no reviewable changes (19)
- packages/devtools/src/server-rpc/npm.ts
- packages/devtools/cli.mjs
- packages/devtools-wizard/build.config.ts
- packages/devtools-wizard/src/index.ts
- packages/devtools/src/wizard/enable-pages.ts
- packages/devtools-kit/src/_types/integrations.ts
- packages/devtools-kit/src/_types/wizard.ts
- packages/devtools-wizard/package.json
- pnpm-workspace.yaml
- packages/devtools-kit/src/_types/server-ctx.ts
- packages/devtools-wizard/cli.mjs
- packages/devtools-wizard/src/builtin.ts
- packages/devtools-kit/src/_types/index.ts
- packages/devtools/src/dirs.ts
- packages/devtools-kit/src/_types/options.ts
- packages/devtools/src/wizard/index.ts
- packages/devtools/src/server-rpc/wizard.ts
- packages/devtools/package.json
- packages/devtools/src/server-rpc/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/devtools/src/module-main.ts
| if (existsSync(pathPageIndex)) { | ||
| logger.warn('pages/index.vue already exists, skipping') | ||
| return | ||
| } |
There was a problem hiding this comment.
Don’t short-circuit enablePages before patching app.vue.
On Line 247, returning when pages/index.vue exists skips Lines 259-264, so app.vue never gets <NuxtPage /> injected. This can leave “Enable Routing” as a no-op for projects that already have pages/index.vue but still render NuxtWelcome.
💡 Proposed control-flow fix
- if (existsSync(pathPageIndex)) {
- logger.warn('pages/index.vue already exists, skipping')
- return
- }
-
- const pagesIndexTemplate = `<script setup lang="ts">\nconst route = useRoute()\n</script>\n\n<template>\n <div>\n <h1>Nuxt Routing set up successfully!</h1>\n <p>Current route: {{ route.path }}</p>\n <a href="https://nuxt.com/docs/getting-started/routing" target="_blank">Learn more about Nuxt Routing</a>\n </div>\n</template>\n`
-
- await fs.mkdir(dirname(pathPageIndex), { recursive: true })
- await fs.writeFile(pathPageIndex, pagesIndexTemplate, 'utf-8')
+ if (existsSync(pathPageIndex)) {
+ logger.warn('pages/index.vue already exists, skipping file creation')
+ }
+ else {
+ const pagesIndexTemplate = `<script setup lang="ts">\nconst route = useRoute()\n</script>\n\n<template>\n <div>\n <h1>Nuxt Routing set up successfully!</h1>\n <p>Current route: {{ route.path }}</p>\n <a href="https://nuxt.com/docs/getting-started/routing" target="_blank">Learn more about Nuxt Routing</a>\n </div>\n</template>\n`
+ await fs.mkdir(dirname(pathPageIndex), { recursive: true })
+ await fs.writeFile(pathPageIndex, pagesIndexTemplate, 'utf-8')
+ }Also applies to: 259-264
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/devtools/src/server-rpc/general.ts` around lines 245 - 248, The
early return when existsSync(pathPageIndex) causes the function (enablePages) to
skip the subsequent patching of app.vue, so NuxtPage isn't injected for projects
that already have pages/index.vue; remove or alter the short-circuit so that
detecting an existing pages/index.vue only skips creation of that file but does
not return from the function, and ensure the patching logic that updates
pathAppVue (injecting <NuxtPage /> into app.vue) always runs; apply the same
change to the other similar block (the second existsSync check) so both code
paths perform app.vue patching even when pages files already exist.
Remove
is-installed-globallydependency and global install detection logic. Remove@nuxt/devtools-wizardpackage entirely. InlineenablePagesfunctionality directly as an RPC function in the general server module. This is a breaking change for v4 that simplifies the codebase by removing the wizard CLI tool and global install mode support.🤖 Generated with Claude Code