Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,11 @@ module.exports = {
],
},
},
{
files: ['workspaces/dcm/**/*.[jt]s?(x)'],
rules: {
'@backstage/no-undeclared-imports': 'off',
},
},
],
};
8 changes: 8 additions & 0 deletions workspaces/dcm/.changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
14 changes: 14 additions & 0 deletions workspaces/dcm/.changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"privatePackages": {
"tag": false,
"version": false
}
}
8 changes: 8 additions & 0 deletions workspaces/dcm/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git
.yarn/cache
.yarn/install-state.gz
node_modules
packages/*/src
packages/*/node_modules
plugins
*.local.yaml
1 change: 1 addition & 0 deletions workspaces/dcm/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
playwright.config.ts
1 change: 1 addition & 0 deletions workspaces/dcm/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../.eslintrc.cjs');
54 changes: 54 additions & 0 deletions workspaces/dcm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# macOS
.DS_Store

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Coverage directory generated when running tests with coverage
coverage

# Dependencies
node_modules/

# Yarn 3 files
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Node version directives
.nvmrc

# dotenv environment variables file
.env
.env.test

# Build output
dist
dist-types

# Temporary change files created by Vim
*.swp

# MkDocs build output
site

# Local configuration files
*.local.yaml

# Sensitive credentials
*-credentials.yaml

# vscode database functionality support files
*.session.sql

# E2E test reports
e2e-test-report/
5 changes: 5 additions & 0 deletions workspaces/dcm/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
dist-types
coverage
.vscode
.eslintrc.js
942 changes: 942 additions & 0 deletions workspaces/dcm/.yarn/releases/yarn-4.12.0.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions workspaces/dcm/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
compressionLevel: mixed

yarnPath: .yarn/releases/yarn-4.12.0.cjs
32 changes: 32 additions & 0 deletions workspaces/dcm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# DCM workspace

This workspace contains the DCM plugin and a full Backstage app + backend for local development, similar to the redhat-resource-optimization workspace.

## Structure

- **packages/app** – Full Backstage frontend (catalog, techdocs, search, scaffolder, DCM plugin).
- **packages/backend** – Full Backstage backend (catalog, auth, scaffolder, techdocs, search, DCM backend plugin).
- **plugins/dcm** – DCM frontend plugin.
- **plugins/dcm-backend** – DCM backend plugin.
- **plugins/dcm-common** – Shared code for DCM.

## Development

From the workspace root:

```sh
yarn install
yarn start
```

This runs the full app and backend concurrently (frontend at http://localhost:3000, backend at http://localhost:7007). You can then open the DCM page at http://localhost:3000/dcm.

### Other scripts

- **yarn start-app** – Start only the frontend app.
- **yarn start-backend** – Start only the backend.
- **yarn start:fe-plugin** – Start only the DCM frontend plugin in standalone mode.
- **yarn start:be-plugin** – Start only the DCM backend plugin in standalone mode.
- **yarn start:dev** – Run both plugins in standalone mode (no full app/backend).

Configuration is in `app-config.yaml`. Example catalog data is in `examples/`.
62 changes: 62 additions & 0 deletions workspaces/dcm/app-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
app:
title: DCM
baseUrl: http://localhost:3000
support:
url: https://github.com/redhat-developer/rhdh-plugins/issues
items:
- title: Issues
icon: github
links:
- url: https://github.com/redhat-developer/rhdh-plugins/issues
title: GitHub Issues

organization:
name: DCM

backend:
baseUrl: http://localhost:7007
listen:
port: 7007
csp:
connect-src: ["'self'", 'http:', 'https:']
cors:
origin: http://localhost:3000
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
credentials: true
database:
client: better-sqlite3
connection: ':memory:'

integrations:
github:
- host: github.com
token: ${GITHUB_TOKEN}

techdocs:
builder: 'local'
generator:
runIn: 'docker'
publisher:
type: 'local'

auth:
providers:
guest: {}

scaffolder: {}

catalog:
import:
entityFilename: catalog-info.yaml
pullRequestBranchName: backstage-integration
rules:
- allow: [Component, System, API, Resource, Location]
locations:
- type: file
target: ../../examples/entities.yaml
rules:
- allow: [Component, System, API, Resource, Location]
- type: file
target: ../../examples/org.yaml
rules:
- allow: [User, Group]
1 change: 1 addition & 0 deletions workspaces/dcm/backstage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "version": "1.47.0" }
13 changes: 13 additions & 0 deletions workspaces/dcm/catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: dcm
description: An example of a Backstage application.
# Example for optional annotations
# annotations:
# github.com/project-slug: backstage/backstage
# backstage.io/techdocs-ref: dir:.
spec:
type: website
owner: john@example.com
lifecycle: experimental
70 changes: 70 additions & 0 deletions workspaces/dcm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "@internal/dcm",
"version": "1.0.0",
"private": true,
"engines": {
"node": "18 || 20"
},
"scripts": {
"start": "concurrently -c auto -n \"fe,be\" -p \"{name}:{pid}\" \"yarn start-app\" \"yarn start-backend\"",
"start-app": "yarn workspace app start",
"start-backend": "yarn workspace backend start",
"start:fe-plugin": "yarn workspace @red-hat-developer-hub/backstage-plugin-dcm start",
"start:be-plugin": "yarn workspace @red-hat-developer-hub/backstage-plugin-dcm-backend start",
"start:dev": "concurrently -c auto -n \"fe,be\" -p \"{name}:{pid}\" \"yarn start:fe-plugin\" \"yarn start:be-plugin\"",
"tsc": "tsc",
"tsc:full": "tsc --skipLibCheck true --incremental false",
"build:all": "backstage-cli repo build --all",
"build:api-reports": "yarn build:api-reports:only --tsc",
"build:api-reports:only": "backstage-repo-tools api-reports -o ae-wrong-input-file-type --validate-release-tags",
"build:knip-reports": "backstage-repo-tools knip-reports",
"clean": "backstage-cli repo clean",
"test": "backstage-cli repo test",
"test:all": "backstage-cli repo test --coverage",
"fix": "backstage-cli repo fix",
"lint": "backstage-cli repo lint --since origin/main",
"lint:all": "backstage-cli repo lint",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
"new": "backstage-cli new --scope @red-hat-developer-hub",
"postinstall": "cd ../../ && yarn install"
},
"workspaces": {
"packages": [
"packages/*",
"plugins/*"
]
},
"repository": {
"type": "git",
"url": "https://github.com/redhat-developer/rhdh-plugins",
"directory": "workspaces/dcm"
},
"devDependencies": {
"@backstage/cli": "^0.35.2",
"@backstage/e2e-test-utils": "^0.1.1",
"@backstage/repo-tools": "^0.16.2",
"@changesets/cli": "^2.27.1",
"concurrently": "^9.0.0",
"knip": "^5.27.4",
"node-gyp": "^9.0.0",
"prettier": "^2.3.2",
"typescript": "~5.3.0"
},
"resolutions": {
"@types/react": "^18",
"@types/react-dom": "^18",
"fsevents": "~2.3.2"
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
"*.{js,jsx,ts,tsx,mjs,cjs}": [
"eslint --fix",
"prettier --write"
],
"*.{json,md}": [
"prettier --write"
]
},
"packageManager": "yarn@4.12.0"
}
6 changes: 6 additions & 0 deletions workspaces/dcm/packages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# DCM workspace packages

