Conversation
|
Would be great also to update yargs-parser https://github.com/yargs/yargs-parser/releases/tag/yargs-parser-v22.0.0 |
|
Perhaps |
|
Looks like this can be uncommented: https://github.com/bcoe/c8/blob/main/lib/parse-args.js#L176-L187 |
|
to support that, yargs 17 has an issue with node 25.7 (also see #581) which is fixed in yargs 18. do please update that dependecy file:///home/runner/work/SFMC-SDK/SFMC-SDK/node_modules/yargs/yargs:3 ReferenceError: require is not defined in ES module scope, you can use import instead Node.js v25.7.0 |
c8 depends on yargs ^17 which breaks on Node 25 due to CJS/ESM interop changes. Override yargs to ^18 (ESM-first) until c8 updates its dependency (bcoe/c8#578). Also restores node latest to the test matrix alongside 20 and 22. Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
c8 depends on yargs ^17 which breaks on Node 25 due to CJS/ESM interop changes. Override yargs to ^18 (ESM-first) until c8 updates its dependency (bcoe/c8#578). Also restores node latest to the test matrix alongside 20 and 22. Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
* fix: override yargs to v18 for Node 25 compatibility c8 depends on yargs ^17 which breaks on Node 25 due to CJS/ESM interop changes. Override yargs to ^18 (ESM-first) until c8 updates its dependency (bcoe/c8#578). Also restores node latest to the test matrix alongside 20 and 22. Signed-off-by: Tomer Figenblat <tomer@figenblat.com> * chore: bump minimum engines to node >= 20 and npm >= 10 yargs 18 requires Node >= 20.19.0. Node 18 is EOL since April 2025. Signed-off-by: Tomer Figenblat <tomer@figenblat.com> --------- Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
|
The import issue has been resolved -> #581 (comment) 🩹 |
|
While that's good news, getting c8 upgraded to use yargs 18 is still a good idea |
|
Working solution -> yargs/yargs#2509 (comment) |
| }, | ||
| "engines": { | ||
| "node": ">=12" | ||
| "node": "^20.19.0 || ^22.12.0 || >=23" |
There was a problem hiding this comment.
Technically, this is more restrictive than c8's supported Node.js version range
Line 67 in ee2f1cf
and hence would require a major version bump.
This is the strictest version range I could find (shared with yargs-parser)
|
It would be very nice ✨ to have this merged ⛜ and a new 🆕 version 🚀 released 📦, as |
Node 25.7.0 broke extensionless CJS scripts in "type": "module" packages, such as yargs/yargs in yargs 17.x imported by c8; this behavior was temporarily rolled back in Node 25.8.1 but is now restored in 26.0.0 and future versions. Until either yargs releases a backported fix for yargs 17.x, or c8 fixes its import statement, or c8 upgrades to yargs 18.x (all three of those efforts have been stalled for months), we need to work around this with an override. yargs/yargs#2509 yargs/yargs#2514 bcoe/c8#582 bcoe/c8#581 bcoe/c8#578 Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Node 25.7.0 broke extensionless CJS scripts in "type": "module" packages, such as yargs/yargs in yargs 17.x imported by c8; this behavior was temporarily rolled back in Node 25.8.1 but is now restored in 26.0.0 and future versions. Until either yargs releases a backported fix for yargs 17.x, or c8 fixes its import statement, or c8 upgrades to yargs 18.x (all three of those efforts have been stalled for months), we need to work around this with an override. yargs/yargs#2509 yargs/yargs#2514 bcoe/c8#582 bcoe/c8#581 bcoe/c8#578 Signed-off-by: Anders Kaseorg <andersk@mit.edu>
| "test-exclude": "^8.0.0", | ||
| "v8-to-istanbul": "^9.0.0", | ||
| "yargs": "^17.7.2", | ||
| "yargs": "^18.0.0", |
There was a problem hiding this comment.
What if we declare compatibility with both versions, to avoid the need for a major version bump pointed out in #578 (comment)?
| "yargs": "^18.0.0", | |
| "yargs": ">=17.7.2 && <19" |
Node 25.7.0 broke extensionless CJS scripts in "type": "module" packages, such as yargs/yargs in yargs 17.x imported by c8; this behavior was temporarily rolled back in Node 25.8.1 but is now restored in 26.0.0 and future versions. Until either yargs releases a backported fix for yargs 17.x, or c8 fixes its import statement, or c8 upgrades to yargs 18.x (all three of those efforts have been stalled for months), we need to work around this with an override. yargs/yargs#2509 yargs/yargs#2514 bcoe/c8#582 bcoe/c8#581 bcoe/c8#578 Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Node 25.7.0 broke extensionless CJS scripts in "type": "module" packages, such as yargs/yargs in yargs 17.x imported by c8; this behavior was temporarily rolled back in Node 25.8.1 but is now restored in 26.0.0 and future versions. Until either yargs releases a backported fix for yargs 17.x, or c8 fixes its import statement, or c8 upgrades to yargs 18.x (all three of those efforts have been stalled for months), we need to work around this with an override. yargs/yargs#2509 yargs/yargs#2514 bcoe/c8#582 bcoe/c8#581 bcoe/c8#578 Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Now that we've bumped the major due to a recent CVE, might as well update yargs to version with less build steps.