├── -debug.html ├── .babelrc ├── .editorconfig ├── .gitignore ├── .gitmodules ├── .prettierignore ├── .prettierrc ├── .ruby-version ├── .travis.yml ├── 404.html ├── Gemfile ├── Gemfile.lock ├── Makefile ├── README.ja.md ├── README.md ├── _config.yml ├── _data ├── guides.yml ├── i18n │ └── en.yml ├── languages.yml ├── nightly_types.yml └── users.yml ├── _includes ├── additional-reading.html ├── beautify_ms.html ├── debug │ ├── toc.html │ ├── todo.html │ └── url.html ├── docsearch.html ├── footer.html ├── i18n-as-script.html ├── navigation.html ├── news.html ├── page-header.html ├── svg │ ├── discord.svg │ ├── facebook.svg │ ├── github.svg │ ├── language.svg │ ├── twitter.svg │ ├── yarn-kitten-circle.svg │ └── yarn-kitten-full.svg ├── vars.html ├── version-with-upgrade-notice.html └── version.html ├── _layouts ├── default.html ├── guide.html ├── page.html ├── pages │ ├── detail.html │ ├── docs.html │ ├── homepage.html │ ├── install-ci.html │ ├── install.html │ ├── nightly.html │ └── users.html └── post.html ├── _plugins └── file_exists.rb ├── _posts ├── 2016-10-11-introducing-yarn.md ├── 2016-11-24-offline-mirror.md ├── 2016-12-01-lockfiles-for-all.md ├── 2017-02-24-cloudflare-statement.md ├── 2017-05-12-introducing-yarn.md ├── 2017-05-31-determinism.md ├── 2017-06-16-supporting-more-registries.md ├── 2017-06-19-adding-command-line-aliases-for-yarn.md ├── 2017-07-11-lets-dev-a-package-manager.md ├── 2017-07-26-introducing-workspaces.md ├── 2017-09-07-yarn-1-is-here.md ├── 2018-02-15-nohoist.md ├── 2018-04-18-dependencies-done-right.md ├── 2018-05-18-focused-workspaces.md ├── 2018-06-04-yarn-import-package-lock.md └── 2019-07-12-recommended-security-update.md ├── _redirects ├── _sass ├── _404.scss ├── _badges.scss ├── _base.scss ├── _cards.scss ├── _code.scss ├── _copyable.scss ├── _details.scss ├── _docsearch.scss ├── _features.scss ├── _featurettes.scss ├── _footer.scss ├── _guides.scss ├── _heros.scss ├── _highlight.scss ├── _icons.scss ├── _install.scss ├── _navbar.scss ├── _navs.scss ├── _news.scss ├── _readmore.scss ├── _search.scss ├── _tabs.scss ├── _toc.scss └── _users.scss ├── assets ├── detail │ ├── ico-changelog.svg │ ├── ico-commits-last.svg │ ├── ico-commits.svg │ ├── ico-copy-default.svg │ ├── ico-copy-success.svg │ ├── ico-dependencies.svg │ ├── ico-dependents-popular.svg │ ├── ico-dependents.svg │ ├── ico-devdependencies.svg │ ├── ico-download-size.svg │ ├── ico-downloads.svg │ ├── ico-file.svg │ ├── ico-folder.svg │ ├── ico-package-json.svg │ ├── ico-readme.svg │ ├── ico-readmore.svg │ ├── ico-release.svg │ ├── ico-runkit.svg │ ├── ico-size-browser.svg │ ├── ico-size-disk.svg │ └── ico-stargazers.svg ├── feature-reliable.png ├── feature-secure.png ├── feature-speed.png ├── og_image.png ├── posts │ ├── 2016-11-24-offline-mirror │ │ ├── yarn-offline-blog-offline-mirror-list.png │ │ ├── yarn-offline-blog-offline-mirror-size.png │ │ └── yarn-offline-blog-releases.png │ └── 2018-02-15-nohoist │ │ ├── monorepo-2.svg │ │ ├── monorepo-example-1.svg │ │ ├── monorepo-example-file-1-a.svg │ │ ├── monorepo-example-file-2-a.svg │ │ └── standalone-2.svg ├── search.svg ├── search │ ├── ico-bitbucket.svg │ ├── ico-clear.svg │ ├── ico-download.svg │ ├── ico-git.svg │ ├── ico-github.svg │ ├── ico-gitlab.svg │ ├── ico-home.svg │ ├── ico-hot-t1.svg │ ├── ico-hot-t2.svg │ ├── ico-hot-t3.svg │ ├── ico-hot-t4.svg │ ├── ico-npm.svg │ ├── ico-tag.svg │ ├── ico-typescript.svg │ └── ico-yarn.svg └── users │ ├── exponent.svg │ ├── facebook.svg │ └── tilde.svg ├── blog.html ├── crowdin.yaml ├── css └── main.scss ├── favicon.ico ├── index.html ├── install.sh ├── js └── src │ ├── common.js │ ├── components │ ├── Activity.js │ ├── Aside.js │ ├── Cdn.js │ ├── Contributors.js │ ├── Copyable.js │ ├── Deprecated.js │ ├── DetailLinks.js │ ├── Details.js │ ├── Di.js │ ├── Downloads.js │ ├── FileBrowser.js │ ├── GithubActivity.js │ ├── Header.js │ ├── HighlightedMarkdown.js │ ├── Hit.js │ ├── Install.js │ ├── JSONLDItem.js │ ├── Keywords.js │ ├── License.js │ ├── Links.js │ ├── Markdown.js │ ├── Owner.js │ ├── Popularity.js │ ├── ReadMore.js │ ├── Results.js │ ├── Search.js │ ├── SearchBox.js │ ├── Tags.js │ ├── TypeScript.js │ ├── Usage.js │ ├── Versions.js │ └── index.js │ ├── documentation.js │ ├── install.js │ ├── nightly.js │ ├── package.js │ ├── packages.js │ └── util │ ├── config.js │ ├── formatKeywords.js │ ├── highlight.pack.js │ ├── index.js │ ├── production.js │ ├── schema.js │ ├── serviceStatus.js │ └── withUrlSync.js ├── lang └── en │ ├── docs │ ├── _ci │ │ ├── appveyor.md │ │ ├── circle.md │ │ ├── codefresh.md │ │ ├── codeship.md │ │ ├── deb-specific-version.md │ │ ├── gitlab.md │ │ ├── semaphore.md │ │ ├── solano.md │ │ └── travis.md │ ├── _installations │ │ ├── alpine.md │ │ ├── alternatives.md │ │ ├── arch.md │ │ ├── centos.md │ │ ├── debian.md │ │ ├── gentoo.md │ │ ├── mac.md │ │ ├── nightly.md │ │ ├── npm.md │ │ ├── opensuse.md │ │ ├── solus.md │ │ ├── tarball.md │ │ ├── unix_path_setup.md │ │ ├── windows.md │ │ └── windows_path_setup.md │ ├── cli │ │ ├── add.md │ │ ├── audit.md │ │ ├── autoclean.md │ │ ├── bin.md │ │ ├── cache.md │ │ ├── check.md │ │ ├── config.md │ │ ├── create.md │ │ ├── dedupe.md │ │ ├── exec.md │ │ ├── generate-lock-entry.md │ │ ├── global.md │ │ ├── help.md │ │ ├── import.md │ │ ├── index.md │ │ ├── info.md │ │ ├── init.md │ │ ├── install.md │ │ ├── licenses.md │ │ ├── link.md │ │ ├── list.md │ │ ├── lockfile.md │ │ ├── login.md │ │ ├── logout.md │ │ ├── outdated.md │ │ ├── owner.md │ │ ├── pack.md │ │ ├── policies.md │ │ ├── prune.md │ │ ├── publish.md │ │ ├── remove.md │ │ ├── run.md │ │ ├── self-update.md │ │ ├── tag.md │ │ ├── team.md │ │ ├── test.md │ │ ├── unlink.md │ │ ├── upgrade-interactive.md │ │ ├── upgrade.md │ │ ├── version.md │ │ ├── versions.md │ │ ├── why.md │ │ ├── workspace.md │ │ └── workspaces.md │ ├── configuration.md │ ├── creating-a-package.md │ ├── creating-a-project.md │ ├── dependencies.md │ ├── dependency-types.md │ ├── dependency-versions.md │ ├── envvars.md │ ├── getting-started.md │ ├── index.md │ ├── install-ci.md │ ├── install.md │ ├── installing-dependencies.md │ ├── managing-dependencies.md │ ├── migrating-from-npm.md │ ├── nightly.md │ ├── offline-mirror.md │ ├── package-json.md │ ├── pnp.md │ ├── pnp │ │ ├── getting-started.md │ │ └── troubleshooting.md │ ├── prune-offline-mirror.md │ ├── publishing-a-package.md │ ├── selective-version-resolutions.md │ ├── usage.md │ ├── version-control.md │ ├── workspaces.md │ ├── yarn-lock.md │ ├── yarn-workflow.md │ └── yarnrc.md │ ├── index.md │ ├── org │ ├── code-of-conduct.md │ ├── contributing.md │ ├── governance.md │ ├── index.md │ ├── release-process.md │ └── translations.md │ ├── package.html │ ├── packages.html │ └── users.md ├── latest-rc-version ├── latest-version ├── opensearch.xml ├── package.json ├── robots.txt ├── scripts ├── normalize-translations.rb ├── remove-unused-languages.rb ├── set-version.sh ├── sitemaps.js └── validate-translations.rb ├── webpack.config.js └── yarn.lock /-debug.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 | {% for page in site.pages %} 7 |

{{page.path}} ({{page.id}})

8 | 9 | {% if page.layout == "guide" %} 10 | {% include debug/toc.html content=page.content forceRender=true %} 11 | {% endif %} 12 | 13 | {% include debug/todo.html content=page.content forceRender=true %} 14 |
15 | {% endfor %} 16 | 17 |

Redirects

18 |
{% include_relative _redirects %}
19 | 20 |

Pages

21 | 22 | {% assign urls_sorted = site.pages | map: "url" | sort %} 23 | 24 | 29 |
30 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | // webpack understands the native import syntax, and uses it for tree shaking 4 | [ 5 | "env", 6 | { 7 | "modules": false 8 | } 9 | ], 10 | // Specifies what level of language features to activate. 11 | // Stage 2 is "draft", 4 is finished, 0 is strawman. 12 | // See https://tc39.github.io/process-document/ 13 | "stage-2", 14 | // Transpile React components to JavaScript 15 | "react" 16 | ], 17 | "plugins": [ 18 | // Treat React JSX elements as value types and hoist them to the highest scope 19 | "transform-react-constant-elements", 20 | // Turn JSX elements into exploded React objects 21 | "transform-react-inline-elements" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | .sass-cache 3 | .jekyll-metadata 4 | .DS_Store 5 | .idea 6 | 7 | lang/* 8 | !lang/en/ 9 | 10 | _data/i18n/*.yml 11 | !_data/i18n/en.yml 12 | node_modules/ 13 | js/build 14 | _data/webpack.json 15 | .happypack/ 16 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "_sass/bootstrap"] 2 | path = _sass/bootstrap 3 | url = https://github.com/twbs/bootstrap.git 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | js/build 2 | _site 3 | _sass/bootstrap 4 | css/main.scss 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "es5", 4 | "proseWrap": "preserve" 5 | } 6 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.4.3 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | script: 3 | - make crowdin-sync 4 | - git add -A 5 | - git push origin master:gh-pages 6 | -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: 404 4 | description: Page not found. 5 | permalink: /404.html 6 | --- 7 | 8 |
9 |
10 |

404: Page Not Found

11 | 15 | 16 |
17 |
18 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'jekyll' 4 | gem 'jekyll-redirect-from' 5 | gem 'jekyll-paginate' 6 | gem 'crowdin-cli' 7 | gem 'wdm', '>= 0.1.0' if Gem.win_platform? 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: start install serve build i18n-upload i18n-download 2 | 3 | .DEFAULT_GOAL := start 4 | start: 5 | @make install 6 | @make serve 7 | 8 | install: test-builddeps 9 | @git submodule update --init --recursive 10 | @bundle install 11 | @yarn install 12 | 13 | serve: test-builddeps 14 | @yarn start& bundle exec jekyll serve --incremental& wait 15 | 16 | build: test-builddeps 17 | @yarn build 18 | @bundle exec jekyll build 19 | 20 | serve-production: test-builddeps 21 | @make crowdin-download 22 | @NODE_ENV=production yarn build:production 23 | @JEKYLL_ENV=production bundle exec jekyll serve 24 | 25 | build-production: test-builddeps 26 | ifeq ($(CONTEXT), "production") 27 | @make crowdin-download 28 | @ruby ./scripts/validate-translations.rb 29 | endif 30 | @NODE_ENV=production yarn build:production 31 | @JEKYLL_ENV=production bundle exec jekyll build 32 | 33 | crowdin-upload: test-crowdin 34 | @crowdin-cli upload sources --auto-update -b master 35 | 36 | crowdin-download: test-crowdin 37 | @crowdin-cli download -b master | grep -v '^Extracting: ' | grep -v '^ - ' 38 | @ruby ./scripts/remove-unused-languages.rb 39 | @ruby ./scripts/normalize-translations.rb 40 | 41 | ### 42 | # Misc stuff: 43 | ### 44 | 45 | BUNDLE_EXISTS := $(shell command -v bundle 2> /dev/null) 46 | CROWDIN_EXISTS := $(shell command -v crowdin-cli 2> /dev/null) 47 | YARN_EXISTS := $(shell command -v yarn 2> /dev/null) 48 | 49 | test-builddeps: 50 | ifndef BUNDLE_EXISTS 51 | $(error bundler is not installed. Run `gem install bundler`) 52 | endif 53 | ifndef YARN_EXISTS 54 | $(error yarn is not installed. Follow the instructions on https://yarnpkg.com/docs/install) 55 | endif 56 | 57 | test-crowdin: 58 | ifndef CROWDIN_EXISTS 59 | $(error Crowdin is not installed. Run `make install`) 60 | endif 61 | ifndef CROWDIN_API_KEY 62 | $(error CROWDIN_API_KEY is undefined) 63 | endif 64 | -------------------------------------------------------------------------------- /README.ja.md: -------------------------------------------------------------------------------- 1 | Yarn Website 2 | [![Netlify Status](https://api.netlify.com/api/v1/badges/85057564-01fa-49d4-b898-30acb74ae19e/deploy-status)](https://app.netlify.com/sites/yarnpkg/deploys) 3 | ============ 4 | 5 | このリポジトリには、 で入手できるYarn Classic(v1)Webサイトのソースコードが含まれています。 Yarn v2サイトについては、 を参照してください。 6 | 7 | 開始するには: 8 | 9 | ```sh 10 | $ git clone git@github.com:yarnpkg/website.git yarn-website 11 | $ cd yarn-website 12 | ``` 13 | 14 | Yarnと [Bundler](http://bundler.io/) がインストールされていることを確認する必要があります。 15 | ```sh 16 | $ gem install bundler 17 | ``` 18 | 19 | その後: 20 | 21 | ```sh 22 | $ make 23 | ``` 24 | 25 | または: 26 | 27 | ```sh 28 | $ make install 29 | $ make serve 30 | ``` 31 | 32 | Windowsでは、 `make`は使用できないため、` bundle`と `jekyll`を直接実行する必要があります。 33 | 34 | ```sh 35 | bundle install 36 | bundle exec jekyll serve --incremental 37 | ``` 38 | 39 | --- 40 | 41 | **Special thanks to [Netlify](https://www.netlify.com/) for powering the website.** 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Yarn Website 2 | [![Netlify Status](https://api.netlify.com/api/v1/badges/85057564-01fa-49d4-b898-30acb74ae19e/deploy-status)](https://app.netlify.com/sites/yarnpkg/deploys) 3 | ============ 4 | 5 | This repo contains the source code for the Yarn Classic (v1) website, available at https://classic.yarnpkg.com/. For the Yarn v2 site, see https://github.com/yarnpkg/berry/tree/master/packages/docusaurus 6 | 7 | [README in Japanese](README.ja.md) 8 | 9 | In order to get started: 10 | 11 | ```sh 12 | $ git clone git@github.com:yarnpkg/website.git yarn-website 13 | $ cd yarn-website 14 | ``` 15 | 16 | You should ensure you have Yarn and [Bundler](http://bundler.io/) installed: 17 | 18 | ```sh 19 | $ gem install bundler 20 | ``` 21 | 22 | And then: 23 | 24 | ```sh 25 | $ make 26 | ``` 27 | 28 | Or: 29 | 30 | ```sh 31 | $ make install 32 | $ make serve 33 | ``` 34 | 35 | On Windows, `make` is not available, so you need to execute `bundle` and `jekyll` directly: 36 | 37 | ```sh 38 | bundle install 39 | bundle exec jekyll serve --incremental 40 | ``` 41 | 42 | --- 43 | 44 | **Special thanks to [Netlify](https://www.netlify.com/) for powering the website.** 45 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Site settings 2 | title: Yarn 3 | description: > # this means to ignore newlines until "baseurl:" 4 | Fast, reliable, and secure dependency management. 5 | baseurl: "" 6 | url: "https://classic.yarnpkg.com" 7 | twitter_username: yarnpkg 8 | github_username: yarnpkg 9 | 10 | latest_version: 1.22.22 11 | latest_rc_version: 1.22.22 12 | 13 | # Whether to show the RC version on the site. Set this to false if the latest 14 | # stable version is newer than the RC (ie. if an RC has not been released since 15 | # the most recent stable version). 16 | show_rc: false 17 | 18 | # The versions of node that Yarn supports 19 | # This is visible on the install page 20 | node_support: ^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0 21 | 22 | gacode: "UA-85522875-1" 23 | 24 | exclude: 25 | - README.md 26 | - crowdin.yaml 27 | - Gemfile 28 | - Gemfile.lock 29 | - Makefile 30 | - _sass/bootstrap 31 | - .sass-cache 32 | - node_modules 33 | - js/src 34 | 35 | include: 36 | - _redirects 37 | - install.sh 38 | 39 | plugins: 40 | - jekyll-redirect-from 41 | - jekyll-paginate 42 | 43 | # Build settings 44 | markdown: kramdown 45 | kramdown: 46 | input: GFM 47 | syntax_highlighter: rouge 48 | 49 | syntax_highlighter_opts: 50 | css_class: 'rougeHighlight' 51 | span: 52 | line_numbers: false 53 | block: 54 | line_numbers: false 55 | start_line: 1 56 | 57 | sass: 58 | style: compressed 59 | 60 | redcarpet: 61 | extensions: [with_toc_data] 62 | 63 | # Blog Settings 64 | permalink: /blog/:year/:month/:day/:title/ 65 | paginate: 1 66 | 67 | 68 | 69 | 70 | 71 | 72 | # ignore me 73 | __empty_array__: [] 74 | -------------------------------------------------------------------------------- /_data/nightly_types.yml: -------------------------------------------------------------------------------- 1 | # Types of files available as part of the nightly builds 2 | - tar 3 | - deb 4 | - msi 5 | - rpm 6 | - js 7 | #- js-legacy 8 | -------------------------------------------------------------------------------- /_data/users.yml: -------------------------------------------------------------------------------- 1 | - name: Facebook 2 | url: https://www.facebook.com/ 3 | image: facebook.svg 4 | 5 | - name: Exponent 6 | url: https://getexponent.com/ 7 | image: exponent.svg 8 | 9 | - name: Tilde 10 | url: http://www.tilde.io 11 | image: tilde.svg 12 | -------------------------------------------------------------------------------- /_includes/additional-reading.html: -------------------------------------------------------------------------------- 1 | {% assign tags = include.tags %} 2 | 3 | {% include vars.html %} 4 | 5 |
6 | {{i18n.guide_additional_reading}} 7 | {% for tag in tags %} 8 | {% for guide in site.data.guides %} 9 | {% if guide.tags contains tag %} 10 | 11 |
{{i18n[guide.title]}}
12 |

{{i18n[guide.description]}}

13 |
14 | {% break %} 15 | {% endif %} 16 | {% endfor %} 17 | {% endfor %} 18 | 19 | {% for tag in tags %} 20 | {% for guide in site.data.guides %} 21 | {% for page in guide.pages %} 22 | {% if page.tags contains tag %} 23 | 24 |
{{i18n[page.id]}}
25 | {% if page.description %} 26 |

{{i18n[page.description]}}

