Skip to content

Conversation

@delucis
Copy link
Contributor

@delucis delucis commented Nov 8, 2025

This PR migrates the monorepo to bundle using tsdown instead of crackle. This is a prerequisite for #238 in order to be able to move some packages (unpack) to ESM-only build output.

Some notes:

  • Crackle provided a “dev” mode. This PR replaces that with a TypeScript custom condition as described in this article. Packages include a @capsizecss/src condition in their exports which points directly to the .ts source files. This way packages can import types/code from each other directly within the monorepo without needing to run builds. I added config to the site (Vite) and the storybook config (webpack) to handle this.

  • tsdown always outputs a .d.cts for CJS type declarations, so this is a change from the .d.ts shipped currently. I don’t think this should matter at all given they are mapped in the exports and types fields in package.json anyway.

  • This PR matches the existing build 1:1, shipping dual CJS and ESM code for each package. In Replace fontkit with fontkitten #238 we could then disable CJS builds for the unpack package (or drop it from other packages too eventually — especially for metrics shipping a dual bundle is pretty heavy).

@delucis delucis requested a review from a team as a code owner November 8, 2025 12:02
@changeset-bot
Copy link

changeset-bot bot commented Nov 8, 2025

🦋 Changeset detected

Latest commit: c764b99

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@capsizecss/vanilla-extract Patch
@capsizecss/metrics Patch
@capsizecss/unpack Patch
@capsizecss/core Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

@michaeltaranto michaeltaranto left a comment

Choose a reason for hiding this comment

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

Thanks so much for driving this @delucis 🙌

@michaeltaranto michaeltaranto merged commit 41ef5b0 into seek-oss:master Nov 11, 2025
3 checks passed
@seek-oss-ci seek-oss-ci mentioned this pull request Nov 11, 2025
@delucis delucis deleted the chris/tsdown branch November 11, 2025 23:30
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