Skip to content

Commit 52f2120

Browse files
committed
Use fine grained dependencies
1 parent d75e994 commit 52f2120

File tree

8 files changed

+3663
-3441
lines changed

8 files changed

+3663
-3441
lines changed

.circleci/config.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
# To validate changes, use an online parser, eg.
88
# http://yaml-online-parser.appspot.com/
99

10-
## IMPORTANT
11-
# If you change the `docker_image` version, also change the `cache_key` suffix and the version of
12-
# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file.
13-
var_1: &docker_image angular/ngcontainer:0.3.3
14-
var_2: &cache_key v2-ng-mat-{{ .Branch }}-{{ checksum "package-lock.json" }}-0.3.3
10+
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
1512

1613
# Define common ENV vars
1714
var_3: &define_env_vars
@@ -48,8 +45,7 @@ jobs:
4845
- restore_cache:
4946
key: *cache_key
5047

51-
- run: bazel run @nodejs//:npm install
52-
# TODO(jelbourn): Update this command to run all tests if the Bazel issues have been fixed.
48+
# TODO(jelbourn): Update this command to run all tests if the Bazel issues have been fixed.
5349
- run: bazel test src/{cdk,lib}/schematics:unit_tests
5450

5551
- save_cache:

BUILD.bazel

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,9 @@ package(default_visibility = ["//visibility:public"])
44

55
# TODO: Replace with fine-grained node_modules using `npm_install` / `yarn_install`.
66
# TODO: See https://github.com/bazelbuild/rules_nodejs/wiki#migrating-to-rules_nodejs-013
7-
filegroup(
7+
alias(
88
name = "node_modules",
9-
srcs = glob(["/".join(["node_modules", pkg, "**", ext]) for pkg in [
10-
"@angular",
11-
"@angular-devkit",
12-
"@schematics",
13-
"@types",
14-
"bytebuffer",
15-
"chalk",
16-
"fs-extra",
17-
"glob",
18-
"hammerjs",
19-
"jasmine",
20-
"minimist",
21-
"moment",
22-
"mock-fs",
23-
"parse5",
24-
"protobufjs",
25-
"protractor",
26-
"reflect-metadata",
27-
"rxjs",
28-
"tsickle",
29-
"tslib",
30-
"tslint",
31-
"tsutils",
32-
"typescript",
33-
"zone.js",
34-
] for ext in [
35-
"*.js",
36-
"*.json",
37-
"*.d.ts",
38-
]] + [
39-
"node_modules/http-server/**",
40-
# Reference all files of the "@schematics/angular" package because the schematic
41-
# tests depend on the template files of the angular schematics.
42-
"node_modules/@schematics/angular/**",
43-
]),
9+
actual = "@npm//:node_modules",
4410
)
4511

4612
# Glob pattern that matches all Angular testing bundles.

WORKSPACE

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

3+
# 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
6+
http_archive(
7+
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"
11+
)
12+
313
# Add TypeScript rules
414
http_archive(
515
name = "build_bazel_rules_typescript",
6-
url = "https://github.com/bazelbuild/rules_typescript/archive/0.17.0.zip",
7-
strip_prefix = "rules_typescript-0.17.0",
8-
sha256 = "1626ee2cc9770af6950bfc77dffa027f9aedf330fe2ea2ee7e504428927bd95d",
16+
url = "https://github.com/bazelbuild/rules_typescript/archive/0.18.0.zip",
17+
strip_prefix = "rules_typescript-0.18.0",
18+
sha256 = "4726e07a2f8d23b5e3af166f3b2a6e8aa75adad94b35ab4d959e8fe875f90272",
919
)
1020

1121
# Fetch transient dependencies of the TypeScript bazel rules.
@@ -15,24 +25,28 @@ rules_typescript_dependencies()
1525
# Add sass rules
1626
http_archive(
1727
name = "io_bazel_rules_sass",
18-
url = "https://github.com/bazelbuild/rules_sass/archive/0.1.0.zip",
19-
strip_prefix = "rules_sass-0.1.0",
20-
sha256 = "b243c4d64f054c174051785862ab079050d90b37a1cef7da93821c6981cb9ad4",
28+
url = "https://github.com/bazelbuild/rules_sass/archive/1.13.4.zip",
29+
strip_prefix = "rules_sass-1.13.4",
30+
sha256 = "5ddde0d3df96978fa537f76e766538c031dee4d29f91a895f4b1345b5e3f9b16",
2131
)
2232

2333
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
2434
sass_repositories()
2535

2636
# NOTE: this rule installs nodejs, npm, and yarn, but does NOT install
2737
# your npm dependencies. You must still run the package manager.
28-
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
38+
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories",
39+
"npm_install")
2940

3041
check_bazel_version("0.15.0")
31-
node_repositories(
32-
package_json = ["//:package.json"],
33-
# Disabled until we use fine-grained dependencies. This was previously disabled but is now
34-
# enabled by default.
35-
preserve_symlinks = False,
42+
node_repositories()
43+
44+
# Use Bazel managed node modules. See more below:
45+
# https://github.com/bazelbuild/rules_nodejs#bazel-managed-vs-self-managed-dependencies
46+
npm_install(
47+
name = "npm",
48+
package_json = "//:package.json",
49+
package_lock_json = "//:package-lock.json",
3650
)
3751

3852
# Setup TypeScript Bazel workspace
@@ -50,8 +64,3 @@ local_repository(
5064
name = "rxjs",
5165
path = "node_modules/rxjs/src",
5266
)
53-
54-
# This commit matches the version of buildifier in angular/ngcontainer
55-
# If you change this, also check if it matches the version in the angular/ngcontainer
56-
# version in /.circleci/config.yml
57-
BAZEL_BUILDTOOLS_VERSION = "82b21607e00913b16fe1c51bec80232d9d6de31c"

0 commit comments

Comments
 (0)