Skip to content

Commit

Permalink
chore: Replace package manager yarn to pnpm (#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicstone authored Sep 19, 2024
1 parent beaeb18 commit 336eafd
Show file tree
Hide file tree
Showing 15 changed files with 16,571 additions and 19,708 deletions.
10 changes: 1 addition & 9 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = 1

exclude_patterns = ["/.cache/**/*", "/.yarn/**/*", "/public/**/*", "/src/generated/**/*"]
exclude_patterns = ["/.cache/**/*", "/pnpm-lock.yaml", "/public/**/*", "/src/generated/**/*"]

[[analyzers]]
name = "shell"
Expand All @@ -12,11 +12,3 @@ enabled = true

[analyzers.meta]
plugins = ["react"]

[[transformers]]
name = "prettier"
enabled = true

[[transformers]]
name = "standardjs"
enabled = true
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.cache
.yarn
pnpm-lock.yaml
public
src/generated
static
Expand Down
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/.cache linguist-generated=true
/.yarn linguist-generated=true
/public/* linguist-generated=true
/src/generated/* linguist-generated=true
/yarn.lock linguist-generated=true
/pnpm-lock.yaml linguist-generated=true
12 changes: 8 additions & 4 deletions .github/workflows/deploy-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ jobs:
token: ${{ secrets.GH_PAT_CHECKOUT }}
submodules: "recursive"

- uses: pnpm/action-setup@v4
with:
version: 9.7.0

- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "yarn"
cache: "pnpm"

- uses: actions/cache/restore@v4
with:
Expand All @@ -39,9 +43,9 @@ jobs:
restore-keys: |
gatsby-v1-
- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- run: yarn build
- run: pnpm run build
env:
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
Expand All @@ -54,7 +58,7 @@ jobs:
role-duration-seconds: 7200
mask-aws-account-id: true

- run: yarn deploy
- run: pnpm run deploy
env:
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/deploy-to-stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ jobs:
token: ${{ secrets.GH_PAT_CHECKOUT }}
submodules: "recursive"

- uses: pnpm/action-setup@v4
with:
version: 9.7.0

- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "yarn"
cache: "pnpm"

- uses: actions/cache/restore@v4
with:
Expand All @@ -40,9 +44,9 @@ jobs:
restore-keys: |
gatsby-v1-
- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- run: yarn build
- run: pnpm run build
env:
# "bucketName" is a required option for gatsby-plugin-s3
AWS_S3_BUCKET_NAME: "example"
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ jobs:
token: ${{ secrets.GH_PAT_CHECKOUT }}
submodules: "recursive"

- uses: pnpm/action-setup@v4
with:
version: 9.7.0

- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "yarn"
cache: "pnpm"

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- run: yarn typecheck
- run: pnpm run typecheck

- run: yarn lint
- run: pnpm run lint
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn lint && yarn format
pnpm run lint && pnpm run format
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sonar.exclusions=.cache/**/*,.yarn/**/*,/public,src/generated/**/*
sonar.exclusions=.cache/**/*,/pnpm-lock.yaml,/public,src/generated/**/*
925 changes: 0 additions & 925 deletions .yarn/releases/yarn-4.5.0.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,56 +110,56 @@ Gatsby.js + Amazon CloudFront (Cloud Functions) + Amazon S3 を用いた Jamstac
### ローカルサーバーを立ち上げ

```shell
yarn develop
pnpm run develop
```

### プロダクションビルド

```shell
yarn build
pnpm run build
```

### プロダクションとしてサーバーを立ち上げ

```shell
yarn build
yarn serve
pnpm run build
pnpm run serve
```

### キャッシュのクリア

```shell
yarn clean
pnpm run clean
```

### リンターによる静的解析

```shell
yarn lint
pnpm run lint
```

### リンターによる静的解析(自動修正モード)

```shell
yarn lint:fix
pnpm run lint:fix
```

### TypeScript による型検証

```shell
yarn typecheck
pnpm run typecheck
```

### GraphQL の型情報を取り込む

```shell
yarn graphql
pnpm run graphql
```

### amazon s3 への deploy

```shell
yarn deploy
pnpm run deploy
```

## 動作対象ブラウザ
Expand Down
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@
"serve": "gatsby serve --port 20014",
"clean": "gatsby clean",
"lint": "eslint --cache --ignore-path .eslintignore --ext .js,.ts,.tsx .",
"lint:fix": "yarn lint --fix",
"lint:fix": "pnpm run lint --fix",
"format": "prettier --cache --ignore-path .eslintignore --write .",
"graphql": "graphql-codegen",
"typecheck": "tsc -p . --noEmit",
"deploy": "gatsby-plugin-s3 deploy",
"prepare": "husky"
"prepare": "husky",
"preinstall": "npx only-allow pnpm"
},
"dependencies": {
"@emotion/is-prop-valid": "1.3.0",
"@emotion/react": "11.13.3",
"@emotion/styled": "11.13.0",
"@mui/icons-material": "5.16.7",
"@mui/lab": "5.0.0-alpha.173",
"@mui/material": "5.16.7",
"@mui/utils": "6.1.0",
"@sentry/browser": "8.30.0",
"bicstone": "1.4.0",
"date-fns": "3.6.0",
Expand Down Expand Up @@ -91,8 +94,11 @@
"last 3 iOS major versions"
],
"volta": {
"node": "20.17.0"
},
"engines": {
"node": "20.17.0",
"yarn": "4.5.0"
"pnpm": "9.7.0"
},
"packageManager": "[email protected].0"
"packageManager": "[email protected].0"
}
Loading

0 comments on commit 336eafd

Please sign in to comment.