Skip to content

Commit

Permalink
switch to yarn 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirvshivkov committed Aug 30, 2024
1 parent 73392f8 commit b6073d1
Show file tree
Hide file tree
Showing 13 changed files with 15,008 additions and 13,834 deletions.
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

925 changes: 0 additions & 925 deletions .yarn/releases/yarn-4.4.0.cjs

This file was deleted.

8 changes: 7 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.4.0.cjs
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.5.0.cjs
90 changes: 44 additions & 46 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# syntax=docker/dockerfile:1.2

# Stage 1 - Create yarn install skeleton layer
FROM node:20-bookworm-slim AS packages
FROM registry.access.redhat.com/ubi9/nodejs-20:1-54.1724037697 AS packages

# Set Python interpreter for `node-gyp` to use
ENV PYTHON=/usr/bin/python3
USER 0

WORKDIR /app
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn ./.yarn

COPY packages packages
# Comment this out if you don't have any internal plugins
COPY plugins plugins
COPY --chown=1001:0 package.json yarn.lock ./
COPY --chown=1001:0 packages packages
COPY --chown=1001:0 plugins plugins

RUN find packages \! -name "package.json" -mindepth 2 -maxdepth 2 -exec rm -rf {} \+

# Stage 2 - Install dependencies and build packages
FROM node:20-bookworm-slim AS build

# Install isolate-vm dependencies and sqlite3 dependencies
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends python3 g++ build-essential libsqlite3-dev && \
yarn config set python /usr/bin/python3

USER node
FROM registry.access.redhat.com/ubi9/nodejs-20:1-54.1724037697 AS build

USER 0
# Install system dependencies
RUN dnf install -y python3 gcc-c++ make sqlite-devel git && \
dnf clean all && \
npm install --global yarn corepack && \
corepack enable && \
yarn set version 3.5.0 && \
chown -R 1001:0 /opt/app-root/src

USER 1001
WORKDIR /app

COPY --from=packages --chown=node:node /app .
COPY --chown=node:node .yarn ./.yarn
COPY --chown=node:node .yarnrc.yml ./
COPY --from=packages --chown=1001:0 /app .

ENV CYPRESS_CACHE_FOLDER /app/cypress_cache
RUN mkdir -p /app/cypress_cache

# Install dependencies using Yarn 4.4
RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid=1000 \
yarn install --immutable
RUN yarn workspaces focus --all --production

COPY --chown=node:node . .
COPY --chown=1001:0 . .

RUN yarn tsc
RUN yarn --cwd packages/backend build
Expand All @@ -45,37 +45,35 @@ RUN mkdir packages/backend/dist/skeleton packages/backend/dist/bundle \
&& tar xzf packages/backend/dist/bundle.tar.gz -C packages/backend/dist/bundle

# Stage 3 - Build the actual backend image and install production dependencies
FROM node:22-bookworm-slim
FROM registry.access.redhat.com/ubi9/nodejs-20:1-54.1724037697

# Install isolate-vm dependencies and sqlite3 dependencies
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \
apt-get install -y --no-install-recommends python3 g++ build-essential libsqlite3-dev && \
yarn config set python /usr/bin/python3
USER 0

USER node
# Install system dependencies
RUN dnf install -y python3 gcc-c++ make sqlite-devel git && \
dnf clean all && \
npm install --global yarn corepack && \
corepack enable && \
yarn set version 3.5.0

USER 1001
WORKDIR /app

# Copy the install dependencies from the build stage and context
COPY --from=build --chown=node:node /app/.yarn ./.yarn
COPY --from=build --chown=node:node /app/.yarnrc.yml ./
COPY --from=build --chown=node:node /app/yarn.lock /app/package.json /app/packages/backend/dist/skeleton/ ./
COPY --from=build --chown=1001:0 /app/yarn.lock /app/package.json /app/packages/backend/dist/skeleton/ ./

COPY --from=build --chown=1001:0 /app/.yarn ./.yarn
COPY --from=build --chown=1001:0 /app/.yarnrc.yml ./

# Install production dependencies using Yarn 4.4
RUN --mount=type=cache,target=/home/node/.cache/yarn,sharing=locked,uid=1000,gid=1000 \
yarn workspaces focus --all --production && rm -rf "$(yarn cache clean)"
RUN yarn install --immutable

# Copy the built packages from the build stage
COPY --from=build --chown=node:node /app/packages/backend/dist/bundle/ ./
COPY --from=build --chown=1001:0 /app/packages/backend/dist/bundle/ ./

