Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rules nodejs 1.0 redo #34736

Closed
wants to merge 19 commits into from
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4398240
build: upgrade to rules_nodejs 1.0.0 (first stable release)
gregmagolan Dec 29, 2019
825d3d8
build: upgrade to io_bazel_rules_sass 1.24.0
gregmagolan Dec 29, 2019
a2ff79d
refactor: handle breaking changes in rules_nodejs 1.0.0
gregmagolan Dec 29, 2019
b150178
build: package-build & release scripts should handle new pkg_npm naming
gregmagolan Dec 29, 2019
ce3da38
build: update integration/bazel & @angular/bazel schematics to rules_…
gregmagolan Nov 27, 2019
7eb983e
build: update to @angular/cli 9.0.0-rc.4
gregmagolan Dec 30, 2019
aaa3e7d
build: update to rules nodejs 1.0.1
gregmagolan Jan 3, 2020
08c0df1
test: handle bootstrap templated_args in jasmine_node_test defaults.bzl
gregmagolan Jan 8, 2020
0873362
test: keep diff in integration/bazel minimal by not introducing addit…
gregmagolan Jan 8, 2020
f8ca3f3
build: renamed "injected_scripts" target to "asset_injected_index_html"
gregmagolan Jan 8, 2020
48d1d95
build: add a before-all-other bootstrap script that patches require
gregmagolan Jan 8, 2020
53b52ee
build: cleanup //tools/ts-api-guardian:tests target
gregmagolan Jan 8, 2020
37c0a0c
build: should use $(execpath) in npm_package_bin args
gregmagolan Jan 8, 2020
4b29151
build: derive ts_library dep from jasmine_node_test boostrap label if…
gregmagolan Jan 8, 2020
5158987
build: add better comments to defaults.bzl jasmine_node_test macro
gregmagolan Jan 9, 2020
d499337
test: add coverage to //tools/ts-api-guardian/... on WindowsCI
gregmagolan Jan 9, 2020
38687ac
test: test for regression where jasmine_node_test passes silently
gregmagolan Jan 11, 2020
527b566
build: update to rules_nodejs 1.1.0
gregmagolan Jan 12, 2020
9bcebac
fixup! refactor: handle breaking changes in rules_nodejs 1.0.0
gregmagolan Jan 12, 2020
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -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 = "16fc00ab0d1e538e88f084272316c0693a2e9007d64f45529b82f6230aedb073",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.42.2/rules_nodejs-0.42.2.tar.gz"],
sha256 = "c97bf38546c220fa250ff2cc052c1a9eac977c662c1fc23eda797b0ce8e70a43",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.1.0/rules_nodejs-1.1.0.tar.gz"],
)

# Check the bazel version and download npm dependencies
@@ -29,7 +29,7 @@ Try running `yarn bazel` instead.
minimum_bazel_version = "1.1.0",
)

check_rules_nodejs_version(minimum_version_string = "0.42.1")
check_rules_nodejs_version(minimum_version_string = "1.0.0")

# Setup the Node.js toolchain
node_repositories(
@@ -8,16 +8,19 @@ 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 = "c97bf38546c220fa250ff2cc052c1a9eac977c662c1fc23eda797b0ce8e70a43",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.1.0/rules_nodejs-1.1.0.tar.gz"],
)

# Fetch sass rules for compiling sass files
http_archive(
name = "io_bazel_rules_sass",
sha256 = "4f05239080175a3f4efa8982d2b7775892d656bb47e8cf56914d5f9441fb5ea6",
strip_prefix = "rules_sass-86ca977cf2a8ed481859f83a286e164d07335116",
url = "https://github.com/bazelbuild/rules_sass/archive/86ca977cf2a8ed481859f83a286e164d07335116.zip",
sha256 = "77e241148f26d5dbb98f96fe0029d8f221c6cb75edbb83e781e08ac7f5322c5f",
strip_prefix = "rules_sass-1.24.0",
urls = [
"https://github.com/bazelbuild/rules_sass/archive/1.24.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.24.0.zip",
],
)

# Check the bazel version and download npm dependencies
@@ -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.1.0",
"@bazel/protractor": "1.1.0",
"@bazel/rollup": "1.1.0",
"@bazel/terser": "1.1.0",
"@bazel/typescript": "1.1.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.7.4"
},
"scripts": {
@@ -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")
@@ -37,12 +37,14 @@ filegroup(
ts_devserver(
name = "devserver",
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"],
@@ -64,14 +66,13 @@ 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",
)

http_server(
@@ -9,5 +9,7 @@
<body>
<!-- The Angular application will be bootstrapped into this element. -->
<app-component></app-component>
<script src="/npm/node_modules/zone.js/dist/zone.min.js"></script>
<script src="/bundle.min.js"></script>
</body>
</html>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.