arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.1k stars 61 forks source link

fix: use the browser field in the root `package.json` #155

Closed merceyz closed 7 months ago

merceyz commented 8 months ago

What's the problem this PR addresses?

https://github.com/arcanis/clipanion/pull/120 caused ./lib/advanced/Cli.mjs to contain an unqualified import to the platform folder instead of the files in it.

Fixes https://github.com/nodejs/corepack/pull/349#discussion_r1443780153

How did you fix it?

Import the node platform directly, remove the sources/platform/package.json file, and add a browser and module field to the publishConfig.

This let's bundlers pick the module version and if they're bundling for a browser replace ./lib/platform/node* with ./lib/platform/browser*.

arcanis commented 7 months ago

Released as 4.0.0-rc.3