Skip to content

chore: update tooling - #353

Merged
fabien0102 merged 18 commits into
fabien0102:mainfrom
el-j:feat/update-2-latest
Oct 29, 2026
Merged

fabien0102 merged 18 commits into
fabien0102:mainfrom
el-j:feat/update-2-latest

Conversation

@el-j

@el-j el-j commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

OpenAPI Codegen: Tooling and compatibility update

Summary

This PR modernizes the project for the current JavaScript/TypeScript ecosystem and fixes compatibility issues introduced by newer package versions, stricter TypeScript checks, and the current Node runtime.

The goal was to keep the generator stable while updating the repo to a cleaner, faster, and more current toolchain without rewriting the generator architecture itself.

Review Status

All review feedback from @fabien0102 has been addressed:

  • Removed Promise.withResolvers polyfill and bumped CI workflows to Node.js 22 (Active LTS).
  • Formatted .oxlintrc.json with Prettier.
  • Cleaned up types in plugins/typescript/src/utils/getEnumProperties.ts (removed any and @ts-ignore).
  • Removed unnecessary type castings in cli/src/commands/InitCommand.ts and cli/src/utils/getGithubToken.ts.
  • Bumped patch/minor dependencies (@types/node@^26.6.5, got@^16.1.0, oxlint@^1.89.0, prettier@^3.9.10, vitest@^5.0.5).
  • Full CI suite (Tests/test (pull_request)) is 100% passing.

Related

This PR effectively incorporates and resolves the issues covered by:

What changed

Tooling and linting

  • Switched the repository from ESLint to real oxlint
  • Removed the legacy ESLint configuration and aligned the repo around the faster, cleaner oxlint workflow
  • Modernized the workspace configuration to work with current pnpm lifecycle behavior and native dependency build approval
  • Kept the project aligned with the current supported toolchain without broad rewrite work

