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

build: switch to dual package emitting #2746

Merged
merged 4 commits into from
May 8, 2024

Conversation

cf-remylenoir
Copy link
Collaborator

@cf-remylenoir cf-remylenoir commented May 7, 2024

Purpose of PR

Note

This is only for v5 alpha/beta pre-releases and won't be merged into main

Adds setup for emitting 2 package.json files for ESM and CJS, making use of tsconfig-to-dual-package.

This approach has the benefit of clearly declaring what type should be used since it relies on 2 package.json and prevents Node/TypeScript configuration confusion or change for the consumers, and mostly issues with our direct dependency for the icons (Phosphor)

Motivation and readings 🍿

@cf-remylenoir cf-remylenoir self-assigned this May 7, 2024
Copy link

changeset-bot bot commented May 7, 2024

⚠️ No Changeset found

Latest commit: 2701795

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
forma-36 ❌ Failed (Inspect) May 8, 2024 2:54pm

Comment on lines +23 to +25
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For backward compability

.changeset/config.json Outdated Show resolved Hide resolved
@cf-remylenoir cf-remylenoir marked this pull request as ready for review May 8, 2024 14:55
@cf-remylenoir cf-remylenoir requested review from damann and a team as code owners May 8, 2024 14:55
@cf-remylenoir cf-remylenoir requested review from stephanLeece, denkristoffer and andipaetzold and removed request for a team, damann and stephanLeece May 8, 2024 14:55
@cf-remylenoir cf-remylenoir merged commit 0b047d5 into feat/icons-v5 May 8, 2024
1 of 4 checks passed
@cf-remylenoir cf-remylenoir deleted the dual-package-emit branch May 8, 2024 15:12
"sideEffects": false,
"type": "module",
"main": "./dist/cjs/index.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

type: module & main being CJS seems wrong

Comment on lines +57 to +58
"engines": {
"node": ">=16"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this required? It's a frontend package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It isn't, to be removed.

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.

2 participants