Skip to content

Commit 2d0c0a9

Browse files
authored
feat: use new frontend system (#851)
1 parent de632d6 commit 2d0c0a9

26 files changed

+5230
-9336
lines changed

app-config.production.yaml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ app:
22
# Should be the same as backend.baseUrl when using the `app-backend` plugin.
33
baseUrl: http://localhost:7007
44

5-
auth:
6-
# see https://backstage.io/docs/auth/ to learn about auth providers
7-
providers:
8-
guest: null
9-
105
backend:
116
# Note that the baseUrl should be the URL that the browser and other clients
127
# should use when communicating with the backend, i.e. it needs to be
@@ -18,7 +13,7 @@ backend:
1813
# all interfaces, the most permissive setting. The right value depends on your specific deployment.
1914
listen: ':7007'
2015

21-
# config options: https://node-postgres.com/api/client
16+
# config options: https://node-postgres.com/apis/client
2217
database:
2318
client: pg
2419
connection:
@@ -33,8 +28,28 @@ backend:
3328
# ca: # if you have a CA file and want to verify it you can uncomment this section
3429
# $file: <file-path>/ca/server.crt
3530

31+
auth:
32+
providers:
33+
guest: {}
34+
3635
catalog:
3736
# Overrides the default list locations from app-config.yaml as these contain example data.
3837
# See https://backstage.io/docs/features/software-catalog/#adding-components-to-the-catalog for more details
3938
# on how to get entities into the catalog.
40-
locations: []
39+
locations:
40+
# Local example data, replace this with your production config, these are intended for demo use only.
41+
# File locations are relative to the backend process, typically in a deployed context, such as in a Docker container, this will be the root
42+
- type: file
43+
target: ./examples/entities.yaml
44+
45+
# Local example template
46+
- type: file
47+
target: ./examples/template/template.yaml
48+
rules:
49+
- allow: [Template]
50+
51+
# Local example organizational data
52+
- type: file
53+
target: ./examples/org.yaml
54+
rules:
55+
- allow: [User, Group]

app-config.yaml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,24 @@ renovate:
3434
dryRun: full
3535

3636
# General configuration for the app
37-
3837
app:
3938
title: Scaffolded Backstage App
4039
baseUrl: http://localhost:3000
4140

41+
# Enable all packages by default, this will discover packages from packages/app/package.json
42+
packages: all
43+
44+
extensions:
45+
# Disable the nav items that we're manually rendering in packages/app/src/modules/nav/Sidebar.tsx
46+
- nav-item:search: false
47+
- nav-item:user-settings: false
48+
- nav-item:catalog: false
49+
50+
# Configure the catalog index page to be the root page, this is normally mounted on /catalog
51+
- page:catalog:
52+
config:
53+
path: /
54+
4255
organization:
4356
name: My Company
4457

@@ -59,9 +72,7 @@ backend:
5972
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
6073
# Default Helmet Content-Security-Policy values can be removed by setting the key to false
6174
cors:
62-
origin:
63-
- http://localhost:3000
64-
- http://localhost:7007
75+
origin: http://localhost:3000
6576
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
6677
credentials: true
6778
exposedHeaders:
@@ -81,7 +92,7 @@ integrations:
8192
github:
8293
- host: github.com
8394
# This is a Personal Access Token or PAT from GitHub. You can find out how to generate this token, and more information
84-
# about setting up the GitHub integration here: https://backstage.io/docs/getting-started/configuration#setting-up-a-github-integration
95+
# about setting up the GitHub integration here: https://backstage.io/docs/integrations/github/locations#configuration
8596
token: ${GITHUB_TOKEN}
8697
### Example for how to add your GitHub Enterprise instance using the API:
8798
# - host: ghe.example.net
@@ -110,6 +121,7 @@ techdocs:
110121
auth:
111122
# see https://backstage.io/docs/auth/ to learn about auth providers
112123
providers:
124+
# See https://backstage.io/docs/auth/guest/provider
113125
guest: {}
114126

115127
scaffolder:
@@ -126,6 +138,28 @@ catalog:
126138
- type: file
127139
target: ../../examples/entities.yaml
128140

141+
# Local example template
142+
- type: file
143+
target: ../../examples/template/template.yaml
144+
rules:
145+
- allow: [Template]
146+
147+
# Local example organizational data
148+
- type: file
149+
target: ../../examples/org.yaml
150+
rules:
151+
- allow: [User, Group]
152+
153+
## Uncomment these lines to add more example data
154+
# - type: url
155+
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all.yaml
156+
157+
## Uncomment these lines to add an example org
158+
# - type: url
159+
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme-corp.yaml
160+
# rules:
161+
# - allow: [User, Group]
162+
129163
providers:
130164
github:
131165
myOrg:
@@ -142,3 +176,11 @@ catalog:
142176
- catalog
143177
- search
144178
- renovate
179+
180+
kubernetes:
181+
# see https://backstage.io/docs/features/kubernetes/configuration for kubernetes configuration options
182+
183+
# see https://backstage.io/docs/permissions/getting-started for more on the permission framework
184+
permission:
185+
# setting this to `false` will disable permissions
186+
enabled: true

docker-compose.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ volumes:
55
services:
66
db:
77
image: postgres:17
8-
env_file:
9-
- packages/backend/.env
8+
environment:
9+
POSTGRES_USER: backstage
10+
POSTGRES_PASSWORD: password
1011
volumes:
1112
- postgres:/var/lib/postgresql/data
1213
ports:

lerna.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

package.json

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,26 @@
1111
},
1212
"packageManager": "[email protected]",
1313
"scripts": {
14-
"fix": "yarn prettier:fix && backstage-cli repo fix --publish && backstage-cli repo lint --fix && yarn dedupe --strategy highest",
15-
"check": "yarn prettier:check && yarn tsc:full && yarn lint && yarn test:all && yarn dedupe --check",
16-
"check:agent": "./scripts/check-agents.sh",
17-
"dev": "concurrently \"yarn start\" \"yarn start-backend\"",
18-
"start": "yarn workspace app start",
19-
"start-backend": "yarn workspace backend start",
20-
"build:backend": "yarn workspace backend build",
21-
"build:all": "backstage-cli repo build --all",
2214
"build-image": "yarn workspace backend build-image",
23-
"build:api-reports": "yarn build:api-reports:only --tsc",
24-
"build:api-reports:only": "NODE_OPTIONS=--max-old-space-size=8192 backstage-repo-tools api-reports --allow-all-warnings -o ae-wrong-input-file-type --validate-release-tags",
15+
"build:all": "backstage-cli repo build --all",
16+
"build:backend": "yarn workspace backend build",
17+
"check": "yarn prettier:check && yarn tsc:full && yarn repo:lint && yarn test:all && yarn dedupe --check",
18+
"clean": "backstage-cli repo clean",
2519
"docker-deps": "docker compose up -d",
2620
"generate": "yarn workspace @secustor/backstage-plugin-renovate-backend generate",
27-
"tsc": "tsc",
28-
"tsc:full": "tsc --incremental false",
29-
"clean": "backstage-cli repo clean",
30-
"jest": "jest",
31-
"test": "backstage-cli repo test",
32-
"test:all": "backstage-cli repo test --coverage",
33-
"test:jest": "jest --coverage",
34-
"test:e2e": "playwright test",
35-
"lint": "backstage-cli repo lint --since origin/main",
36-
"lint:fix": "yarn prettier:fix && backstage-cli repo lint --fix && yarn tsc:full && yarn dedupe --strategy highest",
21+
"fix": "yarn prettier:fix && backstage-cli repo fix --publish && backstage-cli repo lint --fix && yarn dedupe --strategy highest",
3722
"lint:all": "backstage-cli repo lint",
23+
"new": "backstage-cli new",
3824
"prettier:check": "prettier --check .",
3925
"prettier:fix": "prettier --write .",
40-
"new": "backstage-cli new --scope internal",
41-
"prepare": "husky"
26+
"repo:fix": "backstage-cli repo fix",
27+
"repo:lint": "backstage-cli repo lint --since origin/main",
28+
"start": "backstage-cli repo start",
29+
"test": "backstage-cli repo test",
30+
"test:all": "backstage-cli repo test --coverage",
31+
"test:e2e": "playwright test",
32+
"tsc": "tsc",
33+
"tsc:full": "tsc --skipLibCheck false --incremental false"
4234
},
4335
"workspaces": {
4436
"packages": [
@@ -47,35 +39,22 @@
4739
]
4840
},
4941
"devDependencies": {
50-
"@backstage/cli": "0.34.1",
51-
"@backstage/e2e-test-utils": "0.1.1",
52-
"@backstage/repo-tools": "0.15.1",
42+
"@backstage/cli": "^0.34.1",
43+
"@backstage/e2e-test-utils": "^0.1.1",
5344
"@changesets/changelog-github": "0.5.1",
5445
"@changesets/cli": "2.29.6",
5546
"@playwright/test": "1.55.0",
56-
"@spotify/prettier-config": "15.0.0",
57-
"@types/jest": "29.5.14",
58-
"concurrently": "9.2.1",
59-
"husky": "9.1.7",
60-
"jest": "29.7.0",
61-
"jest-environment-jsdom": "30.1.1",
62-
"lerna": "8.2.3",
6347
"lint-staged": "16.1.5",
6448
"node-gyp": "11.4.2",
65-
"pinst": "3.0.0",
6649
"prettier": "3.6.2",
67-
"ts-jest": "29.4.1",
6850
"typescript": "5.9.2"
6951
},
7052
"resolutions": {
7153
"@types/react": "^18",
7254
"@types/react-dom": "^18"
7355
},
74-
"prettier": "@spotify/prettier-config",
56+
"prettier": "@backstage/cli/config/prettier",
7557
"lint-staged": {
76-
"package.json": [
77-
"prettier --write"
78-
],
7958
"*.{js,jsx,ts,tsx,mjs,cjs}": [
8059
"eslint --fix",
8160
"prettier --write"
@@ -91,7 +70,19 @@
9170
"license": "LGPL-3.0",
9271
"namePrefix": "@secustor/",
9372
"namePluginInfix": "backstage-plugin-"
94-
}
73+
},
74+
"templates": [
75+
"@backstage/cli/templates/new-frontend-plugin",
76+
"@backstage/cli/templates/new-frontend-plugin-module",
77+
"@backstage/cli/templates/backend-plugin",
78+
"@backstage/cli/templates/backend-plugin-module",
79+
"@backstage/cli/templates/plugin-web-library",
80+
"@backstage/cli/templates/plugin-node-library",
81+
"@backstage/cli/templates/plugin-common-library",
82+
"@backstage/cli/templates/web-library",
83+
"@backstage/cli/templates/node-library",
84+
"@backstage/cli/templates/scaffolder-backend-module"
85+
]
9586
}
9687
}
9788
},

