Skip to content

Commit

Permalink
chore: パッケージマネージャーをpnpmに移行する (#574)
Browse files Browse the repository at this point in the history
* chore: pnpmを導入

* chore: yarn.lockを削除

* chore: npmで実行していたスクリプトをpnpmで実行する

* chore: GitHub Actionsのワークフローでpnpmを使う

* chore: renovateのpostUpdateOptionsをpnpm向けに変更

* chore: .gitignoreのコメントを修正

* docs: READMEを修正

* docs: npmへのリンクをpnpmへのリンクに差し替え
  • Loading branch information
ibulog authored Nov 18, 2024
1 parent e7ea912 commit 6b10e13
Show file tree
Hide file tree
Showing 10 changed files with 6,953 additions and 5,530 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/publishRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,28 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
registry-url: 'https://registry.npmjs.org'
- uses: pnpm/action-setup@v4
- name: git config
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- run: yarn install --frozen-lockfile
- run: yarn release
- run: pnpm install --frozen-lockfile
- run: pnpm release
if: ${{ env.IS_PRERELEASE == 'false' }}
- run: yarn release --prerelease
- run: pnpm release --prerelease
if: ${{ env.IS_PRERELEASE == 'true' }}
- run: npm publish
- run: pnpm publish
if: ${{ env.IS_PRERELEASE == 'false' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --tag prerelease
- run: pnpm publish --tag prerelease
if: ${{ env.IS_PRERELEASE == 'true' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: echo NEW_TAG=$(git describe) >> $GITHUB_ENV
- run: git push origin $NEW_TAG
- run: npx ts-node ./scripts/getLatestChangelog.ts > ${{ env.CHANGELOG_PATH }}
- run: pnpm dlx ts-node ./scripts/getLatestChangelog.ts > ${{ env.CHANGELOG_PATH }}
- name: create release on GitHub
uses: actions/create-release@v1
env:
Expand All @@ -62,5 +63,5 @@ jobs:
- name: craete pull request
uses: peter-evans/create-pull-request@v7
with:
title: "chore(release): ${{ env.NEW_TAG }}"
branch: "merge-release-${{ env.NEW_TAG }}"
title: 'chore(release): ${{ env.NEW_TAG }}'
branch: 'merge-release-${{ env.NEW_TAG }}'
7 changes: 4 additions & 3 deletions .github/workflows/startRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v4
- name: git config
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand All @@ -39,13 +40,13 @@ jobs:
BASE_TAG=v$(npx -c 'echo "$npm_package_version"')
git checkout $BASE_TAG
git merge --no-edit ${{ github.ref }}
- run: yarn install --frozen-lockfile
- run: pnpm install --frozen-lockfile
- name: release dry run
if: ${{ env.IS_PRERELEASE == 'false' }}
run: yarn release:dryrun > ${{ env.RESULT_PATH }}
run: pnpm release:dryrun > ${{ env.RESULT_PATH }}
- name: prerelease dry run
if: ${{ env.IS_PRERELEASE == 'true' }}
run: yarn release:dryrun --prerelease > ${{ env.RESULT_PATH }}
run: pnpm release:dryrun --prerelease > ${{ env.RESULT_PATH }}
- name: wrap dry run log
run: |
echo "Dry Run Log:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ jobs:
with:
node-version: 18

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Install dependencies
run: yarn install
run: pnpm install

- name: Test
run: yarn test
run: pnpm test

- name: Build
run: yarn build
run: pnpm build
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties

# use yarn
# use pnpm
package-lock.json

# env
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ SmartHRらしい文書を書くための、textlintルールプリセットを

## インストール

Install with [npm](https://www.npmjs.com/):
Install with [pnpm](https://pnpm.io/):

npm install textlint-rule-preset-smarthr
pnpm install textlint-rule-preset-smarthr

## 使い方

Expand All @@ -24,7 +24,7 @@ textlint --rule preset-smarthr README.md
TypeScriptのソースコードは`src/`フォルダに書くことができます。

```
npm run build
pnpm run build
```

### Tests
Expand All @@ -33,7 +33,7 @@ npm run build
testの詳細は[textlint-tester](https://github.com/textlint/textlint/tree/master/packages/textlint-tester)を参照してください。

```
npm test
pnpm test
```
### 基本設定

Expand Down
2 changes: 1 addition & 1 deletion example/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package-lock=false
lockfile=false
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
"type": "git",
"url": "git+https://github.com/kufu/textlint-rule-preset-smarthr.git"
},
"engines": {
"pnpm": "=9.13.2"
},
"scripts": {
"example": "cd example && npm it",
"example": "cd example && pnpm it",
"test:textlint-scripts": "textlint-scripts test",
"test:dict": "textlint --config test/.textlintrc README.md",
"test": "npm run test:dict && npm run test:textlint-scripts",
"test": "pnpm run test:dict && pnpm run test:textlint-scripts",
"build": "textlint-scripts build",
"prepublishOnly": "npm run --if-present build",
"prepublishOnly": "pnpm run --if-present build",
"release": "standard-version",
"release:dryrun": "standard-version --dry-run"
},
Expand Down Expand Up @@ -78,5 +81,6 @@
},
"author": "SmartHR textlint Team",
"license": "MIT",
"description": "SmartHRらしい文書を書くための、textlintルールプリセットを提供します。"
"description": "SmartHRらしい文書を書くための、textlintルールプリセットを提供します。",
"packageManager": "[email protected]+sha256.ccce81bf7498c5f0f80e31749c1f8f03baba99d168f64590fc7e13fad3ea1938"
}
Loading

0 comments on commit 6b10e13

Please sign in to comment.