Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: basic implementation of dts generation #42

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Conversation

Timeless0911
Copy link
Collaborator

@Timeless0911 Timeless0911 commented Jul 22, 2024

Summary

A basic implementation of dts generation in Rslib.

  • bundleless dts: ts compiler API
  • bundle dts: ts compiler API and api-extractor rollup

This feature is implemented via rsbuild-plugin-dts, and the dts generation is running in a new forked process.

This PR already implemented:

  • using new process to run dts generation and do not block js bundle multicompiler
  • support ts watch compiler API in rsbuild watch mode
  • basic tests for dts bundle and bundleless

There are some other features related to dts, which will be implemented in separated PR later in the future.

  • optimize log output
  • tests covering more configurations
  • support incremental build with project reference
  • support external packages when using api-extractor
  • deal alias in bundless dts
  • support autoExtension for dts files (.d.ts with esm format and .d.cts with cjs format when type: module .d.ts with cjs format and .d.mts with esm format when type: commonjs)
  • support using swc iso to generate dts when isolatedDeclarations enabled

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@Timeless0911 Timeless0911 changed the title feat: support dts bundleless WIP: support dts bundleless Jul 22, 2024
@Timeless0911 Timeless0911 changed the title WIP: support dts bundleless WIP: support dts generation Jul 22, 2024
@Timeless0911 Timeless0911 changed the title WIP: support dts generation WIP: basic support dts generation Jul 23, 2024
@Timeless0911 Timeless0911 changed the title WIP: basic support dts generation WIP: basic support of dts generation Jul 23, 2024
@Timeless0911 Timeless0911 force-pushed the feat/dts branch 5 times, most recently from 33558f8 to c1ea1b6 Compare July 30, 2024 13:18
@Timeless0911 Timeless0911 changed the title WIP: basic support of dts generation feat: basic support of dts generation Jul 31, 2024
@Timeless0911 Timeless0911 force-pushed the feat/dts branch 2 times, most recently from eb9d6da to 0792a56 Compare July 31, 2024 09:47
@Timeless0911 Timeless0911 changed the title feat: basic support of dts generation feat: basic implemention of dts generation Jul 31, 2024
@Timeless0911 Timeless0911 requested a review from fi3ework July 31, 2024 09:50
packages/plugin-dts/src/index.ts Outdated Show resolved Hide resolved
packages/plugin-dts/src/index.ts Outdated Show resolved Hide resolved
packages/plugin-dts/src/dts.ts Outdated Show resolved Hide resolved
packages/plugin-dts/src/dts.ts Outdated Show resolved Hide resolved
packages/plugin-dts/src/dts.ts Outdated Show resolved Hide resolved
packages/plugin-dts/src/dts.ts Show resolved Hide resolved
packages/plugin-dts/src/tsc.ts Outdated Show resolved Hide resolved
@Timeless0911 Timeless0911 changed the title feat: basic implemention of dts generation feat: basic implementation of dts generation Aug 1, 2024
@Timeless0911 Timeless0911 requested a review from fi3ework August 1, 2024 04:54
packages/core/package.json Show resolved Hide resolved
e2e/cases/dts/index.test.ts Show resolved Hide resolved
packages/plugin-dts/src/dts.ts Outdated Show resolved Hide resolved
@Timeless0911 Timeless0911 merged commit 54c861e into main Aug 1, 2024
3 checks passed
@Timeless0911 Timeless0911 deleted the feat/dts branch August 1, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants