Skip to content

Commit 228fe30

Browse files
committed
chore: update deps (incl. prettier)
1 parent 63cef9b commit 228fe30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1223
-916
lines changed

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
js/build
2+
_site
3+
_sass/bootstrap
4+
css/main.scss

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5",
4+
"proseWrap": "preserve"
5+
}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ $ make serve
2929
```
3030

3131
On Windows, `make` is not available, so you need to execute `bundle` and `jekyll` directly:
32+
3233
```sh
3334
bundle install
3435
bundle exec jekyll serve --incremental

_posts/2016-11-24-offline-mirror.md

+13-19
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ categories : announcements
88
share_text : "installing node_modules with Yarn offline"
99
---
1010

11-
Repeatable and reliable builds for large JavaScript projects are vital.
11+
Repeatable and reliable builds for large JavaScript projects are vital.
1212
If your builds depend on dependencies being downloaded from network, this build system is neither repeatable nor reliable.
1313

1414
One of the main advantages of Yarn is that it can install node_modules from files located in file system.
@@ -19,7 +19,6 @@ Caches store already unzipped tarballs downloaded from registry, they also can b
1919
The tarballs in “Offline mirror” can be consumed by any version Yarn that will build cache based on them.
2020
It is also easier to store files when they are compressed.
2121

22-
2322
## Let's set up “Offline mirror” for a simple JS project
2423

2524
```json
@@ -36,7 +35,6 @@ It is also easier to store files when they are compressed.
3635
}
3736
```
3837

39-
4038
When you run `yarn install`, the generated `yarn.lock` file has sections for every dependency:
4139

4240
```yaml
@@ -78,7 +76,7 @@ success Set "yarn-offline-mirror" to "./npm-packages-offline-cache".
7876
✨ Done in 0.06s.
7977
```
8078

81-
> `./npm-packages-offline-cache` is an example location relative to home folder where all the source` .tar.gz` files will be downloaded to from the registry.
79+
> `./npm-packages-offline-cache` is an example location relative to home folder where all the source`.tar.gz` files will be downloaded to from the registry.
8280

8381
Offline mirror does not come with removing tarballs. In order to keep the cache folder up to date, you need to add the following to the config file:
8482

@@ -91,7 +89,6 @@ success Set "yarn-offline-mirror-pruning" to "true".
9189
✨ Done in 0.06s.
9290
```
9391

94-
9592
This will create a .yarnrc file in your HOME directory.
9693
Let's move this file to the project root so that offline mirror would be used only for this project.
9794

@@ -153,26 +150,27 @@ is-array-1.0.1.tgz left-pad-1.1.3.tgz mime-db-1.25.0.tgz mime-types-2.1
153150
```
154151

155152
> How can you test to make sure it is offline?
156-
- Clear your global cache with "yarn cache clean"
157-
- Turn off wifi
158-
- Run "yarn install --offline". The offline flag will make sure yarn does not reach out to the network
159153

160-
> In a nutshell, to enable “Offline mirror” for your project you need:
161-
- add “yarn-offline-mirror” configuration to .yarnrc file
162-
- generate a new yarn.lock with “yarn install” command
154+
* Clear your global cache with "yarn cache clean"
155+
* Turn off wifi
156+
* Run "yarn install --offline". The offline flag will make sure yarn does not reach out to the network
163157

158+
> In a nutshell, to enable “Offline mirror” for your project you need:
164159

160+
* add “yarn-offline-mirror” configuration to .yarnrc file
161+
* generate a new yarn.lock with “yarn install” command
165162

166163
## A few tips and tricks
167164

168165
### Updating your package
169166

170167
If you want to make sure you have a clean cached modules, here are few of the steps you can take:
171-
- Remove the package first. Make sure you have "yarn-offline-mirror-pruning" set to true in your .yarnrc file
172-
- Clear the yarn cache with "yarn cache clean" before adding the updated version of the package
173-
- Add your package
174168

175-
The "yarn-offline-mirror-pruning" will help clean up any unlinked dependencies. When you add the updated package, it will check the yarn cache first and pull any missing dependencies from there. This will prevent yarn adding new tarball back with the updated package. You want to make sure the yarn cache is all clean before you do any adding for cache module.
169+
* Remove the package first. Make sure you have "yarn-offline-mirror-pruning" set to true in your .yarnrc file
170+
* Clear the yarn cache with "yarn cache clean" before adding the updated version of the package
171+
* Add your package
172+
173+
The "yarn-offline-mirror-pruning" will help clean up any unlinked dependencies. When you add the updated package, it will check the yarn cache first and pull any missing dependencies from there. This will prevent yarn adding new tarball back with the updated package. You want to make sure the yarn cache is all clean before you do any adding for cache module.
176174

