Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
323b0cd
fix(cli): offer local generator packages in the create template picker
fengmk2 Jun 7, 2026
9482410
docs(guide): document code generators powered by Bingo templates
fengmk2 Jun 7, 2026
0133204
docs(contributing): document local validation testing against a real …
fengmk2 Jun 7, 2026
2aebc03
fix(cli): update bingo to 0.9.3 and fix generator template execution
fengmk2 Jun 7, 2026
a55b48b
test(cli): add snap test covering generator scaffold and execution
fengmk2 Jun 7, 2026
2a9652b
docs(contributing): pnpm link persists as an override
fengmk2 Jun 7, 2026
8b667bd
docs(guide): drop generator dev-loop block from create guide
fengmk2 Jun 7, 2026
2f329fe
refactor(cli): extract shared isBingoTemplate predicate
fengmk2 Jun 7, 2026
82eafb1
test(tools): strip clack spinner frames from snap output
fengmk2 Jun 7, 2026
1e2ec3e
test(cli): update new-vite-monorepo snap for generator template changes
fengmk2 Jun 7, 2026
18e658d
fix(cli): reject local template packages without a bin entry
fengmk2 Jun 7, 2026
0080cda
fix(cli): place local generator output next to the generator package
fengmk2 Jun 8, 2026
b678f77
refactor(cli): share the local-package lookup in discovery
fengmk2 Jun 8, 2026
c193d18
fix(cli): require an explicit marker for template picker visibility a…
fengmk2 Jun 8, 2026
4ccd074
Merge branch 'main' into fix/create-picker-local-generators
fengmk2 Jun 8, 2026
2afe664
fix(cli): co-locate output for any local generator, including bingo-d…
fengmk2 Jun 8, 2026
aa6b1be
Fixup
fengmk2 Jun 8, 2026
6196e82
Merge branch 'main' into fix/create-picker-local-generators
fengmk2 Jun 8, 2026
d956219
Merge branch 'main' into fix/create-picker-local-generators
fengmk2 Jun 9, 2026
773ebe1
feat(cli): make create.templates the source of truth for local templates
fengmk2 Jun 9, 2026
d42c10e
test(cli): snap coverage for create.templates and generator auto-regi…
fengmk2 Jun 9, 2026
2eff460
docs: document create.templates and config-based local generators
fengmk2 Jun 9, 2026
c321ae6
Merge remote-tracking branch 'origin/main' into fix/create-picker-loc…
fengmk2 Jun 9, 2026
8639a83
fix(cli): skip git init prompt when adding a package to an existing m…
fengmk2 Jun 9, 2026
d05c385
refactor(cli): read the create config in a single evaluation
fengmk2 Jun 9, 2026
08c8473
refactor(cli): replace vite.config.ts edit via the shared config merger
fengmk2 Jun 9, 2026
73378a9
refactor(cli): reuse getConfiguredCreate in register-template
fengmk2 Jun 9, 2026
a46b097
feat(cli): resolve relative-path create.templates entries
fengmk2 Jun 9, 2026
17bb421
feat(cli): register generators by relative path, not package name
fengmk2 Jun 9, 2026
454a1f9
refactor(cli): unify local template dir resolution, fix Windows co-lo…
fengmk2 Jun 9, 2026
7a125af
Merge remote-tracking branch 'origin/main' into fix/create-picker-loc…
fengmk2 Jun 9, 2026
2104b27
fix(cli): register generators into any vite config extension
fengmk2 Jun 9, 2026
60add4e
fix(cli): harden create.templates registration and org resolution
fengmk2 Jun 9, 2026
a9a2fc3
fix(cli): format the registered config in the monorepo format pass
fengmk2 Jun 9, 2026
caeb863
fix(cli): upsert create config strictly and gate local template resol…
fengmk2 Jun 10, 2026
045ebc8
Merge remote-tracking branch 'origin/main' into fix/create-picker-loc…
fengmk2 Jun 10, 2026
a073012
test(cli): expect forward-slash package paths on all platforms
fengmk2 Jun 10, 2026
a7a04ad
Merge remote-tracking branch 'origin/main' into fix/create-picker-loc…
fengmk2 Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,45 @@ vp --version

This builds all packages, compiles the Rust `vp` binary, and installs the CLI to `~/.vite-plus`.

## Validate the local build against a real project

Unit and snap tests don't cover everything. Interactive flows in particular (prompts, pickers, scaffolding) are easiest to validate by running your work-in-progress CLI inside a real Vite+ project.

First, understand how `vp` picks which `vite-plus` to run: for JS-backed commands (such as `vp create`), the global `vp` binary resolves `vite-plus` from the project's `node_modules` first and only falls back to the global installation in `~/.vite-plus`. If your test project has `vite-plus` installed from npm, `pnpm bootstrap-cli` alone will not make it run your local code.

Build the local CLI package after each change:

```bash
pnpm -F vite-plus build # TypeScript + native NAPI binding
pnpm -F vite-plus build-ts # faster, when only TypeScript changed
```

### `pnpm link` the local package

Link your checkout into the test project. The global `vp` then delegates to the project-local CLI, and re-entrant `vp` sub-commands (for example `vp create` running `vp install` and `vp fmt` after scaffolding) resolve back to the same linked checkout:

```bash
cd /path/to/test-project
pnpm link /path/to/vite-plus/packages/cli

vp create # now runs your local checkout
```

Verify the link with `ls -l node_modules/vite-plus` (it should be a symlink into your checkout). Notes:

- pnpm records the link as a `vite-plus: link:...` override (in `pnpm-workspace.yaml` for workspace projects, otherwise under `pnpm.overrides` in `package.json`), so it survives later installs. Don't commit that override in the test project.
- `pnpm link` may also add a `packageManager` field to the test project's `package.json`; revert it if unwanted.
- Undo with `pnpm unlink vite-plus`, or remove the override and run `pnpm install`.

### Global CLI (Rust) changes

`pnpm link` only swaps the JS side; the `vp` binary on `PATH` (and the Rust-backed commands it handles directly, such as package-manager commands) is still whatever is installed in `~/.vite-plus`. For changes to the Rust global CLI (`crates/`), install it from source, and combine with `pnpm link` when the change spans both layers:

```bash
pnpm bootstrap-cli
vp --version
```

## Workflow for build and test

You can run this command to build, test and check if there are any snapshot changes:
Expand Down
3 changes: 2 additions & 1 deletion crates/vite_migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ pub use file_walker::{WalkResult, find_ts_files};
pub use import_rewriter::{BatchRewriteResult, rewrite_imports_in_directory};
pub use package::{rewrite_eslint, rewrite_prettier, rewrite_scripts};
pub use vite_config::{
MergeResult, has_config_key, merge_json_config, merge_tsdown_config, wrap_lazy_plugins,
MergeResult, has_config_key, merge_json_config, merge_tsdown_config, upsert_json_config,
wrap_lazy_plugins,
};
Loading
Loading