Skip to content

Commit 24b6dcf

Browse files
azuclaude
andauthored
chore: migrate from yarn v1 to pnpm and update GitHub Actions (#155)
* chore: migrate from yarn v1 to pnpm - Update packageManager field in package.json - Convert yarn.lock to pnpm-lock.yaml using pnpm import - Update GitHub Actions workflows to use pnpm - Update test script to use pnpm in example directory - Add persist-credentials: false to checkout actions for security - Add explicit permissions to workflow jobs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * CI: pin GitHub Action version * chore: update Node.js version to 22 in website workflow - Update website.yml to use Node.js 22 (current LTS) instead of 20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * chore: migrate example directory from yarn v1 to pnpm - Add packageManager field to example/package.json - Convert example/yarn.lock to example/pnpm-lock.yaml - Remove example/yarn.lock 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: replace prepublish with prepare script for pnpm compatibility - Remove deprecated prepublish script - Add build command to prepare script to ensure lib directory exists before testing - Fixes CI test failure where example directory couldn't find built files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: use prepublishOnly and explicit build in pretest - Replace prepare script with prepublishOnly for npm publish - Add explicit build to pretest script before running tests - Keep prepare script for git hooks only - Avoids unnecessary builds on every pnpm install 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent ab4aebd commit 24b6dcf

File tree

8 files changed

+8521
-7613
lines changed

8 files changed

+8521
-7613
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@ jobs:
44
test:
55
name: "Test on Node.js ${{ matrix.node-version }}"
66
runs-on: ubuntu-latest
7+
permissions:
8+
contents: read
79
strategy:
810
matrix:
911
node-version: [ 18, 20, 22 ]
1012
steps:
1113
- name: checkout
12-
uses: actions/checkout@v4
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15+
with:
16+
persist-credentials: false
17+
18+
- name: Install pnpm
19+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
1320
- name: setup Node.js ${{ matrix.node-version }}
14-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
1522
with:
1623
node-version: ${{ matrix.node-version }}
1724
- name: Install
18-
run: yarn install
25+
run: pnpm install
1926
- name: Test
20-
run: yarn test
27+
run: pnpm test

.github/workflows/website.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,33 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
1113
steps:
12-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15+
with:
16+
persist-credentials: false
17+
18+
- name: Install pnpm
19+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
1320
- name: Setup Node.js
14-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
1522
with:
16-
node-version: 20
23+
node-version: 22
1724
- name: Set Env
1825
run: |
1926
echo "CURRENT_VERSION=$(node -p 'require("./package.json").version')" >> $GITHUB_ENV
2027
- name: Install
21-
run: yarn install
28+
run: pnpm install
2229
- name: Build
2330
run: |
24-
yarn install
25-
npm run website -- --metadataVersion="${CURRENT_VERSION}"
31+
pnpm install
32+
pnpm run website -- --metadataVersion="${CURRENT_VERSION}"
2633
env:
2734
CURRENT_VERSION: ${{ env.CURRENT_VERSION }}
2835
working-directory: example/
2936
- name: Deploy
30-
uses: peaceiris/actions-gh-pages@v4
37+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
3138
with:
3239
github_token: ${{ secrets.GITHUB_TOKEN }}
3340
publish_dir: ./example/dist

example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
},
1919
"dependencies": {
2020
"textlint-rule-preset-jtf-style": "file:.."
21-
}
21+
},
22+
"packageManager": "[email protected]+sha512.9fb969fa749b3ade6035e0f109f0b8a60b5d08a1a87fdf72e337da90dcc93336e2280ca4e44f2358a649b83c17959e9993e777c2080879f3801e6f0d999ad3dd"
2223
}

0 commit comments

Comments
 (0)