From a9c96e453d4c884cd29a6f668089dd0f04d254ca Mon Sep 17 00:00:00 2001 From: Joachim Schuler Date: Mon, 24 Feb 2025 15:38:45 -0500 Subject: [PATCH 1/4] Add knip Signed-off-by: Joachim Schuler --- cypress/tsconfig.json | 30 +--- knip.json | 7 + package.json | 4 +- packages/common/tsconfig.json | 30 +--- .../forklift-console-plugin/tsconfig.json | 30 +--- tsconfig.json | 29 +++ yarn.lock | 165 +++++++++++++++++- 7 files changed, 203 insertions(+), 92 deletions(-) create mode 100644 knip.json create mode 100644 tsconfig.json diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json index e09578f73..7b7deb870 100644 --- a/cypress/tsconfig.json +++ b/cypress/tsconfig.json @@ -1,35 +1,9 @@ { - "$schema": "https://json.schemastore.org/tsconfig", + "extends": "../tsconfig.json", "compilerOptions": { - "allowJs": true, - "strict": false, - "allowSyntheticDefaultImports": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "noUnusedLocals": true, - - "target": "es2020", - "module": "es2020", - "moduleResolution": "node", - "sourceMap": true, - "declaration": true, - "declarationMap": true, - "jsx": "react", - - "lib": ["dom", "es2020"], - "esModuleInterop": true, - "types": ["cypress", "@testing-library/cypress"] }, - "include": ["**/*.ts"], - - "ts-node": { - "files": true, - "transpileOnly": true, - "compilerOptions": { - "module": "commonjs" - } - } + "include": ["**/*.ts"] } diff --git a/knip.json b/knip.json new file mode 100644 index 000000000..3f583695c --- /dev/null +++ b/knip.json @@ -0,0 +1,7 @@ +{ + "workspaces": { + "packages/forklift-console-plugin": { + "entry": "index.ts" + } + } + } \ No newline at end of file diff --git a/package.json b/package.json index 7c1b62391..21e7ca6ff 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "e2e:console": "bash ./ci/deploy-console.sh", "e2e:pre-test": "yarn run e2e:cluster && yarn run e2e:build && yarn run e2e:deployCrds && yarn run e2e:console", "storybook": "yarn workspace @kubev2v/common run storybook dev -p 6006", - "storybook:build": "yarn workspace @kubev2v/common run storybook build" + "storybook:build": "yarn workspace @kubev2v/common run storybook build", + "knip": "knip" }, "devDependencies": { "@cspell/eslint-plugin": "^6.31.1", @@ -62,6 +63,7 @@ "i18next-parser": "^9.3.0", "jest": "^28.1.3", "jest-environment-jsdom": "^28.1.3", + "knip": "^5.44.5", "prettier": "^2.7.1", "rollup": "^4.22.4", "rollup-plugin-analyzer": "^4.0.0", diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json index 721306ed0..5fded7f41 100644 --- a/packages/common/tsconfig.json +++ b/packages/common/tsconfig.json @@ -1,37 +1,11 @@ { - "$schema": "https://json.schemastore.org/tsconfig", + "extends": "../../tsconfig.json", "compilerOptions": { - "allowJs": true, - "strict": false, - "allowSyntheticDefaultImports": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "noUnusedLocals": true, - - "target": "es2020", - "module": "es2020", - "moduleResolution": "node", - "sourceMap": true, - "declaration": true, - "declarationMap": true, - "jsx": "react", - - "lib": ["dom", "es2020"], - "esModuleInterop": true, - "outDir": "./dist", "rootDir": "./src" }, "include": ["./src/**/*"], - "exclude": ["./src/components-stories/**/*", "./src/components-stories/*"], - - "ts-node": { - "files": true, - "transpileOnly": true, - "compilerOptions": { - "module": "commonjs" - } - } + "exclude": ["./src/components-stories/**/*", "./src/components-stories/*"] } diff --git a/packages/forklift-console-plugin/tsconfig.json b/packages/forklift-console-plugin/tsconfig.json index 0746ab8b5..7540b23e6 100644 --- a/packages/forklift-console-plugin/tsconfig.json +++ b/packages/forklift-console-plugin/tsconfig.json @@ -1,25 +1,7 @@ { - "$schema": "https://json.schemastore.org/tsconfig", + "extends": "../../tsconfig.json", "compilerOptions": { - "allowJs": true, - "strict": false, - "allowSyntheticDefaultImports": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "noUnusedLocals": true, - - "target": "es2020", - "module": "es2020", - "moduleResolution": "node", - "sourceMap": true, - "declaration": true, - "declarationMap": true, - "jsx": "react", - - "lib": ["dom", "es2020"], - "esModuleInterop": true, - "baseUrl": ".", "outDir": "./dist", @@ -29,13 +11,5 @@ } }, - "include": ["./src/**/*", "./plugin-metadata.ts", "./plugin-extensions.ts"], - - "ts-node": { - "files": true, - "transpileOnly": true, - "compilerOptions": { - "module": "commonjs" - } - } + "include": ["./src/**/*", "./plugin-metadata.ts", "./plugin-extensions.ts"] } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..37fc17f44 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + + "compilerOptions": { + "allowJs": true, + "strict": false, + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "noUnusedLocals": true, + "target": "es2020", + "module": "es2020", + "moduleResolution": "node", + "sourceMap": true, + "declaration": true, + "declarationMap": true, + "jsx": "react", + "lib": ["dom", "es2020"], + "esModuleInterop": true, + }, + + "ts-node": { + "files": true, + "transpileOnly": true, + "compilerOptions": { + "module": "commonjs" + } + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 7ac6c6111..287f534dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1322,11 +1322,32 @@ "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" +"@nodelib/fs.scandir@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-4.0.1.tgz#4b981a1d6e34e2baff9a33c84b57709e30e8ce30" + integrity sha512-vAkI715yhnmiPupY+dq+xenu5Tdf2TBQ66jLvBIcCddtz+5Q8LbMKaf9CIJJreez8fQ8fgaY+RaywQx8RJIWpw== + dependencies: + "@nodelib/fs.stat" "4.0.0" + run-parallel "^1.2.0" + "@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": version "2.0.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== +"@nodelib/fs.stat@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-4.0.0.tgz#d609b10d9c17dac012c4d7be93602ed939861e58" + integrity sha512-ctr6bByzksKRCV0bavi8WoQevU6plSp2IkllIsEqaiKe2mwNNnaluhnRhcsgGZHrrHk57B3lf95MkLMO3STYcg== + +"@nodelib/fs.walk@3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-3.0.1.tgz#717a03eb1d07c09db32f884a5d0c06ccd9b657f4" + integrity sha512-nIh/M6Kh3ZtOmlY00DaUYB4xeeV6F3/ts1l29iwl3/cfyY/OuCfUx+v08zgx8TKPTifXRcjjqVQ4KB2zOYSbyw== + dependencies: + "@nodelib/fs.scandir" "4.0.1" + fastq "^1.15.0" + "@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" @@ -1606,6 +1627,15 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@snyk/github-codeowners@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@snyk/github-codeowners/-/github-codeowners-1.1.0.tgz#45b99732c3c38b5f5b47e43d2b0c9db67a6d2bcc" + integrity sha512-lGFf08pbkEac0NYgVf4hdANpAgApRjNByLXB+WBip3qj1iendOIyAwP2GKkKbQMNVy2r1xxDf0ssfWscoiC+Vw== + dependencies: + commander "^4.1.1" + ignore "^5.1.8" + p-map "^4.0.0" + "@storybook/addon-actions@8.3.3": version "8.3.3" resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-8.3.3.tgz#6b3289071fa887eb08aa858aa64a87e93f0bb440" @@ -2509,9 +2539,9 @@ undici-types "~6.19.2" "@types/node@^20.16.6": - version "20.16.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.16.10.tgz#0cc3fdd3daf114a4776f54ba19726a01c907ef71" - integrity sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA== + version "20.17.19" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.19.tgz#0f2869555719bef266ca6e1827fcdca903c1a697" + integrity sha512-LEwC7o1ifqg/6r2gn9Dns0f1rhK+fPFDoMiceTJ6kWmVk6bgXBI/9IOWfVan4WiAavK9pIVWdX0/e3J+eEUh5A== dependencies: undici-types "~6.19.2" @@ -4053,6 +4083,11 @@ clone-stats@^1.0.0: resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" integrity sha512-au6ydSpg6nsrigcZ4m8Bc9hxjeW+GJ8xh5G3BJCMt4WXe1H10UNaVOamqQTmrx1kjVuxAHIQSNU6hY4Nsn9/ag== +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== + clone@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" @@ -4129,6 +4164,11 @@ commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" + integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== + commander@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" @@ -4739,6 +4779,13 @@ default-browser@^5.2.1: bundle-name "^4.1.0" default-browser-id "^5.0.0" +defaults@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== + dependencies: + clone "^1.0.2" + define-data-property@^1.0.1, define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" @@ -4951,6 +4998,15 @@ dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" +easy-table@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/easy-table/-/easy-table-1.2.0.tgz#ba9225d7138fee307bfd4f0b5bc3c04bdc7c54eb" + integrity sha512-OFzVOv03YpvtcWGe5AayU5G2hgybsg3iqA6drU8UaoZyB9jLGMTrz9+asnLp/E+6qPh88yEI1gvyZFZ41dmgww== + dependencies: + ansi-regex "^5.0.1" + optionalDependencies: + wcwidth "^1.0.1" + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -5021,6 +5077,14 @@ enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0, enhanced-resolve@^5.17.1, enh graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.18.0: + version "5.18.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz#728ab082f8b7b6836de51f1637aab5d3b9568faf" + integrity sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enquirer@^2.3.6: version "2.4.1" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" @@ -5696,6 +5760,17 @@ fast-glob@^3.2.11, fast-glob@^3.2.12, fast-glob@^3.2.9, fast-glob@^3.3.0: merge2 "^1.3.0" micromatch "^4.0.4" +fast-glob@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" + integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.8" + fast-json-parse@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/fast-json-parse/-/fast-json-parse-1.0.3.tgz#43e5c61ee4efa9265633046b770fb682a7577c4d" @@ -5721,7 +5796,7 @@ fastest-levenshtein@^1.0.12, fastest-levenshtein@^1.0.16: resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== -fastq@^1.13.0: +fastq@^1.13.0, fastq@^1.15.0: version "1.19.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.19.0.tgz#a82c6b7c2bb4e44766d865f07997785fecfdcb89" integrity sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA== @@ -6621,7 +6696,7 @@ ieee754@^1.1.13, ieee754@^1.2.1: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^5.2.0, ignore@^5.2.1, ignore@^5.2.4: +ignore@^5.1.8, ignore@^5.2.0, ignore@^5.2.1, ignore@^5.2.4: version "5.3.2" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== @@ -7570,6 +7645,11 @@ jest@^28.1.3: import-local "^3.0.2" jest-cli "^28.1.3" +jiti@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-2.4.2.tgz#d19b7732ebb6116b06e2038da74a55366faef560" + integrity sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A== + js-base64@^3.7.7: version "3.7.7" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79" @@ -7755,6 +7835,28 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +knip@^5.44.5: + version "5.44.5" + resolved "https://registry.yarnpkg.com/knip/-/knip-5.44.5.tgz#9a3474d0afc312304524af28298294d03acd8699" + integrity sha512-qXHVRsipmxZNKVb5IWUVHwQtr96Dfo3vnWszRgwMI2VhsW9EBi7b/2YlELrrqfPr0lwVnwhUUuNgYwvke+PdGA== + dependencies: + "@nodelib/fs.walk" "3.0.1" + "@snyk/github-codeowners" "1.1.0" + easy-table "1.2.0" + enhanced-resolve "^5.18.0" + fast-glob "^3.3.3" + jiti "^2.4.2" + js-yaml "^4.1.0" + minimist "^1.2.8" + picocolors "^1.1.0" + picomatch "^4.0.1" + pretty-ms "^9.0.0" + smol-toml "^1.3.1" + strip-json-comments "5.0.1" + summary "2.1.0" + zod "^3.22.4" + zod-validation-error "^3.0.3" + known-css-properties@^0.26.0: version "0.26.0" resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.26.0.tgz#008295115abddc045a9f4ed7e2a84dc8b3a77649" @@ -8090,7 +8192,7 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: +micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5, micromatch@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -8555,6 +8657,11 @@ parse-json@^5.0.0, parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +parse-ms@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-4.0.0.tgz#c0c058edd47c2a590151a718990533fd62803df4" + integrity sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw== + parse5-htmlparser2-tree-adapter@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz#23c2cc233bcf09bb7beba8b8a69d46b08c62c2f1" @@ -8667,6 +8774,11 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" + integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== + pify@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -8829,6 +8941,13 @@ pretty-format@^29.0.0, pretty-format@^29.7.0: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-ms@^9.0.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-9.2.0.tgz#e14c0aad6493b69ed63114442a84133d7e560ef0" + integrity sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg== + dependencies: + parse-ms "^4.0.0" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -9509,7 +9628,7 @@ run-applescript@^7.0.0: resolved "https://registry.yarnpkg.com/run-applescript/-/run-applescript-7.0.0.tgz#e5a553c2bffd620e169d276c1cd8f1b64778fbeb" integrity sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A== -run-parallel@^1.1.9: +run-parallel@^1.1.9, run-parallel@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== @@ -9795,6 +9914,11 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +smol-toml@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/smol-toml/-/smol-toml-1.3.1.tgz#d9084a9e212142e3cab27ef4e2b8e8ba620bfe15" + integrity sha512-tEYNll18pPKHroYSmLLrksq233j021G0giwW7P3D24jC54pQ5W5BXMsQ/Mvw1OJCmEYDgY+lrzT+3nNUtoNfXQ== + sockjs@^0.3.24: version "0.3.24" resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce" @@ -10104,6 +10228,11 @@ strip-indent@^4.0.0: dependencies: min-indent "^1.0.1" +strip-json-comments@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-5.0.1.tgz#0d8b7d01b23848ed7dbdf4baaaa31a8250d8cfa0" + integrity sha512-0fk9zBqO67Nq5M/m45qHCJxylV/DhBlIOVExqgOMiCCrzrhU6tCibRXNqE3jwJLftzE9SNuZtYbpzcO+i9FiKw== + strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -10185,6 +10314,11 @@ stylelint@^14.9.1: v8-compile-cache "^2.3.0" write-file-atomic "^4.0.2" +summary@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/summary/-/summary-2.1.0.tgz#be8a49a0aa34eb6ceea56042cae88f8add4b0885" + integrity sha512-nMIjMrd5Z2nuB2RZCKJfFMjgS3fygbeyGk9PxPPaJR1RIcyN9yn4A63Isovzm3ZtQuEkLBVgMdPup8UeLH7aQw== + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -11250,6 +11384,13 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== + dependencies: + defaults "^1.0.3" + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -11708,3 +11849,13 @@ yup@^0.32.11: nanoclone "^0.2.1" property-expr "^2.0.4" toposort "^2.0.2" + +zod-validation-error@^3.0.3: + version "3.4.0" + resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-3.4.0.tgz#3a8a1f55c65579822d7faa190b51336c61bee2a6" + integrity sha512-ZOPR9SVY6Pb2qqO5XHt+MkkTRxGXb4EVtnjc9JpXUOtUB1T9Ru7mZOT361AN3MsetVe7R0a1KZshJDZdgp9miQ== + +zod@^3.22.4: + version "3.24.2" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.2.tgz#8efa74126287c675e92f46871cfc8d15c34372b3" + integrity sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ== From 30b27f7275a7558a002e9d533ca12acbbb447294 Mon Sep 17 00:00:00 2001 From: Joachim Schuler Date: Mon, 24 Feb 2025 15:49:01 -0500 Subject: [PATCH 2/4] Remove knip.json since knip knows workspaces from package.json Signed-off-by: Joachim Schuler --- knip.json | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 knip.json diff --git a/knip.json b/knip.json deleted file mode 100644 index 3f583695c..000000000 --- a/knip.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "workspaces": { - "packages/forklift-console-plugin": { - "entry": "index.ts" - } - } - } \ No newline at end of file From a8f84dd8ba1ee88da977d12d8b3bb900e1eedae7 Mon Sep 17 00:00:00 2001 From: Joachim Schuler Date: Thu, 27 Feb 2025 10:03:22 -0500 Subject: [PATCH 3/4] Update knip entry points Signed-off-by: Joachim Schuler --- knip.json | 25 +++++++++++++++++++ .../forklift-console-plugin/jest.config.ts | 2 +- .../views/migrate/reducer/reducer.ts | 18 ++++++++----- 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 knip.json diff --git a/knip.json b/knip.json new file mode 100644 index 000000000..132c3b894 --- /dev/null +++ b/knip.json @@ -0,0 +1,25 @@ +{ + "workspaces": { + "packages/forklift-console-plugin": { + "entry": [ + "src/modules/Overview/views/overview/OverviewPage.tsx", + "src/modules/Overview/hooks/OverviewContextProvider.tsx", + "src/modules/Providers/views/list/ProvidersListPage.tsx", + "src/modules/Providers/views/details/ProviderDetailsPage.tsx", + "src/modules/Providers/views/create/ProvidersCreatePage.tsx", + "src/modules/Providers/views/migrate/ProvidersCreateVmMigrationContext.tsx", + "src/modules/Plans/views/list/PlansListPage.tsx", + "src/modules/Plans/views/create/PlanCreatePage.tsx", + "src/modules/Plans/views/details/PlanDetailsPage.tsx", + "src/modules/NetworkMaps/views/list/NetworkMapsListPage.tsx", + "src/modules/NetworkMaps/views/details/NetworkMapDetailsPage.tsx", + "src/modules/NetworkMaps/yamlTemplates/index.ts", + "src/modules/StorageMaps/views/list/StorageMapsListPage.tsx", + "src/modules/StorageMaps/views/details/StorageMapDetailsPage.tsx", + "src/modules/StorageMaps/yamlTemplates/index.ts" + ], + "ignore": ["i18next-parser.config.js"] + } + }, + "ignore": ["cypress/**"] +} diff --git a/packages/forklift-console-plugin/jest.config.ts b/packages/forklift-console-plugin/jest.config.ts index 68bf71d6f..59a8f0eea 100644 --- a/packages/forklift-console-plugin/jest.config.ts +++ b/packages/forklift-console-plugin/jest.config.ts @@ -10,7 +10,7 @@ const moduleNameMapper = { '\\.(css|less|scss|svg)$': '/src/__mocks__/dummy.ts', '@console/*': '/src/__mocks__/dummy.ts', '@openshift-console/*': '/src/__mocks__/dummy.ts', - 'react-i18next': '/src/__mocks__/react-i18next.ts', + 'react-i18next': '/src/__mocks__/react-i18next.tsx', ...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '/', diff --git a/packages/forklift-console-plugin/src/modules/Providers/views/migrate/reducer/reducer.ts b/packages/forklift-console-plugin/src/modules/Providers/views/migrate/reducer/reducer.ts index b08745e25..1e4a34dc7 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/views/migrate/reducer/reducer.ts +++ b/packages/forklift-console-plugin/src/modules/Providers/views/migrate/reducer/reducer.ts @@ -300,12 +300,18 @@ const handlers: { // triggered from useEffect on any data change existingResources.netMaps = existingNetMaps; }, - [SET_EXISTING_STORAGE_MAPS]( - { existingResources }, - { payload: { existingStorageMaps } }: PageAction, - ) { - // triggered from useEffect on any data change - existingResources.storageMaps = existingStorageMaps; + // [SET_EXISTING_STORAGE_MAPS]( + // { existingResources }, + // { payload: { existingStorageMaps } }: PageAction, + // ) { + // // triggered from useEffect on any data change + // existingResources.storageMaps = existingStorageMaps; + // }, + [SET_EXISTING_STORAGE_MAPS](draft, action) { + const { existingStorageMaps } = ( + action as PageAction + ).payload; + draft.existingResources.storageMaps = existingStorageMaps; }, [START_CREATE]({ flow, From 626ab6fbcb86e244abf98afddf1bc5cd2d2827d3 Mon Sep 17 00:00:00 2001 From: Joachim Schuler Date: Thu, 27 Feb 2025 10:05:47 -0500 Subject: [PATCH 4/4] revert a file Signed-off-by: Joachim Schuler --- .../Providers/views/migrate/reducer/reducer.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/forklift-console-plugin/src/modules/Providers/views/migrate/reducer/reducer.ts b/packages/forklift-console-plugin/src/modules/Providers/views/migrate/reducer/reducer.ts index 1e4a34dc7..b08745e25 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/views/migrate/reducer/reducer.ts +++ b/packages/forklift-console-plugin/src/modules/Providers/views/migrate/reducer/reducer.ts @@ -300,18 +300,12 @@ const handlers: { // triggered from useEffect on any data change existingResources.netMaps = existingNetMaps; }, - // [SET_EXISTING_STORAGE_MAPS]( - // { existingResources }, - // { payload: { existingStorageMaps } }: PageAction, - // ) { - // // triggered from useEffect on any data change - // existingResources.storageMaps = existingStorageMaps; - // }, - [SET_EXISTING_STORAGE_MAPS](draft, action) { - const { existingStorageMaps } = ( - action as PageAction - ).payload; - draft.existingResources.storageMaps = existingStorageMaps; + [SET_EXISTING_STORAGE_MAPS]( + { existingResources }, + { payload: { existingStorageMaps } }: PageAction, + ) { + // triggered from useEffect on any data change + existingResources.storageMaps = existingStorageMaps; }, [START_CREATE]({ flow,