From 3a88dff70ff3defa3e0b57104fb4319b8a1307c2 Mon Sep 17 00:00:00 2001 From: Thomas Zerr Date: Wed, 16 Oct 2024 11:19:22 +0200 Subject: [PATCH] Add depcheck script and solve issues --- package.json | 2 +- scm-plugins/scm-git-plugin/package.json | 4 +- scm-plugins/scm-hg-plugin/package.json | 4 +- scm-plugins/scm-legacy-plugin/package.json | 4 +- scm-plugins/scm-svn-plugin/package.json | 4 +- scm-ui/ui-api/package.json | 33 +- scm-ui/ui-buttons/package.json | 19 +- scm-ui/ui-components/package.json | 94 +- scm-ui/ui-components/src/PdfViewer.tsx | 2 +- .../src/__snapshots__/storyshots.test.ts.snap | 21 + .../ui-components/src/markdown/PluginApi.ts | 2 +- .../remarkChangesetShortLinkParser.ts | 2 +- .../markdown/remarkValuelessTextAdapter.ts | 8 +- .../src/modals/CreateTagModal.tsx | 13 +- .../src/navigation/ExternalNavLink.tsx | 2 +- .../ui-components/src/navigation/NavLink.tsx | 2 +- .../src/navigation/SecondaryNavigation.tsx | 2 +- .../src/navigation/SubNavigation.tsx | 2 +- .../ui-components/src/repos/DiffExpander.ts | 2 +- .../src/repos/DiffStatistics.tsx | 2 +- .../src/repos/RepositoryAvatar.tsx | 4 +- .../src/repos/RepositoryEntry.tsx | 2 +- .../src/repos/RepositoryEntryLink.tsx | 2 +- .../src/repos/diff/LazyDiffFile.tsx | 3 +- scm-ui/ui-components/src/storyshots.test.ts | 9 +- scm-ui/ui-core/package.json | 38 +- scm-ui/ui-core/src/base/layout/card/Card.tsx | 5 +- scm-ui/ui-extensions/package.json | 24 +- scm-ui/ui-forms/package.json | 26 +- scm-ui/ui-layout/package.json | 19 +- scm-ui/ui-legacy/package.json | 15 +- scm-ui/ui-overlays/package.json | 24 +- scm-ui/ui-plugins/.depcheckrc | 1 + scm-ui/ui-plugins/package.json | 22 +- scm-ui/ui-shortcuts/package.json | 20 +- scm-ui/ui-styles/.depcheckrc | 1 + scm-ui/ui-styles/package.json | 19 +- scm-ui/ui-syntaxhighlighting/package.json | 24 +- scm-ui/ui-tests/package.json | 22 +- scm-ui/ui-text/package.json | 16 +- scm-ui/ui-types/package.json | 10 +- scm-ui/ui-webapp/package.json | 50 +- yarn.lock | 992 ++++++------------ 43 files changed, 629 insertions(+), 943 deletions(-) create mode 100644 scm-ui/ui-plugins/.depcheckrc create mode 100644 scm-ui/ui-styles/.depcheckrc diff --git a/package.json b/package.json index 70306c3624..ef038e14f8 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "set-version": "./scripts/scripts.js version" }, "dependencies": { - "@scm-manager/eslint-config": "2.17.0" + "@scm-manager/eslint-config": "^2.17.0" }, "devDependencies": { "@scm-manager/remark-preset-lint": "^1.0.0", diff --git a/scm-plugins/scm-git-plugin/package.json b/scm-plugins/scm-git-plugin/package.json index a50fc393c5..6f9dc33946 100644 --- a/scm-plugins/scm-git-plugin/package.json +++ b/scm-plugins/scm-git-plugin/package.json @@ -18,7 +18,7 @@ "@scm-manager/eslint-config": "^2.17.0", "@scm-manager/jest-preset": "^2.14.1", "@scm-manager/plugin-scripts": "^1.6.1", - "@scm-manager/prettier-config": "^2.11.1", + "@scm-manager/prettier-config": "^2.12.0", "@types/react": "^17.0.1" }, "babel": { @@ -33,4 +33,4 @@ "eslintConfig": { "extends": "@scm-manager/eslint-config" } -} \ No newline at end of file +} diff --git a/scm-plugins/scm-hg-plugin/package.json b/scm-plugins/scm-hg-plugin/package.json index 03f03b44ea..750a395217 100644 --- a/scm-plugins/scm-hg-plugin/package.json +++ b/scm-plugins/scm-hg-plugin/package.json @@ -17,7 +17,7 @@ "@scm-manager/eslint-config": "^2.17.0", "@scm-manager/jest-preset": "^2.14.1", "@scm-manager/plugin-scripts": "^1.6.1", - "@scm-manager/prettier-config": "^2.11.1", + "@scm-manager/prettier-config": "^2.12.0", "@types/react": "^17.0.1" }, "babel": { @@ -32,4 +32,4 @@ "eslintConfig": { "extends": "@scm-manager/eslint-config" } -} \ No newline at end of file +} diff --git a/scm-plugins/scm-legacy-plugin/package.json b/scm-plugins/scm-legacy-plugin/package.json index d1fe53b34b..135e7a5d54 100644 --- a/scm-plugins/scm-legacy-plugin/package.json +++ b/scm-plugins/scm-legacy-plugin/package.json @@ -17,7 +17,7 @@ "@scm-manager/eslint-config": "^2.17.0", "@scm-manager/jest-preset": "^2.14.1", "@scm-manager/plugin-scripts": "^1.6.1", - "@scm-manager/prettier-config": "^2.11.1", + "@scm-manager/prettier-config": "^2.12.0", "@types/react": "^17.0.1" }, "babel": { @@ -32,4 +32,4 @@ "eslintConfig": { "extends": "@scm-manager/eslint-config" } -} \ No newline at end of file +} diff --git a/scm-plugins/scm-svn-plugin/package.json b/scm-plugins/scm-svn-plugin/package.json index 377ad4d14b..103fa52050 100644 --- a/scm-plugins/scm-svn-plugin/package.json +++ b/scm-plugins/scm-svn-plugin/package.json @@ -17,7 +17,7 @@ "@scm-manager/eslint-config": "^2.17.0", "@scm-manager/jest-preset": "^2.14.1", "@scm-manager/plugin-scripts": "^1.6.1", - "@scm-manager/prettier-config": "^2.11.1", + "@scm-manager/prettier-config": "^2.12.0", "@types/react": "^17.0.1" }, "babel": { @@ -32,4 +32,4 @@ "eslintConfig": { "extends": "@scm-manager/eslint-config" } -} \ No newline at end of file +} diff --git a/scm-ui/ui-api/package.json b/scm-ui/ui-api/package.json index c8d15e86bc..e6cc7f54b6 100644 --- a/scm-ui/ui-api/package.json +++ b/scm-ui/ui-api/package.json @@ -15,28 +15,33 @@ "build": "tsup ./src/index.ts -d build --format esm,cjs --dts", "typecheck": "tsc", "lint": "eslint src", - "test": "jest src/" + "test": "jest src/", + "depcheck": "depcheck" }, - "devDependencies": { + "peerDependencies": { "@scm-manager/babel-preset": "^2.13.1", "@scm-manager/eslint-config": "^2.17.0", "@scm-manager/jest-preset": "^2.14.1", - "@scm-manager/prettier-config": "^2.10.1", + "@scm-manager/prettier-config": "^2.12.0", "@scm-manager/tsconfig": "^2.13.0", - "@testing-library/react-hooks": "^5.0.3", "@types/react": "^17.0.1", "react-test-renderer": "^17.0.1", - "tsup": "^5.12.6" + "fetch-mock": "^7.5.1", + "gitdiff-parser": "^0.2.2", + "react": "^17.0.1", + "query-string": "6.14.1", + "react-query": "^3.39.2", + "react-router-dom": "^5.3.1", + "react-i18next": "11", + "@testing-library/react-hooks": "8.0.1" + }, + "devDependencies": { + "@scm-manager/ui-types": "3.5.1-SNAPSHOT", + "tsup": "^5.12.6", + "@types/react-test-renderer": "^17.0.1" }, "dependencies": { - "@scm-manager/ui-types": "3.5.1-SNAPSHOT", - "fetch-mock-jest": "^1.5.1", - "gitdiff-parser": "^0.2.2", - "query-string": "6.14.1", - "react": "^17.0.1", - "react-query": "^3.25.1", - "react-router-dom": "^5.3.1", - "react-i18next": "11" + "fetch-mock-jest": "^1.5.1" }, "babel": { "presets": [ @@ -53,4 +58,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/scm-ui/ui-buttons/package.json b/scm-ui/ui-buttons/package.json index 3a86e8e9d8..d729dc0c96 100644 --- a/scm-ui/ui-buttons/package.json +++ b/scm-ui/ui-buttons/package.json @@ -3,13 +3,20 @@ "version": "3.5.1-SNAPSHOT", "private": false, "main": "index.ts", - "peerDependencies": { - "@scm-manager/ui-core": "3.5.1-SNAPSHOT" + "license": "AGPL-3.0-only", + "scripts": { + "depcheck": "depcheck" }, - "devDependencies": { - "@scm-manager/prettier-config": "^2.11.1", + "peerDependencies": { + "@scm-manager/prettier-config": "^2.12.0", "@scm-manager/eslint-config": "^2.17.0", - "@scm-manager/tsconfig": "^2.13.0" + "@scm-manager/tsconfig": "^2.13.0", + "react": "^17.0.1", + "react-router-dom": "^5.3.1", + "classnames": "^2.3.1" + }, + "dependencies": { + "@scm-manager/ui-core": "3.5.1-SNAPSHOT" }, "prettier": "@scm-manager/prettier-config", "eslintConfig": { @@ -18,4 +25,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index ecafe91f6e..5bf2de4a4d 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -16,70 +16,72 @@ "build-storybook": "build-storybook", "storybook": "start-storybook -s ../ui-webapp/public", "storyshots": "jest --testPathPattern=\"storyshots.test.ts\" --collectCoverage=false", - "update-storyshots": "jest --testPathPattern=\"storyshots.test.ts\" --collectCoverage=false -u" + "update-storyshots": "jest --testPathPattern=\"storyshots.test.ts\" --collectCoverage=false -u", + "depcheck": "depcheck" }, - "devDependencies": { + "peerDependencies": { "@scm-manager/babel-preset": "^2.13.1", "@scm-manager/eslint-config": "^2.17.0", "@scm-manager/jest-preset": "^2.14.1", - "@scm-manager/prettier-config": "^2.10.1", + "@scm-manager/prettier-config": "^2.12.0", "@scm-manager/tsconfig": "^2.13.0", - "@scm-manager/ui-shortcuts": "3.5.1-SNAPSHOT", - "@scm-manager/ui-syntaxhighlighting": "3.5.1-SNAPSHOT", - "@scm-manager/ui-tests": "3.5.1-SNAPSHOT", - "@scm-manager/ui-text": "3.5.1-SNAPSHOT", - "@storybook/addon-actions": "^6.4.20", - "@storybook/addon-essentials": "^6.4.20", - "@storybook/addon-interactions": "^6.4.20", - "@storybook/addon-storyshots": "^6.4.20", - "@storybook/builder-webpack5": "^6.4.20", - "@storybook/manager-webpack5": "^6.4.20", - "@storybook/react": "^6.4.20", - "@types/classnames": "^2.2.9", - "@types/css": "^0.0.31", - "@types/enzyme": "^3.10.3", - "@types/fetch-mock": "^7.3.1", - "@types/jest": "^26.0.24", + "decode-named-character-reference": "^1.0.1", + "@storybook/addon-actions": "^6.5.10", + "@storybook/addon-essentials": "^6.5.10", + "@storybook/addon-interactions": "^6.5.10", + "@storybook/addon-storyshots": "^6.5.10", + "@storybook/builder-webpack5": "^6.5.10", + "@storybook/manager-webpack5": "^6.5.10", + "@storybook/react": "^6.5.10", + "storybook-addon-i18next": "^1.3.0", + "storybook-addon-themes": "^6.1.0", + "@types/classnames": "^2.3.1", "@types/react": "^17.0.1", "@types/react-dom": "^17.0.1", "@types/react-router-dom": "^5.3.3", - "@types/react-select": "^2.0.19", "@types/styled-components": "^5.1.25", - "@types/to-camel-case": "^1.0.0", - "@types/unist": "^2.0.3", - "css": "^3.0.0", - "enzyme-context": "^1.1.2", - "enzyme-context-react-router-4": "^2.0.0", + "@testing-library/react-hooks": "8.0.1", "fetch-mock": "^7.5.1", - "gitdiff-parser": "^0.2.2", "html-webpack-plugin": "^5.5.0", - "i18next-fetch-backend": "^2.2.0", - "mini-css-extract-plugin": "^1.6.2", - "raf": "^3.4.0", + "mini-css-extract-plugin": "^2.4.3", "react-test-renderer": "^17.0.1", "sass-loader": "^12.3.0", - "storybook-addon-i18next": "^1.3.0", - "storybook-addon-themes": "^6.1.0", - "to-camel-case": "^1.0.0", + "@headlessui/react": "^1.7.17", + "classnames": "^2.3.1", + "date-fns": "^2.4.1", + "react": "^17.0.1", + "react-dom": "^17.0.1", + "react-i18next": "11", + "react-router-dom": "^5.3.1", + "styled-components": "^5.3.5", + "i18next": "21", + "react-query": "^3.39.2", + "@types/react-test-renderer": "^17.0.1" + }, + "devDependencies": { + "@scm-manager/ui-tests": "3.5.1-SNAPSHOT", + "@scm-manager/ui-types": "3.5.1-SNAPSHOT", + "@types/fetch-mock": "^7.3.1", + "@types/react-select": "^2.0.19", + "@types/unist": "^2.0.3", + "gitdiff-parser": "^0.2.2", + "i18next-fetch-backend": "4", "webpack": "^5.72.0" }, "dependencies": { - "@headlessui/react": "^1.4.3", + "@scm-manager/ui-core": "3.5.1-SNAPSHOT", + "@scm-manager/ui-overlays": "3.5.1-SNAPSHOT", + "@scm-manager/ui-layout": "3.5.1-SNAPSHOT", + "@scm-manager/ui-buttons": "3.5.1-SNAPSHOT", + "@scm-manager/ui-shortcuts": "3.5.1-SNAPSHOT", + "@scm-manager/ui-syntaxhighlighting": "3.5.1-SNAPSHOT", + "@scm-manager/ui-text": "3.5.1-SNAPSHOT", "@scm-manager/ui-api": "3.5.1-SNAPSHOT", "@scm-manager/ui-extensions": "3.5.1-SNAPSHOT", - "@scm-manager/ui-types": "3.5.1-SNAPSHOT", - "classnames": "^2.2.6", - "date-fns": "^2.4.1", "deepmerge": "^4.2.2", "hast-util-sanitize": "^3.0.2", - "query-string": "6.14.1", - "react": "^17.0.1", "react-diff-view": "^2.4.10", - "react-dom": "^17.0.1", - "react-hook-form": "^7.5.1", - "react-i18next": "11", - "react-router": "^5.3.1", - "react-router-dom": "^5.3.1", + "react-hook-form": "^7.33.1", "react-select": "^2.1.2", "rehype-raw": "^5.1.0", "rehype-react": "^6.2.0", @@ -88,8 +90,8 @@ "remark-gfm": "^1.0.0", "remark-parse": "^9.0.0", "remark-rehype": "^8.0.0", - "tabbable": "^5.2.1", - "unified": "^9.2.1" + "unified": "^9.2.1", + "unist-util-visit": "^2.0.3" }, "babel": { "presets": [ @@ -106,4 +108,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/scm-ui/ui-components/src/PdfViewer.tsx b/scm-ui/ui-components/src/PdfViewer.tsx index 77fe2ac50a..404e6c5817 100644 --- a/scm-ui/ui-components/src/PdfViewer.tsx +++ b/scm-ui/ui-components/src/PdfViewer.tsx @@ -16,7 +16,7 @@ import React, { FC } from "react"; import { File, Link } from "@scm-manager/ui-types"; -import { Notification } from "@scm-manager/ui-components"; +import Notification from "./Notification"; import { Trans, useTranslation } from "react-i18next"; type Props = { diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index 20cf7d6ab5..aeae1f4c4c 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -17051,6 +17051,7 @@ Array [ type="button" />,