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

fix(cjs)!: remove .default suffix from d.ts and d.cts files #3750

Merged
merged 2 commits into from May 8, 2024

Conversation

userquin
Copy link
Member

@userquin userquin commented Apr 22, 2024

This PR will revert changes in .cjs files, patching d.ts and d.cts instead.

I need to check a few packages, rn next example working with these changes (postcss).

(Maybe we can patch only postcss packages, there is no way yet to configure postcss plugin in Next and Webpack (?) with .default suffix: unocss/postcss and @unocss/postcss)

The dist-verify.ts script is wrong (in this PR)...

/cc @kwaa

We also have some problems when using old ESLint: check #3751

Copy link

netlify bot commented Apr 22, 2024

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit dc85fd5
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/66362566321be50008b1c34b
😎 Deploy Preview https://deploy-preview-3750--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@userquin userquin changed the title fix!: remove .default suffix from d.ts and d.cts files fix(CJS)!: remove .default suffix from d.ts and d.cts files Apr 22, 2024
@antfu
Copy link
Member

antfu commented May 2, 2024

Instead of increasing the complexity of patching, maybe we could expose some "proxy cjs file" doing something like

const mod = require('./dist/index.cjs')

module.exports = mod.default
// this line might not be needed if no named exports (eslint/postcss plugin for example)
Object.assign(module.exports, mod)

@userquin
Copy link
Member Author

userquin commented May 4, 2024

I still need to review dist-verify script...

@antfu antfu marked this pull request as ready for review May 8, 2024 21:57
@antfu antfu changed the title fix(CJS)!: remove .default suffix from d.ts and d.cts files fix(cjs)!: remove .default suffix from d.ts and d.cts files May 8, 2024
@antfu antfu merged commit e9f5b5b into main May 8, 2024
9 checks passed
@antfu antfu deleted the userquin/fix-remove-default-cjs-suffix branch May 8, 2024 21:57
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.

None yet

2 participants