Skip to content

chore: bump stack to TypeScript 7, oxlint and @swc/jest - #26

Merged
Theosakamg merged 4 commits into
mainfrom
chore/bump-stack-oxlint-swc
Nov 18, 2026
Merged

Theosakamg merged 4 commits into
mainfrom
chore/bump-stack-oxlint-swc

Conversation

@Theosakamg

@Theosakamg Theosakamg commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Bump the dev stack. TypeScript 7 broke npm install (ts-jest and typescript-eslint require TS < 7).

Changes

  • Lint: eslint + typescript-eslint → oxlint (.oxlintrc.json migrated via @oxlint/migrate, same rules). Scripts lint:es/fix:es → lint:ox/fix:ox.
  • Tests: ts-jest → @swc/jest (CJS output, jest.mock hoisting kept).
  • Test type-check: swc only strips types, so tests are now type-checked by npm run test:types (tsc -p tsconfig.test.json), run in the test job right after spec:generate (the generated client is not committed, so it cannot run in Code Quality). Pre-existing type errors in tests were fixed.
  • nock 15 is ESM-only: nock and its deps are transformed by swc via transformIgnorePatterns. Tests adapted to the nock 15 reply callback API (single fetch Request), and tests/setup.ts restores nock after each file (it patches shared Node core modules and leaked into the next suite of the same worker).
  • tsconfig.json: explicit "types": ["node"] (TS 6+ defaults to []). tsconfig.test.json: incremental: false so it no longer shares dist/.tsbuildinfo with the build.
  • Dev deps bumped: @types/node ^26.6.6, oxlint ^1.94.0, jest, nock, prettier, typescript ^7.0.2.
  • Removed unused deps: ts-node, nodemon, quicktype (no reference in scripts/workflows).

Runtime dependency unchanged: dotenv stays on ^17.3 (a dotenv 18 bump, which logs to stderr unless quiet, belongs in its own PR). No generated files (src/api, src/model) changed.

Validation

  • npm run lint:all, npm run test:types, npm run build, npm test (693 tests, repeated runs with 2 workers) pass after merging current main.
  • Packed tarball smoke-tested: ESM import, CJS require / dynamic import, and TS consumers (nodenext ESM/CJS, bundler, preserve) with tsc 7 strict, skipLibCheck: false.

Notes

  • npm 12 blocks @swc/core postinstall by default (works anyway; npm install-scripts approve @swc/core if needed).

…st to @swc/jest

- Replace eslint/typescript-eslint with oxlint (config migrated via @oxlint/migrate)
- Replace ts-jest with @swc/jest (ts-jest does not support TypeScript 7)
- Transform ESM-only nock 15 and its deps in jest
- Adapt oauth2 tests to nock 15 reply callback API
- Remove unused ts-node, nodemon and quicktype
- Add explicit node types to tsconfig (TS 6+ default types: [])

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Reviewed — No blocking findings · 🔵 2 minor points

🔍 Full review · 10 files reviewed

🔵 Minor points

  • package.json:53 — The PR is described as a dev-stack bump, but it also raises the only runtime dependency, dotenv, from ^17.3 to ^18.0.10 (lockfile: 17.4.2 → 18.0.10). The description does not mention this, and dotenv is installed for every consumer of the published package. dotenv 18 ships a new bundled CJS build (dist/index.cjs), adds a dotenv CLI bin, and changes how config() logs: unless quiet is set, it prints ◇ injected env (N) from … through console.error. src/app.ts calls dotenv.config() without options, so it now writes that line to stderr. A major-version change to a shipped dependency should be stated, or done in its own PR.
  • jest.config.js:9 — Jest no longer reads tsconfig.test.json: the old tsconfig: 'tsconfig.test.json' option was removed, and the swc config sets its own options. No npm script or workflow references the file either, so it is now dead configuration. Its types: ["jest", "node"] and isolatedModules settings suggest it still controls how tests are compiled, but it does not. Also, swc only strips types, so test files are never type-checked. The PR admits tsc -p tsconfig.test.json already fails, and no CI job runs it, so type errors in tests now go unnoticed.
Verification
  • .oxlintrc.json ports the old src override: no-unused-vars off, explicit-function-return-type and no-explicit-any as warn, no-console warn, prefer-const/no-var error, and the same ignore paths.
  • The removed @typescript-eslint/no-var-requires rule is covered by typescript/no-require-imports: error in the new config.
  • No README, workflow or script references lint:es, fix:es, eslint, ts-jest, ts-node, nodemon or quicktype any more; src/app.ts's eslint-disable comment is a directive oxlint also honours.
  • nock 15 needs Node >=22.20.0, which is covered by the CI matrix (22.x/24.x/26.x) and by the Node 22 used in compare-signatures.
  • The rewritten nock reply callbacks read the fetch Request with req.headers.get and await req.text(), and the refresh-fallback test still tells requests apart by checking the body for refresh_token.

