Skip to content

Conversation

@michaeltaranto
Copy link
Contributor

Create server entry point to isolate usage of node APIs without needing to polyfill.

BREAKING CHANGES

Move fromFile to server entry point.

MIGRATION GUIDE

-import { fromFile } from '@capsizecss/unpack';
+import { fromFile } from '@capsizecss/unpack/server';

As an aside, noticed the lint wasn't being run in CI 🤦‍♂️ .

@michaeltaranto michaeltaranto requested a review from a team as a code owner December 15, 2025 00:48
@changeset-bot
Copy link

changeset-bot bot commented Dec 15, 2025

🦋 Changeset detected

Latest commit: 7ab1c50

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

This PR includes changesets to release 1 package
Name Type
@capsizecss/unpack Major

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

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Looks good! My only thoughts:

  • @capsizecss/unpack/node could be another naming option vs /server

  • The other alternative would be to drop fromFile() entirely and tell people to migrate to:

    fromBuffer(await readFile('my-font.ttf'))

    Then there would be no need to worry about the module’s compatibility. But I get that it can be handy to have a dedicated API.

@michaeltaranto
Copy link
Contributor Author

Yeah the naming for the import path was something I wasnt sold on. Even node sounds a bit odd. Have you seen this convention in other packages?

I think its a good convenience to provide, so i guess just bike-shedding the naming is the last step here.

@delucis
Copy link
Contributor

delucis commented Dec 16, 2025

Have you seen this convention in other packages?

I feel like I have, but now I can’t find any examples 😅 (In fact, maybe I’m even just thinking of myself — at one point I played with having a smaller @fontkitten/node package, but once I realised Capsize needed browser support, I dropped the idea because my main target was improving things specifically for Capsize and the downstream web frameworks like Astro & Nuxt.)

Either way, I’m not too fussed about the naming! Happy to see whichever makes sense to you.

@michaeltaranto
Copy link
Contributor Author

Playing around with some very honest paths:

import { fromFile } from '@capsizecss/unpack/file-system';

or

import { fromFile } from '@capsizecss/unpack/fs';

Thoughts?

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