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

Improve export checks #479

Open
dcastil opened this issue Oct 5, 2024 · 0 comments
Open

Improve export checks #479

dcastil opened this issue Oct 5, 2024 · 0 comments
Labels
context-v2 Related to tailwind-merge v2 feature Is new feature

Comments

@dcastil
Copy link
Owner

dcastil commented Oct 5, 2024

I do some basic export checks in https://github.com/dcastil/tailwind-merge/blob/v2.5.3/.github/workflows/test.yml#L34, but this could be improved.

In https://www.totaltypescript.com/how-to-create-an-npm-package#5-exports-main-and-arethetypeswrongcli there is the package https://www.npmjs.com/package/@arethetypeswrong/cli mentioned which I could use to dome some more extensive checks for the package exports.

Current output of npx @arethetypeswrong/cli --pack .:

tailwind-merge v2.5.3

Build tools:
- typescript@^5.6.2
- rollup@^4.22.5
- @rollup/plugin-typescript@^12.1.0

🎭 Import resolved to a CommonJS type declaration file, but an ESM JavaScript file. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md

💀 Import failed to resolve to type declarations or JavaScript files. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/NoResolution.md


┌───────────────────┬────────────────────────┬────────────────────────┐
│                   │ "tailwind-merge"       │ "tailwind-merge/es5"   │
├───────────────────┼────────────────────────┼────────────────────────┤
│ node10            │ 🟢                     │ 💀 Resolution failed   │
├───────────────────┼────────────────────────┼────────────────────────┤
│ node16 (from CJS) │ 🟢 (CJS)               │ 🟢 (CJS)               │
├───────────────────┼────────────────────────┼────────────────────────┤
│ node16 (from ESM) │ 🎭 Masquerading as CJS │ 🎭 Masquerading as CJS │
├───────────────────┼────────────────────────┼────────────────────────┤
│ bundler           │ 🟢                     │ 🟢                     │
└───────────────────┴────────────────────────┴────────────────────────┘
@github-actions github-actions bot added the context-v2 Related to tailwind-merge v2 label Oct 5, 2024
@dcastil dcastil added feature Is new feature and removed feature request labels Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context-v2 Related to tailwind-merge v2 feature Is new feature
Projects
None yet
Development

No branches or pull requests

1 participant