Skip to content

Commit 6cecf2c

Browse files
committed
Try upgrading Yarn to Yarn Modern (#385)
Let's see how this affects workflows. If it works well, then we'll be on the latest version!
1 parent 69af819 commit 6cecf2c

File tree

16 files changed

+7685
-4251
lines changed

16 files changed

+7685
-4251
lines changed

.github/workflows/set-up-everything/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ runs:
2727
python-version: 3.12.4
2828

2929
- name: Install dependencies
30-
# I learned about https://github.com/yarnpkg/yarn/issues/2739 painfully.
31-
run: yarn --production=false --frozen-lockfile
30+
run: yarn --immutable
3231
shell: bash

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@ node_modules/
22
yarn-error.log
33

44
.DS_Store
5+
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/sdks
12+
!.yarn/versions

.yarn/releases/yarn-4.4.1-patched.cjs

Lines changed: 925 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-4.4.1-patched.cjs

DEVELOPMENT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This document aims to get you up-and-running developing on this project! If afte
77
At a minimum, you will need:
88

99
- Node.js, version 20 or higher
10-
- Yarn 1.\* (i.e. classic Yarn)
10+
- Yarn 4+
1111
- a Bash shell
1212

1313
For the most enjoyable development experience, or if you plan to contribute to the [Adventure Pack](workspaces/adventure-pack/), you will additionally need:
@@ -19,7 +19,7 @@ See below for more context on each prerequisite and how to install it.
1919

2020
### Node
2121

22-
This project is structured as a Node module, using [classic Yarn](https://classic.yarnpkg.com/) as the package manager. So even if you don't intend to write any TypeScript/JavaScript code, it will be beneficial to have a recent version of Node, so you can run the repository management code, which is generally written in TypeScript or JavaScript.
22+
This project is structured as a Node module, using Yarn as the package manager. So even if you don't intend to write any TypeScript/JavaScript code, it will be beneficial to have a recent version of Node, so you can run the repository management code, which is generally written in TypeScript or JavaScript.
2323

2424
We recommend installing Node using the Node Version Manager (`nvm`). Follow the installation instructions at https://nvm.sh/ then:
2525

@@ -33,7 +33,7 @@ node -v
3333

3434
### Yarn
3535

36-
As mentioned, Yarn (specifically [classic Yarn](https://classic.yarnpkg.com/)) is the package manager we currently use for the TypeScript/JavaScript code. If you have a recent version of Node, you will have access to all the package managers your heart desires, though you may need to enable them using [Corepack](https://nodejs.org/api/corepack.html):
36+
As mentioned, [Yarn](https://yarnpkg.com/) is the package manager we currently use for the TypeScript/JavaScript code. If you have a recent version of Node, you will have access to all the package managers your heart desires, though you may need to enable them using [Corepack](https://nodejs.org/api/corepack.html):
3737

3838
```sh
3939
# The `corepack` command is distributed with Node.

eslint.config.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ import config from "@code-chronicles/eslint-config";
33
export default [
44
...config,
55
{
6-
// Ignore the workspaces directory, it will handle its own linting.
7-
// See the "lint" script in `package.json`.
8-
ignores: ["workspaces/"],
6+
ignores: [
7+
// Ignore the workspaces directory, it will handle its own linting.
8+
// See the "lint" script in `package.json`.
9+
"workspaces/",
10+
11+
// Minified Yarn code!
12+
".yarn/releases/",
13+
],
914
},
1015
];

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
"workspaces/util"
1919
],
2020
"scripts": {
21-
"format": "yarn --silent workspace @code-chronicles/repository-scripts start format",
22-
"lint": "yarn --silent workspace @code-chronicles/repository-scripts start lint",
23-
"test": "yarn --silent workspace @code-chronicles/repository-scripts start test",
24-
"typecheck": "yarn --silent workspace @code-chronicles/repository-scripts start typecheck"
21+
"format": "yarn workspace @code-chronicles/repository-scripts start format",
22+
"lint": "yarn workspace @code-chronicles/repository-scripts start lint",
23+
"test": "yarn workspace @code-chronicles/repository-scripts start test",
24+
"typecheck": "yarn workspace @code-chronicles/repository-scripts start typecheck"
2525
},
2626
"devDependencies": {
2727
"@code-chronicles/eslint-config": "0.0.1",
2828
"eslint": "9.9.0",
2929
"prettier": "3.3.3"
3030
},
31-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
31+
"packageManager": "yarn@4.4.1"
3232
}

workspaces/download-leetcode-submissions/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ As such it's safe to run the script multiple times, without redoing too much wor
7777

7878
## Development
7979

80-
Like the rest of the [Code Chronicles Leetcode ecosystem](../../), this package is structured as a Node module, using [classic Yarn](https://classic.yarnpkg.com/) as the package manager.
80+
Like the rest of the [Code Chronicles Leetcode ecosystem](../../), this package is structured as a Node module, using [Yarn](https://yarnpkg.com/) as the package manager.
8181

8282
You can install dependencies by running `yarn`, either in this package's directory, or in the repository root. The usual `yarn format`, `yarn lint`, and `yarn typecheck` scripts are available to aid in development and occasionally to annoy.
8383

workspaces/eslint-config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default [...config, { ignores: ["dist/"] }];
2020

2121
## Development
2222

23-
Like the rest of the [Code Chronicles Leetcode ecosystem](../../), this package is structured as a Node module, using [classic Yarn](https://classic.yarnpkg.com/) as the package manager.
23+
Like the rest of the [Code Chronicles Leetcode ecosystem](../../), this package is structured as a Node module, using [Yarn](https://yarnpkg.com/) as the package manager.
2424

2525
You can install dependencies by running `yarn`, either in this package's directory, or in the repository root. The usual `yarn format` and `yarn lint` commands are available, but for the time being there is no `yarn typecheck`, since this package is pure JavaScript rather than TypeScript. (However, it hopefully will be [in the near future](https://eslint.org/docs/latest/use/configure/configuration-files#typescript-configuration-files)!)
2626

workspaces/fetch-leetcode-problem-list/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This repository includes [a Github Actions workflow](../../.github/workflows/upd
5757

5858
## Development
5959

60-
Like the rest of the [Code Chronicles Leetcode ecosystem](../../), this package is structured as a Node module, using [classic Yarn](https://classic.yarnpkg.com/) as the package manager.
60+
Like the rest of the [Code Chronicles Leetcode ecosystem](../../), this package is structured as a Node module, using [Yarn](https://yarnpkg.com/) as the package manager.
6161

6262
You can install dependencies by running `yarn`, either in this package's directory, or in the repository root. The usual `yarn format`, `yarn lint`, and `yarn typecheck` scripts are available to aid in development and occasionally to annoy. Read more in the repository's general [development guide](../../DEVELOPMENT.md).
6363

0 commit comments

Comments
 (0)