-
Notifications
You must be signed in to change notification settings - Fork 107
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 usage of contrast-colors with commonjs and esm #185
base: main
Are you sure you want to change the base?
Conversation
docs: launch prep
Merge branch 'master' of github.com:adobe/leonardo
style: fixed issue with tabs indicator color fallback
feat: adding link to demo app in UI
Bumps [serialize-to-js](https://github.com/commenthol/serialize-to-js) from 3.0.0 to 3.0.2. - [Release notes](https://github.com/commenthol/serialize-to-js/releases) - [Commits](commenthol/serialize-to-js@v3.0.0...v3.0.2) Signed-off-by: dependabot[bot] <[email protected]>
style: Updated demo app to a calendar with more colors to demonstrate
style: updated styles of links
…ize-to-js-3.0.2 build(deps): bump serialize-to-js from 3.0.0 to 3.0.2
feat: colorscale as HTML Canvas
style: dropdown width override to correct width
- @adobe/[email protected] - @adobe/[email protected]
* added tests and updated getContrast function for APCA support * feat: updated support for APCA with tests and UI
* added tests and updated getContrast function for APCA support * feat: added parameter support (URL) for formula
* added tests and updated getContrast function for APCA support * fix: polarity switch in APCA
- @adobe/[email protected] - @adobe/[email protected]
…ed with less than 100% saturation (adobe#172)
- @adobe/[email protected] - @adobe/[email protected]
* added initial form fill for contrast. WCAG 2 formula works * added apca to bulk contrast Co-authored-by: Nathan Baldwin <[email protected]>
ping :) |
Anything wrong with this? Otherwise it would be great to merge this before conflicts are introduced or it becomes incomplete |
I was exploring the |
Would be appreciated if you or anyone else could take this over. As this PR was completely ignored, while development and releases happened, I've given up. |
This is still sorely needed |
500acc1
to
ed3e3c3
Compare
Description
Fix usage as commonjs and esm module and add dependencies of
contrast-colors
to itspackage.json
.As
.mjs
file extension is used for esm module files, the moduletype
can be set tocommonjs
, which is what.js
files are.The
main
property ofpackage.json
should now point to the commonjs file indist/
-index.js
was not working at all, as there isindex.mjs
in the package root andindex.js
only in the dist folder.The
module
property obviously can point toindex.mjs
.The
exports
property apparently needsimport
andrequire
to make importing and requiring the module work, I tried all sorts of other combinations, but this was the only variant that worked for me.I had to adjust the imports, I assume bundlers handle it without the file extension, but using it in vanilla node requires the file extension:
.mjs
in this case - independently of thetype
property inpackage.json
.I did not update the lock files as I'm not sure where and how exactly I should run
npm
oryarn
- also my versions seemed newer than yours and caused a huge amount of changes in those files, so maybe it's better if you do it yourselves.See https://antfu.me/posts/publish-esm-and-cjs for further reference
Motivation
With version alpha.16 we're not able to use
leonardo-contrast-colors
anymore in a NodeJS script that's still using commonjs modules.Fixes #173
Screenshots
To-do list