From c65f0e00c6c6d5b3007fe8a81916639f59c1fdf8 Mon Sep 17 00:00:00 2001 From: Charlie Brown Date: Wed, 13 Nov 2024 16:31:17 -0600 Subject: [PATCH] Make it pass with ts-jest --- package.json | 2 +- packages/victory-core/src/victory-util/log.ts | 6 +- pnpm-lock.yaml | 121 ++++++++---------- 3 files changed, 58 insertions(+), 71 deletions(-) diff --git a/package.json b/package.json index d5d5479fa..a34420563 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "storybook": "^8.4.1", "style-loader": "^4.0.0", "tailwindcss": "^3.3.0", - "ts-jest": "^29.1.2", + "ts-jest": "^29.2.5", "ts-loader": "^9.3.0", "ts-node": "^10.9.1", "typescript": "^4.7.3", diff --git a/packages/victory-core/src/victory-util/log.ts b/packages/victory-core/src/victory-util/log.ts index e2ce4667c..342328b85 100644 --- a/packages/victory-core/src/victory-util/log.ts +++ b/packages/victory-core/src/victory-util/log.ts @@ -1,9 +1,9 @@ -/* global console */ +/* global console process */ /* eslint-disable no-console */ -// TODO: Use "warning" npm module like React is switching to. export function warn(message: string) { - // @ts-expect-error This will be replaced by webpack DefinePlugin + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore - Webpack DefinePlugin will replace process.env.NODE_ENV if (process.env.NODE_ENV !== "production") { if (console && console.warn) { console.warn(message); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b29b9e6de..1c3b8cbee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -243,8 +243,8 @@ importers: specifier: ^3.3.0 version: 3.4.1(ts-node@10.9.1) ts-jest: - specifier: ^29.1.2 - version: 29.1.2(@babel/core@7.23.9)(babel-jest@29.7.0)(esbuild@0.18.20)(jest@29.7.0)(typescript@4.7.4) + specifier: ^29.2.5 + version: 29.2.5(@babel/core@7.23.9)(babel-jest@29.7.0)(esbuild@0.18.20)(jest@29.7.0)(typescript@4.7.4) ts-loader: specifier: ^9.3.0 version: 9.3.1(typescript@4.7.4)(webpack@5.74.0) @@ -6855,14 +6855,14 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.24 + '@types/node': 18.6.1 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.3.2 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.11.24)(ts-node@10.9.1) + jest-config: 29.7.0(@types/node@18.6.1)(ts-node@10.9.1) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -6896,7 +6896,7 @@ packages: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.11.24 + '@types/node': 18.6.1 jest-mock: 29.7.0 /@jest/expect-utils@29.7.0: @@ -6922,7 +6922,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.11.24 + '@types/node': 18.6.1 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -7051,7 +7051,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 20.11.24 + '@types/node': 18.6.1 '@types/yargs': 17.0.10 chalk: 4.1.2 @@ -9244,7 +9244,7 @@ packages: /@types/bonjour@3.5.10: resolution: {integrity: sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==} dependencies: - '@types/node': 20.11.24 + '@types/node': 18.6.1 /@types/btoa-lite@1.0.1: resolution: {integrity: sha512-YwCjy5v1THSaj5KrBz0SKwKYtjwT0YpOm8VB4TR6DzyvTa503T+rE0Ku6Q3DUKtm1rzNrEXyqdYHpcLiYN6oXg==} @@ -9254,7 +9254,7 @@ packages: resolution: {integrity: sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==} dependencies: '@types/express-serve-static-core': 4.17.29 - '@types/node': 20.11.24 + '@types/node': 18.6.1 /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} @@ -9433,7 +9433,7 @@ packages: /@types/jsdom@20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: - '@types/node': 20.11.24 + '@types/node': 18.6.1 '@types/tough-cookie': 4.0.2 parse5: 7.1.2 dev: true @@ -9444,7 +9444,7 @@ packages: /@types/jsonfile@6.1.3: resolution: {integrity: sha512-/yqTk2SZ1wIezK0hiRZD7RuSf4B3whFxFamB1kGStv+8zlWScTMcHanzfc0XKWs5vA1TkHeckBlOyM8jxU8nHA==} dependencies: - '@types/node': 20.11.24 + '@types/node': 18.6.1 dev: true /@types/jsonwebtoken@9.0.4: @@ -9589,12 +9589,12 @@ packages: resolution: {integrity: sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==} dependencies: '@types/mime': 1.3.2 - '@types/node': 20.11.24 + '@types/node': 18.6.1 /@types/sockjs@0.3.33: resolution: {integrity: sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==} dependencies: - '@types/node': 20.11.24 + '@types/node': 18.6.1 /@types/stack-utils@2.0.1: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} @@ -9622,7 +9622,7 @@ packages: /@types/ws@8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 20.11.24 + '@types/node': 18.6.1 dev: true /@types/yargs-parser@21.0.0: @@ -10452,6 +10452,10 @@ packages: /async-limiter@1.0.1: resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==} + /async@3.2.6: + resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} + dev: true + /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -13228,6 +13232,14 @@ packages: /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + /ejs@3.1.10: + resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} + engines: {node: '>=0.10.0'} + hasBin: true + dependencies: + jake: 10.9.2 + dev: true + /electron-to-chromium@1.4.645: resolution: {integrity: sha512-EeS1oQDCmnYsRDRy2zTeC336a/4LZ6WKqvSaM1jLocEk5ZuyszkQtCpsqvuvaIXGOUjwtvF6LTcS8WueibXvSw==} @@ -14238,6 +14250,12 @@ packages: webpack: 5.96.1 dev: false + /filelist@1.0.4: + resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} + dependencies: + minimatch: 5.1.0 + dev: true + /filesize@10.1.6: resolution: {integrity: sha512-sJslQKU2uM33qH5nqewAwVB2QgR6w1aMNsYUp3aN5rMRyXEwJGmZvaWzeJFNTOXWlHQyBFCWrdj3fV/fsTOX8w==} engines: {node: '>= 10.4.0'} @@ -16159,6 +16177,17 @@ packages: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + /jake@10.9.2: + resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + async: 3.2.6 + chalk: 4.1.2 + filelist: 1.0.4 + minimatch: 3.1.2 + dev: true + /jest-changed-files@29.7.0: resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -16266,47 +16295,6 @@ packages: - supports-color dev: true - /jest-config@29.7.0(@types/node@20.11.24)(ts-node@10.9.1): - resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - dependencies: - '@babel/core': 7.23.9 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - '@types/node': 20.11.24 - babel-jest: 29.7.0(@babel/core@7.23.9) - chalk: 4.1.2 - ci-info: 3.3.2 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0 - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - ts-node: 10.9.1(@swc/core@1.8.0)(@types/node@18.6.1)(typescript@4.7.4) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - dev: true - /jest-diff@29.7.0: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -16429,7 +16417,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.11.24 + '@types/node': 18.6.1 jest-util: 29.7.0 /jest-pnp-resolver@1.2.2(jest-resolve@29.7.0): @@ -16566,7 +16554,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 20.11.24 + '@types/node': 18.6.1 chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.11 @@ -22586,12 +22574,13 @@ packages: /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - /ts-jest@29.1.2(@babel/core@7.23.9)(babel-jest@29.7.0)(esbuild@0.18.20)(jest@29.7.0)(typescript@4.7.4): - resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==} - engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0} + /ts-jest@29.2.5(@babel/core@7.23.9)(babel-jest@29.7.0)(esbuild@0.18.20)(jest@29.7.0)(typescript@4.7.4): + resolution: {integrity: sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==} + engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/transform': ^29.0.0 '@jest/types': ^29.0.0 babel-jest: ^29.0.0 esbuild: '*' @@ -22600,6 +22589,8 @@ packages: peerDependenciesMeta: '@babel/core': optional: true + '@jest/transform': + optional: true '@jest/types': optional: true babel-jest: @@ -22610,6 +22601,7 @@ packages: '@babel/core': 7.23.9 babel-jest: 29.7.0(@babel/core@7.23.9) bs-logger: 0.2.6 + ejs: 3.1.10 esbuild: 0.18.20 fast-json-stable-stringify: 2.1.0 jest: 29.7.0(@types/node@18.6.1)(ts-node@10.9.1) @@ -22617,9 +22609,9 @@ packages: json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 - semver: 7.5.4 + semver: 7.6.3 typescript: 4.7.4 - yargs-parser: 21.0.1 + yargs-parser: 21.1.1 dev: true /ts-loader@9.3.1(typescript@4.7.4)(webpack@5.74.0): @@ -24155,11 +24147,6 @@ packages: camelcase: 5.3.1 decamelize: 1.2.0 - /yargs-parser@21.0.1: - resolution: {integrity: sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==} - engines: {node: '>=12'} - dev: true - /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'}