Skip to content

Improved build packaging with dts sourcemaps#30

Merged
ndeloof merged 1 commit into
mainfrom
update-build-packaging
Oct 8, 2025
Merged

Improved build packaging with dts sourcemaps#30
ndeloof merged 1 commit into
mainfrom
update-build-packaging

Conversation

@wmluke

@wmluke wmluke commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

- What I did
Improved build packaging with dts sourcemaps

- How I did it

- How to verify it

  • Run tests in test-integration/cjs-project and test-integration/esm-project

- Human readable description for the release notes

Improved build packaging with dts sourcemaps

- A picture of a cute animal (not mandatory but encouraged)

- Migrated to `tsdown` from `tsup` b/c `tsup` is no longer actively maintained.
- Generated dts sourcemaps to link generated types to canonical source types in `lib`.
- removed `./dist/*` from package.json `exports`.
@wmluke wmluke requested review from Copilot and ndeloof October 8, 2025 17:10
@wmluke wmluke self-assigned this Oct 8, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the build tooling from tsup to tsdown and improves TypeScript declaration file generation by adding source maps to link generated types back to their canonical source.

  • Migrated from tsup to tsdown for build tooling
  • Added DTS source maps to improve developer experience with type definitions
  • Updated package.json exports and build configuration

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
tsdown.config.ts Migrated configuration from tsup to tsdown with DTS source maps enabled
package.json Updated build script and dependencies, modified exports configuration
test-integration/esm-project/import.test.ts Updated test description for clarity
test-integration/cjs-project/import.test.js Updated test description for clarity

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread package.json
"type": "module",
"license": "Apache-2.0",
"main": "dist/index.mjs",
"main": "dist/index.js",

Copilot AI Oct 8, 2025

Copy link

Choose a reason for hiding this comment

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

The main field points to 'dist/index.js' but the exports show ESM uses 'dist/index.js' and CJS uses 'dist/index.cjs'. Consider updating main to point to 'dist/index.cjs' since main is typically used for CommonJS entry point.

Suggested change
"main": "dist/index.js",
"main": "dist/index.cjs",

Copilot uses AI. Check for mistakes.
@ndeloof ndeloof merged commit 4d65357 into main Oct 8, 2025
8 of 9 checks passed
@ndeloof ndeloof deleted the update-build-packaging branch October 8, 2025 17:37
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.

comments are stripped in built bundle

3 participants