feat(vue): add @modular-vue/cli scaffolder (PR-50) - #82
Conversation
Adds `@modular-vue/cli` (binary `modular-vue`), the Vue 3 + vue-router scaffolder, as a preset over the shared `cli-core` engine — the Vue counterpart of the React CLIs. The preset supplies Vue SFC template bodies (shell layout components, module pages, a route-zone detail panel, Home), a core-`createStore` `storeFile`, `@modular-vue/journeys` journey definition + persistence bodies, the `createSharedComposables` app-shared contract with the `RouteMeta` augmentation, and the `vue` / `vue-router` / `vue-tsc` package.json + tsconfig bodies. `init`, `create module`, `create store`, `create journey`, and `create catalog` all work; the generated shell owns the router via `createModularApp` with module routes grafted under a named `root` layout route. cli-core is now framework-pluggable at the package.json/entry-file layer: the preset gained a `scaffold` block carrying the entry/view extensions (`main.ts` + `.vue` vs `main.tsx` + `.tsx`) and optional overrides for the neutral package.json / tsconfig / root vitest.config bodies. `init.ts`, `create-module.ts`, and `transform.ts` read the entry filename and journeys binding name from the preset instead of hardcoding `main.tsx` / `@modular-react/journeys`. React presets set only `entryMain` / `viewExt`, so cli-core still emits its React-family defaults byte-identically — guarded by the existing react-router (16) and tanstack (11) snapshot tests, which stay green. Verified end-to-end in the workspace: a generated project typechecks clean across all five packages (`vue-tsc --noEmit`) and its module tests pass through `renderModule`. The CLI's own suite is 13 tests including a full-tree snapshot. Two framework-forced choices: module route paths are absolute (vue-router rejects relative top-level paths, and `renderModule` mounts `createRoutes()` output in isolation), and `AppZones` values are typed `UiComponent` (vue's broader `Component` fails `useZones`'s `ZoneMapOf` constraint). The shell-patterns doc is corrected accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0185QobcTYoTHWKLhwA3T1fV
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR adds the shipped ChangesVue CLI scaffolding
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Developer
participant modular-vue
participant vuePreset
participant GeneratedWorkspace
Developer->>modular-vue: run init or create command
modular-vue->>vuePreset: load scaffold configuration and templates
vuePreset->>GeneratedWorkspace: write Vue workspace files
modular-vue->>GeneratedWorkspace: wire modules, stores, and journeys
GeneratedWorkspace-->>Developer: generated project tree
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/vue-cli/package.json`:
- Around line 22-24: Update the test script in packages/vue-cli/package.json so
it builds the CLI before running Vitest, ensuring dist/cli.js exists for
cli.test.ts during a clean pnpm test. Reuse the existing build script and
preserve the current Vitest invocation.
- Around line 37-38: Update the node engine constraint in the packages/vue-cli
package.json engines configuration from >=22.0.0 to >=22.12.0, ensuring Vue CLI
users meet Vite 8.1.3’s supported runtime requirement.
In `@README.md`:
- Line 52: The Vue parity status in README.md should match the tracker’s
full-parity status. Update the `@modular-vue/`* description to remove the claim
that two follow-ups remain, while preserving the existing version and setup
guidance. Keep docs/vue-support-tracker.md:3-3 as the authoritative full-parity
status; no direct change is required there.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 82d6af98-bbe9-4e88-b2b1-350f9aee6fce
⛔ Files ignored due to path filters (2)
packages/vue-cli/test/__snapshots__/cli.test.ts.snapis excluded by!**/*.snappnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (25)
README.mddocs/getting-started-vue-router.mddocs/shell-patterns-vue-router.mddocs/vue-support-tracker.mdpackages/cli-core/src/commands/create-journey.tspackages/cli-core/src/commands/create-module.tspackages/cli-core/src/commands/create-store.tspackages/cli-core/src/commands/init.tspackages/cli-core/src/index.tspackages/cli-core/src/preset.tspackages/cli-core/src/utils/transform.tspackages/react-router-cli/src/preset.tspackages/tanstack-router-cli/src/preset.tspackages/vue-cli/README.mdpackages/vue-cli/package.jsonpackages/vue-cli/src/cli.tspackages/vue-cli/src/preset.tspackages/vue-cli/src/templates/app-shared.tspackages/vue-cli/src/templates/journey.tspackages/vue-cli/src/templates/module.tspackages/vue-cli/src/templates/scaffold.tspackages/vue-cli/src/templates/shell.tspackages/vue-cli/src/templates/store.tspackages/vue-cli/test/cli.test.tspackages/vue-cli/tsconfig.json
…next-phase-buv0ab # Conflicts: # docs/vue-support-tracker.md
…, sync docs - cli-core: add optional PresetPackages.journeysVersion so the shell's direct journeys dep can track the preset's own family version instead of falling back to the React RUNTIME_VERSIONS.journeys constant. React presets omit it and stay byte-identical (snapshot tests unchanged). - vue-cli: pin the shell's @modular-vue/journeys dep to the Vue family range (MODULAR_VUE_VERSION) via the new preset field, keeping it in sync with the generated journey packages from one source. - vue-cli: add standalone `create catalog` tests (wire into existing workspace + reject when already configured). - README: mark @modular-vue/* at full parity (both follow-ups PR-43/PR-44 have landed per the tracker). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018YU4kALmunKmR8YxLaqAz8
What & why
Ships PR-50 from the Vue support tracker:
@modular-vue/cli(binarymodular-vue), the Vue 3 + vue-router scaffolder, completing the tooling phase of the Vue initiative. It's a preset over the sharedcli-coreengine — the Vue counterpart of@react-router-modules/cli/@tanstack-react-modules/cli. With this, all three families scaffold through the same commands (init,create module|store|journey|catalog) and only the emitted code differs.New package
packages/vue-cli(@modular-vue/cli, 1.0.0). The preset supplies:<script setup>SFC template bodies: shell layout components (RootLayoutroot,ShellLayoutchrome with command slots + auseZonesdetail panel,Sidebar,Home), module pages, a route-zone detail panel.createStorestoreFile(decision D3) and auth/config stores.@modular-vue/journeysjourney definition +createWebStoragePersistencebodies.createSharedComposablesapp-shared contract, including the globalRouteMetaaugmentation for typedmeta.vue/vue-router/vue-tscpackage.json+tsconfigbodies and a rootvitest.config.ts(with@vitejs/plugin-vue).The generated shell owns the vue-router router and grafts module routes under a named
rootlayout route viacreateModularApp.Enabling
cli-corechange (the PR-04 follow-through). The preset gained ascaffoldblock carrying the entry/view file extensions (main.ts+.vuevsmain.tsx+.tsx) and optional overrides for the framework-neutralpackage.json/tsconfig/ root-vitest.config.tsbodies.init.ts,create-module.ts, andtransform.tsnow read the entry filename and the journeys binding name from the preset instead of hardcodingmain.tsx/@modular-react/journeys. React presets set onlyentryMain/viewExt, socli-corestill emits its React-family defaults byte-identically.Two framework-forced choices (documented inline + in the tracker):
/dashboard): vue-router rejects relative top-level paths, and@modular-vue/testing'srenderModulemounts a module'screateRoutes()output in isolation. An absolute child still renders inside the shell's<router-view>when grafted under the namedrootroute.AppZonesvalues are typedUiComponent, not vue'sComponent:useZones<AppZones>()'sZoneMapOfconstraint requires the neutralUiComponent, which an SFC default export satisfies but vue's broaderComponentunion does not.docs/shell-patterns-vue-router.mdis corrected to match.How it was verified
cli-corechanges.cli-testlabtests including a full generated-tree snapshot (init+create module/store/journey --persistence).vue-tsc --noEmitand the generated module tests pass throughrenderModule(with@vitejs/plugin-vuein the generated rootvitest.config.ts).oxlintclean on the new/changed files; affected packages typecheck.Checklist
pnpm lintpasses (typecheck + oxfmt + oxlint) for the changed packages.pnpm test— react 16, tanstack 11, vue 13).cli-corechange. Thecli-coreedits are framework-neutral (guarded by the byte-identical React snapshots); the Vue work is delivered here, closing PR-50 in the tracker. No further Vue follow-up needed.🤖 Generated with Claude Code
https://claude.ai/code/session_0185QobcTYoTHWKLhwA3T1fV
Generated by Claude Code
Summary by CodeRabbit
New Features
modular-vueCLI for scaffolding Vue 3 and Vue Router workspaces.Documentation