# Copy any other files that we need at runtime
COPY --chown=node:node app-config*.yaml ./

# # This will include the examples, if you don't need these simply remove this line
# COPY --chown=node:node examples ./examples
COPY --chown=1001:0 app-config.yaml ./

# This switches many Node.js dependencies to production mode.
ENV NODE_ENV=production
ENV NODE_ENV production

CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"]
CMD ["node", "packages/backend", "--config", "app-config.yaml"]
39 changes: 21 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,35 @@
]
},
"resolutions": {
"@swc/core": "1.7.14",
"@types/react": "^18.0.0",
"graphql": "^16.2.0",
"react-router": "6.26.1",
"react-router-dom": "6.26.1",
"react": "^18.0.0",
"@testing-library/react": "^15.0.0",
"@types/react": "^18",
"@types/react-dom": "^18",
"@testing-library/react": "^12.1.3",
"prettier": "^2.0.0",
"ramda": "^0.30.1",
"react-dom": "^18.0.0"
"react-dom": "^17.0.0",
"typescript": "^5.4.5"
},
"devDependencies": {
"@backstage/cli": "^0.27.0",
"@backstage/e2e-test-utils": "^0.1.1",
"@playwright/test": "^1.46.1",
"@spotify/prettier-config": "^15.0.0",
"@types/lodash": "^4.17.7",
"@types/node": "^20.16.1",
"concurrently": "^8.2.2",
"cypress": "^13.13.3",
"eslint": "^9.9.1",
"@types/lodash": "^4.14.202",
"@types/node": "^20.10.5",
"concurrently": "^8.0.0",
"eslint": "^8.6.0",
"fs-extra": "11.2.0",
"husky": "^9.1.5",
"husky": "^9.0.0",
"jest": "^29.7.0",
"knip": "^5.27.4",
"lint-staged": "^15.2.9",
"node-fetch": "^3.3.2",
"prettier": "^3.3.3",
"typescript": "~5.5.4"
"knip": "^5.0.0",
"lint-staged": "^15.0.0",
"node-fetch": "^2.6.7",
"node-gyp": "^10.0.0",
"prettier": "^3.0.0",
"typescript": "~5.4.5"
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
Expand All @@ -79,14 +79,17 @@
"@asyncapi/react-component"
]
},
"packageManager": "yarn@4.4.0",
"packageManager": "yarn@3.5.0",
"dependencies": {
"@backstage/plugin-home": "^0.7.9",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@mermaid-js/mermaid-cli": "^10.9.1",
"@mui/icons-material": "^5.16.7",
"@mui/lab": "^5.0.0-alpha.173",
"@mui/material": "^5.16.7",
"@mui/styles": "^5.16.7",
"@types/node-fetch": "^2.6.11"
"@types/node-fetch": "^2.6.11",
"add": "^2.0.6"
}
}
75 changes: 16 additions & 59 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,103 +14,60 @@
"lint": "backstage-cli package lint"
},
"dependencies": {
"@backstage-community/plugin-adr": "^0.6.23",
"@backstage-community/plugin-adr-backend": "^0.4.22",
"@backstage-community/plugin-adr": "^0.6.24",
"@backstage-community/plugin-adr-backend": "^0.4.23",
"@backstage-community/plugin-cicd-statistics": "^0.1.39",
"@backstage-community/plugin-explore-backend": "^0.1.4",
"@backstage-community/plugin-explore-common": "^0.0.4",
"@backstage-community/plugin-gcalendar": "^0.3.29",
"@backstage-community/plugin-explore-backend": "^0.1.5",
"@backstage-community/plugin-explore-common": "^0.0.5",
"@backstage-community/plugin-gcalendar": "^0.3.30",
"@backstage-community/plugin-tech-insights-backend": "^0.6.1",
"@backstage-community/plugin-tech-insights-backend-module-jsonfc": "^0.1.54",
"@backstage-community/plugin-tech-insights-node": "^0.6.5",
"@backstage-community/plugin-tech-radar": "^0.7.8",
"@backstage/app-defaults": "^1.5.10",
"@backstage/backend-common": "^0.24.0",
"@backstage/backend-defaults": "^0.4.3",
"@backstage/backend-dynamic-feature-service": "^0.3.1",
"@backstage/backend-tasks": "^0.6.0",
"@backstage/catalog-client": "^1.6.6",
"@backstage/catalog-model": "^1.6.0",
"@backstage/cli": "^0.27.0",
"@backstage/config": "^1.2.0",
"@backstage/core-app-api": "^1.14.2",
"@backstage/core-components": "^0.14.10",
"@backstage/core-plugin-api": "^1.9.3",
"@backstage/integration": "^1.14.0",
"@backstage/integration-react": "^1.1.30",
"@backstage/plugin-api-docs": "^0.11.8",
"@backstage/plugin-app-backend": "^0.3.72",
"@backstage/plugin-auth-backend": "^0.22.11",
"@backstage/plugin-auth-backend-module-guest-provider": "^0.1.9",
"@backstage/plugin-auth-node": "^0.5.0",
"@backstage/plugin-catalog": "^1.22.0",
"@backstage/plugin-catalog-backend": "^1.25.1",
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.1.21",
"@backstage/plugin-catalog-common": "^1.0.26",
"@backstage/plugin-catalog-graph": "^0.4.8",
"@backstage/plugin-catalog-import": "^0.12.2",
"@backstage/plugin-catalog-react": "^1.12.3",
"@backstage/plugin-home": "^0.7.9",
"@backstage/plugin-kubernetes-backend": "^0.18.4",
"@backstage/plugin-kubernetes": "^0.11.13",
"@backstage/plugin-org": "^0.6.28",
"@backstage/plugin-permission-backend": "^0.5.47",
"@backstage/plugin-permission-backend-module-allow-all-policy": "^0.1.20",
"@backstage/plugin-permission-common": "^0.8.1",
"@backstage/plugin-permission-node": "^0.8.1",
"@backstage/plugin-permission-react": "^0.4.25",
"@backstage/plugin-proxy-backend": "^0.5.4",
"@backstage/plugin-scaffolder": "^1.24.0",
"@backstage/plugin-scaffolder-backend": "^1.24.0",
"@backstage/plugin-search": "^1.4.15",
"@backstage/plugin-search-backend": "^1.5.15",
"@backstage/plugin-search-backend-module-catalog": "^0.2.0",
"@backstage/plugin-search-backend-module-pg": "^0.5.33",
"@backstage/plugin-search-backend-module-techdocs": "^0.2.0",
"@backstage/plugin-search-backend-node": "^1.3.0",
"@backstage/plugin-search-react": "^1.7.14",
"@backstage/plugin-techdocs": "^1.10.8",
"@backstage/plugin-techdocs-backend": "^1.10.11",
"@backstage/plugin-techdocs-module-addons-contrib": "^1.1.13",
"@backstage/plugin-techdocs-react": "^1.2.7",
"@backstage/plugin-user-settings": "^0.8.11",
"@backstage/test-utils": "^1.5.10",
"@backstage/theme": "^0.5.6",
"@internal/backstage-plugin-cicd-statistics-module-zuul": "workspace:^",
"@internal/scaffolder-backend-module-otc": "^0.1.0",
"@janus-idp/backstage-plugin-keycloak-backend": "^1.13.1",
"@k-phoen/backstage-plugin-grafana": "^0.1.22",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@roadiehq/scaffolder-backend-argocd": "^1.1.27",
"@roadiehq/scaffolder-backend-module-http-request": "^4.3.2",
"@roadiehq/scaffolder-backend-module-utils": "^2.0.0",
"@testing-library/react": "^16.0.0",
"@types/passport-oauth2": "^1.4.17",
"app": "link:../app",
"better-sqlite3": "^11.2.1",
"dockerode": "^4.0.2",
"express": "^4.19.2",
"express-promise-router": "^4.1.1",
"history": "^5.3.0",
"node-fetch": "^3.3.2",
"passport-oauth2": "^1.8.0",
"pg": "^8.12.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router": "^6.26.1",
"react-router-dom": "^6.26.1",
"@material-ui/core": "^4.12.2",
"@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",
"winston": "^3.14.2"
},
"devDependencies": {
"@backstage/test-utils": "^1.5.10",
"@playwright/test": "^1.46.1",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.0",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.5.2",
"@types/react": "18.3.4",
"@types/react-dom": "^18.3.0",
"cypress": "^13.13.3",
"cypress": "^13.14.1",
"eslint": "^9.9.1",
"eslint-plugin-cypress": "^3.5.0",
"start-server-and-test": "^2.0.5"
Expand Down
1 change: 0 additions & 1 deletion packages/app/src/plugins.ts

This file was deleted.

Loading

0 comments on commit b6073d1

Please sign in to comment.