Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn 4 #221

Merged
merged 5 commits into from
Jan 22, 2024
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ jobs:
run: |
yarn config set -H 'npmAuthToken' "${{secrets.NPM_TOKEN}}"
if [ -f ".changeset/pre.json" ]; then
yarn workspaces foreach -v --no-private npm publish --access public --tolerate-republish --tag next
yarn workspaces foreach --all --verbose --no-private npm publish --access public --tolerate-republish --tag next
else
yarn workspaces foreach -v --no-private npm publish --access public --tolerate-republish
yarn workspaces foreach --all --verbose --no-private npm publish --access public --tolerate-republish
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,13 @@ coverage
*.lcov

# E2E test reports
e2e-test-report/
e2e-test-report/

# Yarn 3+ files
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
enableGlobalCache: true

httpTimeout: 300000

nodeLinker: node-modules

npmRegistryServer: "https://registry.npmjs.org/"

yarnPath: .yarn/releases/yarn-4.0.2.cjs
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"node": "18 || 20"
},
"scripts": {
"dev": "concurrently \"yarn start\" \"yarn start-backend\" \"http-server -p 8090 --cors 2>&1\"",
"dev": "concurrently 'yarn start' 'yarn start-backend' 'http-server -p 8090 --cors 2>&1'",
"start": "yarn workspace app start",
"start-backend": "yarn workspace backend start",
"build": "backstage-cli repo build --all",
Expand Down Expand Up @@ -47,22 +47,24 @@
"jest-environment-jsdom": "30.0.0-alpha.2"
},
"dependencies": {
"@changesets/cli": "2.25.2",
"jest-environment-jsdom": "30.0.0-alpha.2"
},
"devDependencies": {
"@backstage/cli": "^0.25.1",
"@backstage/e2e-test-utils": "^0.1.0",
"@backstage/repo-tools": "^0.5.2",
"@changesets/cli": "2.25.2",
"@playwright/test": "^1.32.3",
"@spotify/prettier-config": "14.1.4",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/webpack": "5.28.0",
"concurrently": "7.5.0",
"concurrently": "^8.0.0",
"eslint-plugin-notice": "0.9.10",
"http-server": "14.1.1",
"prettier": "2.7.1",
"typescript": "~5.2.0",
"@types/react": "^18",
"react": "^18.0.0",
"@types/react-dom": "^18"
"typescript": "~5.2.0"
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
Expand All @@ -76,5 +78,6 @@
"*.md": [
"node ./scripts/check-docs-quality"
]
}
},
"packageManager": "yarn@4.0.2"
}
1 change: 0 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"@types/node": "^20.11.5",
"@types/react-dom": "*",
"cross-env": "7.0.3",
"http-server": "14.1.1",
"start-server-and-test": "1.14.0"
},
"browserslist": {
Expand Down
39 changes: 34 additions & 5 deletions packages/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,53 @@
#
# yarn install
# yarn tsc
# yarn build
# yarn build:backend
#
# Once the commands have been run, you can build the image using `yarn build-image`

FROM node:14-buster-slim
FROM node:18-bookworm-slim

# Install sqlite3 dependencies. You can skip this if you don't use sqlite3 in the image,
# in which case you should also move better-sqlite3 to "devDependencies" in package.json.
# Additionally, we install dependencies for `techdocs.generator.runIn: local`.
# https://backstage.io/docs/features/techdocs/getting-started#disabling-docker-in-docker-situation-optional
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 libsqlite3-dev python3 python3-pip python3-venv build-essential && \
yarn config set python /usr/bin/python3

# Set up a virtual environment for mkdocs-techdocs-core.
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

RUN pip3 install mkdocs-techdocs-core==1.1.7

# From here on we use the least-privileged `node` user to run the backend.
WORKDIR /app
RUN chown node:node /app
USER node


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

# Copy over Yarn 3 configuration, release, and plugins
COPY --chown=node:node .yarn ./.yarn
COPY --chown=node:node .yarnrc.yml ./

# Copy repo skeleton first, to avoid unnecessary docker cache invalidation.
# The skeleton contains the package.json of each package in the monorepo,
# and along with yarn.lock and the root package.json, that's enough to run yarn install.
COPY yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
COPY --chown=node:node yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz

RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
RUN --mount=type=cache,target=/home/node/.yarn/berry/cache,sharing=locked,uid=1000,gid=1000 \
yarn workspaces focus --all --production

# Then copy the rest of the backend bundle, along with any other files we might want.
COPY packages/backend/dist/bundle.tar.gz app-config.yaml ./
COPY --chown=node:node packages/backend/dist/bundle.tar.gz app-config*.yaml ./
RUN tar xzf bundle.tar.gz && rm bundle.tar.gz

CMD ["node", "packages/backend", "--config", "app-config.yaml"]
10 changes: 5 additions & 5 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
"@backstage/plugin-scaffolder-backend": "^1.20.0",
"@gitbeaker/node": "35.7.0",
"@octokit/rest": "18.12.0",
"app": "link:../app",
"better-sqlite3": "9.0.0",
"luxon": "3.2.1",
"app": "^0.5.0",
"dockerode": "3.3.4",
"express": "4.18.2",
"express-promise-router": "4.1.1",
"node-gyp": "^9.0.0",
"knex": "2.4.1",
"winston": "3.8.2",
"serialize-error": "8.1.0"
"luxon": "3.2.1",
"node-gyp": "^9.0.0",
"serialize-error": "8.1.0",
"winston": "3.8.2"
},
"devDependencies": {
"@backstage/cli": "^0.25.1",
Expand Down
14 changes: 7 additions & 7 deletions plugins/score-card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
},
"dependencies": {
"@backstage/catalog-model": "^1.4.3",
"@backstage/config": "^1.1.1",
"@backstage/core-components": "^0.13.10",
"@backstage/core-plugin-api": "^1.8.2",
"@backstage/config": "^1.1.1",
"@backstage/plugin-catalog-common": "^1.0.20",
"@backstage/plugin-catalog-react": "^1.9.3",
"@backstage/theme": "^0.5.0",
Expand All @@ -45,20 +45,20 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.57",
"react-use": "^17.2.4",
"@types/react": "^18.0.0"
"@types/react": "^18.0.0",
"react-use": "^17.2.4"
},
"peerDependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "^6.4.3"
},
"devDependencies": {
"@backstage/cli": "^0.25.1",
"@backstage/plugin-catalog": "^1.16.1",
"@backstage/catalog-client": "^1.5.2",
"@backstage/cli": "^0.25.1",
"@backstage/core-app-api": "^1.11.3",
"@backstage/dev-utils": "^1.0.26",
"@backstage/plugin-catalog": "^1.16.1",
"@backstage/test-utils": "^1.4.7",
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^6.0.0",
Expand All @@ -67,9 +67,9 @@
"@types/jest": "*",
"@types/node": "^20.11.5",
"@types/react-dom": "*",
"msw": "0.47.3",
"cross-fetch": "3.1.5",
"http-server": "14.1.1"
"http-server": "14.1.1",
"msw": "0.47.3"
},
"files": [
"dist",
Expand Down
Loading
Loading