yarn.lock
ã§ãµããŒããããããšãçºè¡šããç¬éããã圌ãã¯ç§ã«äœåºŠãåã質åãããŸãããããã¯æ¬¡ã®ããã«èãããŸããpackage-lock.json
ãã ãã䜿çšããªãã®ã¯ãªãyarn.lock
ã§ããïŒã
ãã®è³ªåã«å¯Ÿããç°¡åãªçãã¯æ¬¡ã®ãšããã§ãããnpmã®ããŒãºãå®å
šã«æºãããŠããªãããã§ããããã ãã«äŸåããŠããå Žåãããã¯npmã®æé©ãªããã±ãŒãžã€ã³ã¹ããŒã«ã¹ããŒã ã圢æããæ©èœãšããããžã§ã¯ãã«æ°ããæ©èœãè¿œå ããæ©èœãäœäžãããŸãããã®è³æã§ã¯ããã詳现ãªåçã瀺ããŠããŸãã
yarn.lock
yarn.lockãã¡ã€ã«ã®åºæ¬æ§é
ãã®ãã¡ã€ã«
yarn.lock
ã¯ãããã±ãŒãžäŸåé¢ä¿æå®åãšããããã®äŸåé¢ä¿ã®è§£æ±ºã説æããã¡ã¿ããŒã¿ã®å¯Ÿå¿ã®èª¬æã§ããäŸãã°ïŒ
mkdirp@1.x:
version "1.0.2"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.2.tgz#5ccd93437619ca7050b538573fc918327eba98fb"
integrity sha512-N2REVrJ/X/jGPfit2d7zea2J1pf7EAR5chIUcfHffAZ7gmlam5U65sAm76+o4ntQbSRdTjYf7qZz3chuHlwXEA==
ãã®ã¹ããããã¯æ¬¡ã®ããã«è¿°ã¹ãŠããŸãïŒãäŸåé¢ä¿ã¯
mkdirp@1.x
ããã§æå®ããããšããã«æ£ç¢ºã«è§£æ±ºããå¿
èŠããããŸãããè€æ°ã®ããã±ãŒãžãã«äŸåããŠããå Žåmkdirp@1.x
ããããã®äŸåé¢ä¿ã¯ãã¹ãŠåãæ¹æ³ã§è§£æ±ºãããŸãã
npm 7ã§ã¯ããããžã§ã¯ãã«ãã¡ã€ã«ãååšããå Žå
yarn.lock
ãnpmã¯ãã®ãã¡ã€ã«ã«å«ãŸããã¡ã¿ããŒã¿ã䜿çšããŸãããã£ãŒã«ãå€resolved
ã¯ãããã±ãŒãžãã©ãããããŠã³ããŒãããå¿
èŠãããããnpmã«éç¥ããŸãããã£ãŒã«ãå€ã¯ãintegrity
äœãåä¿¡ããããããã§ãã¯ããŠãåä¿¡ãäºæããããã®ãšäžèŽããããšã確èªããããã«äœ¿çšãããŸããããã±ãŒãžããããžã§ã¯ãã«è¿œå ãŸãã¯ãããžã§ã¯ãããåé€ããããšãããã«å¿ããŠã³ã³ãã³ããæŽæ°ããyarn.lock
ãŸãã
åæã«ã以åãšåæ§ã«ãnpmã¯ãã¡ã€ã«ãäœæããŸã
package-lock.json
... ãã®ãã¡ã€ã«ããããžã§ã¯ãã«ååšããå ŽåãäŸåãã¡ã€ã«ã®æ§é ïŒãã©ãŒã ïŒã«é¢ããä¿¡é Œã§ããæ
å ±æºãšããŠäœ¿çšãããŸãã
ããã§ã®è³ªåã¯ãã
yarn.lock
Yarnã®ããã±ãŒãžãããŒãžã£ãŒã«ãšã£ãŠååãªãã®ã§ããå Žåãnpmããã®ãã¡ã€ã«ã䜿çšã§ããªãã®ã¯ãªãã§ããïŒãã§ãã
確å®çäŸåé¢ä¿ã®ã€ã³ã¹ããŒã«çµæ
Yarnã䜿çšããŠããã±ãŒãžãã€ã³ã¹ããŒã«ããçµæã¯ãåããã¡ã€ã«
yarn.lock
ãšåãããŒãžã§ã³ã®Yarn ã䜿çšããŠãåãã§ããããšãä¿èšŒãããŠããŸããç°ãªãããŒãžã§ã³ã®Yarnã䜿çšãããšãããã±ãŒãžãã¡ã€ã«ããã£ã¹ã¯äžã§ç°ãªãå Žæã«é
眮ãããå¯èœæ§ããããŸãã
ãã¡ã€ã«
yarn.lock
ã¯ã確å®çãªäŸåé¢ä¿ã®è§£æ±ºãä¿èšŒããŸããããšãã°ãã§foo@1.x
èš±å¯ãããŠããå Žåfoo@1.2.3
ãåããã¡ã€ã«ã䜿çšãããšyarn.lock
ãããã¯ãã¹ãŠã®ããŒãžã§ã³ã®Yarnã§åžžã«çºçããŸããããããããã¯ïŒå°ãªããšãããèªäœã§ïŒäŸåé¢ä¿ããªãŒã®æ§é ã®ç¢ºå®æ§ãä¿èšŒããããšãšåçã§ã¯ãããŸããïŒ
次ã®äŸåé¢ä¿ã°ã©ããèããŠã¿ãŸãã
root -> (foo@1, bar@1)
foo -> (baz@1)
bar -> (baz@2)
次ã«ãããã€ãã®äŸåé¢ä¿ããªãŒå³ã瀺ããŸãããããããæ£ãããšèŠãªãããšãã§ããŸãã
ããªãŒçªå·1ïŒ
root
+-- foo
+-- bar
| +-- baz@2
+-- baz@1
ããªãŒçªå·2ïŒ
+-- foo
| +-- baz@1
+-- bar
+-- baz@2
ãã¡ã€ã«
yarn.lock
ã¯ãã©ã®ç¹å®ã®äŸåé¢ä¿ããªãŒã䜿çšããããéç¥ã§ããŸãããroot
ã³ãã³ããããã±ãŒãžå
ã§å®è¡ãããå Žårequire(«baz»)
ïŒãã®äŸåé¢ä¿ã¯äŸåé¢ä¿ããªãŒã«åæ ãããªããããããã¯æ£ãããããŸããïŒããã¡ã€ã«yarn.lock
ã¯ãã®æäœã®æ£ããå®è¡ãä¿èšŒããŸãããããã¯ããã¡ã€ã«ãäžããããšã®ã§ãã確å®æ§ã®åœ¢åŒã§ãããäžããããšã¯ã§ãpackage-lock.json
ãŸããyarn.lock
ã
å®éã«ã¯ããã¡ãããã€ãŒã³ä»¥æ¥ããã¡ã€ã«
yarn.lock
ãäŸåé¢ä¿ã®é©åãªããŒãžã§ã³ãéžæããããã«å¿
èŠãªãã¹ãŠã®æ
å ±ãããã誰ããåãããŒãžã§ã³ã®Yarnã䜿çšããŠããéããéžæã¯ç¢ºå®çã§ããã€ãŸããããŒãžã§ã³ã®éžæã¯åžžã«åãæ¹æ³ã§è¡ãããŸããã³ãŒãã¯ã誰ããå€æŽãããŸã§å€æŽãããŸããã Yarnã¯ååã«ã€ã³ããªãžã§ã³ãã§ãããããäŸåé¢ä¿ããªãŒãäœæãããšãã«ãããã±ãŒãžãããã§ã¹ãã®èªã¿èŸŒã¿æéã«é¢ããäžäžèŽã«äŸåããªãããšã«æ³šæããŠãã ãããããã§ãªããã°ãçµæã®ç¢ºå®æ§ã¯ä¿èšŒãããŸããã
ããã¯Yarnã¢ã«ãŽãªãºã ã®è©³çŽ°ã«ãã£ãŠæ±ºå®ããããã£ã¹ã¯äžã®ããŒã¿æ§é ïŒäœ¿çšãããã¢ã«ãŽãªãºã ãèå¥ããªãïŒã«ãã£ãŠæ±ºå®ãããªãããããã®æ±ºå®è«ã®ä¿èšŒã¯ã
package-lock.json
ãã£ã¹ã¯ã«æ ŒçŽãããŠããäŸåé¢ä¿ããªãŒã®æ§é ã®å®å
šãªèª¬æãå«ãŸããŠããŸãã
ã€ãŸããYarnãäŸåé¢ä¿ããªãŒãæ§ç¯ããæ¹æ³ã¯
yarn.lock
ãYarnèªäœã®ãã¡ã€ã«ãšå®è£
ã«åœ±é¿ãããŸãããããŠnpmã§ã¯ããã¡ã€ã«ã®ã¿ãäŸåé¢ä¿ããªãŒã«åœ±é¿ããŸãpackage-lock.json
ãããpackage-lock.json
ã«ãããç°ãªãããŒãžã§ã³ã®npmã§èª¬æãããŠããããã«ã誀ã£ãŠãããžã§ã¯ãæ§é ãå£ãããšãé£ãããªããŸãããã¡ã€ã«ã«å€æŽãå ããããå ŽåïŒèª€ã£ãŠããŸãã¯æå³çã«ïŒãããŒãžã§ã³ç®¡çã·ã¹ãã ã䜿çšãããããžã§ã¯ããªããžããªã«å€æŽãããããŒãžã§ã³ãè¿œå ãããšããããã®å€æŽããã¡ã€ã«ã«æ確ã«è¡šç€ºãããŸãã
ãã¹ããããäŸåé¢ä¿ãšäŸåé¢ä¿ã®éè€æé€
ããã«ããã¡ã€ã«ã
yarn.lock
äŸåé¢ä¿ã®è§£æ±ºã®çµæãæ£ç¢ºã«åæ ã§ãããå®éã«ã¯npmã§äœ¿çšãããå Žåããã¹ããããäŸåé¢ä¿ã®æäœãšäŸåé¢ä¿ã®éè€æé€ã䌎ãç¶æ³ã®ã¯ã©ã¹å
šäœããããŸããããã«ãããã¯npmãyarn.lock
ã¡ã¿ããŒã¿ããœãŒã¹ãšããŠäœ¿çšããå Žåã«ãåœãŠã¯ãŸããŸãã npmã¯ããyarn.lock
ãä¿¡é Œã§ããæ
å ±æºãšããŠäœ¿çšããŸãããnpmã¯ãã®ãã¡ã€ã«ãäŸåé¢ä¿ããŒãžã§ã³ã«èª²ãããå¶éã«é¢ããä¿¡é Œã§ããæ
å ±æºãšã¯èŠãªããŸããã
å Žåã«ãã£ãŠã¯ãYarnãéåžžã«é«ãã¬ãã«ã®ãã±ããéè€ãæã€äŸåé¢ä¿ããªãŒãäœæãããããäžèŠã«ãªããŸãããã®çµæããã®ãããªå Žåã«ç³žã®ã¢ã«ãŽãªãºã ãæ£ç¢ºã«ãã©ãããšã¯çæ³ããã»ã©é ãããšãããããŸããã
次ã®äŸåé¢ä¿ã°ã©ããèããŠã¿ãŸãã
root -> (x@1.x, y@1.x, z@1.x)
x@1.1.0 -> ()
x@1.2.0 -> ()
y@1.0.0 -> (x@1.1, z@2.x)
z@1.0.0 -> ()
z@2.0.0 -> (x@1.x)
ãããžã§ã¯ãã
root
äŸåãã1.x
ããã±ãŒãžã®ããŒãžã§ã³x
ãy
ããã³z
ãããã±ãŒãžy
ã¯x@1.1
ããã³ã«äŸåãz@2.x
ãŸããz
ããŒãžã§ã³1ã®ããã±ãŒãžã«ã¯äŸåé¢ä¿ã¯ãããŸããããåãããŒãžã§ã³2ã®ããã±ãŒãžã¯ã«äŸåããŠãx@1.x
ãŸãã
ãã®æ å ±ã«åºã¥ããŠãnpmã¯æ¬¡ã®äŸåé¢ä¿ããªãŒãçæããŸãã
root (x@1.x, y@1.x, z@1.x) <-- x@1.x
+-- x 1.2.0 <-- x@1.x 1.2.0
+-- y (x@1.1, z@2.x)
| +-- x 1.1.0 <-- x@1.x 1.1.0
| +-- z 2.0.0 (x@1.x) <-- x@1.x
+-- z 1.0.0
ããã±ãŒãž
z@2.0.0
ã¯äŸåããŸãx@1.x
ããåãããšãèšãroot
ãŸãããã¡ã€ã«yarn.lock
ã¯x@1.x
cã«ããããããŸã1.2.0
ããã ããããã±ãŒãžã®äŸåé¢ä¿ïŒz
ããã瀺ãããŠããx@1.x
å ŽåïŒã¯ä»£ããã«è§£æ±ºãããŸãx@1.1.0
ã
ãã®çµæãäŸåé¢ä¿
x@1.x
ã¯ã§èª¬æãyarn.lock
ããŠããŸãããããã±ãŒãžããŒãžã§ã³1.2.0
ã§èš±å¯ããå¿
èŠãããããšã瀺ãããŠããŸãããããã±ãŒãžããŒãžã§ã³ã§ã¯2çªç®ã®è§£æ±ºçµæx@1.x
ããããŸã1.1.0
ã
ãã©ã°ãä»ããŠnpmãå®è¡ãããšã
--prefer-dedupe
ã·ã¹ãã ã¯ããã«äžæ©é²ãã§ãäŸåé¢ä¿ã®ã€ã³ã¹ã¿ã³ã¹ã1ã€ã ãã€ã³ã¹ããŒã«ããŸãx
ãããã«ããã次ã®äŸåé¢ä¿ããªãŒã圢æãããŸãã
root (x@1.x, y@1.x, z@1.x)
+-- x 1.1.0 <-- x@1.x 1.1.0
+-- y (x@1.1, z@2.x)
| +-- z 2.0.0 (x@1.x)
+-- z 1.0.0
ããã«ãããäŸåé¢ä¿ã®éè€ãæå°éã«æããããçµæã®äŸåé¢ä¿ããªãŒããã¡ã€ã«ã«ã³ããããããŸã
package-lock.json
ã
ãã¡ã€ã«
yarn.lock
ã¯äŸåé¢ä¿ã解決ãããé åºã®ã¿ããã£ããã£ããçµæã®ããã±ãŒãžããªãŒã¯ãã£ããã£ããªããããYarnã¯æ¬¡ã®ãããªäŸåé¢ä¿ããªãŒãçæããŸãã
root (x@1.x, y@1.x, z@1.x) <-- x@1.x
+-- x 1.2.0 <-- x@1.x 1.2.0
+-- y (x@1.1, z@2.x)
| +-- x 1.1.0 <-- x@1.x 1.1.0
| +-- z 2.0.0 (x@1.x) <-- x@1.1.0 , ...
| +-- x 1.2.0 <-- Yarn , yarn.lock
+-- z 1.0.0
x
Yarnã䜿çšãããšã
ããã±ãŒãžãäŸåé¢ä¿ããªãŒã«3å衚瀺ãããŸããè¿œå èšå®ãªãã§npmã䜿çšããå Žå-2åããã©ã°ã䜿çšããå Žå--prefer-dedupe
-äžåºŠã ãïŒãã ããäŸåé¢ä¿ããªãŒã¯ããã±ãŒãžã®ææ°ããŒãžã§ã³ã§ã¯ãªããæé©ãªããŒãžã§ã³ã§ããããŸããïŒã
çµæãšããŠåŸããã3ã€ã®äŸåé¢ä¿ããªãŒã¯ãã¹ãŠãåããã±ãŒãžãæå®ãããèŠä»¶ãæºããäŸåé¢ä¿ã®ããŒãžã§ã³ãåãåããšããæå³ã§æ£ãããšèŠãªãããšãã§ããŸãããã ããéè€ãå€ãããããã±ãŒãžããªãŒã¯äœæããŸããã
x
ãããã©ããªãããèããŠãã ãã-ããã¯ããèªèº«ã®å€ãã®äŸåé¢ä¿ãæã€å€§ããªããã±ãŒãžã§ãïŒ
ãã®çµæã確å®çã§åçŸå¯èœãªäŸåé¢ä¿ããªãŒã®äœæããµããŒãããªãããnpmãããã±ãŒãžããªãŒãæé©åã§ããå¯äžã®æ¹æ³ããããŸãããã®æ¹æ³ã¯ãããã¯ãã¡ã€ã«ã®äœ¿çšã«ãããŸããããã¯ãã¡ã€ã«ã®äœæããã³äœ¿çšã®åçã¯ãåºæ¬çãªã¬ãã«ã§ã¯ãšã¯ç°ãªã
yarn.lock
ãŸãã
ãŠãŒã¶ãŒã€ã³ãã³ãã®å®è£ çµæã®èšé²
ãã§ã«è¿°ã¹ãããã«ãnpm 7ã§ã¯ããŠãŒã¶ãŒã¯ãã©ã°
--prefer-dedupe
ã䜿çšããŠäŸåé¢ä¿ããªãŒçæã¢ã«ãŽãªãºã ãé©çšã§ããŸãããã®ã¢ã«ãŽãªãºã ã§ã¯ãäŸåé¢ä¿ã®éè€æé€ãåªå
ãããåžžã«ææ°ããŒãžã§ã³ã®ããã±ãŒãžãã€ã³ã¹ããŒã«ããå¿
èŠã¯ãããŸããããã©ã°ã®äœ¿çšã¯--prefer-dedupe
éåžžããã±ããã®éè€ãæå°éã«æããå¿
èŠãããç¶æ³ã§çæ³çã§ãã
ãã®ãã©ã°ã䜿çšãããšãäžèšã®äŸã®çµæã®ããªãŒã¯æ¬¡ã®ããã«ãªããŸãã
root (x@1.x, y@1.x, z@1.x) <-- x@1.x
+-- x 1.1.0 <-- x@1.x 1.1.0
+-- y (x@1.1, z@2.x)
| +-- z 2.0.0 (x@1.x) <-- x@1.x
+-- z 1.0.0
ãã®å Žåãnpmã¯
x@1.2.0
ãèŠä»¶ãæºããã®ã¯ããã±ãŒãžã®ææ°ããŒãžã§ã³ã§ãããx@1.x
代ããã«éžæããããšã¯ããªãå¯èœã§ãããšå€æããŸãx@1.1.0
ããã®ããŒãžã§ã³ãéžæãããšãäŸåé¢ä¿ããªãŒå
ã®ããã±ãŒãžã®éè€ãå°ãªããªããŸãã
ããã¯ãã¡ã€ã«ã®äŸåé¢ä¿ããªãŒã®æ§é ãä¿®æ£ããªãã£ãå ŽåãããŒã å ã®ãããžã§ã¯ãã§äœæ¥ããåããã°ã©ããŒã¯ãããŒã ã®ä»ã®ã¡ã³ããŒãã»ããã¢ããããã®ãšåãæ¹æ³ã§äœæ¥ç°å¢ãã»ããã¢ããããå¿ èŠããããŸããããã ãã§ã圌ã¯ä»ã®äººãšåãçµæãåŸãããšãã§ããŸããäŸåé¢ä¿ããªãŒæ§ç¯ã¡ã«ããºã ã®ãå®è£ ããåæ§ã®æ¹æ³ã§å€æŽã§ããå Žåãããã¯npmãŠãŒã¶ãŒã«ãç¹å®ã®ããŒãºã«åºã¥ããŠäŸåé¢ä¿ãæé©åããããã®æ·±å»ãªæ©äŒãäžããŸãããã ããããªãŒã®äœæçµæãã·ã¹ãã ã®å®è£ ã«äŸåããŠããå Žåã¯ã確å®çãªäŸåé¢ä¿ããªãŒãäœæã§ããªããªããŸããããã¯ãã¡ã€ã«ã®äœ¿çšããããããã®
yarn.lock
ã§ãã
é«åºŠãªnpmèšå®ãããŸããŸãªäŸåé¢ä¿ããªãŒã®äœæã«ã©ã®ããã«ã€ãªãããã瀺ãããã€ãã®äŸã次ã«ç€ºããŸãã
--legacy-peer-deps
ãnpmã«å®å šã«ç¡èŠããããã©ã°peerDependencies
ã--legacy-bundling
ãäŸåããªãŒãããããã©ãããã«ããããšãã¹ãã§ã¯ãªãããšãnpmã«äŒãããã©ã°ã--global-style
ããã¹ãŠã®æšç§»çãªäŸåé¢ä¿ãäžäœã¬ãã«ã®äŸåé¢ä¿ãã©ã«ããŒã§ãã¹ããããäŸåé¢ä¿ãšããŠèšå®ãããããã®ãã©ã°ã
äŸåé¢ä¿ã®è§£æ±ºã®çµæã®ãã£ããã£ãšä¿®æ£ãããã³äŸåé¢ä¿ããªãŒãçæããã¡ã«ããºã ãã«ã¹ã¿ãã€ãºããæ©èœããŠãŒã¶ãŒã«æäŸããå Žåãåãã¢ã«ãŽãªãºã ã䜿çšããŠäŸåé¢ä¿ããªãŒãçæãããšããæåŸ ã¯ãç¶æ³ã«å¿ããŠæ©èœããŸããã
å®æããäŸåé¢ä¿ããªãŒã®æ§é ãä¿®æ£ããããšã§ããŠãŒã¶ãŒã«ãã®ãããªæ©äŒãäžããåæã«æ±ºå®è«çã§åçŸå¯èœãªäŸåé¢ä¿ããªãŒãæ§ç¯ããããã»ã¹ãäžæãããªãããã«ããããšãã§ããŸãã
ããã©ãŒãã³ã¹ãšããŒã¿ã®å®å šæ§
ãã®ãã¡ã€ã«ã¯
package-lock.json
ãäŸåé¢ä¿ããªãŒã®ç¢ºå®æ§ãšåçŸæ§ãä¿èšŒããå¿
èŠãããå Žåã ãã§ãªãã圹ã«ç«ã¡ãŸãããŸãããã®ãã¡ã€ã«ã䜿çšããŠããã±ãŒãžã®ã¡ã¿ããŒã¿ã远跡ããã³ä¿åããpackage.json
npmã¬ãžã¹ããªã®äœ¿çšã«è²»ããããæéã倧å¹
ã«ç¯çŽããŸãããã¡ã€ã«ã®å¯èœæ§ã¯yarn.lock
éåžžã«éãããŠããããã絶ããããŠã³ããŒãããå¿
èŠã®ããã¡ã¿ããŒã¿ã¯ãããŸããã
npm 7ã§ã¯ããã¡ã€ã«ã«
package-lock.json
ã¯npmããããžã§ã¯ãã®äŸåé¢ä¿ããªãŒãå®å
šã«æ§ç¯ããããã«å¿
èŠãªãã¹ãŠã®ãã®ãå«ãŸããŠããŸãã npm 6ã§ã¯ããã®ããŒã¿ã¯ããŸã䟿å©ã«ä¿åãããªããããå€ãããã¯ãã¡ã€ã«ãçºçããå Žåãã·ã¹ãã ã«è¿œå ã®äœæ¥ãããŒãããå¿
èŠããããŸãããããã¯1ã€ã®ãããžã§ã¯ãã«å¯ŸããŠ1åã ãå®è¡ãããŸãã
çµæãšããŠã
yarn.lock
äŸåé¢ä¿ããªãŒã®æ§é ã«é¢ããæ
å ±ãèšé²ãããŠããå Žåãå¥ã®ãã¡ã€ã«ã䜿çšããŠè¿œå ã®ã¡ã¿ããŒã¿ãä¿åããå¿
èŠããããŸãã
å°æ¥ã®æ©äŒ
ããã§èª¬æããŠããããšã¯ããã£ã¹ã¯ã«äŸåé¢ä¿ãé 眮ããããã®ããŸããŸãªæ°ããã¢ãããŒããèæ ®ãããšãåçã«å€åããå¯èœæ§ããããŸãããããã¯ãpnpmãyarn 2 / berryãããã³PnP Yarnã§ãã
npm 8ã«åãçµãã§ããç§ãã¡ã¯ãä»®æ³ãã¡ã€ã«ã·ã¹ãã ã«åºã¥ããŠäŸåé¢ä¿ããªãŒãæ§ç¯ããæ¹æ³ãæ¢æ±ããŸãããã®ã¢ã€ãã¢ã¯Tinkã§ã¢ãã«åãããã³ã³ã»ããã¯2019幎ã«æ€èšŒãããŸãããpnpmã§äœ¿çšãããæ§é ã®ãããªãã®ã«åãæ¿ãããšããã¢ã€ãã¢ã«ã€ããŠãè°è«ããŠããŸãããããã¯ããæå³ã§ã¯ãä»®æ³ãã¡ã€ã«ã·ã¹ãã ã䜿çšãããããåçãªå€åã§ãã
ãã¹ãŠã®äŸåé¢ä¿ãäœããã®äžå€®ãªããžããªã«ããããã¹ããããäŸåé¢ä¿ãã·ã³ããªãã¯ãªã³ã¯ãŸãã¯ä»®æ³ãã¡ã€ã«ã·ã¹ãã ã®ã¿ã§è¡šãããŠããå ŽåãäŸåé¢ä¿ããªãŒã®æ§é ã®ã¢ãã«åã¯ãããã»ã©éèŠãªåé¡ã§ã¯ãããŸããããã ãããã¡ã€ã«ã§æäŸã§ãã以äžã®ã¡ã¿ããŒã¿ãå¿ èŠ
yarn.lock
ã§ãããã®ãããpackage-lock.json
ãžã®å®å
šãªç§»è¡ããããæ¢åã®ãã¡ã€ã«åœ¢åŒãæŽæ°ããŠåçåããæ¹ãçã«ããªã£ãŠããŸãyarn.lock
ã
ããã¯ããyarn.lockã®å±éºæ§ã«ã€ããŠããšåŒã¶ããšãã§ããèšäºã§ã¯ãããŸããã
ç§ãç¥ã£ãŠããããšãããã€ãŒã³ã¯ç¢ºå®ã«æ£ãããããžã§ã¯ãäŸåé¢ä¿ããªãŒãçæããããšãææããããšæããŸãããŸããç¹å®ã®ããŒãžã§ã³ã®YarnïŒå·çæç¹ã§ã¯ãããã¯ãã¹ãŠã®æ°ããããŒãžã§ã³ã®Yarnã«é©çšãããŸãïŒã®å Žåããããã®ããªãŒã¯ãnpmãšåæ§ã«å®å šã«ç¢ºå®çã§ãã
ãã®ãã¡ã€ã«ã¯
yarn.lock
ãåãããŒãžã§ã³ã®Yarnã䜿çšããŠç¢ºå®çãªäŸåé¢ä¿ããªãŒãäœæããã®ã«ååã§ããããããå€ãã®ããŒã«ã§åæ§ã®ã¡ã«ããºã ã䜿çšããŠãããããããã±ãŒãžãããŒãžã£ãŒã®å®è£
ã«äŸåããã¡ã«ããºã ã«äŸåããããšã¯ã§ããŸãããããã¯ããã¡ã€ã«åœ¢åŒã®å®è£
ãyarn.lock
æ£åŒã«ã¯ã©ãã«ãææžåãããŠããŸããã ïŒããã¯Yarnã«åºæã®åé¡ã§ã¯ãããŸãããnpmã§ãåãç¶æ³ãçºçããŸããããã¡ã€ã«åœ¢åŒã®ææžåã¯ããªãæ·±å»ãªä»äºã§ããïŒ
å³å¯ã«æ±ºå®ãããäŸåé¢ä¿ããªãŒã®æ§ç¯ã®ä¿¡é Œæ§ãä¿èšŒããæè¯ã®æ¹æ³ã¯ãé·æçã«ã¯äŸåé¢ä¿ã®è§£æ±ºçµæãä¿®æ£ããããšã§ããåæã«ãããã±ãŒãžãããŒãžã£ãŒã®å°æ¥ã®å®è£ ã§ã¯ãäŸåé¢ä¿ã解決ãããšãã«ã以åã®å®è£ ãšåããã¹ããã©ããšãã信念ã«é Œãã¹ãã§ã¯ãããŸããããã®ã¢ãããŒãã§ã¯ãæé©åãããäŸåé¢ä¿ããªãŒãæ§ç¯ããèœåãå¶éãããŸãã
äŸåé¢ä¿ããªãŒã®æåã«åºå®ãããæ§é ããã®éžè±ã¯ããŠãŒã¶ãŒã®æ瀺çãªæ¬²æ±ã®çµæã§ããå¿ èŠããããŸãããã®ãããªéžè±ã¯ãäŸåé¢ä¿ããªãŒã®æ§é ã«é¢ãã以åã«èšé²ãããããŒã¿ã«å€æŽãå ããããšã«ãã£ãŠãããèªäœãææžåããå¿ èŠããããŸãã
ã®ã¿
package-lock.json
ããŸãã¯ãã®ãã¡ã€ã«ã®ãããªã¡ã«ããºã ã¯ãnpmã«ãã®ãããªæ©èœãæäŸã§ããŸãã
JavaScriptãããžã§ã¯ãã§ã©ã®ããã±ãŒãžãããŒãžã£ãŒã䜿çšããŠããŸããïŒ