Skip to content
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: bun -> yarn #25

Merged
merged 14 commits into from
Mar 28, 2024
Merged

Conversation

KinjiKawaguchi
Copy link
Member

@KinjiKawaguchi KinjiKawaguchi commented Mar 26, 2024

やったこと

  • bun -> yarn

※yarn を使うなら bun は不要なので closes #19

Copy link
Collaborator

@h-takeyeah h-takeyeah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bun を yarn にしたときの手順、具体的にどんな作業を行ったかを記録のために取っておいて訂正、このPRにログなどをベターっと貼っちゃってください。

あと、これは質問なのですが、emotionなどが依存関係に追加されたのはなぜですか(そもそも必要なの?っていうのと、PRの内容と違くない?っていう2つの意味で)

@KinjiKawaguchi
Copy link
Member Author

以降の際にchakra周りで不具合が出ちゃったので、一旦chakraをすべて吹き飛ばしてドキュメント通り(今までは違った)インスコしたので付いてきた感じです

@h-takeyeah
Copy link
Collaborator

なるほど

@h-takeyeah
Copy link
Collaborator

h-takeyeah commented Mar 26, 2024

手元に 4faf42e を pull してきて、node_modulesなどが残っている状態で yarn のバージョンを v4 に上げてみました。

前提として、4faf42e は以下の感じでした

  • yarn.lock の先頭のあたりに # yarn lockfile v1 と書かれている
  • bun.lockb は削除されている

この状態で下記のコマンドを実行しました。

corepack enable
corepack prepare yarn@stable --activate
yarn -v # 4.1.1
yarn set version stable # ここで package.json に "packageManger" フィールドが書き込まれた
yarn install

ちらっと書いた package.json の変更はこんな感じです。

{
  // 末尾に追加された
  "packageManager": "[email protected]"
}

特に最後の yarn install に関してはログに「マイグレートしたで」と出ていたのが興味深いです。共有します。

$ yarn install
➤ YN0087: Migrated your project to the latest Yarn version 🚀

➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @chakra-ui/react@npm:2.8.2, @emotion/react@npm:11.11.4, @emotion/styled@npm:11.11.0, and 593 more.
➤ YN0000: └ Completed in 12s 99ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 499 packages were added to the project (+ 294.09 MiB).
➤ YN0000: └ Completed in 14s 720ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 16s 58ms
➤ YN0000: · Done in 43s 99ms

このとき、yarn.lockが更新されました。v1の表記は消えています。

# This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!

__metadata:
  version: 8
  cacheKey: 10c0

(略)

また同時に新しく .yarnrc.yml が作成されました。このファイルは設定ファイルです。

nodeLinker: node-modules

nodeLinker という設定は https://yarnpkg.com/features/linkers この文書が詳しいです。

@KinjiKawaguchi
Copy link
Member Author

バージョン指定と、その後yarnコマンドのログ

➜  typing-app git:(feat/front/bun-to-yarn-migration) ✗                      
corepack enable
corepack prepare yarn@stable
yarn set version stable
Preparing yarn@stable...
➤ YN0000: Downloading https://repo.yarnpkg.com/4.1.1/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.1.1.cjs
➤ YN0000: Done in 0s 88ms
➜  typing-app git:(feat/front/bun-to-yarn-migration) ✗ yarn
➤ YN0087: Migrated your project to the latest Yarn version 🚀

➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @chakra-ui/react@npm:2.8.2, @emotion/react@npm:11.11.4, @emotion/styled@npm:11.11.0, @radix-ui/react-slot@npm:1.0.2, and 592 more.
➤ YN0000: └ Completed in 2s 657ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 44 packages were added to the project (+ 8.15 MiB).
➤ YN0000: └ Completed in 0s 696ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 2s 890ms
➤ YN0000: · Done in 6s 308ms
➜  typing-app git:(feat/front/bun-to-yarn-migration) ✗ 

Copy link
Collaborator

@h-takeyeah h-takeyeah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ログ提出ありがとうございました

@h-takeyeah
Copy link
Collaborator

コミット追加しました 🦖

上の2つは yarnpkg 公式からの情報をもとにしていて、上はここ which-files-should-be-gitignored 、その下は同じページおよび create-next-app すると作成される .gitattributes がそれぞれソース 🍝 になります 📝

h-takeyeah
h-takeyeah previously approved these changes Mar 28, 2024
Copy link
Collaborator

@h-takeyeah h-takeyeah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!! 👍 😸

@KinjiKawaguchi KinjiKawaguchi force-pushed the feat/front/bun-to-yarn-migration branch from c9aaec0 to e2e84ed Compare March 28, 2024 04:38
@h-takeyeah h-takeyeah self-requested a review March 28, 2024 04:41
Copy link
Collaborator

@h-takeyeah h-takeyeah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今度こそ

@KinjiKawaguchi KinjiKawaguchi merged commit 0a9abe3 into develop Mar 28, 2024
1 check passed
@h-takeyeah h-takeyeah deleted the feat/front/bun-to-yarn-migration branch March 29, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants