Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes the following changes to the
packages/tailwindcss
package (check Context):plugin.ts
module, cannot be used with Typescript 5.7"type": "commonjs"
to package.json./lib/util/flattenColorPalette.js
variant to package.json exports (publishConfig
)Context
The current version at npm registry has all types broken for all packages exports. The problem seems to be with tsup since it is not applying the
.cts
hack, alld.ts
files usingexport { X as default };
, check https://arethetypeswrong.github.io/?p=tailwindcss%404.0.0 .With this PR (for context check this PR unjs/unbuild#475 and this md file https://github.com/unjs/unbuild/blob/a011a7831e2004688bf44716f5e9c9377d08ebec/src/builders/rollup/plugins/cjs.md):
This PR includes a new script module that runs after tsup finish building the dist, extracting the default export and applying some replacements in the files including the default
export
correclty:export = X;
and remaining named exports in the default export statement.About exporting the types in the
plugin.ts
module, when using TypeScript 5.7 there is an error. Using the following code with any module resolutionand building it via
tsc -b
, there is an error about required annotation:Using a local tgz from this PR, TypeScript is fine when building the module:
You can generate the local tgz using this PR in the following repository (use packages/plugin): https://github.com/iconify/iconify-tailwind