Skip to content

Commit 23795ae

Browse files
authored
Merge pull request #2 from coder/mes/repo-setup-v2
chore: setup initial repo
2 parents a178bc3 + 4695468 commit 23795ae

File tree

106 files changed

+29774
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+29774
-2
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git
2+
.yarn/cache
3+
.yarn/install-state.gz
4+
node_modules
5+
packages/*/src
6+
packages/*/node_modules
7+
plugins
8+
*.local.yaml

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
playwright.config.ts

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
root: true,
3+
};

.gitignore

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# macOS
2+
.DS_Store
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
lerna-debug.log*
11+
12+
# Coverage directory generated when running tests with coverage
13+
coverage
14+
15+
# Dependencies
16+
node_modules/
17+
18+
# Yarn 3 files
19+
.pnp.*
20+
.yarn/*
21+
!.yarn/patches
22+
!.yarn/plugins
23+
!.yarn/releases
24+
!.yarn/sdks
25+
!.yarn/versions
26+
27+
# Node version directives
28+
.nvmrc
29+
30+
# dotenv environment variables file
31+
.env
32+
.env.test
33+
34+
# Build output
35+
dist
36+
dist-types
37+
38+
# Temporary change files created by Vim
39+
*.swp
40+
41+
# MkDocs build output
42+
site
43+
44+
# Local configuration files
45+
*.local.yaml
46+
47+
# Sensitive credentials
48+
*-credentials.yaml
49+
50+
# vscode database functionality support files
51+
*.session.sql
52+
53+
# E2E test reports
54+
e2e-test-report/

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
dist-types
3+
coverage
4+
.vscode

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
# backstage-plugins
2-
Plugins for the Backstage platform
1+
# [Backstage](https://backstage.io)
2+
3+
This is your newly scaffolded Backstage App, Good Luck!
4+
5+
To start the app, run:
6+
7+
```sh
8+
yarn install
9+
yarn dev
10+
```

app-config.production.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
app:
2+
# Should be the same as backend.baseUrl when using the `app-backend` plugin.
3+
baseUrl: ${BASE_URL}
4+
5+
auth:
6+
environment: development
7+
providers:
8+
github:
9+
development:
10+
clientId: ${GITHUB_CLIENT_ID}
11+
clientSecret: ${GITHUB_CLIENT_SECRET}
12+
13+
backend:
14+
# Note that the baseUrl should be the URL that the browser and other clients
15+
# should use when communicating with the backend, i.e. it needs to be
16+
# reachable not just from within the backend host, but from all of your
17+
# callers. When its value is "http://staging.backstage.cdr.dev", it's strictly private
18+
# and can't be reached by others.
19+
baseUrl: ${BASE_URL}
20+
# The listener can also be expressed as a single <host>:<port> string. In this case we bind to
21+
# all interfaces, the most permissive setting. The right value depends on your specific deployment.
22+
listen: ':8080'
23+
24+
# config options: https://node-postgres.com/api/client
25+
database:
26+
client: pg
27+
connection:
28+
${DATABASE_URL}
29+
# https://node-postgres.com/features/ssl
30+
# you can set the sslmode configuration option via the `PGSSLMODE` environment variable
31+
# see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
32+
# ssl:
33+
# ca: # if you have a CA file and want to verify it you can uncomment this section
34+
# $file: <file-path>/ca/server.crt
35+
36+
catalog:
37+
# Overrides the default list locations from app-config.yaml as these contain example data.
38+
# See https://backstage.io/docs/features/software-catalog/#adding-components-to-the-catalog for more details
39+
# on how to get entities into the catalog.
40+
locations: []

app-config.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
app:
2+
title: Scaffolded Backstage App
3+
baseUrl: http://localhost:3000
4+
5+
organization:
6+
name: Coder
7+
8+
backend:
9+
# Used for enabling authentication, secret is shared by all backend plugins
10+
# See https://backstage.io/docs/auth/service-to-service-auth for
11+
# information on the format
12+
# auth:
13+
# keys:
14+
# - secret: ${BACKEND_SECRET}
15+
baseUrl: http://localhost:7007
16+
listen:
17+
port: 7007
18+
# Uncomment the following host directive to bind to specific interfaces
19+
# host: 127.0.0.1
20+
csp:
21+
connect-src: ["'self'", 'http:', 'https:']
22+
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
23+
# Default Helmet Content-Security-Policy values can be removed by setting the key to false
24+
cors:
25+
origin: http://localhost:3000
26+
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
27+
credentials: true
28+
# This is for local development only, it is not recommended to use this in production
29+
# The production database configuration is stored in app-config.production.yaml
30+
database:
31+
client: pg
32+
connection:
33+
host: ${POSTGRES_HOST}
34+
port: ${POSTGRES_PORT}
35+
user: ${POSTGRES_USER}
36+
password: ${POSTGRES_PASSWORD}
37+
# workingDirectory: /tmp # Use this to configure a working directory for the scaffolder, defaults to the OS temp-dir
38+
39+
integrations:
40+
github:
41+
- host: github.com
42+
# This is a Personal Access Token or PAT from GitHub. You can find out how to generate this token, and more information
43+
# about setting up the GitHub integration here: https://backstage.io/docs/getting-started/configuration#setting-up-a-github-integration
44+
token: ${GITHUB_TOKEN}
45+
### Example for how to add your GitHub Enterprise instance using the API:
46+
# - host: ghe.example.net
47+
# apiBaseUrl: https://ghe.example.net/api/v3
48+
# token: ${GHE_TOKEN}
49+
50+
proxy:
51+
endpoints:
52+
'/coder':
53+
target: 'https://dev.coder.com/'
54+
changeOrigin: true
55+
allowedMethods: ['GET']
56+
allowedHeaders: ['Authorization', 'Coder-Session-Token']
57+
headers:
58+
X-Custom-Source: backstage
59+
60+
# Reference documentation http://backstage.io/docs/features/techdocs/configuration
61+
# Note: After experimenting with basic setup, use CI/CD to generate docs
62+
# and an external cloud storage when deploying TechDocs for production use-case.
63+
# https://backstage.io/docs/features/techdocs/how-to-guides#how-to-migrate-from-techdocs-basic-to-recommended-deployment-approach
64+
techdocs:
65+
builder: 'local' # Alternatives - 'external'
66+
generator:
67+
runIn: 'docker' # Alternatives - 'local'
68+
publisher:
69+
type: 'local' # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives.
70+
71+
auth:
72+
# see https://backstage.io/docs/auth/ to learn about auth providers
73+
providers: {}
74+
75+
scaffolder:
76+
# see https://backstage.io/docs/features/software-templates/configuration for software template options
77+
{}
78+
catalog:
79+
import:
80+
entityFilename: catalog-info.yaml
81+
pullRequestBranchName: backstage-integration
82+
rules:
83+
- allow: [Component, System, API, Resource, Location]
84+
locations:
85+
# Local example data, file locations are relative to the backend process, typically `packages/backend`
86+
- type: file
87+
target: ../../examples/entities.yaml
88+
89+
# Local example template
90+
- type: file
91+
target: ../../examples/template/template.yaml
92+
rules:
93+
- allow: [Template]
94+
95+
# Local example organizational data
96+
- type: file
97+
target: ../../examples/org.yaml
98+
rules:
99+
- allow: [User, Group]
100+
101+
## Uncomment these lines to add more example data
102+
# - type: url
103+
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/all.yaml
104+
105+
## Uncomment these lines to add an example org
106+
# - type: url
107+
# target: https://github.com/backstage/backstage/blob/master/packages/catalog-model/examples/acme-corp.yaml
108+
# rules:
109+
# - allow: [User, Group]

backstage.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"version": "1.22.1"
3+
}

catalog-info.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: backstage.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: backstage-shell
5+
description: An example of a Backstage application.
6+
# Example for optional annotations
7+
# annotations:
8+
# github.com/project-slug: backstage/backstage
9+
# backstage.io/techdocs-ref: dir:.
10+
spec:
11+
type: website
12+
owner: john@example.com
13+
lifecycle: experimental

lerna.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"packages": ["packages/*", "plugins/*"],
3+
"npmClient": "yarn",
4+
"version": "0.1.0",
5+
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
6+
}

package.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "root",
3+
"version": "1.0.0",
4+
"private": true,
5+
"engines": {
6+
"node": "18 || 20"
7+
},
8+
"scripts": {
9+
"dev": "concurrently \"yarn dev-init\" \"yarn start\" \"yarn start-backend\"",
10+
"dev-init": "/bin/bash ./scripts/dev-init.sh",
11+
"start": "yarn workspace app start",
12+
"start-backend": "yarn workspace backend start",
13+
"build:backend": "yarn workspace backend build",
14+
"build:all": "backstage-cli repo build --all",
15+
"build-image": "yarn workspace backend build-image",
16+
"tsc": "tsc",
17+
"tsc:full": "tsc --skipLibCheck false --incremental false",
18+
"clean": "backstage-cli repo clean",
19+
"test": "backstage-cli repo test",
20+
"test:all": "backstage-cli repo test --coverage",
21+
"test:e2e": "playwright test",
22+
"fix": "backstage-cli repo fix",
23+
"lint": "backstage-cli repo lint --since origin/master",
24+
"lint:all": "backstage-cli repo lint",
25+
"prettier:check": "prettier --check .",
26+
"new": "backstage-cli new --scope internal"
27+
},
28+
"workspaces": {
29+
"packages": [
30+
"packages/*",
31+
"plugins/*"
32+
]
33+
},
34+
"devDependencies": {
35+
"@backstage/cli": "^0.25.1",
36+
"@backstage/e2e-test-utils": "^0.1.0",
37+
"@playwright/test": "^1.32.3",
38+
"@spotify/prettier-config": "^12.0.0",
39+
"concurrently": "^8.0.0",
40+
"lerna": "^7.3.0",
41+
"node-gyp": "^9.0.0",
42+
"prettier": "^2.3.2",
43+
"typescript": "~5.2.0"
44+
},
45+
"resolutions": {
46+
"@types/react": "^18",
47+
"@types/react-dom": "^18"
48+
},
49+
"prettier": "@spotify/prettier-config",
50+
"lint-staged": {
51+
"*.{js,jsx,ts,tsx,mjs,cjs}": [
52+
"eslint --fix",
53+
"prettier --write"
54+
],
55+
"*.{json,md}": [
56+
"prettier --write"
57+
]
58+
}
59+
}

packages/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# The Packages Folder
2+
3+
This is where your own applications and centrally managed libraries live, each
4+
in a separate folder of its own.
5+
6+
From the start there's an `app` folder (for the frontend) and a `backend` folder
7+
(for the Node backend), but you can also add more modules in here that house
8+
your core additions and adaptations, such as themes, common React component
9+
libraries, utilities, and similar.

packages/app/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public

packages/app/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright 2020 The Backstage Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { test, expect } from '@playwright/test';
18+
19+
test('App should render the welcome page', async ({ page }) => {
20+
await page.goto('/');
21+
22+
await expect(page.getByText('My Company Catalog')).toBeVisible();
23+
});

0 commit comments

Comments
 (0)