Skip to content

fix: resolve npm security vulnerabilities and migrate to ESLint flat config - #40

Merged
StevanFreeborn merged 7 commits into
masterfrom
stevanfreeborn/fix/update-deps
Jul 29, 2026
Merged

fix: resolve npm security vulnerabilities and migrate to ESLint flat config#40
StevanFreeborn merged 7 commits into
masterfrom
stevanfreeborn/fix/update-deps

Conversation

@StevanFreeborn

Copy link
Copy Markdown
Owner
  • Upgrade all vulnerable packages: eslint 8→10, mocha 10→11, nyc 15→18,
    typedoc 0.25→0.28, typescript 4→6, @typescript-eslint/* 5→8
  • Remove deprecated eslint-config-standard-with-typescript (blocked upgrade path)
  • Migrate from .eslintrc to eslint.config.mjs (flat config)
  • Drop unused error variable in ArgumentValidator.ts catch clause
  • Add overrides for brace-expansion and serialize-javascript (no mocha version
    ships patched copies of these transitive deps)

…config

- Upgrade all vulnerable packages: eslint 8→10, mocha 10→11, nyc 15→18,
  typedoc 0.25→0.28, typescript 4→6, @typescript-eslint/* 5→8
- Remove deprecated eslint-config-standard-with-typescript (blocked upgrade path)
- Migrate from .eslintrc to eslint.config.mjs (flat config)
- Drop unused `error` variable in ArgumentValidator.ts catch clause
- Add overrides for brace-expansion and serialize-javascript (no mocha version
  ships patched copies of these transitive deps)
- Add Node 22.x, 24.x, 26.x to CI test matrix
- Add rimraf@4.4.1 override to support Node 14 with nyc@18
…ode 14 from CI

- Replace bare `export { baseURL, apiKey }` in integrationTests/mochaRootHooks.ts
  with getBaseUrl()/getApiKey() getters so imports read the live closure
  variable set by beforeAll instead of capturing undefined at require time
- Update all 22 integration spec files to import and call the getter functions
- Keep nyc@^18.0.0, brace-expansion@5.0.8, uuid@11.1.1 overrides (0 vulns)
- Remove rimraf override (was only needed for Node 14 / npm 6 incompatibility)
- Remove Node 14.x from CI test matrix (npm 6 ignores overrides, can't install
  rimraf v5+) but keep engines >=14.x for production consumers
- Add ignoreDeprecations: "6.0" to tsconfig.json for moduleResolution=node10
… integration tests

On Node 22+ Linux, ESM detection intercepts .ts files loaded via mocha's -r
flag before ts-node's CJS hook fires, causing mochaRootHooks.ts to not
execute its top-level dotenv.config() and register mochaHooks. Env vars
never loaded, beforeAll never ran, and getter functions threw.

- Replace getter exports with direct process.env reads in all spec files
- Use -r dotenv/config (plain JS, no ts-node dependency) before hooks file
- Remove dotenv import from mochaRootHooks.ts
nyc has compatibility issues with Node 22+ due to async_hooks changes,
causing it to hang after tests complete. c8 uses native V8 coverage,
is maintained alongside Node, and is the recommended replacement.

- Replace nyc@^18.0.0 + @istanbuljs/nyc-config-typescript with c8
- Create .c8rc.json (checkCoverage, reportsDir, same thresholds)
- Remove .nycrc
… agents via getClient() helper

- Add getClient() helper in mochaRootHooks.ts with keepAlive:false agents so
  HTTP sockets close immediately and Node exits cleanly
- Revert --exit flag (no longer needed with proper agent cleanup)
- Update all 22 spec files to call getClient() instead of
  new OnspringClient(process.env.API_BASE_URL!, ...)
- Refactor addRecord() to accept a client instance
- Drop Node 16/18 from CI matrix (c8 v12 requires Node 20+)
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d83403e) to head (0ef0614).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##            master       #40     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files           66        66             
  Lines          806      4181   +3375     
  Branches        90       196    +106     
===========================================
+ Hits           806      4181   +3375     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@StevanFreeborn
StevanFreeborn merged commit 2789ca2 into master Jul 29, 2026
9 checks passed
@StevanFreeborn
StevanFreeborn deleted the stevanfreeborn/fix/update-deps branch July 29, 2026 01:14
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.

1 participant