27 | {% endif %} 28 |
29 | {% break %} 30 | {% endif %} 31 | {% endfor %} 32 | {% endfor %} 33 | {% endfor %} 34 |
35 | -------------------------------------------------------------------------------- /_includes/beautify_ms.html: -------------------------------------------------------------------------------- 1 | {% assign inputL = include.ms %} 2 | 3 | {% assign second = 1000 %} 4 | {% assign minute = second | times: 60 %} 5 | {% assign hour = minute | times: 60 %} 6 | 7 | {% assign hours = inputL | divided_by: hour | round %} 8 | {% assign hoursL = inputL | modulo: hour %} 9 | 10 | {% assign mins = hoursL | divided_by: minute | round %} 11 | {% assign minsL = hoursL | modulo: minute %} 12 | 13 | {% assign secs = minsL | divided_by: second | round %} 14 | {% assign secsL = minsL | modulo: second %} 15 | 16 | {% assign mills = secsL | round %} 17 | 18 | {% if hours != 0 %} 19 | {{hours}} hour{% if hours > 1 %}s{% endif %} 20 | {% endif %} 21 | 22 | {% if mins != 0 %} 23 | {{mins}} minute{% if mins > 1 %}s{% endif %} 24 | {% endif %} 25 | 26 | {% if secs != 0 %} 27 | {{secs}} second{% if secs > 1 %}s{% endif %} 28 | {% endif %} 29 | 30 | {% if mins == 0 %} 31 | {% if mills != 0 %} 32 | {{mills}}ms 33 | {% endif %} 34 | {% endif %} 35 | -------------------------------------------------------------------------------- /_includes/debug/todo.html: -------------------------------------------------------------------------------- 1 | {% assign shouldRender = false %} 2 | 3 | {% if jekyll.environment == "development" %} 4 | {% assign shouldRender = true %} 5 | {% endif %} 6 | 7 | {% if include.forceRender %} 8 | {% assign shouldRender = true %} 9 | {% endif %} 10 | 11 | {% if shouldRender %} 12 | {% if include.content contains '[TODO' %} 13 | {% if include.content %} 14 |
15 |

Yarn Website Internal Developer Info!

16 | 17 |

This page contains some [TODO]'s, if you have time, please complete them

18 | 19 | {% assign lines = include.content | newline_to_br | strip_newlines | split: '
' %} 20 | {% assign total = lines | size %} 21 | 22 | {% for i in (0..total) %} 23 | {% assign line = lines[i] %} 24 | 25 | {% if line contains '[TODO' %} 26 | {% assign message = '' %} 27 | 28 | {% assign start = i | minus: 3 %} 29 | {% assign end = i | plus: 3 %} 30 | 31 | {% if start < 0 %}{% assign start = 0 %}{% endif %} 32 | {% if end > total %}{% assign end = total %}{% endif %} 33 | 34 |
{% for n in (start..end) %}{{n}}: {{lines[n] | escape}}
35 | {% endfor %}
36 | {% endif %} 37 | {% endfor %} 38 | 39 |

40 | If you believe you are seeing this warning by mistake, please open 41 | an issue. 42 |

43 |
44 | {% endif %} 45 | {% endif %} 46 | {% endif %} 47 | -------------------------------------------------------------------------------- /_includes/debug/url.html: -------------------------------------------------------------------------------- 1 | {% assign shouldRender = false %} 2 | 3 | {% if jekyll.environment == "development" %} 4 | {% assign shouldRender = true %} 5 | {% endif %} 6 | 7 | {% if include.forceRender %} 8 | {% assign shouldRender = true %} 9 | {% endif %} 10 | 11 | {% if shouldRender %} 12 | {% if include.url contains "_" %} 13 |
14 |

Yarn Website Internal Developer Info!

15 | 16 |

17 | This page has an incorrectly formatted url. Underscores (_) are not 18 | allowed inside urls, use dashes instead. 19 |

20 | 21 |
{{include.url}}
22 | 23 |

24 | If you believe you are seeing this warning by mistake, please open 25 | an issue. 26 |

27 |
28 | {% endif %} 29 | {% endif %} 30 | -------------------------------------------------------------------------------- /_includes/docsearch.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | This is Algolia docsearch, search of the documentation. See https://community.algolia.com/docsearch/ 3 | Scripts are added in the en/docs/index.html page 4 | {% endcomment %} 5 | 6 |
7 | 11 |
12 | -------------------------------------------------------------------------------- /_includes/footer.html: -------------------------------------------------------------------------------- 1 | {% include vars.html %} 2 | 3 | 4 | 5 |
6 | 25 |
26 | 35 | -------------------------------------------------------------------------------- /_includes/i18n-as-script.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | get the current translations from Jekyll, to be used in scripts 3 | {% endcomment }%} 4 | 25 | -------------------------------------------------------------------------------- /_includes/news.html: -------------------------------------------------------------------------------- 1 | {% include vars.html %} 2 | 3 |
4 | 5 | 6 |
7 |
8 | {{i18n.site_news_important}}: {{i18n.site_news_docs_cover_v1}} 9 |
10 |
11 | {{i18n.site_news_see_v2_docs}} 12 |
13 |
14 |
15 | -------------------------------------------------------------------------------- /_includes/page-header.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yarnpkg/website/f82b8a0a95c10f5c35f00488eb34e953a0f4aa61/_includes/page-header.html -------------------------------------------------------------------------------- /_includes/svg/discord.svg: -------------------------------------------------------------------------------- 1 | 2 | Discord 3 | 4 | 5 | -------------------------------------------------------------------------------- /_includes/svg/facebook.svg: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /_includes/svg/github.svg: -------------------------------------------------------------------------------- 1 | 2 | GitHub 3 | 4 | 5 | -------------------------------------------------------------------------------- /_includes/svg/language.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /_includes/svg/twitter.svg: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /_includes/svg/yarn-kitten-circle.svg: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /_includes/vars.html: -------------------------------------------------------------------------------- 1 | {% capture __vars %} 2 | {% assign vars_url_parts = page.url | split: "/" | shift %} 3 | {% assign vars_url_language = vars_url_parts[1] %} 4 | {% assign vars_url_relative = vars_url_parts | shift | shift | join: "/" | replace: ".html", "" %} 5 | {% assign vars_temp_matched_languages = site.data.languages | where: "tag", vars_url_language %} 6 | {% assign vars_active_language = vars_temp_matched_languages[0] %} 7 | 8 | {% unless vars_active_language %} 9 | {% assign vars_active_language = site.data.languages[0] %} 10 | {% assign vars_production_url_base_language = "" %} 11 | {% else %} 12 | {% assign vars_production_url_base_language = "/" | append: vars_active_language.tag %} 13 | {% endunless %} 14 | 15 | {% assign i18n = site.data.i18n[vars_active_language.tag] %} 16 | 17 | {% if jekyll.environment == "development" %} 18 | {% assign url_base = site.baseurl | append: "/lang/" | append: vars_active_language.tag %} 19 | {% else %} 20 | {% assign url_base = site.baseurl | append: vars_production_url_base_language %} 21 | {% endif %} 22 | {% endcapture %} 23 | -------------------------------------------------------------------------------- /_includes/version-with-upgrade-notice.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | These instructions only cover Yarn versions prior to 2.0. Those versions entered maintenance mode in January 2020 and will eventually reach their end-of-life in terms of support. Please see the main website for the most up-to-date documentation: yarnpkg.com/getting-started/migration. 6 |
7 |
8 | The latest Yarn version is: Latest CLI Release 9 |
10 |
11 |
12 | 13 | {% include version.html %} 14 | -------------------------------------------------------------------------------- /_includes/version.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{i18n.site_nav_stable_version}}: 4 | 5 | 6 | v{{site.latest_version}} 7 | 8 | 9 | {% if site.show_rc %} 10 | 11 | {{i18n.site_nav_rc_version}} 12 | 13 | 14 | v{{site.latest_rc_version}} 15 | 16 | 17 | {% endif %} 18 |
19 |
20 | {{i18n.site_nav_node_support}}: 21 | 22 | {{site.node_support}} 23 | 24 |
25 |
26 | -------------------------------------------------------------------------------- /_layouts/guide.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | --- 4 | 5 | {% include vars.html %} 6 | 7 | {% assign matched_guides = site.data.guides | where: "id", page.guide %} 8 | {% assign current_guide = matched_guides[0] %} 9 | 10 | {% assign guides_size = current_guide.pages | size | plus: 2 %} 11 | 12 | {% for i in (0..guides_size) %} 13 | {% if current_guide.pages[i].id == page.id %} 14 | {% assign guide_prev_index = i | minus: 1 %} 15 | {% assign guide_next_index = i | plus: 1 %} 16 | {% break %} 17 | {% endif %} 18 | {% endfor %} 19 | 20 | {% assign guide_prev = current_guide.pages[guide_prev_index] %} 21 | {% assign guide_next = current_guide.pages[guide_next_index] %} 22 | 23 |
24 |
25 | {% include debug/toc.html content=page.content %} 26 | 27 |
28 | {{content}} 29 |
30 | 31 |
32 |
33 | 34 |
35 | {% if guide_prev_index > -1 %} 36 | 37 | ← 38 | {{i18n[guide_prev.id]}} 39 | 40 | {% endif %} 41 | 42 | {% if guide_next %} 43 | 44 | {{i18n[guide_next.id]}} 45 | → 46 | 47 | {% endif %} 48 |
49 |
50 | 51 | {% if page.additional_reading_tags %} 52 | {% include additional-reading.html tags=page.additional_reading_tags %} 53 | {% endif %} 54 |
55 | 56 |
57 | 72 |
73 |
74 | -------------------------------------------------------------------------------- /_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {% include vars.html %} 6 | 7 |
8 |
9 |

{{i18n[page.id]}}

10 | 11 | {% if layout.hero_subtext %} 12 | {% include {{ layout.hero_subtext }} %} 13 | {% elsif page.hero_subtext %} 14 | {% include {{ page.hero_subtext }} %} 15 | {% endif %} 16 |
17 |
18 | 19 |
20 | {{content}} 21 |
22 | -------------------------------------------------------------------------------- /_layouts/pages/detail.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | {% include vars.html %} 6 | 7 |
8 |
9 |

{{i18n.detail.title}}

10 |
11 |
12 | 13 |
14 | {{content}} 15 |
16 | -------------------------------------------------------------------------------- /_layouts/pages/docs.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | scripts: 4 | - "/js/build/documentation.js" 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 | {% assign guides_size = site.data.guides | size | minus: 1 %} 10 | 11 | {% include docsearch.html %} 12 | 13 | {% for index in (0..guides_size) %} 14 | {% assign index_mod = index | modulo: 3 %} 15 | 16 | {% if index_mod == 0 %} 17 |
18 | {% endif %} 19 | 20 | {% assign guide = site.data.guides[index] %} 21 | 32 | 33 | {% if index_mod == 2 %} 34 |
35 | {% endif %} 36 | {% endfor %} 37 | -------------------------------------------------------------------------------- /_layouts/pages/users.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | --- 4 | 5 | {% include vars.html %} 6 | 7 | 8 | 9 |
10 |
11 |

12 | {{i18n.users_lead}} {{i18n.users_description}} 13 |

14 | 15 |
16 | {% for user in site.data.users %} 17 |
18 |
19 | 20 | {{user.name}} 21 | 22 |
23 | {% endfor %} 24 |
25 | 26 |
27 |
28 | {{i18n.users_add_prompt}} 29 | 30 | {{i18n.users_add_pr}} 31 | 32 |
33 | 34 | 35 | {{i18n.users_add_requirements_image}} 36 |
37 | {{i18n.users_add_requirements_logo}} 38 |
39 |
40 |
41 |
42 |
43 | -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 |
7 |

{{page.title}}

8 |
9 |
10 | 11 |
12 |
13 |
14 |

15 | Posted {{page.date | date: "%b %-d, %Y"}} by 16 | {% if page.author_url %} 17 | {{page.author}} 18 | {% else %} 19 | {{page.author}} 20 | {% endif %} 21 | {% if page.meta %} · {{page.meta}}{% endif %} 22 |

