Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ Options:
--save-catalog Save the new dependency to the default catalog
--allow-build <NAMES> A list of package names allowed to run postinstall
--ignore-scripts Do not run lifecycle scripts
--no-optional Do not install optionalDependencies
--frozen-lockfile Fail if lockfile needs to be updated
--no-frozen-lockfile Allow lockfile updates
--lockfile-only Only update lockfile, don't install
--prefer-offline Use cached packages when available
--offline Only use packages already in cache
-f, --force Force reinstall all dependencies
--no-lockfile Don't read or generate lockfile
--shamefully-hoist Create flat node_modules (pnpm only)
--silent Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN> Filter packages in monorepo (can be used multiple times)
-w, --workspace-root Add to workspace root
--workspace Only add if package exists in workspace (pnpm-specific)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Options:
--save-catalog Save the new dependency to the default catalog
--allow-build <NAMES> A list of package names allowed to run postinstall
--ignore-scripts Do not run lifecycle scripts
--no-optional Do not install optionalDependencies
--frozen-lockfile Fail if lockfile needs to be updated
--no-frozen-lockfile Allow lockfile updates
--lockfile-only Only update lockfile, don't install
--prefer-offline Use cached packages when available
--offline Only use packages already in cache
-f, --force Force reinstall all dependencies
--no-lockfile Don't read or generate lockfile
--shamefully-hoist Create flat node_modules (pnpm only)
--silent Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN> Filter packages in monorepo (can be used multiple times)
-w, --workspace-root Add to workspace root
--workspace Only add if package exists in workspace (pnpm-specific)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Options:
--save-catalog Save the new dependency to the default catalog
--allow-build <NAMES> A list of package names allowed to run postinstall
--ignore-scripts Do not run lifecycle scripts
--no-optional Do not install optionalDependencies
--frozen-lockfile Fail if lockfile needs to be updated
--no-frozen-lockfile Allow lockfile updates
--lockfile-only Only update lockfile, don't install
--prefer-offline Use cached packages when available
--offline Only use packages already in cache
-f, --force Force reinstall all dependencies
--no-lockfile Don't read or generate lockfile
--shamefully-hoist Create flat node_modules (pnpm only)
--silent Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN> Filter packages in monorepo (can be used multiple times)
-w, --workspace-root Add to workspace root
--workspace Only add if package exists in workspace (pnpm-specific)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Options:
--save-catalog Save the new dependency to the default catalog
--allow-build <NAMES> A list of package names allowed to run postinstall
--ignore-scripts Do not run lifecycle scripts
--no-optional Do not install optionalDependencies
--frozen-lockfile Fail if lockfile needs to be updated
--no-frozen-lockfile Allow lockfile updates
--lockfile-only Only update lockfile, don't install
--prefer-offline Use cached packages when available
--offline Only use packages already in cache
-f, --force Force reinstall all dependencies
--no-lockfile Don't read or generate lockfile
--shamefully-hoist Create flat node_modules (pnpm only)
--silent Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN> Filter packages in monorepo (can be used multiple times)
-w, --workspace-root Add to workspace root
--workspace Only add if package exists in workspace (pnpm-specific)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Options:
--save-catalog Save the new dependency to the default catalog
--allow-build <NAMES> A list of package names allowed to run postinstall
--ignore-scripts Do not run lifecycle scripts
--no-optional Do not install optionalDependencies
--frozen-lockfile Fail if lockfile needs to be updated
--no-frozen-lockfile Allow lockfile updates
--lockfile-only Only update lockfile, don't install
--prefer-offline Use cached packages when available
--offline Only use packages already in cache
-f, --force Force reinstall all dependencies
--no-lockfile Don't read or generate lockfile
--shamefully-hoist Create flat node_modules (pnpm only)
--silent Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN> Filter packages in monorepo (can be used multiple times)
-w, --workspace-root Add to workspace root
--workspace Only add if package exists in workspace (pnpm-specific)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ Options:
A list of package names allowed to run postinstall
--ignore-scripts
Do not run lifecycle scripts
--no-optional
Do not install optionalDependencies
--frozen-lockfile
Fail if lockfile needs to be updated
--no-frozen-lockfile
Allow lockfile updates
--lockfile-only
Only update lockfile, don't install
--prefer-offline
Use cached packages when available
--offline
Only use packages already in cache
-f, --force
Force reinstall all dependencies
--no-lockfile
Don't read or generate lockfile
--shamefully-hoist
Create flat node_modules (pnpm only)
--silent
Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN>
Filter packages in monorepo (can be used multiple times)
-w, --workspace-root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Options:
--save-catalog Save the new dependency to the default catalog
--allow-build <NAMES> A list of package names allowed to run postinstall
--ignore-scripts Do not run lifecycle scripts
--no-optional Do not install optionalDependencies
--frozen-lockfile Fail if lockfile needs to be updated
--no-frozen-lockfile Allow lockfile updates
--lockfile-only Only update lockfile, don't install
--prefer-offline Use cached packages when available
--offline Only use packages already in cache
-f, --force Force reinstall all dependencies
--no-lockfile Don't read or generate lockfile
--shamefully-hoist Create flat node_modules (pnpm only)
--silent Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN> Filter packages in monorepo (can be used multiple times)
-w, --workspace-root Add to workspace root
--workspace Only add if package exists in workspace (pnpm-specific)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Options:
--save-catalog Save the new dependency to the default catalog
--allow-build <NAMES> A list of package names allowed to run postinstall
--ignore-scripts Do not run lifecycle scripts
--no-optional Do not install optionalDependencies
--frozen-lockfile Fail if lockfile needs to be updated
--no-frozen-lockfile Allow lockfile updates
--lockfile-only Only update lockfile, don't install
--prefer-offline Use cached packages when available
--offline Only use packages already in cache
-f, --force Force reinstall all dependencies
--no-lockfile Don't read or generate lockfile
--shamefully-hoist Create flat node_modules (pnpm only)
--silent Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN> Filter packages in monorepo (can be used multiple times)
-w, --workspace-root Add to workspace root
--workspace Only add if package exists in workspace (pnpm-specific)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Options:
--save-catalog Save the new dependency to the default catalog
--allow-build <NAMES> A list of package names allowed to run postinstall
--ignore-scripts Do not run lifecycle scripts
--no-optional Do not install optionalDependencies
--frozen-lockfile Fail if lockfile needs to be updated
--no-frozen-lockfile Allow lockfile updates
--lockfile-only Only update lockfile, don't install
--prefer-offline Use cached packages when available
--offline Only use packages already in cache
-f, --force Force reinstall all dependencies
--no-lockfile Don't read or generate lockfile
--shamefully-hoist Create flat node_modules (pnpm only)
--silent Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN> Filter packages in monorepo (can be used multiple times)
-w, --workspace-root Add to workspace root
--workspace Only add if package exists in workspace (pnpm-specific)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Options:
--save-catalog Save the new dependency to the default catalog
--allow-build <NAMES> A list of package names allowed to run postinstall
--ignore-scripts Do not run lifecycle scripts
--no-optional Do not install optionalDependencies
--frozen-lockfile Fail if lockfile needs to be updated
--no-frozen-lockfile Allow lockfile updates
--lockfile-only Only update lockfile, don't install
--prefer-offline Use cached packages when available
--offline Only use packages already in cache
-f, --force Force reinstall all dependencies
--no-lockfile Don't read or generate lockfile
--shamefully-hoist Create flat node_modules (pnpm only)
--silent Suppress Vite+ output and enable native silent mode where supported
--filter <PATTERN> Filter packages in monorepo (can be used multiple times)
-w, --workspace-root Add to workspace root
--workspace Only add if package exists in workspace (pnpm-specific)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Recursive pack writes child archives here while the root package is scanned.
*.tgz
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ steps = [
{ argv = ["vp", "pm", "pack"], comment = "should pack current workspace root" },
{ argv = ["vpt", "rm", "-f", "command-pack-pnpm10-with-workspace-1.0.0.tgz", "app-1.0.0.tgz", "vite-plus-test-utils-1.0.0.tgz"], snapshot = false, continue-on-failure = true },
{ argv = ["node", "-e", "const {execFileSync}=require('node:child_process');const out=JSON.parse(execFileSync('vp',['pm','pack','--recursive','--json'],{encoding:'utf8'}));out.sort((a,b)=>a.name<b.name?-1:a.name>b.name?1:0);console.log(JSON.stringify(out,null,2));"], comment = "should pack all packages in workspace (sorted by name for determinism)" },
["vpt", "print-file", "out.json"],
{ argv = ["vpt", "rm", "-f", "command-pack-pnpm10-with-workspace-1.0.0.tgz", "app-1.0.0.tgz", "vite-plus-test-utils-1.0.0.tgz"], snapshot = false, continue-on-failure = true },
{ argv = ["vp", "pm", "pack", "--filter", "app"], comment = "should pack specific package (uses --filter app pack)" },
{ argv = ["vpt", "rm", "-f", "command-pack-pnpm10-with-workspace-1.0.0.tgz", "app-1.0.0.tgz", "vite-plus-test-utils-1.0.0.tgz"], snapshot = false, continue-on-failure = true },
{ argv = ["node", "-e", "const {execFileSync}=require('node:child_process');const out=JSON.parse(execFileSync('vp',['pm','pack','--filter','app','--filter','@vite-plus-test/utils','--json'],{encoding:'utf8'}));out.sort((a,b)=>a.name<b.name?-1:a.name>b.name?1:0);console.log(JSON.stringify(out,null,2));"], comment = "should pack multiple packages (sorted by name for determinism)" },
["vpt", "print-file", "out.json"],
{ argv = ["vpt", "rm", "-f", "command-pack-pnpm10-with-workspace-1.0.0.tgz", "app-1.0.0.tgz", "vite-plus-test-utils-1.0.0.tgz"], snapshot = false, continue-on-failure = true },
{ argv = ["vp", "pm", "pack", "--out", "./dist/package.tgz"], comment = "should pack with output file" },
{ argv = ["vpt", "rm", "-rf", "./dist"], continue-on-failure = true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,8 @@ should pack all packages in workspace (sorted by name for determinism)
]
```

## `vpt print-file out.json`

**Exit code:** 1

```
out.json: not found
missing file
```
## `vpt rm -f command-pack-pnpm10-with-workspace-1.0.0.tgz app-1.0.0.tgz vite-plus-test-utils-1.0.0.tgz`

*(skipped 1 step(s) to the next line boundary: step failed)*

## `vp pm pack --filter app`

Expand Down Expand Up @@ -121,16 +113,8 @@ should pack multiple packages (sorted by name for determinism)
]
```

## `vpt print-file out.json`

**Exit code:** 1

```
out.json: not found
missing file
```
## `vpt rm -f command-pack-pnpm10-with-workspace-1.0.0.tgz app-1.0.0.tgz vite-plus-test-utils-1.0.0.tgz`

*(skipped 1 step(s) to the next line boundary: step failed)*

## `vp pm pack --out ./dist/package.tgz`

Expand All @@ -139,12 +123,10 @@ should pack with output file
```
📦 command-pack-pnpm10-with-workspace@1.0.0
Tarball Contents
app-1.0.0.tgz
package.json
packages/app/package.json
packages/utils/package.json
pnpm-workspace.yaml
vite-plus-test-utils-1.0.0.tgz
Tarball Details
<workspace>/dist/package.tgz
```
Expand All @@ -161,12 +143,10 @@ should pack with destination
```
📦 command-pack-pnpm10-with-workspace@1.0.0
Tarball Contents
app-1.0.0.tgz
package.json
packages/app/package.json
packages/utils/package.json
pnpm-workspace.yaml
vite-plus-test-utils-1.0.0.tgz
Tarball Details
<workspace>/dist/command-pack-pnpm10-with-workspace-1.0.0.tgz
```
Expand All @@ -183,12 +163,10 @@ should pack with gzip compression level
```
📦 command-pack-pnpm10-with-workspace@1.0.0
Tarball Contents
app-1.0.0.tgz
package.json
packages/app/package.json
packages/utils/package.json
pnpm-workspace.yaml
vite-plus-test-utils-1.0.0.tgz
Tarball Details
command-pack-pnpm10-with-workspace-1.0.0.tgz
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ steps = [
{ argv = ["node", "-e", "(async()=>{const fs=require('node:fs');const path=require('node:path');const file=path.join(process.env.VP_HOME,'cache','upgrade-check.json');const deadline=Date.now()+5000;for(;;){try{if(JSON.parse(fs.readFileSync(file,'utf8')).status==='available')return}catch{}if(Date.now()>=deadline)process.exit(1);await new Promise(resolve=>setTimeout(resolve,25))}})()"], snapshot = false },
{ argv = ["vpt", "grep-file", "$VP_HOME/cache/upgrade-check.json", '"status":"available"'], snapshot = false },
{ argv = ["vp", "env", "list", "--json"], comment = "Machine-readable output does not consume the pending notice.", snapshot = false },
{ argv = ["vpt", "write-file", "package.json", '{"name":"silent-add","private":true,"packageManager":"npm@11.13.0"}'], snapshot = false },
{ argv = ["vpt", "mkdir", "dep"], snapshot = false },
{ argv = ["vpt", "write-file", "dep/package.json", '{"name":"silent-add-dep","version":"1.0.0"}'], snapshot = false },
{ argv = ["vp", "add", "./dep", "--silent", "--save-catalog", "--lockfile-only"], comment = "Silent add suppresses compatibility diagnostics and leaves the cached update notice pending." },
{ argv = ["vpt", "stat-file", "package-lock.json", "--assert", "file"], snapshot = false },
{ argv = ["vp", "env", "off"], comment = "The next interactive command displays the cached update notice." },
{ argv = ["vp", "env", "off"], comment = "A subsequent command stays quiet after the notice timestamp is recorded." },
]
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ The foreground command launches the detached checker and returns without waiting
Machine-readable output does not consume the pending notice.


## `vpt write-file package.json '{"name":"silent-add","private":true,"packageManager":"npm@11.13.0"}'`


## `vpt mkdir dep`


## `vpt write-file dep/package.json '{"name":"silent-add-dep","version":"1.0.0"}'`


## `vp add ./dep --silent --save-catalog --lockfile-only`

Silent add suppresses compatibility diagnostics and leaves the cached update notice pending.

```
```

## `vpt stat-file package-lock.json --assert file`


## `vp env off`

The next interactive command displays the cached update notice.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { readFileSync } from 'node:fs';

const lockfile = readFileSync(process.argv[2]);
const original = readFileSync('before.lock');
if (!lockfile.equals(original)) {
process.exit(1);
}
console.log('lockfile unchanged');
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "install-option-dep",
"version": "2.0.0",
"description": "Updated dependency fixture"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "install-option-dep",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "install-package-options",
"version": "1.0.0",
"private": true,
"packageManager": "npm@11.13.0"
}
Loading
Loading