Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Knip and related changes #208

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added Knip and related changes
Signed-off-by: Andre Wanlin <awanlin@spotify.com>
awanlin committed Jan 15, 2024
commit b502d037b824505e017326aa98d0044f943db8be
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -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:
3 changes: 3 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
@@ -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

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
@@ -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"
},
@@ -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"
awanlin marked this conversation as resolved.
Show resolved Hide resolved
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
7 changes: 1 addition & 6 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -35,23 +35,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": {
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';
@@ -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,
2 changes: 1 addition & 1 deletion packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
@@ -115,7 +115,7 @@ const entityWarningContent = (
</>
);

export const cicdContent = (
const cicdContent = (
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<EntityGithubActionsContent />
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';
7 changes: 2 additions & 5 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -8,13 +8,12 @@
"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",
@@ -46,9 +45,7 @@
"@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": {
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.

48 changes: 0 additions & 48 deletions packages/backend/src/plugins/techdocs.ts

This file was deleted.

27 changes: 0 additions & 27 deletions packages/backend/src/plugins/todo.ts

This file was deleted.

1,182 changes: 967 additions & 215 deletions yarn.lock

Large diffs are not rendered by default.