Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 0a5e58d

Browse files
authored
chore(*): update minimum Yarn version, do some Yarn-related cleanups
Included changes: *Update minimum Yarn version from 1.3.2 to 1.10.1* Yarn 1.10 added the integrity field to the lockfile, making newer Yarn users have their lockfile changed a lot if they run `yarn`. This commit updates the required Yarn version to be at least 1.10.1 and changes Travis & Jenkins to use Yarn 1.10.1 *Change the package.json's engines grunt field to grunt-cli* The grunt field suggested it's the grunt package version we're checking while we check the grunt-cli version instead. *Stop separating Yarn script arguments from script names via " -- "* The " -- " separator is necessary in npm but not in Yarn. In fact, it's deprecated in Yarn and some future version is supposed to start passing this parameter directly to the scripts which may break them. *Don't install grunt-cli globally during the build* It's enough to use `yarn grunt` instead of `grunt` and the global grunt-cli installation is no longer needed. *Use `yarn grunt` instead of `yarn run grunt`* The former form is shorter. *Don't define the `grunt` Yarn script* As opposed to npm, `yarn binName` invokes a binary named `binName` exposed by the respective package so the `grant` Yarn script is no longer needed. *Allow Node versions newer than 8; bump the minimum* Closes #16714
1 parent bb5a7e3 commit 0a5e58d

File tree

9 files changed

+1261
-21
lines changed

9 files changed

+1261
-21
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626
- secure: oTBjhnOKhs0qDSKTf7fE4f6DYiNDPycvB7qfSF5QRIbJK/LK/J4UtFwetXuXj79HhUZG9qnoT+5e7lPaiaMlpsIKn9ann7ffqFWN1E8TMtpJF+AGigx3djYElwfgf5nEnFUFhwjFzvbfpZNnxVGgX5YbIZpe/WUbHkP4ffU0Wks=
2727

2828
before_install:
29-
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2
29+
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.10.1
3030
- export PATH="$HOME/.yarn/bin:$PATH"
3131

3232
before_script:

Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if (!semver.satisfies(currentYarnVersion, expectedYarnVersion)) {
3030
}
3131

3232
// Grunt CLI version checks
33-
var expectedGruntVersion = pkg.engines.grunt;
33+
var expectedGruntVersion = pkg.engines['grunt-cli'];
3434
var currentGruntVersions = exec('grunt --version', {silent: true}).stdout;
3535
var match = /^grunt-cli v(.+)$/m.exec(currentGruntVersions);
3636
if (!match) {

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
"url": "https://github.com/angular/angular.js.git"
1010
},
1111
"engines": {
12-
"node": "^8.9.1",
13-
"yarn": ">=1.3.2",
14-
"grunt": "^1.2.0"
12+
"node": ">=8.12.0",
13+
"yarn": ">=1.10.1",
14+
"grunt-cli": "^1.2.0"
1515
},
1616
"scripts": {
1717
"commit": "git-cz",
1818
"test-i18n": "jasmine-node i18n/spec",
19-
"test-i18n-ucd": "jasmine-node i18n/ucd/spec",
20-
"grunt": "grunt"
19+
"test-i18n-ucd": "jasmine-node i18n/ucd/spec"
2120
},
2221
"devDependencies": {
2322
"angular-benchpress": "0.x.x",

scripts/jenkins/build.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ rm -f angular.js.size
2121

2222

2323
# BUILD #
24-
yarn run grunt -- ci-checks package --no-color
24+
yarn grunt ci-checks package --no-color
2525

2626
mkdir -p test_out
2727

2828
# UNIT TESTS #
29-
yarn run grunt -- test:unit --browsers="$BROWSERS" --reporters=dots,junit --no-colors --no-color
29+
yarn grunt test:unit --browsers="$BROWSERS" --reporters=dots,junit --no-colors --no-color
3030

3131
# END TO END TESTS #
32-
yarn run grunt -- test:ci-protractor
32+
yarn grunt test:ci-protractor
3333

3434
# DOCS APP TESTS #
35-
yarn run grunt -- test:docs --browsers="$BROWSERS" --reporters=dots,junit --no-colors --no-color
35+
yarn grunt test:docs --browsers="$BROWSERS" --reporters=dots,junit --no-colors --no-color
3636

3737
# Promises/A+ TESTS #
38-
yarn run grunt -- test:promises-aplus --no-color
38+
yarn grunt test:promises-aplus --no-color
3939

4040

4141
# CHECK SIZE #

scripts/jenkins/init-node.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ nvm install
88

99
# clean out and install yarn
1010
rm -rf ~/.yarn
11-
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2
11+
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.10.1
1212
export PATH="$HOME/.yarn/bin:$PATH"
1313

1414
# Ensure that we have the local dependencies installed
1515
yarn install
1616

1717
echo testing grunt version
18-
yarn run grunt -- --version
18+
yarn grunt --version

scripts/jenkins/release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function init {
3737
function build {
3838
cd ../..
3939
source scripts/jenkins/init-node.sh
40-
yarn run grunt -- ci-checks package --no-color
40+
yarn grunt ci-checks package --no-color
4141

4242
cd $SCRIPT_DIR
4343
}

scripts/travis/before_build.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -e
44

5-
yarn global add [email protected]
6-
75
mkdir -p "$LOGS_DIR"
86

97
if [ "$JOB" != "ci-checks" ]; then
@@ -13,13 +11,13 @@ fi
1311

1412
# ci-checks and unit tests do not run against the packaged code
1513
if [[ "$JOB" != "ci-checks" ]] && [[ "$JOB" != unit-* ]]; then
16-
grunt package
14+
yarn grunt package
1715
fi
1816

1917
# unit runs the docs tests too which need a built version of the code
2018
if [[ "$JOB" = unit-* ]]; then
21-
grunt validate-angular-files
22-
grunt build
19+
yarn grunt validate-angular-files
20+
yarn grunt build
2321
fi
2422

2523
# check this after the package, because at this point the browser_provider

scripts/travis/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ case "$JOB" in
2929
# convert commit range to 2 dots, as commitplease uses `git log`.
3030
# See https://github.com/travis-ci/travis-ci/issues/4596 for more info
3131
echo "Validate commit messages in PR:"
32-
yarn run commitplease -- "${TRAVIS_COMMIT_RANGE/.../..}"
32+
yarn run commitplease "${TRAVIS_COMMIT_RANGE/.../..}"
3333
fi
3434
;;
3535
"unit-core")

0 commit comments

Comments
 (0)