Commit Graph

103 Commits

Author SHA1 Message Date
Mark Stacey
2f89339ee2 fix(build): Apply bundle fix to legacy build (#6303)
The Webpack config for the modern build was adjusted recently to add a loader,
which is used as a workaround for a bug introduced by a recent dependency
update. The legacy config needed the same update.

The Webpack config was also updated in superficial ways to follow
recommendations made for migrating from Webpack v1 to v2 (e.g. using
`module.rules` instead of `module.loaders`). These changes should have no
functional impact, and should make migrating to future versions of Webpack
easier.

fix #6269
2018-08-28 18:48:38 +01:00
Simen Bekkhus
a67d02f2e3 Update update-homebrew.sh (#6297)
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->

**Summary**
Went down a rabbit hole with the formula, and noticed that the script wasn't updated.

<!-- Is the feature a substantial feature request? Please use https://github.com/yarnpkg/rfcs -->

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

**Test plan**
Not sure. @Daniel15 maybe has some thoughts?

<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->
2018-08-22 23:45:34 -07:00
Maël Nison
a49644b1bd Fixes the bundle build (#6274) 2018-08-17 10:54:07 +01:00
Anton Alexandrenok
7ab9eda095 Excluded shebang for lockfile package (#5788) 2018-05-06 12:34:07 +01:00
Maël Nison
2f1ad7f427 chore(release): Add changelog script (#5677)
**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`.
2018-04-16 17:04:59 +01:00
Peter Dave Hello
aada10ebee Enable curl --compressed option to speed up request (#5369) 2018-03-25 12:52:43 +01:00
Daniel Lo Nigro
03f942ce0e Enforce usage of TLS 1.2 when building Chocolatey package (#5422) 2018-02-27 13:55:02 -08:00
Burak Yiğit Kaya
5c4b6f382a ci(circle): Test all node versions on CircleCI (#4857)
**Summary**

This PR removes the custom Docker image we have and adds all node versions to CircleCI tests. The
aim is to levearge increased granularity and parallelism that the new CircleCI workflows provide.

**Test plan**

All new steps on CircleCI should pass.
2017-11-06 09:58:56 +00:00
Burak Yigit Kaya
ee5d4a153a Chore: use npm@4 for publishing tarballs
**Summary**

Yarn 1.1.0 release failed due to a bug in npm@5:
https://github.com/npm/npm/issues/16723. This patch uses `npx` to
force using `np@4` when publishing in `update-npm.sh`.

**Test plan**

CircleCI
2017-09-24 19:03:41 +01:00
Burak Yiğit Kaya
01dceb3a5b Fix: always use origin/master instead of master for homebrew (#4444)
* Fix: always use origin/master instead of master for homebrew

**Summary**

Fixes #3415. The old homebrew update script updated the repo
from remote but did not update the local `master` branch, thus
had the potential for conflicts and mismatches. This patch
forces it to use `origin/master` instead and uses the latest
up-to-date version from the source.

**Test plan**

N/A

* Stay on master
2017-09-19 10:40:06 +10:00
Burak Yiğit Kaya
3f94e774bf Chore: fix misues of -p in node infocations (#4415)
**Summary**

We've been using `node -p -e` where `-e` is redundant since
it is implied by `-p`: https://nodejs.org/api/cli.html#cli_p_print_script

This patch removes those extra `-e`s.

**Test plan**

All bundles should build on CI without errors.
2017-09-12 14:11:40 +01:00
James Kyle
6c0b94af20 Fix: fixes yarn workspace command (#4080)
**Summary**

Resolves #4021

This fixes the workspace command so that it runs in the correct directory and adds a test to validate it.

Previously the command was also relying on `process.argv` to get the executable path for `node` and `yarn`. However, that ends up being unreliable if yarn was run as part of another process (aka `jest`).

**Test plan**

Added integration tests.
2017-08-24 21:15:55 +01:00
William Hilton
2b09caff06 Update: Separate lockfile into its own npm package (#4114)
**Summary**

Fixes #3879. Separates the lockfile parser as a separate npm package.

**Test plan**

Existing unit tests.
2017-08-20 00:53:54 +01:00
Burak Yiğit Kaya
5cfb241cee Update: use a named version folder in NPM tarballs (#4094)
**Summary**

Fixes #3758. Makes the top-level folder in the tar archives have a name like `yarn-vX.Y.Z` instead of `dist` using the `--transform` and `-s` options in `tar` (they are different in GNU and BSD `tar`).

**Test plan**

Run `yarn build-dist` and then `tar -ztvf artifacts/yarn-v1.0.0.tar.gz`. Make sure the output lists all the files under `yarn-v1.0.0` directory.
2017-08-08 10:32:33 +01:00
Burak Yiğit Kaya
2c54c02453 Fix: Fix single-file builds and simplify bundles (#4063)
**Summary**

Fixes #4057.

**Test plan**

CI should pass, especially with `build-dist` job.

Manual:

 - Run `yarn build-dist`
 - Run `node artifacts/yarn-0.28.0.js --version`
 - Run `./dist/bin/yarn --version`

Make sure all above commands work without errors.
2017-08-02 12:54:40 +01:00
Burak Yiğit Kaya
61e402b1f7 Fix: avoid using process.exit() when possible (#3955)
**Summary**

Refs #3524. We are using `process.exit()` pretty liberally although it is [strongly advised not to use it](https://nodejs.org/api/process.html#process_process_exit_code) since it may cause the `stdout` to get corrupted/terminated before a full flush. This patch changes all possible `process.exit(code)` calls with `process.exitCode = code` statements.

We'd also ideally enable [no-process-exit](http://eslint.org/docs/rules/no-process-exit) rule in ESLint but it requires an upgrade to ESLint v4 which should be handled separately.

**Test plan**

Expect tests to pass and actually finish (not run indefinitely due to `yarn` not exiting at all). Also, the script referenced in #3524 to output something like the following:
```
DATA 18
DATA 8192
DATA 8192
DATA 5392
DATA 15
EXIT 0
```
2017-07-20 17:23:28 +01:00
Daniel Lo Nigro
77328c398e Publish npm release of Yarn directly from CircleCI (#3938) 2017-07-17 11:22:12 +01:00
Daniel Lo Nigro
f577788307 [ci skip] Make scripts/update-npm.sh executable 2017-07-10 10:08:50 -07:00
Daniel Lo Nigro
cbcdede995 Publish tarball with single JS file build to npm (#3866)
* Remove unneeded package.json fields from dist

We don't need dependencies and devDependencies in the package.json within the Yarn distributable, as the dependencies are bundled with Yarn itself. We also don't need "scripts" or "jest" as they're purely for development

* Add script for publishing to npm

* Add Jenkins job for publishing to npm
2017-07-09 12:12:30 +01:00
Simon Vocella
472a051ec8 Use eslint-plugin-prettier instead of custom scripts for prettier (#3796)
* use eslint-plugin-prettier instead of custom scripts for prettier

* remove prettier script
2017-07-03 14:28:22 -07:00
Michael Kriese
a7202858b0 Fix prettier on windows. (#3635) 2017-06-14 15:32:47 +01:00
Konstantin Raev
4463175c5c Workspace phase 3 & 4 (#3516)
* Workspaces phase 3 & 4

* fixed check command

* addressed comments from @arcanis

* returned if worksapce condititon
2017-06-02 19:57:23 +01:00
Simon Vocella
1b21157868 Delete eslint-plugin-prettify and revert back to custom scripts for prettier (#3426)
* delete eslint-plugin-prettify and return back to custom scripts

* formatting eslintrc

* set print-width to 120
2017-05-17 13:07:24 +01:00
Simon Vocella
25890c8cf9 add prettier and prettying everything (#3401)
* add prettier and prettying everything

* fix scripts and run yarn prettier

* fix scripts again and run yarn prettier

* use eslint-plugin-prettify instead of custom scripts
2017-05-16 19:12:03 +01:00
Simon Vocella
9931b39b87 use yarn instead of npm everywhere is possible aka Eating your own dog food (#3374) 2017-05-10 19:02:52 +01:00
Daniel Lo Nigro
6455ffc73e update-homebrew.sh: Check out master before deleting old branch
Closes #3305
2017-05-02 22:12:20 -07:00
Daniel Lo Nigro
5f28a9077d Only update Chocolatey and Homebrew for non-RC releases 2017-05-01 21:31:16 -07:00
Daniel Lo Nigro
40f7f9d978 Clean Homebrew Git repo before committing. Fixes #3275 2017-04-29 17:05:33 -07:00
Daniel Lo Nigro
65afaa5256 Pass version number to build-chocolatey and update-homebrew
Instead of always grabbing the Yarn version number from yarnpkg.com, allow it to be passed in as command line argument.
Updates Jenkins bump-version job to pass it in.

References https://github.com/yarnpkg/website/issues/471
2017-04-29 17:05:33 -07:00
Daniel Lo Nigro
50c5bf0cde Use npm's node-gyp if available, otherwise automatically install node-gyp (#3240)
* Attempt to install node-gyp if it's required but missing

* Try to use node-gyp version from npm

* Trailing commas
2017-04-24 10:44:48 +01:00
Maël Nison
978632278f Adds clean-mirror.sh to scripts (#3179) 2017-04-20 19:08:06 -07:00
Daniel Lo Nigro
bb45834217 Make update-homebrew.sh executable (#3132) 2017-04-13 09:49:19 -07:00
Daniel Lo Nigro
a3226f4a53 Automatically update Homebrew package when new versions are released (#3083)
Closes #2841
2017-04-13 08:19:09 -07:00
Daniel Lo Nigro
3af60cf9c1 Use standalone .js bundle in dist tarball rather than individual JS files (#3030)
Instead of including all the raw JS files in the dist tarball, just use the single Yarn JS file that's built as part of the build, along with a few other files that are required. This significantly reduces the number of files in the tarball:

```
C:\src\yarn\dist (bundle-as-dist) (yarn@0.23.0-0)
λ find .
.
./bin
./bin/node-gyp-bin
./bin/node-gyp-bin/node-gyp
./bin/node-gyp-bin/node-gyp.cmd
./bin/yarn
./bin/yarn.cmd
./bin/yarn.js
./bin/yarnpkg
./bin/yarnpkg.cmd
./lib
./lib/v8-compile-cache.js
./lib/yarn-cli.js
./LICENSE
./package.json
```

There are three .js files in the archive:
 - `lib/v8-compile-cache.js`:  Speeds up instantiation time by using the V8 code cache (https://www.npmjs.com/package/v8-compile-cache). This needs to be separate as it has to load **before** the bulk of the application code is loaded, so it can **not** be bundled
 - `lib/yarn-cli.js`: Contains all the bundled Yarn code
 - `bin/yarn.js`: Entry point to the app, just like today. Loads `v8-compile-cache` then loads `yarn-cli`

This change means that **only** the JavaScript files that are actually used are included, resulting in a nice file size reduction for the installation packages:
![](http://ss.dan.cx/2017/04/Yarn_bundle_dist_metrics_-_Google_Sheets_-_Google__01-13.51.49.png)

Differences are due to differing compression algorithms: Debian packages use xz or LZMA, RedHat uses gzip, Windows installer uses Cabinet

They're also slightly faster to extract:
![image 3](https://cloud.githubusercontent.com/assets/91933/24582332/483b41f4-16e2-11e7-9509-8024b1e78a39.png)

Testing was performed on my desktop computer (Intel Core i5 6500, Samsung 850 Evo 1TB SSD, Windows 10), with testing for Linux stuff (like installing the Debian package) tested in a Docker container.

Raw data: https://docs.google.com/spreadsheets/d/1d8jdf3DU_GUFdotlPl08PkYa8SkzStK2tgnQ54ivsm0/edit?usp=sharing

Performance is very slightly faster when using `v8-compile-cache` along with the bundled file, but it's not extremely significant (`yarn --version` went from 0.19s to 0.14s on my BuyVM server). The difference might be bigger on servers with slower disks (HDD) or with more overloaded servers.

I also deleted the `build-dist.ps1` file because we _should_ be able to assume that Bash is available on Windows, particularly if Git is installed (as it comes with Git Bash). I need to verify that this works on AppVeyor.
2017-04-08 14:40:19 -07:00
Maël Nison
508c959080 Remove the dependency on the "rc" module (#3063)
* Removes dependency on the "rc" module

* Removers shebang-loader, not used anymore

* Fixes flow errors

* Fixes tests on Windows
2017-04-07 15:28:55 +01:00
Daniel Lo Nigro
8506db8ffc [Chocolatey] Add UseBasicParsing to Invoke-WebRequest so it works in environments without the MSIE engine available (#2726) 2017-02-19 16:06:31 -08:00
wtgtybhertgeghgtwtg
88f558c057 Remove json-loader. (#2605) 2017-02-14 09:49:19 -08:00
philtay
fda53e97b0 Do not hardcode basedir in bin/yarn (#2455) 2017-01-16 15:38:49 -08:00
Konstantin Raev
9347540b09 fixes #2406 - don't create tag for preminor version change in master branch (#2407)
* fixes #2406 - don't create tag for preminor version change in master branch

* new line
2017-01-16 15:37:06 -08:00
QWp6t
500bd03a02 Add -loader suffix in webpack, closes #2410 (#2447)
Previously, packages named with `-loader` suffix could be specified as loaders within Webpack without requiring the suffix to be named explicitly. Webpack 2.1.0-beta.26 no longer looks for `-loader` suffix automatically, and packages have to therefore be named explicitly or `-loader` can be added to `resolveLoader.moduleExtensions`.
See: https://github.com/webpack/webpack/releases/tag/v2.1.0-beta.26
2017-01-14 19:03:47 +00:00
Daniel Lo Nigro
6a317c276e Convert scripts/install-latest.sh to a shim that loads the real script 2016-12-14 17:07:48 +11:00
Denis Gorbachev
2a0afc7321 Fix which check during yarn install (#2061) (#2071) 2016-11-29 18:49:51 +06:00
Pascal Berger
58e24ca6be Update build script so that it can be run from any directory (#2041) 2016-11-25 16:27:16 -08:00
Daniel Lo Nigro
42b47592ed Fixes two issues with the install script: (#2027)
- Old versions of Mac OS (10.10 and below) require the `-t` option for `mktemp`
 - The check for GPG wasn't returning correctly, and tried to run GPG even when not available

Closes #2012
Closes #1984
2016-11-24 15:45:43 -08:00
Daniel Lo Nigro
47ffc523d0 Verify GPG signature in installation script (#1949)
* Verify GPG signature in installation script

* Add YARN_GPG environment variable for omitting GPG check
2016-11-21 22:33:08 -08:00
Alan Wong
5be113bb9c Add --version flag to install script (#1928)
* Add `--version` flag to install script

* Lower case variable names

* Declare `latest_url` as a local
2016-11-17 20:35:14 -08:00
Sebastian McKenzie
15d011274e Add automatic check for updates that nags the user when there's a new version available (#1429)
* Add automatic check for updates that nags the user when there's a new version available - fixes #1138

* remove self-update

* add support for updating yarn to tarball installer

* use new installationMethod package.json value to output update command

* address comments from @Daniel15

* remove self update tests
2016-11-14 20:22:21 +00:00
Sebastian McKenzie
96a0fbb94e Remove crappy folders from node_modules in dist tarballs (#1810)
* Remove crappy folders from node_modules in dist tarballs

* add windows version of scripts/clean-node-modules
2016-11-14 13:35:26 +00:00
Konstantin Raev
dc22912b7f Mark master branch as "prerelease" (#1689)
* set prerelease 0.17.0-0

* bumped release script to make prereleases

* switched npm with yarn
2016-11-04 17:41:04 +00:00
Konstantin Raev
15d5c94b5c Revert "bump"
This reverts commit a748ea5029.
2016-11-04 16:59:54 +00:00