Dependency cleanup

  • Removed the deprecated got-fetch dependency and kept the codebase on the supported got package already in use by the CLI
  • Removed obsolete @types/* packages that are now redundant because the actual dependencies ship their own TypeScript declarations
  • Cleaned up stale dependency metadata and lockfile drift caused by modern package resolution
  • Updated the project to TypeScript 6.0.2 and aligned the package config for the new compiler requirements
  • Updated patch/minor dependencies: @types/node@^26.6.5, got@^16.1.0, oxlint@^1.89.0, prettier@^3.9.10, vitest@^5.0.5

TypeScript compatibility

  • Removed deprecated TypeScript config options that are no longer valid in current compiler versions
  • Added explicit rootDir values where required by TypeScript's stricter output-layout checks
  • Updated the plugin TypeScript config to modern Node16-style resolution and added the correct ES libs for the APIs used in the generator
  • Fixed strict typing issues raised by modern prompt APIs and runtime values
  • Resolved the issues surfaced by the stricter TypeScript checks introduced by the updated stack

React Query migration

  • Updated generated React Query code to match TanStack Query v5
  • Removed reliance on the old Enabled helper that no longer exists in the current package API
  • Switched generated usage to the supported enabled flag pattern based on UseQueryOptions["enabled"]
  • Updated the example frontend to use the same API pattern
  • Documented the migration in the package changelog and README so downstream users are aware of the breaking change

Testing and runtime compatibility

  • Bumped CI workflows (.github/workflows/tests.yaml and .github/workflows/release-please.yaml) to Node.js 22 (Active LTS), removing the need for Promise.withResolvers polyfill in tests
  • Verified the project remains green under the current workflow and dependency stack
  • Confirmed the generated code and CLI pass the package build, typecheck, and full test suite

Breaking changes

TanStack React Query v5 migration

TanStack React Query v5 removed the old Enabled helper. Generated code should now use the supported enabled option pattern instead of the removed helper.

TypeScript configuration modernization

Projects consuming the generator should expect the TypeScript config to follow modern compiler expectations. Older config patterns like deprecated module resolution values and missing rootDir configuration are no longer appropriate under the current TypeScript toolchain.

Issues

Fixes #354
Relates to #348 (TypeScript 7 transition tracked in #348 and Draft PR #355)

Validation

The following checks run successfully:

  • pnpm test run
  • pnpm check:types
  • pnpm check:lint
  • pnpm check:prettier
  • pnpm build
  • GitHub Actions CI (Tests/test (pull_request)) passing

el-j added 8 commits October 7, 2026 14:55
- Added allowBuilds for '@swc/core' and 'esbuild' in pnpm-workspace.yaml
- Excluded minimum release age for [email protected]
- Changed moduleResolution from 'Node' to 'Bundler' in tsconfig.json
…sistency

- Updated type definitions in `githubContext.ts`, `githubFetcher.ts`, `githubParameters.ts`, and `githubSchemas.ts` to use single-line union types for better clarity.
- Simplified the `RemoveIndex` type utility in `schemaToTypeAliasDeclaration.ts`.
- Made minor formatting adjustments in `README.md` for consistency.
- Updated `pnpm-workspace.yaml` to use consistent quotation marks.

run check and fix
@el-j

el-j commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

@fabien0102 hi there, any chance we get this merged?

@fabien0102

Copy link
Copy Markdown
Owner

On it, sorry for the delay, this PR is HUGE!

Comment thread plugins/typescript/CHANGELOG.md Resolved
Comment thread vitest.setup.ts Resolved
Comment thread cli/src/commands/InitCommand.ts Resolved
Comment thread cli/src/commands/InitCommand.ts Resolved
Comment thread plugins/typescript/README.md Resolved
@el-j el-j mentioned this pull request Oct 26, 2026
11 of 44 tasks
@el-j

el-j commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi @fabien0102! 👋

All review feedback has been addressed and the review threads have been resolved:

  1. Scoped Polyfill: The Promise.withResolvers polyfill is now strictly localized inside cli/src/core/getOpenAPISourceFile.url.test.ts without any global setup file.
  2. Prettier Formatting: Formatted .oxlintrc.json with Prettier.
  3. Clean Typing: Refactored plugins/typescript/src/utils/getEnumProperties.ts to use proper typing for propertySchema instead of any / @ts-ignore.
  4. Clean Returns: Removed unnecessary type castings from cli/src/commands/InitCommand.ts and cli/src/utils/getGithubToken.ts.
  5. Dependency Bump: Updated to the latest minor/patch versions (got@^16.1.0, oxlint@^1.89.0, vitest@^5.0.5, prettier@^3.9.10, @types/node@^26.6.5).

CI (Tests/test (pull_request)) is 100% green. Ready for your final review and merge!

(Note: I updated the issue link to keep #348 open so it can track the upcoming TypeScript 7 migration in Draft PR #355)

Comment on lines +5 to +17
// Polyfill Promise.withResolvers for Node 20 environments (required by @mswjs/interceptors / nock 15)
if (typeof Promise.withResolvers === "undefined") {
Promise.withResolvers = function <T>() {
let resolve!: (value: T | PromiseLike<T>) => void;
let reject!: (reason?: unknown) => void;
const promise = new Promise<T>((res, rej) => {
resolve = res;
reject = rej;
});
return { promise, resolve, reject };
};
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Let’s remove this and bump the CI to the latest node LTS

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done! Removed the polyfill and bumped Node.js to 22 (latest LTS) in CI workflows.

@fabien0102 fabien0102 changed the title Feat/update 2 latest chore: update tooling Oct 29, 2026
@fabien0102
fabien0102 merged commit 40b2563 into fabien0102:main Oct 29, 2026
1 check passed
@el-j
el-j deleted the feat/update-2-latest branch October 29, 2026 17:08
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.

update dependencies & removed unused deprecated

2 participants