Skip to content

Commit

Permalink
Merge pull request #4 from ourchitecture/our-dev
Browse files Browse the repository at this point in the history
chore: formatting
  • Loading branch information
ericis authored Mar 17, 2024
2 parents d54bf6f + 5a4713a commit e38051c
Show file tree
Hide file tree
Showing 13 changed files with 526 additions and 559 deletions.
8 changes: 6 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ format:
@yarn workspaces foreach --all --interlaced run format
@echo "Successfully formatted monorepo."

@echo "Formatting independent projects..."
@cd ./src/systems/dev/backstage/ourstage && make $@
@echo "Successfully formatted independent projects."

.PHONY: up
up:
@echo "Starting the system..."
Expand Down Expand Up @@ -95,7 +99,7 @@ shutdown: down
.PHONY: upgrade
upgrade:
@echo "Upgrading monorepo..."
@yarn upgrade-interactive --latest
@yarn upgrade-interactive
@echo "Successfully upgraded monorepo."

@echo "Upgrading independent projects..."
Expand Down Expand Up @@ -209,7 +213,7 @@ pr:
--repo ourchitecture/monorepo \
--base main \
--fill-first \
--assignee @
--assignee @me
.PHONY: pr-chore
pr-chore: pr

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"devDependencies": {
"@changesets/changelog-git": "^0.2.0",
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.2",
"@commitlint/cli": "^19.2.0",
"@commitlint/config-conventional": "^19.1.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"markdownlint-cli2": "^0.12.1",
Expand Down
6 changes: 4 additions & 2 deletions src/systems/dev/backstage/ourstage/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.yarn/cache
.yarn/install-state.gz
**/.yarn/cache
**/.yarn/install-state.gz
**/coverage
**/dist
**/dist-types
**/node_modules

packages/backend/*.containerfile

*.log

app-config.local.yaml
39 changes: 24 additions & 15 deletions src/systems/dev/backstage/ourstage/app-config.production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,32 @@ backend:
# all interfaces, the most permissive setting. The right value depends on your specific deployment.
listen: ':7007'

# config options: https://node-postgres.com/api/client
database:
client: pg
connection:
host: ${POSTGRES_HOST}
port: ${POSTGRES_PORT}
user: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}
# https://node-postgres.com/features/ssl
# you can set the sslmode configuration option via the `PGSSLMODE` environment variable
# see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
# ssl:
# ca: # if you have a CA file and want to verify it you can uncomment this section
# $file: <file-path>/ca/server.crt
# # config options: https://node-postgres.com/api/client
# database:
# client: pg
# connection:
# host: ${POSTGRES_HOST}
# port: ${POSTGRES_PORT}
# user: ${POSTGRES_USER}
# password: ${POSTGRES_PASSWORD}
# # https://node-postgres.com/features/ssl
# # you can set the sslmode configuration option via the `PGSSLMODE` environment variable
# # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
# # ssl:
# # ca: # if you have a CA file and want to verify it you can uncomment this section
# # $file: <file-path>/ca/server.crt

catalog:
# Overrides the default list locations from app-config.yaml as these contain example data.
# See https://backstage.io/docs/features/software-catalog/#adding-components-to-the-catalog for more details
# on how to get entities into the catalog.
locations: []
locations:
# Ourchitecture entities catalog.
- type: url
target: https://github.com/ourchitecture/monorepo/blob/main/src/systems/dev/backstage/catalog/catalog-info.yaml

# Ourstage entities catalog.
# NOTE: file locations are relative to the backend process,
# typically `packages/backend`.
- type: file
target: ./catalog-info.yaml
14 changes: 11 additions & 3 deletions src/systems/dev/backstage/ourstage/app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ backend:
# Uncomment the following host directive to bind to specific interfaces
# host: 127.0.0.1
csp:
connect-src: ["'self'", 'http:', 'https:']
connect-src:
- "'self'"
- 'http:'
- 'https:'
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
img-src:
- "'self'"
- 'data:'
- 'https://avatars.githubusercontent.com'
- 'https://media.licdn.com'
# Default Helmet Content-Security-Policy values can be removed by setting the key to false
cors:
origin: http://localhost:3000
Expand Down Expand Up @@ -75,13 +83,13 @@ catalog:
pullRequestBranchName: backstage-integration
rules:
- allow: [Component, Group, User, System, API, Resource, Location]
# NOTE: file locations are relative to the backend process,
# typically `packages/backend`.
locations:
# Ourchitecture entities catalog.
- type: url
target: https://github.com/ourchitecture/monorepo/blob/main/src/systems/dev/backstage/catalog/catalog-info.yaml

# Ourstage entities catalog.
# NOTE: file locations are relative to the backend process,
# typically `packages/backend`.
- type: file
target: ../../catalog-info.yaml
24 changes: 12 additions & 12 deletions src/systems/dev/backstage/ourstage/makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ourstage_backend_image_name := localhost/ourstage/backend:latest
ourstage_backend_port := 7007
ourstage_backend_container_port := 7007
ourstage_backend_env := dev
ourstage_backend_image_name := localhost/ourstage/backend-$(ourstage_backend_env):latest
ourstage_backend_container_name := ourstage-backend-$(ourstage_backend_env)

.DEFAULT_GOAL:=all
Expand Down Expand Up @@ -63,14 +63,14 @@ format:

.PHONY: install-container
install-container:
@echo "Installing ourstage container..."
@echo "Installing ourstage container ($(ourstage_backend_env))..."
@docker build \
--build-arg="NPM_REGISTRY_TOKEN=$$(cat .nexus-npm-password)" \
--file=./packages/backend/$(ourstage_backend_env).containerfile \
--network=host \
--tag=$(ourstage_backend_image_name) \
./
@echo "Successfully installed ourstage container."
@echo "Successfully installed ourstage container ($(ourstage_backend_env))."

.PHONY: local-dev
local-dev:
Expand All @@ -80,15 +80,15 @@ local-dev:

.PHONY: up
up: install-container
@echo "Starting ourstage..."
@echo "Starting ourstage ($(ourstage_backend_env))..."
@docker run \
--detach \
--name $(ourstage_backend_container_name) \
--network host \
--user node \
$(ourstage_backend_image_name)
@printf "\n\nOurstage is running at http://localhost:$(ourstage_backend_port)\n\n"
@echo "Successfully started ourstage."
@echo "Successfully started ourstage ($(ourstage_backend_env))."
.PHONY: start
start: up
.PHONY: startup
Expand All @@ -100,7 +100,7 @@ run: up

.PHONY: debug
debug: install-container
@echo "Debugging ourstage..."
@echo "Debugging ourstage ($(ourstage_backend_env))..."
@docker run \
--entrypoint /bin/bash \
--interactive \
Expand All @@ -110,19 +110,19 @@ debug: install-container
--tty \
--user node \
$(ourstage_backend_image_name)
@echo "Successfully debugged ourstage."
@echo "Successfully debugged ourstage ($(ourstage_backend_env))."

.PHONY: logs
logs:
@echo "Retrieving ourstage logs..."
@echo "Retrieving ourstage ($(ourstage_backend_env)) logs..."
@docker logs $(ourstage_backend_container_name)
@echo "Retrieved ourstage logs."
@echo "Retrieved ourstage ($(ourstage_backend_env)) logs."

.PHONY: down
down:
@echo "Stopping ourstage..."
@echo "Stopping ourstage ($(ourstage_backend_env))..."
@docker rm --force $(ourstage_backend_container_name)
@echo "Stopping stopped ourstage."
@echo "Stopping stopped ourstage ($(ourstage_backend_env))."
.PHONY: stop
stop: down
.PHONY: shutdown
Expand All @@ -131,7 +131,7 @@ shutdown: down
.PHONY: upgrade
upgrade:
@echo "Upgrading ourstage..."
@yarn upgrade-interactive --latest
@yarn upgrade-interactive
@echo "Successfully upgraded ourstage."

.PHONY: clean
Expand Down
12 changes: 6 additions & 6 deletions src/systems/dev/backstage/ourstage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"devDependencies": {
"@backstage/cli": "^0.25.2",
"@backstage/e2e-test-utils": "^0.1.1",
"@playwright/test": "^1.32.3",
"@playwright/test": "^1.42.1",
"@spotify/prettier-config": "^12.0.0",
"concurrently": "^8.0.0",
"lerna": "^7.3.0",
"node-gyp": "^9.0.0",
"prettier": "^2.3.2",
"typescript": "~5.3.0"
"concurrently": "^8.2.2",
"lerna": "^7.4.2",
"node-gyp": "^9.4.1",
"prettier": "^2.8.8",
"typescript": "~5.3.3"
},
"resolutions": {
"@types/react": "^18",
Expand Down
26 changes: 13 additions & 13 deletions src/systems/dev/backstage/ourstage/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@
"@backstage/plugin-techdocs-react": "^1.1.16",
"@backstage/plugin-user-settings": "^0.8.1",
"@backstage/theme": "^0.5.1",
"@material-ui/core": "^4.12.2",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.9.1",
"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"
"history": "^5.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^6.22.3",
"react-router-dom": "^6.22.3",
"react-use": "^17.5.0"
},
"devDependencies": {
"@backstage/test-utils": "^1.5.0",
"@playwright/test": "^1.32.3",
"@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",
"@playwright/test": "^1.42.1",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/react": "*",
"@types/react-dom": "*",
"cross-env": "^7.0.0"
"cross-env": "^7.0.3"
},
"browserslist": {
"production": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid
# Install and check the system.
COPY --chown=node:node . ./
RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid=1000 \
rm --force ./.npmrc ./yarn.lock \
rm --force ./yarn.lock \
&& cp yarn.lock.bak ./yarn.lock \
&& make install check

Expand All @@ -120,4 +120,4 @@ WORKDIR /app
ENV NODE_ENV=development

# Start the development server.
CMD ["yarn dev"]
CMD ["yarn", "dev"]
52 changes: 26 additions & 26 deletions src/systems/dev/backstage/ourstage/packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,41 @@
"build-image": "docker build ../.. -f Dockerfile --tag backstage"
},
"dependencies": {
"@backstage/backend-common": "^0.21.0",
"@backstage/backend-tasks": "^0.5.15",
"@backstage/backend-common": "^0.21.3",
"@backstage/backend-tasks": "^0.5.18",
"@backstage/catalog-client": "^1.6.0",
"@backstage/catalog-model": "^1.4.4",
"@backstage/config": "^1.1.1",
"@backstage/plugin-app-backend": "^0.3.58",
"@backstage/plugin-auth-backend": "^0.21.0",
"@backstage/plugin-auth-node": "^0.4.4",
"@backstage/plugin-catalog-backend": "^1.17.0",
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.1.7",
"@backstage/plugin-app-backend": "^0.3.61",
"@backstage/plugin-auth-backend": "^0.21.3",
"@backstage/plugin-auth-node": "^0.4.8",
"@backstage/plugin-catalog-backend": "^1.17.3",
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.1.10",
"@backstage/plugin-permission-common": "^0.7.12",
"@backstage/plugin-permission-node": "^0.7.21",
"@backstage/plugin-proxy-backend": "^0.4.8",
"@backstage/plugin-scaffolder-backend": "^1.21.0",
"@backstage/plugin-search-backend": "^1.5.0",
"@backstage/plugin-search-backend-module-catalog": "^0.1.14",
"@backstage/plugin-search-backend-module-pg": "^0.5.19",
"@backstage/plugin-search-backend-module-techdocs": "^0.1.14",
"@backstage/plugin-search-backend-node": "^1.2.14",
"@backstage/plugin-techdocs-backend": "^1.9.3",
"@backstage/plugin-permission-node": "^0.7.24",
"@backstage/plugin-proxy-backend": "^0.4.11",
"@backstage/plugin-scaffolder-backend": "^1.21.3",
"@backstage/plugin-search-backend": "^1.5.3",
"@backstage/plugin-search-backend-module-catalog": "^0.1.17",
"@backstage/plugin-search-backend-module-pg": "^0.5.22",
"@backstage/plugin-search-backend-module-techdocs": "^0.1.17",
"@backstage/plugin-search-backend-node": "^1.2.17",
"@backstage/plugin-techdocs-backend": "^1.9.6",
"app": "link:../app",
"better-sqlite3": "^9.0.0",
"dockerode": "^3.3.1",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"node-gyp": "^9.0.0",
"better-sqlite3": "^9.4.3",
"dockerode": "^3.3.5",
"express": "^4.18.3",
"express-promise-router": "^4.1.1",
"node-gyp": "^9.4.1",
"pg": "^8.11.3",
"winston": "^3.2.1"
"winston": "^3.12.0"
},
"devDependencies": {
"@backstage/cli": "^0.25.2",
"@types/dockerode": "^3.3.0",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5",
"@types/luxon": "^2.0.4"
"@types/dockerode": "^3.3.26",
"@types/express": "^4.17.21",
"@types/express-serve-static-core": "^4.17.43",
"@types/luxon": "^2.4.0"
},
"files": [
"dist"
Expand Down
Loading

0 comments on commit e38051c

Please sign in to comment.