Conversation
0931d1a to
7c9f5b6
Compare
| argv = require('minimist')(process.argv.slice(2), { | ||
| boolean: 'clockwise' | ||
| }); | ||
| import rewind from "@mapbox/geojson-rewind"; |
There was a problem hiding this comment.
Why not import local module?
There was a problem hiding this comment.
It is the local module :)
This is a quirk/benefit of how the exports field in the package.json file works. It's a little safer because it allows the entry point to be renamed without breaking. I've done the same in the test module. Unfortunately import rewind from "./" doesn't seem to work, so the direct translation from CJS isn't an option (at least, I haven't managed to reproduce that behaviour).
The alternative is the direct local import, which would look like import rewind from "./index.js";. Happy to change to that if you prefer, though it is (very slightly) less robust.
4fda323 to
35b189c
Compare
|
Is there a way to get CI to run by the way, or is that something which has to be triggered by an admin? If there are travis issues I'd be happy to follow up with a GitHub Actions workflow for CI tasks. |
|
Sorry to bump again. I'd love to make progress with this. |
|
@mourner (you're the latest to commit, so apologies if I'm attracting the attention of the wrong person), I'd like to avoid this stagnating if I can... |
…o change to how the CLI looks)
… package.json for CJS consumers Build runs on the prepare npm life-cycle hook, so on install and before publish.
79b76db to
8c38b58
Compare
|
Rebased and updated the relevant bits. |
This PR updates the code to be in ES modules, and adds a build to retain compatibility with CJS contexts. To CJS users there should be no obvious change. One thing to note though, is that the CLI will now only work with Node 12.22 and up (all maintained versions of node are supported).
Closes #29