Skip to content

Switch to tsdown for builds#265

Merged
MattIPv4 merged 4 commits intomainfrom
MattIPv4/tsdown
Apr 23, 2026
Merged

Switch to tsdown for builds#265
MattIPv4 merged 4 commits intomainfrom
MattIPv4/tsdown

Conversation

@MattIPv4
Copy link
Copy Markdown
Member

@MattIPv4 MattIPv4 commented Apr 15, 2026

Unblocks #264 as tsup is no longer maintained and is not compatible with TS 6

Copilot AI review requested due to automatic review settings April 15, 2026 13:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 package build pipeline from tsup to tsdown, updating TypeScript resolution settings and internal imports accordingly, and adds CI coverage for the new build step.

Changes:

  • Replace tsup build configuration with tsdown configuration (including asset handling + post-build optimization hook).
  • Update TypeScript config and internal imports to support explicit .ts extensions and bundler-style module resolution.
  • Add a GitHub Actions build job to ensure npm run build succeeds in CI.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tsup.config.ts Removed previous tsup-based build configuration (entries, clean build dir, copy + optimize onSuccess).
tsdown.config.ts Added tsdown build configuration, including loader/copy settings, output naming rules, and onSuccess optimization.
tsconfig.json Switched to moduleResolution: bundler and enabled allowImportingTsExtensions to support explicit .ts imports.
src/animal-quest.ts Updated internal import to include .ts extension.
src/ambassadors/species.ts Updated internal imports to include .ts extensions.
src/ambassadors/images.ts Updated internal imports to include .ts extensions and reformatted import block.
src/ambassadors/filters.ts Updated internal import to include .ts extension.
src/ambassadors/core.ts Updated internal imports to include .ts extensions.
scripts/optimize.ts Updated JSON import syntax to use import attributes (with { type: "json" }).
scripts/iucn.ts Updated internal import to include .ts extension.
package.json Bumped version, switched build script to tsdown, replaced tsup dependency with tsdown.
package-lock.json Lockfile updates reflecting replacement of tsup with tsdown and transitive dependency changes.
.github/workflows/test.yml Added a build job running npm run build with asset-cache + populate steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tsdown.config.ts
Comment thread tsdown.config.ts
Comment thread tsdown.config.ts Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Version published 🚀

npm install @alveusgg/data@0.72.0-pre.016cf6cb38201f555f1c5109ed2774b2fb496493
pnpm add @alveusgg/data@0.72.0-pre.016cf6cb38201f555f1c5109ed2774b2fb496493

hyf0 pushed a commit to rolldown/rolldown that referenced this pull request Apr 17, 2026
#9139)

When another plugin resolves a specifier and marks it `external: true`,
`CopyModulePlugin::resolve_id` was ignoring the flag and attempting to
red the id, producing `Failed to read copy module <id>`.

This surfaces with `rolldown-plugin-dts`, which returns ambient-module
glob specifiers such as `typeof import("*.jpg")` as external. If `.jpg`
is also configured as `moduleTypes: copy`, the copy plugin invokes
`ctx.resolve`, which runs the dts resolver, gets back `{ id: "*.jpg",
external: true }`, and then crashes trying to read `*.jpg` off disk.

Real world example: alveusgg/data#265
Copilot AI review requested due to automatic review settings April 17, 2026 14:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tsdown.config.ts
Comment thread package.json Outdated
Copilot AI review requested due to automatic review settings April 17, 2026 15:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tsdown.config.ts
Copilot AI review requested due to automatic review settings April 22, 2026 16:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tsdown.config.ts
@MattIPv4 MattIPv4 marked this pull request as ready for review April 22, 2026 17:52
@MattIPv4 MattIPv4 requested a review from a team as a code owner April 22, 2026 17:52
Copilot AI review requested due to automatic review settings April 22, 2026 17:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tsdown.config.ts
@MattIPv4 MattIPv4 merged commit 32fb8c2 into main Apr 23, 2026
11 checks passed
@MattIPv4 MattIPv4 deleted the MattIPv4/tsdown branch April 23, 2026 22:39
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.

3 participants