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

Update yarn to v4 #1758

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@v3
with:
Expand All @@ -35,7 +38,7 @@ jobs:
${{ runner.os }}-yarn-

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

- name: Build source
run: yarn build
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ jobs:
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

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

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@v3
with:
Expand All @@ -27,9 +30,6 @@ jobs:
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Set ignore engines
run: yarn config set ignore-engines true

- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
Expand All @@ -38,7 +38,7 @@ jobs:
${{ runner.os }}-yarn-

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

- name: Validate
run: yarn lint
Expand Down Expand Up @@ -67,3 +67,17 @@ jobs:

- name: Run parcel tests
run: yarn test:parcel

# Borrowed from https://github.com/yarnpkg/berry/issues/4976#issue-1415019789
- name: Run yarn lint:yarn-dedupe
run: |
if ! yarn lint:yarn-dedupe; then
echo ''
echo ''
echo 'ℹ️ ℹ️ ℹ️'
echo 'Some dependencies can be deduplicated, which will make yarn.lock'
echo 'lighter and potentially save us from unexplainable bugs.'
echo 'Please run `yarn fix:yarn-dedupe` locally and commit yarn.lock.'
echo 'ℹ️ ℹ️ ℹ️'
exit 1
fi
5 changes: 4 additions & 1 deletion .github/workflows/visual-regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm

- name: enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@v3
with:
Expand All @@ -35,7 +38,7 @@ jobs:
${{ runner.os }}-yarn-

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

- name: Build source
run: yarn build
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Website

on:
push:
branches:
- master

pull_request:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v3

- name: enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install packages
working-directory: './website'
run: yarn install --immutable

- name: Validate
working-directory: './website'
run: yarn build

# Borrowed from https://github.com/yarnpkg/berry/issues/4976#issue-1415019789
- name: Run yarn lint:yarn-dedupe
working-directory: './website'
run: |
if ! yarn lint:yarn-dedupe; then
echo ''
echo ''
echo 'ℹ️ ℹ️ ℹ️'
echo 'Some dependencies can be deduplicated, which will make yarn.lock'
echo 'lighter and potentially save us from unexplainable bugs.'
echo 'Please run `yarn fix:yarn-dedupe` locally and commit yarn.lock.'
echo 'ℹ️ ℹ️ ℹ️'
exit 1
fi
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@ storybook-static

*.log
*.tsbuildinfo

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

website/.yarn/*
!website/.yarn/patches
!website/.yarn/plugins
!website/.yarn/releases
!website/.yarn/sdks
!website/.yarn/versions
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodeLinker: node-modules
npmRegistryServer: 'https://registry.yarnpkg.com'
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
"clean:node-modules": "rm -rf node_modules/.cache",
"clean:parcel-cache": "rm -rf .parcel-cache/",
"clean:ts-cache": "find . -name \"*.tsbuildinfo\" -type f -delete",
"postinstall": "scripts/postinstall.sh",
"fix:yarn-dedupe": "yarn dedupe",
"lint": "eslint --config .eslintrc.js --ext js,json,jsx,ts,tsx .",
"lint:fix": "yarn lint -- --fix",
"lint:fix": "yarn lint --fix",
"lint:yarn-dedupe": "yarn dedupe --check",
"prettier:check": "prettier ./ --check",
"prettier:fix": "prettier ./ --write",
"release": "yarn clean && yarn build && yarn changeset publish",
Expand Down Expand Up @@ -63,7 +64,6 @@
"semver": "^7.5.4",
"typescript": "^4.9.5"
},
"dependencies": {},
"devDependencies": {
"@babel/preset-env": "^7.21.5",
"@babel/preset-react": "^7.18.6",
Expand Down Expand Up @@ -126,6 +126,7 @@
}
}
},
"packageManager": "[email protected]",
"size-limit": [
{
"path": "./packages/react/dist/browser/runtime/css-custom-property.js",
Expand Down
1 change: 0 additions & 1 deletion packages/parcel-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@compiled/parcel-transformer-external": "^0.1.0",
"@parcel/plugin": "^2.8.3"
},
"devDependencies": {},
"engines": {
"parcel": "^2.0.0"
}
Expand Down
16 changes: 2 additions & 14 deletions scripts/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,7 @@

set -Eeuo pipefail

trap cleanup SIGINT SIGTERM ERR EXIT

cleanup() {
trap - SIGINT SIGTERM ERR EXIT

rm -f yarn.lock.bak
}

# Remove any atlassian mirrors
sed -i.bak -E 's/https:\/\/packages.atlassian.com\/api\/npm\/npm-remote\//https:\/\/registry.yarnpkg.com\//g' yarn.lock
echo "De-duplicating..."

# Deduplicate
npx yarn-deduplicate

# Run yarn again to transform any changes
yarn --ignore-scripts
yarn dedupe
3 changes: 2 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"clean": "rm -rf dist && workspaces-run -- rm -rf dist && workspaces-run -- rm -rf .cache",
"clean:npm": "yarn clean:pkg:npm && rm -rf node_modules",
"clean:pkg:npm": "workspaces-run -- rm -rf node_modules",
"postinstall": "npx yarn-deduplicate",
"fix:yarn-dedupe": "yarn dedupe",
"lint:yarn-dedupe": "yarn dedupe --check",
"start:docs": "cd packages/docs && yarn start",
"start:landing": "cd packages/landing && yarn start"
},
Expand Down
1 change: 0 additions & 1 deletion website/packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "1.0.0",
"main": "./src/index.ts",
"source": "./src/index.ts",
"scripts": {},
"dependencies": {
"@babel/core": "^7.24.5",
"@babel/preset-react": "^7.24.1",
Expand Down
Loading
Loading