Skip to content

Commit

Permalink
chore(deps): update to backstage 1.26.x (janus-idp#1536)
Browse files Browse the repository at this point in the history
* chore(deps): update to backstage 1.26.x

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* update to new backend

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* update to 1.26.4

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* lint

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix scripts

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* update frontend to match showcase

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* format files

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix keycloak test

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix(deps): remove react-router-dom from dev dependencies and as it's there in peer dependency (#2)

* update to backstage 1.26.5

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix kiali

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* revert to basic frontend

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix linting

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix lint config

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* lint files

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* update dist-dynamic

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix resolutions

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* update react-router-dom

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix react deps

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix deprecations

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* potential fix for react

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix dep resolution

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* skip orchestrator test

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* add eslint rule

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix tsc error

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix(orchestrator): force react dependency to be 18.3 and return test (#3)

resolved issue that caused orchestrator to install it's own react version
thus causing the test to fail and the entire page to crash.

* fix(e2e): update e2e tests to allow guest login (janus-idp#4)

* update common test file

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* update lockfiles

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* fix react

Signed-off-by: Paul Schultz <pschultz@pobox.com>

---------

Signed-off-by: Paul Schultz <pschultz@pobox.com>
Co-authored-by: Jaivardhan Kumar <mailjai.vardhan@gmail.com>
Co-authored-by: Bat-Zion Rotman <brotman@redhat.com>
Co-authored-by: Debsmita Santra <debsmita.santra@gmail.com>
  • Loading branch information
4 people authored May 9, 2024
1 parent 2675371 commit 3c1239f
Show file tree
Hide file tree
Showing 134 changed files with 7,776 additions and 10,120 deletions.
74 changes: 9 additions & 65 deletions app-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
app:
title: Scaffolded Backstage App
title: Janus IDP Plugins
baseUrl: http://localhost:3000

organization:
name: My Company
name: Red Hat

backend:
# Used for enabling authentication, secret is shared by all backend plugins
Expand Down Expand Up @@ -34,21 +34,9 @@ backend:
store: memory
# workingDirectory: /tmp # Use this to configure a working directory for the scaffolder, defaults to the OS temp-dir

integrations:
github:
- host: github.com
# This is a Personal Access Token or PAT from GitHub. You can find out how to generate this token, and more information
# about setting up the GitHub integration here: https://backstage.io/docs/getting-started/configuration#setting-up-a-github-integration
token: ${GITHUB_TOKEN}
### Example for how to add your GitHub Enterprise instance using the API:
# - host: ghe.example.net
# apiBaseUrl: https://ghe.example.net/api/v3
# token: ${GHE_TOKEN}
integrations: {}

proxy:
'/test':
target: 'https://example.com'
changeOrigin: true
'/quay/api':
target: 'https://quay.io'
headers:
Expand All @@ -62,10 +50,6 @@ proxy:
quay:
uiUrl: 'https://quay.io'

# Reference documentation http://backstage.io/docs/features/techdocs/configuration
# Note: After experimenting with basic setup, use CI/CD to generate docs
# and an external cloud storage when deploying TechDocs for production use-case.
# https://backstage.io/docs/features/techdocs/how-to-guides#how-to-migrate-from-techdocs-basic-to-recommended-deployment-approach
techdocs:
builder: 'local' # Alternatives - 'external'
generator:
Expand All @@ -86,53 +70,13 @@ catalog:
entityFilename: catalog-info.yaml
pullRequestBranchName: backstage-integration
rules:
- allow: [Component, System, API, Resource, Location]
- allow: [Component, System, Group, Resource, Location, Template, API]
locations:
# Local example data, file locations are relative to the backend process, typically `packages/backend`
- type: file
target: ../../examples/entities.yaml

# Local example template
- type: file
target: ../../examples/template/template.yaml
rules:
- allow: [Template]

# Local example organizational data
- type: file
target: ../../examples/org.yaml
rules:
- allow: [User, Group]
- type: url
target: https://github.com/janus-idp/backstage-showcase/blob/main/catalog-entities/all.yaml

## Uncomment these lines to add more example data
# - type: url
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all.yaml
- type: url
target: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/main/templates.yaml

## Uncomment these lines to add an example org
# - type: url
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme-corp.yaml
# rules:
# - allow: [User, Group]
dynamicPlugins:
frontend:
janus.dynamic-frontend-plugin:
dynamicRoutes:
- path: '/settings'
importName: 'UserSettingsPage'
module: 'UserSettings'
- path: '/tech-radar'
width: 1500
height: 800
importName: 'TechRadarPage'
module: 'TechRadar'
- path: '/create'
importName: 'ScaffolderPage'
module: 'Scaffolder'
routeBindings:
- bindTarget: 'catalogPlugin.externalRoutes'
bindMap:
createComponent: 'remotePlugins.Scaffolder.scaffolderPlugin.routes.root'
viewTechDoc: 'techdocsPlugin.routes.docRoot'
- bindTarget: 'remotePlugins.Scaffolder.scaffolderPlugin.externalRoutes'
bindMap:
registerComponent: 'catalogImportPlugin.routes.importPage'
frontend: {}
2 changes: 1 addition & 1 deletion backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.25.2"
"version": "1.26.5"
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
},
"scripts": {
"preinstall": "npx only-allow yarn",
"start:backstage": "turbo run start:backstage",
"start:backend": "turbo run start --filter=...backend",
"start:backstage": "turbo run start --filter=...app --filter=...backend",
"start:plugins": "turbo run start --filter=@janus-idp/*",
"start:storybook": "yarn --cwd packages/storybook start",
"build": "turbo run build",
"build:backstage": "turbo run build --filter=...{./packages/app} --filter=...{./packages/backend}",
"build:backstage": "turbo run build --filter=...app --filter=...backend",
"build:plugins": "turbo run build --filter=@janus-idp/*",
"build:storybook": "yarn --cwd packages/storybook build",
"tsc": "turbo run tsc",
Expand Down Expand Up @@ -39,7 +40,7 @@
]
},
"devDependencies": {
"@backstage/cli": "0.26.2",
"@backstage/cli": "0.26.4",
"@ianvs/prettier-plugin-sort-imports": "4.1.1",
"@janus-idp/cli": "*",
"@semantic-release/changelog": "6.0.3",
Expand Down
13 changes: 12 additions & 1 deletion packages/app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
const backstageConfig = require('@backstage/cli/config/eslint-factory')(
__dirname,
);

module.exports = {
...backstageConfig,
rules: {
...backstageConfig.rules,
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
},
};
88 changes: 41 additions & 47 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,63 +15,57 @@
"role": "frontend"
},
"scripts": {
"start": "yarn start:backstage",
"start:backstage": "janus-cli package start",
"build": "janus-cli package build",
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"tsc": "tsc",
"clean": "backstage-cli package clean",
"test": "backstage-cli package test --passWithNoTests --coverage",
"lint": "backstage-cli package lint"
},
"dependencies": {
"@backstage/app-defaults": "^1.5.3",
"@backstage/app-defaults": "^1.5.4",
"@backstage/catalog-model": "^1.4.5",
"@backstage/core-app-api": "^1.12.3",
"@backstage/core-components": "^0.14.3",
"@backstage/core-plugin-api": "^1.9.1",
"@backstage/integration-react": "^1.1.25",
"@backstage/plugin-api-docs": "^0.11.3",
"@backstage/plugin-catalog": "^1.18.2",
"@backstage/core-app-api": "^1.12.4",
"@backstage/core-components": "^0.14.6",
"@backstage/core-plugin-api": "^1.9.2",
"@backstage/integration-react": "^1.1.26",
"@backstage/plugin-api-docs": "^0.11.4",
"@backstage/plugin-catalog": "^1.19.0",
"@backstage/plugin-catalog-common": "^1.0.22",
"@backstage/plugin-catalog-graph": "^0.4.3",
"@backstage/plugin-catalog-import": "^0.10.9",
"@backstage/plugin-catalog-react": "^1.11.2",
"@backstage/plugin-github-actions": "^0.6.14",
"@backstage/plugin-org": "^0.6.23",
"@backstage/plugin-permission-react": "^0.4.21",
"@backstage/plugin-scaffolder": "^1.19.2",
"@backstage/plugin-search": "^1.4.9",
"@backstage/plugin-search-react": "^1.7.9",
"@backstage/plugin-tech-radar": "^0.7.2",
"@backstage/plugin-techdocs": "^1.10.3",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.8",
"@backstage/plugin-techdocs-react": "^1.2.2",
"@backstage/plugin-user-settings": "^0.8.4",
"@backstage/theme": "^0.5.2",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@openshift/dynamic-plugin-sdk": "^4.0.0",
"@scalprum/core": "^0.6.1",
"@scalprum/react-core": "^0.6.1",
"history": "^5.3.0",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^6.17.0",
"react-router-dom": "^6.17.0",
"react-use": "^17.4.0"
"@backstage/plugin-catalog-graph": "^0.4.4",
"@backstage/plugin-catalog-import": "^0.10.10",
"@backstage/plugin-catalog-react": "^1.11.3",
"@backstage/plugin-org": "^0.6.24",
"@backstage/plugin-permission-react": "^0.4.22",
"@backstage/plugin-scaffolder": "^1.19.3",
"@backstage/plugin-search": "^1.4.10",
"@backstage/plugin-search-react": "^1.7.10",
"@backstage/plugin-techdocs": "^1.10.4",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.9",
"@backstage/plugin-techdocs-react": "^1.2.3",
"@backstage/plugin-user-settings": "^0.8.5",
"@emotion/react": "^11.11.4",
"@mui/icons-material": "^5.15.16",
"@mui/material": "^5.15.16",
"@mui/styles": "^5.15.16",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router": "^6.23.0",
"react-router-dom": "^6.23.0",
"tss-react": "^4.9.10",
"@backstage-community/plugin-github-actions": "^0.6.16",
"@backstage-community/plugin-tech-radar": "^0.7.4"
},
"devDependencies": {
"@backstage/cli": "0.26.2",
"@backstage/test-utils": "1.5.3",
"@janus-idp/cli": "*",
"@scalprum/react-test-utils": "0.0.4",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "14.2.1",
"@testing-library/user-event": "14.5.1",
"@types/node": "18.18.5",
"@types/react-dom": "18.2.18",
"cross-env": "7.0.3"
"@backstage/cli": "0.26.4",
"@backstage/test-utils": "1.5.4",
"@testing-library/dom": "9.0.0",
"@testing-library/jest-dom": "6.0.0",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.0.0",
"@types/node": "18.19.31",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.25"
},
"browserslist": {
"production": [
Expand Down
36 changes: 6 additions & 30 deletions packages/app/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
import React from 'react';

import { removeScalprum } from '@scalprum/core';
import { mockPluginData } from '@scalprum/react-test-utils';
import { render, waitFor } from '@testing-library/react';

import { AppBase } from './App';
import TestRoot from './utils/test/TestRoot';
import App from './App';

describe('App', () => {
beforeEach(() => {
removeScalprum();
});

it('should render', async () => {
const { TestScalprumProvider } = mockPluginData({
url: 'http://localhost:7007/foo/bar.json',
module: 'UserSettings',
pluginManifest: {
baseURL: 'http://localhost:7007',
extensions: [],
name: 'janus.dynamic-frontend-plugin',
loadScripts: [],
version: '1.0.0',
registrationMethod: 'custom',
},
});
process.env = {
NODE_ENV: 'test',
APP_CONFIG: [
Expand All @@ -41,13 +20,10 @@ describe('App', () => {
] as any,
};

const rendered = render(
<TestScalprumProvider>
<TestRoot>
<AppBase />
</TestRoot>
</TestScalprumProvider>,
);
await waitFor(() => expect(rendered.baseElement).toBeInTheDocument());
const rendered = render(<App />);

await waitFor(() => {
expect(rendered.baseElement).toBeInTheDocument();
});
});
});
Loading

0 comments on commit 3c1239f

Please sign in to comment.