Skip to content

Commit

Permalink
♻️ Migrate from yarn to pnpm (#1503)
Browse files Browse the repository at this point in the history
* 🔧 Add `pnpm-workspace` configuration

* 🔧 Add `pnpm-lock` file

* ♻️ Replace `yarn` with `pnpm` in root package.json

* 🔥 Remove yarn binary

* ⬆️ Bump `next-pwa` dependencies

* 🔥 Remove yarn lockfile

* ♻️ Replace `yarn` with `pnpm` in gitmojis package

* ♻️ Replace `yarn` with `pnpm` in website package

* ♻️ Replace `yarn` with `pnpm` in GitHub workflows

* ♻️ Adjust `lintstagedrc` prettier arguments

* 📝 Update documentation

* ♻️ Replace `yarn` with `pnpm` in git hooks

* 🔥 Remove yarn refs from git files

* ⬆️ Update `clipboard` dependency

* 👷‍♂️ Install pnpm in GitHub Actions

* 🔥 Remove unnecessary `exec` c md

* 📝 Update documentation

* 🔧 Specify pnpm as an engine
  • Loading branch information
carloscuesta authored Jun 14, 2023
1 parent ccdc5cb commit 7d305f4
Show file tree
Hide file tree
Showing 16 changed files with 8,084 additions and 11,939 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ If you would like to add a new emoji to gitmoji, fill the provided `ISSUE_TEMPLA
1. Fork [this repository](https://github.com/carloscuesta/gitmoji/fork).
2. Create a new branch with the feature name. (Eg: add-emoji-deploy, fix-website-header)
3. Make your changes.
4. Test you changes by running `yarn turbo test`
- 4.1. If the snapshots are failing run `yarn turbo test -- -u` and be sure that the new snapshots match your changes
4. Test you changes by running `pnpm turbo test`
- 4.1. If the snapshots are failing run `pnpm turbo test -- -u` and be sure that the new snapshots match your changes
5. Commit your changes. Don't forget to add a commit title with an emoji and a description.
6. Push your changes.
7. Submit your pull request.
Expand Down Expand Up @@ -53,7 +53,7 @@ $ cd gitmoji
2. Install the dependencies and start the development server.

```bash
$ yarn install && yarn run dev
$ pnpm install && pnpm run dev
```

The project is built with [Next.js](http://nextjs.org)
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ jobs:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: "yarn"
cache: "pnpm"
node-version: ${{ matrix.node-version }}
- name: Install dependencies 📦
run: yarn install --immutable
run: pnpm install
- name: Lint 🎨
run: yarn turbo lint
run: pnpm turbo lint
- name: TypeScript check 🏷
run: yarn turbo tscheck
run: pnpm turbo tscheck
- name: Tests ✅
run: yarn turbo test
run: pnpm turbo test
9 changes: 5 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
cache: "yarn"
cache: "pnpm"
node-version: "18"
- name: Install dependencies 📦
run: yarn install --immutable
run: pnpm install
- name: Build 👷‍♂️
run: yarn turbo run build --filter=gitmojis
run: pnpm turbo run build --filter=gitmojis
- name: Publish package to NPM 🚀
env:
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
run: |
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
yarn turbo publishPackage
pnpm turbo publishPackage
- name: Publish GitHub Release 📝
uses: softprops/action-gh-release@v1
with:
Expand Down
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ coverage/
.eslintcache
*.log
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# next-pwa
packages/website/public/workbox-*.js
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
pnpm exec lint-staged
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn turbo tscheck && yarn turbo test
pnpm turbo tscheck && pnpm turbo test
6 changes: 3 additions & 3 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"*.json": ["prettier --write *.json"],
"*.md": ["prettier --write *.md"],
"*.yml": ["prettier --write *.yml"]
"*.json": ["prettier --write"],
"*.md": ["prettier --write"],
"*.yml": ["prettier --write"]
}
823 changes: 0 additions & 823 deletions .yarn/releases/yarn-3.3.1.cjs

This file was deleted.

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

This file was deleted.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
"name": "gitmoji",
"private": true,
"engines": {
"node": "18"
"node": "18",
"pnpm": ">=8"
},
"workspaces": [
"packages/*"
],
"scripts": {
"prepare": "husky install",
"dev": "yarn turbo --parallel dev"
"dev": "pnpm turbo --parallel dev"
},
"devDependencies": {
"@vercel/analytics": "^1.0.1",
Expand All @@ -21,5 +19,5 @@
"volta": {
"node": "16.15.0"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]"
}
4 changes: 2 additions & 2 deletions packages/gitmojis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"dist"
],
"scripts": {
"dev": "nodemon --exec 'yarn build' --watch ./src",
"dev": "nodemon --exec 'pnpm run build' --watch ./src",
"build": "unbuild",
"lint:json": "ajv --spec=draft2020 validate -s ./src/schema.json -d ./src/gitmojis.json",
"lint": "yarn run lint:json && prettier --check ./src/**/*.{js,json,ts}",
"lint": "pnpm run lint:json && prettier --check ./src/**/*.{js,json,ts}",
"publishPackage": "npm publish"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"private": true,
"version": "1.0.0",
"engines": {
"node": "16"
"node": "18"
},
"scripts": {
"build": "next build && next-sitemap",
"tscheck": "yarn tsc --noEmit",
"tscheck": "pnpm exec tsc --noEmit",
"dev": "next dev",
"lint": "eslint ./src && prettier --check ./src/**/*.{ts,tsx,css}",
"start": "next start",
Expand All @@ -20,7 +20,7 @@
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.11",
"clipboard": "^2.0.4",
"clipboard": "^2.0.11",
"eslint": "^8.42.0",
"eslint-config-next": "^13.4.5",
"eslint-config-prettier": "^8.8.0",
Expand All @@ -36,7 +36,7 @@
"jest-fetch-mock": "^3.0.3",
"lint-staged": "^13.2.2",
"next": "^13.4.5",
"next-pwa": "^5.4.4",
"next-pwa": "^5.6.0",
"next-sitemap": "^4.1.3",
"next-themes": "^0.2.0",
"node-mocks-http": "^1.12.2",
Expand Down
Loading

1 comment on commit 7d305f4

@vercel
Copy link

@vercel vercel bot commented on 7d305f4 Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.