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
2 changes: 1 addition & 1 deletion .github/actions/deploy-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ inputs:
runs:
using: 'composite'
steps:
- uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # main
- uses: voidzero-dev/setup-vp@3754dd7dbdb32bd8f6d28b6043de13ad3a75f21f # v1.21.1
with:
cache: true
working-directory: docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-docs-fork-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
# Build the same commit that workflow_run.head_sha identifies.
ref: ${{ github.event.pull_request.head.sha }}

- uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1.20.0
- uses: voidzero-dev/setup-vp@3754dd7dbdb32bd8f6d28b6043de13ad3a75f21f # v1.21.1
with:
working-directory: docs
cache: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Packages: -1
-

dependencies:
- testnpm2 1.0.1
- testnpm2
```

## `vpt print-file package.json`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Packages: -1
-

dependencies:
- testnpm2 1.0.1
- testnpm2
```

## `vpt print-file package.json`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Packages: -1
-

dependencies:
- testnpm2 1.0.1
- testnpm2
```

## `vpt print-file package.json`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Packages: -1
-

dependencies:
- testnpm2 1.0.1
- testnpm2
testnpm2 1.0.0 <- ../test-lib-pnpm
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Packages: -1
-

dependencies:
- testnpm2 1.0.1
- testnpm2
testnpm2 1.0.0 <- ../test-lib-pnpm
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Packages: -1
-

dependencies:
- testnpm2 1.0.1
- testnpm2
testnpm2 1.0.0 <- ../test-lib-pnpm
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Packages: -1
-

devDependencies:
- test-vite-plus-package 1.0.0
- test-vite-plus-package
```

## `vpt print-file package.json`
Expand Down Expand Up @@ -111,7 +111,7 @@ Packages: -1
-

optionalDependencies:
- test-vite-plus-package-optional 1.0.0
- test-vite-plus-package-optional

devDependencies:
test-vite-plus-package 1.0.0
Expand Down Expand Up @@ -148,7 +148,7 @@ Packages: -1
optionalDependencies: skipped

devDependencies:
- test-vite-plus-package 1.0.0
- test-vite-plus-package
```

## `vpt print-file package.json`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Packages: -1
-

devDependencies:
- test-vite-plus-package 1.0.0
- test-vite-plus-package
```

## `vpt print-file package.json`
Expand Down Expand Up @@ -110,7 +110,7 @@ Packages: -1
-

optionalDependencies:
- test-vite-plus-package-optional 1.0.0
- test-vite-plus-package-optional

devDependencies:
test-vite-plus-package 1.0.0
Expand Down Expand Up @@ -147,7 +147,7 @@ Packages: -1
optionalDependencies: skipped

devDependencies:
- test-vite-plus-package 1.0.0
- test-vite-plus-package
```

## `vpt print-file package.json`
Expand Down
7 changes: 6 additions & 1 deletion crates/vp_cli_snapshots/tests/cli_snapshots/redact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ static PNPM_STORE_INFO_RE: LazyLock<regex::Regex> = LazyLock::new(|| {
// pnpm reads a removed package's manifest concurrently with unlinking the
// package, so its removal summary may omit the version. Strip that version
// within dependency sections of pnpm output; keep names and added versions.
// `pnpm dedupe` omits the Done footer, so also recognize its removal count.
static PNPM_REMOVAL_COUNT_RE: LazyLock<regex::Regex> =
LazyLock::new(|| regex::Regex::new(r"(?m)^Packages: -\d+\n").unwrap());
static PNPM_DEPENDENCY_SECTION_RE: LazyLock<regex::Regex> = LazyLock::new(|| {
regex::Regex::new(
r"(?m)^(?:dependencies|devDependencies|optionalDependencies):\n(?:[^\n]+\n?)*",
Expand Down Expand Up @@ -630,7 +633,9 @@ pub fn redact_output(
output = PNPM_PROGRESS_RE.replace_all(&output, "").into_owned();
output = PNPM_STORE_INFO_RE.replace_all(&output, "").into_owned();

if output.contains("Done in <duration> using pnpm <version>") {
if output.contains("Done in <duration> using pnpm <version>")
|| PNPM_REMOVAL_COUNT_RE.is_match(&output)
{
output = PNPM_DEPENDENCY_SECTION_RE
.replace_all(&output, |caps: &regex::Captures| {
PNPM_REMOVED_VERSION_RE.replace_all(&caps[0], "${1}").into_owned()
Expand Down
15 changes: 15 additions & 0 deletions crates/vp_cli_snapshots/tests/redact_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,21 @@ fn normalizes_pnpm_removed_dependency_versions() {
}
}

#[test]
fn normalizes_pnpm_dedupe_removed_versions_without_done_line() {
for section in ["dependencies", "devDependencies", "optionalDependencies"] {
for version in [" 1.0.0", "", " 1.0.0-beta.1+build.2"] {
let input = format!(
"Packages: -2\n--\n\n{section}:\n- testnpm2{version}\n- @scope/pkg{version}\n testnpm2 1.0.1\n\n- after-section 3.0.0\n"
);
let expected = format!(
"Packages: -2\n--\n\n{section}:\n- testnpm2\n- @scope/pkg\n testnpm2 1.0.1\n\n- after-section 3.0.0\n"
);
assert_eq!(redact_output(input, &[], true), expected);
}
}
}

#[test]
fn preserves_pnpm_added_versions_and_text_outside_dependency_sections() {
let input = concat!(
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const VITEST_VERSION = '5.0.1';

// Exact action release used by generated workflows and the @v1 migration.
// The Renovate custom manager keeps this value current.
export const SETUP_VP_VERSION = 'v1.21.0';
export const SETUP_VP_VERSION = 'v1.21.1';

export const TSDOWN_MIGRATION_SKILL_URL =
'https://github.com/rolldown/tsdown/blob/main/skills/tsdown-migrate/SKILL.md';
Expand Down
Loading