Skip to content

build: emit declarations with isolatedDeclarations - #23

Merged
maximseshuk merged 1 commit into
mainfrom
chore/isolated-declarations
Oct 27, 2026
Merged

maximseshuk merged 1 commit into
mainfrom
chore/isolated-declarations

Conversation

@maximseshuk

Copy link
Copy Markdown
Owner

What

Turns on isolatedDeclarations in tsconfig.build.json, so tsdown emits the .d.ts files with Oxc instead of the TypeScript API. openapi, scalar, swaggerUi, createUiPlugin, generateSpecCommand, AUTH_FIELDS and the UI plugin name constants get explicit types. allowJs is off in the build config, because isolatedDeclarations does not allow it and the tooling base config turns it on.

Why

tsdown 0.23.2 no longer emits declarations through the TypeScript API when TypeScript 7 is installed. It fails with:

Error: TypeScript 7.0.2 does not provide the classic TypeScript API required by tsc. Please use TypeScript 6.0 or below, or enable `isolatedDeclarations` in your `tsconfig.json` to use Oxc instead.

The next tsdown bump from Dependabot would fail the build. Same fix as payload-plugin-janitor#7.

How I tested it

  • pnpm typecheck, lint, format:check, test:unit (183 tests) and build pass.
  • I diffed the .d.ts output against main. Only the import form and quotes change. The plugin name constants keep their template literal types.

Checklist

  • pnpm typecheck && pnpm lint && pnpm format && pnpm test:unit pass
  • Tests added or updated for the behavior change
  • README.md and docs/ updated if users will notice the change
  • Commit subjects follow Conventional Commits (fix: ..., feat: ...)

@maximseshuk
maximseshuk merged commit 0abf95e into main Oct 27, 2026
4 checks passed
@maximseshuk
maximseshuk deleted the chore/isolated-declarations branch October 27, 2026 14:09
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