177175
### You can check in “Offline mirror” into git or mercurial repository
178176

@@ -186,7 +184,6 @@ For example, out of 849 React Native dependencies totaling 23MB, only 10% are la
186184
Many Facebook teams, including the React Native team, decided to check in their “Offline mirror”.
187185
They all share the same “Offline mirror” which means that most dependencies for new projects are often already checked into that folder, so the cost of storing the packages in source control gets lower the more projects use it.
188186

189-
190187
### Let's compare checking in node_modules to checking in “Offline mirror”
191188

192189
The React Native team used to check in the `node_modules` folder but they hit several limits:
@@ -263,8 +260,6 @@ Untracked files:
263260
no changes added to commit (use "git add" and/or "git commit -a")
264261
```
265262

266-
267-
268263
### Did you know that Yarn is also distributed as a single bundle JS file in [releases](https://github.com/yarnpkg/yarn/releases) that can be used on CI systems without internet access?
269264

270265
![Files distributed with Yarn releases](/assets/posts/2016-11-24-offline-mirror/yarn-offline-blog-releases.png){:style="max-width: 700px"}
@@ -278,7 +273,6 @@ node ./yarn-0.23.2.js install
278273

279274
This is quite convenient for teams that use multiple operating systems and want to have atomic updates for Yarn.
280275

281-
282276
### This is going to get better
283277

284278
The “Offline mirror” was implemented early in Yarn's development cycle and we are working on improving it in a backwards compatible way:

_posts/2016-12-01-lockfiles-for-all.md

+29-29
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ you want to be sure that you're executing the same code across every system.
1414

1515
Yarn maintains consistency across machines in two key ways:
1616

17-
- Yarn uses a deterministic algorithm that builds up the entire dependency tree
17+
* Yarn uses a deterministic algorithm that builds up the entire dependency tree
1818
before placing files where they need to be.
19-
- Important info from the install process is stored in the `yarn.lock` lockfile
19+
* Important info from the install process is stored in the `yarn.lock` lockfile
2020
so that it can be shared between every system installing the dependencies.
2121

2222
This lockfile contains information about the exact versions of every single
@@ -34,11 +34,11 @@ system designed around "breaking" or "non-breaking" changes.
3434

3535
When you have a version such as `v1.2.3`, it's broken into three parts:
3636

37-
- **Major (1.x.x)***Changes that may cause user code to break*
38-
- **Minor (x.2.x)***Changes that add new features (but should not break user
39-
code)*
40-
- **Patch (x.x.3)***Changes that are fixing bugs in previous versions (but
41-
do not add new features and should not break user code)*
37+
* **Major (1.x.x)**_Changes that may cause user code to break_
38+
* **Minor (x.2.x)**_Changes that add new features (but should not break user
39+
code)_
40+
* **Patch (x.x.3)**_Changes that are fixing bugs in previous versions (but
41+
do not add new features and should not break user code)_
4242

4343
When a package publishes a new version, the author bumps major, minor, or patch
4444
based on the changes that they have made as a way to communicate them.
@@ -47,7 +47,7 @@ Users of packages should typically welcome minor and patch versions but should
4747
be wary of major versions as they could break your code.
4848

4949
Version ranges are a way of specifying which types of changes you want to
50-
accept and which versions you want to prevent. These version ranges then
50+
accept and which versions you want to prevent. These version ranges then
5151
resolve down to a single version which is either the version you have installed
5252
or the latest published version that matches your version range.
5353

@@ -61,7 +61,7 @@ for them to publish an accidental breaking change in a minor or patch version.
6161
If you install this breaking change when you don't intend to it could have bad
6262
consequences like breaking your app in production.
6363

64-
Lockfiles *lock* the versions for every single dependency you have installed.
64+
Lockfiles _lock_ the versions for every single dependency you have installed.
6565
This prevents "Works On My Machine" problems, and ensures that you don't
6666
accidentally get a bad dependency.
6767

@@ -73,10 +73,10 @@ you do not want that code to end up running without you knowing about it.
7373

7474
There are two primary types of projects that use Yarn:
7575

76-
- **Libraries***Projects that get published as packages to the registry and
77-
installed by users. (i.e. React or Babel)*
78-
- **Applications***Projects that only consume other packages, typically
79-
building some kind of product. (i.e. Your company's app)*
76+
* **Libraries**_Projects that get published as packages to the registry and
77+
installed by users. (i.e. React or Babel)_
78+
* **Applications**_Projects that only consume other packages, typically
79+
building some kind of product. (i.e. Your company's app)_
8080

8181
For applications, most developers agree that lockfiles are A Good Idea™.
8282
But there has been some question about using them when building libraries.
@@ -88,14 +88,14 @@ within your dependencies will be ignored.
8888

8989
It is important that Yarn behaves this way for two reasons:
9090

91-
- You would never be able to update the versions of sub-dependencies because
91+
* You would never be able to update the versions of sub-dependencies because
9292
they would be locked by other `yarn.lock` files.
93-
- Yarn would never be able to fold (de-duplicate) dependencies so that
93+
* Yarn would never be able to fold (de-duplicate) dependencies so that
9494
compatible version ranges only install a single version.
9595

9696
Some have wondered why libraries should use lockfiles at all if they do not and
9797
should not affect users. Even further, some have said that using lockfiles when
98-
developing libraries creates a *false sense of security* since your users could
98+
developing libraries creates a _false sense of security_ since your users could
9999
be installing different versions than you.
100100

101101
This seems to logically makes sense, but let's dive deeper into the problem.
@@ -106,10 +106,10 @@ So far we've been talking about dependencies as if there were only one type of
106106
dependency when in fact there are several different types. These are broken
107107
down into two categories:
108108

109-
- **Runtime***Dependencies that are used by the project's code and needed
110-
when the code is run.*
111-
- **Development***Dependencies that are only needed to work directly on the
112-
project*
109+
* **Runtime**_Dependencies that are used by the project's code and needed
110+
when the code is run._
111+
* **Development**_Dependencies that are only needed to work directly on the
112+
project_
113113

114114
When a library is installed by a user, only the runtime dependencies are
115115
installed. The development dependencies are only ever installed when working
@@ -128,36 +128,36 @@ but it seems to hold true across every ecosystem. You almost always need more
128128
code to develop projects than you need to run them.
129129

130130
When working on a library, it is far more likely that a development dependency
131-
breaks just because there are more of them that *could* break.
131+
breaks just because there are more of them that _could_ break.
132132

133133
## The Breaking Change Race
134134

135135
When a package accidentally publishes a breaking change it starts the clock on
136136
who will be the first person to catch it. Whoever installs that breaking change
137137
first will (most likely) be the first to discover it.
138138

139-
Let's *imagine* we have a package called `left-pad` which takes a string and
139+
Let's _imagine_ we have a package called `left-pad` which takes a string and
140140
adds a specified amount of padding in front of it. This small and seemingly
141141
harmless package is used by a really big project, which we'll just call...
142142
Babel.
143143

144-
One day, the maintainer of `left-pad` decides they are going to do something
144+
One day, the maintainer of `left-pad` decides they are going to do something
145145
unspeakably evil and make it pad the right side instead. They publish it as a
146146
patch version which quickly spreads to everyone using it.
147147

148148
Remember, Babel is a really huge project with tens of thousands of users and
149149
dozens of contributors. Let's try and figure out who will catch the padding
150150
fiasco first.
151151

152-
- Looking at build history, Babel was installed in CI (with the `left-pad`
152+
* Looking at build history, Babel was installed in CI (with the `left-pad`
153153
dependency) exactly **103 times** in the last 30 days.
154-
- Looking at statistics from the registry, Babel was installed (with
154+
* Looking at statistics from the registry, Babel was installed (with
155155
`left-pad`) by users over **5.5 Million times** in the same 30 days.
156156

157157
To put that in a different measurement:
158158

159-
- Contributors install Babel on average **every 7 hours**
160-
- Users install Babel about on average **every 0.5 seconds**
159+
* Contributors install Babel on average **every 7 hours**
160+
* Users install Babel about on average **every 0.5 seconds**
161161

162162
When the `left-pad` incident happened, users discovered it almost immediately.
163163
Notifying the Babel contributors via GitHub issues, tweets, Facebook messages,
@@ -187,7 +187,7 @@ suite the contributors can come up with.
187187
Users just write more code, and the code they write is not always what a
188188
library author will expect. The more popular the library the more edge cases
189189
users will find. Users will do things that you didn't even think was possible–
190-
it will *horrify* you. It will make you question the goodness of humanity.
190+
it will _horrify_ you. It will make you question the goodness of humanity.
191191

192192
Even if a contributor happened to beat users to finding a breaking change,
193193
there's a pretty decent chance they won't catch it anyways. Untested edge cases
@@ -216,7 +216,7 @@ want to fix a bug or add a small feature to a library.
216216
## The user's burden
217217

218218
Of course not every breaking change is a development dependency, and
219-
theoretically contributors *could* catch breaking changes before users notice
219+
theoretically contributors _could_ catch breaking changes before users notice
220220
them. In that (narrow) scenario, aren't we shifting the burden from
221221
contributors to users?
222222

_posts/2017-05-12-introducing-yarn.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ categories : announcements
88
share_text : "Yarn Create & Yarn 1.0"
99
---
1010

11-
1211
Last year was a great time for Javascript newcomers! A lot of starter-kit projects were published, refined, and some of them eventually went on to offer command line tools dedicated to make project creation easier. One such example is [create-react-app](https://github.com/facebookincubator/create-react-app), but most frameworks have their own tools, with various flavors and syntaxes.
1312

1413
Despite these tools, one problem remains: Users still need to know how to use their package managers before being able to start a new project. They need to know what's the difference between global packages and local packages, and how to make sure that the binaries are available from the shell, which can sometimes cause subtle issues. Further, because these globally installed tools need to be manually updated, most projects maintain a small cli wrapper that downloads the latest version of the tool itself. Fortunately, we're in a position where we can help with this to make building new applications more cohesive:
@@ -25,7 +24,7 @@ When ran, the create command will automatically install or update the requested
2524

2625
It is important to us to keep the feature small and extensible. Yarn should be a lightweight tool and `yarn create` is no exception: An immediate implication is that the create command is a completely agnostic tool: we make no assumption regarding what you want to create, and delegate all the behavior to the `create-*` packages! It is our hope that the community will come up with creative way to use this tool. Creating apps is but only one thing! Feel free to make packages that create tests, readmes, changelogs or anything else you want!
2726

28-
*Note: The `create-` prefix is inserted right before the package name. So, for example, if you run yarn create `@ng/app`, it will install the `@ng/create-app` package, then run it.*
27+
_Note: The `create-` prefix is inserted right before the package name. So, for example, if you run yarn create `@ng/app`, it will install the `@ng/create-app` package, then run it._
2928

3029
### Other Improvements
3130

_posts/2017-05-31-determinism.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ supports-color@^3.2.3:
3434
has-flag "^1.0.0"
3535
```
3636

