-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Switch style-spec scripts to native ESM #11538
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see this neglected part of the code being addressed! One thing that doesn't feel quite right to me in this approach is copying the scripts from GL JS to run the binaries — it's fragile and complicated. Could we simplify this somehow? Perhaps rely on the built version of the style spec instead so that we don't have to use the loader?
@@ -0,0 +1,20 @@ | |||
#!/usr/bin/env node | |||
/* eslint-disable import/no-unresolved, no-process-exit */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: import/no-unresolved
no longer needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately in that case we need to add the @mapbox/mapbox-gl-style-spec
as a dependency to itself, or silence ESLint with
/* eslint import/no-unresolved: [error, { ignore: ['^@mapbox/mapbox-gl-style-spec$'] }] */
I've updated the PR to ignore the unresolved @mapbox/mapbox-gl-style-spec
import
This PR converts style-spec scripts to native ESM and checks these scripts happy-path as a part of CI.
Closes #10965
Launch Checklist
mapbox-gl-js
changelog:<changelog>fix: convert style-spec scripts to native ESM</changelog>