packages/app/e2e-tests/app.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@ import { test, expect } from '@playwright/test';
1919
test('App should render the welcome page', async ({ page }) => {
2020
await page.goto('/');
2121

22+
const enterButton = page.getByRole('button', { name: 'Enter' });
23+
await expect(enterButton).toBeVisible();
24+
await enterButton.click();
25+
2226
await expect(page.getByText('My Company Catalog')).toBeVisible();
2327
});

packages/app/package.json

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,52 +14,38 @@
1414
"lint": "backstage-cli package lint"
1515
},
1616
"dependencies": {
17-
"@backstage-community/plugin-github-actions": "^0.13.0",
18-
"@backstage-community/plugin-tech-radar": "^1.0.0",
19-
"@backstage/app-defaults": "^1.6.5",
20-
"@backstage/catalog-model": "^1.7.5",
2117
"@backstage/cli": "^0.34.1",
22-
"@backstage/core-app-api": "^1.18.0",
18+
"@backstage/core-compat-api": "^0.5.1",
2319
"@backstage/core-components": "^0.17.5",
2420
"@backstage/core-plugin-api": "^1.10.9",
21+
"@backstage/frontend-defaults": "^0.3.0",
22+
"@backstage/frontend-plugin-api": "^0.11.0",
2523
"@backstage/integration-react": "^1.2.9",
26-
"@backstage/plugin-api-docs": "^0.12.10",
24+
"@backstage/plugin-app-visualizer": "^0.1.22",
2725
"@backstage/plugin-catalog": "^1.31.2",
28-
"@backstage/plugin-catalog-common": "^1.1.5",
29-
"@backstage/plugin-catalog-graph": "^0.4.22",
30-
"@backstage/plugin-catalog-import": "^0.13.4",
31-
"@backstage/plugin-catalog-react": "^1.20.1",
26+
"@backstage/plugin-notifications": "^0.5.8",
3227
"@backstage/plugin-org": "^0.6.43",
33-
"@backstage/plugin-permission-react": "^0.4.36",
3428
"@backstage/plugin-scaffolder": "^1.34.0",
3529
"@backstage/plugin-search": "^1.4.29",
36-
"@backstage/plugin-search-react": "^1.9.3",
37-
"@backstage/plugin-techdocs": "^1.14.1",
38-
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.27",
39-
"@backstage/plugin-techdocs-react": "^1.3.2",
30+
"@backstage/plugin-signals": "^0.0.22",
4031
"@backstage/plugin-user-settings": "^0.8.25",
41-
"@backstage/theme": "^0.6.8",
42-
"@material-ui/core": "^4.12.4",
43-
"@material-ui/icons": "^4.11.3",
44-
"@mui/icons-material": "^7.0.0",
45-
"@mui/material": "^7.0.0",
46-
"@mui/styles": "^6.1.0",
32+
"@backstage/ui": "^0.7.0",
33+
"@material-ui/core": "^4.12.2",
34+
"@material-ui/icons": "^4.9.1",
4735
"@secustor/backstage-plugin-renovate": "workspace:^",
48-
"history": "^5.0.0",
4936
"react": "^18.0.2",
5037
"react-dom": "^18.0.2",
5138
"react-router": "^6.3.0",
52-
"react-router-dom": "^6.3.0",
53-
"react-use": "^17.2.4"
39+
"react-router-dom": "^6.3.0"
5440
},
5541
"devDependencies": {
56-
"@backstage/test-utils": "1.7.11",
42+
"@backstage/frontend-test-utils": "^0.3.5",
5743
"@playwright/test": "1.55.0",
5844
"@testing-library/dom": "10.4.1",
5945
"@testing-library/jest-dom": "6.8.0",
6046
"@testing-library/react": "16.3.0",
6147
"@testing-library/user-event": "14.6.1",
62-
"@types/react-dom": "18.3.7",
48+
"@types/react-dom": "*",
6349
"cross-env": "10.0.0"
6450
},
6551
"browserslist": {

packages/app/public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="theme-color" content="#000000" />
77
<meta
88
name="description"
9-
content="Backstage is an open platform for building developer portals"
9+
content="Backstage is an open source framework for building developer portals"
1010
/>
1111
<!--
1212
manifest.json provides metadata used when your web app is installed on a
@@ -41,7 +41,7 @@
4141
href="<%= publicPath %>/safari-pinned-tab.svg"
4242
color="#5bbad5"
4343
/>
44-
<title><%= config.getString('app.title') %></title>
44+
<title><%= config.getOptionalString('app.title') ?? 'Backstage' %></title>
4545
</head>
4646
<body>
4747
<noscript>You need to enable JavaScript to run this app.</noscript>

packages/app/src/App.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('App', () => {
1919
] as any,
2020
};
2121

22-
const rendered = render(<App />);
22+
const rendered = render(App.createRoot());
2323

2424
await waitFor(() => {
2525
expect(rendered.baseElement).toBeInTheDocument();

0 commit comments

Comments
 (0)