Skip to content

postcss-custom-properties : fix types and some small bugs #139

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

Conversation

romainmenke
Copy link
Member

@romainmenke romainmenke commented Jan 9, 2022

  • converted to typescript
  • fixed type definitions
  • add support for .mjs in importFrom
  • fix unicode support
  • add overrideImportFromWithRoot option

typings

This plugin was a good example of how .d.ts files for typescript are often incorrect.
They are created manually without any tool analyses to check correctness.

Better to have true typescript as we then also get all the help from the right tools.

.mjs

The plugin actually already support .mjs in importFrom but this was not allowed.

  • allow it
  • update package.json so that it runs as a module when the plugin is called from another .mjs file.

unicode

This was a tiny fix.
One less regexp and it works.

overrideImportFromWithRoot

This really is a matter of perspective and both orders are equally valid.
They both allow different tactics and features.

postcss/postcss-custom-properties#222

This was updated a while back as a minor version bump but this was actually a breaking change.

I fear not having an option that controls this will just cause someone to reverse it again in the future.


fixes : postcss/postcss-custom-properties#255
fixes : postcss/postcss-custom-properties#237
fixes : postcss/postcss-custom-properties#231

@@ -235,6 +235,27 @@ module.exports = {
stage: 0
}
},
'import:ch88': {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is very much broken.

Copy link
Member Author

Choose a reason for hiding this comment

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

see : #140

@romainmenke romainmenke changed the title postcss-custom-properties : fix types postcss-custom-properties : fix types and some small bugs Jan 9, 2022
Copy link
Member

@Antonio-Laguna Antonio-Laguna left a comment

Choose a reason for hiding this comment

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

Nice one, will keep an eye on #140 and potentially continue discussions there.

@Antonio-Laguna Antonio-Laguna merged commit c4863ca into main Jan 11, 2022
@Antonio-Laguna Antonio-Laguna deleted the postcss-custom-properties-fix-types--exuberant-javanese-bb6594be80 branch January 11, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

importFrom should support ESM Emojis in property name are not working ☹️ Non-passive change for ImportFrom Priority
2 participants