23 | 24 | {{content}} 25 |
26 |
27 |
28 | -------------------------------------------------------------------------------- /_plugins/file_exists.rb: -------------------------------------------------------------------------------- 1 | # source: https://github.com/michaelx/jekyll_file_exists/blob/dd363223754836a640de81ddab68fd95cebe7791/file_exists.rb 2 | module Jekyll 3 | class FileExistsTag < Liquid::Tag 4 | 5 | def initialize(tag_name, path, tokens) 6 | super 7 | @path = path 8 | end 9 | 10 | def render(context) 11 | # Pipe parameter through Liquid to make additional replacements possible 12 | url = Liquid::Template.parse(@path).render context 13 | 14 | # Adds the site source, so that it also works with a custom one 15 | site_source = context.registers[:site].config['source'] 16 | dir_name = File.dirname(context.environments.first["page"]["path"]) 17 | file_path = File.join(site_source, dir_name, url.strip) 18 | 19 | # Check if file exists (returns true or false) 20 | "#{File.exist?(file_path)}" 21 | end 22 | end 23 | end 24 | 25 | Liquid::Template.register_tag('file_exists', Jekyll::FileExistsTag) 26 | -------------------------------------------------------------------------------- /_posts/2016-10-11-introducing-yarn.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout : post 3 | title : "Yarn: A new package manager for JavaScript" 4 | author : Sebastian McKenzie, Christoph Pojer, James Kyle 5 | author_url : "https://twitter.com/yarnpkg" 6 | date : 2016-10-11 8:00:00 7 | categories : announcements 8 | share_text : "Yarn: A new package manager for JavaScript" 9 | --- 10 | 11 | We're pleased to announce the open source release of Yarn, a collaboration between [Facebook][], [Exponent][], [Google][], and [Tilde][]. With Yarn, engineers still have access to the npm registry, but can install packages more quickly and manage dependencies consistently across machines or in secure offline environments. Yarn enables engineers to move faster and with confidence when using shared code so they can focus on what matters — building new products and features. Read the full announcement on [code.facebook.com](https://code.facebook.com/posts/1840075619545360). 12 | 13 | [facebook]: https://www.facebook.com/facebook/about/ 14 | [exponent]: https://expo.io/about 15 | [google]: https://about.google/ 16 | [tilde]: https://www.tilde.io/about-us/ 17 | -------------------------------------------------------------------------------- /_posts/2017-09-07-yarn-1-is-here.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout : post 3 | title : "Yarn 1.0 is Here" 4 | author : Burak Yigit Kaya 5 | author_url : "https://twitter.com/madbyk" 6 | date : 2017-09-07 8:00:00 7 | categories : announcements 8 | share_text : "Yarn 1.0: Workspaces, auto-merging lockfiles, selective versions resolutions" 9 | --- 10 | 11 | After a long wait, [Yarn 1.0 is out](https://code.facebook.com/posts/274518539716230)! 12 | -------------------------------------------------------------------------------- /_posts/2019-07-12-recommended-security-update.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout : post 3 | title : "Recommended security update" 4 | author : "Maël Nison" 5 | author_url : "https://twitter.com/arcanis" 6 | date : 2019-07-12 23:44:03 7 | categories : announcements 8 | share_text : "Recommended security update" 9 | --- 10 | 11 | We've been made aware of a potential attack vector in the way some data are stored in the lockfile. We recommend to [upgrade](https://yarnpkg.com/en/docs/install) Yarn to the latest 1.17.3 release as soon as you get the chance. We also recommend you to edit your lockfiles to replace any reference to the `http:` protocol: 12 | 13 | ``` 14 | $ sed -i '' 's/http:/https:/g' yarn.lock 15 | ``` 16 | 17 | ## What happened? 18 | 19 | The Yarn registry is just a DNS alias to the npm registry. For a few months in 2018, the npm registry [returned http urls instead of the regular https ones](https://npm.community/t/some-packages-have-dist-tarball-as-http-and-not-https/285/40). Although the problem seems to have been corrected earlier this year, the lockfile entries generated during this period may still reference http urls and cause Yarn to send unencrypted authentication data over the network. 20 | 21 | ## What's the mitigation? 22 | 23 | Starting from the 1.17.3, regardless of what the registries return, we'll enforce https on the three most common hostnames: `*.yarnpkg.com`, `*.npmjs.org`, and `*.npmjs.com`. Additionally, starting from the v2, we'll rethink our default policies to make using http [require an explicit acknowledgement](https://github.com/yarnpkg/berry/issues/293) of some form. 24 | 25 | -- 26 | 27 | Thanks to [@skovorodan](https://twitter.com/skovorodan) (operating on behalf of [Exodus](https://www.exodus.io/)) for the heads-up. 28 | -------------------------------------------------------------------------------- /_sass/_404.scss: -------------------------------------------------------------------------------- 1 | #goog-fixurl ul { 2 | margin: 0; 3 | padding: 0; 4 | list-style: none; 5 | } 6 | 7 | #goog-fixurl form { 8 | margin-top: 1rem; 9 | @extend .form-inline; 10 | } 11 | 12 | #goog-fixurl .other-things { 13 | display: none; 14 | } 15 | 16 | #goog-fixurl input[type='text'] { 17 | @extend .form-control; 18 | @extend .float-md-left; 19 | margin-right: 0.5rem; 20 | } 21 | 22 | #goog-fixurl input[type='submit'] { 23 | @extend .btn; 24 | @include button-outline-variant($yarn-blue-darkest); 25 | color: white; 26 | } 27 | -------------------------------------------------------------------------------- /_sass/_badges.scss: -------------------------------------------------------------------------------- 1 | .badge { 2 | -webkit-font-smoothing: antialiased; 3 | } 4 | -------------------------------------------------------------------------------- /_sass/_cards.scss: -------------------------------------------------------------------------------- 1 | a.card { 2 | display: block; 3 | color: inherit; 4 | text-decoration: none; 5 | 6 | &:hover { 7 | border-color: rgba(0, 0, 0, 0.2); 8 | } 9 | 10 | &:hover .text-primary { 11 | text-decoration: underline; 12 | } 13 | } 14 | 15 | .guide-card { 16 | .card-text { 17 | @include media-breakpoint-up('lg') { 18 | min-height: $line-height-base * $font-size-base * 5; 19 | } 20 | 21 | @include media-breakpoint-up('xl') { 22 | min-height: $line-height-base * $font-size-base * 4; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /_sass/_copyable.scss: -------------------------------------------------------------------------------- 1 | .copyable { 2 | display: flex; 3 | width: 100%; 4 | background-color: $gray-lighter; 5 | padding: 1em; 6 | margin: 0.5em 0 0.5em; 7 | 8 | &--content { 9 | flex-grow: 1; 10 | background: none; 11 | color: #666666; 12 | min-width: 0; 13 | overflow: hidden; 14 | text-overflow: ellipsis; 15 | white-space: nowrap; 16 | } 17 | 18 | &--button { 19 | background: none; 20 | border: none; 21 | border-radius: 0; 22 | color: #666666; 23 | white-space: nowrap; 24 | cursor: pointer; 25 | 26 | &:focus { 27 | outline: none; 28 | } 29 | 30 | &__img { 31 | height: 1em; 32 | width: 1em; 33 | margin-right: 0.3em; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /_sass/_docsearch.scss: -------------------------------------------------------------------------------- 1 | /** Algolia DocSearch **/ 2 | 3 | .search-input { 4 | padding: 1rem 1.5rem 1rem 2.5rem; 5 | background: white url('/assets/search.svg') no-repeat 1rem center; 6 | background-size: 1rem 1rem; 7 | } 8 | 9 | .algolia-autocomplete { 10 | width: 100%; 11 | 12 | .ds-dropdown-menu { 13 | min-width: unset !important; 14 | max-width: unset !important; 15 | width: 100% !important; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /_sass/_features.scss: -------------------------------------------------------------------------------- 1 | .feature { 2 | margin: 3rem 0; 3 | } 4 | 5 | .feature-image[width] { 6 | max-width: attr(width); 7 | } 8 | 9 | .feature-divider { 10 | margin: 3rem 0; 11 | } 12 | 13 | .feature-heading { 14 | font-size: 2.4rem; 15 | font-weight: 300; 16 | line-height: 1; 17 | letter-spacing: -0.05rem; 18 | margin-bottom: 1rem; 19 | 20 | span { 21 | display: inline-block; 22 | } 23 | } 24 | 25 | .feature-text { 26 | font-weight: 300; 27 | font-size: 1.1rem; 28 | color: $text-muted-er; 29 | } 30 | 31 | @include media-breakpoint-up('sm') { 32 | .feature-text { 33 | font-size: 1.3rem; 34 | } 35 | } 36 | 37 | @include media-breakpoint-down('md') { 38 | .feature-image { 39 | max-height: 340px; 40 | width: auto; 41 | } 42 | } 43 | 44 | @include media-breakpoint-up('md') { 45 | .feature-heading { 46 | font-size: 2.6rem; 47 | } 48 | 49 | .feature-image-speed { 50 | margin-bottom: -30px; 51 | } 52 | 53 | .feature-image-secure { 54 | margin-bottom: -30px; 55 | } 56 | } 57 | 58 | @include media-breakpoint-up('lg') { 59 | .feature-heading { 60 | font-size: 2.8rem; 61 | } 62 | 63 | .feature-image-secure { 64 | margin-top: -60px; 65 | margin-bottom: -60px; 66 | } 67 | } 68 | 69 | @include media-breakpoint-up('xl') { 70 | .feature-heading { 71 | margin-top: 3.5rem; 72 | } 73 | 74 | .feature-divider { 75 | margin: 5rem 0; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /_sass/_featurettes.scss: -------------------------------------------------------------------------------- 1 | .featurette { 2 | margin-top: 2rem; 3 | margin-bottom: 2rem; 4 | 5 | h2 { 6 | color: $gray; 7 | font-weight: 300; 8 | } 9 | 10 | p { 11 | color: $text-muted-er; 12 | font-weight: 300; 13 | font-size: 1.1rem; 14 | } 15 | } 16 | 17 | @include media-breakpoint-up('md') { 18 | .featurette { 19 | height: 8rem; 20 | margin-top: 0; 21 | margin-bottom: 3rem; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /_sass/_footer.scss: -------------------------------------------------------------------------------- 1 | .footer { 2 | } 3 | 4 | .footer-divider { 5 | margin: 3rem 0; 6 | } 7 | 8 | @include media-breakpoint-down('xs') { 9 | .footer-right { 10 | margin-top: 1rem; 11 | padding-top: 1rem; 12 | border-top: 1px solid $gray-lighter; 13 | } 14 | } 15 | 16 | @include media-breakpoint-up('sm') { 17 | .footer-left { 18 | float: left; 19 | } 20 | 21 | .footer-right { 22 | float: right; 23 | text-align: right; 24 | } 25 | } 26 | 27 | @include media-breakpoint-down('md') { 28 | .footer-item { 29 | display: block; 30 | } 31 | } 32 | 33 | @include media-breakpoint-up('lg') { 34 | .footer-item + .footer-item::before { 35 | padding-left: 0.25em; 36 | padding-right: 0.25em; 37 | content: ' · '; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /_sass/_guides.scss: -------------------------------------------------------------------------------- 1 | .guide-content, 2 | .blog-content { 3 | line-height: 1.7; 4 | 5 | p { 6 | margin-bottom: 1.2rem; 7 | } 8 | 9 | h1, 10 | h2, 11 | h3, 12 | h4, 13 | h5, 14 | h6, 15 | .h1, 16 | .h2, 17 | .h3, 18 | .h4, 19 | .h5, 20 | .h6 { 21 | margin-top: 2rem; 22 | margin-bottom: 1.2rem; 23 | 24 | code { 25 | background: $yarn-blue; 26 | color: $code-bg; 27 | font-weight: 600; 28 | -webkit-font-smoothing: antialiased; 29 | } 30 | } 31 | 32 | blockquote { 33 | margin-bottom: 1.2rem; 34 | padding: 1.2rem 1.2rem 0; 35 | border: 1px solid $gray-lighter; 36 | background: $gray-lightest; 37 | border-left: $border-radius solid $gray-light; 38 | border-radius: $border-radius; 39 | 40 | code { 41 | background-color: $gray-lighter; 42 | } 43 | } 44 | 45 | table { 46 | @extend .table; 47 | } 48 | 49 | .list-group-item-text { 50 | margin-bottom: 0; 51 | } 52 | 53 | .list-group-item-heading { 54 | margin-top: 0; 55 | margin-bottom: $list-group-item-heading-margin-bottom; 56 | } 57 | } 58 | 59 | .guide-controls { 60 | margin-top: $spacer-x; 61 | margin-bottom: $spacer-x; 62 | } 63 | -------------------------------------------------------------------------------- /_sass/_highlight.scss: -------------------------------------------------------------------------------- 1 | /* 2 | Monokai style - ported by Luigi Maselli - http://grigio.org 3 | */ 4 | 5 | .hljs { 6 | background: #292b2c; 7 | -webkit-font-smoothing: antialiased; 8 | border-left: 4px solid #2c8ebb; 9 | color: #ddd; 10 | max-width: 100%; 11 | margin-bottom: 1.2rem; 12 | border-radius: 3px; 13 | padding: 0.6rem 1.2rem; 14 | overflow-x: auto; 15 | -webkit-overflow-scrolling: touch; 16 | } 17 | 18 | .hljs-tag, 19 | .hljs-keyword, 20 | .hljs-selector-tag, 21 | .hljs-literal, 22 | .hljs-strong, 23 | .hljs-name { 24 | color: #f92672; 25 | } 26 | 27 | .hljs-code { 28 | color: #66d9ef; 29 | } 30 | 31 | .hljs-class .hljs-title { 32 | color: white; 33 | } 34 | 35 | .hljs-attribute, 36 | .hljs-symbol, 37 | .hljs-regexp, 38 | .hljs-link { 39 | color: #bf79db; 40 | } 41 | 42 | .hljs-string, 43 | .hljs-bullet, 44 | .hljs-subst, 45 | .hljs-title, 46 | .hljs-section, 47 | .hljs-emphasis, 48 | .hljs-type, 49 | .hljs-built_in, 50 | .hljs-builtin-name, 51 | .hljs-selector-attr, 52 | .hljs-selector-pseudo, 53 | .hljs-addition, 54 | .hljs-variable, 55 | .hljs-template-tag, 56 | .hljs-template-variable { 57 | color: #a6e22e; 58 | } 59 | 60 | .hljs-comment, 61 | .hljs-quote, 62 | .hljs-deletion, 63 | .hljs-meta { 64 | color: #75715e; 65 | } 66 | 67 | .hljs-keyword, 68 | .hljs-selector-tag, 69 | .hljs-literal, 70 | .hljs-doctag, 71 | .hljs-title, 72 | .hljs-section, 73 | .hljs-type, 74 | .hljs-selector-id { 75 | font-weight: bold; 76 | } 77 | -------------------------------------------------------------------------------- /_sass/_icons.scss: -------------------------------------------------------------------------------- 1 | .icon { 2 | position: relative; 3 | display: inline-block; 4 | width: 20px; 5 | height: 20px; 6 | vertical-align: middle; 7 | top: -2px; 8 | } 9 | 10 | .icon-language { 11 | background-image: url(/assets/language.svg); 12 | margin-right: 4px; 13 | } 14 | -------------------------------------------------------------------------------- /_sass/_install.scss: -------------------------------------------------------------------------------- 1 | .install-only-stable, 2 | .install-only-rc, 3 | .install-only-nightly { 4 | display: none; 5 | } 6 | 7 | .install-stable .install-only-stable, 8 | .install-rc .install-only-rc, 9 | .install-nightly .install-only-nightly { 10 | display: inherit; 11 | } 12 | -------------------------------------------------------------------------------- /_sass/_navbar.scss: -------------------------------------------------------------------------------- 1 | $navbar-link-height: 0.425rem; 2 | $navbar-height: ($navbar-padding-y * 2) + ($navbar-link-height * 2) + 3 | ($font-size-base * $line-height-base); 4 | 5 | .navbar-icon { 6 | position: relative; 7 | top: -2px; 8 | height: 20px; 9 | vertical-align: middle; 10 | 11 | path { 12 | fill: $navbar-light-color; 13 | 14 | .navbar-light .nav-item .nav-link:hover &, 15 | .navbar-light .nav-item .nav-link:focus & { 16 | fill: $navbar-light-hover-color; 17 | } 18 | 19 | .navbar-light .nav-item.active .nav-link &, 20 | .navbar-light .nav-item.open > .nav-link & { 21 | fill: $navbar-light-active-color; 22 | } 23 | } 24 | } 25 | 26 | .navbar-logo { 27 | float: left; 28 | height: 2.6rem; 29 | margin-bottom: -0.2rem; 30 | margin-right: $navbar-padding-x * 2; 31 | } 32 | 33 | .navbar-logo .logo-primary { 34 | fill: rgba(44, 142, 187, 1); 35 | transition: fill 500ms ease; 36 | } 37 | 38 | @include media-breakpoint-down('md') { 39 | .navbar-toggleable-md { 40 | clear: both; 41 | } 42 | 43 | .navbar-nav-right.navbar-nav .nav-item { 44 | float: left; 45 | margin-right: $navbar-padding-x; 46 | } 47 | 48 | .navbar-nav-right.navbar-nav .dropdown-menu { 49 | position: absolute; 50 | } 51 | } 52 | 53 | @include media-breakpoint-down('xs') { 54 | .navbar-nav-right.navbar-nav .dropdown { 55 | float: none; 56 | } 57 | } 58 | 59 | // Waiting on next release of bootstrap on cdnjs (.open was renamed to .show) 60 | .open { 61 | @extend .show; 62 | } 63 | -------------------------------------------------------------------------------- /_sass/_navs.scss: -------------------------------------------------------------------------------- 1 | .nav-inline { 2 | display: inline-block; 3 | vertical-align: top; 4 | } 5 | -------------------------------------------------------------------------------- /_sass/_news.scss: -------------------------------------------------------------------------------- 1 | .news-container { 2 | position: relative; 3 | 4 | height: 40px; 5 | 6 | padding: 0 1em; 7 | 8 | text-decoration: none; 9 | line-height: 40px; 10 | 11 | margin: auto; 12 | 13 | @media (max-width: 760px) { 14 | height: auto; 15 | line-height: 30px; 16 | 17 | text-align: center; 18 | } 19 | 20 | background: #2188b6; 21 | color: rgba(255, 255, 255, 0.8); 22 | } 23 | 24 | .news-container-alert { 25 | position: relative; 26 | 27 | height: auto; 28 | 29 | text-decoration: none; 30 | 31 | margin: auto; 32 | } 33 | 34 | .news-overlay { 35 | position: absolute; 36 | 37 | left: 0; 38 | top: 0; 39 | bottom: 0; 40 | right: 0; 41 | } 42 | 43 | .news-inner { 44 | position: relative; 45 | z-index: 1; 46 | 47 | pointer-events: none; 48 | 49 | a { 50 | display: inline-block; 51 | 52 | pointer-events: all; 53 | 54 | color: inherit; 55 | 56 | &:hover { 57 | color: #ffffff; 58 | } 59 | 60 | .alert & { 61 | color: $link-color; 62 | 63 | &:hover { 64 | color: $link-color-hover; 65 | } 66 | } 67 | } 68 | } 69 | 70 | .news-line { 71 | display: inline-block; 72 | } 73 | 74 | .news-highlight { 75 | font-weight: bold; 76 | 77 | color: #ffffff; 78 | } 79 | -------------------------------------------------------------------------------- /_sass/_readmore.scss: -------------------------------------------------------------------------------- 1 | .readMore { 2 | &--collapsed &--content { 3 | overflow: hidden; 4 | position: relative; 5 | margin-bottom: 0.2em; 6 | 7 | &:after { 8 | content: ''; 9 | position: absolute; 10 | left: 0; 11 | top: 0; 12 | height: 250px; 13 | width: 100%; 14 | box-shadow: inset 0 -100px 60px -60px white; 15 | pointer-events: none; 16 | } 17 | } 18 | 19 | &--content { 20 | overflow-x: auto; 21 | 22 | img { 23 | max-width: 100%; 24 | } 25 | } 26 | 27 | &--button { 28 | padding: 0.3em 0.8em; 29 | padding-right: 0; 30 | border-radius: 0.2em; 31 | color: #666; 32 | border: 1px solid #cbcbcb; 33 | background-color: transparent; 34 | cursor: pointer; 35 | 36 | &:active, 37 | &:focus { 38 | outline: none; 39 | box-shadow: inset 0 0 0 1px #cbcbcb; 40 | } 41 | 42 | img { 43 | width: 0.8em; 44 | margin: 0 1em; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /_sass/_tabs.scss: -------------------------------------------------------------------------------- 1 | .tabs { 2 | margin: 1rem 0; 3 | 4 | .tab-content { 5 | border: 1px solid $nav-tabs-border-color; 6 | border-top-width: 0; 7 | border-radius: 0 0 $nav-tabs-border-radius $nav-tabs-border-radius; 8 | } 9 | 10 | .tab-pane { 11 | padding: $spacer; 12 | 13 | > { 14 | h1, 15 | h2, 16 | h3, 17 | h4, 18 | h5, 19 | h6, 20 | p, 21 | ul, 22 | ol, 23 | pre, 24 | blockquote, 25 | .highlighter-rouge { 26 | &:first-child { 27 | margin-top: 0; 28 | } 29 | 30 | &:last-child { 31 | margin-bottom: 0; 32 | } 33 | } 34 | } 35 | } 36 | } 37 | 38 | .nav-tabs { 39 | @extend .bg-faded; 40 | border-radius: $nav-tabs-border-radius $nav-tabs-border-radius 0 0; 41 | border: 1px solid $nav-tabs-border-color; 42 | padding: ($spacer / 2); 43 | padding-bottom: 0; 44 | } 45 | -------------------------------------------------------------------------------- /_sass/_toc.scss: -------------------------------------------------------------------------------- 1 | .toc::before { 2 | content: '#'; 3 | } 4 | 5 | @include media-breakpoint-up('md') { 6 | .toc::before { 7 | position: absolute; 8 | display: inline-block; 9 | right: 100%; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /_sass/_users.scss: -------------------------------------------------------------------------------- 1 | .user { 2 | display: block; 3 | position: relative; 4 | height: 8rem; 5 | padding: 0.5rem; 6 | margin: 0 0 1rem; 7 | background: white; 8 | border: 1px solid $card-border-color; 9 | border-radius: $border-radius; 10 | 11 | img { 12 | position: absolute; 13 | top: 50%; 14 | left: 50%; 15 | transform: translate(-50%, -50%); 16 | max-width: 200px; 17 | max-height: 100px; 18 | } 19 | 20 | &-target { 21 | position: relative; 22 | top: -140px; 23 | 24 | &:target + a { 25 | z-index: 1; 26 | border-color: transparent; 27 | box-shadow: 0 0 0 5px $brand-primary; 28 | animation: 1s tada 0.5s 1 both; 29 | } 30 | } 31 | } 32 | 33 | @keyframes tada { 34 | 0%, 35 | 100% { 36 | transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, 0deg); 37 | } 38 | 10%, 39 | 20% { 40 | transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg); 41 | } 42 | 30%, 43 | 50%, 44 | 70%, 45 | 90% { 46 | transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); 47 | } 48 | 40%, 49 | 60%, 50 | 80% { 51 | transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /assets/detail/ico-changelog.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/detail/ico-commits-last.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/detail/ico-commits.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/detail/ico-copy-default.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/detail/ico-copy-success.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/detail/ico-dependencies.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/detail/ico-dependents-popular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /assets/detail/ico-dependents.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/detail/ico-devdependencies.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /assets/detail/ico-download-size.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/detail/ico-downloads.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/detail/ico-file.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/detail/ico-folder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/detail/ico-package-json.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/detail/ico-readme.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/detail/ico-readmore.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/detail/ico-release.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/detail/ico-runkit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/detail/ico-size-browser.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/detail/ico-size-disk.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /assets/detail/ico-stargazers.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/feature-reliable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yarnpkg/website/f82b8a0a95c10f5c35f00488eb34e953a0f4aa61/assets/feature-reliable.png -------------------------------------------------------------------------------- /assets/feature-secure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yarnpkg/website/f82b8a0a95c10f5c35f00488eb34e953a0f4aa61/assets/feature-secure.png -------------------------------------------------------------------------------- /assets/feature-speed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yarnpkg/website/f82b8a0a95c10f5c35f00488eb34e953a0f4aa61/assets/feature-speed.png -------------------------------------------------------------------------------- /assets/og_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yarnpkg/website/f82b8a0a95c10f5c35f00488eb34e953a0f4aa61/assets/og_image.png -------------------------------------------------------------------------------- /assets/posts/2016-11-24-offline-mirror/yarn-offline-blog-offline-mirror-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yarnpkg/website/f82b8a0a95c10f5c35f00488eb34e953a0f4aa61/assets/posts/2016-11-24-offline-mirror/yarn-offline-blog-offline-mirror-list.png -------------------------------------------------------------------------------- /assets/posts/2016-11-24-offline-mirror/yarn-offline-blog-offline-mirror-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yarnpkg/website/f82b8a0a95c10f5c35f00488eb34e953a0f4aa61/assets/posts/2016-11-24-offline-mirror/yarn-offline-blog-offline-mirror-size.png -------------------------------------------------------------------------------- /assets/posts/2016-11-24-offline-mirror/yarn-offline-blog-releases.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yarnpkg/website/f82b8a0a95c10f5c35f00488eb34e953a0f4aa61/assets/posts/2016-11-24-offline-mirror/yarn-offline-blog-releases.png -------------------------------------------------------------------------------- /assets/search.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/search/ico-bitbucket.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-clear.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-download.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-git.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/search/ico-github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-gitlab.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-hot-t1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-hot-t2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-hot-t3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-hot-t4.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-npm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-tag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-typescript.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/search/ico-yarn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/users/facebook.svg: -------------------------------------------------------------------------------- 1 | facebook -------------------------------------------------------------------------------- /assets/users/tilde.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /blog.html: -------------------------------------------------------------------------------- 1 | --- 2 | id: blog 3 | layout: page 4 | permalink: /blog/ 5 | --- 6 | 7 |
8 | {% for post in site.posts %} 9 |
10 |

{{ post.title }}

11 | 12 |

Posted {{ post.date | date: "%b %-d, %Y" }} by {{ post.author }}{% if post.meta %} · {{ post.meta }}{% endif %}

13 | 14 |

