Skip to content

Commit

Permalink
refactor: yarn -> pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
ijsKoud committed Mar 31, 2024
1 parent f4d5916 commit 6fd9a45
Show file tree
Hide file tree
Showing 22 changed files with 4,631 additions and 7,819 deletions.
11 changes: 0 additions & 11 deletions .commitlintrc.json

This file was deleted.

7 changes: 2 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": ["@sapphire"],
"rules": {
"@typescript-eslint/no-base-to-string": "off"
}
}
"extends": ["@snowcrystals/eslint-config"]
}
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ To work on the project you must do the following:

**1**. Fork and clone the repository, make sure you are in the correct branch in this case the **main** branch.

**2**. Install Yarn (we do not accept npm/pnpm package manager usage here), after that run `yarn install` to install all the dependencies.
**2**. Install pnpm (we do not accept npm/pnpm package manager usage here), after that run `pnpm install` to install all the dependencies.

**3**. Do whatever you want to do (add things, change things, fixed things, etc)

**4**. Use `yarn run build` to build the app and `yarn run start` to start it. `yarn run dev` is usefull if you want to get up-to-date data`.
**4**. Use `pnpm run build` to build the app and `pnpm run start` to start it. `pnpm run dev` is usefull if you want to get up-to-date data`.

**4**. Open a [pull request](/compare) and wait for someone to review it (remember to always use semantic commit names for a PR and preferably for commits too!).
48 changes: 35 additions & 13 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install Node v18
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache: pnpm

- name: Install Dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

Building:
runs-on: ubuntu-latest
Expand All @@ -29,50 +34,67 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install Node v18
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache: pnpm

- name: Install Dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: Run Compiler
run: yarn run build
run: pnpm run build

Linting:
runs-on: ubuntu-latest
needs: Dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install Node v18
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache: pnpm

- name: Install Dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: Run Eslint
run: yarn run lint
run: pnpm run lint

Testing:
runs-on: ubuntu-latest
needs: Dependencies
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install Node v18
uses: actions/setup-node@v4
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache: pnpm

- name: Install Dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile

- name: Run Vitest
run: yarn run test
run: pnpm run test
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
2 changes: 1 addition & 1 deletion .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
"**/*.{js,jsx,ts,tsx}": (filenames) => ["yarn turbo lint test", `prettier --write ${filenames.join(" ")}`]
"**/*.{js,jsx,ts,tsx}": (filenames) => ["pnpm turbo lint test", `prettier --write ${filenames.join(" ")}`]
};
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.2.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion apps/discord-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
"engines": {
"node": ">= v18.16.0"
},
"packageManager": "yarn@4.0.2"
"packageManager": "pnpm@8.15.5"
}
2 changes: 1 addition & 1 deletion apps/github-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
"engines": {
"node": ">= v18.16.0"
},
"packageManager": "yarn@4.0.2"
"packageManager": "pnpm@8.15.5"
}
15 changes: 6 additions & 9 deletions docker/discord-bot.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apk add --no-cache libc6-compat
RUN apk update

# Copy obly the needed files
RUN yarn global add turbo
RUN pnpm add turbo --global
COPY . .
RUN turbo prune --scope=discord-bot --docker

Expand All @@ -24,21 +24,18 @@ RUN apk update
# Install dependencies
COPY .gitignore .gitignore
COPY --from=builder /ijsblokje/out/json/ .
COPY --from=builder /ijsblokje/out/yarn.lock ./yarn.lock
COPY --from=builder /ijsblokje/out/pnpm-lock.yaml ./pnpm-lock.yaml

COPY --from=builder /ijsblokje/.yarnrc.yml .yarnrc.yml
COPY --from=builder /ijsblokje/.yarn .yarn

RUN yarn --immutable
RUN pnpm install --frozen-lockfile

# Build the project
COPY --from=builder /ijsblokje/out/full/ .
COPY --from=builder /ijsblokje/tsconfig.json tsconfig.json
RUN yarn turbo run build --filter=discord-bot
RUN pnpm turbo build --filter=discord-bot

# Remove dev-dependencies from node_modules
RUN yarn pinst --disable
RUN yarn workspaces focus --production --all
RUN pnpm pinst --disable
RUN pnpm install --prod


# --- Runner ---
Expand Down
15 changes: 6 additions & 9 deletions docker/github-bot.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apk add --no-cache libc6-compat
RUN apk update

# Copy obly the needed files
RUN yarn global add turbo
RUN pnpm add turbo --global
COPY . .
RUN turbo prune --scope=github-bot --docker

Expand All @@ -24,21 +24,18 @@ RUN apk update
# Install dependencies
COPY .gitignore .gitignore
COPY --from=builder /ijsblokje/out/json/ .
COPY --from=builder /ijsblokje/out/yarn.lock ./yarn.lock
COPY --from=builder /ijsblokje/out/pnpm-lock.yaml ./pnpm-lock.yaml

COPY --from=builder /ijsblokje/.yarnrc.yml .yarnrc.yml
COPY --from=builder /ijsblokje/.yarn .yarn

RUN yarn --immutable
RUN pnpm install --frozen-lockfile

# Build the project
COPY --from=builder /ijsblokje/out/full/ .
COPY --from=builder /ijsblokje/tsconfig.json tsconfig.json
RUN yarn turbo run build --filter=github-bot
RUN pnpm turbo build --filter=github-bot

# Remove dev-dependencies from node_modules
RUN yarn pinst --disable
RUN yarn workspaces focus --production --all
RUN pnpm pinst --disable
RUN pnpm install --prod


# --- Runner ---
Expand Down
14 changes: 4 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,15 @@
"test": "turbo test",
"start": "turbo start",
"start:dev": "nodemon ./dist",
"postinstall": "is-ci || husky install"
"postinstall": "is-ci || husky"
},
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-angular": "^18.4.3",
"@sapphire/eslint-config": "^5.0.3",
"@snowcrystals/eslint-config": "^1.0.0",
"@sapphire/ts-config": "^5.0.0",
"@snowcrystals/prettier-config": "^1.0.0",
"@types/node": "^20.10.5",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.2",
"husky": "^8.0.3",
"husky": "^9.0.11",
"is-ci": "^3.0.1",
"lint-staged": "^15.2.0",
"pinst": "^3.0.0",
Expand All @@ -43,5 +37,5 @@
"engines": {
"node": ">= v18.16.0"
},
"packageManager": "yarn@4.0.2"
"packageManager": "pnpm@8.15.5"
}
2 changes: 1 addition & 1 deletion packages/octocat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
"engines": {
"node": ">= v18.16.0"
},
"packageManager": "yarn@4.0.2"
"packageManager": "pnpm@8.15.5"
}
2 changes: 1 addition & 1 deletion packages/octokit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
"engines": {
"node": ">= v18.16.0"
},
"packageManager": "yarn@4.0.2"
"packageManager": "pnpm@8.15.5"
}
2 changes: 1 addition & 1 deletion packages/release/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
"engines": {
"node": ">= v18.16.0"
},
"packageManager": "yarn@4.0.2"
"packageManager": "pnpm@8.15.5"
}
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
"engines": {
"node": ">= v18.16.0"
},
"packageManager": "yarn@4.0.2"
"packageManager": "pnpm@8.15.5"
}
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"engines": {
"node": ">= v18.16.0"
},
"packageManager": "yarn@4.0.2"
"packageManager": "pnpm@8.15.5"
}
Loading

0 comments on commit 6fd9a45

Please sign in to comment.