Skip to content

Improve export checks #479

@dcastil

Description

@dcastil

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           │ 🟢                     │ 🟢                     │
└───────────────────┴────────────────────────┴────────────────────────┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    context-v2Related to tailwind-merge v2featureIs new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions