Skip to content

chore(deps): clear 195 of 236 dependency advisories (0 critical left) - #427

Merged
JosephSamirL merged 11 commits into
mainfrom
probe/dep-upgrade-audit
Aug 9, 2026
Merged

chore(deps): clear 195 of 236 dependency advisories (0 critical left)#427
JosephSamirL merged 11 commits into
mainfrom
probe/dep-upgrade-audit

Conversation

@abbaseya

@abbaseya abbaseya commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Takes the repo from 236 open advisories (3 critical / 105 high) to 41 (0 critical / 11 high),
measured with yarn npm audit --all --recursive --environment all — the same GitHub Advisory
data Dependabot reads (265 rows locally vs Dependabot's 266 alerts).

Targets main directly, to clear the Dependabot alerts on the default branch sooner. A
separate PR will carry the same work to main-convert afterwards.

Scope: none of this ships to customers

Every packages/* manifest declares an empty dependencies apart from js-sdk-utils → murmurhash. The runtime closure of the entire published SDK is that one package, so all 266
alerts trace to the demo apps and dev tooling, not to anything a customer installs.

peerDependencies are byte-identical to the base branch in all 11 published packages — only
devDependencies and the lockfile change here.

What changed

lockfile re-resolution (yarn up -R), no manifest edits clears 151 advisories on its own
next 16.0.1 → 16.3.0 clears the last critical (React flight protocol RCE)
wrangler 3 → 4, @nestjs/* → 11.1.28, @remix-run/* → 2.17.5, react-router-dom → 7.18.2 demo apps
nyc → 18, chai 4 → 6 test tooling
rollup-plugin-typescript2 0.36 → 0.37 build fix, see below

A note on the commit list

The branch was originally cut from main-convert, so it carries 7 commits of that branch's
history alongside the 4 dependency commits. They contribute no file changes
git diff origin/main...800473a is empty — so the 22 changed files here are exactly the
dependency work. Squash-merging collapses the history question entirely.

Two findings worth a look

chai was never the blocker. The 2025 note held chai at 4 because "version 5.x breaks the
unit tests". The actual cause is that chai ≥5 exports a sealed ES module namespace, so
chai.use(spies) can no longer attach .spy in place. Capturing what use() returns fixes it —
a 3-line change in packages/event/tests/event-manager.tests.ts. chai 6 then passes all 546
tests. chai-string also works fine on chai 6 despite advertising a ^4.1.2 peer range.

picomatch@2.3.2 silently breaks the build. The recursive refresh made
rollup-plugin-typescript2 go inert — it stopped both transforming and resolving, so rollup fell
back to parsing raw TypeScript as JavaScript. Symptoms differ per package (Could not resolve "./src/..." in enums, Expected ',', got ':' in js-sdk) but it is one plugin failing. Bisected
on a pristine clone with a single variable: yarn up -R picomatch on its own takes the build from
passing to failing. picomatch 2.3.1 → 2.3.2 is itself a required security bump, so holding it back
is not an option; rollup-plugin-typescript2@0.37.0 works with it. The test suite stays green
through the broken state
, so tests alone never catch this.

The 41 that remain

Each sits behind a parent already at its latest published version — these need the tool replaced,
not upgraded:

count blocked by
14 react-scripts@5.0.1 (demo/reactjs; unmaintained since 2022)
9 @remix-run v2 (superseded by React Router 7)
8 the jsdoc / better-docs docs chain in js-sdk
5 wrangler@4miniflareundici
5 mocha / nyc / browserify internals

Verification at 4b6bbdd

  • pass-qa green on CI
  • yarn install --immutable — passes
  • yarn build at the repo root — 50 bundles, exit 0
  • yarn lint in packages/js-sdk — clean
  • yarn test:mocha across all 10 test packages — 546 passing, 0 failing
  • yarn test:browser in packages/js-sdk47 passed

Two pre-existing issues found on the way, not fixed here

Repo-root yarn lint is red. It fails in packages/types (src/config/index.ts, generated
src/config/types.gen.ts). The pristine base gives 1674 errors; this branch gives 1676 — neither
file is touched here, and the 2-error delta is prettier moving 3.6.2 → 3.9.6 inside its existing
^3.6.2 range. pass-qa only lints packages/js-sdk, so CI has never exercised it.

yarn build leaves a dirty tree. generate-rollup-config.mjs rewrites each package's
source package.json, pinning peerDependencies to the current sibling workspace versions —
not just the generated lib/package.json. Any build silently rewrites tracked files, which is
easy to commit by accident. Worth separating.

🤖 Generated with Claude Code

github-actions Bot and others added 9 commits July 2, 2026 17:47
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Releases created by release-please use the default GITHUB_TOKEN, and
GitHub does not fire `on: release` workflows for events created with
that token — so publish-package.yml never auto-ran and every npm
publish had to be dispatched manually.

workflow_dispatch is an explicit exception to that rule, so the
release job now dispatches the existing publish-package.yml (the
single publishing path) once per released tag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts:
#	.release-please-manifest.json
#	packages/api/CHANGELOG.md
#	packages/api/package.json
#	packages/bucketing/CHANGELOG.md
#	packages/bucketing/package.json
#	packages/cloudflare/CHANGELOG.md
#	packages/cloudflare/package.json
#	packages/data/CHANGELOG.md
#	packages/data/package.json
#	packages/enums/CHANGELOG.md
#	packages/enums/package.json
#	packages/event/CHANGELOG.md
#	packages/event/package.json
#	packages/experience/CHANGELOG.md
#	packages/experience/package.json
#	packages/js-sdk/CHANGELOG.md
#	packages/js-sdk/package.json
#	packages/logger/CHANGELOG.md
#	packages/logger/package.json
#	packages/rules/CHANGELOG.md
#	packages/rules/package.json
#	packages/segments/CHANGELOG.md
#	packages/segments/package.json
#	packages/types/CHANGELOG.md
#	packages/types/package.json
#	packages/utils/CHANGELOG.md
#	packages/utils/package.json
…vert

chore: merge main into main-convert
Takes the repo from 236 open advisories (3 critical / 105 high) to 41
(0 critical / 11 high), measured with `yarn npm audit --all --recursive`.

No published package is affected either way: every packages/* manifest
declares an empty `dependencies` apart from js-sdk-utils -> murmurhash,
so the alerts all trace to the demo apps and dev tooling.

- lockfile re-resolution (`yarn up -R`) clears 151 advisories on its own,
  with no manifest edits
- next 16.0.1 -> 16.3.0 clears the last critical (React flight RCE)
- wrangler 3 -> 4, @nestjs/* -> 11.1.28, @remix-run/* -> 2.17.5,
  react-router-dom -> 7.18.2, nyc -> 18
- chai 4 -> 6 across every test package

chai >=5 exports a sealed ES module namespace, so `chai.use(spies)` can
no longer attach `.spy` in place. The event tests now capture what
`use()` returns instead. All 546 mocha tests pass.

The 41 remaining advisories sit behind parents that are already at their
latest published version: react-scripts@5.0.1 (14), @remix-run v2 (9),
the jsdoc/better-docs chain (8), wrangler -> miniflare -> undici (5),
mocha/nyc/browserify internals (5).

Known issue, not yet resolved: `yarn build` fails on packages/enums in
this state - rollup-plugin-typescript2 stops resolving relative imports
after the recursive lockfile refresh. Ruled out rollup, plugin-commonjs,
plugin-terser, glob, rollup-plugin-dts, dotenv, tslib, typescript, a
stale rpt2 cache and the @types auto-inclusion; the culprit is not yet
pinpointed. The test suite stays green through it, so tests alone do not
catch this.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The recursive lockfile refresh in the previous commit broke `yarn build`:
rollup-plugin-typescript2 silently stopped transforming and resolving,
so rollup fell back to parsing raw TypeScript as JavaScript. Symptoms
differed per package - `Could not resolve "./src/..."` in enums, and
`Expected ',', got ':'` in js-sdk - but both are the same plugin going
inert.

Bisected on a pristine clone with a single variable: `yarn up -R
picomatch` on its own takes the build from passing to failing.
picomatch 2.3.1 -> 2.3.2 is itself a required security bump (4 advisories),
so pinning it back is not an option.

rollup-plugin-typescript2 0.37.0 works with picomatch 2.3.2, so the fix
is to move the plugin forward rather than hold the transitive back.

Verified after the change:
- `yarn build` at the repo root: 50 bundles, exit 0
- `yarn lint` in packages/js-sdk: clean
- all 546 mocha tests across the 10 test packages: passing
- advisories unchanged at 41 (0 critical, 11 high), down from 236

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@abbaseya abbaseya self-assigned this Aug 8, 2026
@abbaseya
abbaseya requested a review from JosephSamirL August 8, 2026 15:39
abbaseya and others added 2 commits August 8, 2026 18:51
`yarn install --immutable` failed in CI (`pass-qa`) with YN0028: the
lockfile disagreed with the manifests.

Two defects, both mine:

1. The `yarn up` runs in the earlier commits rewrote `peerDependencies`
   across all 11 published packages as a side effect - tightening ranges
   like `@convertcom/js-sdk-types: ">=3.11.0"` to `">=4.0.0"` to match
   current workspace majors. That is a breaking change for consumers on
   older majors, and the exact opposite of what this branch claims: no
   published package should change at all here. All 47 peer ranges are
   restored to their `main-convert` values.

2. The lockfile was left internally inconsistent - yarn had rewritten the
   `packages/js-sdk` workspace entry's peer ranges but not the other ten,
   because it only rewrites entries it re-resolves. Resynced against the
   corrected manifests.

Only `devDependencies` differ from `main-convert` now, which is what the
advisory work actually needed.

Verified at this commit:
- `yarn install --immutable` - passes (the CI step that failed)
- `yarn build` at the repo root - 50 bundles, exit 0
- `yarn lint` in packages/js-sdk - clean
- 546 mocha tests across 10 packages - passing
- 47 browser tests - passing

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`pass-qa` still failed on `yarn install --immutable` (YN0028) after the
previous fix, because I had misdiagnosed the cause.

`generate-rollup-config.mjs` rewrites each package's **source**
`package.json` on every build, pinning `peerDependencies` to the current
sibling workspace versions:

    peerDependencies: {...info.peerDependencies, ...peerDependencies}
    writeFileSync(resolve(`${basePath}/package.json`), ...)

So `yarn build` - not `yarn up` - is what turned ranges like
`@convertcom/js-sdk-types: ">=3.11.0"` into `">=4.0.0"`. Running the
verification build and then `git add -A` swept that mutation into the
commit, while the lockfile still carried the ranges from before it. CI
installs before it builds, so a clean checkout disagrees with the
committed manifests every time.

All 47 peer ranges are back to their `main-convert` values and the
lockfile matches them. Only `devDependencies` differ from `main-convert`
now, which is all the advisory work needed - no published package
changes.

Note for whoever picks this up: the build mutating tracked source files
means any `yarn build` leaves a dirty tree. Worth separating the
generated `lib/package.json` from the source manifest, but that is out of
scope here.

Verified at this commit, with no build run afterwards:
- `yarn install --immutable` - passes (the failing CI step)
- peerDependencies byte-identical to origin/main-convert in all 11 packages

Build and test results from the same dependency state, before the
restore: 50 bundles, 546 mocha tests, 47 browser tests, lint clean.

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

sonarqubecloud Bot commented Aug 8, 2026

Copy link
Copy Markdown

@JosephSamirL
JosephSamirL merged commit 44f24d9 into main Aug 9, 2026
5 checks passed
@JosephSamirL
JosephSamirL deleted the probe/dep-upgrade-audit branch August 9, 2026 13:01
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