sindresorhus / ow

Function argument validation for humans
https://sindresorhus.com/ow/
MIT License
3.8k stars 105 forks source link

Output ESM instead of CommonJS #225

Closed SimonSiefke closed 2 years ago

SimonSiefke commented 2 years ago

this would be a breaking change because of esm output

fixes #215

sindresorhus commented 2 years ago

CI is failing

sindresorhus commented 2 years ago

I'm willing to merge this now, but I won't release this until TS 4.5 final is out.

SimonSiefke commented 2 years ago

yeah, it's a bit unfortunate that ts-node doesn't support typescript-4.5 beta https://github.com/TypeStrong/ts-node/issues/1519

I think it would be compatible, just the semver (>=2.7) doesn't seem to allow beta release (4.5.0-beta)

I've now changed npm install to npm install --force so that ci (hopefully) passes

SimonSiefke commented 2 years ago

I also needed to upgrade ava and xo so that they support esm, but I think everything should work now. Sorry that the pr is very big now :(

sindresorhus commented 2 years ago

CI is failing because of https://github.com/xojs/xo/issues/599

sindresorhus commented 2 years ago

Alright. XO is fixed now. Can you fix the tests?

SimonSiefke commented 2 years ago

Node 14 CI Coverage is failing because of https://github.com/avajs/ava/issues/2417 Changed nyc to c8 which worked locally

Node 16 CI Tests are failing because of ESM Loader Change in Node 16.12.0 (which was released yesterday), which breaks ts-node I opened https://github.com/TypeStrong/ts-node/issues/1526

SimonSiefke commented 2 years ago

Updated ts-node, I think all should work now.

voxpelli commented 2 years ago

I'm looking into why xo fails in this PR as it seems to be related to my PR in https://github.com/xojs/xo/pull/624, though an npm install on a fresh checkout of this PR gives me:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: ow@0.28.1
npm ERR! Found: typescript@4.5.0-dev.20211027
npm ERR! node_modules/typescript
npm ERR!   dev typescript@"^4.5.0-beta" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@">=2.7" from ts-node@10.4.0
npm ERR! node_modules/ts-node
npm ERR!   dev ts-node@"^10.4.0" from the root project

Did you install using npm install, npm install --legacy-peer-deps or npm install --force @SimonSiefke @sindresorhus?

voxpelli commented 2 years ago

Posted about the cause of the https://github.com/xojs/xo/pull/624 related issue in that PR.

Though, as a separate issue, I don't think npm install --legacy-peer-deps or npm install --force should be required for ow, so if that's something this PR introduced, then if that can be avoided then that would be great 👍

voxpelli commented 2 years ago

👏 🎉

jonahsnider commented 2 years ago

I'm willing to merge this now, but I won't release this until TS 4.5 final is out.

TypeScript v4.5 has now been released, can this PR be released now @sindresorhus?

sindresorhus commented 2 years ago

Unfortunately not: https://github.com/sindresorhus/ow/pull/227#issuecomment-969125723