Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Idiomatic install & karma fixes, rules_nodejs 0.14.1 & bazel 0.17.1
Browse files Browse the repository at this point in the history
Closes #288

PiperOrigin-RevId: 214834503
  • Loading branch information
gregmagolan authored and alexeagle committed Sep 27, 2018
1 parent f6c8d2d commit 4116992
Show file tree
Hide file tree
Showing 39 changed files with 426 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .circleci/bazel.rc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build --experimental_repository_cache=/home/circleci/bazel_repository_cache
# Limit Bazel to consuming 2560K of RAM
build --local_resources=2560,1.0,1.0
# Also limit Bazel's own JVM heap to stay within our 4G container limit
startup --host_jvm_args=-Xmx2g
startup --host_jvm_args=-Xmx3g
# Since the default CircleCI container has only 4G, limiting the memory
# is required to keep Bazel from exhausting the memory. These values
# are determined experimentally. If the Bazel process crashes without
Expand Down
16 changes: 11 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

## IMPORTANT
# If you change the `docker_image` version, also change the `cache_key` suffix
var_1: &docker_image angular/ngcontainer:0.4.0
var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-0.4.0
var_1: &docker_image angular/ngcontainer:0.6.0
var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-0.6.0
var_3: &setup-bazel-remote-cache
run:
name: Start up bazel remote cache proxy
Expand Down Expand Up @@ -72,8 +72,11 @@ jobs:
- restore_cache:
key: *cache_key
- run: bazel --bazelrc=/dev/null info release
- run: bazel --bazelrc=/dev/null build ...
- run: bazel --bazelrc=/dev/null test ...
# We cherry pick the memory utilization options from .circleci/bazel.rc here.
# Since the default CircleCI container has only 4G, limiting the memory
# is required to keep Bazel from exhausting the memory.
- run: bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build ... --local_resources=2560,1.0,1.0
- run: bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g test ... --local_resources=2560,1.0,1.0

- save_cache:
key: *cache_key
Expand Down Expand Up @@ -109,7 +112,10 @@ jobs:
- run: .circleci/setup_cache.sh
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
- *setup-bazel-remote-cache
- run: yarn skylint
# Disable skylint for now as we're on an older version that is not
# compatible with Bazel 0.17.1 and the newer version has deprecated checks
# that fail in this repo that can't be turned off
# - run: yarn skylint

workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
node_modules
/bazel-*
/internal/e2e/package_karma/bazel-*
/internal/e2e/package_typescript/bazel-*
/internal/e2e/package_typescript_*/bazel-*
/internal/e2e/ts_auto_deps/bazel-*

internal/e2e/ts_auto_deps/simple/BUILD
Expand Down
14 changes: 0 additions & 14 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ js_library(

load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")

# A nodejs_binary for karma/karma to use by default in ts_web_test &
# ts_web_test_suite that depends on @npm//:@bazel/karma instead of the
# output of the //internal/karma/karma_concat_js ts_library rule. This
# default is for downstream users that depend on the @bazel/karma npm
# package. The generated @npm//:karma/karma target does not work
# as it does not have the additional data dependencies required.
nodejs_binary(
name = "karma/karma",
data = ["@npm//:@bazel/karma"],
entry_point = "karma/bin/karma",
install_source_map_support = False,
visibility = ["//visibility:public"],
)

# A nodejs_binary for @bazel/typescript/tsc_wrapped to use by default in
# ts_library that depends on @npm//:@bazel/typescript instead of the
# output of the //internal/tsc_wrapped ts_library rule. This
Expand Down
2 changes: 1 addition & 1 deletion examples/protocol_buffers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ts_web_test_suite(
bootstrap = ["@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts"],
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",
# TODO(gregmagolan): re-enable once `target_wrapped_test.conf.js does not exist!` issue resolved
# TODO(gregmagolan): re-enable once `Cannot find module 'Firefox.app/Contents/MacOS/firefox'` issue resolved
# "@io_bazel_rules_webtesting//browsers:firefox-local",
],
deps = ["test_lib"],
Expand Down
2 changes: 1 addition & 1 deletion examples/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ts_web_test_suite(
name = "testing",
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",
# TODO(gregmagolan): re-enable once `target_wrapped_test.conf.js does not exist!` issue resolved
# TODO(gregmagolan): re-enable once `Cannot find module 'Firefox.app/Contents/MacOS/firefox'` issue resolved
# "@io_bazel_rules_webtesting//browsers:firefox-local",
],
static_files = [
Expand Down
1 change: 1 addition & 0 deletions internal/common/tsconfig.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def create_tsconfig(
extra_root_dirs: Extra root dirs to be passed to tsc_wrapped.
module_path_prefixes: additional locations to resolve modules
module_roots: standard locations to resolve modules
node_modules_root: the node_modules root path
skip_goog_scheme_deps_checking: whether imports from 'goog:*' should be strict deps checked
Returns:
Expand Down
6 changes: 3 additions & 3 deletions internal/e2e/default_tsconfig_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'wksp'));
const WORKSPACE_BOILERPLATE = `
http_archive(
name = "build_bazel_rules_nodejs",
urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.14.0.zip"],
strip_prefix = "rules_nodejs-0.14.0",
sha256 = "0e39999df9bf8c6fce46629457edb8c0073ad68244483339af578d83bf4fb794",
urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.14.1.zip"],
strip_prefix = "rules_nodejs-0.14.1",
sha256 = "813eb51733d3632f456f3bb581d940ed64e80dab417595c93bf5ad19079898e2",
)
http_archive(
name = "bazel_skylib",
Expand Down
2 changes: 1 addition & 1 deletion internal/e2e/package_karma/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ts_web_test_suite(
srcs = glob(["*.js"]),
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",
# TODO(gregmagolan): re-enable once `target_wrapped_test.conf.js does not exist!` issue resolved
# TODO(gregmagolan): re-enable once `Cannot find module 'Firefox.app/Contents/MacOS/firefox'` issue resolved
# "@io_bazel_rules_webtesting//browsers:firefox-local",
],
)
5 changes: 5 additions & 0 deletions internal/e2e/package_karma/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Testing karma dependency

A karma 3.0.0 dependency is here to verify that a user's karma dependency doesn't interfere with
the ts_web_test_suite rule which depends on a transitive dependency in @bazel/karma on a fork
of karma.
3 changes: 2 additions & 1 deletion internal/e2e/package_karma/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"dependencies": {
"@bazel/karma": "file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package"
"@bazel/karma": "file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package",
"karma": "3.0.0"
}
}
Loading

0 comments on commit 4116992

Please sign in to comment.