Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
yarnの話.pdf
Search
kaminchu
March 13, 2020
Programming
1
190
yarnの話.pdf
kaminchu
March 13, 2020
Tweet
Share
More Decks by kaminchu
See All by kaminchu
jawsug_niigata_20220115
kaminchu
0
360
React勉強会.pdf
kaminchu
0
350
Web_アプリ_勉強会_FE_BE_.pdf
kaminchu
0
1k
ルーターの選び方その2.pdf
kaminchu
0
830
ルーターの選び方
kaminchu
0
1.2k
NDS56.pdf
kaminchu
0
140
nds54
kaminchu
0
250
internet
kaminchu
0
3.1k
Other Decks in Programming
See All in Programming
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
190
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
120
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
710
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
680
AI巻き込み型コードレビューのススメ
nealle
1
160
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.2k
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
270
Featured
See All Featured
How GitHub (no longer) Works
holman
316
140k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Done Done
chrislema
186
16k
Music & Morning Musume
bryan
47
7.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
KATA
mclloyd
PRO
34
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Designing Experiences People Love
moore
144
24k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
73
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
410
Transcript
yarn の話 JSON ⽇の⾦曜⽇@新潟 14 週⽬ 1
⾃⼰紹介 ツイッター @kam1nchu 仕事 インフラエンジニア よく⾏く勉強会 JAWS-UG 新潟⽀部 好きな⾔語 Typescript
2
yarn は知ってますか? 3
npm の名前の違うやつです 4
おわり 5
ではなくて 6
npm にはない( かもしれない) 便利そうな 機能を いくつか紹介します 7
コマンドライン系 8
npm scripts yarn の場合、 run が省略可能です # npm の場合 $
npm run build # yarn の場合 $ yarn build 9
autoclean yarn install や yarn add 時に、 node_modules 以下の設定したファイル を消してくれます
# .yarnclean の⽣成 $ yarn autoclean --init # パッケージの追加と同時に、*.md とかの不要ファイルが消える $ yarn add express 10
check package.json が yarn.lock と⼀致するか検証してくれます # 普通にチェック $ yarn check
# ハッシュ値までチェック $ yarn check --integrity 11
create create-react-app みたいなやつ ( 指定できるkit ⼀覧の探し⽅はよくわかってない) # react のテンプレ作ってくれる $
yarn create react-app my-app 12
import yarn じゃないプロジェクトで、 node_modules いじらないようにいい感 じに yarn.lock 作ってくれるやつ( っぽい) ※
うまく⾃分で検証できてないので、⾃信ない $ yarn import 13
init package.json をいい感じにつくるやつ # 対話形式 $ yarn init # とりあえず作っちゃいたいとき
$ yarn init --yes # private: true を追加できる $ yarn init --private 14
licenses 全パッケージのライセンスが⾒れる $ yarn licenses list 15
licenses 全パッケージのライセンスが⾒れる $ yarn licenses list 16
upgrade-interactive 神ツール インストールされてるすべてのパッケージを( インタラクティブに) 最 新にできる。 package.json に書かれてるバージョンも書き換得ることができる。 # package.json
のバージョン範囲での最新にする $ yarn upgrade-interactive # レジストリにある最新にする。package.json も書き変わる。 $ yarn upgrade-interactive --latest 17
why 「なんでこのパッケージが?」を解決できる # 誰だよ、lodash ⼊れたやつ $ yarn why lodash 18
package.json 系 19
resolutions パッケージに含まれる依存パッケージが脆弱性がある!!依存パッケ ージだけ最新にしたい!!!!!って時に使える。 { "name": "project", "version": "1.0.0", "dependencies": {
"left-pad": "1.0.0", "example_package": "^1.0.0" }, "resolutions": { "example_package/**/left-pad": "1.1.1" } } 20
workspace Lerna みたいなやつ(Lerna 知らんけど) 。 package.json の中に workspaces を記述することで、ディレクトリの中のプロジェクトを node_module
へのリンクにできます。 詳しくはリンクを読んで!! https://classic.yarnpkg.com/ja/docs/cli/workspace https://classic.yarnpkg.com/ja/docs/workspaces 21
ファイル系 22
.yarnrc yarn の動作を制御できます。 CLI の引数をいじれるのとかはちょっと便利そう。 --install.check-files true を⼊れると、 yarn install
--check-files と同じになる 詳しくはリンクをみて!! https://classic.yarnpkg.com/ja/docs/yarnrc 23
おわり 24