Skip to content

chore: Enable isolatedDeclarations - #991

Closed
armandabric wants to merge 1 commit into
masterfrom
isolated-declarations
Closed

armandabric wants to merge 1 commit into
masterfrom
isolated-declarations

Conversation

@armandabric

Copy link
Copy Markdown
Collaborator

Enables isolatedDeclarations in tsconfig.json.

Why

When isolatedDeclarations is on, tsdown (through rolldown-plugin-dts) generates dist/index.d.ts with Oxc instead of TypeScript. The build then no longer depends on the TypeScript API or on the tsgo binary:

tsc still enforces the rule, so code that Oxc can't handle is reported by pnpm run typecheck and in the editor.

Changes

  • createPropFilter: explicit return type.
  • defaultOptions: typed as Options.
  • tsdown.config.ts / vitest.config.ts: the default export is a typed constant, because these files are part of the tsconfig and isolatedDeclarations can't infer default exports.

dist/index.js and dist/index.d.ts are byte-identical to the current build.

Independent of #990: this works with TypeScript 6 and 7.

Checks

  • pnpm run typecheck
  • pnpm run test (215 tests)
  • pnpm run build (attw and publint pass, declarations generated by Oxc)
  • pnpm run lint / pnpm run format

🤖 Generated with Claude Code

With isolatedDeclarations, tsdown generates the declarations with Oxc
instead of TypeScript, so the build no longer depends on the TypeScript
API or the tsgo binary. The generated declarations are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b0e649a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes.

@armandabric

Copy link
Copy Markdown
Collaborator Author

Moved into #990.

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