Merge pull request #21963 from drodil/introduce_knip
ci: introduce knip for checking unused packages
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:-----------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| msw | package.json |
|
||||
| cross-fetch | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (64)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------------------------------------------|:-------------|
|
||||
| lodash | package.json |
|
||||
| history | package.json |
|
||||
| react-use | package.json |
|
||||
| @octokit/rest | package.json |
|
||||
| zen-observable | package.json |
|
||||
| @material-ui/lab | package.json |
|
||||
| @backstage/theme | package.json |
|
||||
| @backstage/plugin-org | package.json |
|
||||
| @backstage/plugin-adr | package.json |
|
||||
| @backstage/plugin-todo | package.json |
|
||||
| @backstage/plugin-gocd | package.json |
|
||||
| app-next-example-plugin | package.json |
|
||||
| @backstage/plugin-kafka | package.json |
|
||||
| @backstage/app-defaults | package.json |
|
||||
| @backstage/plugin-sentry | package.json |
|
||||
| @backstage/plugin-search | package.json |
|
||||
| @backstage/plugin-badges | package.json |
|
||||
| @backstage/catalog-model | package.json |
|
||||
| @backstage/plugin-rollbar | package.json |
|
||||
| @backstage/plugin-jenkins | package.json |
|
||||
| @backstage/plugin-explore | package.json |
|
||||
| @backstage/plugin-catalog | package.json |
|
||||
| @circleci/backstage-plugin | package.json |
|
||||
| @backstage/plugin-puppetdb | package.json |
|
||||
| @backstage/plugin-playlist | package.json |
|
||||
| @backstage/plugin-newrelic | package.json |
|
||||
| @backstage/plugin-linguist | package.json |
|
||||
| @backstage/plugin-devtools | package.json |
|
||||
| @backstage/plugin-api-docs | package.json |
|
||||
| @backstage/plugin-airbrake | package.json |
|
||||
| @backstage/plugin-shortcuts | package.json |
|
||||
| @backstage/plugin-dynatrace | package.json |
|
||||
| @backstage/plugin-stackstorm | package.json |
|
||||
| @backstage/plugin-scaffolder | package.json |
|
||||
| @backstage/plugin-lighthouse | package.json |
|
||||
| @backstage/plugin-kubernetes | package.json |
|
||||
| @backstage/plugin-cloudbuild | package.json |
|
||||
| @backstage/plugin-azure-sites | package.json |
|
||||
| @backstage/plugin-search-react | package.json |
|
||||
| @backstage/plugin-gcp-projects | package.json |
|
||||
| @backstage/plugin-azure-devops | package.json |
|
||||
| @backstage/plugin-tech-insights | package.json |
|
||||
| @backstage/plugin-search-common | package.json |
|
||||
| @backstage/plugin-cost-insights | package.json |
|
||||
| @backstage/plugin-code-coverage | package.json |
|
||||
| @backstage/plugin-catalog-react | package.json |
|
||||
| @backstage/plugin-catalog-graph | package.json |
|
||||
| @backstage/plugin-techdocs-react | package.json |
|
||||
| @backstage/plugin-octopus-deploy | package.json |
|
||||
| @backstage/plugin-github-actions | package.json |
|
||||
| @backstage/plugin-catalog-common | package.json |
|
||||
| @backstage/plugin-apache-airflow | package.json |
|
||||
| @backstage/plugin-linguist-common | package.json |
|
||||
| @backstage/plugin-entity-feedback | package.json |
|
||||
| @backstage/plugin-scaffolder-react | package.json |
|
||||
| @backstage/plugin-permission-react | package.json |
|
||||
| @roadiehq/backstage-plugin-travis-ci | package.json |
|
||||
| @roadiehq/backstage-plugin-buildkite | package.json |
|
||||
| @backstage/plugin-newrelic-dashboard | package.json |
|
||||
| @oriflame/backstage-plugin-score-card | package.json |
|
||||
| @roadiehq/backstage-plugin-github-insights | package.json |
|
||||
| @backstage/plugin-catalog-unprocessed-entities | package.json |
|
||||
| @roadiehq/backstage-plugin-github-pull-requests | package.json |
|
||||
| @backstage/plugin-techdocs-module-addons-contrib | package.json |
|
||||
|
||||
## Unused devDependencies (7)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------------|:-------------|
|
||||
| cross-env | package.json |
|
||||
| @types/jquery | package.json |
|
||||
| @testing-library/dom | package.json |
|
||||
| @types/zen-observable | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
| @testing-library/user-event | package.json |
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (15)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------------------|:-------------|
|
||||
| vite | package.json |
|
||||
| history | package.json |
|
||||
| react-router | package.json |
|
||||
| @octokit/rest | package.json |
|
||||
| zen-observable | package.json |
|
||||
| vite-plugin-html | package.json |
|
||||
| @material-ui/lab | package.json |
|
||||
| @backstage/theme | package.json |
|
||||
| @vitejs/plugin-react | package.json |
|
||||
| vite-plugin-node-polyfills | package.json |
|
||||
| @backstage/plugin-airbrake | package.json |
|
||||
| @backstage/frontend-app-api | package.json |
|
||||
| @backstage/plugin-azure-sites | package.json |
|
||||
| @backstage/plugin-search-common | package.json |
|
||||
| @backstage/plugin-linguist-common | package.json |
|
||||
|
||||
## Unused devDependencies (5)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------------|:-------------|
|
||||
| cross-env | package.json |
|
||||
| @types/jquery | package.json |
|
||||
| @testing-library/dom | package.json |
|
||||
| @types/zen-observable | package.json |
|
||||
| @testing-library/user-event | package.json |
|
||||
|
||||
## Unlisted dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:------------|:---------------------------------------------------------|
|
||||
| @rjsf/utils | src/components/scaffolder/customScaffolderExtensions.tsx |
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------|:-------------|
|
||||
| winston-transport | package.json |
|
||||
|
||||
## Unused devDependencies (5)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| supertest | package.json |
|
||||
| http-errors | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/http-errors | package.json |
|
||||
| @backstage/backend-test-utils | package.json |
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------|:-------------|
|
||||
| mysql2 | package.json |
|
||||
| @types/webpack-env | package.json |
|
||||
| @manypkg/get-packages | package.json |
|
||||
|
||||
## Unused devDependencies (12)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| msw | package.json |
|
||||
| mysql2 | package.json |
|
||||
| supertest | package.json |
|
||||
| http-errors | package.json |
|
||||
| better-sqlite3 | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/supertest | package.json |
|
||||
| @types/webpack-env | package.json |
|
||||
| @types/http-errors | package.json |
|
||||
| aws-sdk-client-mock | package.json |
|
||||
| @aws-sdk/util-stream-node | package.json |
|
||||
| @backstage/backend-test-utils | package.json |
|
||||
|
||||
## Referenced optional peerDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------------|:-------------|
|
||||
| pg-connection-string | package.json |
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| @backstage/backend-plugin-api | package.json |
|
||||
|
||||
## Unused devDependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| @backstage/backend-test-utils | package.json |
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:--------------------------------|:-------------|
|
||||
| @backstage/types | package.json |
|
||||
| @backstage/errors | package.json |
|
||||
| @backstage/plugin-search-common | package.json |
|
||||
|
||||
## Unused devDependencies (5)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| wait-for-expect | package.json |
|
||||
| @backstage/config-loader | package.json |
|
||||
| @backstage/backend-app-api | package.json |
|
||||
| @backstage/backend-test-utils | package.json |
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (7)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------------------------------------------|:-------------|
|
||||
| @backstage/backend-tasks | package.json |
|
||||
| @backstage/plugin-auth-node | package.json |
|
||||
| @backstage/backend-plugin-api | package.json |
|
||||
| @backstage/plugin-permission-node | package.json |
|
||||
| @backstage/plugin-permission-common | package.json |
|
||||
| @backstage/plugin-search-backend-node | package.json |
|
||||
| @backstage/plugin-catalog-backend-module-openapi | package.json |
|
||||
|
||||
## Unused devDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| lodash | package.json |
|
||||
| @backstage/backend-plugin-api | package.json |
|
||||
|
||||
## Unused devDependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| supertest | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| wait-for-expect | package.json |
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (5)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------|:-------------|
|
||||
| pg | package.json |
|
||||
| msw | package.json |
|
||||
| mysql2 | package.json |
|
||||
| better-sqlite3 | package.json |
|
||||
| @backstage/errors | package.json |
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:-----------------|:-------------|
|
||||
| supertest | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/supertest | package.json |
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (12)
|
||||
|
||||
| Name | Location |
|
||||
|:--------------------------------------------------|:-------------|
|
||||
| pg | package.json |
|
||||
| luxon | package.json |
|
||||
| mysql2 | package.json |
|
||||
| example-app | package.json |
|
||||
| @octokit/rest | package.json |
|
||||
| better-sqlite3 | package.json |
|
||||
| @gitbeaker/node | package.json |
|
||||
| pg-connection-string | package.json |
|
||||
| azure-devops-node-api | package.json |
|
||||
| @backstage/plugin-tech-insights-node | package.json |
|
||||
| @backstage/plugin-azure-sites-common | package.json |
|
||||
| @backstage/plugin-scaffolder-backend-module-rails | package.json |
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------------------------|:-------------|
|
||||
| @types/luxon | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/express-serve-static-core | package.json |
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| msw | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------------|:-------------|
|
||||
| yaml | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/json-schema | package.json |
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:-------|:-------------|
|
||||
| semver | package.json |
|
||||
|
||||
## Unused devDependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| @backstage/backend-test-utils | package.json |
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (28)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------------------------|:-------------|
|
||||
| util | package.json |
|
||||
| glob | package.json |
|
||||
| buffer | package.json |
|
||||
| sucrase | package.json |
|
||||
| process | package.json |
|
||||
| postcss | package.json |
|
||||
| esbuild | package.json |
|
||||
| @swc/jest | package.json |
|
||||
| @swc/core | package.json |
|
||||
| @svgr/core | package.json |
|
||||
| cross-fetch | package.json |
|
||||
| jest-runtime | package.json |
|
||||
| @swc/helpers | package.json |
|
||||
| replace-in-file | package.json |
|
||||
| jest-css-modules | package.json |
|
||||
| @svgr/plugin-jsx | package.json |
|
||||
| @svgr/plugin-svgo | package.json |
|
||||
| @types/webpack-env | package.json |
|
||||
| eslint-plugin-react | package.json |
|
||||
| terser-webpack-plugin | package.json |
|
||||
| jest-environment-jsdom | package.json |
|
||||
| eslint-plugin-jsx-a11y | package.json |
|
||||
| @sucrase/webpack-loader | package.json |
|
||||
| eslint-plugin-react-hooks | package.json |
|
||||
| eslint-plugin-deprecation | package.json |
|
||||
| eslint-formatter-friendly | package.json |
|
||||
| @spotify/eslint-config-react | package.json |
|
||||
| @typescript-eslint/eslint-plugin | package.json |
|
||||
|
||||
## Unused devDependencies (18)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------------------------|:-------------|
|
||||
| msw | package.json |
|
||||
| del | package.json |
|
||||
| ts-node | package.json |
|
||||
| nodemon | package.json |
|
||||
| @types/ejs | package.json |
|
||||
| @types/svgo | package.json |
|
||||
| @backstage/theme | package.json |
|
||||
| @types/http-proxy | package.json |
|
||||
| @backstage/dev-utils | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
| @backstage/core-app-api | package.json |
|
||||
| @backstage/backend-common | package.json |
|
||||
| @backstage/core-plugin-api | package.json |
|
||||
| @backstage/core-components | package.json |
|
||||
| @types/terser-webpack-plugin | package.json |
|
||||
| @backstage/backend-test-utils | package.json |
|
||||
| @backstage/backend-plugin-api | package.json |
|
||||
| @types/rollup-plugin-peer-deps-external | package.json |
|
||||
|
||||
## Referenced optional peerDependencies (4)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------------------|:-------------|
|
||||
| vite | package.json |
|
||||
| vite-plugin-html | package.json |
|
||||
| @vitejs/plugin-react | package.json |
|
||||
| vite-plugin-node-polyfills | package.json |
|
||||
|
||||
## Unlisted dependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------------|:-------------------------------------------|
|
||||
| prettier | src/commands/migrate/packageLintConfigs.ts |
|
||||
| react-dom/client | src/lib/bundler/hasReactDomClient.ts |
|
||||
| react/package.json | src/lib/bundler/server.ts |
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------|:-------------|
|
||||
| jscodeshift | package.json |
|
||||
| jscodeshift-add-imports | package.json |
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------------|:-------------|
|
||||
| ts-node | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/jscodeshift | package.json |
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (4)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| msw | package.json |
|
||||
| zen-observable | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @backstage/backend-test-utils | package.json |
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:--------|:-------------|
|
||||
| history | package.json |
|
||||
|
||||
## Unused devDependencies (11)
|
||||
|
||||
| Name | Location |
|
||||
|:-----------------------------|:-------------|
|
||||
| msw | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| react-router-beta | package.json |
|
||||
| react-router-stable | package.json |
|
||||
| @testing-library/dom | package.json |
|
||||
| react-router-dom-beta | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
| react-router-dom-stable | package.json |
|
||||
| @testing-library/user-event | package.json |
|
||||
| @testing-library/react-hooks | package.json |
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------|:-------------|
|
||||
| @backstage/core-app-api | package.json |
|
||||
|
||||
## Unused devDependencies (8)
|
||||
|
||||
| Name | Location |
|
||||
|:--------------------------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
| @backstage/plugin-catalog | package.json |
|
||||
| @backstage/plugin-puppetdb | package.json |
|
||||
| @backstage/frontend-app-api | package.json |
|
||||
| @backstage/plugin-stackstorm | package.json |
|
||||
| @backstage/frontend-test-utils | package.json |
|
||||
| @oriflame/backstage-plugin-score-card | package.json |
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (4)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------|:-------------|
|
||||
| linkifyjs | package.json |
|
||||
| @date-io/core | package.json |
|
||||
| zen-observable | package.json |
|
||||
| @backstage/config | package.json |
|
||||
|
||||
## Unused devDependencies (9)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------------|:-------------|
|
||||
| msw | package.json |
|
||||
| cross-fetch | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @testing-library/dom | package.json |
|
||||
| @types/zen-observable | package.json |
|
||||
| @types/google-protobuf | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
| @backstage/app-defaults | package.json |
|
||||
| @testing-library/user-event | package.json |
|
||||
|
||||
## Unlisted dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:--------|:---------------------------------------|
|
||||
| csstype | src/components/Lifecycle/Lifecycle.tsx |
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:--------|:-------------|
|
||||
| history | package.json |
|
||||
|
||||
## Unused devDependencies (6)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| @testing-library/dom | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
| @backstage/core-app-api | package.json |
|
||||
| @testing-library/user-event | package.json |
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (6)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| msw | package.json |
|
||||
| ts-node | package.json |
|
||||
| nodemon | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/command-exists | package.json |
|
||||
| @backstage/backend-test-utils | package.json |
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:-----------------|:-------------|
|
||||
| @backstage/theme | package.json |
|
||||
|
||||
## Unused devDependencies (6)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------------|:-------------|
|
||||
| zen-observable | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @testing-library/dom | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
| @testing-library/user-event | package.json |
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
## Referenced optional peerDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:-----------------|:-------------|
|
||||
| @playwright/test | package.json |
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (4)
|
||||
|
||||
| Name | Location |
|
||||
|:-----------------|:-------------|
|
||||
| ts-node | package.json |
|
||||
| nodemon | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/puppeteer | package.json |
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Knip report
|
||||
|
||||
## Unlisted dependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:-------|:-------------------------------|
|
||||
| estree | lib/visitImports.js |
|
||||
| estree | rules/no-undeclared-imports.js |
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:-----------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------------------|:-------------|
|
||||
| lodash | package.json |
|
||||
| @material-ui/core | package.json |
|
||||
| @backstage/core-components | package.json |
|
||||
|
||||
## Unused devDependencies (6)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------------------------|:-------------|
|
||||
| history | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
| @backstage/frontend-app-api | package.json |
|
||||
| @backstage/frontend-test-utils | package.json |
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------------------|:-------------|
|
||||
| @backstage/errors | package.json |
|
||||
| @aws-sdk/credential-provider-node | package.json |
|
||||
|
||||
## Unused devDependencies (5)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| aws-sdk-client-mock | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
| aws-sdk-client-mock-jest | package.json |
|
||||
| @backstage/config-loader | package.json |
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (4)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------|:-------------|
|
||||
| msw | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @testing-library/dom | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------------------|:-------------|
|
||||
| msw | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @backstage/config-loader | package.json |
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------|:-------------|
|
||||
| msw | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
|
||||
@@ -15,6 +15,7 @@ Commands:
|
||||
api-reports [options] [paths...]
|
||||
type-deps
|
||||
generate-catalog-info [options]
|
||||
knip-reports [options] [paths...]
|
||||
package [command]
|
||||
repo [command]
|
||||
help [command]
|
||||
@@ -49,6 +50,16 @@ Options:
|
||||
-h, --help
|
||||
```
|
||||
|
||||
### `backstage-repo-tools knip-reports`
|
||||
|
||||
```
|
||||
Usage: backstage-repo-tools knip-reports [options] [paths...]
|
||||
|
||||
Options:
|
||||
--ci
|
||||
-h, --help
|
||||
```
|
||||
|
||||
### `backstage-repo-tools package`
|
||||
|
||||
```
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (6)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------------|:-------------|
|
||||
| glob | package.json |
|
||||
| ts-node | package.json |
|
||||
| is-glob | package.json |
|
||||
| @stoplight/spectral-runtime | package.json |
|
||||
| @stoplight/spectral-functions | package.json |
|
||||
| @openapitools/openapi-generator-cli | package.json |
|
||||
|
||||
## Unused devDependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------------------|:-------------|
|
||||
| @types/is-glob | package.json |
|
||||
| @backstage/backend-test-utils | package.json |
|
||||
|
||||
## Referenced optional peerDependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:---------|:-------------|
|
||||
| prettier | package.json |
|
||||
|
||||
@@ -16,37 +16,36 @@
|
||||
|
||||
import { groupBy } from 'lodash';
|
||||
import {
|
||||
resolve as resolvePath,
|
||||
relative as relativePath,
|
||||
basename,
|
||||
join,
|
||||
relative as relativePath,
|
||||
resolve as resolvePath,
|
||||
} from 'path';
|
||||
import { execFile } from 'child_process';
|
||||
import fs from 'fs-extra';
|
||||
import {
|
||||
CompilerState,
|
||||
Extractor,
|
||||
ExtractorConfig,
|
||||
CompilerState,
|
||||
ExtractorLogLevel,
|
||||
ExtractorMessage,
|
||||
} from '@microsoft/api-extractor';
|
||||
import { Program } from 'typescript';
|
||||
import {
|
||||
DocNode,
|
||||
IDocNodeContainerParameters,
|
||||
TSDocTagSyntaxKind,
|
||||
TSDocConfiguration,
|
||||
Standardization,
|
||||
DocBlockTag,
|
||||
DocPlainText,
|
||||
DocLinkTag,
|
||||
DocNode,
|
||||
DocPlainText,
|
||||
IDocNodeContainerParameters,
|
||||
Standardization,
|
||||
TSDocConfiguration,
|
||||
TSDocTagSyntaxKind,
|
||||
} from '@microsoft/tsdoc';
|
||||
import { TSDocConfigFile } from '@microsoft/tsdoc-config';
|
||||
import {
|
||||
ApiPackage,
|
||||
ApiModel,
|
||||
ApiItem,
|
||||
ApiItemKind,
|
||||
ApiModel,
|
||||
ApiPackage,
|
||||
} from '@microsoft/api-extractor-model';
|
||||
import {
|
||||
IMarkdownDocumenterOptions,
|
||||
@@ -64,6 +63,7 @@ import { AstDeclaration } from '@microsoft/api-extractor/lib/analyzer/AstDeclara
|
||||
import { paths as cliPaths } from '../../lib/paths';
|
||||
import minimatch from 'minimatch';
|
||||
import { getPackageExportNames } from '../../lib/entryPoints';
|
||||
import { createBinRunner } from '../util';
|
||||
|
||||
const tmpDir = cliPaths.resolveTargetRoot(
|
||||
'./node_modules/.cache/api-extractor',
|
||||
@@ -290,10 +290,10 @@ function logApiReportInstructions() {
|
||||
'*************************************************************************************',
|
||||
);
|
||||
console.log(
|
||||
'* You have uncommitted changes to the public API of a package. *',
|
||||
'* You have uncommitted changes to the public API or reports of a package. *',
|
||||
);
|
||||
console.log(
|
||||
'* To solve this, run `yarn build:api-reports` and commit all api-report.md changes. *',
|
||||
'* To solve this, run `yarn build:api-reports` and commit all md file changes. *',
|
||||
);
|
||||
console.log(
|
||||
'*************************************************************************************',
|
||||
@@ -1227,31 +1227,6 @@ export async function categorizePackageDirs(packageDirs: string[]) {
|
||||
return { tsPackageDirs, cliPackageDirs };
|
||||
}
|
||||
|
||||
function createBinRunner(cwd: string, path: string) {
|
||||
return async (...command: string[]) =>
|
||||
new Promise<string>((resolve, reject) => {
|
||||
execFile(
|
||||
'node',
|
||||
[path, ...command],
|
||||
{
|
||||
cwd,
|
||||
shell: true,
|
||||
timeout: 60000,
|
||||
maxBuffer: 1024 * 1024,
|
||||
},
|
||||
(err, stdout, stderr) => {
|
||||
if (err) {
|
||||
reject(new Error(`${err.message}\n${stderr}`));
|
||||
} else if (stderr) {
|
||||
reject(new Error(`Command printed error output: ${stderr}`));
|
||||
} else {
|
||||
resolve(stdout);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function parseHelpPage(helpPageContent: string) {
|
||||
const [, usage] = helpPageContent.match(/^\s*Usage: (.*)$/im) ?? [];
|
||||
const lines = helpPageContent.split(/\r?\n/);
|
||||
@@ -1443,3 +1418,66 @@ export async function runCliExtraction({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface KnipExtractionOptions {
|
||||
packageDirs: string[];
|
||||
isLocalBuild: boolean;
|
||||
}
|
||||
|
||||
export async function runKnipReports({
|
||||
packageDirs,
|
||||
isLocalBuild,
|
||||
}: KnipExtractionOptions) {
|
||||
const knipDir = cliPaths.resolveTargetRoot('./node_modules/knip/bin/');
|
||||
|
||||
for (const packageDir of packageDirs) {
|
||||
console.log(`## Processing ${packageDir}`);
|
||||
const fullDir = cliPaths.resolveTargetRoot(packageDir);
|
||||
const reportPath = resolvePath(fullDir, 'knip-report.md');
|
||||
const run = createBinRunner(fullDir, '');
|
||||
|
||||
const report = await run(
|
||||
`${knipDir}/knip.js`,
|
||||
`--directory ${fullDir}`, // Run in the package directory
|
||||
'--no-exit-code', // Removing this will end the process in case there are findings by knip
|
||||
'--no-progress', // Remove unnecessary debugging from output
|
||||
// TODO: Add more checks when dependencies start to look ok, see https://knip.dev/reference/cli#--include
|
||||
'--include dependencies,unlisted',
|
||||
'--reporter markdown',
|
||||
);
|
||||
|
||||
const existingReport = await fs
|
||||
.readFile(reportPath, 'utf8')
|
||||
.catch(error => {
|
||||
if (error.code === 'ENOENT') {
|
||||
return undefined;
|
||||
}
|
||||
throw error;
|
||||
});
|
||||
|
||||
if (existingReport !== report) {
|
||||
if (isLocalBuild) {
|
||||
console.warn(`Knip report changed for ${packageDir}`);
|
||||
await fs.writeFile(reportPath, report);
|
||||
} else {
|
||||
logApiReportInstructions();
|
||||
|
||||
if (existingReport) {
|
||||
console.log('');
|
||||
console.log(
|
||||
`The conflicting file is ${relativePath(
|
||||
cliPaths.targetRoot,
|
||||
reportPath,
|
||||
)}, expecting the following content:`,
|
||||
);
|
||||
console.log('');
|
||||
|
||||
console.log(report);
|
||||
|
||||
logApiReportInstructions();
|
||||
}
|
||||
throw new Error(`Knip report changed for ${packageDir}, `);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ import * as pathsLib from '../../lib/paths';
|
||||
|
||||
import {
|
||||
buildDocs,
|
||||
runCliExtraction,
|
||||
runApiExtraction,
|
||||
categorizePackageDirs,
|
||||
runApiExtraction,
|
||||
runCliExtraction,
|
||||
} from './api-extractor';
|
||||
|
||||
import { buildApiReports } from './api-reports';
|
||||
@@ -43,6 +43,7 @@ jest.mock('./api-extractor', () => ({
|
||||
runApiExtraction: jest.fn(),
|
||||
runCliExtraction: jest.fn(),
|
||||
buildDocs: jest.fn(),
|
||||
runKnipReports: jest.fn(),
|
||||
}));
|
||||
|
||||
const projectPaths = pathsLib.paths;
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
import { OptionValues } from 'commander';
|
||||
import {
|
||||
createTemporaryTsConfig,
|
||||
buildDocs,
|
||||
categorizePackageDirs,
|
||||
createTemporaryTsConfig,
|
||||
runApiExtraction,
|
||||
runCliExtraction,
|
||||
buildDocs,
|
||||
} from './api-extractor';
|
||||
import { paths as cliPaths, resolvePackagePaths } from '../../lib/paths';
|
||||
import { generateTypeDeclarations } from './generateTypeDeclarations';
|
||||
@@ -94,6 +94,7 @@ export const buildApiReports = async (paths: string[] = [], opts: Options) => {
|
||||
validateReleaseTags: opts.validateReleaseTags,
|
||||
});
|
||||
}
|
||||
|
||||
if (cliPackageDirs.length > 0) {
|
||||
console.log('# Generating package CLI reports');
|
||||
await runCliExtraction({
|
||||
|
||||
@@ -168,6 +168,17 @@ export function registerCommands(program: Command) {
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
program
|
||||
.command('knip-reports [paths...]')
|
||||
.option('--ci', 'CI run checks that there is no changes on knip reports')
|
||||
.description('Generate a knip report for selected packages')
|
||||
.action(
|
||||
lazy(() =>
|
||||
import('./knip-reports/knip-reports').then(m => m.buildKnipReports),
|
||||
),
|
||||
);
|
||||
|
||||
registerPackageCommand(program);
|
||||
registerRepoCommand(program);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { paths as cliPaths } from '../../lib/paths';
|
||||
import pLimit from 'p-limit';
|
||||
import os from 'os';
|
||||
import { relative as relativePath, resolve as resolvePath } from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import { createBinRunner } from '../util';
|
||||
|
||||
// Ignore this due to Knip error: Error: ENAMETOOLONG: name too long, scandir
|
||||
const ignoredPackages = ['packages/techdocs-cli-embedded-app'];
|
||||
|
||||
interface KnipExtractionOptions {
|
||||
packageDirs: string[];
|
||||
isLocalBuild: boolean;
|
||||
}
|
||||
|
||||
interface KnipConfigOptions {
|
||||
packageDir: string;
|
||||
}
|
||||
|
||||
interface KnipPackageOptions {
|
||||
packageDir: string;
|
||||
knipDir: string;
|
||||
isLocalBuild: boolean;
|
||||
}
|
||||
|
||||
function logKnipReportInstructions() {
|
||||
console.log('');
|
||||
console.log(
|
||||
'*************************************************************************************',
|
||||
);
|
||||
console.log(
|
||||
'* You have uncommitted changes to the knip reports of a package. *',
|
||||
);
|
||||
console.log(
|
||||
'* To solve this, run `yarn build:knip-reports` and commit all md file changes. *',
|
||||
);
|
||||
console.log(
|
||||
'*************************************************************************************',
|
||||
);
|
||||
console.log('');
|
||||
}
|
||||
|
||||
async function generateKnipConfig({ packageDir }: KnipConfigOptions) {
|
||||
const knipConfig = {
|
||||
entry: [
|
||||
'dev/index.{ts,tsx}',
|
||||
'src/index.{ts,tsx}',
|
||||
'src/routes.ts',
|
||||
'src/run.ts',
|
||||
],
|
||||
jest: { entry: 'src/setupTests.ts' },
|
||||
storybook: { entry: 'src/components/**/*.stories.tsx' },
|
||||
ignore: [
|
||||
'.eslintrc.js',
|
||||
'config.d.ts',
|
||||
'knexfile.js',
|
||||
'node_modules/**',
|
||||
'dist/**',
|
||||
'{fixtures,migrations,templates}/**',
|
||||
],
|
||||
};
|
||||
await fs.writeFile(
|
||||
`${packageDir}/knip.json`,
|
||||
JSON.stringify(knipConfig, null, 2),
|
||||
);
|
||||
}
|
||||
|
||||
function cleanKnipConfig({ packageDir }: KnipConfigOptions) {
|
||||
if (fs.existsSync(`${packageDir}/knip.json`)) {
|
||||
fs.rmSync(`${packageDir}/knip.json`);
|
||||
}
|
||||
}
|
||||
|
||||
async function handlePackage({
|
||||
packageDir,
|
||||
knipDir,
|
||||
isLocalBuild,
|
||||
}: KnipPackageOptions) {
|
||||
console.log(`## Processing ${packageDir}`);
|
||||
if (ignoredPackages.includes(packageDir)) {
|
||||
console.log(`Skipping ${packageDir}`);
|
||||
return;
|
||||
}
|
||||
const fullDir = cliPaths.resolveTargetRoot(packageDir);
|
||||
const reportPath = resolvePath(fullDir, 'knip-report.md');
|
||||
const run = createBinRunner(fullDir, '');
|
||||
|
||||
await generateKnipConfig({ packageDir: fullDir });
|
||||
|
||||
const report = await run(
|
||||
`${knipDir}/knip.js`,
|
||||
`--directory ${fullDir}`, // Run in the package directory
|
||||
'--config knip.json',
|
||||
'--no-exit-code', // Removing this will end the process in case there are findings by knip
|
||||
'--no-progress', // Remove unnecessary debugging from output
|
||||
// TODO: Add more checks when dependencies start to look ok, see https://knip.dev/reference/cli#--include
|
||||
'--include dependencies,unlisted',
|
||||
'--reporter markdown',
|
||||
);
|
||||
|
||||
cleanKnipConfig({ packageDir: fullDir });
|
||||
|
||||
const existingReport = await fs.readFile(reportPath, 'utf8').catch(error => {
|
||||
if (error.code === 'ENOENT') {
|
||||
return undefined;
|
||||
}
|
||||
throw error;
|
||||
});
|
||||
|
||||
if (existingReport !== report) {
|
||||
if (isLocalBuild) {
|
||||
console.warn(`Knip report changed for ${packageDir}`);
|
||||
await fs.writeFile(reportPath, report);
|
||||
} else {
|
||||
logKnipReportInstructions();
|
||||
|
||||
if (existingReport) {
|
||||
console.log('');
|
||||
console.log(
|
||||
`The conflicting file is ${relativePath(
|
||||
cliPaths.targetRoot,
|
||||
reportPath,
|
||||
)}, expecting the following content:`,
|
||||
);
|
||||
console.log('');
|
||||
|
||||
console.log(report);
|
||||
|
||||
logKnipReportInstructions();
|
||||
}
|
||||
throw new Error(`Knip report changed for ${packageDir}, `);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function runKnipReports({
|
||||
packageDirs,
|
||||
isLocalBuild,
|
||||
}: KnipExtractionOptions) {
|
||||
const knipDir = cliPaths.resolveTargetRoot('./node_modules/knip/bin/');
|
||||
const limiter = pLimit(os.cpus().length);
|
||||
|
||||
try {
|
||||
await Promise.all(
|
||||
packageDirs.map(packageDir =>
|
||||
limiter(async () =>
|
||||
handlePackage({ packageDir, knipDir, isLocalBuild }),
|
||||
),
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
console.log(
|
||||
`Error occurred during knip reporting: ${e}, cleaning knip configs`,
|
||||
);
|
||||
packageDirs.map(packageDir => {
|
||||
const fullDir = cliPaths.resolveTargetRoot(packageDir);
|
||||
cleanKnipConfig({ packageDir: fullDir });
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2022 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { OptionValues } from 'commander';
|
||||
import { runKnipReports } from './knip-extractor';
|
||||
import { resolvePackagePaths } from '../../lib/paths';
|
||||
|
||||
type Options = {
|
||||
ci?: boolean;
|
||||
} & OptionValues;
|
||||
|
||||
export const buildKnipReports = async (paths: string[] = [], opts: Options) => {
|
||||
const isCiBuild = opts.ci;
|
||||
|
||||
const isAllPackages = !paths?.length;
|
||||
const selectedPackageDirs = await resolvePackagePaths({
|
||||
paths,
|
||||
include: opts.include,
|
||||
exclude: opts.exclude,
|
||||
});
|
||||
|
||||
if (isAllPackages && !isCiBuild) {
|
||||
console.log('');
|
||||
console.log(
|
||||
'TIP: You can generate knip-reports for select packages by passing package paths:',
|
||||
);
|
||||
console.log('');
|
||||
console.log(
|
||||
' yarn build:knip-reports packages/config packages/core-plugin-api plugins/*',
|
||||
);
|
||||
console.log('');
|
||||
}
|
||||
|
||||
if (selectedPackageDirs.length > 0) {
|
||||
console.log('# Generating package knip reports');
|
||||
await runKnipReports({
|
||||
packageDirs: selectedPackageDirs,
|
||||
isLocalBuild: !isCiBuild,
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright 2024 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { execFile } from 'child_process';
|
||||
|
||||
export function createBinRunner(cwd: string, path: string) {
|
||||
return async (...command: string[]) =>
|
||||
new Promise<string>((resolve, reject) => {
|
||||
execFile(
|
||||
'node',
|
||||
[path, ...command],
|
||||
{
|
||||
cwd,
|
||||
shell: true,
|
||||
timeout: 60000,
|
||||
maxBuffer: 1024 * 1024,
|
||||
},
|
||||
(err, stdout, stderr) => {
|
||||
if (err) {
|
||||
reject(new Error(`${err.message}\n${stderr}`));
|
||||
} else if (stderr) {
|
||||
reject(new Error(`Command printed error output: ${stderr}`));
|
||||
} else {
|
||||
resolve(stdout);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (4)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------|:-------------|
|
||||
| history | package.json |
|
||||
| react-use | package.json |
|
||||
| @backstage/theme | package.json |
|
||||
| @backstage/test-utils | package.json |
|
||||
|
||||
## Unused devDependencies (5)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------------|:-------------|
|
||||
| cross-env | package.json |
|
||||
| @testing-library/dom | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
| @testing-library/jest-dom | package.json |
|
||||
| @testing-library/user-event | package.json |
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------|:-------------|
|
||||
| global-agent | package.json |
|
||||
|
||||
## Unused devDependencies (5)
|
||||
|
||||
| Name | Location |
|
||||
|:-------------------|:-------------|
|
||||
| ts-node | package.json |
|
||||
| nodemon | package.json |
|
||||
| find-process | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/webpack-env | package.json |
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (1)
|
||||
|
||||
| Name | Location |
|
||||
|:------------------|:-------------|
|
||||
| @material-ui/core | package.json |
|
||||
|
||||
## Unused devDependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:---------------|:-------------|
|
||||
| msw | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Knip report
|
||||
|
||||
## Unused dependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------|:-------------|
|
||||
| @emotion/react | package.json |
|
||||
| @emotion/styled | package.json |
|
||||
|
||||
## Unused devDependencies (3)
|
||||
|
||||
| Name | Location |
|
||||
|:-----------------------|:-------------|
|
||||
| @mui/styles | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (4)
|
||||
|
||||
| Name | Location |
|
||||
|:----------------------|:-------------|
|
||||
| luxon | package.json |
|
||||
| zen-observable | package.json |
|
||||
| @backstage/cli | package.json |
|
||||
| @types/zen-observable | package.json |
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Knip report
|
||||
|
||||
## Unused devDependencies (2)
|
||||
|
||||
| Name | Location |
|
||||
|:-----------------------|:-------------|
|
||||
| @backstage/cli | package.json |
|
||||
| @testing-library/react | package.json |
|
||||
|
||||
Reference in New Issue
Block a user