From 15f8c8e0c11905f71e46feefb2ea9375a7763a6f Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Sun, 15 Sep 2024 16:43:20 +0200 Subject: [PATCH] chore: update ogc-client Several more dependencies are now only available in ESM only, so they need to be transformed for Jest. --- jest.preset.js | 15 ++++++++- package-lock.json | 74 ++++++++++++++------------------------------ package.json | 2 +- package/package.json | 2 +- 4 files changed, 39 insertions(+), 54 deletions(-) diff --git a/jest.preset.js b/jest.preset.js index e7f46ce016..8c67db3562 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -1,11 +1,24 @@ const nxPreset = require('@nx/jest/preset').default +const npmDependenciesOnlyInEsm = [ + 'color-*', + 'ol', + '@mapbox', + '@geospatial-sdk', + '@camptocamp/ogc-client', + 'node-fetch', + 'data-uri-to-buffer', + 'fetch-blob', + 'formdata-polyfill', + '.*.mjs', +] + module.exports = { ...nxPreset, coverageReporters: ['text'], setupFiles: ['jest-canvas-mock'], transformIgnorePatterns: [ - 'node_modules/(?!(color-*|ol|@mapbox|@geospatial-sdk|@camptocamp/ogc-client|.*.mjs$))', + `node_modules/(?!(${npmDependenciesOnlyInEsm.join('|')}))`, ], transform: { '^.+\\.(ts|mjs|js|html)$': [ diff --git a/package-lock.json b/package-lock.json index 0c6dd3b64d..0ef179e543 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@angular/router": "^16.2", "@bartholomej/ngx-translate-extract": "^8.0.2", "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", - "@camptocamp/ogc-client": "1.1.1-dev.ad6d9ab", + "@camptocamp/ogc-client": "1.1.1-dev.c75dcba", "@geospatial-sdk/core": "^0.0.5-dev.20", "@geospatial-sdk/geocoding": "^0.0.5-dev.20", "@geospatial-sdk/openlayers": "^0.0.5-dev.20", @@ -3739,11 +3739,12 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/@camptocamp/ogc-client": { - "version": "1.1.1-dev.ad6d9ab", - "resolved": "https://registry.npmjs.org/@camptocamp/ogc-client/-/ogc-client-1.1.1-dev.ad6d9ab.tgz", - "integrity": "sha512-YK0xaVij5bScgYeXJKIItLu6eoVC/lrCIoH5UepkXG3oUSERnFNs60PumwwH8mAWclV2AAPeOwFe60dNvY356Q==", + "version": "1.1.1-dev.c75dcba", + "resolved": "https://registry.npmjs.org/@camptocamp/ogc-client/-/ogc-client-1.1.1-dev.c75dcba.tgz", + "integrity": "sha512-Zz7nz6Rcf9JQG/MjW9sU69BLTFqBd7samrl4x55Pbmp9WpmVVsgEANJduVkiUGJ8A/y97LAR3h3/i5DZVs7Z8Q==", "dependencies": { - "@rgrove/parse-xml": "^4.1.0" + "@rgrove/parse-xml": "^4.1.0", + "node-fetch": "^3.3.1" }, "peerDependencies": { "ol": ">5.x", @@ -3766,6 +3767,23 @@ "node": ">=14.0.0" } }, + "node_modules/@camptocamp/ogc-client/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -4447,52 +4465,6 @@ "proj4": "^2.9.2" } }, - "node_modules/@geospatial-sdk/core/node_modules/@camptocamp/ogc-client": { - "version": "1.1.1-dev.c75dcba", - "resolved": "https://registry.npmjs.org/@camptocamp/ogc-client/-/ogc-client-1.1.1-dev.c75dcba.tgz", - "integrity": "sha512-Zz7nz6Rcf9JQG/MjW9sU69BLTFqBd7samrl4x55Pbmp9WpmVVsgEANJduVkiUGJ8A/y97LAR3h3/i5DZVs7Z8Q==", - "dependencies": { - "@rgrove/parse-xml": "^4.1.0", - "node-fetch": "^3.3.1" - }, - "peerDependencies": { - "ol": ">5.x", - "proj4": ">2.8" - }, - "peerDependenciesMeta": { - "ol": { - "optional": true - }, - "proj4": { - "optional": true - } - } - }, - "node_modules/@geospatial-sdk/core/node_modules/@rgrove/parse-xml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@rgrove/parse-xml/-/parse-xml-4.1.0.tgz", - "integrity": "sha512-pBiltENdy8SfI0AeR1e5TRpS9/9Gl0eiOEt6ful2jQfzsgvZYWqsKiBWaOCLdocQuk0wS7KOHI37n0C1pnKqTw==", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@geospatial-sdk/core/node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, "node_modules/@geospatial-sdk/geocoding": { "version": "0.0.5-dev.20", "resolved": "https://registry.npmjs.org/@geospatial-sdk/geocoding/-/geocoding-0.0.5-dev.20.tgz", diff --git a/package.json b/package.json index e389d20a74..ff13656c08 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@angular/router": "^16.2", "@bartholomej/ngx-translate-extract": "^8.0.2", "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", - "@camptocamp/ogc-client": "1.1.1-dev.ad6d9ab", + "@camptocamp/ogc-client": "1.1.1-dev.c75dcba", "@geospatial-sdk/core": "^0.0.5-dev.20", "@geospatial-sdk/geocoding": "^0.0.5-dev.20", "@geospatial-sdk/openlayers": "^0.0.5-dev.20", diff --git a/package/package.json b/package/package.json index 61e635c3a4..b63e6793b6 100644 --- a/package/package.json +++ b/package/package.json @@ -38,7 +38,7 @@ }, "dependencies": { "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", - "@camptocamp/ogc-client": "1.1.1-dev.ad6d9ab", + "@camptocamp/ogc-client": "1.1.1-dev.c75dcba", "@geospatial-sdk/core": "^0.0.5-dev.20", "@geospatial-sdk/geocoding": "^0.0.5-dev.20", "@geospatial-sdk/openlayers": "^0.0.5-dev.20",