Skip to content

Commit

Permalink
chore: 📦️ migrate yarn to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Ruck committed Oct 14, 2023
1 parent 264ddfe commit 434812d
Show file tree
Hide file tree
Showing 62 changed files with 13,409 additions and 11,887 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/analyse-changed-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ steps.node_version.outputs.version }}
cache: 'yarn'
cache: 'pnpm'

- run: yarn global add turbo
- run: pnpm global add turbo

- name: Identifying Changed Bap-Services
id: changed-packages
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"eslint.packageManager": "yarn",
"eslint.packageManager": "pnpm",
"eslint.alwaysShowStatus": true,
"search.exclude": {
"**/node_modules": true,
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
`kubectl create secret docker-registry regcred --docker-server=docker.pkg.github.com --docker-username=<GITHUB_USERNAME> --docker-password=<GITHUB_TOKEN> --docker-email=<EMAIL_ADDRESS>`

5. clone democracy-development
6. run `yarn dev`
6. run `pnpm dev`
7. edit `/etc/hosts` (macOS) add

```
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ Change `.env` if necessary.
Once this is set up, run the following:

```
yarn install
yarn run dev
pnpm install
pnpm run dev
```

Now visit [localhost:3100][localhost] and you should see the GraphQL playground.
Expand All @@ -120,7 +120,7 @@ install kustomize `brew install kustomize`

#### Generate Kubernetes configs

run `yarn build:k8s:STAGE`
run `pnpm build:k8s:STAGE`
_replace Stage with alpha|internal|local|prod_

#### Monitoring
Expand Down
4 changes: 2 additions & 2 deletions bundestag.io/admin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
pnpm-error.log*

# local env files
.env.local
Expand Down
8 changes: 4 additions & 4 deletions bundestag.io/admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ FROM node:16-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

# Rebuild the source code only when needed
FROM node:16-alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline
RUN pnpm build && pnpm install --production --ignore-scripts --prefer-offline

# Production image, copy all the files and run next
FROM node:16-alpine AS runner
Expand All @@ -38,4 +38,4 @@ EXPOSE 3000
# Uncomment the following line in case you want to disable telemetry.
# ENV NEXT_TELEMETRY_DISABLED 1

CMD ["yarn", "start"]
CMD ["pnpm", "start"]
2 changes: 1 addition & 1 deletion bundestag.io/admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ First, run the development server:
```bash
npm run dev
# or
yarn dev
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Expand Down
2 changes: 1 addition & 1 deletion bundestag.io/admin/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# pnpm lockfile v1


"@ant-design/colors@^6.0.0":
Expand Down
2 changes: 1 addition & 1 deletion bundestag.io/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build": "tsc",
"start": "node build/index.js",
"dev": "ts-node-dev --watch=resolvers,schemas --respawn src/index.ts",
"lint": "yarn lint:ts && yarn lint:exports",
"lint": "pnpm lint:ts && pnpm lint:exports",
"lint:es": "eslint src --ext .js,.jsx,.ts,.tsx",
"lint:ts": "tsc --noEmit",
"lint:exports": "ts-unused-exports ./tsconfig.json --excludePathsFromReport=generated --excludePathsFromReport=resolvers --excludePathsFromReport=/schemas --excludePathsFromReport=graphqlContext.ts",
Expand Down
2 changes: 1 addition & 1 deletion bundestag.io/api/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# pnpm lockfile v1


"@ampproject/remapping@^2.1.0":
Expand Down
2 changes: 1 addition & 1 deletion bundestag.io/dip/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# pnpm lockfile v1


"@apollo/[email protected]":
Expand Down
4 changes: 2 additions & 2 deletions common/bundestagio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"license": "MIT",
"scripts": {
"build": "tsc",
"lint": "yarn lint:ts && yarn lint:exports",
"lint": "pnpm lint:ts && pnpm lint:exports",
"lint:ts": "tsc --noEmit",
"lint:exports": "ts-unused-exports ./tsconfig.json --ignoreFiles=index",
"prepublishOnly": "yarn build"
"prepublishOnly": "pnpm build"
},
"devDependencies": {
"@types/jsonwebtoken": "^8.5.0",
Expand Down
2 changes: 1 addition & 1 deletion common/bundestagio/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# pnpm lockfile v1


"@democracy-deutschland/bundestag.io-definitions@^1.0.2":
Expand Down
4 changes: 2 additions & 2 deletions common/democracy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"license": "MIT",
"scripts": {
"build": "tsc",
"lint": "yarn lint:ts && yarn lint:exports",
"lint": "pnpm lint:ts && pnpm lint:exports",
"lint:ts": "tsc --noEmit",
"lint:exports": "ts-unused-exports ./tsconfig.json --ignoreFiles=index",
"prepublish": "yarn build"
"prepublish": "pnpm build"
},
"devDependencies": {
"typescript": "^3.9.6"
Expand Down
2 changes: 1 addition & 1 deletion common/democracy/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# pnpm lockfile v1


"@democracy-deutschland/bundestag.io-definitions@^1.0.2":
Expand Down
2 changes: 1 addition & 1 deletion democracy/web-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
node_modules
.env
/static/fonts/democracy/*
yarn-error.log
pnpm-error.log
8 changes: 4 additions & 4 deletions democracy/web-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ FROM node:alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat bash libpng-dev gcc g++ make
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

# Rebuild the source code only when needed
FROM node:alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline
RUN pnpm build && pnpm install --production --ignore-scripts --prefer-offline

# Production image, copy all the files and run next
FROM node:alpine AS runner
Expand Down Expand Up @@ -39,4 +39,4 @@ EXPOSE 3000
# Uncomment the following line in case you want to disable telemetry.
# ENV NEXT_TELEMETRY_DISABLED 1

CMD ["yarn", "start"]
CMD ["pnpm", "start"]
4 changes: 2 additions & 2 deletions democracy/web-app/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

yarn build
yarn start
pnpm build
pnpm start
2 changes: 1 addition & 1 deletion democracy/web-app/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# pnpm lockfile v1


"@ant-design/icons-react@~1.1.1":
Expand Down
18 changes: 9 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
dockerfile: ../../infra/Dockerfile
ports:
- 4000:4000
command: yarn run dev
command: pnpm run dev
depends_on:
- mongo
environment:
Expand Down Expand Up @@ -52,7 +52,7 @@ services:
- bundestag.io/dip/.env
environment:
- PORT=4002
command: yarn dev
command: pnpm dev
volumes:
- ./bundestag.io/dip/src:/app/src
ports:
Expand All @@ -77,7 +77,7 @@ services:
context: services/cron-jobs/crawler
target: base_stage
dockerfile: ../../../infra/Dockerfile
command: yarn dev
command: pnpm dev
volumes:
- ./services/cron-jobs/crawler/src:/app/src
env_file:
Expand All @@ -97,7 +97,7 @@ services:
context: services/cron-jobs/sync-procedures
target: base_stage
dockerfile: ../../../infra/Dockerfile
command: yarn dev
command: pnpm dev
volumes:
- ./services/cron-jobs/sync-procedures/src:/app/src
env_file:
Expand All @@ -117,7 +117,7 @@ services:
context: services/cron-jobs/queue-pushs-vote-top-100
target: base_stage
dockerfile: ../../../infra/Dockerfile
command: yarn dev
command: pnpm dev
volumes:
- ./services/cron-jobs/queue-pushs-vote-top-100/src:/app/src
env_file:
Expand All @@ -135,7 +135,7 @@ services:
context: services/cron-jobs/push-send-queued
target: base_stage
dockerfile: ../../../infra/Dockerfile
command: yarn dev
command: pnpm dev
volumes:
- ./services/cron-jobs/push-send-queued/src:/app/src
env_file:
Expand All @@ -153,7 +153,7 @@ services:
context: services/cron-jobs/cleanup-push-queue
target: base_stage
dockerfile: ../../../infra/Dockerfile
command: yarn dev
command: pnpm dev
volumes:
- ./services/cron-jobs/cleanup-push-queue/src:/app/src
env_file:
Expand All @@ -171,7 +171,7 @@ services:
context: services/cron-jobs/import-named-polls
target: base_stage
dockerfile: ../../../infra/Dockerfile
command: yarn dev
command: pnpm dev
volumes:
- ./services/cron-jobs/import-named-polls/src:/app/src
env_file:
Expand All @@ -187,7 +187,7 @@ services:
context: services/cron-jobs/import-named-poll-deputies
target: base_stage
dockerfile: ../../../infra/Dockerfile
command: yarn dev
command: pnpm dev
volumes:
- ./services/cron-jobs/import-named-poll-deputies/src:/app/src
env_file:
Expand Down
16 changes: 8 additions & 8 deletions infra/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ RUN apk update && \
apk add --no-cache git curl python3 make g++

# Copy dependency files
COPY package.json yarn.lock ./
COPY package.json pnpm-lock.yaml ./

# Install dependencies and clean cache
RUN yarn install --no-progress --pure-lockfile && \
yarn cache clean
RUN pnpm install --no-progress --pure-lockfile && \
pnpm cache clean

# Copy remaining files
COPY . .
Expand All @@ -23,7 +23,7 @@ COPY . .
###
FROM base_stage as build_stage
WORKDIR /app
RUN yarn build
RUN pnpm build

###
### Install stage
Expand All @@ -34,8 +34,8 @@ WORKDIR /app
# Remove unnecessary files and reinstall dependencies in production mode
RUN curl -sf https://gobinaries.com/tj/node-prune | sh && \
rm -rf node_modules && \
yarn install --no-progress --pure-lockfile --production && \
yarn cache clean && \
pnpm install --no-progress --pure-lockfile --production && \
pnpm cache clean && \
node-prune

###
Expand All @@ -46,7 +46,7 @@ WORKDIR /app
ENV NODE_ENV=production

# Copy dependency files
COPY package.json yarn.lock ./
COPY package.json pnpm-lock.yaml ./

# Copy compiled files from the build stage
COPY --from=build_stage /app/build ./build
Expand All @@ -55,4 +55,4 @@ COPY --from=build_stage /app/build ./build
COPY --from=install_stage /app/node_modules ./node_modules

# Set the start command
CMD [ "yarn", "start" ]
CMD [ "pnpm", "start" ]
12 changes: 6 additions & 6 deletions infra/Dockerfile.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
RUN yarn global add turbo
RUN pnpm global add turbo
COPY . .
RUN turbo prune --scope=$SERVICE --docker

Expand All @@ -24,13 +24,13 @@ WORKDIR /app
# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
RUN yarn install
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN pnpm install

# Build the project
COPY --from=builder /app/out/full/ .
RUN yarn turbo run build --filter=$SERVICE
RUN yarn install --prod --frozen-lockfile --ignore-scripts --prefer-offline
RUN pnpm turbo run build --filter=$SERVICE
RUN pnpm install --prod --frozen-lockfile --ignore-scripts --prefer-offline

FROM base AS runner
WORKDIR /app
Expand All @@ -44,4 +44,4 @@ COPY --from=installer /app/$SERVICE_PATH/package.json .
COPY --from=installer /app/node_modules ./node_modules
COPY --from=installer --chown=runuser:nodejs /app/$SERVICE_PATH/build ./build

CMD yarn --cwd $SERVICE_PATH start
CMD pnpm --cwd $SERVICE_PATH start
7 changes: 2 additions & 5 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"npmClient": "yarn",
"packages": [
"./bundestag.io/dip",
"./services/cron-jobs/crawler"
],
"npmClient": "pnpm",
"packages": ["./bundestag.io/dip", "./services/cron-jobs/crawler"],
"version": "independent"
}
Loading

0 comments on commit 434812d

Please sign in to comment.