Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
yarnの話.pdf
Search
kaminchu
March 13, 2020
Programming
210
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
yarnの話.pdf
kaminchu
March 13, 2020
More Decks by kaminchu
See All by kaminchu
jawsug_niigata_20220115
kaminchu
0
380
React勉強会.pdf
kaminchu
0
370
Web_アプリ_勉強会_FE_BE_.pdf
kaminchu
0
1.1k
ルーターの選び方その2.pdf
kaminchu
0
880
ルーターの選び方
kaminchu
0
1.3k
NDS56.pdf
kaminchu
0
160
nds54
kaminchu
0
280
internet
kaminchu
0
3.1k
Other Decks in Programming
See All in Programming
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
30
14k
カツオ、ご期待ください
suneo3476
0
130
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
250
iOSDCのペンライトを自動制御したい!
akkeylab
0
330
JRuby: Past, Present, and Future
headius
0
220
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.7k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1k
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
280
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
400
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
4
460
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
110
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
420
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
590
A better future with KSS
kneath
240
18k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
380
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Site-Speed That Sticks
csswizardry
13
1.5k
The Pragmatic Product Professional
lauravandoore
37
7.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
590
sira's awesome portfolio website redesign presentation
elsirapls
0
430
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
350
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
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