37-
This is the `yarn.lock `file generated by running the command `yarn add supports-color`. This file contains the version of supports-color that our project is using as well as the exact version of all its sub-dependencies.
37+
This is the `yarn.lock` file generated by running the command `yarn add supports-color`. This file contains the version of supports-color that our project is using as well as the exact version of all its sub-dependencies.
3838

3939
With this lock file we can ensure that the version of `has-flag` that `supports-color` relies on is always the same version.
4040

@@ -80,7 +80,7 @@ npm 5 introduces a rework of the shrinkwrap feature called package-lock. This fi
8080
}
8181
```
8282

83-
Note that here all the packages listed in the first dependencies object are hoisted. This means that npm can use only the package-lock as the source of truth in order to build the final dependency graph whereas Yarn needs the accompanying` package.json` to seed it.
83+
Note that here all the packages listed in the first dependencies object are hoisted. This means that npm can use only the package-lock as the source of truth in order to build the final dependency graph whereas Yarn needs the accompanying`package.json` to seed it.
8484

8585
This means that npm has better assurances around hoisting position across npm versions at the cost of having a more dense lockfile. There’s currently no plan on how to support `package-lock.json` in Yarn as the story around lockfile interoperability is unclear. You could however imagine a future where Yarn supports both and updates them in tandem. We’re very interested in community feedback and encourage proposals for how this would work to be submitted as an [RFC](https://github.com/yarnpkg/rfcs).
8686

_posts/2017-06-16-supporting-more-registries.md

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ categories : announcements
88
share_text : "Yarn now supports even more private registries"
99
---
1010

11-
1211
Today, Yarn already supports a wide variety of different package feeds when fetching and downloading your dependencies. Up until now, there was however a small subset of public and private package feed providers that Yarn could not yet handle very well. One example of these package feed providers that were not yet supported was [Visual Studio Team Services](https://www.visualstudio.com/team-services/) (VSTS).
1312

1413
Let's explain why:

_posts/2017-06-19-adding-command-line-aliases-for-yarn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Let’s say you check for package distribution tags information pretty often, ar
1616

1717
## Bash & Zsh
1818

19-
[Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) is the default shell on most Unix-like systems; together with [Zsh](https://en.wikipedia.org/wiki/Z_shell), they both descended from the earlier [Bourne shell](https://en.wikipedia.org/wiki/Bourne_shell) and hence syntaxes are largely compatible. To add a simple alias in either Bash or Zsh, simply have the following line added into your `.bashrc` or `.zshrc`, respectively:
19+
[Bash](<https://en.wikipedia.org/wiki/Bash_(Unix_shell)>) is the default shell on most Unix-like systems; together with [Zsh](https://en.wikipedia.org/wiki/Z_shell), they both descended from the earlier [Bourne shell](https://en.wikipedia.org/wiki/Bourne_shell) and hence syntaxes are largely compatible. To add a simple alias in either Bash or Zsh, simply have the following line added into your `.bashrc` or `.zshrc`, respectively:
2020

2121
```sh
2222
alias ynf="yarn info --verbose --no-emoji"

0 commit comments

Comments
 (0)