-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: yarn ではなく pnpm を使うように変更 #4186
Conversation
✅ Deploy Preview for smarthr-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
05d2065
to
f84adae
Compare
548a539
to
fdbe9d7
Compare
Netlify が爆破されたら rebase してプルリクオープンします |
fdbe9d7
to
108aee3
Compare
check-source: | ||
steps: | ||
- run: yarn audit --groups dependencies | ||
- run: yarn lint | ||
- run: pnpm audit --prod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn audit --groups dependencies
と同等のものに変更しています。
https://pnpm.io/ja/cli/audit#--prod--p
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
cache: 'pnpm' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
キャッシュに関してはこれだけで良さそうでした。
https://pnpm.io/ja/continuous-integration#github-actions
"pnpm": { | ||
"overrides": { | ||
"@babel/helper-compilation-targets": "^7.23.6", | ||
"@types/react": "^18.2.55", | ||
"minimist": "1.2.8", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn の resolutions
と同等の記述になります。
https://pnpm.io/ja/package_json#pnpmoverrides
@@ -1,6 +1,6 @@ | |||
{ | |||
"extends": ["github>kufu/renovate-config"], | |||
"npm": { | |||
"postUpdateOptions": ["yarnDedupeHighest"] | |||
"postUpdateOptions": ["pnpmDedupe"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"compilerOptions": { | ||
// stories.tsx で発生する下記のエラーを避けるため、tsconfig.json ではなくこちらで `"declaration": true` を指定 | ||
// https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189 | ||
"declaration": true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下記の条件に当てはまる変数部分でエラーが発生してしまっていました。(エラーが発生していたのは .stories.tsx のファイル)
tsconfig.json
で"declaration": true
となっている- infer を使った型推論がされている
- export されている
これは、 yarn から pnpm に切り替えたことで、 node_modules の管理方式が hoisted から isolated によって発生したものです。
詳しい説明は下記の issue に書いてあります。
microsoft/TypeScript#47663 (comment)
"declaration": true
はビルド時に型ファイルを吐き出すかどうかの設定ですが、storybook が参照する tsconfig.json
でこれが true になっている必要はないので、tsconfig.build.json
側でその指定をするように変更しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pnpm install
して pnpm dev
で問題なく動作することを確認しました!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
あぁ、何らかの auto-merge がされてしまったのか |
ab66a7e
to
e9c3924
Compare
Related URL
Overview
T/O
What I did
corepack 対応は別プルリクでやります!
Capture