Skip to content

feat(TD-9488): EOL deps — Node 22, js-yaml 4, bunyan→pino (Phases 0 + 1b) - #169

Merged
VDubber merged 4 commits into
td-9488/npm-migrationfrom
td-9488/eol-upgrades
Oct 21, 2026
Merged

VDubber merged 4 commits into
td-9488/npm-migrationfrom
td-9488/eol-upgrades

Conversation

@VDubber

@VDubber VDubber commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Stacked on #168 (yarn→npm migration). EOL dependency upgrades for TD-9488.

Phase 0 — runtime + js-yaml

  • .nvmrc (22) + engines: ">=22" — pin off EOL Node 18/20
  • js-yaml 3.13.1 → 4.3.2 (clears a high advisory); safeLoad → load at j1cli.ts:207

Phase 1b — kill the inflight chain (bunyan → pino)

  • Replaced bunyan-category with pino ^8.21.0
  • inflight / mv / rimraf@2 / glob@6 gone from the production tree — the chain TD-9488 called out
  • Logger is now an exported structural interface ({trace,debug,info,warn,error,fatal}); any bunyan/pino-style logger still satisfies it
  • Dropped @types/bunyan; removed the .npmrc legacy-peer-deps shim (no longer needed)

⚠️ BREAKING: Logger type changed from bunyan's to the exported structural interface; runtime logs drop the category field. See PUBLIC-API.md §6b.

Status

  • 72 tests green (34 PollyJS + 38 nock), tsc build clean under TS 3.8
  • Production npm audit: 322 → 4 across the stack (0 critical). Remaining 4 (lodash, brace-expansion, minimatch, tmp/inquirer) resolve in Phase 2 (apollo) + the TS/jest toolchain bump
  • Public contract validated via diff PUBLIC-API.baseline.d.ts dist/index.d.ts; only the approved Logger change

NOT in this PR — Phase 2 (Apollo + graphql) needs a decision

graphql@14.7.0 (named in TD-9488) + the 5 apollo-* packages are the remaining EOL core.
Blocked on: (a) a TypeScript upgrade first (Apollo 3/4 types won't parse under TS 3.8), and
(b) choosing the Apollo target. Tracked for the next PR.

🤖 Generated with Claude Code

@VDubber
VDubber requested a review from a team as a code owner October 20, 2026 21:28
@socket-security

socket-security Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpino@​8.21.09910010091100
Updatedjs-yaml@​3.13.1 ⏵ 4.3.2100 +1100 +3110095100

View full report

Comment thread src/index.ts Outdated
Comment thread src/j1cli.ts
Comment thread package.json
Comment thread package.json
VDubber and others added 3 commits October 20, 2026 22:48
- Add .nvmrc (22) and package.json engines ">=22" to pin the runtime
  (CI was on EOL Node 18; local was EOL Node 20).
- Bump js-yaml ^3.13.1 -> ^4.3.2 (resolves a known high advisory).
  Migrate the single call site j1cli.ts: yaml.safeLoad -> yaml.load
  (js-yaml 4 renamed safeLoad to load; load is safe by default).

Public API contract unchanged (diff vs PUBLIC-API.baseline.d.ts clean),
72 tests green, tsc build clean under TS 3.8.

Transitive-vuln overrides intentionally deferred to Phase 1a: npm audit fix
overreaches into the dev tree and pulls a modern @types/babel__traverse that
TS 3.8 cannot parse. The residual prod vulns (0 critical) are resolved by the
later phases (apollo removal, bunyan optional-dep drop, inquirer patch).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Removes the inflight memory-leak chain from the consumer dependency tree:
bunyan-category -> bunyan -> mv -> rimraf@2.4.5 -> glob@6.0.4 -> inflight.
(npm `overrides` cannot fix this for a published library, so the logger
itself had to change.)

- Replace `bunyan-category` with `pino ^8.21.0` (pino 8 types parse under
  the current TS 3.8). inflight / mv / rimraf@2 / glob@6 gone from the prod tree.
- Export a minimal structural `Logger` interface + `LogFn` from the package.
  `JupiterOneClientOptions.logger` now types against it. Any bunyan/pino-style
  logger still satisfies it, so most consumers are unaffected.
- Drop `@types/bunyan`; remove `.npmrc` legacy-peer-deps=true (it only existed
  for bunyan-category's exact @types/bunyan@1.8.6 peer, now gone — npm installs
  cleanly under strict peer resolution again).

BREAKING CHANGE: `Logger` is now an exported structural interface rather than
bunyan's type. Consumers who imported bunyan's `Logger` or relied on bunyan-only
methods must adjust; runtime log output no longer includes the `category` field.

Public contract baseline updated (PUBLIC-API.baseline.d.ts, PUBLIC-API.md §6b).
Prod audit 7 -> 4 vulns. 72 tests green, tsc build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…yaml pin

- HIGH: declare the exported `Logger` members as methods instead of
  `name: LogFn` properties. Property-typed function members are checked
  contravariantly under `strictFunctionTypes`, which rejects bunyan/pino
  loggers and would turn the documented no-op upgrade into a compile error for
  any consumer on `strict: true`. Method signatures are bivariant, so
  overloaded loggers satisfy the interface again (verified under --strict with
  TS 5.9). `LogFn` is still exported for standalone use.
- Move the 3.0.0 version bump to this PR (the first branch that introduces a
  breaking change: Node 22 engines + the Logger type change), so the release
  workflow can never publish those as a patch if the stack lands out of order.
- Add src/yaml-parsing.test.ts pinning the js-yaml 4 (YAML 1.2 core schema)
  scalar behavior the CLI relies on (0777 -> 777 decimal, 12:30 -> string),
  guarding the silent 1.1->1.2 parsing change. (MIGRATING note added in the
  Phase 2 PR.)
- Drop the remaining internal deadline reference from DEPENDENCY-AUDIT.md.

75 tests green (72 + 3 yaml), tsc build clean under TS 3.8, contract baseline
updated for the Logger method shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VDubber
VDubber force-pushed the td-9488/eol-upgrades branch from 7e09fb2 to 1f605a2 Compare October 21, 2026 15:01
tom-foley-j1
tom-foley-j1 previously approved these changes Oct 21, 2026
Keep the feature stack at 2.1.2 so merging #168-#171 to main does not trigger
the version-gated auto-publish mid-stack. The 3.0.0 bump + npm publish happen in
a dedicated release PR merged last, matching this repo's release-X.Y.Z
convention (cf. #165 release-2.1.2, #161 release-2.0.1). CHANGELOG 3.0.0 notes
and MIGRATING-v3.md remain in the feature PRs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VDubber
VDubber merged commit d9b8b48 into main Oct 21, 2026
6 checks passed
@VDubber
VDubber deleted the td-9488/eol-upgrades branch October 21, 2026 17:35
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