* Require a Node version where `require()` of an ES module works natively, so * published packages can depend on ESM-only modules without breaking CommonJS * consumers. Node 20 is EOL, so we require Node 22.12+, where `require(esm)` is * unflagged; earlier versions throw `ERR_REQUIRE_ESM`. * *
({ Yarn })
| 43 | * @param {Context} context |
| 44 | */ |
| 45 | function enforceNodeEngineOnPackages({ Yarn }) { |
| 46 | const nodeEngine = '>=22.12.0' |
| 47 | for (const workspace of Yarn.workspaces()) { |
| 48 | // only the published library packages under packages/* |
| 49 | if (!workspace.cwd.startsWith('packages/')) continue |
| 50 | workspace.set(['engines', 'node'], nodeEngine) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | module.exports = defineConfig({ |
| 55 | constraints: async (ctx) => { |
no test coverage detected
searching dependent graphs…