Fix remaining pnpm 11 audit handling - #102
Conversation
ritz078
left a comment
There was a problem hiding this comment.
Requesting changes on one item — the packageManager pin and the version: 10 in update-nutrient-sdk.yml need to land reconciled, details inline.
Worth flagging separately because it has no line to hang on: the green checks here don't cover any of this. playwright.yml installs no pnpm, and the run on this head logs ./scripts/install-dependencies.sh: line 13: pnpm: command not found for both pnpm examples; neither changed script is referenced by any workflow at the merge base. So no pnpm code path in this PR is exercised by PR CI, and the first real execution will be the scheduled bump job.
The underlying problem is real and the fix is the right one, for what it's worth — I verified a root pnpm install --frozen-lockfile fails on the pre-PR shape (ERR_PNPM_LOCKFILE_CONFIG_MISMATCH) and passes on this one, with the existing v9 lockfile unchanged.
- Export pnpm_config_minimum_release_age=0 in the bump and audit scripts: pnpm 11 defaults minimum-release-age to 24h and records an exclusion in the nearest pnpm-workspace.yaml for every fresher version it installs, which would rewrite the tracked example workspace files on every run. The env form also covers `pnpm audit --fix`, which ignores the --config flag. - Set verifyDepsBeforeRun: warn in the root workspace file and call tests/pnpm-workflows.test.sh directly in CI: pnpm 11 defaults the check to "install", so `pnpm run` (the pre-commit hook included) would install and possibly rewrite the tree before running anything. - Move the remaining root-level npm invocations (husky hook, e2e runner, README, PR template) to pnpm; export COREPACK_ENABLE_STRICT=0 from pnpm-helpers.sh and the Playwright web server for the npm calls that run inside the npm-based examples, and document it in AGENTS.md. - Name the failing example's reason in audit-dependencies.sh when the sibling workspace file is missing. - Extend the workflow test: structural check of the Setup pnpm step, npm/npx guard across all root-level files, and assertions for each of the above. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@nutrient-core-reviewer review |
ritz078
left a comment
There was a problem hiding this comment.
One thing with no line to hang on: the description doesn't mention install-dependencies.sh gaining set -euo pipefail. It's a real behaviour change — the first failing example now ends the run instead of being skipped — and it's what turns the release-age inconsistency below into a dead Playwright job rather than one uninstalled example. Defensible as fail-fast, worth stating as a deliberate call.
Approving on the strength of the rest: I verified the packageManager hash against the registry's dist.integrity, and CI on this head genuinely exercises the pnpm path for the first time.
Summary
packageManagerhash, and take the pnpm version from it in both workflows instead of an action input.pnpm-workspace.yaml(overrides plusallowBuilds/onlyBuiltDependencies) and setverifyDepsBeforeRun: warnsopnpm runnever installs implicitly.require_local_pnpm_workspace: apnpm-lock.yamlwithout a siblingpnpm-workspace.yamlfails loudly instead of silently binding to the root workspace.scripts/pnpm-helpers.sh);install-dependencies.shand the automated bump now fail fast instead of skipping later examples, while the aggregate audit script reports all failures and exits 1.pnpm audit --fix=overrideis now a real operation instead of the previous invalid, ignored subcommand. Automated SDK bumps can therefore include security overrides in each pnpm example'spnpm-workspace.yamland corresponding lockfile updates; generated bump PRs disclose this explicitly.minimumReleaseAge: 0in both pnpm example workspaces and export the same policy from their shared scripts, so automated writers, CI, and directpnpm installcalls consistently accept newly released SDK and transitive versions without writingminimumReleaseAgeExcludeentries.tests/pnpm-workflows.test.sh, and installs the pnpm examples. Root-level scripts, the husky hook, README, AGENTS.md and the PR template use pnpm;COREPACK_ENABLE_STRICT=0is set where the scripts and the Playwright web server run npm inside the npm-based examples.Validation
tests/pnpm-workflows.test.sh, including executable fail-fast/error fixtures and direct-workspace release-age assertionsminimumReleaseAgeExcludewrites reproduced and suppressed by the env opt-out; the Corepack npm rejection fromexamples/reactreproduced and lifted byCOREPACK_ENABLE_STRICT=0