mikeal / ipjs

Universal JavaScript Build and Packaging
41 stars 4 forks source link

feat: windows support and drop 12.x + add 16.x in CI #21

Closed rvagg closed 2 years ago

rvagg commented 2 years ago

I'm leaving out windows-latest from CI because estest uses a #!/bin/sh to get a strict unhandled rejections flag in; and I'm already 5 steps deep into this epic yak shave already and I have to stop somewhere! This works though, tested locally.

Currently the main dist exports map looks like this on Windows:

  "exports": {
    ".": {
      "browser": "./esm\\src\\index.js",
      "require": "./cjs\\src\\index.js",
      "import": "./esm\\src\\index.js"
    },
    ...

And the esm/package.json looks like this:

{
  "type": "module",
  "browser": {
    "./src\\hashes\\sha2.js": "./src\\hashes\\sha2-browser.js"
  }
}

So in the latter case it's both keys and values that are messed up. I've avoided using the path.posix.* route because it's really hard to get right for this kind of case and we know we're dealing with only local and (presumably) simply named paths so a basic replace should be good enough.

rvagg commented 2 years ago

added 12.x support in CI back in, it still works and it's not breaking

rvagg commented 2 years ago

I'm considering js-multiformats to be the CI test for this on windows (until [if] we get estest windows compatible): https://github.com/multiformats/js-multiformats/pull/136 🥳