fix(deps): migrate validate-color to official npm package#379
fix(deps): migrate validate-color to official npm package#379lewinpauli wants to merge 2 commits into
Conversation
|
Ubuntu 25.10 x86_64 Gnome shell 49.0 |
|
Thanks for this PR, the validate-color npm package didn't work previously, as I already tried to replace the third party link with the official npm package, but I'll look into this PR. And atm of writing, the thirdparty link doesn't work anymore:
Side note: I'll need to change this in #381 so I'll get this commit and cherry-pick it, so that you'll be listed as author / co-author and I as committer, for the change in the README, please factor that out into a separate commit, I like that change, so I'll merge it later 😄 |
- Replace gitpkg.now.sh URL with npm registry version ^2.2.4 - Add named exports configuration in rollup for validate-color - Add custom rollup plugin to re-export named exports from bundled package
Add screenshot and instructions for restarting the GNOME session after installing the extension by logging out and back in.
|
I seperated the changes in 2 commits as you mentioned @Totto16 |
couldnt start on fedora 43 gnome 49 branch master
The Bug
yarn install was not possible and created the following error:
after yarn install was fixed, Gnome Extension manager showed the following errors:
SyntaxError: The requested module 'file:///home/coco/.local/share/gnome-shell/extensions/pano@elhan.io/thirdparty/validate_color.js' doesn't provide an export named: 'validateHTMLColorHex' @ file:///home/coco/.local/share/gnome-shell/extensions/pano@elhan.io/extension.js:59:10The Fix
Migrate validate-color to official npm package
Problem
The validate-color dependency was using a custom GitHub package URL (https://gitpkg.now.sh/dreamyguy/validate-color/src/validate-color) which caused build issues with named exports not being properly re-exported during the rollup bundling process.
Changes Made
Updated validate-color dependency from gitpkg URL to official npm registry version ^2.2.4
Added namedExportsConfig object to explicitly define named exports for packages that need them:
validateHTMLColorName
validateHTMLColorSpecialName
validateHTMLColorHex
validateHTMLColorRgb
validateHTMLColorHsl
validateHTMLColorHwb
validateHTMLColorLab
validateHTMLColorLch
validateHTMLColor
Enhanced commonjs() plugin configuration with requireReturnsDefault: 'auto' and conditional defaultIsModuleExports
Added custom rollup plugin (export-named) to properly re-export named exports from bundled packages
yarn install && yarn build && pano works now
Fixes
#378
#281
Type of change
Please delete options that are not relevant.
Checklist