{{ post.excerpt | remove: '

' | remove: '

' }}

15 |
16 | {% endfor %} 17 |
18 | -------------------------------------------------------------------------------- /crowdin.yaml: -------------------------------------------------------------------------------- 1 | project_identifier: yarn 2 | api_key_env: CROWDIN_API_KEY 3 | base_path: . 4 | 5 | files: 6 | - source: '/lang/en/**/*' 7 | translation: '/lang/%locale%/**/%original_file_name%' 8 | languages_mapping: 9 | locale: 10 | af: af 11 | ar: ar 12 | ca: ca 13 | cs: cs 14 | da: da 15 | de: de 16 | el: el 17 | en: en 18 | es-ES: es-ES 19 | fa-IR: fa-IR 20 | fi: fi 21 | fr: fr 22 | he: he 23 | hu: hu 24 | id-ID: id-ID 25 | it: it 26 | ja: ja 27 | ko: ko 28 | mr-IN: mr-IN 29 | nl: nl 30 | no-NO: no-NO 31 | pl: pl 32 | pt-BR: pt-BR 33 | pt-PT: pt-PT 34 | ro: ro 35 | ru: ru 36 | sk-SK: sk-SK 37 | sr: sr 38 | sv-SE: sv-SE 39 | tr: tr 40 | uk: uk 41 | vi: vi 42 | zh-CN: zh-Hans 43 | zh-TW: zh-Hant 44 | - source: '/_data/i18n/en.yml' 45 | translation: '/_data/i18n/%locale%.yml' 46 | languages_mapping: 47 | locale: 48 | af: af 49 | ar: ar 50 | ca: ca 51 | cs: cs 52 | da: da 53 | de: de 54 | el: el 55 | en: en 56 | es-ES: es-ES 57 | fa-IR: fa-IR 58 | fi: fi 59 | fr: fr 60 | he: he 61 | hu: hu 62 | id-ID: id-ID 63 | it: it 64 | ja: ja 65 | ko: ko 66 | mr-IN: mr-IN 67 | nl: nl 68 | no-NO: no-NO 69 | pl: pl 70 | pt-BR: pt-BR 71 | pt-PT: pt-PT 72 | ro: ro 73 | ru: ru 74 | sk-SK: sk-SK 75 | sr: sr 76 | sv-SE: sv-SE 77 | tr: tr 78 | uk: uk 79 | vi: vi 80 | zh-CN: zh-Hans 81 | zh-TW: zh-Hant 82 | -------------------------------------------------------------------------------- /css/main.scss: -------------------------------------------------------------------------------- 1 | --- 2 | # Only the main Sass file needs front matter (the dashes are enough) 3 | --- 4 | @charset "utf-8"; 5 | 6 | $yarn-blue-light: #badae8; 7 | $yarn-blue: #2c8ebb; 8 | $yarn-blue-dark: #2188b6; 9 | $yarn-blue-darker: #1b7eab; 10 | $yarn-blue-darkest: #1476a2; 11 | 12 | $text-muted: #52585e; 13 | $text-muted-er: #6d767d; 14 | 15 | $navbar-light-color: rgba(0, 0, 0, 0.6); 16 | $navbar-light-hover-color: rgba(0, 0, 0, 0.7); 17 | $navbar-light-active-color: rgba(0, 0, 0, 0.8); 18 | $navbar-light-disabled-color: rgba(0, 0, 0, 0.3); 19 | 20 | $brand-primary: $yarn-blue; 21 | $progress-bar-color: $brand-primary; 22 | 23 | $link-color: saturate(darken($brand-primary, 8%), 20%); 24 | $link-color-hover: saturate(darken($brand-primary, 30%), 20%); 25 | 26 | $npm-red: #c12127; 27 | 28 | @import 'bootstrap/scss/bootstrap.scss'; 29 | @import '_base.scss'; 30 | @import '_news.scss'; 31 | @import '_navbar.scss'; 32 | @import '_icons.scss'; 33 | @import '_heros.scss'; 34 | @import '_features.scss'; 35 | @import '_featurettes.scss'; 36 | @import '_guides.scss'; 37 | @import '_code.scss'; 38 | @import '_users.scss'; 39 | @import '_404.scss'; 40 | @import '_tabs.scss'; 41 | @import '_navs.scss'; 42 | @import '_cards.scss'; 43 | @import '_badges.scss'; 44 | @import '_toc.scss'; 45 | @import '_footer.scss'; 46 | @import '_search.scss'; 47 | @import '_docsearch.scss'; 48 | @import '_details.scss'; 49 | @import '_readmore.scss'; 50 | @import '_copyable.scss'; 51 | @import '_highlight.scss'; 52 | @import "_install.scss"; 53 | 54 | // should come from bootstrap but it doesn't 55 | .justify-items-between { 56 | -webkit-box-pack: justify; 57 | -webkit-justify-content: space-between; 58 | -ms-flex-pack: justify; 59 | justify-content: space-between; 60 | } 61 | 62 | .align-items-baseline { 63 | -webkit-box-align: baseline; 64 | -ms-flex-align: baseline; 65 | align-items: baseline; 66 | } 67 | 68 | .flex-column { 69 | flex-direction: column; 70 | } 71 | 72 | .user-select-none { 73 | -webkit-user-select: none; 74 | -moz-user-select: none; 75 | -ms-user-select: none; 76 | user-select: none; 77 | } 78 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yarnpkg/website/f82b8a0a95c10f5c35f00488eb34e953a0f4aa61/favicon.ico -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | --- 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Click here to see the site 13 | 14 | 15 | -------------------------------------------------------------------------------- /js/src/common.js: -------------------------------------------------------------------------------- 1 | import 'jquery'; 2 | import 'bootstrap/js/src/dropdown.js'; 3 | import 'bootstrap/js/src/collapse.js'; 4 | import 'bootstrap/js/src/tab.js'; 5 | import React from 'react'; 6 | import ReactDOM from 'react-dom'; 7 | import { checkServiceStatus } from './util/serviceStatus'; 8 | import { fillLanguageDropdown } from './util/production'; 9 | import { Search } from './components'; 10 | 11 | checkServiceStatus(); 12 | 13 | ReactDOM.render(, document.getElementById('search')); 14 | 15 | if (process.env.NODE_ENV === 'production') { 16 | fillLanguageDropdown(); 17 | } 18 | -------------------------------------------------------------------------------- /js/src/components/Activity.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Sparklines, SparklinesLine } from '@haroenv/react-sparklines'; 3 | import { isEmpty, encode } from '../util'; 4 | import { Di } from './'; 5 | 6 | export const Activity = ({ 7 | graphData, 8 | graphLink, 9 | lastCommit, 10 | commitsLastThreeMonths, 11 | }) => { 12 | if (!graphData && !graphLink && !lastCommit && !commitsLastThreeMonths) { 13 | return null; 14 | } 15 | 16 | return ( 17 |
18 |

{window.i18n.detail.activity}

19 | 20 | {graphData && ( 21 | 22 | 23 | 24 | 25 | 26 | )} 27 |
28 | {commitsLastThreeMonths >= 0 && ( 29 | 34 | )} 35 | {lastCommit && ( 36 | 41 | )} 42 |
43 |
44 | ); 45 | }; 46 | -------------------------------------------------------------------------------- /js/src/components/Aside.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { 4 | Install, 5 | Cdn, 6 | DetailLinks, 7 | Activity, 8 | Popularity, 9 | Usage, 10 | Versions, 11 | Contributors, 12 | Tags, 13 | GithubActivity, 14 | } from './'; 15 | import { packageJSONLink, isKnownRepositoryHost } from '../util'; 16 | 17 | export const Aside = ({ 18 | name, 19 | homepage, 20 | repository, 21 | contributors, 22 | activity, 23 | downloads, 24 | humanDownloads, 25 | stargazers, 26 | dependents, 27 | humanDependents, 28 | dependencies, 29 | tags, 30 | versions, 31 | version, 32 | devDependencies, 33 | bundlesize, 34 | onOpenFileBrowser, 35 | jsDelivrHits, 36 | }) => ( 37 | 70 | ); 71 | -------------------------------------------------------------------------------- /js/src/components/Cdn.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Di } from './'; 3 | 4 | const JsDelivr = ({ name, version }) => ( 5 | 13 | cdn.jsdelivr.net/npm/{name}/ 14 | 15 | } 16 | /> 17 | ); 18 | 19 | const Unpkg = ({ name, version }) => ( 20 | 28 | unpkg.com/{name}/ 29 | 30 | } 31 | /> 32 | ); 33 | 34 | const BundleRun = ({ name, version }) => ( 35 | 43 | bundle.run/{name} 44 | 45 | } 46 | /> 47 | ); 48 | 49 | export class Cdn extends Component { 50 | constructor(props) { 51 | super(props); 52 | 53 | this.cdns = { 54 | jsdelivr: JsDelivr, 55 | unpkg: Unpkg, 56 | bundlerun: BundleRun, 57 | }; 58 | 59 | this.order = Object.keys(this.cdns).sort(() => { 60 | return Math.random() - 0.5; 61 | }); 62 | } 63 | 64 | render() { 65 | const items = this.order.map(key => { 66 | const Component = this.cdns[key]; 67 | return ( 68 | 73 | ); 74 | }); 75 | 76 | return ( 77 |
78 |

{window.i18n.detail.cdns}

79 |
{items}
80 |
81 | ); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /js/src/components/Contributors.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Owner } from './'; 3 | 4 | export class Contributors extends Component { 5 | render() { 6 | const { contributors } = this.props; 7 | return ( 8 |
9 |

{window.i18n.detail.contributors}

10 |
    11 | {contributors.map(contributor => ( 12 |
  • 13 | 14 |
  • 15 | ))} 16 |
17 |
18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /js/src/components/Copyable.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | const images = { 4 | default: '/assets/detail/ico-copy-default.svg', 5 | success: '/assets/detail/ico-copy-success.svg', 6 | }; 7 | 8 | export class Copyable extends Component { 9 | constructor(props) { 10 | super(props); 11 | this.state = { 12 | statusImage: images.default, 13 | }; 14 | } 15 | 16 | copy(toCopy, timeout = 2000) { 17 | const setAndUnset = ({ image, timeout }) => { 18 | this.setState(() => ({ 19 | statusImage: image, 20 | })); 21 | setTimeout(() => { 22 | this.setState(() => ({ 23 | statusImage: images.default, 24 | })); 25 | }, timeout); 26 | }; 27 | 28 | let range = document.createRange(); 29 | range.selectNode(toCopy); 30 | window.getSelection().removeAllRanges(); 31 | window.getSelection().addRange(range); 32 | try { 33 | // Now that we've selected the anchor text, execute the copy command 34 | const copy = document.execCommand('copy'); 35 | window.getSelection().removeAllRanges(); 36 | if (copy === true) { 37 | setAndUnset({ image: images.success, timeout }); 38 | } 39 | } catch (err) { 40 | this.setState(() => ({ 41 | statusImage: images.default, 42 | })); 43 | } 44 | } 45 | 46 | render() { 47 | const { tag = 'div', pre, children } = this.props; 48 | const Content = tag; 49 | return ( 50 |
51 | 52 | {pre} 53 | (this.copyText = text)}>{children} 54 | 55 | 66 |
67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /js/src/components/Deprecated.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Deprecated = ({ deprecated }) => 4 | deprecated ? ( 5 | 6 | {window.i18n.deprecated} 7 | 8 | ) : null; 9 | -------------------------------------------------------------------------------- /js/src/components/DetailLinks.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { Copyable } from './'; 4 | import { encode, isKnownRepositoryHost } from '../util'; 5 | 6 | const images = { 7 | homepage: '/assets/search/ico-home.svg', 8 | npm: '/assets/search/ico-npm.svg', 9 | github: '/assets/search/ico-github.svg', 10 | yarn: '/assets/search/ico-yarn.svg', 11 | gitlab: '/assets/search/ico-gitlab.svg', 12 | bitbucket: '/assets/search/ico-bitbucket.svg', 13 | generic_repo: '/assets/search/ico-git.svg', 14 | }; 15 | 16 | const Link = ({ site, url, display, Tag = 'a' }) => ( 17 | 21 | 22 | {display} 23 | 24 | ); 25 | 26 | const RepositoryLink = ({ repository }) => { 27 | const { host, user, path, project } = repository; 28 | 29 | if (!isKnownRepositoryHost(repository.host)) { 30 | return repository.url ? ( 31 | 32 | ) : null; 33 | } 34 | 35 | const [provider] = repository.host.split('.'); 36 | 37 | return ( 38 | 43 | ); 44 | }; 45 | 46 | export const DetailLinks = ({ name, homepage, repository, className }) => ( 47 |
48 | 52 | 53 | https:// 54 | yarn.pm/{name} 55 | 56 | 57 | } 58 | Tag="div" 59 | /> 60 | {homepage ? ( 61 | 66 | ) : null} 67 | {repository ? : null} 68 | 73 |
74 | ); 75 | -------------------------------------------------------------------------------- /js/src/components/Di.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Di = ({ icon, title, description }) => ( 4 |
5 | {icon && } 6 |
{title}
7 | 8 |
{description}
9 |
10 | ); 11 | -------------------------------------------------------------------------------- /js/src/components/Downloads.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { getDownloadBucket } from '../util'; 3 | 4 | export const Downloads = ({ downloads = 0, humanDownloads }) => ( 5 | 12 | {humanDownloads} 13 | 14 | ); 15 | -------------------------------------------------------------------------------- /js/src/components/GithubActivity.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { isEmpty, encode } from '../util'; 4 | import { Activity } from './'; 5 | 6 | const threeMonths = 12; // 4 weeks * 3 = 12 7 | 8 | const commitsLastThreeMonths = ({ weeklyData }) => 9 | weeklyData.slice(-(threeMonths + 1)); 10 | 11 | const countCommitsLastThreeMonths = ({ weeklyData }) => 12 | commitsLastThreeMonths({ weeklyData }).reduce( 13 | (acc, { total }) => acc + total, 14 | 0 15 | ); 16 | 17 | const commitsPerWeekLastThreeMonths = ({ weeklyData }) => 18 | commitsLastThreeMonths({ weeklyData }).map(week => week.total); 19 | 20 | const weeksAgoSinceLastCommit = ({ weeklyData }) => 21 | formatWeeksSinceLastCommit( 22 | weeklyData 23 | .slice() 24 | .reverse() 25 | .findIndex(({ total }) => total !== 0) 26 | ); 27 | 28 | const formatWeeksSinceLastCommit = weeks => { 29 | if (weeks === -1) { 30 | return window.i18n.detail.over_a_year_ago; 31 | } 32 | if (weeks < 1) { 33 | return window.i18n.detail.less_than_a_week_ago; 34 | } 35 | if (weeks === 1) { 36 | return window.i18n.detail.one_week_ago; 37 | } 38 | return window.i18n.detail.weeks_ago.replace('{count}', weeks); 39 | }; 40 | 41 | export const GithubActivity = ({ data = [], repository }) => { 42 | if (isEmpty(data)) { 43 | return null; 44 | } 45 | 46 | return ( 47 | 55 | ); 56 | }; 57 | -------------------------------------------------------------------------------- /js/src/components/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | License, 4 | Deprecated, 5 | Owner, 6 | Downloads, 7 | TypeScript, 8 | Keywords, 9 | } from './'; 10 | import { safeMarkdown } from '../util'; 11 | 12 | const Description = ({ description, deprecated }) => ( 13 |
14 | {deprecated ? ( 15 |

16 | 17 |

18 | ) : null} 19 |

23 |

24 | ); 25 | 26 | export const Header = ({ 27 | name, 28 | owner, 29 | downloadsLast30Days, 30 | humanDownloadsLast30Days, 31 | description, 32 | license, 33 | deprecated, 34 | keywords = [], 35 | version, 36 | types, 37 | }) => ( 38 |
39 |

{name}

40 |
41 | 42 | 46 | 47 | 48 | {version} 49 | 50 |
51 | 52 | 53 |
54 | ); 55 | -------------------------------------------------------------------------------- /js/src/components/HighlightedMarkdown.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { connectHighlight } from 'react-instantsearch-dom'; 3 | import { safeMarkdown } from '../util'; 4 | 5 | export const HighlightedMarkdown = connectHighlight( 6 | ({ highlight, attribute, hit }) => ( 7 | 8 | {highlight({ 9 | attribute, 10 | hit, 11 | highlightProperty: '_highlightResult', 12 | }).map( 13 | (v, i) => 14 | v.isHighlighted ? ( 15 | 20 | ) : ( 21 | 26 | ) 27 | )} 28 | 29 | ) 30 | ); 31 | -------------------------------------------------------------------------------- /js/src/components/Hit.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import formatDistance from 'date-fns/formatDistance'; 3 | import { Highlight } from 'react-instantsearch-dom'; 4 | import { formatKeywords, packageLink, isEmpty } from '../util'; 5 | import { 6 | Downloads, 7 | HighlightedMarkdown, 8 | License, 9 | Deprecated, 10 | TypeScript, 11 | Owner, 12 | Links, 13 | } from './'; 14 | 15 | export const Hit = ({ hit, onTagClick, onOwnerClick }) => ( 16 |
17 | 18 | 19 | 20 | 24 | 25 | 26 | {hit.version} 27 | 28 |

29 | {hit.deprecated ? ( 30 | hit.deprecated 31 | ) : ( 32 | 33 | )} 34 |

35 | 36 | 43 | {window.i18n.time_ago.replace( 44 | '{time_distance}', 45 | formatDistance(new Date(hit.modified), new Date()) 46 | )} 47 | 48 | {isEmpty(hit.keywords) ? null : ( 49 | 50 | {formatKeywords( 51 | hit.keywords, 52 | hit._highlightResult.keywords, 53 | 4, 54 | onTagClick 55 | )} 56 | 57 | )} 58 | 64 |
65 | ); 66 | -------------------------------------------------------------------------------- /js/src/components/Install.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Copyable } from './'; 3 | 4 | export class Install extends Component { 5 | render() { 6 | const { name, onOpenFileBrowser } = this.props; 7 | return ( 8 | 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /js/src/components/JSONLDItem.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { packageLink } from '../util'; 3 | 4 | /** 5 | * JSON-ld is a technology that allows crawlers to get info about 6 | * documents on the web, in a more structured way that microdata. 7 | * 8 | * Here we use schema.org's documents that describe a SoftwareApplication 9 | * of the type DeveloperApplication. It takes the description, name 10 | * url etc from this package data. 11 | * 12 | * Crawlers like Google can take this data and then display the Yarn 13 | * detail page however they want Software to look. 14 | * 15 | * At this point Google etc. doesn't display it separately yet, but since 16 | * both Yarn, npm and other sites include this information, they might 17 | * very well in the future. 18 | * 19 | * read more about it on: http://json-ld.org 20 | */ 21 | 22 | export const JSONLDItem = ({ name, description, keywords }) => ( 23 | 38 | ); 39 | -------------------------------------------------------------------------------- /js/src/components/Keywords.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { isEmpty, searchLink } from '../util'; 3 | 4 | export const Keywords = ({ keywords = [], maxKeywords = 4 }) => { 5 | return isEmpty(keywords) ? null : ( 6 | 7 | {keywords 8 | .slice(0, maxKeywords) 9 | .map((keyword, i) => ( 10 | 11 | {keyword} 12 | 13 | )) 14 | .reduce((prev, curr, i) => [ 15 | prev, 16 | , , 17 | curr, 18 | ])} 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /js/src/components/License.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const License = ({ type }) => 4 | type ? {type} : null; 5 | -------------------------------------------------------------------------------- /js/src/components/Links.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { isKnownRepositoryHost, i18nReplaceVars, encode } from '../util'; 3 | 4 | const Repository = ({ repository, name }) => { 5 | const [provider] = repository.host.split('.'); 6 | 7 | return ( 8 | 9 | 18 | {window.i18n[provider]} 19 | 20 | 21 | ); 22 | }; 23 | 24 | export const Links = ({ name, homepage, repository, className }) => ( 25 |
26 | 27 | 31 | {window.i18n.npm} 32 | 33 | 34 | {repository && isKnownRepositoryHost(repository.host) ? ( 35 | 36 | ) : null} 37 | {homepage ? ( 38 | 39 | 40 | {window.i18n.homepage} 41 | 42 | 43 | ) : null} 44 |
45 | ); 46 | -------------------------------------------------------------------------------- /js/src/components/Owner.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Owner = ({ link, avatar, name, onClick }) => ( 4 | { 8 | if (onClick && !(e.metaKey || e.ctrlKey)) { 9 | e.preventDefault(); 10 | onClick(name); 11 | } 12 | }} 13 | > 14 | 21 | {name} 22 | 23 | ); 24 | -------------------------------------------------------------------------------- /js/src/components/ReadMore.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | export class ReadMore extends Component { 4 | constructor(props) { 5 | super(props); 6 | 7 | this.maxHeight = `${props.height}px`; 8 | this.state = { 9 | collapsed: true, 10 | collapsible: true, 11 | }; 12 | } 13 | 14 | toggleCollapse = () => { 15 | this.setState({ 16 | collapsed: !this.state.collapsed, 17 | }); 18 | }; 19 | 20 | componentWillUpdate(nextProps, nextState) { 21 | const { height } = this.content.getBoundingClientRect(); 22 | if (nextState.collapsible && height < nextProps.height) { 23 | this.setState({ 24 | collapsible: false, 25 | collapsed: false, 26 | }); 27 | } 28 | } 29 | 30 | render() { 31 | const { children, text, className } = this.props; 32 | const { collapsed, collapsible } = this.state; 33 | 34 | return ( 35 |
40 |
(this.content = div)} 44 | > 45 | {children} 46 |
47 | {collapsible && ( 48 | 57 | )} 58 |
59 | ); 60 | } 61 | } 62 | 63 | ReadMore.defaultProps = { 64 | height: 250, 65 | className: '', 66 | }; 67 | -------------------------------------------------------------------------------- /js/src/components/SearchBox.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { SearchBox as AisSearchBox } from 'react-instantsearch-dom'; 3 | 4 | export class SearchBox extends Component { 5 | state = { active: false }; 6 | 7 | handleFocus = () => 8 | this.setState({ 9 | active: true, 10 | }); 11 | 12 | handleBlur = () => 13 | this.setState({ 14 | active: false, 15 | }); 16 | 17 | render() { 18 | return ( 19 |
20 | 25 |
26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /js/src/components/Tags.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Di } from './'; 3 | 4 | export const Tags = ({ tags, name }) => { 5 | const tagNames = Object.keys(tags); 6 | if (tagNames.length === 0) { 7 | return null; 8 | } 9 | 10 | return ( 11 |
12 |

{window.i18n.detail.tags}

13 |
14 | {tagNames.map(tag => ( 15 | {tag}} description={tags[tag]} /> 16 | ))} 17 |
18 |
19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /js/src/components/TypeScript.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const TypeScript = ({ ts = false }) => { 4 | return ts !== false ? ( 5 | {`TypeScript 11 | ) : null; 12 | }; 13 | -------------------------------------------------------------------------------- /js/src/components/Versions.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Di } from './'; 3 | 4 | const _localeVersion = pubDate => 5 | new Date(pubDate).toLocaleDateString(window.i18n.active_language, { 6 | year: 'numeric', 7 | month: 'long', 8 | day: 'numeric', 9 | }); 10 | 11 | export class Versions extends Component { 12 | constructor(props) { 13 | super(props); 14 | this.state = { 15 | isShowingMore: false, 16 | }; 17 | } 18 | 19 | _toggleShowMore() { 20 | this.setState(({ isShowingMore }) => ({ 21 | isShowingMore: !isShowingMore, 22 | })); 23 | } 24 | 25 | render() { 26 | const { versions } = this.props; 27 | const { isShowingMore } = this.state; 28 | const versionKeys = Object.keys(versions); 29 | const buttonText = isShowingMore 30 | ? window.i18n.detail.hide 31 | : window.i18n.detail.display_all; 32 | const versionsToShow = isShowingMore 33 | ? versionKeys.reverse() 34 | : versionKeys.reverse().slice(0, 3); 35 | 36 | return ( 37 |
38 |

{window.i18n.detail.versions}

39 |
40 | {versionsToShow.map(version => ( 41 | 46 | ))} 47 |
48 | {versionKeys.length > 3 && ( 49 | 61 | )} 62 |
63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /js/src/components/index.js: -------------------------------------------------------------------------------- 1 | export { Activity } from './Activity.js'; 2 | export { Aside } from './Aside.js'; 3 | export { Cdn } from './Cdn.js'; 4 | export { Contributors } from './Contributors.js'; 5 | export { Copyable } from './Copyable.js'; 6 | export { Deprecated } from './Deprecated.js'; 7 | export { DetailLinks } from './DetailLinks.js'; 8 | export { Details } from './Details.js'; 9 | export { Di } from './Di.js'; 10 | export { Downloads } from './Downloads.js'; 11 | export { FileBrowser } from './FileBrowser.js'; 12 | export { GithubActivity } from './GithubActivity.js'; 13 | export { Header } from './Header.js'; 14 | export { HighlightedMarkdown } from './HighlightedMarkdown.js'; 15 | export { Hit } from './Hit.js'; 16 | export { Install } from './Install.js'; 17 | export { JSONLDItem } from './JSONLDItem.js'; 18 | export { Keywords } from './Keywords.js'; 19 | export { License } from './License.js'; 20 | export { Links } from './Links.js'; 21 | export { Markdown } from './Markdown.js'; 22 | export { Owner } from './Owner.js'; 23 | export { Popularity } from './Popularity.js'; 24 | export { ReadMore } from './ReadMore.js'; 25 | export { Results } from './Results.js'; 26 | export { Search } from './Search.js'; 27 | export { SearchBox } from './SearchBox.js'; 28 | export { Tags } from './Tags.js'; 29 | export { TypeScript } from './TypeScript.js'; 30 | export { Usage } from './Usage.js'; 31 | export { Versions } from './Versions.js'; 32 | -------------------------------------------------------------------------------- /js/src/documentation.js: -------------------------------------------------------------------------------- 1 | import docsearch from 'docsearch.js'; 2 | import { docsearch as config } from './util/config'; 3 | 4 | docsearch({ 5 | apiKey: config.apiKey, 6 | indexName: config.indexName, 7 | inputSelector: '#algolia-doc-search', 8 | algoliaOptions: { filters: `lang:${window.i18n.active_language}` }, 9 | }); 10 | -------------------------------------------------------------------------------- /js/src/package.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { Details } from './components'; 4 | import qs from 'qs'; 5 | 6 | /* 7 | To get the package id: 8 | - production: https://yarnpkg.com/en/package/@kadira/storybook => @kadira/storybook 9 | - dev (no rewrite available): http://localhost:4000/lang/en/package/?@kadira/storybook => @kadira/storybook 10 | */ 11 | const search = qs.parse(location.search, { ignoreQueryPrefix: true }); 12 | const id = 13 | process.env.NODE_ENV == 'production' 14 | ? location.pathname 15 | .split('/') 16 | .slice(3) 17 | .join('/') 18 | : // Get the first search param. It is necessary because it can have more than one 19 | // param, e.g: when using ?files (to open the file browser). 20 | Object.keys(search)[0]; 21 | 22 | function languageDropdownAddPackage(pkg) { 23 | const langMenu = document.getElementById('dropdownNavLanguageMenu'); 24 | const langMenuItems = langMenu.querySelectorAll('.dropdown-item'); 25 | 26 | const addPackage = langMenuItem => (langMenuItem.href += `/${pkg}`); 27 | 28 | for (let i = 0; i < langMenuItems.length; i++) { 29 | addPackage(langMenuItems[i]); 30 | } 31 | } 32 | 33 | languageDropdownAddPackage(id); 34 | 35 | ReactDOM.render( 36 |
, 37 | document.getElementById('pkg-detail') 38 | ); 39 | -------------------------------------------------------------------------------- /js/src/util/config.js: -------------------------------------------------------------------------------- 1 | import algoliasearch from 'algoliasearch/lite'; 2 | 3 | export const algolia = { 4 | appId: 'OFCNCOG2CU', 5 | apiKey: 'f54e21fa3a2a0160595bb058179bfb1e', 6 | indexName: 'npm-search', 7 | }; 8 | 9 | export const client = algoliasearch(algolia.appId, algolia.apiKey, { 10 | _useRequestCache: true, 11 | }); 12 | 13 | export const docsearch = { 14 | apiKey: '3949f721e5d8ca1de8928152ff745b28', 15 | indexName: 'yarnpkg', 16 | }; 17 | -------------------------------------------------------------------------------- /js/src/util/production.js: -------------------------------------------------------------------------------- 1 | if (!NodeList.prototype.forEach) { 2 | NodeList.prototype.forEach = Array.prototype.forEach; 3 | } 4 | 5 | export function fillLanguageDropdown() { 6 | // Takes over language dropdown to set cookie 7 | const langMenu = document.getElementById('dropdownNavLanguageMenu'); 8 | if (langMenu) { 9 | const langMenuItems = langMenu.querySelectorAll('dropdown-item'); 10 | 11 | langMenuItems.forEach(langMenuItem => { 12 | langMenuItem.addEventListener('click', event => { 13 | event.preventDefault(); 14 | const target = event.currentTarget; 15 | const lang = target.dataset.lang; 16 | document.cookie = `nf_lang=${lang}`; 17 | location.reload(); 18 | }); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /js/src/util/schema.js: -------------------------------------------------------------------------------- 1 | export default { 2 | activity: Array.from({ length: 12 }, () => ({ total: 0 })), 3 | changelogFilename: '', 4 | created: 1489597229367, 5 | dependencies: {}, 6 | devDependencies: {}, 7 | dependents: 0, 8 | deprecated: false, 9 | description: '…', 10 | downloadsLast30Days: 0, 11 | downloadsRatio: 0, 12 | jsDelivrHits: 0, 13 | github: { 14 | stargazers_count: 0, 15 | }, 16 | gitlab: { 17 | star_count: 0, 18 | }, 19 | bundlesize: undefined, 20 | homepage: '', 21 | humanDependents: '0', 22 | humanDownloadsLast30Days: '0', 23 | keywords: [], 24 | lastCrawl: '', 25 | lastPublisher: { 26 | name: '', 27 | email: '', 28 | avatar: 'https://avatars3.githubusercontent.com/u/22247014?v=3&s=200', 29 | link: '', 30 | }, 31 | license: '', 32 | modified: 1489597229367, 33 | name: '…', 34 | objectID: '', 35 | owner: { 36 | name: '', 37 | avatar: 'https://avatars3.githubusercontent.com/u/22247014?v=3&s=200', 38 | link: '', 39 | }, 40 | owners: [ 41 | { 42 | name: '', 43 | email: '', 44 | avatar: 'https://avatars3.githubusercontent.com/u/22247014?v=3&s=200', 45 | link: '', 46 | }, 47 | ], 48 | popular: false, 49 | popularName: '', 50 | readme: '', 51 | version: '', 52 | versions: {}, 53 | tags: {}, 54 | types: {}, 55 | loaded: false, 56 | }; 57 | -------------------------------------------------------------------------------- /js/src/util/serviceStatus.js: -------------------------------------------------------------------------------- 1 | import fetch from 'unfetch'; 2 | export function checkServiceStatus() { 3 | fetch('https://status.yarnpkg.com/api/v1/status') 4 | .then(res => res.json()) 5 | .then(({ data: { status, message } }) => { 6 | if (status !== 'success') { 7 | showStatusMessage(message); 8 | } 9 | }) 10 | .catch(ex => console.warn(`Could not fetch service status: ${ex.message}`)); 11 | } 12 | 13 | export function showStatusMessage(message) { 14 | const alertEl = document.createElement('div'); 15 | alertEl.className = 'alert alert-danger alert-dismissible fade hide'; 16 | alertEl.setAttribute('role', 'alert'); 17 | alertEl.innerHTML = ` 18 | 21 | Status: 22 | . 23 | Read More →`; 24 | 25 | const buttonEl = alertEl.querySelector('button'); 26 | buttonEl.addEventListener('click', () => { 27 | buttonEl.parentNode.parentNode.removeChild(buttonEl.parentNode); 28 | }); 29 | 30 | // Set text using textContent so it's not vulnerable to XSS 31 | const messageEl = alertEl.querySelector('.system-status'); 32 | messageEl.textContent = message; 33 | 34 | // Insert into the hero, above the title 35 | let containerEl = document.querySelector('.hero > .container'); 36 | if (!containerEl) { 37 | containerEl = document.body; 38 | } 39 | containerEl.insertBefore(alertEl, containerEl.firstChild); 40 | 41 | // Fade the alert in 42 | window.setTimeout(() => alertEl.classList.remove('hide'), 0); 43 | window.setTimeout(() => alertEl.classList.add('show'), 20); 44 | } 45 | -------------------------------------------------------------------------------- /lang/en/docs/_ci/appveyor.md: -------------------------------------------------------------------------------- 1 | Yarn is [preinstalled on AppVeyor](https://www.appveyor.com/updates/2016/11/01/), 2 | so you don't need to do anything extra in order to use it as part of your 3 | build. 4 | 5 | To speed up your builds, you can cache Yarn's cache folder by adding this to 6 | your `appveyor.yml`: 7 | 8 | ```yml 9 | cache: 10 | - "%LOCALAPPDATA%\\Yarn" 11 | ``` 12 | -------------------------------------------------------------------------------- /lang/en/docs/_ci/circle.md: -------------------------------------------------------------------------------- 1 | [CircleCI](https://circleci.com/) provides documentation for Yarn. You can get up and running by following their [Yarn documentation](https://circleci.com/docs/2.0/yarn/). 2 | -------------------------------------------------------------------------------- /lang/en/docs/_ci/codefresh.md: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Empty line. Do not remove. 3 | {% endcomment %} 4 | [Codefresh pipelines](https://codefresh.io/docs/docs/configure-ci-cd-pipeline/introduction-to-codefresh-pipelines/) use Docker images in all their steps so it is very easy to use any [Yarn version](https://hub.docker.com/_/node/) in any pipeline. 5 | 6 | This pipeline [checks out](https://codefresh.io/docs/docs/codefresh-yaml/steps/git-clone/) the source code and then runs `yarn` with two [freestyle steps](https://codefresh.io/docs/docs/codefresh-yaml/steps/freestyle/). 7 | 8 | `codefresh.yml` 9 | 10 | ```yml 11 | version: '1.0' 12 | stages: 13 | - prepare 14 | - test 15 | - build 16 | steps: 17 | main_clone: 18 | title: Cloning main repository... 19 | stage: prepare 20 | type: git-clone 21 | repo: 'codefresh-contrib/react-sample-app' 22 | revision: master 23 | git: github 24 | MyUnitTests: 25 | title: Unit test 26 | stage: test 27 | image: node:11.0 28 | commands: 29 | - yarn install 30 | - yarn test 31 | environment: 32 | - CI=true 33 | MyReactBuild: 34 | title: Packaging application 35 | stage: build 36 | image: node:8.16 37 | commands: 38 | - yarn build 39 | ``` 40 | 41 | Notice that it is possible to use any version of node/yarn that exists in [Dockerhub](https://hub.docker.com/_/node/?tab=tags). In this case we use version 11 for running tests and version 8.6 for packaging the application. You can also use any private docker image that includes `yarn` and any other tools you need in your pipeline. 42 | 43 | There is no need for any special caching directives as Codefresh automatically caches the current workdir with all its folders (such as `node_modules`). 44 | 45 | For more details see [a complete pipeline with Yarn](https://codefresh.io/docs/docs/learn-by-example/nodejs/react/). 46 | -------------------------------------------------------------------------------- /lang/en/docs/_ci/codeship.md: -------------------------------------------------------------------------------- 1 | Yarn is pre-installed [Codeship Basic](https://codeship.com/features/basic). 2 | 3 | If you are using [Codeship Pro](https://pages.codeship.com/docker) (with 4 | Docker), it is recommended to install Yarn 5 | via [our Debian/Ubuntu package](https://yarnpkg.com/en/docs/install#linux-tab) 6 | instead. 7 | -------------------------------------------------------------------------------- /lang/en/docs/_ci/deb-specific-version.md: -------------------------------------------------------------------------------- 1 | It is recommended that you lock in a specific version of Yarn, so that all your builds use the same version of Yarn, and you can test new Yarn releases before switching over. You can do this by adding the version number to the `apt-get install` call: 2 | 3 | ``` 4 | sudo apt-get install -y -qq yarn={{site.latest_version}}-1 5 | ``` 6 | -------------------------------------------------------------------------------- /lang/en/docs/_ci/gitlab.md: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Empty line. Do not remove. 3 | {% endcomment %} 4 | Because [GitLab CI](https://about.gitlab.com/product/continuous-integration/) uses docker in the background, you can specify an image with yarn pre-installed. 5 | 6 | ```yml 7 | # .gitlab-ci.yml 8 | image: node:9.4.0 9 | ``` 10 | 11 | If you're using a docker image that doesn't come with yarn pre-installed you can still install it after the container has loaded. 12 | 13 | ```yml 14 | # .gitlab-ci.yml 15 | image: does-not-have-yarn 16 | 17 | before_script: 18 | # Install yarn as outlined in (https://yarnpkg.com/lang/en/docs/install/#alternatives-stable) 19 | - curl -o- -L https://yarnpkg.com/install.sh | bash 20 | # Make available in the current terminal 21 | - export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" 22 | ``` 23 | 24 | In either case, it's good practice to cache your `.yarn` folder as well to speed up your builds. 25 | 26 | ```yml 27 | # .gitlab-ci.yml 28 | cache: 29 | paths: 30 | - .yarn 31 | ``` 32 | 33 | Here's an example `.gitlab-ci.yml` file using yarn to run a testing suite. 34 | Just save this file to the root of your project and GitLab's CI will pick up the jobs. 35 | 36 | ```yml 37 | # .gitlab-ci.yml 38 | image: node:9.11.1 39 | 40 | before_script: 41 | - yarn install --cache-folder .yarn 42 | 43 | test: 44 | stage: test 45 | cache: 46 | paths: 47 | - node_modules/ 48 | - .yarn 49 | ``` 50 | -------------------------------------------------------------------------------- /lang/en/docs/_ci/semaphore.md: -------------------------------------------------------------------------------- 1 | [Semaphore](https://semaphoreci.com/) has Yarn pre-installed for all 2 | supported Node.js versions, and no user interaction is required for the Yarn 3 | cache to work. 4 | 5 | To assure that your local Yarn version matches the one on Semaphore, add the 6 | lines below to your setup commands, in Project Settings. 7 | 8 | ```sh 9 | curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 10 | echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 11 | # install-package is a tool for caching APT installations in Semaphore 12 | # defining a package version is optional 13 | install-package --update-new yarn= 14 | ``` 15 | -------------------------------------------------------------------------------- /lang/en/docs/_ci/solano.md: -------------------------------------------------------------------------------- 1 | Yarn is pre-installed on [SolanoCI](https://www.solanolabs.com/). You can quickly get up and running by following their 2 | [Yarn documentation](http://docs.solanolabs.com/ConfiguringLanguage/nodejs/#configuration). For an example configuration file, 3 | check out one of [their sample configuration files](https://github.com/solanolabs/express/blob/master/solano.yml). 4 | -------------------------------------------------------------------------------- /lang/en/docs/_ci/travis.md: -------------------------------------------------------------------------------- 1 | [Travis CI](https://travis-ci.org/) detects the use of Yarn by the presence of `yarn.lock` in the repository root. 2 | If it is available, Travis CI will install `yarn` if necessary, and execute `yarn` as the default install command. 3 | 4 | If your install phase requires more, it is necessary to install Yarn yourself until it is pre-installed on build images. 5 | 6 | ```yml 7 | before_install: # if "install" is overridden 8 | # Repo for Yarn 9 | - sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg 10 | - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 11 | - sudo apt-get update -qq 12 | - sudo apt-get install -y -qq yarn 13 | cache: 14 | yarn: true 15 | ``` 16 | 17 | 18 | {% include_relative _ci/deb-specific-version.md %} 19 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/alpine.md: -------------------------------------------------------------------------------- 1 |
2 | On Alpine Linux (3.6+), you can install Yarn with apk. 3 | ```sh 4 | apk add yarn 5 | ``` 6 |
7 | 8 |
9 | Currently, there are no Alpine packages available for RC or nightly builds of Yarn. Please use the tarball: 10 | {% include_relative _installations/tarball.md %} 11 |
12 | 13 | ### Path Setup 14 | 15 | 16 | {% include_relative _installations/unix_path_setup.md %} 17 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/alternatives.md: -------------------------------------------------------------------------------- 1 | If you are using another OS or one of the other options specific to your OS 2 | will not work for you, there are a couple of alternatives. You will need to 3 | [install Node.js](https://nodejs.org/) if you don't already have it installed. 4 | 5 | On common Linux distributions such as Debian, Ubuntu and CentOS, it is 6 | recommended to install Yarn via our packages instead. 7 | 8 | 9 | {% include_relative _installations/tarball.md %} 10 | 11 | ### Path Setup 12 | 13 | #### Unix/Linux/macOS 14 | 15 | 16 | {% include_relative _installations/unix_path_setup.md %} 17 | 18 | #### Windows 19 | 20 | 21 | {% include_relative _installations/windows_path_setup.md %} 22 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/arch.md: -------------------------------------------------------------------------------- 1 |
2 | On Arch Linux, Yarn can be installed through the official package manager. 3 | 4 | ```sh 5 | pacman -S yarn 6 | ``` 7 | 8 |
9 | 10 |
11 | Currently, there are no Arch packages available for RC or nightly builds of Yarn. Please use the tarball: 12 | {% include_relative _installations/tarball.md %} 13 |
14 | 15 | ### Path Setup 16 | 17 | 18 | {% include_relative _installations/unix_path_setup.md %} 19 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/centos.md: -------------------------------------------------------------------------------- 1 |
2 | On CentOS, Fedora and RHEL, you can install Yarn via our RPM package repository. 3 | ```sh 4 | curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo 5 | ``` 6 | 7 | If you do not already have Node.js installed, you should also configure 8 | [the NodeSource repository](https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora): 9 | 10 | ```sh 11 | curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash - 12 | ``` 13 | 14 | Then you can simply: 15 | 16 | ```sh 17 | sudo yum install yarn 18 | ## OR ## 19 | sudo dnf install yarn 20 | ``` 21 | 22 |
23 | 24 |
25 | Currently, there are no RPM packages available for RC or nightly builds of Yarn. Please use the tarball: 26 | {% include_relative _installations/tarball.md %} 27 |
28 | 29 | ### Path Setup 30 | 31 | 32 | {% include_relative _installations/unix_path_setup.md %} 33 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/debian.md: -------------------------------------------------------------------------------- 1 | On Debian or Ubuntu Linux, you can install Yarn via our Debian package 2 | repository. You will first need to configure the repository: 3 | 4 |
5 | ```sh 6 | curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 7 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 8 | ``` 9 |
10 |
11 | ```sh 12 | curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 13 | echo "deb https://dl.yarnpkg.com/debian/ rc main" | sudo tee /etc/apt/sources.list.d/yarn.list 14 | ``` 15 |
16 |
17 | ```sh 18 | curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 19 | echo "deb https://nightly.yarnpkg.com/debian/ nightly main" | sudo tee /etc/apt/sources.list.d/yarn.list 20 | ``` 21 |
22 | 23 | On Ubuntu 16.04 or below and Debian Stable, you will also need to configure [the NodeSource repository](https://github.com/nodesource/distributions/blob/master/README.md#deb) to get a new enough version of Node.js. 24 | 25 | Then you can simply: 26 | 27 | ```sh 28 | sudo apt update && sudo apt install yarn 29 | ``` 30 | 31 | **Note**: Ubuntu 17.04 comes with `cmdtest` installed by default. If you're getting errors from installing `yarn`, you may want to run `sudo apt remove cmdtest` first. Refer to [this](https://github.com/yarnpkg/yarn/issues/2821) for more information. 32 | 33 | If using `nvm` you can avoid the `node` installation by doing: 34 | 35 | ```sh 36 | sudo apt update && sudo apt install --no-install-recommends yarn 37 | ``` 38 | 39 | **Note**: Due to the use of `nodejs` instead of `node` name in some distros, `yarn` might complain about `node` not being installed. A workaround for this is to add an alias in your `.bashrc` file, like so: `alias node=nodejs`. This will point `yarn` to whatever version of `node` you decide to use. 40 | 41 | ### Path Setup 42 | 43 | 44 | {% include_relative _installations/unix_path_setup.md %} 45 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/gentoo.md: -------------------------------------------------------------------------------- 1 |
2 | On Gentoo Linux, you can install Yarn with portage. 3 | ```sh 4 | sudo emerge --ask sys-apps/yarn 5 | ``` 6 |
7 | 8 |
9 | Currently, there are no Gentoo packages available for RC or nightly builds of Yarn. Please use the tarball: 10 | {% include_relative _installations/tarball.md %} 11 |
12 | 13 | ### Path Setup 14 | 15 | 16 | {% include_relative _installations/unix_path_setup.md %} 17 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/mac.md: -------------------------------------------------------------------------------- 1 |
2 | #### Homebrew 3 | 4 | You can install Yarn through the [Homebrew package manager](http://brew.sh/). 5 | This will also install Node.js if it is not already installed. 6 | 7 | ```sh 8 | brew install yarn 9 | ``` 10 | 11 | If you use [nvm](https://github.com/creationix/nvm) or similar, you should ensure that your `PATH` lists nvm's shims before the version of Node.js installed by Homebrew. 12 | 13 | #### MacPorts 14 | 15 | You can install Yarn through [MacPorts](https://www.macports.org/). 16 | This will also install Node.js if it is not already installed. 17 | 18 | ```sh 19 | sudo port install yarn 20 | ``` 21 | 22 | {% include_relative _installations/tarball.md %} 23 | 24 |
25 | 26 |
27 | Currently, there are no Homebrew or MacPorts packages available for RC or nightly builds of Yarn. Please use the tarball: 28 | {% include_relative _installations/tarball.md %} 29 |
30 | 31 | #### Path Setup 32 | 33 | 34 | {% include_relative _installations/unix_path_setup.md %} 35 | 36 | #### Upgrade Yarn 37 | 38 | Yarn will warn you if a new version is available. 39 | To upgrade Yarn, you can do so with Homebrew. 40 | 41 | ```sh 42 | brew upgrade yarn 43 | ``` 44 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/nightly.md: -------------------------------------------------------------------------------- 1 | {{i18n.install_nightly_intro}} 2 | 3 | The easiest way of installing a nightly build is via our shell script: 4 | 5 | ```sh 6 | curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly 7 | ``` 8 | 9 | An Ubuntu/Debian repository of the nightly builds is also available. To enable it, run the following commands: 10 | 11 | ```sh 12 | sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg 13 | echo "deb http://nightly.yarnpkg.com/debian/ nightly main" | sudo tee /etc/apt/sources.list.d/yarn-nightly.list 14 | sudo apt update && sudo apt install yarn 15 | ``` 16 | 17 | On Windows, the [Windows installer](https://nightly.yarnpkg.com/latest.msi) can be used. 18 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/npm.md: -------------------------------------------------------------------------------- 1 | ## Install via npm 2 | 3 | It is recommended to install Yarn through the [npm package manager](http://npmjs.org/), which comes bundled with [Node.js](https://nodejs.org/) when you install it on your system. 4 | 5 | Once you have npm installed you can run the following both to **install** and **upgrade** Yarn: 6 | 7 | ```sh 8 | npm install --global yarn 9 | ``` 10 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/opensuse.md: -------------------------------------------------------------------------------- 1 |
2 | On openSUSE, you can install Yarn via our RPM package repository. 3 | 4 | ``` 5 | sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg 6 | sudo zypper ar -f https://dl.yarnpkg.com/rpm/ Yarn 7 | sudo zypper in yarn 8 | ``` 9 | 10 |
11 | 12 |
13 | Currently, there are no openSUSE packages available for RC or nightly builds of Yarn. Please use the tarball: 14 | {% include_relative _installations/tarball.md %} 15 |
16 | 17 | ### Path Setup 18 | 19 | 20 | {% include_relative _installations/unix_path_setup.md %} 21 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/solus.md: -------------------------------------------------------------------------------- 1 |
2 | On Solus, you can install yarn via the Solus repository. 3 | ```sh 4 | sudo eopkg install yarn 5 | ``` 6 |
7 | 8 |
9 | Currently, there are no Solus packages available for RC or nightly builds of Yarn. Please use the tarball: 10 | {% include_relative _installations/tarball.md %} 11 |
12 | 13 | ### Path Setup 14 | 15 | 16 | {% include_relative _installations/unix_path_setup.md %} 17 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/unix_path_setup.md: -------------------------------------------------------------------------------- 1 | If Yarn is not found in your PATH, follow these steps to add it and allow it to be run from anywhere. 2 | 3 | Note: your profile may be in your `.profile`, `.bash_profile`, `.bashrc`, `.zshrc`, etc. 4 | 5 | 1. Add this to your profile: `export PATH="$PATH:/opt/yarn-[version]/bin"` (the path may vary depending on where you extracted Yarn to) 6 | 1. In the terminal, log in and log out for the changes to take effect 7 | 8 | To have access to Yarn's executables globally, you will need to set up the `PATH` environment variable in your terminal. To do this, add `` export PATH="$PATH:`yarn global bin`" `` to your profile, or if you use Fish shell, simply run the command `` set -U fish_user_paths (yarn global bin) $fish_user_paths `` 9 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/windows.md: -------------------------------------------------------------------------------- 1 |
2 | There are three options for installing Yarn on Windows. 3 |
4 | 5 | #### Download the installer 6 | 7 | This will give you a `.msi` file that when run will walk you through installing 8 | Yarn on Windows. 9 | 10 | If you use the installer you will first need to install 11 | [Node.js](https://nodejs.org/). 12 | 13 | Download Installer 14 | Download Installer (RC) 15 | Download Installer (Nightly) 16 | 17 |
18 | #### Install via Chocolatey 19 | 20 | [Chocolatey](https://chocolatey.org/) is a package manager for Windows. 21 | You can install Chocolatey by following 22 | [these instructions](https://chocolatey.org/install). 23 | 24 | Once you have Chocolatey installed, you may install yarn by running the 25 | following code in your console: 26 | 27 | ```sh 28 | choco install yarn 29 | ``` 30 | 31 | This will also ensure that you have [Node.js](https://nodejs.org/) installed. 32 | 33 | #### Install via Scoop 34 | 35 | [Scoop](http://scoop.sh) is a command-line installer for Windows. 36 | You can install Scoop by following 37 | [these instructions](https://github.com/lukesampson/scoop/wiki/Quick-Start). 38 | 39 | Once you have Scoop installed, you may install yarn by running the 40 | following code in your console: 41 | 42 | ```sh 43 | scoop install yarn 44 | ``` 45 | 46 | If [Node.js](https://nodejs.org/) is not installed, scoop will give you a suggestion to install it. 47 | Example: 48 | 49 | ```sh 50 | scoop install nodejs 51 | ``` 52 | 53 |
54 | 55 | #### Notice 56 | 57 | Please whitelist your project folder and the Yarn cache directory (%LocalAppData%\Yarn) in your antivirus software, otherwise installing packages will be significantly slower as every single file will be scanned as it's written to disk. 58 | -------------------------------------------------------------------------------- /lang/en/docs/_installations/windows_path_setup.md: -------------------------------------------------------------------------------- 1 | You will need to set up the `PATH` environment variable in your terminal to have access to Yarn's binaries globally. 2 | 3 | Add `set PATH=%PATH%;C:\.yarn\bin` to your shell environment. 4 | -------------------------------------------------------------------------------- /lang/en/docs/cli/bin.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_bin 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 | Displays the location of the yarn `bin` folder. 10 | 11 | ##### `yarn bin []` 12 | 13 | - `yarn bin` will print the folder where yarn will install executable files for your package. An example of an executable may be a script that you have defined for your package that can be executed via [`yarn run`]({{url_base}}/docs/cli/run). 14 | 15 | Example: 16 | 17 | ```sh 18 | $ yarn bin 19 | /home/emillumine/Code/Funkwhale/funkwhale/front/node_modules/.bin 20 | ``` 21 | 22 | - `yarn bin ` will print the path to the executable file. 23 | 24 | Example: 25 | 26 | ```sh 27 | $ yarn bin gettext-compile 28 | /home/emillumine/Code/Funkwhale/funkwhale/front/node_modules/.bin/gettext-compile 29 | ``` 30 | -------------------------------------------------------------------------------- /lang/en/docs/cli/cache.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_cache 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | ##### `yarn cache list [--pattern]` 8 | 9 | Yarn stores every package in a global cache in your user directory on the file 10 | system. `yarn cache list` will print out every cached package. 11 | 12 | `yarn cache list --pattern ` will print out every cached package that matches the pattern provided. 13 | 14 | Examples: 15 | 16 | ```sh 17 | yarn cache list --pattern gulp 18 | yarn cache list --pattern "gulp|grunt" 19 | yarn cache list --pattern "gulp-(match|newer)" 20 | ``` 21 | 22 | ##### `yarn cache dir` 23 | 24 | Running `yarn cache dir` will print out the path where yarn's global cache is currently stored. 25 | 26 | ##### `yarn cache clean []` 27 | 28 | Running this command will clear the global cache. It will be populated again the 29 | next time `yarn` or `yarn install` is run. Additionally, you can specify one or more packages that you want to clean. 30 | 31 | ### Change the cache path for yarn 32 | 33 | Set `cache-folder` config value to configure the cache directory. 34 | 35 | ```sh 36 | yarn config set cache-folder 37 | ``` 38 | 39 | You can also specify the cache directory by flag `--cache-folder`: 40 | 41 | ```sh 42 | yarn --cache-folder 43 | ``` 44 | 45 | You can also specify the cache directory by environment variable `YARN_CACHE_FOLDER`: 46 | 47 | ```sh 48 | YARN_CACHE_FOLDER= yarn 49 | ``` 50 | 51 | Yarn will also respect `cache=` in `.npmrc` for compatibility with npm. 52 | -------------------------------------------------------------------------------- /lang/en/docs/cli/check.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_check 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | ##### `yarn check` 8 | 9 | Verifies that versions of the package dependencies in the current project's `package.json` match those in yarn's lock file. 10 | 11 | **NOTE**: The command `yarn check` has been historically buggy and undermaintained and, as such, [has been deprecated and will be removed in Yarn 2.0](https://github.com/yarnpkg/rfcs/pull/106). You should use `yarn install --check-files` instead. 12 | 13 | The switches `--integrity` and `--verify-tree` are mutually exclusive. 14 | 15 | ##### `yarn check --integrity` 16 | 17 | Verifies that versions and hashed values of the package contents in the project's `package.json` match those in yarn's lock file. This helps to verify that the package dependencies have not been altered. 18 | 19 | ##### `yarn check --verify-tree` 20 | 21 | Recursively verifies that the dependencies in `package.json` are present in `node_modules` and have the right version. This check does not consider `yarn.lock`. 22 | -------------------------------------------------------------------------------- /lang/en/docs/cli/config.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_config 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Manages the yarn configuration files.

8 | 9 | ##### `yarn config set [-g|--global]` 10 | 11 | Sets the config `key` to a certain `value`. 12 | 13 | Example: 14 | 15 | ```sh 16 | $ yarn config set init-license BSD-2-Clause 17 | yarn config vx.x.x 18 | success Set "init-license" to "BSD-2-Clause". 19 | ✨ Done in 0.05s. 20 | ``` 21 | 22 | ##### `yarn config get ` 23 | 24 | Echoes the value for a given `key` to `stdout`. 25 | 26 | Example: 27 | 28 | ```sh 29 | $ yarn config get init-license 30 | BSD-2-Clause 31 | ``` 32 | 33 | ##### `yarn config delete ` 34 | 35 | Deletes a given `key` from the config. 36 | 37 | Example: 38 | 39 | ```sh 40 | $ yarn config delete test-key 41 | yarn config vx.x.x 42 | success Deleted "test-key". 43 | ✨ Done in 0.06s. 44 | ``` 45 | 46 | ##### `yarn config list` 47 | 48 | Displays the current configuration. 49 | 50 | Example: 51 | 52 | ```sh 53 | $ yarn config list 54 | yarn config vx.x.x 55 | info yarn config 56 | { 'version-tag-prefix': 'v', 57 | 'version-git-tag': true, 58 | 'version-git-sign': false, 59 | 'version-git-message': 'v%s', 60 | 'init-version': '1.0.0', 61 | 'init-license': 'MIT', 62 | 'save-prefix': '^', 63 | 'ignore-scripts': false, 64 | 'ignore-optional': true, 65 | registry: 'https://registry.yarnpkg.com', 66 | 'user-agent': 'yarn/0.15.0 npm/? node/v6.2.1 darwin x64' } 67 | info npm config 68 | { registry: 'https://registry.npmjs.org/', 69 | '//localhost:4873/:_authToken': 'some-auth-token' } 70 | ✨ Done in 0.05s. 71 | ``` 72 | -------------------------------------------------------------------------------- /lang/en/docs/cli/create.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_create 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 |

Creates new projects from any create-* starter kits.

10 | 11 | ##### `yarn create []` 12 | 13 | This command is a shorthand that helps you do two things at once: 14 | 15 | - Install `create-` globally, or update the package to the 16 | latest version if it already exists 17 | - Run the `create-` executable located in the `bin` field of the starter kit’s `package.json`, 18 | forwarding any `` to it 19 | 20 | For example, `yarn create react-app my-app` is equivalent to: 21 | 22 | ```sh 23 | $ yarn global add create-react-app 24 | $ create-react-app my-app 25 | ``` 26 | 27 | For more information, check out the [relevant blog entry](https://yarnpkg.com/blog/2017/05/12/introducing-yarn/). 28 | -------------------------------------------------------------------------------- /lang/en/docs/cli/dedupe.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_dedupe 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 | The dedupe command isn't necessary. `yarn install` will already dedupe. 10 | -------------------------------------------------------------------------------- /lang/en/docs/cli/exec.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_exec 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 |

Executes a shell script.

10 | 11 | ##### `yarn exec` 12 | 13 | This command executes a shell script. 14 | 15 | ```sh 16 | $ yarn exec echo test message 17 | test message 18 | ``` 19 | -------------------------------------------------------------------------------- /lang/en/docs/cli/generate-lock-entry.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_generate_lock_entry 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Generates a lock file entry.

8 | 9 | ##### `yarn generate-lock-entry` 10 | 11 | _Note: This command is considered for advanced use-cases and tooling only. It generates a lock file entry given the current `package.json` manifest file._ 12 | 13 | ```sh 14 | $ yarn generate-lock-entry 15 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 16 | # yarn lockfile v1 17 | yarnpkg@0.14.0: 18 | version "0.14.0" 19 | dependencies: 20 | babel-plugin-transform-inline-imports-commonjs "^1.0.0" 21 | babel-runtime "^6.0.0" 22 | bytes "^2.4.0" 23 | [...] 24 | ``` 25 | -------------------------------------------------------------------------------- /lang/en/docs/cli/help.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_help 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 |

Displays help information.

10 | 11 | ##### `yarn help` 12 | 13 | This command shows a list of available commands and flags, each with a brief 14 | explanation on what it does. 15 | -------------------------------------------------------------------------------- /lang/en/docs/cli/licenses.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_licenses 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

List licenses for installed packages.

8 | 9 | ##### `yarn licenses list` 10 | 11 | Running this command will list, in alphabetical order all of the packages that 12 | were installed by `yarn` or `yarn install`, and give you the license (and URL 13 | to the source code) associated with each package. 14 | 15 | ```sh 16 | yarn licenses list 17 | ``` 18 | 19 | ``` 20 | yarn licenses v0.14.0 21 | ├─ abab@1.0.3 22 | │ ├─ License: ISC 23 | │ └─ URL: git+https://github.com/jsdom/abab.git 24 | ├─ abbrev@1.0.9 25 | │ ├─ License: ISC 26 | │ └─ URL: http://github.com/isaacs/abbrev-js 27 | ├─ acorn-globals@1.0.9 28 | │ ├─ License: MIT 29 | │ └─ URL: https://github.com/ForbesLindesay/acorn-globals.git 30 | ├─ acorn@2.7.0 31 | │ ├─ License: MIT 32 | │ └─ URL: https://github.com/ternjs/acorn.git 33 | ├─ align-text@0.1.4 34 | │ ├─ License: MIT 35 | │ └─ URL: git://github.com/jonschlinkert/align-text.git 36 | ├─ amdefine@1.0.0 37 | │ ├─ License: BSD-3-Clause AND MIT 38 | │ └─ URL: https://github.com/jrburke/amdefine.git 39 | ├─ ansi-escapes@1.4.0 40 | │ ├─ License: MIT 41 | │ └─ URL: https://github.com/sindresorhus/ansi-escapes.git 42 | ├─ ansi-regex@2.0.0 43 | │ ├─ License: MIT 44 | │ └─ URL: https://github.com/sindresorhus/ansi-regex.git 45 | ... 46 | ``` 47 | 48 | ##### `yarn licenses generate-disclaimer` 49 | 50 | Running this command will return a sorted list of licenses from all the 51 | packages you have installed to the `stdout`. 52 | 53 | ```sh 54 | yarn licenses generate-disclaimer 55 | ``` 56 | 57 | ``` 58 | The following software may be included in this product: package-1. This software contains the following license and notice below: 59 | 60 | [[LICENSE TEXT]] 61 | 62 | ----- 63 | 64 | The following software may be included in this product: package-2. This software contains the following license and notice below: 65 | 66 | [[LICENSE TEXT]] 67 | ``` 68 | -------------------------------------------------------------------------------- /lang/en/docs/cli/list.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_list 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

List installed packages.

8 | 9 | ##### `yarn list` 10 | 11 | ```sh 12 | yarn list 13 | ``` 14 | 15 | The `yarn list` command mimics the expected Unix behavior of listing. In Yarn, the `list` 16 | command lists all dependencies for the current working directory by referencing all 17 | package manager meta data files, which includes a project's dependencies. 18 | 19 | ``` 20 | yarn list vx.x.x 21 | ├─ package-1@1.3.3 22 | ├─ package-2@5.0.9 23 | │ └─ package-3@^2.1.0 24 | └─ package-3@2.7.0 25 | ``` 26 | 27 | ##### `yarn list [--depth] [--pattern]` 28 | 29 | By default, all packages and their dependencies will be displayed. To restrict the depth of the 30 | dependencies, you can add a flag, `--depth`, along with the desired level to the `list` command. 31 | 32 | ``` 33 | yarn list --depth=0 34 | ``` 35 | 36 | Keep in mind, levels are zero-indexed. 37 | 38 | `yarn list --pattern ` will filter the list of dependencies by the pattern flag. 39 | 40 | Examples: 41 | 42 | ```sh 43 | yarn list --pattern gulp 44 | yarn list --pattern "gulp|grunt" 45 | yarn list --pattern "gulp|grunt" --depth=1 46 | ``` 47 | -------------------------------------------------------------------------------- /lang/en/docs/cli/lockfile.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_lockfile 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 | The lockfile command isn't necessary. `yarn install` will produce a lockfile. 10 | -------------------------------------------------------------------------------- /lang/en/docs/cli/login.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_login 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 |

Store registry username and email.

10 | 11 | ##### `yarn login` 12 | 13 | Running this command will prompt you for your username and email for the 14 | [npm registry](https://www.npmjs.com/). It will **not** ask for your password. 15 | Later when you run a command that requires authentication such as 16 | [`yarn publish`]({{url_base}}/docs/cli/publish), you will have to enter your 17 | password to do so. 18 | 19 | ```sh 20 | yarn login 21 | ``` 22 | 23 | ```sh 24 | yarn login vx.x.x 25 | question npm username: my-username 26 | question npm email: my-username@example.com 27 | ✨ Done in 6.03s. 28 | ``` 29 | 30 | Using [`yarn logout`]({{url_base}}/docs/cli/logout) you can delete your 31 | username and email. 32 | -------------------------------------------------------------------------------- /lang/en/docs/cli/logout.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_logout 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 |

Clear registry username and email.

10 | 11 | ##### `yarn logout` 12 | 13 | This will remove your stored username and email for the 14 | [npm registry](https://www.npmjs.com/) as setup by 15 | [`yarn login`]({{url_base}}/docs/cli/login). You do need to run this to de-authenticate, registry 16 | actions are individually authenticated. 17 | -------------------------------------------------------------------------------- /lang/en/docs/cli/outdated.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_outdated 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Checks for outdated package dependencies.

8 | 9 | ##### `yarn outdated` 10 | 11 | Lists version information for all package dependencies. This information 12 | includes the currently installed version, the desired version based on semver, 13 | and the latest available version. 14 | 15 | For example, say your `package.json` has the following dependencies listed: 16 | 17 | ```js 18 | { 19 | "dependencies": { 20 | "underscore": "~1.6.0" 21 | }, 22 | "devDependencies": { 23 | "lodash": "4.15.0" 24 | } 25 | } 26 | ``` 27 | 28 | The command run should look something like this: 29 | 30 | ```sh 31 | yarn outdated 32 | ``` 33 | 34 | ``` 35 | Package Current Wanted Latest Package Type URL 36 | lodash 4.15.0 4.15.0 4.16.4 devDependencies https://github.com/lodash/lodash#readme 37 | underscore 1.6.0 1.6.0 1.8.3 dependencies https://github.com/jashkenas/underscore#readme 38 | ✨ Done in 0.72s. 39 | ``` 40 | 41 | ##### `yarn outdated [package...]` 42 | 43 | Lists version information for one or more package dependencies. 44 | 45 | For the example `package.json` shown previously, you should see the following 46 | output when checking one of the dependencies: 47 | 48 | ```sh 49 | yarn outdated lodash 50 | ``` 51 | 52 | ``` 53 | Package Current Wanted Latest Package Type URL 54 | lodash 4.15.0 4.15.0 4.16.4 devDependencies https://github.com/lodash/lodash#readme 55 | ✨ Done in 1.04s. 56 | ``` 57 | -------------------------------------------------------------------------------- /lang/en/docs/cli/owner.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_owner 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Manage package owners.

8 | 9 | ### What is a package owner? 10 | 11 | A package "owner" in the registry is a user that has access to make changes to 12 | a package. A single package can have as many owners as you want. 13 | 14 | Owners have permission to do the following tasks: 15 | 16 | 1. Publish new versions of the package 17 | 2. Add or remove other owners of the package 18 | 3. Change metadata for a package 19 | 20 | ### Caveats 21 | 22 | There aren't any other levels of access at this time. All users can either 23 | modify a package or they cannot. In the future, there may be more types of 24 | roles, but not at this time. 25 | 26 | ### Commands 27 | 28 | ##### `yarn owner list ` 29 | 30 | Lists all of the owners of a ``. 31 | 32 | ##### `yarn owner add ` 33 | 34 | Adds the `` as an owner of the ``. You must already be an owner 35 | of the `` in order to run this command. 36 | 37 | ##### `yarn owner remove ` 38 | 39 | Removes the `` as an owner of the ``. You must already be an 40 | owner of the `` in order to run this command. 41 | -------------------------------------------------------------------------------- /lang/en/docs/cli/pack.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_pack 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | ##### `yarn pack` 8 | 9 | Creates a compressed gzip archive of package dependencies. 10 | 11 | ##### `yarn pack --filename ` 12 | 13 | Creates a compressed gzip archive of package dependencies and names the file _filename_. 14 | -------------------------------------------------------------------------------- /lang/en/docs/cli/prune.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_prune 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 | The prune command isn't necessary. `yarn install` will prune extraneous packages. 10 | -------------------------------------------------------------------------------- /lang/en/docs/cli/publish.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_publish 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Publishes a package to the npm registry.

8 | 9 | Once a package is published, you can never modify that specific version, so 10 | take care before publishing. 11 | 12 | ##### `yarn publish` 13 | 14 | Publishes the package defined by the `package.json` in the current directory. 15 | 16 | ##### `yarn publish [tarball]` 17 | 18 | Publishes the package defined by a `.tgz` gzipped tarball. 19 | 20 | ##### `yarn publish [folder]` 21 | 22 | Publishes the package contained in the specified folder. 23 | `/package.json` should specify the package details. 24 | 25 | ##### `yarn publish --new-version ` 26 | 27 | Skips the prompt for new version by using the value of `version` instead. 28 | 29 | ##### `yarn publish --tag ` 30 | 31 | Providing a tag to `yarn publish` lets you publish packages with a specific tag. 32 | For example, if you do a `yarn publish --tag beta`, and your package is named 33 | `blorp`, then someone else can install that package with `yarn add blorp@beta`. 34 | 35 | ##### `yarn publish --access ` 36 | 37 | The `--access` flag controls whether the npm registry publishes this package as 38 | a public package, or restricted. 39 | -------------------------------------------------------------------------------- /lang/en/docs/cli/remove.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_remove 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | ##### `yarn remove ` 8 | 9 | Running `yarn remove foo` will remove the package named `foo` from your direct 10 | dependencies updating your `package.json` and `yarn.lock` files in the process. 11 | 12 | Other developers working on the project can run `yarn install` to sync their 13 | own `node_modules` directories with the updated set of dependencies. 14 | 15 | When you remove a package, it is removed from all types of dependencies: 16 | `dependencies`, `devDependencies`, etc. 17 | 18 | > **Note**: `yarn remove` will always update your `package.json` and 19 | > `yarn.lock`. This ensures that different developers on the same project get 20 | > the same set of dependencies. It is not possible to disable this behavior. 21 | 22 | > **Note**: `yarn remove --` uses the same `flag`s as `yarn install` command. 23 | -------------------------------------------------------------------------------- /lang/en/docs/cli/self-update.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_self_update 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Updates Yarn to the latest version.

8 | 9 | ##### `yarn self-update` 10 | 11 | _**Important**: `self-update` is not available. See [policies](https://yarnpkg.com/lang/en/docs/cli/policies/#toc-policies-set-version) for enforcing versions within a project_ 12 | 13 | In order to update your version of Yarn, you can run one of the following commands: 14 | 15 | - `npm install --global yarn` - if you've installed Yarn via npm (recommended) 16 | - `curl --compressed -o- -L https://yarnpkg.com/install.sh | bash` if you're on Unix 17 | - otherwise, check the docs of the installer you've used to install Yarn 18 | -------------------------------------------------------------------------------- /lang/en/docs/cli/team.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_team 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Maintain team memberships

8 | 9 | ##### `yarn team` 10 | 11 | Manage teams in organizations, and change team memberships. 12 | 13 | ### Commands 14 | 15 | ##### `yarn team create ` 16 | 17 | Create a new team. 18 | 19 | ##### `yarn team destroy ` 20 | 21 | Destroys an existing team. 22 | 23 | ##### `yarn team add ` 24 | 25 | Add a user to an existing team. 26 | 27 | ##### `yarn team remove ` 28 | 29 | Remove a user from a team they belong to. 30 | 31 | ##### `yarn team list |` 32 | 33 | If performed on an organization name, will return a list of existing teams under that organization. If performed on a team, it will instead return a list of all users belonging to that particular team. 34 | 35 | ### Details 36 | 37 | yarn team always operates directly on the current registry, configurable from the command line using `--registry=`. 38 | 39 | In order to create teams and manage team membership, you _must be a team admin_ under the given organization. Listing teams and team memberships may be done by any member of the organizations. 40 | 41 | Organization creation and management of team admins and organization members is done through the npm website, not the CLI. 42 | 43 | To use teams to manage permissions on packages belonging to your organization, use the yarn access command to grant or revoke the appropriate permissions. 44 | -------------------------------------------------------------------------------- /lang/en/docs/cli/test.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_test 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Runs the test script defined by the package.

8 | 9 | ##### `yarn test` 10 | 11 | If you have defined a `scripts` object in your package, this command will run 12 | the specified `test` script. 13 | 14 | For example, if you have a bash script in your package, `scripts/test`: 15 | 16 | ```sh 17 | #!/bin/bash 18 | 19 | echo "Hello, world!" 20 | ``` 21 | 22 | and the following in your `package.json`: 23 | 24 | ```json 25 | { 26 | "name": "my-tribute-package", 27 | "version": "1.0.0", 28 | "description": 29 | "This is not the best package in the world, this is just a tribute.", 30 | "main": "index.js", 31 | "author": "Yarn Contributor", 32 | "license": "MIT", 33 | "scripts": { 34 | "test": "scripts/test" 35 | } 36 | } 37 | ``` 38 | 39 | then running `yarn test` would yield: 40 | 41 | ```sh 42 | $ yarn test 43 | yarn test v0.15.1 44 | $ "./scripts/test" 45 | Hello, world! 46 | ✨ Done in 0.17s. 47 | ``` 48 | 49 | ##### `yarn run test` 50 | 51 | `yarn test` is also a shortcut for `yarn run test`. 52 | -------------------------------------------------------------------------------- /lang/en/docs/cli/unlink.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_unlink 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 |

Unlink a previously created symlink for a package.

10 | 11 | To remove a symlinked package created with [`yarn link`]({{url_base}}/docs/cli/link), `yarn unlink` can be used. 12 | 13 | ##### `yarn unlink` 14 | 15 | Run `yarn unlink` in the folder that was previously used to create a link. 16 | 17 | ##### `yarn unlink [package]` 18 | 19 | To unlink a package that was symlinked during development in your project, simply 20 | run `yarn unlink [package]`. You will need to run `yarn install --check-files` to re-install 21 | the package that was linked, for more info [see issue 1957](https://github.com/yarnpkg/yarn/issues/1957). 22 | 23 | Continued example from the [`yarn link`]({{url_base}}/docs/cli/link) documentation: assume two folders 24 | `react` and `react-relay` that are located next to each other with `react` linked 25 | into the `react-relay` project: 26 | 27 | ```sh 28 | $ cd react 29 | $ yarn unlink 30 | yarn link vx.x.x 31 | success Unregistered "react". 32 | ``` 33 | 34 | ```sh 35 | $ cd ../react-relay 36 | $ yarn unlink react 37 | yarn link vx.x.x 38 | success Unregistered "react". 39 | ``` 40 | 41 | Also see: 42 | 43 | - [`yarn link`]({{url_base}}/docs/cli/link): symlink a package for local development. 44 | -------------------------------------------------------------------------------- /lang/en/docs/cli/upgrade-interactive.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_upgrade_interactive 3 | guide: docs_cli 4 | layout: guide 5 | additional_reading_tags: ["cli-add", "cli-tag", "dependencies-versions", "cli-upgrade"] 6 | --- 7 | 8 | {% include vars.html %} 9 | 10 |

This is similar to npm-check interactive update mode. It provides an easy way to update outdated packages.

11 | 12 | ##### `yarn upgrade-interactive [--latest]` 13 | 14 | The `upgrade-interactive` command takes the same parameters as, and functions the same as the base `upgrade` command. 15 | This command will display the outdated packages before performing any upgrade, allowing the user to select which packages to upgrade. 16 | Yarn will respect the version ranges in `package.json` when determining the version to upgrade to. 17 | 18 | You can think of `yarn upgrade-interactive` as a combination of the `yarn outdated` and `yarn upgrade [package...]` commands. 19 | Where `yarn outdated` displays the list of outdated packages and `yarn upgrade [package...]` can then be used to upgrade desired packages, 20 | `yarn upgrade-interactive` displays the same outdated package list and lets you immediately choose which to upgrade. 21 | 22 | `--latest` : This flag tells yarn to ignore the specified version ranges in `package.json` and instead use the version tagged `latest` 23 | in the registry. 24 | 25 | ``` 26 | [1/? Choose which packages to update. (Press to select, to toggle all, to inverse s 27 | election) 28 | devDependencies 29 | ❯◯ autoprefixer 6.7.7 ❯ 7.0.0 https://github.com/postcss/autoprefixer#readme 30 | ◯ webpack 2.4.1 ❯ 2.5.1 https://github.com/webpack/webpack 31 | 32 | dependencies 33 | ◯ bull 2.2.6 ❯ 3.0.0-alpha.3 https://github.com/OptimalBits/bull#readme 34 | ◯ fs-extra 3.0.0 ❯ 3.0.1 https://github.com/jprichardson/node-fs-extra 35 | ◯ socket.io 1.7.3 ❯ 1.7.4 https://github.com/socketio/socket.io#readme 36 | ◯ socket.io-client 1.7.3 ❯ 1.7.4 https://github.com/Automattic/socket.io-client#readme 37 | ``` 38 | -------------------------------------------------------------------------------- /lang/en/docs/cli/versions.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_versions 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 |

Displays version information of the currently installed Yarn, Node.js, and its dependencies.

10 | 11 | ##### `yarn versions`
12 | 13 | ```sh 14 | yarn versions 15 | ``` 16 | 17 | ``` 18 | yarn versions v0.24.5 19 | { http_parser: '2.7.0', 20 | node: '7.10.0', 21 | v8: '5.5.372.43', 22 | uv: '1.11.0', 23 | zlib: '1.2.11', 24 | ares: '1.10.1-DEV', 25 | modules: '51', 26 | openssl: '1.0.2k', 27 | icu: '58.2', 28 | unicode: '9.0', 29 | cldr: '30.0.3', 30 | tz: '2016j' } 31 | ✨ Done in 0.04s. 32 | ``` 33 | -------------------------------------------------------------------------------- /lang/en/docs/cli/why.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_why 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Show information about why a package is installed.

8 | 9 | ##### `yarn why ` 10 | 11 | This command will identify why a package has been installed, detailing which 12 | other packages depend upon it, for example, or whether it was explicitly marked 13 | as a dependency in the `package.json` manifest. 14 | 15 | ```sh 16 | yarn why jest 17 | ``` 18 | 19 | ``` 20 | yarn why vx.x.x 21 | [1/4] 🤔 Why do we have the module "jest"...? 22 | [2/4] 🚚 Initializing dependency graph... 23 | [3/4] 🔍 Finding dependency... 24 | [4/4] 🚡 Calculating file sizes... 25 | info Has been hoisted to "jest" 26 | info This module exists because it's specified in "devDependencies". 27 | info Disk size without dependencies: "1.29kB" 28 | info Disk size with unique dependencies: "101.31kB" 29 | info Disk size with transitive dependencies: "20.35MB" 30 | info Amount of shared dependencies: 125 31 | ``` 32 | 33 | ### Query argument 34 | 35 | The mandatory query argument for `yarn why` can be any of: 36 | 37 | - a package name (as in the above example) 38 | - a package folder; eg: `yarn why node_modules/once` 39 | - a file within a package folder; eg: `yarn why node_modules/once/once.js` 40 | 41 | The file locations can also be absolute. 42 | -------------------------------------------------------------------------------- /lang/en/docs/cli/workspace.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_workspace 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 | To learn more about workspaces, check these links: 8 | 9 | - [Workspaces in Yarn](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces) 10 | - [Workspaces](https://yarnpkg.com/en/docs/workspaces) 11 | 12 | ##### `yarn workspace ` 13 | 14 | This will run the chosen Yarn command in the selected workspace. 15 | 16 | Example: 17 | 18 | ```sh 19 | yarn workspace awesome-package add react react-dom --dev 20 | ``` 21 | 22 | This will add `react` and `react-dom` as `devDependencies` in your `packages/awesome-package/package.json`. 23 | 24 | If you want to remove a package: 25 | 26 | ```sh 27 | yarn workspace web-project remove some-package 28 | ``` 29 | 30 | The example above would remove `some-package` from `packages/web-project/package.json`. 31 | -------------------------------------------------------------------------------- /lang/en/docs/cli/workspaces.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_cli_workspaces 3 | guide: docs_cli 4 | layout: guide 5 | --- 6 | 7 |

Show information about your workspaces.

8 | 9 | ### What is a workspace? 10 | 11 | To learn more about workspaces, check these links: 12 | 13 | - [Workspaces in Yarn]({{url_base}}/blog/2017/08/02/introducing-workspaces) 14 | - [Workspaces]({{url_base}}/docs/workspaces) 15 | 16 | ### Commands 17 | 18 | ##### `yarn workspaces info [--json]` 19 | 20 | This command will display the workspace dependency tree of your current project. 21 | 22 | ```sh 23 | yarn workspaces info 24 | ``` 25 | 26 | ``` 27 | yarn workspaces vx.x.x 28 | { "create-subscription": { 29 | "location": "packages/create-subscription", 30 | "workspaceDependencies": [], 31 | "mismatchedWorkspaceDependencies": [] 32 | }, 33 | ... 34 | "react-noop-renderer": { 35 | "location": "packages/react-noop-renderer", 36 | "workspaceDependencies": [ 37 | "react-reconciler" 38 | ], 39 | "mismatchedWorkspaceDependencies": [] 40 | }, 41 | "react-reconciler": { 42 | "location": "packages/react-reconciler", 43 | "workspaceDependencies": [], 44 | "mismatchedWorkspaceDependencies": [] 45 | }, ... } 46 | ``` 47 | 48 | ##### `yarn workspaces run ` 49 | 50 | This will run the chosen Yarn command in each workspace. 51 | 52 | ```sh 53 | yarn workspaces run test 54 | ``` 55 | 56 | This will invoke the test script for each workspace. 57 | 58 | This will also pass forward flags and can be useful for CI processes. 59 | 60 | ```sh 61 | yarn workspaces run test --ci 62 | ``` 63 | -------------------------------------------------------------------------------- /lang/en/docs/configuration.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_configuration_index 3 | guide: docs_configuration 4 | layout: guide 5 | --- 6 | 7 | 8 | 9 | ## Configuring your package 10 | 11 | Yarn looks for `package.json` files to identify each package and configure the behavior of yarn while running inside that package. 12 | 13 | An example configuration for the `pet-kitten` package, which would be found at `pet-kitten/package.json`: 14 | 15 | ``` 16 | { 17 | "name": "pet-kitten", 18 | "version": "0.1.0", 19 | "main": "pet.js", 20 | "dependencies": { 21 | "hand": "1.0.0" 22 | } 23 | } 24 | ``` 25 | 26 | ## Use `yarn.lock` to pin your dependencies 27 | 28 | Yarn also uses a `yarn.lock` file in the root of your project to make dependency resolution fast and reliable. You never need to touch this file, yarn owns it and will change it when managing dependencies. 29 | 30 | To make sure your app works consistently, **you should always save the `yarn.lock` file in your code repository.** 31 | -------------------------------------------------------------------------------- /lang/en/docs/creating-a-project.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_creating_a_project 3 | guide: docs_yarn_workflow 4 | layout: guide 5 | --- 6 | 7 | It doesn't matter if you have an existing repository/directory of code, or if 8 | you are starting a completely new project, adding Yarn works the same way every 9 | time. 10 | 11 | In your terminal/console in the directory that you want to add Yarn (which 12 | should almost always be the root of your project), run the following command: 13 | 14 | ```sh 15 | yarn init 16 | ``` 17 | 18 | This will open up an interactive form for creating a new yarn project with the 19 | following questions: 20 | 21 | ``` 22 | name (your-project): 23 | version (1.0.0): 24 | description: 25 | entry point (index.js): 26 | git repository: 27 | author: 28 | license (MIT): 29 | ``` 30 | 31 | You can type answers for each of these or you can just hit enter/return to use 32 | the default or leave it blank. 33 | 34 | ### `package.json` 35 | 36 | Now you should have a `package.json` that looks similar to this: 37 | 38 | ```json 39 | { 40 | "name": "my-new-project", 41 | "version": "1.0.0", 42 | "description": "My New Project description.", 43 | "main": "index.js", 44 | "repository": { 45 | "url": "https://example.com/your-username/my-new-project", 46 | "type": "git" 47 | }, 48 | "author": "Your Name ", 49 | "license": "MIT" 50 | } 51 | ``` 52 | 53 | When you run `yarn init`, all it is doing is creating this file. Nothing 54 | happens in the background. You can feel free to edit this file as much as you 55 | want. 56 | 57 | Your `package.json` is used to store info about your project. This includes the 58 | name of your project, the maintainers, where the source code lives, but most 59 | importantly what dependencies are needed to be installed for the project. 60 | -------------------------------------------------------------------------------- /lang/en/docs/dependencies.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_dependencies 3 | guide: docs_dependencies 4 | layout: guide 5 | additional_reading_tags: ["package-json", "yarn-lock"] 6 | --- 7 | 8 | Package dependencies are critical to the success of a package. When you develop the functionality of your package, you will very likely use existing code defined in other packages. Those packages then become dependencies to your project. 9 | 10 | Your `package.json` file is the home for the declaration of all your dependencies, from development to production to optional. You will specify both the package name and minimum version information for each dependency. 11 | 12 | Your `yarn.lock` file ensures that your package is consistent across installations by storing the versions of which dependencies are installed with your package. 13 | -------------------------------------------------------------------------------- /lang/en/docs/envvars.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_configuration_envvars 3 | guide: docs_configuration 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 | Environment variables defined in `process.env` allow you to configure additional Yarn features. 10 | 11 | ### `CHILD_CONCURRENCY` 12 | 13 | ```javascript 14 | process.env.CHILD_CONCURRENCY=#number# 15 | ``` 16 | 17 | Controls the number of child processes run in parallel to build node modules. 18 | 19 | Setting this number to 1 will cause the node modules to be built sequentially which can avoid linker errors on windows with node-gyp. 20 | 21 | ### `npm_config` 22 | 23 | For backward compatibility with `npm`, Yarn allows passing down `npm` configuration via environment variables. For instance, the `--build-from-source` `npm` CLI flag becomes: `npm_config_build_from_source=true`. For more information on configuring `npm`, refer to the [npm-config](https://docs.npmjs.com/misc/config) page. 24 | -------------------------------------------------------------------------------- /lang/en/docs/getting-started.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_getting_started 3 | guide: docs_getting_started 4 | layout: guide 5 | --- 6 | 7 | Yarn is a package manager for your code. It allows you to use and share (e.g. JavaScript) code 8 | with other developers from around the world. Yarn does this quickly, securely, 9 | and reliably so you don't ever have to worry. 10 | 11 | Yarn allows you to use other developers' solutions to different problems, 12 | making it easier for you to develop your software. If you have problems, you 13 | can report issues or contribute back, and when the problem is fixed, you can 14 | use Yarn to keep it all up to date. 15 | 16 | Code is shared through something called a **package** (sometimes referred to as 17 | a **module**). A package contains all the code being shared as well as a 18 | `package.json` file which describes the package. 19 | -------------------------------------------------------------------------------- /lang/en/docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_index 3 | layout: pages/docs 4 | stylesheets: https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css 5 | --- 6 | -------------------------------------------------------------------------------- /lang/en/docs/install-ci.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_install_ci 3 | guide: docs_yarn_workflow 4 | layout: pages/install-ci 5 | --- 6 | -------------------------------------------------------------------------------- /lang/en/docs/install.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_install 3 | guide: docs_getting_started 4 | layout: pages/install 5 | --- 6 | -------------------------------------------------------------------------------- /lang/en/docs/installing-dependencies.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_installing_dependencies 3 | guide: docs_yarn_workflow 4 | layout: guide 5 | additional_reading_tags: ["dependencies", "package-json", "yarn-lock", "cli-install"] 6 | --- 7 | 8 | {% include vars.html %} 9 | 10 | If you have just checked out a package from [version control]({{url_base}}/docs/version-control), you will need to install those dependencies. 11 | 12 | > If you are [adding dependencies]({{url_base}}/docs/managing-dependencies#toc-adding-a-dependency) for your project, then those dependencies are automatically installed during that process. 13 | 14 | ### Installing Dependencies 15 | 16 | [`yarn install`]({{url_base}}/docs/cli/install) is used to install all dependencies for a project. The dependencies are retrieved from your project's `package.json` file, and stored in the `yarn.lock` file. 17 | 18 | When developing a package, installing dependencies is most commonly done after: 19 | 20 | 1. You have just checked out code for a project that needs these dependencies to function. 21 | 1. Another developer on the project has added a new dependency that you need to pick up. 22 | 23 | ### Installing Options 24 | 25 | There are many options for installing dependencies, including: 26 | 27 | 1. Installing all dependencies: `yarn` or `yarn install` 28 | 1. Installing one and only one version of a package: `yarn install --flat` 29 | 1. Forcing a re-download of all packages: `yarn install --force` 30 | 1. Installing only production dependencies: `yarn install --production` 31 | 32 | See [the full list]({{url_base}}/docs/cli/install) of flags you can pass to `yarn install`. 33 | -------------------------------------------------------------------------------- /lang/en/docs/nightly.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_nightly 3 | guide: docs_getting_started 4 | layout: pages/nightly 5 | --- 6 | -------------------------------------------------------------------------------- /lang/en/docs/offline-mirror.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_offline_mirror 3 | guide: docs_offline_mirror 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 | Follow [this blog post](https://yarnpkg.com/blog/2016/11/24/offline-mirror/) to 10 | configure an offline mirror. 11 | -------------------------------------------------------------------------------- /lang/en/docs/prune-offline-mirror.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_prune_offline_mirror 3 | guide: docs_offline_mirror 4 | layout: guide 5 | --- 6 | 7 | After you configure your offline mirror, Yarn will automatically add new 8 | package tarballs to the mirror. However, it does not automatically remove 9 | tarballs that are no longer referenced in `yarn.lock`. For example, if you `$ yarn remove` a dependency, the tarball will remain in the mirror, even if no 10 | other dependencies have it as a sub-dependency. This behavior can be desirable 11 | in a setting where many projects share the same mirror, but when that is not 12 | the case, you may want to have Yarn remove unnecessary tarballs. 13 | 14 | To turn on automating pruning, set `yarn-offline-mirror-pruning` to `true` in 15 | your `.yarnrc`: 16 | 17 | `$ yarn config set yarn-offline-mirror-pruning true` 18 | 19 | Now, tarballs will be removed when appropriate. The end result is that 20 | `package.json`, `node_modules`, `yarn.lock`, and the offline mirror should all 21 | remain perfectly in sync whenever you change your project's dependencies. 22 | -------------------------------------------------------------------------------- /lang/en/docs/usage.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_usage 3 | guide: docs_getting_started 4 | layout: guide 5 | additional_reading_tags: ["basics", "cli"] 6 | --- 7 | 8 | {% include vars.html %} 9 | 10 | Now that you have Yarn [installed]({{url_base}}/docs/install), you can start 11 | using Yarn. Here are some of the most common commands you'll need. 12 | 13 | **Starting a new project** 14 | 15 | ```sh 16 | yarn init 17 | ``` 18 | 19 | **Adding a dependency** 20 | 21 | ```sh 22 | yarn add [package] 23 | yarn add [package]@[version] 24 | yarn add [package]@[tag] 25 | ``` 26 | 27 | **Adding a dependency to different categories of dependencies** 28 | 29 | Add to `devDependencies`, `peerDependencies`, and `optionalDependencies` respectively: 30 | 31 | ```sh 32 | yarn add [package] --dev 33 | yarn add [package] --peer 34 | yarn add [package] --optional 35 | ``` 36 | 37 | **Upgrading a dependency** 38 | 39 | ```sh 40 | yarn upgrade [package] 41 | yarn upgrade [package]@[version] 42 | yarn upgrade [package]@[tag] 43 | ``` 44 | 45 | **Removing a dependency** 46 | 47 | ```sh 48 | yarn remove [package] 49 | ``` 50 | 51 | **Installing all the dependencies of project** 52 | 53 | ```sh 54 | yarn 55 | ``` 56 | 57 | or 58 | 59 | ```sh 60 | yarn install 61 | ``` 62 | -------------------------------------------------------------------------------- /lang/en/docs/version-control.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_version_control 3 | guide: docs_yarn_workflow 4 | layout: guide 5 | additional_reading_tags: ["dependencies", "package-json", "yarn-lock"] 6 | --- 7 | 8 | To have people successfully develop or use your package, you need to ensure that all the necessary files are checked into your source control system. 9 | 10 | ### Required Files 11 | 12 | The following files must be checked into source control for anyone to be able to manage your package: 13 | 14 | - `package.json`: This has all the current dependencies for your package. 15 | - `yarn.lock`: This stores the exact versions of each dependency for your package. 16 | - The actual source code that provides the functionality for your package. 17 | 18 | > Check out the [Yarn Example Package](https://github.com/yarnpkg/example-yarn-package) for the minimum requirements necessary for a Yarn package. 19 | -------------------------------------------------------------------------------- /lang/en/docs/yarn-workflow.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs_yarn_workflow 3 | guide: docs_yarn_workflow 4 | layout: guide 5 | --- 6 | 7 | Introducing a package manager into your project introduces a new workflow 8 | around dependencies. Yarn tries its best to stay out of your way and make each 9 | step of this workflow simple to understand. 10 | 11 | There are a few things you should know about the basic workflow: 12 | 13 | 1. Creating a new project 14 | 2. Adding/updating/removing dependencies 15 | 3. Installing/reinstalling your dependencies 16 | 4. Working with version control (e.g. git) 17 | 5. Continuous Integration 18 | -------------------------------------------------------------------------------- /lang/en/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: pages/homepage 3 | --- 4 | -------------------------------------------------------------------------------- /lang/en/org/governance.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: governance 3 | guide: yarn_organization 4 | layout: guide 5 | --- 6 | 7 | This is currently being discussed in 8 | [yarnpkg/yarn#274](https://github.com/yarnpkg/yarn/issues/274). 9 | -------------------------------------------------------------------------------- /lang/en/org/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: organization 3 | guide: yarn_organization 4 | layout: guide 5 | --- 6 | 7 | {% include vars.html %} 8 | 9 |

10 | Rules, guidelines, and documentation on Yarn contribution, processes, and 11 | community. 12 |

13 | 14 | Yarn is a community run project with sponsored contributions from a number of 15 | companies. Anyone can get involved and contribute to Yarn, and we're committed 16 | to creating an open and inclusive community for everyone. 17 | 18 | Every member of the community that wishes to contribute either through code, 19 | documentation, support, or any other form of contribution must read and follow 20 | our [Code of Conduct]({{url_base}}/org/code-of-conduct). 21 | -------------------------------------------------------------------------------- /lang/en/org/translations.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: translations 3 | guide: yarn_organization 4 | layout: guide 5 | --- 6 | 7 | Documentation is written in English through the repository on GitHub. 8 | Translations are managed through [Crowdin](https://crowdin.com/). 9 | 10 | If would like to contribute to translations you can 11 | [join our team here](http://i18n.yarnpkg.com/project/yarn/invite). 12 | 13 | Once you sign up for an account you can click on your language and start 14 | writing translations. 15 | 16 | Remember that the [code of conduct]({{url_base}}/org/code-of-conduct) also 17 | applies to anything that happens on Crowdin. 18 | -------------------------------------------------------------------------------- /lang/en/packages.html: -------------------------------------------------------------------------------- 1 | --- 2 | id: packages 3 | layout: page 4 | scripts: 5 | - "/js/build/packages.js" 6 | title: Yarn packages 7 | --- 8 | 23 | -------------------------------------------------------------------------------- /lang/en/users.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: users 3 | layout: pages/users 4 | --- 5 | -------------------------------------------------------------------------------- /latest-rc-version: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | --- 4 | {{site.latest_rc_version}} 5 | -------------------------------------------------------------------------------- /latest-version: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | --- 4 | {{site.latest_version}} -------------------------------------------------------------------------------- /opensearch.xml: -------------------------------------------------------------------------------- 1 | 2 | Yarn 3 | Package Search 4 | 5 | UTF-8 6 | https://classic.yarnpkg.com/favicon.ico 7 | 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yarn-website", 3 | "version": "1.0.0", 4 | "devDependencies": { 5 | "algolia-sitemap": "^2.1.1", 6 | "babel-core": "^6.26.3", 7 | "babel-loader": "^7.1.4", 8 | "babel-plugin-transform-react-constant-elements": "^6.23.0", 9 | "babel-plugin-transform-react-inline-elements": "^6.22.0", 10 | "babel-preset-env": "1.7.0", 11 | "babel-preset-react": "^6.24.1", 12 | "babel-preset-stage-2": "^6.24.1", 13 | "happypack": "^4.0.1", 14 | "lint-staged": "9.0.0", 15 | "pre-commit": "^1.2.2", 16 | "prettier": "^1.13.4", 17 | "webpack": "^3.5.5", 18 | "webpack-bundle-analyzer": "^3.3.2", 19 | "webpack-manifest-plugin": "^1.3.1" 20 | }, 21 | "scripts": { 22 | "build": "webpack", 23 | "build:sitemaps": "./scripts/sitemaps.js", 24 | "build:production": "npm run build && npm run build:sitemaps", 25 | "start": "webpack --watch", 26 | "lint:staged": "lint-staged", 27 | "format": "yarn prettier --write '**/*.{js,md,scss}'" 28 | }, 29 | "lint-staged": { 30 | "*.{js,md,scss}": [ 31 | "prettier --write", 32 | "git add" 33 | ] 34 | }, 35 | "pre-commit": "lint:staged", 36 | "repository": { 37 | "type": "git", 38 | "url": "https://github.com/yarnpkg/website.git" 39 | }, 40 | "private": true, 41 | "dependencies": { 42 | "@haroenv/react-sparklines": "^1.7.1", 43 | "algoliasearch": "^3.27.1", 44 | "bootstrap": "^4.0.0-alpha.5", 45 | "bytes": "^3.0.0", 46 | "date-fns": "^2.0.0-alpha.7", 47 | "docsearch.js": "^2.5.2", 48 | "jquery": "^3.4.0", 49 | "marked": "^0.4.0", 50 | "popper.js": "^1.14.3", 51 | "prop-types": "^15.6.1", 52 | "qs": "^6.5.2", 53 | "react": "^16.4.0", 54 | "react-dom": "^16.4.2", 55 | "react-instantsearch-dom": "^5.2.0-beta.2", 56 | "react-transition-group": "^1.2.1", 57 | "unescape-html": "^1.0.0", 58 | "unfetch": "^3.0.0", 59 | "xss": "^1.0.3" 60 | }, 61 | "resolutions": { 62 | "algoliasearch": "3.27.1" 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /-debug/ 3 | Disallow: /page*/ 4 | Disallow: /*/packages/ 5 | 6 | Sitemap: http://sitemap.yarnpkg.com/sitemap-index.xml 7 | -------------------------------------------------------------------------------- /scripts/normalize-translations.rb: -------------------------------------------------------------------------------- 1 | puts "Normalizing toc..." 2 | 3 | # frontmatterSourceRegex = %r!\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)!m 4 | # frontmatterTargetRegex = %r!\A(\* \* \*\s*\n.*?\n?)^((\* \* \*|\.\.\.)\s*$\n?)!m 5 | 6 | frontmatterSourceRegex = /^---.*?---/m 7 | frontmatterTargetRegex = /^\* \* \*.*?\* \* \*/m 8 | 9 | tocRegex = /\[\]\(#toc-(.*?)\)\{#toc-.*?\}/ 10 | 11 | langsDir = File.join('.', 'lang') 12 | langs = Dir.entries(langsDir).reject {|lang| lang == 'en' || lang == "." || lang == ".."} 13 | 14 | # Build up a hashmap with all of the source front-matters 15 | # { relativePath => frontMatter } 16 | englishFiles = Dir.glob(File.join(langsDir, 'en', '**', '*.*')) 17 | english = {} 18 | englishFiles.each {|file| 19 | path = file.sub(File.join(langsDir, 'en'), '') 20 | contents = IO.read file 21 | contents = contents.unicode_normalize 22 | result = contents.match frontmatterSourceRegex 23 | english[path] = result 24 | } 25 | 26 | langs.each {|lang| 27 | files = Dir.glob(File.join(langsDir, lang, '**', '*.*')) 28 | 29 | files.each {|file| 30 | # puts "- Replacing #{file}" 31 | 32 | path = file.sub(File.join(langsDir, lang), '') 33 | contents = IO.read file 34 | frontmatter = english[path] 35 | 36 | result = contents 37 | result = result.unicode_normalize 38 | result = result.gsub /\r\n?/, "\n" 39 | result = result + "\n" 40 | result = result.gsub(tocRegex, '') 41 | result = result.gsub(frontmatterTargetRegex) {|c| frontmatter } if frontmatter 42 | 43 | File.write(file, result) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /scripts/remove-unused-languages.rb: -------------------------------------------------------------------------------- 1 | require "yaml" 2 | 3 | puts "Removing unused languages..." 4 | 5 | languagesFile = File.join('.', '_data', 'languages.yml') 6 | languages = YAML.load_file(languagesFile) 7 | 8 | languagesEnabledHash = {} 9 | languages.each {|language| 10 | if language['enabled'] 11 | languagesEnabledHash[ language['tag'] ] = true 12 | end 13 | } 14 | 15 | langDirectory = File.join('.', 'lang') 16 | 17 | langs = Dir.entries(langDirectory).select { |entry| 18 | File.directory? File.join(langDirectory, entry) and !(entry == '.' || entry == '..') 19 | } 20 | 21 | langs.each {|lang| 22 | if languagesEnabledHash[lang] 23 | # puts "- Leaving #{lang}" 24 | else 25 | # puts "- Removing #{lang}..." 26 | system "rm _data/i18n/#{lang}.yml" 27 | system "rm -r lang/#{lang}" 28 | end 29 | } 30 | -------------------------------------------------------------------------------- /scripts/set-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Sets the Yarn version number in _config.yml 3 | set -ex 4 | 5 | if [ -z "$YARN_VERSION" -o -z "$YARN_RC" ]; then 6 | echo 'Please provide YARN_VERSION and YARN_RC environment variables.' 7 | echo 'YARN_RC should be "true" to release an RC build.' 8 | exit 1 9 | fi 10 | 11 | configFile=`dirname $0`/../_config.yml 12 | 13 | if [ "$YARN_RC" = "true" ]; then 14 | sed -i -e "s/latest_rc_version:.\+/latest_rc_version: $YARN_VERSION/" "$configFile" 15 | sed -i -e 's/show_rc:.\+/show_rc: true/' "$configFile" 16 | else 17 | sed -i -e "s/latest_version:.\+/latest_version: $YARN_VERSION/" "$configFile" 18 | 19 | # If the stable version is newer than the latest RC, we should hide the RC 20 | latestRCVersion=`grep -oP 'latest_rc_version: \K([0-9\.]+)' "$configFile"` 21 | ! dpkg --compare-versions $latestRCVersion le $YARN_VERSION 22 | if [ $? -ne 0 ]; then 23 | sed -i -e 's/show_rc:.\+/show_rc: false/' "$configFile" 24 | fi; 25 | fi 26 | -------------------------------------------------------------------------------- /scripts/sitemaps.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | if ( 4 | process.env.CONTEXT === 'production' && 5 | process.env.BUILD_SITEMAP !== 'false' 6 | ) { 7 | const algoliaSitemap = require('algolia-sitemap'); 8 | const { mkdirSync, existsSync } = require('fs'); 9 | 10 | const algoliaConfig = { 11 | appId: 'OFCNCOG2CU', 12 | apiKey: process.env.ALGOLIA_BROWSE_KEY, 13 | indexName: 'npm-search', 14 | }; 15 | 16 | function hitToParams(hit) { 17 | const url = ({ lang, name }) => 18 | `https://yarnpkg.com/${lang}/package/${name}`; 19 | const loc = url({ lang: 'en', name: hit.name }); 20 | const lastmod = new Date(hit.modified).toISOString(); 21 | const priority = hit.downloadsRatio || 0.5; 22 | return { 23 | loc, 24 | lastmod, 25 | priority, 26 | alternates: { 27 | languages: ['fr', 'pt-BR', 'zh-Hans'], 28 | hitToURL: lang => url({ lang, name: hit.name }), 29 | }, 30 | }; 31 | } 32 | 33 | const path = `${__dirname}/../sitemaps`; 34 | 35 | if (!existsSync(path)) { 36 | mkdirSync(path); 37 | } 38 | 39 | algoliaSitemap({ 40 | algoliaConfig, 41 | sitemapLoc: 'https://yarnpkg.com/sitemaps', 42 | outputFolder: path, 43 | hitToParams, 44 | }) 45 | .then(() => console.log('Sitemap generated successfully')) 46 | .catch(e => { 47 | console.log(e); 48 | process.exit(1); 49 | }); 50 | } else { 51 | console.log('sitemap generation skipped'); 52 | } 53 | -------------------------------------------------------------------------------- /scripts/validate-translations.rb: -------------------------------------------------------------------------------- 1 | puts "Validating translations..." 2 | 3 | mdFiles = Dir.glob(File.join('.', '_site', 'lang', '**', '*.md')) 4 | 5 | if mdFiles.size > 0 6 | puts "Error: Found translations still in markdown" 7 | puts mdFiles 8 | exit 1 9 | else 10 | puts "Valid." 11 | exit 0 12 | end 13 | --------------------------------------------------------------------------------