Skip to content

Commit

Permalink
Yarn 3 (#898)
Browse files Browse the repository at this point in the history
* chore: yarn 3

* chore: update husky and lint-staged

* chore: add nvmrc
  • Loading branch information
quantizor authored Apr 4, 2023
1 parent 06352ec commit 773a080
Show file tree
Hide file tree
Showing 10 changed files with 12,873 additions and 8,204 deletions.
34 changes: 10 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
node-version-file: ".nvmrc"

- name: Install
run: yarn
run: yarn install --immutable

- name: Build
run: yarn build
Expand All @@ -30,22 +23,15 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/checkout@v3

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: yarn
node-version-file: ".nvmrc"

- name: Install
run: yarn
run: yarn install --immutable

- name: Jest
run: yarn test
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ __diff_output__
.DS_Store

# build
.next
.next

# Yarn 3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

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

npm run precommit
yarn precommit
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-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.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.5.0.cjs
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
"scripts": {
"analyze": "ANALYZE=true yarn build",
"dev": "next dev",
"prepare": "husky install",
"prebuild": "rimraf .next",
"precommit": "lint-staged",
"build": "NODE_ENV=production next build",
"lint:fix": "next lint --fix",
"lint": "next lint",
"start": "NODE_ENV=production next start",
"test": "jest -c .jest.config.js",
"prettier": "prettier **/*.js --write",
"size": "bundlesize"
"size": "bundlesize",
"postinstall": "husky install"
},
"dependencies": {
"@mdx-js/loader": "^1.5.3",
Expand Down Expand Up @@ -60,10 +63,10 @@
"enzyme-to-json": "^3.6.2",
"eslint": "^8.4.1",
"eslint-config-next": "12.0.7",
"husky-v4": "^4.3.8",
"husky": "^8.0.0",
"jest": "^27.4.3",
"jest-styled-components": "^7.0.8",
"lint-staged": "^12.1.2",
"lint-staged": "^13",
"prettier": "^2.5.1",
"react-test-renderer": "^17.0.2",
"rimraf": "^3.0.0"
Expand All @@ -74,9 +77,5 @@
"maxSize": "300kB"
}
],
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
"packageManager": "[email protected]"
}
Loading

1 comment on commit 773a080

@vercel
Copy link

@vercel vercel bot commented on 773a080 Apr 4, 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.