diff --git a/.github/actions/deploy-docs/action.yml b/.github/actions/deploy-docs/action.yml index e03892e6b7..2a2839a6da 100644 --- a/.github/actions/deploy-docs/action.yml +++ b/.github/actions/deploy-docs/action.yml @@ -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 diff --git a/.github/workflows/build-docs-fork-preview.yml b/.github/workflows/build-docs-fork-preview.yml index ca14f774bd..d6314ec670 100644 --- a/.github/workflows/build-docs-fork-preview.yml +++ b/.github/workflows/build-docs-fork-preview.yml @@ -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 diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm10/snapshots/command_dedupe_pnpm10.global.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm10/snapshots/command_dedupe_pnpm10.global.md index e33a3196a2..c7765c45cf 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm10/snapshots/command_dedupe_pnpm10.global.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm10/snapshots/command_dedupe_pnpm10.global.md @@ -157,7 +157,7 @@ Packages: -1 - dependencies: -- testnpm2 1.0.1 +- testnpm2 ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm10/snapshots/command_dedupe_pnpm10.local.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm10/snapshots/command_dedupe_pnpm10.local.md index 809c986364..ce73150ec7 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm10/snapshots/command_dedupe_pnpm10.local.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm10/snapshots/command_dedupe_pnpm10.local.md @@ -153,7 +153,7 @@ Packages: -1 - dependencies: -- testnpm2 1.0.1 +- testnpm2 ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm11/snapshots/command_dedupe_pnpm11.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm11/snapshots/command_dedupe_pnpm11.md index 67206700f6..675f11c0c4 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm11/snapshots/command_dedupe_pnpm11.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_pnpm11/snapshots/command_dedupe_pnpm11.md @@ -157,7 +157,7 @@ Packages: -1 - dependencies: -- testnpm2 1.0.1 +- testnpm2 ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm10/snapshots/command_link_pnpm10.global.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm10/snapshots/command_link_pnpm10.global.md index b8f0015bec..26d4f35ba7 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm10/snapshots/command_link_pnpm10.global.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm10/snapshots/command_link_pnpm10.global.md @@ -56,7 +56,7 @@ Packages: -1 - dependencies: -- testnpm2 1.0.1 +- testnpm2 testnpm2 1.0.0 <- ../test-lib-pnpm ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm10/snapshots/command_link_pnpm10.local.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm10/snapshots/command_link_pnpm10.local.md index d38e8029ec..25aeac2942 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm10/snapshots/command_link_pnpm10.local.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm10/snapshots/command_link_pnpm10.local.md @@ -51,7 +51,7 @@ Packages: -1 - dependencies: -- testnpm2 1.0.1 +- testnpm2 testnpm2 1.0.0 <- ../test-lib-pnpm ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm11/snapshots/command_link_pnpm11.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm11/snapshots/command_link_pnpm11.md index f892c5a356..eb4ccd8f48 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm11/snapshots/command_link_pnpm11.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_pnpm11/snapshots/command_link_pnpm11.md @@ -56,7 +56,7 @@ Packages: -1 - dependencies: -- testnpm2 1.0.1 +- testnpm2 testnpm2 1.0.0 <- ../test-lib-pnpm ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_pnpm10/snapshots/command_prune_pnpm10.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_pnpm10/snapshots/command_prune_pnpm10.md index 3e7f85dbc7..b87c80ef2b 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_pnpm10/snapshots/command_prune_pnpm10.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_pnpm10/snapshots/command_prune_pnpm10.md @@ -79,7 +79,7 @@ Packages: -1 - devDependencies: -- test-vite-plus-package 1.0.0 +- test-vite-plus-package ``` ## `vpt print-file package.json` @@ -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 @@ -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` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_pnpm11/snapshots/command_prune_pnpm11.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_pnpm11/snapshots/command_prune_pnpm11.md index eb4d3f2f17..8f5f2834bb 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_pnpm11/snapshots/command_prune_pnpm11.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_pnpm11/snapshots/command_prune_pnpm11.md @@ -78,7 +78,7 @@ Packages: -1 - devDependencies: -- test-vite-plus-package 1.0.0 +- test-vite-plus-package ``` ## `vpt print-file package.json` @@ -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 @@ -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` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/redact.rs b/crates/vp_cli_snapshots/tests/cli_snapshots/redact.rs index ca4b7ad0ba..50d83699f9 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/redact.rs +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/redact.rs @@ -244,6 +244,9 @@ static PNPM_STORE_INFO_RE: LazyLock = 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 = + LazyLock::new(|| regex::Regex::new(r"(?m)^Packages: -\d+\n").unwrap()); static PNPM_DEPENDENCY_SECTION_RE: LazyLock = LazyLock::new(|| { regex::Regex::new( r"(?m)^(?:dependencies|devDependencies|optionalDependencies):\n(?:[^\n]+\n?)*", @@ -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 using pnpm ") { + if output.contains("Done in using pnpm ") + || PNPM_REMOVAL_COUNT_RE.is_match(&output) + { output = PNPM_DEPENDENCY_SECTION_RE .replace_all(&output, |caps: ®ex::Captures| { PNPM_REMOVED_VERSION_RE.replace_all(&caps[0], "${1}").into_owned() diff --git a/crates/vp_cli_snapshots/tests/redact_unit.rs b/crates/vp_cli_snapshots/tests/redact_unit.rs index 93cfb880a4..2143a39bd0 100644 --- a/crates/vp_cli_snapshots/tests/redact_unit.rs +++ b/crates/vp_cli_snapshots/tests/redact_unit.rs @@ -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!( diff --git a/packages/cli/src/utils/constants.ts b/packages/cli/src/utils/constants.ts index 34ab71f236..e4a707477c 100644 --- a/packages/cli/src/utils/constants.ts +++ b/packages/cli/src/utils/constants.ts @@ -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';