From 6eb8125700e6c1c56bb49182e2f534ca6a0dbb64 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Fri, 26 Oct 2018 22:41:03 -0700 Subject: [PATCH 1/2] Add angular material --- WORKSPACE | 16 ++++- package.json | 12 ++-- src/BUILD.bazel | 13 ++++ src/app.component.html | 4 +- src/app.module.ts | 7 +- src/hello-world/BUILD.bazel | 5 +- src/hello-world/hello-world.component.html | 4 +- src/hello-world/hello-world.component.spec.ts | 2 + src/hello-world/hello-world.module.ts | 4 +- src/index.html | 2 + src/material/BUILD.bazel | 13 ++++ src/material/material.module.ts | 12 ++++ src/module-id.js | 6 ++ src/todos/BUILD.bazel | 3 +- src/todos/todos.component.html | 17 ++--- src/todos/todos.module.ts | 3 +- yarn.lock | 69 ++++++++++++++----- 17 files changed, 154 insertions(+), 38 deletions(-) create mode 100644 src/material/BUILD.bazel create mode 100644 src/material/material.module.ts create mode 100644 src/module-id.js diff --git a/WORKSPACE b/WORKSPACE index c81b9a42b..ed0ae7d12 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -23,8 +23,8 @@ http_archive( # The @angular repo contains rule for building Angular applications http_archive( name = "angular", - url = "https://github.com/angular/angular/archive/7.0.1.zip", - strip_prefix = "angular-7.0.1", + url = "https://github.com/angular/angular/archive/7.0.2.zip", + strip_prefix = "angular-7.0.2", ) # The @rxjs repo contains targets for building rxjs with bazel @@ -35,6 +35,14 @@ http_archive( sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403", ) +# Angular material +# TODO(gmagolan): update to next tagged https://github.com/angular/material2 +http_archive( + name = "angular_material", + url = "https://github.com/angular/material2/archive/150c964c320c8573b6c02eb0a7024bb2919a22c2.zip", + strip_prefix = "material2-150c964c320c8573b6c02eb0a7024bb2919a22c2", +) + # Rules for compiling sass http_archive( name = "io_bazel_rules_sass", @@ -97,3 +105,7 @@ sass_repositories() load("@angular//:index.bzl", "ng_setup_workspace") ng_setup_workspace() + +load("@angular_material//:index.bzl", "angular_material_setup_workspace") + +angular_material_setup_workspace() diff --git a/package.json b/package.json index 1d2296240..6ed360336 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,14 @@ "zone.js": "0.8.26" }, "devDependencies": { - "@angular/bazel": "7.0.1", - "@angular/compiler": "7.0.1", - "@angular/compiler-cli": "7.0.1", - "@angular/core": "7.0.1", + "@angular/animations": "7.0.2", + "@angular/bazel": "7.0.2", + "@angular/cdk": "7.0.2", + "@angular/compiler": "7.0.2", + "@angular/compiler-cli": "7.0.2", + "@angular/common": "7.0.2", + "@angular/core": "7.0.2", + "@angular/material": "7.0.2", "@bazel/benchmark-runner": "0.1.0", "@bazel/ibazel": "0.5.0", "@bazel/karma": "0.20.3", diff --git a/src/BUILD.bazel b/src/BUILD.bazel index 857139b0e..63322536e 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -18,6 +18,7 @@ ng_module( tsconfig = ":tsconfig.json", deps = [ "//src/hello-world", + "//src/material", "//src/todos", "@angular//packages/core", "@angular//packages/router", @@ -35,12 +36,14 @@ ts_devserver( additional_root_paths = [ "npm/node_modules/zone.js/dist", "npm/node_modules/tslib", + "npm/node_modules/@angular/material/prebuilt-themes", "npm/node_modules/@ngrx/store/bundles", ], # Start from the development version of the main entry_module = "angular_bazel_example/src/main.dev", scripts = [ ":require.config.js", + ":module-id.js", ], # This is the URL we'll point our