Skip to content

Commit

Permalink
build: update integration/bazel & @angular/bazel schematics to rules_…
Browse files Browse the repository at this point in the history
…nodejs 1.0.0

For the purposes of the integration test the zone.js script & bundle script tags can just go into the source index.html itself. The purpose of the integration test is is to test @angular/bazel & ng_module & ng_package so there is no need to exercise html_insert_assets in integration/bazel.
  • Loading branch information
gregmagolan committed Dec 29, 2019
1 parent 016b469 commit 61d63ec
Show file tree
Hide file tree
Showing 8 changed files with 358 additions and 257 deletions.
4 changes: 2 additions & 2 deletions integration/bazel/WORKSPACE
Expand Up @@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "9901bc17138a79135048fb0c107ee7a56e91815ec6594c08cb9a17b80276d62b",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.40.0/rules_nodejs-0.40.0.tar.gz"],
sha256 = "3887b948779431ac443e6a64f31b9e1e17b8d386a31eebc50ec1d9b0a6cabd2b",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.0.0/rules_nodejs-1.0.0.tar.gz"],
)

# Fetch sass rules for compiling sass files
Expand Down
24 changes: 16 additions & 8 deletions integration/bazel/package.json
Expand Up @@ -23,18 +23,26 @@
"@angular/compiler": "file:../../dist/packages-dist/compiler",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"@bazel/bazel": "file:../../node_modules/@bazel/bazel",
"@bazel/karma": "0.40.0",
"@bazel/protractor": "0.40.0",
"@bazel/rollup": "0.40.0",
"@bazel/terser": "0.40.0",
"@bazel/typescript": "0.40.0",
"@bazel/karma": "1.0.0",
"@bazel/protractor": "1.0.0",
"@bazel/rollup": "1.0.0",
"@bazel/terser": "1.0.0",
"@bazel/typescript": "1.0.0",
"@types/jasmine": "2.8.8",
"http-server": "0.11.1",
"rollup": "1.25.2",
"http-server": "0.12.0",
"karma": "4.4.1",
"karma-chrome-launcher": "3.1.0",
"karma-firefox-launcher": "1.2.0",
"karma-jasmine": "2.0.1",
"karma-requirejs": "1.1.0",
"karma-sourcemap-loader": "0.3.7",
"protractor": "5.4.2",
"requirejs": "2.3.6",
"rollup": "1.27.5",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-sourcemaps": "0.4.2",
"terser": "4.3.9",
"terser": "4.4.0",
"typescript": "3.6.4"
},
"scripts": {
Expand Down
19 changes: 11 additions & 8 deletions integration/bazel/src/BUILD.bazel
@@ -1,8 +1,8 @@
package(default_visibility = ["//visibility:public"])

load("@npm_angular_bazel//:index.bzl", "ng_module")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
load("@npm//http-server:index.bzl", "http_server")
load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package")
load("@npm_angular_bazel//:index.bzl", "ng_module")
load("@npm_bazel_rollup//:index.bzl", "rollup_bundle")
load("@npm_bazel_terser//:index.bzl", "terser_minified")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver")
Expand Down Expand Up @@ -36,13 +36,16 @@ filegroup(

ts_devserver(
name = "devserver",
additional_root_paths = ["npm/node_modules/zone.js/dist"],
entry_module = "bazel_integration_test/src/main",
index_html = "index.html",
scripts = [
":rxjs_umd_modules",
],
# Use the same bundle serving path as prodserver so that we can share
# an index.html file.
serving_path = "/bundle.min.js",
static_files = [
"index.html",
"@npm//:node_modules/zone.js/dist/zone.min.js",
],
deps = ["//src"],
Expand All @@ -64,14 +67,14 @@ terser_minified(
src = ":bundle",
)

web_package(
pkg_web(
name = "prodapp",
assets = [
# do not sort
"@npm//:node_modules/zone.js/dist/zone.min.js",
srcs = [
"index.html",
":bundle.min",
"@npm//:node_modules/zone.js/dist/zone.min.js",
],
index_html = "index.html",
additional_root_paths = ["npm/node_modules/zone.js/dist"],
)

http_server(
Expand Down
2 changes: 2 additions & 0 deletions integration/bazel/src/index.html
Expand Up @@ -9,5 +9,7 @@
<body>
<!-- The Angular application will be bootstrapped into this element. -->
<app-component></app-component>
<script src="/zone.min.js"></script>
<script src="/bundle.min.js"></script>
</body>
</html>

0 comments on commit 61d63ec

Please sign in to comment.