Skip to content

Commit

Permalink
Merge pull request #208 from awanlin/topic/add-knip
Browse files Browse the repository at this point in the history
Added Knip and related changes
  • Loading branch information
awanlin authored Jan 15, 2024
2 parents 458db8a + ef580db commit 23d4be4
Show file tree
Hide file tree
Showing 19 changed files with 994 additions and 509 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: yarn tsc:full

- name: build
run: yarn build
run: yarn build:all

- name: Login to Heroku Container registry
env:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
run: yarn install --immutable
# End of yarn setup

- name: knip
run: yarn knip

- name: lint
run: yarn backstage-cli repo lint

Expand Down
5 changes: 5 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://unpkg.com/knip@3/schema.json",
"ignore": ["**/setupTests.ts", "**/.eslintrc.js"],
"ignoreDependencies": ["better-sqlite3", "app", "@testing-library/jest-dom", "webpack-env"]
}
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@
"dev": "concurrently \"yarn start\" \"yarn start-backend\"",
"start": "yarn workspace app start",
"start-backend": "yarn workspace backend start",
"build": "backstage-cli repo build --all",
"build:backend": "yarn workspace backend build",
"build:all": "backstage-cli repo build --all",
"build-image": "yarn workspace backend build-image",
"tsc": "tsc",
"tsc:full": "tsc --skipLibCheck false --incremental false",
"clean": "backstage-cli repo clean",
"test": "backstage-cli repo test",
"test:all": "backstage-cli repo test --coverage",
"test:e2e": "playwright test",
"fix": "backstage-cli repo fix",
"lint": "backstage-cli repo lint --since origin/master",
"lint:all": "backstage-cli repo lint",
"create-plugin": "backstage-cli create-plugin --scope internal --no-private",
"remove-plugin": "backstage-cli remove-plugin",
"prettier:check": "prettier --check .",
"new": "backstage-cli new --scope internal",
"knip": "knip",
"prepare": "husky install",
"postinstall": "husky install || true"
},
Expand All @@ -44,14 +47,17 @@
"@backstage/e2e-test-utils": "^0.1.0",
"@playwright/test": "^1.32.3",
"@spotify/prettier-config": "^7.0.0",
"@types/node": "^18.0.0",
"@types/node": "^20.10.5",
"concurrently": "^6.0.0",
"eslint-plugin-jest": "*",
"eslint": "^8.6.0",
"fs-extra": "10.1.0",
"husky": "^8.0.0",
"jest": "^29.7.0",
"knip": "^3.9.0",
"lint-staged": "^15.0.0",
"node-fetch": "^2.6.7",
"prettier": "^2.3.2",
"typescript": "~5.2.0"
"typescript": "~5.3.3"
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
Expand Down
9 changes: 1 addition & 8 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"bundled": true,
"dependencies": {
"@backstage/app-defaults": "^1.4.7-next.1",
"@backstage/catalog-model": "^1.4.3",
"@backstage/cli": "^0.25.1-next.1",
"@backstage/core-app-api": "^1.11.3-next.0",
"@backstage/core-components": "^0.13.10-next.1",
Expand All @@ -18,7 +17,6 @@
"@backstage/plugin-badges": "^0.2.53-next.2",
"@backstage/plugin-catalog": "^1.16.1-next.2",
"@backstage/plugin-catalog-graph": "^0.3.3-next.2",
"@backstage/plugin-catalog-react": "^1.9.3-next.2",
"@backstage/plugin-cost-insights": "^0.12.18-next.2",
"@backstage/plugin-explore": "^0.4.15-next.2",
"@backstage/plugin-github-actions": "^0.6.10-next.2",
Expand All @@ -35,23 +33,18 @@
"@backstage/theme": "^0.5.0",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
"history": "^5.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-use": "^15.3.3"
"react-router-dom": "^6.3.0"
},
"devDependencies": {
"@playwright/test": "^1.32.3",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/jest": "^26.0.7",
"@types/node": "^12.0.0",
"@types/react-dom": "*",
"@types/uuid": "^9.0.0",
"cross-env": "^7.0.0",
"uuid": "^9.0.1"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as plugins from './plugins';
import { badgesPlugin } from './plugins';

import { AlertDisplay, OAuthRequestDialog } from '@backstage/core-components';
import { AppRouter, FeatureFlagged, FlatRoutes } from '@backstage/core-app-api';
Expand Down Expand Up @@ -45,7 +45,7 @@ import { CustomizableHomePage } from './components/home/CustomizableHomePage';

const app = createApp({
apis,
plugins: Object.values(plugins),
plugins: [badgesPlugin],
bindRoutes({ bind }) {
bind(catalogPlugin.externalRoutes, {
viewTechDoc: techdocsPlugin.routes.docRoot,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const entityWarningContent = (
</>
);

export const cicdContent = (
const cicdContent = (
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<EntityGithubActionsContent />
Expand Down
9 changes: 0 additions & 9 deletions packages/app/src/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
export { plugin as ApiDocs } from '@backstage/plugin-api-docs';
export { catalogPlugin as CatalogPlugin } from '@backstage/plugin-catalog';
export { plugin as TechRadar } from '@backstage/plugin-tech-radar';
export { plugin as GithubActions } from '@backstage/plugin-github-actions';
export { plugin as CostInsights } from '@backstage/plugin-cost-insights';
export { plugin as GraphiQL } from '@backstage/plugin-graphiql';
export { plugin as UserSettings } from '@backstage/plugin-user-settings';
export { plugin as TechDocs } from '@backstage/plugin-techdocs';
export { badgesPlugin } from '@backstage/plugin-badges';
export { todoPlugin } from '@backstage/plugin-todo';
18 changes: 3 additions & 15 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,18 @@
"role": "backend"
},
"scripts": {
"build": "backstage-cli package build",
"build-image": "docker build ../.. -f Dockerfile --tag example-backend",
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"migrate:create": "knex migrate:make -x ts"
"build-image": "docker build ../.. -f Dockerfile --tag backstage"
},
"dependencies": {
"@backstage/backend-common": "^0.20.1-next.2",
"@backstage/backend-defaults": "^0.2.9-next.2",
"@backstage/backend-tasks": "^0.5.14-next.2",
"@backstage/catalog-client": "^1.5.2-next.0",
"@backstage/catalog-model": "^1.4.3",
"@backstage/config": "^1.1.1",
"@backstage/errors": "^1.2.3",
"@backstage/plugin-app-backend": "^0.3.57-next.2",
"@backstage/plugin-auth-backend": "^0.20.3-next.2",
"@backstage/plugin-auth-backend-module-github-provider": "^0.1.6-next.2",
Expand All @@ -33,29 +29,21 @@
"@backstage/plugin-explore-backend": "^0.0.19-next.2",
"@backstage/plugin-explore-common": "^0.0.2",
"@backstage/plugin-permission-common": "^0.7.11",
"@backstage/plugin-permission-node": "^0.7.20-next.2",
"@backstage/plugin-proxy-backend": "^0.4.7-next.2",
"@backstage/plugin-search-backend": "^1.4.9-next.2",
"@backstage/plugin-search-backend-module-catalog": "^0.1.13-next.2",
"@backstage/plugin-search-backend-module-explore": "^0.1.13-next.2",
"@backstage/plugin-search-backend-module-techdocs": "^0.1.13-next.2",
"@backstage/plugin-search-backend-node": "^1.2.13-next.2",
"@backstage/plugin-techdocs-backend": "^1.9.2-next.2",
"@backstage/plugin-todo-backend": "^0.3.7-next.2",
"@frontside/backstage-plugin-graphql-backend": "^0.1.2",
"@frontside/backstage-plugin-graphql-backend-module-catalog": "^0.1.2",
"app": "^0.0.0",
"better-sqlite3": "^7.5.0",
"dockerode": "^3.2.1",
"express": "^4.17.1",
"express-promise-router": "^3.0.3",
"winston": "^3.2.1"
},
"devDependencies": {
"@backstage/cli": "^0.25.1-next.1",
"@types/dockerode": "^3.2.1",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5",
"@types/helmet": "^0.0.47"
"@types/express": "^4.17.6"
}
}
14 changes: 0 additions & 14 deletions packages/backend/src/plugins/app.ts

This file was deleted.

19 changes: 0 additions & 19 deletions packages/backend/src/plugins/auth.ts

This file was deleted.

20 changes: 0 additions & 20 deletions packages/backend/src/plugins/badges.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/backend/src/plugins/catalog.ts

This file was deleted.

20 changes: 0 additions & 20 deletions packages/backend/src/plugins/graphql.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/backend/src/plugins/proxy.ts

This file was deleted.

61 changes: 0 additions & 61 deletions packages/backend/src/plugins/search.ts

This file was deleted.

Loading

0 comments on commit 23d4be4

Please sign in to comment.