Skip to content

Commit 25b71c2

Browse files
committed
build: switch to yarn
1 parent 8ed0129 commit 25b71c2

File tree

6 files changed

+11717
-19576
lines changed

6 files changed

+11717
-19576
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ before_install:
5353
- if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then ./scripts/install-angular-snapshot.sh --only-save; fi
5454

5555
install:
56-
- npm install
56+
- yarn
5757

5858
before_script:
5959
- mkdir -p $LOGS_DIR
@@ -62,5 +62,6 @@ script:
6262
- ./scripts/ci/travis-script.sh
6363

6464
cache:
65+
yarn: true
6566
directories:
6667
- ./node_modules/

WORKSPACE

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
workspace(name = "angular_material")
22

33
# Load NodeJS rules. Note that this is technically not needed because
4-
# `rules_typescript_dependencies()` would also load the NodeJS rules, but we specifically need
5-
# at least v0.14.1 which includes: https://github.com/bazelbuild/rules_nodejs/pull/341
4+
# `rules_typescript_dependencies()` would also load the NodeJS rules, but we need a specific
5+
# version of the rules that includes: rules_nodejs#53523fd
66
http_archive(
77
name = "build_bazel_rules_nodejs",
8-
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.14.1.zip",
9-
strip_prefix = "rules_nodejs-0.14.1",
10-
sha256 = "813eb51733d3632f456f3bb581d940ed64e80dab417595c93bf5ad19079898e2"
8+
url = "https://github.com/bazelbuild/rules_nodejs/archive/53523fd7591650ef058220c2f7da788c94340aa3.zip",
9+
strip_prefix = "rules_nodejs-53523fd7591650ef058220c2f7da788c94340aa3",
10+
sha256 = "e43608890b082e5ed285c15dde93b6341e9495eda0d6de197bb2ca86879a8dca"
1111
)
1212

1313
# Add TypeScript rules
@@ -36,17 +36,20 @@ sass_repositories()
3636
# NOTE: this rule installs nodejs, npm, and yarn, but does NOT install
3737
# your npm dependencies. You must still run the package manager.
3838
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories",
39-
"npm_install")
39+
"yarn_install")
4040

41-
check_bazel_version("0.15.0")
42-
node_repositories()
41+
node_repositories(
42+
# For deterministic builds, specify explicit NodeJS and Yarn versions.
43+
node_version = "10.10.0",
44+
yarn_version = "1.9.4",
45+
)
4346

4447
# Use Bazel managed node modules. See more below:
4548
# https://github.com/bazelbuild/rules_nodejs#bazel-managed-vs-self-managed-dependencies
46-
npm_install(
49+
yarn_install(
4750
name = "npm",
4851
package_json = "//:package.json",
49-
package_lock_json = "//:package-lock.json",
52+
yarn_lock = "//:yarn.lock",
5053
)
5154

5255
# Setup TypeScript Bazel workspace

0 commit comments

Comments
 (0)