Skip to content

chore: patch dependency advisories and drop bun.lock - #284

Open
marc0olo wants to merge 3 commits into
mainfrom
chore/security-updates-drop-bun-lock
Open

marc0olo wants to merge 3 commits into
mainfrom
chore/security-updates-drop-bun-lock

Conversation

@marc0olo

@marc0olo marc0olo commented Sep 14, 2026

Copy link
Copy Markdown
Member

Clears all 24 open Dependabot alerts (1 critical, 13 high, 8 moderate, 2 low) and supersedes #275 and #283.

Dependency updates

vite^7.3.5, vitest^4.1.11 (the two direct-dep advisories), plus pnpm.overrides entries for the 21 transitive ones. pnpm audit is clean afterwards.

Also drops the minimumReleaseAgeExclude: [vite] entry, which was annotated "remove after 2026-04-16" — vite 7.3.5 is well past the 7-day threshold.

Why bun.lock is removed

Three of the four controls added in #263 are pnpm-only — pnpm.overrides, minimumReleaseAge, onlyBuiltDependencies. Bun reads none of them, so bun.lock was resolving a second dependency graph that silently bypassed the hardening:

pnpm.overrides target pnpm-lock.yaml bun.lock
brace-expansion@>=1 <2^1.1.13 1.1.13 1.1.12
brace-expansion@>=2 <2.0.3^2.0.3 2.0.3 2.0.2
picomatch@>=2 <3^2.3.2 2.3.2 2.3.1
picomatch@>=4 <4.0.44.0.4 4.0.4 4.0.3
yaml@>=2 <2.8.32.8.3 2.8.3 2.8.2

It also can't be kept current: Dependabot supports bun for version updates but not security updates, so every security PR updated package.json + pnpm-lock.yaml only, leaving bun.lock stale and failing the required bun i --frozen-lockfile step. That's what sank both #275 and #283, and it would sink every future one.

e2e_test_bun now installs with pnpm and still runs setup, build, build:examples and test:examples under bun, so bun runtime coverage is unchanged. What's given up is coverage of bun's resolver — acceptable for a library whose consumers resolve it themselves, and whose published tarball depends only on @icp-sdk/core, bip39 and json-with-bigint (none flagged). Verified locally that bun run setup and bun run build work against the pnpm tree.

Consumer-facing bun support is untouched — docs/guides/using-bun.mdx still applies.

Docs

README.md and examples/README.md both told contributors to install with bun i. With bun.lock gone that resolves an ungoverned graph — the same problem this PR fixes — so both now install with pnpm, and bun is documented as a test runner over that install.

Both guides also omitted the pocket-ic download. .npmrc sets ignore-scripts=true, so the postinstall that fetches the binary never runs on a plain install; pnpm run setup is now an explicit step. Verified by deleting the binary: pnpm i does not restore it, pnpm run setup does. (Caught by Copilot review — the first revision of this PR had the same gap.)

The two CI badges pointed at test-nodejs.yml and test-bun.yml, neither of which exists; collapsed to the one real workflow. Happy to split the docs changes out if you'd rather keep the PR to dependencies.

Verified

  • pnpm audit — 0 vulnerabilities
  • pnpm i --frozen-lockfile — lockfile up to date
  • pnpm test:pic — 65 passed
  • pnpm format:check — clean
  • bun run setup, bun run build — pass against the pnpm tree
  • vitest list on the counter example collects under 4.1.11

Example e2e suites need the canister toolchain, so those run in CI.

🤖 Generated with Claude Code

Clears all 24 open Dependabot alerts.

Bumps vite and vitest, and extends pnpm.overrides to cover the remaining
transitive advisories.

Removes bun.lock. pnpm.overrides, minimumReleaseAge and onlyBuiltDependencies
are pnpm-only, so bun.lock resolved a second, ungoverned dependency graph that
bypassed them — it still pinned the exact brace-expansion, picomatch and yaml
versions the overrides exist to exclude. Dependabot cannot maintain it either:
bun is supported for version updates but not security updates, so every
security PR left bun.lock stale and failed `bun i --frozen-lockfile`.

The bun job now installs via pnpm and still builds and tests with bun, so
runtime coverage is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 14, 2026 12:07
@marc0olo
marc0olo requested a review from a team as a code owner September 14, 2026 12:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

README setup documentation still has two unresolved issues involving PocketIC setup and pnpm instructions.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR patches dependency advisories, standardizes installs on pnpm, and retains Bun runtime testing.

Changes:

  • Updates direct and transitive dependencies through pnpm overrides.
  • Removes the stale bun.lock and updates Bun CI installation.
  • Refreshes contributor setup instructions and workflow badges.
File summaries
File Summary Findings
README.md Updates setup instructions and badges. Nit (3 votes): Add the explicit PocketIC setup step before the Bun suite. Nit (2 votes): Update the linked examples/README.md to use pnpm instead of bun i.
pnpm-workspace.yaml Removes the temporary Vite release-age exemption. None.
pnpm-lock.yaml Records patched dependency resolutions. None.
package.json Upgrades dependencies and adds pnpm overrides. None.
.github/workflows/e2e-test-nodejs.yml Installs dependencies with pnpm for Bun runtime tests. None.
Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 4/6 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md Outdated
Comment thread README.md Outdated
`.npmrc` sets ignore-scripts=true, so the postinstall that downloads the
pocket-ic binary never runs on a plain install. Both setup guides now call
`pnpm run setup` explicitly.

examples/README.md offered `bun i` as an alternative install, which resolves a
dependency graph that bypasses pnpm.overrides and the release-age policy. Bun is
now documented as a test runner over a pnpm install.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Outstanding documentation and dependency-rationale corrections must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (2)

examples/README.md:43

  • This instruction refers to commands “that follow,” but the build and test commands to be run with Bun are all above this paragraph and nothing follows it. As written, the guide still tells a Bun user to run the preceding pnpm commands; point the instruction at the commands above (or move it before them).
Dependencies are always installed with pnpm so that `pnpm.overrides` and the
release-age policy apply. To run the suites with [bun](https://bun.sh/) instead,
keep the `pnpm i` above and replace `pnpm` with `bun` in the commands that follow.

package.json:59

  • The resolver comparison in the PR description is stale relative to this change: it says the pnpm graph uses brace-expansion 1.1.13/2.0.3 and overrides ^1.1.13/^2.0.3, but this file now uses ^1.1.16/^2.1.2 and the lockfile resolves 1.1.18/2.1.4. Please update that table so the security rationale accurately describes the graph being merged.
      "brace-expansion@>=1.0.0 <2.0.0": "^1.1.16",
      "brace-expansion@>=2.0.0 <2.1.2": "^2.1.2",
  • Files reviewed: 5/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread README.md Outdated
The root README implied `build` was enough to run the example suites, but it
only builds packages/pic. The tests import generated `declarations/`, which are
gitignored and produced by `build:examples`. The root guide now points at
examples/README.md rather than duplicating the sequence.

examples/README.md notes that `build:examples` needs the ICP CLI toolchain and
must run before the tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 5/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants