-
-
Notifications
You must be signed in to change notification settings - Fork 772
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 style-spec scripts to work in esm package/fix help #1971
Conversation
Bundle size report: Size Change: 0 B
ℹ️ View DetailsNo major changes |
The type in the package.json file of the style-spec is defined as |
I mentioned changing these extensions to cjs is probably the wrong approach in the issue thread, which is why this is still a draft. This works but those scripts should be easy to convert since they are small I was planning to attempt to change it to ESM syntax next, I just wanted to submit what I got working last night before I went to bed. |
Sorry, didn't mean to jump too soon. Thanks for looking into this! |
I've tested this with and basic-v7.json as a test file |
I've tested all scripts with a few of styles here. They all work flawlessly. |
Thanks! |
I added the changelogs and updated the version |
Attempt to fix #1963
This PR updates the syntax of the style-spec bin scripts to be ESM syntax and adds a file extension to fix the following error
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /root/.nvm/versions/node/v16.15.0/lib/node_modules/@maplibre/maplibre-gl-style-spec/bin/gl-style-migrate. Loading extensionless files is not supported inside of "type":"module" package.json contexts. The package.json file /root/.nvm/versions/node/v16.15.0/lib/node_modules/@maplibre/maplibre-gl-style-spec/package.json caused this "type":"module" context. Try changing /root/.nvm/versions/node/v16.15.0/lib/node_modules/@maplibre/maplibre-gl-style-spec/bin/gl-style-migrate to have a file extension. Note the "bin" field of package.json can point to a file with an extension, for example {"type":"module","bin":{"gl-style-migrate":"./bin/gl-style-migrate.js"}}
it also adds missing help information for 'gl-style-migrate' which did not exist before.
It also removes 'gl-style-composite' for #1981
CHANGELOG.md
under the## main
section.