タグ

yarnに関するsukka9のブックマーク (5)

  • node_modulesの問題点とその歴史 npm, yarnとpnpm

    皆さんnpmパッケージのバージョンを上げるときにハマって依存地獄から抜けられなかったことはありませんか? 私はあります。 複雑怪奇な依存関係を調べてみようとnode_modulesを覗いてみて、そのカオスっぷりに臭いものに蓋をしたことはありませんか? 私はあります。 そこでnode_modules以下について調べてみたのですが、node_modulesにどんな問題点があって、npmやyarn, pnpmは何を目指していたのか時系列順に紐解いた方がわかりやすいことに気づきました。 ここでは初期のnpmが抱えていた問題から今に至るまでを順を追って説明します。 するとnode_modulesの仕組みの他に、各パッケージマネージャの方針の違いが見えてくるはずです。 初期の頃のnpm (~2015年以前) この頃はシンプルで、依存関係はそのままnode_modulesのディレクトリ構造に反映されてい

    node_modulesの問題点とその歴史 npm, yarnとpnpm
  • yarn v3 の独自機能を避けつつ yarn v1 から v3 へのアップグレードをする

    yarn v3 が出ました。詳しい解説は譲るとして、esbuild integration や パフォーマンス向上が目玉です。 Yarn 3.0 🚀🤖 Performances, ESBuild, Better Patches, ... - DEV Community 流石に v1 はもう古いが、 v2 からの独自路線は受け付けがたい…という立場なのですが(yarn オリジナル作者の sebmck も難色を示しています)、今回は yarn 特有の機能をできるだけ避けて、できるだけ npm や pnpm 等と互換な部分だけで yarn v3 を使います。なので pnp も使いません。eslintvscodetypescript 等でハマりどころが多すぎます。 ゼロインストールも否定派です。git blob objects のサイズが爆発して仕事にならなくなったことがあります。

    yarn v3 の独自機能を避けつつ yarn v1 から v3 へのアップグレードをする
  • yarn-deduplicate(1) で yarn.lock の重複エントリを最適化する - Islands in the byte stream

    追記(2019/03/18): yarn-toolsからyarn-deduplicateが独立して使いやすくなり、 --strategy でdedupeの方法を選べるようになっています。タイトルも変更しました。 yarnpkg(1) を使って依存関係を管理しているとき、 yarnpkg upgrade-interactive は対話的にライブラリのアップデートができるので大変便利です。しかし、これを実行すると yarn.lock に不必要に重複エントリが作られることがよくあります。 nodejsで実行するケースでは重複があっても問題がないことが多いのですが、 クライアントサイドでは重複があると単純にファイルサイズが大きくなり。また、@types/* や react, jquery といったフレームワークはどの環境でも動作に問題が出たりするので、重複エントリは問題です*1。そこで今までは、

    yarn-deduplicate(1) で yarn.lock の重複エントリを最適化する - Islands in the byte stream
  • NPM vs Yarn Cheat Sheet

    Okay, so you’ve heard about this new JavaScript package manager called yarn, installed it with npm i -g yarn, and now you want to know how to use it? For the most part if you know NPM, you’re already set! Here are the key notes for switching. 👍 Feel free to bookmark this article, as it will update often as yarn grows. Cheat Sheet — What you need to knownpm install === yarn Install is the default

    NPM vs Yarn Cheat Sheet
  • Home page | Yarn

    Yarn is a package manager that doubles down as project manager. Whether you work on simple projects or industry monorepos, whether you're an open source developer or an enterprise user, Yarn has your back. This documentation covers Yarn 4+. For the previous documentation dedicated to 3.6 and below, please refer to v3.yarnpkg.com. WorkspacesFirst package manager built specifically around workspaces

    Home page | Yarn
  • 1