Two CI jobs in develop.yml cover this change: the Code Quality job runs npm run lint:all (now oxlint plus prettier), and the test matrix runs npm run test:unit through @swc/jest on Node 22, 24 and 26. The only test changes are the nock 15 callback updates in oauth2-client.test.ts and the Mock generics in environments.test.ts. No job type-checks the tests, and the docs and coverage steps are disabled (if: false).

Review details
  • Commit: 29fa04e
  • Model: claude-opus-5-5

Review 1 of 10 for this pull request · View the full run

…otenv 17

- Restore nock after each test file: it patches shared Node core modules and leaked
  interception into the next suite of the same worker (CI oauth2-client failures)
- Add lint:types (tsc -p tsconfig.test.json) to lint:all and fix test type errors
- Revert dotenv to ^17.3 (runtime dependency, out of scope for a dev-stack bump)
- Bump @types/node to ^26.6.6 and oxlint to ^1.94.0
- Code Quality has no generated client (src/api, src/model are gitignored), so the
  test type-check moves out of lint:all into test:types, run after spec:generate
- tsconfig.test.json: disable incremental so it no longer shares dist/.tsbuildinfo
  with the build (stale cache produced bogus missing-export errors)
@github-actions

Copy link
Copy Markdown

Upsun SDK checker report

Display raw output
/home/runner/work/upsun-sdk-node/upsun-sdk-node/node_modules/ts-api-utils/lib/index.cjs:787
var IntrinsicTypeFlags = ts9__default.default.TypeFlags.Intrinsic ?? ts9__default.default.TypeFlags.Any | ts9__default.default.TypeFlags.Unknown | ts9__default.default.TypeFlags.String | ts9__default.default.TypeFlags.Number | ts9__default.default.TypeFlags.BigInt | ts9__default.default.TypeFlags.Boolean | ts9__default.default.TypeFlags.BooleanLiteral | ts9__default.default.TypeFlags.ESSymbol | ts9__default.default.TypeFlags.Void | ts9__default.default.TypeFlags.Undefined | ts9__default.default.TypeFlags.Null | ts9__default.default.TypeFlags.Never | ts9__default.default.TypeFlags.NonPrimitive;
                                                        ^

TypeError: Cannot read properties of undefined (reading 'Intrinsic')
    at Object.<anonymous> (/home/runner/work/upsun-sdk-node/upsun-sdk-node/node_modules/ts-api-utils/lib/index.cjs:787:57)
    at Module._compile (node:internal/modules/cjs/loader:1781:14)
    at Object..js (node:internal/modules/cjs/loader:1913:10)
    at Module.load (node:internal/modules/cjs/loader:1505:32)
    at Function._load (node:internal/modules/cjs/loader:1309:12)
    at wrapModuleLoad (node:internal/modules/cjs/loader:254:19)
    at Module.require (node:internal/modules/cjs/loader:1527:12)
    at require (node:internal/modules/helpers:147:16)
    at Object.<anonymous> (/home/runner/work/upsun-sdk-node/upsun-sdk-node/node_modules/upsun-sdk-checker/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js:37:30)
    at Module._compile (node:internal/modules/cjs/loader:1781:14)

Node.js v22.23.4

@Theosakamg
Theosakamg marked this pull request as ready for review November 18, 2026 12:28

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Reviewed — No blocking findings · ⚪ 1 nitpick

🔍 Full review · 16 files reviewed

⚪ Nitpick

  • scripts/help.sh:12 — The new test:types entry is inserted between lint:ox and lint:prettier, breaking the alphabetical ordering the rest of the help list follows.
Verification
  • package.json and the lockfile keep dotenv at ^17.3 / 17.4.2, so the runtime dependency is unchanged.
  • No file outside package-lock.json still references lint:es, fix:es, ts-jest, ts-node, nodemon or quicktype; remaining eslint-disable comments are honoured by oxlint.
  • The src/**/*.ts override in .oxlintrc.json reproduces every rule from the deleted eslint.config.js src block; no-var-requires is covered by typescript/no-require-imports, set to error for all files, and tests/** stays ignored.
  • tsconfig.test.json sets incremental:false and noEmit and adds jest to the types list, so test:types no longer writes to dist/.tsbuildinfo, which the build shares.
  • tests/setup.ts calls nock.restore() in afterAll; each test file loads a fresh nock module, which re-activates interception on import.

The develop.yml test job now runs npm run test:types after spec:generate on Node 22/24/26, and the Code Quality job runs npm run lint:all (oxlint + prettier); the swc/nock 15 jest setup is covered only by running the existing unit tests (npm run test:unit). No test checks that the transformIgnorePatterns whitelist covers every ESM-only dependency of nock 15.

Review details
  • Commit: 952536e
  • Model: claude-opus-5-5

Review 2 of 10 for this pull request · View the full run

@Theosakamg
Theosakamg merged commit 457970d into main Nov 18, 2026
10 checks passed
@Theosakamg
Theosakamg deleted the chore/bump-stack-oxlint-swc branch November 18, 2026 12:32
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