You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/create.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,10 +52,21 @@ Run `vp create --list` to see the built-in templates and the common shorthand te
52
52
-`--hooks` enables pre-commit hook setup
53
53
-`--no-hooks` skips hook setup
54
54
-`--package-manager <name>` uses a specified package manager (`pnpm`, `npm`, `yarn`, or `bun`)
55
+
-`--approve-builds` approves and runs gated dependency build scripts without prompting
55
56
-`--no-interactive` runs without prompts
56
57
-`--verbose` shows detailed scaffolding output
57
58
-`--list` prints the available built-in and popular templates
58
59
60
+
### Dependency build scripts
61
+
62
+
For security, pnpm, bun, and yarn (Berry) do not run a dependency's build scripts (`install` / `postinstall`, e.g. native builds like `better-sqlite3`) until you approve them. When a template adds such a dependency directly, `vp create` surfaces it after installing instead of leaving the project in a half-built state:
63
+
64
+
- Interactive: you are asked which of those dependencies to approve and build (nothing is selected by default).
65
+
- Non-interactive: a note lists them and points at `vp pm approve-builds`.
66
+
-`--approve-builds`: approves and builds them automatically, so non-interactive runs (CI) can produce a ready-to-use project.
67
+
68
+
Approval is recorded the way each package manager expects: pnpm's `allowBuilds`, bun's `trustedDependencies`, or yarn's `dependenciesMeta.<pkg>.built` (in the workspace root manifest). Transitive build scripts you did not choose (e.g. `esbuild` pulled in by Vite) are left at the package manager's defaults and are not surfaced. npm runs build scripts by default, so there is nothing to approve there.
69
+
59
70
## Template Options
60
71
61
72
Arguments after `--` are passed directly to the selected template.
> node $SNAP_CASES_DIR/.shared/mock-npm-registry.mjs -- vp create @your-org:with-build-dep --no-interactive --package-manager bun --directory default-app # default run surfaces the gated build with guidance, leaving it untrusted
38
+
39
+
Build scripts were not run for: core-js.
40
+
41
+
These dependencies may not work until built. Run vp pm approve-builds core-js in the project to approve them, or re-create with --approve-builds.
42
+
◇ Scaffolded default-app
43
+
• Node <semver> bun <semver>
44
+
✓ Dependencies installed in <variable>ms
45
+
→ Next: cd default-app && vp run
46
+
47
+
> cat default-app/package.json # no trustedDependencies, the build was not run
"node $SNAP_CASES_DIR/.shared/mock-npm-registry.mjs -- vp create @your-org:with-build-dep --no-interactive --approve-builds --package-manager bun --directory approved-app # --approve-builds runs `bun pm trust` for the gated build script (core-js)",
10
+
"cat approved-app/package.json # core-js recorded under trustedDependencies",
11
+
"node $SNAP_CASES_DIR/.shared/mock-npm-registry.mjs -- vp create @your-org:with-build-dep --no-interactive --package-manager bun --directory default-app # default run surfaces the gated build with guidance, leaving it untrusted",
12
+
"cat default-app/package.json # no trustedDependencies, the build was not run",
13
+
"cd default-app && vp pm approve-builds core-js # the guidance's `vp pm approve-builds` command approves the gated build",
14
+
"cat default-app/package.json # core-js is now recorded under trustedDependencies"
> node $SNAP_CASES_DIR/.shared/mock-npm-registry.mjs -- vp create @your-org:with-build-dep --no-interactive --approve-builds --directory approved-app # template ships Prettier, so create installs+migrates before the main install; the gated build (core-js) must still be surfaced and approved
2
+
3
+
Prettier detected in workspace packages but no root config found. Package-level Prettier must be migrated manually.
4
+
◇ Scaffolded approved-app
5
+
• Node <semver> pnpm <semver>
6
+
✓ Dependencies installed in <variable>ms
7
+
→ Next: cd approved-app && vp run
8
+
9
+
> cat approved-app/pnpm-workspace.yaml # approval recorded under allowBuilds despite the migration pre-install
10
+
allowBuilds:
11
+
core-js: true
12
+
catalog:
13
+
vite: npm:@voidzero-dev/vite-plus-core@latest
14
+
vitest: npm:@voidzero-dev/vite-plus-test@latest
15
+
vite-plus: latest
16
+
overrides:
17
+
vite: "catalog:"
18
+
vitest: "catalog:"
19
+
peerDependencyRules:
20
+
allowAny:
21
+
- vite
22
+
- vitest
23
+
allowedVersions:
24
+
vite: "*"
25
+
vitest: "*"
26
+
27
+
> node $SNAP_CASES_DIR/.shared/mock-npm-registry.mjs -- vp create @your-org:with-build-dep --no-interactive --directory default-app # default run surfaces the gated build with guidance, leaving it unapproved
28
+
29
+
Prettier detected in workspace packages but no root config found. Package-level Prettier must be migrated manually.
30
+
31
+
Build scripts were not run for: core-js.
32
+
33
+
These dependencies may not work until built. Run vp pm approve-builds in the project to approve them, or re-create with --approve-builds.
34
+
◇ Scaffolded default-app
35
+
• Node <semver> pnpm <semver>
36
+
✓ Dependencies installed in <variable>ms
37
+
→ Next: cd default-app && vp run
38
+
39
+
> cat default-app/pnpm-workspace.yaml # no allowBuilds, the build was not run
40
+
allowBuilds:
41
+
core-js: set this to true or false
42
+
catalog:
43
+
vite: npm:@voidzero-dev/vite-plus-core@latest
44
+
vitest: npm:@voidzero-dev/vite-plus-test@latest
45
+
vite-plus: latest
46
+
overrides:
47
+
vite: "catalog:"
48
+
vitest: "catalog:"
49
+
peerDependencyRules:
50
+
allowAny:
51
+
- vite
52
+
- vitest
53
+
allowedVersions:
54
+
vite: "*"
55
+
vitest: "*"
56
+
57
+
> cd default-app && vp pm approve-builds core-js # the guidance's `vp pm approve-builds` command approves the gated build
0 commit comments