diff --git a/.changeset/floppy-cows-stare.md b/.changeset/floppy-cows-stare.md new file mode 100644 index 000000000..aa7217323 --- /dev/null +++ b/.changeset/floppy-cows-stare.md @@ -0,0 +1,5 @@ +--- +'@openfn/cli': patch +--- + +Update undici version diff --git a/packages/cli/package.json b/packages/cli/package.json index ade33cf32..4d4327f04 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -66,7 +66,7 @@ "json-diff": "^1.0.6", "rimraf": "^6.1.3", "treeify": "^1.1.0", - "undici": "6.24.1", + "undici": "8.5.0", "ws": "^8.19.0", "yargs": "^17.7.2" }, diff --git a/packages/cli/src/projects/util.ts b/packages/cli/src/projects/util.ts index 7f446fd22..548cee720 100644 --- a/packages/cli/src/projects/util.ts +++ b/packages/cli/src/projects/util.ts @@ -108,7 +108,8 @@ export const getLightningUrl = ( } const params = new URLSearchParams(); snapshots?.forEach((snapshot) => params.append('snapshots[]', snapshot)); - return new URL(`/api/provision/${path}?${params.toString()}`, endpoint); + const query = params.toString(); + return new URL(`/api/provision/${path}${query ? `?${query}` : ''}`, endpoint); }; // TODO move to client.ts diff --git a/packages/cli/test/projects/deploy.test.ts b/packages/cli/test/projects/deploy.test.ts index b0c1774e5..3e5ee3d40 100644 --- a/packages/cli/test/projects/deploy.test.ts +++ b/packages/cli/test/projects/deploy.test.ts @@ -2,6 +2,7 @@ import { writeFile } from 'node:fs/promises'; import test from 'ava'; import mock from 'mock-fs'; import path from 'node:path'; +import { createRequire } from 'node:module'; import Project, { generateWorkflow } from '@openfn/project'; import { createMockLogger } from '@openfn/logger'; import createLightningServer from '@openfn/lightning-mock'; @@ -30,6 +31,8 @@ const ENDPOINT = `http://localhost:${port}`; const projectYaml = myProject_yaml.replace('https://app.openfn.org', ENDPOINT); const two_workflows_yaml = twowfs.replace('https://app.openfn.org', ENDPOINT); +const require = createRequire(import.meta.url); + const mockFs = (paths: Record) => { // ensure this path is available to pnpm (needed by deps for some reason??) // Note: loading all of pnpm takes ~7 seconds per test @@ -37,8 +40,15 @@ const mockFs = (paths: Record) => { const iconv = path.resolve( '../../node_modules/.pnpm/iconv-lite@0.4.24/node_modules/iconv-lite/encodings' ); + // undici v8 reads its llhttp WASM from disk on the first request, so keep + // that dir visible or fetches to the mock server fail with ENOENT + const undiciLlhttp = path.join( + path.dirname(require.resolve('undici')), + 'lib/llhttp' + ); mock({ [iconv]: mock.load(iconv, {}), + [undiciLlhttp]: mock.load(undiciLlhttp, {}), ...paths, }); }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f6c86ac69..bc758721a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -210,8 +210,8 @@ importers: specifier: ^1.1.0 version: 1.1.0 undici: - specifier: 6.24.1 - version: 6.24.1 + specifier: 8.5.0 + version: 8.5.0 ws: specifier: ^8.19.0 version: 8.19.0 @@ -3494,8 +3494,8 @@ packages: mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - nanoid@3.3.12: - resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==} + nanoid@3.3.15: + resolution: {integrity: sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -4235,18 +4235,18 @@ packages: resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==} engines: {node: '>=14.0'} - undici@6.24.1: - resolution: {integrity: sha512-sC+b0tB1whOCzbtlx20fx3WgCXwkW627p4EA9uM+/tNNPkSS+eSEld6pAs9nDv7WbY1UUljBMYPtu9BCOrCWKA==} - engines: {node: '>=18.17'} - undici@7.24.4: resolution: {integrity: sha512-BM/JzwwaRXxrLdElV2Uo6cTLEjhSb3WXboncJamZ15NgUURmvlXvxa6xkwIOILIjPNo9i8ku136ZvWV0Uly8+w==} engines: {node: '>=20.18.1'} - undici@7.25.0: - resolution: {integrity: sha512-xXnp4kTyor2Zq+J1FfPI6Eq3ew5h6Vl0F/8d9XU5zZQf1tX9s2Su1/3PiMmUANFULpmksxkClamIZcaUqryHsQ==} + undici@7.28.0: + resolution: {integrity: sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==} engines: {node: '>=20.18.1'} + undici@8.5.0: + resolution: {integrity: sha512-xamtWoB1EshgjpmlXd7GGm2VfdDtw1+rD8uhry8pSNW3If6S8E0m2T2+orSKeZXEn/aPJMviCpDBA65WJt8zhg==} + engines: {node: '>=22.19.0'} + universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -4912,13 +4912,13 @@ snapshots: dependencies: '@openfn/language-common': 3.2.3 stream-json: 1.9.1 - undici: 7.24.4 + undici: 7.28.0 '@openfn/language-collections@0.9.0': dependencies: '@openfn/language-common': 3.3.1 stream-json: 1.9.1 - undici: 7.25.0 + undici: 7.28.0 '@openfn/language-common@2.0.1': dependencies: @@ -4951,7 +4951,7 @@ snapshots: http-status-codes: 2.3.0 jsonpath-plus: 10.4.0 lodash: 4.18.1 - undici: 7.25.0 + undici: 7.28.0 '@openfn/language-http@6.4.3': dependencies: @@ -7109,7 +7109,7 @@ snapshots: object-assign: 4.1.1 thenify-all: 1.6.0 - nanoid@3.3.12: + nanoid@3.3.15: optional: true negotiator@0.6.3: {} @@ -7338,7 +7338,7 @@ snapshots: postcss@8.5.8: dependencies: - nanoid: 3.3.12 + nanoid: 3.3.15 picocolors: 1.1.1 source-map-js: 1.2.1 optional: true @@ -7923,11 +7923,11 @@ snapshots: dependencies: '@fastify/busboy': 2.1.1 - undici@6.24.1: {} - undici@7.24.4: {} - undici@7.25.0: {} + undici@7.28.0: {} + + undici@8.5.0: {} universalify@0.1.2: {}