- **app** – Full Backstage frontend app (catalog, techdocs, search, scaffolder, DCM plugin). Run with `yarn workspace app start`.
- **backend** – Full Backstage backend (catalog, auth, scaffolder, techdocs, search, DCM backend plugin). Run with `yarn workspace backend start`.

From the workspace root, `yarn start` runs both app and backend concurrently.
4 changes: 4 additions & 0 deletions workspaces/dcm/packages/app/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public
*.config.js
*.config.ts
node_modules
1 change: 1 addition & 0 deletions workspaces/dcm/packages/app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
82 changes: 82 additions & 0 deletions workspaces/dcm/packages/app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"name": "app",
"version": "0.0.1",
"private": true,
"bundled": true,
"backstage": {
"role": "frontend"
},
"repository": {
"type": "git",
"url": "https://github.com/redhat-developer/rhdh-plugins",
"directory": "workspaces/dcm/packages/app"
},
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"clean": "backstage-cli package clean",
"test": "backstage-cli package test",
"lint": "backstage-cli package lint"
},
"dependencies": {
"@backstage-community/plugin-rbac": "1.33.2",
"@backstage/app-defaults": "^1.5.16",
"@backstage/catalog-model": "^1.7.3",
"@backstage/cli": "^0.35.2",
"@backstage/core-app-api": "^1.19.4",
"@backstage/core-components": "^0.18.6",
"@backstage/core-plugin-api": "^1.12.2",
"@backstage/integration-react": "^1.2.3",
"@backstage/plugin-api-docs": "^0.12.3",
"@backstage/plugin-catalog": "^1.26.1",
"@backstage/plugin-catalog-common": "^1.1.3",
"@backstage/plugin-catalog-graph": "^0.4.15",
"@backstage/plugin-catalog-import": "^0.12.9",
"@backstage/plugin-catalog-react": "^1.15.1",
"@backstage/plugin-org": "^0.6.35",
"@backstage/plugin-permission-react": "^0.4.30",
"@backstage/plugin-scaffolder": "^1.27.5",
"@backstage/plugin-search": "^1.4.22",
"@backstage/plugin-search-react": "^1.8.5",
"@backstage/plugin-techdocs": "^1.12.2",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.20",
"@backstage/plugin-techdocs-react": "^1.2.13",
"@backstage/plugin-user-settings": "^0.8.18",
"@backstage/theme": "^0.7.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@patternfly/patternfly": "^6.3.0",
"@red-hat-developer-hub/backstage-plugin-dcm": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-theme": "^0.12.0",
"history": "^5.0.0",
"react": "^18.0.2",
"react-dom": "^18.0.2",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-use": "^17.2.4"
},
"devDependencies": {
"@backstage/test-utils": "^1.7.14",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.0.0",
"@types/react": "^18",
"@types/react-dom": "*",
"cross-env": "^7.0.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"files": [
"dist"
]
}
Loading