Skip to content

Commit 25bd7fb

Browse files
committed
build: migrate to yarn v4 (#509)
1 parent 10bcd7d commit 25bd7fb

File tree

18 files changed

+16636
-11829
lines changed

18 files changed

+16636
-11829
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,22 @@ jobs:
2222
- name: Checkout Repo
2323
uses: actions/checkout@v3
2424

25+
- name: Enable Corepack
26+
run: corepack enable
27+
2528
- name: Setup Node.js ${{ matrix.node }}
2629
uses: actions/setup-node@v3
2730
with:
2831
node-version: ${{ matrix.node }}
2932
cache: yarn
33+
env:
34+
# https://github.com/actions/setup-node/issues/531#issuecomment-1819151412
35+
SKIP_YARN_COREPACK_CHECK: 1
3036

3137
- name: Install Dependencies
32-
run: yarn --frozen-lockfile
38+
run: yarn --immutable
39+
env:
40+
SKIP_YARN_COREPACK_CHECK: 1
3341

3442
- name: Build, Lint and Test
3543
run: |
@@ -38,6 +46,7 @@ jobs:
3846
env:
3947
EFF_NO_LINK_RULES: true
4048
PARSER_NO_WATCH: true
49+
SKIP_YARN_COREPACK_CHECK: 1
4150

4251
- name: Codecov
4352
uses: codecov/codecov-action@v3

.github/workflows/codeql.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: 'CodeQL'
1+
name: CodeQL
22

33
on:
44
push:
5-
branches: ['master']
65
pull_request:
7-
branches: ['master']
86
schedule:
97
- cron: '41 19 * * 6'
108

@@ -20,22 +18,23 @@ jobs:
2018
strategy:
2119
fail-fast: false
2220
matrix:
23-
language: [javascript]
21+
language:
22+
- javascript
2423

2524
steps:
2625
- name: Checkout
2726
uses: actions/checkout@v3
2827

2928
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v2
29+
uses: github/codeql-action/init@v3
3130
with:
3231
languages: ${{ matrix.language }}
3332
queries: +security-and-quality
3433

3534
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v2
35+
uses: github/codeql-action/autobuild@v3
3736

3837
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v2
38+
uses: github/codeql-action/analyze@v3
4039
with:
4140
category: '/language:${{ matrix.language }}'

.github/workflows/pkg-size.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v3
1616

17-
- name: Setup Node.js
18-
uses: actions/setup-node@v3
17+
- name: Enable Corepack
18+
run: corepack enable
19+
20+
- name: Setup Node.js LTS
21+
uses: actions/setup-node@v4
1922
with:
2023
node-version: 16
2124
cache: yarn
25+
env:
26+
# https://github.com/actions/setup-node/issues/531#issuecomment-1819151412
27+
SKIP_YARN_COREPACK_CHECK: 1
2228

2329
- name: Package Size Report
2430
uses: pkg-size/action@v1

.github/workflows/release.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,38 @@ jobs:
1616
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1717
fetch-depth: 0
1818

19-
- name: Setup Node.js 16
20-
uses: actions/setup-node@v3
19+
- name: Enable Corepack
20+
run: corepack enable
21+
22+
- name: Setup Node.js LTS
23+
uses: actions/setup-node@v4
2124
with:
2225
node-version: 16
2326
cache: yarn
27+
env:
28+
# https://github.com/actions/setup-node/issues/531#issuecomment-1819151412
29+
SKIP_YARN_COREPACK_CHECK: 1
2430

2531
- name: Install Dependencies
26-
run: yarn --frozen-lockfile
32+
run: yarn --immutable
33+
env:
34+
SKIP_YARN_COREPACK_CHECK: 1
2735

2836
# required for linting before commit
2937
- name: Build
3038
run: yarn build
39+
env:
40+
SKIP_YARN_COREPACK_CHECK: 1
3141

3242
- name: Create Release Pull Request or Publish to npm
3343
id: changesets
3444
uses: changesets/action@v1
3545
with:
36-
# This expects you to have a script called release which does a build for your packages and calls changeset publish
37-
publish: yarn release:only
3846
commit: 'chore: release package(s)'
3947
title: 'chore: release package(s)'
48+
publish: yarn release:only
49+
version: yarn run version
4050
env:
4151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4252
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
SKIP_YARN_COREPACK_CHECK: 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports={name:"plugin-prepare-lifecycle",factory:e=>({hooks:{afterAllInstalled(r){if(!r.topLevelWorkspace.manifest.scripts.get("prepare"))return;e("@yarnpkg/shell").execute("yarn prepare")}}})};

.yarnrc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
nodeLinker: node-modules
2+
3+
plugins:
4+
- checksum: 37b2361b1502b2054e6779788c0e9bdd6a90ce49852a8cad2feda79b0614ec94f06fb6e78951f5f95429c610d7934dd077caa47413a0227378a102c55161616d
5+
path: .yarn/plugins/plugin-prepare-lifecycle.cjs
6+
spec: "https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js"

package.json

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,54 @@
99
"workspaces": [
1010
"packages/*"
1111
],
12-
"packageManager": "yarn@1.22.19",
12+
"packageManager": "yarn@4.0.2",
1313
"scripts": {
14-
"build": "run-p build:*",
14+
"build": "run-p 'build:*'",
1515
"build:r": "r -f es2015",
1616
"build:ts": "tsc -b",
17-
"clean": "rimraf packages/*/{lib,*.tsbuildinfo}",
18-
"lint": "run-p lint:*",
17+
"clean": "rimraf --glob 'packages/*/{lib,*.tsbuildinfo}'",
18+
"lint": "yarn build && run-p 'lint:*'",
1919
"lint:es": "eslint . --cache -f friendly",
2020
"lint:tsc": "tsc --noEmit",
21-
"prelint": "yarn build",
22-
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
23-
"prerelease": "yarn build",
24-
"release": "yarn release:only",
25-
"release:only": "changeset publish --tag release-v2",
26-
"test": "jest",
27-
"typecov": "type-coverage"
21+
"prepare": "patch-package && simple-git-hooks",
22+
"release": "run-s build release:only",
23+
"release:only": "changeset publish",
24+
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
25+
"typecov": "type-coverage",
26+
"version": "changeset version && yarn --no-immutable"
2827
},
2928
"devDependencies": {
30-
"@1stg/lib-config": "^12.0.1",
31-
"@changesets/changelog-github": "^0.4.8",
32-
"@changesets/cli": "^2.26.2",
29+
"@1stg/common-config": "^9.0.1",
30+
"@changesets/changelog-github": "^0.5.0",
31+
"@changesets/cli": "^2.27.1",
32+
"@commitlint/cli": "^18.4.3",
33+
"@pkgr/rollup": "^5.0.0",
34+
"@types/acorn": "^6.0.0",
3335
"@types/eslint": "^8.56.0",
34-
"@types/eslint-plugin-markdown": "^2.0.0",
35-
"@types/jest": "^29.5.3",
36-
"@types/node": "^20.4.6",
37-
"@types/react": "^18.2.18",
38-
"@types/unist": "^2.0.6",
39-
"jest": "^29.6.2",
36+
"@types/eslint-plugin-markdown": "^2.0.2",
37+
"@types/jest": "^29.5.11",
38+
"@types/node": "^20.10.6",
39+
"@types/react": "^18.2.46",
40+
"@types/unist": "^3.0.2",
41+
"cross-env": "^7.0.3",
42+
"eslint": "^8.56.0",
43+
"jest": "^30.0.0-alpha.2",
44+
"lint-staged": "^15.2.0",
45+
"npm-run-all2": "^6.1.1",
4046
"patch-package": "^8.0.0",
47+
"prettier": "^2.8.8",
4148
"react": "^18.2.0",
49+
"rimraf": "^5.0.5",
50+
"simple-git-hooks": "^2.9.0",
4251
"ts-jest": "^29.1.1",
43-
"ts-node": "^10.9.1",
44-
"type-coverage": "^2.26.0",
45-
"typescript": "^5.1.6",
46-
"yarn-deduplicate": "^6.0.2"
52+
"ts-node": "^10.9.2",
53+
"type-coverage": "^2.27.1",
54+
"typescript": "^5.3.3"
4755
},
4856
"resolutions": {
57+
"@commitlint/cli": "^18.4.3",
58+
"@types/acorn": "^6.0.0",
59+
"lint-staged": "^15.2.0",
4960
"prettier": "^2.8.8"
5061
},
5162
"commitlint": {

packages/eslint-mdx/src/helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const getPositionAtFactory = (text: string) => {
7777
return {
7878
line,
7979
column: offset - currOffset,
80+
// @ts-expect-error -- intended
8081
offset,
8182
}
8283
}

packages/eslint-mdx/src/meta.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- no idea
2-
// @ts-ignore
31
import { name, version } from '../package.json'
42

53
export const meta = { name, version }

packages/eslint-mdx/src/tokens.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const restoreTokens = (
2929
value?: string,
3030
): Token => ({
3131
type,
32+
// @ts-expect-error -- intended
3233
value,
3334
start,
3435
end,

0 commit comments

Comments
 (0)