Skip to content

Commit da63c6f

Browse files
devversionvivian-hu-zz
authored andcommitted
build: switch to yarn (#13362)
* build: switch to yarn * Use more recent version of Yarn
1 parent 4fc5ee1 commit da63c6f

File tree

7 files changed

+11732
-19672
lines changed

7 files changed

+11732
-19672
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# http://yaml-online-parser.appspot.com/
99

1010
var_1: &docker_image angular/ngcontainer:0.6.0
11-
var_2: &cache_key v2-ng-mat-{{ .Branch }}-{{ checksum "package-lock.json" }}-0.6.0
11+
var_2: &cache_key v2-ng-mat-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.6.0
1212

1313
# Define common ENV vars
1414
var_3: &define_env_vars

.travis.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,22 @@ jobs:
4141
if: type = cron
4242
env:
4343
global:
44-
- LOGS_DIR=/tmp/angular-material2-build/logs
45-
- SAUCE_USERNAME=angular-ci
46-
- BROWSER_STACK_USERNAME=angularteam1
47-
- BROWSER_STACK_ACCESS_KEY=CaXMeMHD9pr5PHg8N7Jq
48-
- BROWSER_PROVIDER_READY_FILE=/tmp/angular-material2-build/readyfile
49-
- BROWSER_PROVIDER_ERROR_FILE=/tmp/angular-material2-build/errorfile
44+
# Keep Yarn version in sync with Yarn version within Bazel WORKSPACE.
45+
- YARN_VERSION=1.9.4
46+
- LOGS_DIR=/tmp/angular-material2-build/logs
47+
- SAUCE_USERNAME=angular-ci
48+
- BROWSER_STACK_USERNAME=angularteam1
49+
- BROWSER_STACK_ACCESS_KEY=CaXMeMHD9pr5PHg8N7Jq
50+
- BROWSER_PROVIDER_READY_FILE=/tmp/angular-material2-build/readyfile
51+
- BROWSER_PROVIDER_ERROR_FILE=/tmp/angular-material2-build/errorfile
5052

5153
before_install:
5254
- source ./scripts/ci/travis-env.sh
55+
- source ./scripts/ci/install-yarn.sh
5356
- if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then ./scripts/install-angular-snapshot.sh --only-save; fi
5457

5558
install:
56-
- npm install
59+
- yarn install --frozen-lockfile --non-interactive
5760

5861
before_script:
5962
- mkdir -p $LOGS_DIR
@@ -62,5 +65,6 @@ script:
6265
- ./scripts/ci/travis-script.sh
6366

6467
cache:
68+
yarn: true
6569
directories:
6670
- ./node_modules/

WORKSPACE

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,21 @@ sass_repositories()
3333

3434
# NOTE: this rule installs nodejs, npm, and yarn, but does NOT install
3535
# your npm dependencies. You must still run the package manager.
36-
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "npm_install")
37-
node_repositories()
36+
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install")
37+
38+
node_repositories(
39+
# For deterministic builds, specify explicit NodeJS and Yarn versions. Keep the Yarn version
40+
# in sync with the version of Travis.
41+
node_version = "10.10.0",
42+
yarn_version = "1.9.4",
43+
)
3844

3945
# Use Bazel managed node modules. See more below:
4046
# https://github.com/bazelbuild/rules_nodejs#bazel-managed-vs-self-managed-dependencies
41-
npm_install(
47+
yarn_install(
4248
name = "npm",
4349
package_json = "//:package.json",
44-
package_lock_json = "//:package-lock.json",
50+
yarn_lock = "//:yarn.lock",
4551
)
4652

4753
# Setup TypeScript Bazel workspace

0 commit comments

Comments
 (0)