**Summary**
1. Added node 10 to CircleCI
2. Fixed a test that was using the `net.createServer` method. This was having issues, likely because of this: https://github.com/nodejs/node/issues/20334 - it now uses a "normal" `http` server instead, serving the same purpose.
3. Changed the `readFirstAvailableStream` method in `util/fs.js`. I'm guessing this is related to the same issue as 2, but there have been quite some changes in `10` that might be causing this - so it's just a guess. Since this piece of code could be clearer and more conceise anyway, I opted to just change it. Now instead of relying on the stream `error` event to check if a file exists, it just explicitly checks it before starting the stream.
4. Upgraded `upath` from `1.0.2` to `1.0.5` which supports node 10 (found through its `engines` field when installing).
5. Upgraded Jest
6. Fixed a bug regarding replacing symlinks to non-existent targets on Windows
7. Removed a redundant test
8. Fixed two test cases that were failing frequently on macOS builds
fixes#5761fixes#5477
**Test plan**
CI should be green (including and especially the new node10 job!)
**Summary**
A previous change removed the -c option that was passed to the shell, causing script like "echo foo"
to fail if script-shell was set to bash. This change cleans up the way custom shell is specified,
passing the shell to node's child process spawner instead of trying to make it part of our command
string. Doing it this way seems to account for the previously required -c flag.
fixes#5699
**Test plan**
No test was added because our tests for the `yarn run` command use a mocked `execute-lifecycle-script`. Plus these tests would get run on windows too, so making a test that specified a config of `script-shell bash` would fail if it was unmocked.
Can be tested manually by creating a `.yarnrc` that contains:
```
script-shell bash
```
and adding a script like:
```
"scripts": {
"foo": "echo foo; echo bar; echo $SHELL"
}
```
which should produce the output
```
$ yarn run foo
yarn run v1.6.0
$ echo foo; echo bar; echo $SHELL
foo
bar
/bin/bash
✨ Done in 0.15s.
```
Adds the ability to yarn import using package-lock.json as the dependency-tree state. When one enters the yarn import command, if a package-lock.json file exists, yarn will attempt to import from it. If not, it will import from node_modules normally.
**Summary**
This is the fix for [#5517](https://github.com/yarnpkg/yarn/issues/5517) where backlashes in the output in Windows are broken if the directory path contains "\n". The **stringifyLangArgs** method has been modified so that "\n" will only be replaced by EOL if it is not preceded by a "\\".
**Test plan**
The test project path is C:\\Users\\An\\Documents\\Projects\\oss\\name\
Before
```
error An unexpected error occurred: "C:\\Users\\An\\Documents\\Projects\\oss\
ame\\package.json: Unexpected token U in JSON at position 139".
```
After
```
error An unexpected error occurred: "C:\\Users\\An\\Documents\\Projects\\oss\\name\\package.json: Unexpected token U in JSON at position 139".
```
Also added automated tests.
**Summary**
These are a few upgrades of dependencies in order to address issues on node 10 (in relation to: https://github.com/yarnpkg/yarn/issues/5477)
*duplexify* *3.5.0* => *3.5.4* (00d08fa3f2)
*v8-compile-cache* *^1.1.0* => *^2.0.0* (https://github.com/zertosh/v8-compile-cache/pull/7)
*natives* *1.1.0* => *1.1.3* (https://github.com/gulpjs/gulp/issues/2162)
The last did not have to do with `new Buffer` but was something I personally encountered when using `gulp` for building in `node 10`. I don't know how common this is, but the fix is easy and within scope, so decided to include it.
**Test plan**
CI should be green.
* feat(bin): Implement an optional parameter support to `yarn bin`
This allows to get the path to a binary without making assumptions regarding the layout of the
`node_modules` folder.
BREAKING CHANGE: n/a
n/a
* Adds `yarn bin` tests
* Update en.js
* Update bin.js
* Update bin.js
* Fixes the tests
* fix#5729: replace dependency on deepequal with deep-equal
* fix bogus lockfile (yarn.lock)
it should only remove deepequal (and its two dependencies
fast-apply and is-args) and add deep-equal
the first lockfile was produced with:
```
rm -f node_modules yarn.lock
yarn
```
this has been produced by restoring the original yarn.lock from
the master branch and:
```
rm -f node_modules
yarn
```
**Summary**
npm runs the pre and post pack scripts on publish, but yarn was not. Added these scripts.
fixes#5707
**Test plan**
Added a test that regex's the output to look for scripts being run.
If you look at the test, the regex is kinda weird, but I did it that way to make sure the log statements were in the correct order in the output.
**Summary**
This PR fixes#5721 where `upgrade` was not being silent when the `--silent`/`-s` flags were provided. It still printed the tree. 🖨🌳
**Test plan**
Added two new test cases.
Manual CLI tests:
Before:
```
> yarn-local upgrade --silent
└─ left-pad@1.3.0
└─ left-pad@1.3.0
```
After:
```
> yarn-local upgrade --silent
```
**Summary**
Fixes#5477 and #5704.
Remove usager of deprecated `Buffer`constructor to avoid ugly warnings on Node 10.
**Test plan**
Existing test should pass.
When specifying a directory as the first parameter to `publish` yarn was ignoring it and just using
`config.cwd`. This fix checks to see if the passed parameter is to a directory and if it is it sets
`config.cwd` to that directory, so that manifest loading and lifecycle script execution occur
correctly in that specified directory.
fixes#5678
**Summary**
Snapshots should not be used with `test.concurrent`. This PR fixes a
flaky test which was doing exactly this.
**Test plan**
CI should pass.
**Summary**
Fixes#976.
This is a bug fix to the problem where lifecycle scripts that try to go interactive hang yarn installs with no indication as to why.
This sets stdin to /dev/null and, on unix-like systems, detaches the process from the terminal making it unable to read /dev/tty.
Previously with the spinner enabled was impossible to give input to an interactive script on stdin, because a pipe was kept open from the main yarn process to the child process but it was never written to. Interactive scripts could previously use /dev/tty on unix-likes to bypass this, however the fact that scripts are run in parallel means that if two scripts go interactive in this manner that they'll step on each other.
This does not change the behavior if the spinner is disabled. Also added a simple integration test with a blocking install script that times out without the patch.
**Test plan**
Try running `yarn add semantic-ui`. Hangs without the patch, fails with the patch.
* fix(resolution): Prevent duplicate patterns in PackageResolver patternsByPackage array
Previously duplicate patterns would be inserted into this array, causing unneccecary looping and
manifest reading of the same patterns. It also caused a bug when duplicate patterns were marked as
peerDeps (#5676). We now prevent these duplicate entries.
#5676
* fix linting
* refactor Object.assign to expansion
**Summary**
Fixes#4925. Allow setting `bin-links false` in `.yarnrc`. Currently setting this option doesn't have any effect.
**Test plan**
* Create a package with a `.yarnrc` file containing the line `bin-links false`
* Run `yarn add gulp-cli` (or any package with binaries)
* Verify that no bin links were created in `node_modules/.bin`
* test: Fix failing test on master after a release of a new package
**Summary**
We had an integration test relying on a specific version of a package without coding that version
into the test. This PR fixes that and fixes tests failing on master as of now.
**Test plan**
CI should pass.
* Lockdown more package versions
* Don't use test.conccurent with snapshots
* Fix broken snapshots
**Summary**
This diff simply adds a script to easily generate the changelog between the current tag and the previous one.
**Test plan**
Manually ran `yarn changelog`.
**Summary**
Fixes#1610. Previously yarn would allow a dependency on a GitHub pull request with "#1/head" where 1 is the PR number. npm allows the format "#pull/1/head" as well. For compatibility, allowing Yarn to fall back to this format.
**Test plan**
Added a test to `git-ref-resolver` to test the case `"pull/10/head"`
fixes#5670
**Summary**
Currently, it's possible (although undocumented) to automatically bump the version by running something like `yarn version --loose-semver --new-version minor`. To me, this seems less convenient and less intuitive than something like `yarn version --minor` (closely comparable to `npm version minor`). I've added the ability to automatically increment the version with one of the flags: `--major`, `--minor`, or `--patch`. This will also satisfy feature request #5367.
**Test plan**
I've included Jest test cases for each of the new versioning flags.
**Summary**
Follow up to #5593. Looks like we use an npm-specific request header to reduce the bandwidth. That said, for some commands, we need the full responses, which was achieved by setting the `Accept: application/json` header manually. This patch introduces a more descriptive request option, `unfiltered` to standardize this usage.
See https://github.com/npm/npm-registry-client#requests for more info.
**Test plan**
Existing tests should pass.
**Summary**
* fixing currently broken owner command
* doesn't ask for npm username and password for list command
* adding basic test #3893
**Test plan**
Yarn now correctly displays the list of package owners. Also added automated tests.
**Summary**
Fixes#5420. NOTICE and licenseText for packages can be quite long which
can cause E2BIG errors when trying to put it into environment variables
when running scripts. Since these fields are not useful for scripts
anyway, add them to the current blacklist which already has a similar
field in it, `readme`.
**Test plan**
Added an automated test to ensure the env doesn't have these fields but
keeps any other keys.
**Summary**
`INIT_CWD` environment variable holds the full path you were in when you ran `yarn run`
Motivation: https://twitter.com/housecor/status/983773854530260992
**Test plan**
1. Create a script called `testscript.js`
2. In the file type `console.log(process.env.INIT_CWD);`
3. In `package.json` add a script with a key `testscript` and value `node testscript.js`
4. Build yarn
5. Call `../bin/yarn testscript` from the command line in a subfolder
6. The script should log the folder you're running the script from
Video: https://www.youtube.com/watch?v=XY_w8GVtuCY
**Test plan**
Added a new test.
**Summary**
Last year I contributed the ability to disable commit hooks when versioning with npm (See [this commit](2dec601c6d (diff-2992be03e25e9f38300b7ce175e4f4e1))). It makes sense to add the same functionality to yarn.
The original motivation for this feature is based on a pre-commit hook that included linting and testing a large code base, taking ~20 seconds to run. When that hook is run on the preceding commits, it's unnecessary and time-taking to do so on versioning. Because of that, it's nice to have the option to disable that git hook.
**Test plan**
Added lower level integration tests.
fixes#5660
**Summary**
Before it needed to have package argument to enter the block to filter the deps. Now it will do it if either a package is given or a --pattern is given.
**Test plan**
Corrected my incorrectly created tests.
Also `is-negative-zero` would not update as there is no new version which would be found in a caret. So changed that to `array-union` which has a version `1.0.2`
Renovate constantly nags us about pinning Docker image versions which we intentionally don't want to
(see #5622). This PR disables the whole Docker integration since we want our config to stay in this
very specific way for CI.
**Summary**
Adds pkg-tests-fixtures to module ignore path for Jest to avoid duplicate module errors during test
runs.
**Test plan**
Run `yarn test-only --clearCache; yarn test-only` and make sure you
don't see any `duplicate @providesModule` errors from pkg-tests folder.
**Summary**
Using ocaml repo for package-resolver tests were taking too long and very frequently timing out on
Windows. This patch replaces that with the much smaller left-pad repo.
**Test plan**
AppVeyor tests should not timeout for resolver tests from now on.
* Add test case to check behaviour for failing scripts
See #5451
* Fixed babel compilation of Error classes for nodejs 4
Added babel-plugin-transform-builtin-extend
* We don't actually need YARN_SILENT here
* fix(linking): Dont integrity check build artifacts
If an install script modified a file that existed in the package, then yarn would view the file as
stale on every command, mark the package as "fresh", and re-run the install scripts. With this
change, known build artifacts from the integrity file are checked, and if this package file is a
build atrifact, it's size and timestamp are not checked.
#932
* WIP log message for debugging on CI
* WIP adding logging for debugging CI
* WIP adding logging for debugging CI
* remove debugging console statements.
* fix file timestamps for node 8 copyFile. fixes issue on linux.
* change file mode to what works on windows
* add file timestamp comparison and skip if correction not needed
* fix lint errors
* add error handling to fixTimes for some edge cases
* pass undefined instead of 0 as a file id
* refactor fs code, move OS specific edge cases to fs-normalized.js
* empty commit to rerun CI
* fix logic error when closing file, and fix Flow error