fix: resolve npm security vulnerabilities and migrate to ESLint flat config - #40
Merged
Merged
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
typedoc 0.25→0.28, typescript 4→6, @typescript-eslint/* 5→8
errorvariable in ArgumentValidator.ts catch clauseships patched copies of these transitive deps)