Skip to content

chore(TD-9488): migrate yarn→npm + nock coverage net - #168

Merged
VDubber merged 2 commits into
mainfrom
td-9488/npm-migration
Oct 21, 2026
Merged

VDubber merged 2 commits into
mainfrom
td-9488/npm-migration

Conversation

@VDubber

@VDubber VDubber commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

TD-9488 — Groundwork before EOL dependency upgrades

Foundation PR. No runtime behavior change — sets up a clean package manager + a test safety net so the Apollo/graphql/node EOL upgrades (follow-up PRs) can be validated.

Package manager: yarn → npm

  • yarn.lock removed, package-lock.json generated
  • De-yarned all package.json scripts, .husky/pre-commit, lint-staged
  • CI (build.yml): npm ci / npm run build, setup-node@v4, Node 22 (was EOL 18)
  • .npmrc legacy-peer-deps=true — bunyan-category pins exact @types/bunyan@1.8.6; removed once bunyan-category is replaced (Phase 1b)

Test coverage net (nock)

  • New src/index.nock.test.ts — 38 tests covering previously-untested Apollo graphClient methods (entity/relationship/question CRUD, integration instances, endpoint routing)
  • src/index.ts coverage 41.6% → 64.6%
  • Existing PollyJS tests untouched (PollyJS unmaintained — kept, not extended)
  • All 72 tests green under npm

Planning + contract docs

  • DEPENDENCY-AUDIT.md — phased EOL remediation plan + live status
  • PUBLIC-API.md — frozen consumer contract + §6a Apollo-4-sensitive behaviors
  • PUBLIC-API.baseline.d.ts — machine-diffable type snapshot at v2.1.2 (diff after each upgrade phase); excluded from tsc/eslint

Security

  • npm audit: 322 → 35 vulns from the fresh dedup'd install (remaining high/critical handled via overrides in the next PR)

Next PRs (TD-9488, by Nov 1)

  1. Phase 0 — .nvmrc, engines, js-yaml 3→4, overrides for residual vulns
  2. Phase 1b — kill inflight chain (drop bunyan optional deps)
  3. Phase 2 — Apollo 2→4 + graphql 14→16, validated vs the baseline .d.ts

🤖 Generated with Claude Code

Groundwork before the EOL dependency upgrades (TD-9488):

- Migrate package manager yarn -> npm: regenerate lockfile as
  package-lock.json, de-yarn all package.json scripts, husky pre-commit,
  and lint-staged. CI switched to npm ci / npm run build, setup-node@v4,
  Node 22. Add .npmrc legacy-peer-deps=true for bunyan-category's exact
  @types/bunyan@1.8.6 peer (to be removed when bunyan-category is replaced).
- Add src/index.nock.test.ts: 38 nock-based tests covering the previously
  untested Apollo graphClient methods (create/update/delete entity,
  relationship, question, integration instances, etc.). Raises src/index.ts
  coverage 41.6% -> 64.6%. Safety net for the Apollo 2 -> 4 migration.
  Existing PollyJS tests left untouched.
- Add planning + contract docs: DEPENDENCY-AUDIT.md (phased EOL plan),
  PUBLIC-API.md (frozen consumer contract + Apollo-4-risk behaviors),
  PUBLIC-API.baseline.d.ts (machine-diffable type snapshot at v2.1.2),
  excluded from tsc/eslint.

npm audit drops 322 -> 35 from the fresh dedup'd install.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread package.json
Comment thread DEPENDENCY-AUDIT.md Outdated
…interim

- Remove the Jira assignee name and internal ship deadline from
  DEPENDENCY-AUDIT.md (this is a public repo; that metadata is permanent in
  history once merged and belongs on the ticket, not here).
- Note that nock is pinned to ^11 as an interim because nock 14's types do not
  parse under TypeScript 3.8; it is bumped to ^14 in Phase 1a once TS 5.x lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
VDubber added a commit that referenced this pull request 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/npm-migration branch October 21, 2026 17:35
@VDubber VDubber mentioned this pull request Oct 21, 2026
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