Skip to content

Commit 66de34b

Browse files
[🔥AUDIT🔥] Move to pnpm (#1795)
🖍 _This is an audit!_ 🖍 ## Summary: This moves off `yarn` and onto `pnpm`. It also updates package deps to latest versions. This is a minimal impact on end users since these are all dev dependencies. Issue: Closes #1758 ## Test plan: `pnpm clean & pnpm build` `pnpm eslint` Author: somewhatabstract Auditors: copilot-pull-request-reviewer[bot] Required Reviewers: Approved By: Checks: ✅ 8 checks were successful, ⏭️ 1 check has been skipped Pull Request URL: #1795
1 parent d8b374b commit 66de34b

13 files changed

+8722
-7461
lines changed

.changeset/quick-turkeys-hang.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ancesdir": patch
3+
---
4+
5+
Move to pnpm and update dev dependencies to latest

.github/dependabot.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ updates:
33
- package-ecosystem: npm
44
directory: "/"
55
schedule:
6-
interval: daily
6+
interval: weekly
7+
day: saturday
78
time: "09:00"
89
timezone: America/Chicago
910
open-pull-requests-limit: 10
1011
reviewers:
1112
- somewhatabstract
13+
14+
- package-ecosystem: github-actions
15+
directory: "/"
16+
schedule:
17+
interval: weekly
18+
day: saturday
19+
time: "09:00"
20+
timezone: America/Chicago
21+
open-pull-requests-limit: 10
22+
reviewers:
23+
- somewhatabstract

.github/workflows/codeql-analysis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939

4040
steps:
4141
- name: Checkout repository
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v2
46+
uses: github/codeql-action/init@v3
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v2
57+
uses: github/codeql-action/autobuild@v3
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v2
71+
uses: github/codeql-action/analyze@v3

.github/workflows/nodejs.yml

+54-10
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,30 @@ jobs:
2121
node-version: [20.x]
2222
steps:
2323
- uses: actions/checkout@v4
24-
- name: Install & cache node_modules
25-
uses: Khan/actions@shared-node-cache-v2
24+
25+
- uses: pnpm/action-setup@v4
26+
name: Install pnpm
27+
with:
28+
run_install: false
29+
package_json_file: 'package.json'
30+
31+
- name: Use Node.js ${{ matrix.node-version }}
32+
uses: actions/setup-node@v4
2633
with:
2734
node-version: ${{ matrix.node-version }}
35+
cache: 'pnpm'
36+
cache-dependency-path: 'pnpm-lock.yaml'
37+
38+
- name: Install Dependencies
39+
shell: bash
40+
run: pnpm install --frozen-lockfile
41+
2842
- name: Lint
29-
run: yarn lint
43+
run: pnpm eslint
44+
3045
- name: Types
31-
run: yarn typecheck
46+
run: pnpm typecheck
47+
3248
- name: Changesets check
3349
uses: Khan/actions@check-for-changeset-v1
3450
if: |
@@ -49,12 +65,26 @@ jobs:
4965
node-version: [20.x]
5066
steps:
5167
- uses: actions/checkout@v4
52-
- name: Install & cache node_modules
53-
uses: Khan/actions@shared-node-cache-v2
68+
69+
- uses: pnpm/action-setup@v4
70+
name: Install pnpm
71+
with:
72+
run_install: false
73+
package_json_file: 'package.json'
74+
75+
- name: Use Node.js ${{ matrix.node-version }}
76+
uses: actions/setup-node@v4
5477
with:
5578
node-version: ${{ matrix.node-version }}
79+
cache: 'pnpm'
80+
cache-dependency-path: 'pnpm-lock.yaml'
81+
82+
- name: Install Dependencies
83+
shell: bash
84+
run: pnpm install --frozen-lockfile
85+
5686
- name: Run tests with coverage
57-
run: yarn coverage
87+
run: pnpm coverage
5888
- name: Upload coverage
5989
uses: codecov/codecov-action@v4
6090
env:
@@ -73,9 +103,23 @@ jobs:
73103
node-version: [20.x]
74104
steps:
75105
- uses: actions/checkout@v4
76-
- name: Install & cache node_modules
77-
uses: Khan/actions@shared-node-cache-v2
106+
107+
- uses: pnpm/action-setup@v4
108+
name: Install pnpm
109+
with:
110+
run_install: false
111+
package_json_file: 'package.json'
112+
113+
- name: Use Node.js ${{ matrix.node-version }}
114+
uses: actions/setup-node@v4
78115
with:
79116
node-version: ${{ matrix.node-version }}
117+
cache: 'pnpm'
118+
cache-dependency-path: 'pnpm-lock.yaml'
119+
120+
- name: Install Dependencies
121+
shell: bash
122+
run: pnpm install --frozen-lockfile
123+
80124
- name: Run tests and build
81-
run: yarn build
125+
run: pnpm build

.github/workflows/release.yml

+15-3
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,28 @@ jobs:
3636
fetch-depth: 0
3737
persist-credentials: false
3838

39-
- name: Install & cache node_modules
40-
uses: Khan/actions@shared-node-cache-v2
39+
- uses: pnpm/action-setup@v4
40+
name: Install pnpm
41+
with:
42+
run_install: false
43+
package_json_file: 'package.json'
44+
45+
- name: Use Node.js 20.x
46+
uses: actions/setup-node@v4
4147
with:
4248
node-version: 20.x
49+
cache: 'pnpm'
50+
cache-dependency-path: 'pnpm-lock.yaml'
51+
52+
- name: Install Dependencies
53+
shell: bash
54+
run: pnpm install --frozen-lockfile
4355

4456
- name: Create Release Pull Request or Publish to npm
4557
id: changesets
4658
uses: changesets/action@v1
4759
with:
48-
publish: yarn publish:ci
60+
publish: pnpm publish:ci
4961
env:
5062
# We use a Personal Access Token here rather than the GITHUB_TOKEN
5163
# so that it will trigger our other actions. The token has to be on

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict = true

CONTRIBUTING.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ To work in the `ancesdir` repository, follow these steps:
2222

2323
1. Clone the repository
2424
`git clone [email protected]:somewhatabstract/ancesdir.git`
25-
2. Install `yarn` (see [🔗yarnpkg.com](https://yarnpkg.com))
26-
3. Run `yarn` to install the dependencies
25+
2. Install `pnpm` using `corepack install`
26+
3. Run `pnpm i` to install the dependencies
2727

2828
You can now work on `ancesdir`. We prefer [🔗Visual Studio Code](https://code.visualstudio.com/) as our development environment (it's cross-platform and awesome), but please use what you feel comfortable with (we'll even forgive you for using vim).
2929

@@ -43,17 +43,17 @@ We love code reviews. If there are open pull requests, please feel free to revie
4343

4444
To ensure code quality, we use prettier, static typing, eslint, and jest. These are all executed when you submit a pull request to ensure the contribution meets our code quality standard.
4545

46-
To execute these operations outside of a pull request or commit operation, you can use `yarn`.
46+
To execute these operations outside of a pull request or commit operation, you can use `pnpm`.
4747

48-
- `yarn typecheck`
49-
- `yarn lint` or `yarn lint --fix` to autofix what can be
50-
- `yarn test`
48+
- `pnpm typecheck`
49+
- `pnpm eslint` or `pnpm eslint --fix` to autofix what can be
50+
- `pnpm test`
5151

5252
💭**REMEMBER** If you would like to contribute code changes to the project, first make sure there's a corresponding issue for the change you wish to make.
5353

5454
## 📦 Build And Publish
5555

56-
Anyone can create a local build of the distributed code by running `yarn build`.
56+
Anyone can create a local build of the distributed code by running `pnpm build`.
5757

5858
Running the build will execute tests first.
5959

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ This may be useful in a variety of situations. For example, a monorepo where you
1010

1111
## Getting Started
1212

13+
### pnpm
14+
**`pnpm add ancesdir`**
15+
1316
### yarn
1417

1518
**`yarn add ancesdir`**

eslint.config.mjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export default [
2121
{
2222
ignores: [
2323
"**/node_modules",
24-
"flow-typed/**/*.js",
2524
"**/coverage",
2625
"**/dist",
26+
".prettierrc.js",
2727
],
2828
},
2929
...compat.extends("@khanacademy"),
@@ -41,7 +41,9 @@ export default [
4141
...globals.node,
4242
},
4343
},
44-
44+
},
45+
{
46+
files: ["**/src/**", "**/__tests__/**/*.ts", "**/__mocks__/**/*.ts"],
4547
rules: {
4648
"constructor-super": "error",
4749
curly: "error",

package.json

+41-42
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"private": false,
1515
"engines": {
1616
"node": ">=20",
17-
"npm": "please-use-yarn",
18-
"yarn": ">=1.18.0 <2"
17+
"npm": "please-use-pnpm",
18+
"yarn": "please-use-pnpm"
1919
},
2020
"keywords": [
2121
"find",
@@ -30,60 +30,59 @@
3030
"files": [
3131
"dist"
3232
],
33-
"dependencies": {},
3433
"devDependencies": {
35-
"@babel/cli": "^7.24.7",
36-
"@babel/core": "^7.24.7",
37-
"@babel/eslint-parser": "^7.24.7",
38-
"@babel/eslint-plugin": "^7.24.7",
39-
"@babel/preset-env": "^7.24.7",
40-
"@babel/preset-typescript": "^7.24.7",
41-
"@changesets/cli": "^2.27.5",
42-
"@eslint/compat": "^1.1.0",
43-
"@eslint/eslintrc": "^3.1.0",
44-
"@eslint/js": "^9.5.0",
45-
"@khanacademy/eslint-config": "^4.0.0",
46-
"@khanacademy/eslint-plugin": "^3.0.0",
34+
"@babel/cli": "^7.27.0",
35+
"@babel/core": "^7.26.10",
36+
"@babel/eslint-parser": "^7.27.0",
37+
"@babel/eslint-plugin": "^7.27.0",
38+
"@babel/preset-env": "^7.26.9",
39+
"@babel/preset-typescript": "^7.27.0",
40+
"@changesets/cli": "^2.28.1",
41+
"@eslint/compat": "^1.2.8",
42+
"@eslint/eslintrc": "^3.3.1",
43+
"@eslint/js": "^9.24.0",
44+
"@khanacademy/eslint-config": "^5.2.1",
45+
"@khanacademy/eslint-plugin": "^3.1.2",
4746
"@rollup/plugin-babel": "^6.0.4",
48-
"@rollup/plugin-commonjs": "^26.0.1",
49-
"@rollup/plugin-node-resolve": "^15.2.3",
50-
"@types/jest": "^29.5.12",
47+
"@rollup/plugin-commonjs": "^28.0.3",
48+
"@rollup/plugin-node-resolve": "^16.0.1",
49+
"@rollup/plugin-terser": "^0.4.4",
50+
"@types/jest": "^29.5.14",
5151
"@types/node": "^20.14.2",
52-
"@typescript-eslint/eslint-plugin": "^7.13.0",
53-
"@typescript-eslint/parser": "^7.13.0",
52+
"@typescript-eslint/eslint-plugin": "^8.29.0",
53+
"@typescript-eslint/parser": "^8.29.0",
5454
"babel-jest": "^29.7.0",
55-
"eslint": "^9.5.0",
56-
"eslint-config-prettier": "^9.1.0",
57-
"eslint-import-resolver-typescript": "^3.6.1",
55+
"eslint": "^9.24.0",
56+
"eslint-config-prettier": "^10.1.1",
57+
"eslint-import-resolver-typescript": "^4.3.1",
5858
"eslint-plugin-eslint-comments": "^3.2.0",
59-
"eslint-plugin-import": "^2.29.1",
60-
"eslint-plugin-jest": "^28.6.0",
61-
"eslint-plugin-jsx-a11y": "^6.8.0",
62-
"eslint-plugin-prettier": "^5.1.3",
63-
"eslint-plugin-react": "^7.34.2",
64-
"globals": "^15.4.0",
59+
"eslint-plugin-import": "^2.31.0",
60+
"eslint-plugin-jest": "^28.11.0",
61+
"eslint-plugin-jsx-a11y": "^6.10.2",
62+
"eslint-plugin-prettier": "^5.2.6",
63+
"eslint-plugin-react": "^7.37.5",
64+
"globals": "^16.0.0",
6565
"jest": "^29.7.0",
6666
"jest-extended": "^4.0.2",
67-
"prettier": "^3.3.2",
68-
"rollup": "^4.18.0",
67+
"prettier": "^3.5.3",
68+
"rollup": "^4.39.0",
6969
"rollup-plugin-filesize": "^10.0.0",
70-
"rollup-plugin-terser": "^7.0.2",
71-
"typescript": "^5.4.5"
70+
"typescript": "^5.8.3"
7271
},
7372
"resolutions": {
74-
"nanomatch/kind-of": "^6.0.3",
75-
"micromatch/kind-of": "^6.0.3",
76-
"is-descriptor/kind-of": "^6.0.3"
73+
"nanomatch>kind-of": "^6.0.3",
74+
"micromatch>kind-of": "^6.0.3",
75+
"is-descriptor>kind-of": "^6.0.3"
7776
},
7877
"scripts": {
79-
"prepublishOnly": "yarn clean && yarn build",
78+
"prepublishOnly": "pnpm clean && pnpm build",
8079
"clean": "rm -rf dist",
81-
"build": "yarn test && rollup -c && yarn build:types",
80+
"build": "pnpm test && rollup -c && pnpm build:types",
8281
"build:types": "tsc --emitDeclarationOnly --declaration --project tsconfig-types.json",
8382
"test": "jest --colors --config jest.config.js",
8483
"coverage": "jest --colors --config jest.config.js --coverage",
8584
"typecheck": "tsc --noEmit --project tsconfig.json",
86-
"lint": "eslint --report-unused-disable-directives --config eslint.config.mjs \"{src,bin,__{tests,mocks}__}/**/*.ts\"",
87-
"publish:ci": "git diff --stat --exit-code HEAD && yarn build && changeset publish"
88-
}
89-
}
85+
"publish:ci": "git diff --stat --exit-code HEAD && pnpm build && changeset publish"
86+
},
87+
"packageManager": "[email protected]+sha512.2d92c86b7928dc8284f53494fb4201f983da65f0fb4f0d40baafa5cf628fa31dae3e5968f12466f17df7e97310e30f343a648baea1b9b350685dafafffdf5808"
88+
}

0 commit comments

Comments
 (0)