diff --git a/.circleci/config.yml b/.circleci/config.yml index be07044e2b..ee7c70cc2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ version: 2 # See https://blog.daemonl.com/2016/02/yaml.html # To validate changes, use an online parser, eg. # https://yaml-online-parser.appspot.com/ -var_1: &cache_key yarn-cache-{{ checksum "yarn.lock" }}-0.6.0 +var_1: &cache_key yarn-cache-{{ checksum "yarn.lock" }}-0.6.3 var_2: &run_in_ngcontainer docker: - image: angular/ngcontainer:0.6.0 diff --git a/WORKSPACE b/WORKSPACE index 22d40ebcbf..af7c0924dc 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -7,90 +7,51 @@ # imports also make sense when referencing the published package. workspace(name = "ngrx") -#################################### -# Fetch and install the NodeJS rules -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "634206524d90dc03c52392fa3f19a16637d2bcf154910436fe1d669a0d9d7b9c", - strip_prefix = "rules_nodejs-0.10.1", - url = "https://github.com/bazelbuild/rules_nodejs/archive/0.10.1.zip", -) - +# Load NodeJS rules. Note that this is technically not needed because +# `rules_typescript_dependencies()` would also load the NodeJS rules, but we specifically need +# at least v0.14.1 which includes: https://github.com/bazelbuild/rules_nodejs/pull/341 http_archive( - name = "io_bazel_rules_webtesting", - sha256 = "4fb0dca8c9a90547891b7ef486592775a523330fc4555c88cd8f09270055c2ce", - strip_prefix = "rules_webtesting-7ffe970bbf380891754487f66c3d680c087d67f2", - url = "https://github.com/bazelbuild/rules_webtesting/archive/7ffe970bbf380891754487f66c3d680c087d67f2.zip", + name = "build_bazel_rules_nodejs", + url = "https://github.com/bazelbuild/rules_nodejs/archive/0.14.1.zip", + strip_prefix = "rules_nodejs-0.14.1", + sha256 = "813eb51733d3632f456f3bb581d940ed64e80dab417595c93bf5ad19079898e2" ) load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install") -check_bazel_version("0.17.1") - -node_repositories( - package_json = ["//:package.json"], - preserve_symlinks = True, - node_version = "10.9.0", - yarn_version = "1.9.2", - node_repositories = { - "10.9.0-darwin_amd64": ("node-v10.9.0-darwin-x64.tar.gz", "node-v10.9.0-darwin-x64", "3c4fe75dacfcc495a432a7ba2dec9045cff359af2a5d7d0429c84a424ef686fc"), - "10.9.0-linux_amd64": ("node-v10.9.0-linux-x64.tar.xz", "node-v10.9.0-linux-x64", "c5acb8b7055ee0b6ac653dc4e458c5db45348cecc564b388f4ed1def84a329ff"), - "10.9.0-windows_amd64": ("node-v10.9.0-win-x64.zip", "node-v10.9.0-win-x64", "6a75cdbb69d62ed242d6cbf0238a470bcbf628567ee339d4d098a5efcda2401e"), - }, - yarn_repositories = { - "1.9.2": ("yarn-v1.9.2.tar.gz", "yarn-v1.9.2", "3ad69cc7f68159a562c676e21998eb21b44138cae7e8fe0749a7d620cf940204"), - }, -) +check_bazel_version("0.15.0") -#################################### -# Fetch and install the TypeScript rules +# Add TypeScript rules http_archive( - name = "build_bazel_rules_typescript", - sha256 = "3792cc20ef13bb1d1d8b1760894c3320f02a87843e3a04fed7e8e454a75328b6", - strip_prefix = "rules_typescript-0.15.1", - url = "https://github.com/bazelbuild/rules_typescript/archive/0.15.1.zip", + name = "build_bazel_rules_typescript", + url = "https://github.com/bazelbuild/rules_typescript/archive/0.18.0.zip", + strip_prefix = "rules_typescript-0.18.0", + sha256 = "4726e07a2f8d23b5e3af166f3b2a6e8aa75adad94b35ab4d959e8fe875f90272", ) -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() - -#################################### -# The Bazel buildtools repo contains tools like the BUILD file formatter, buildifier -# This commit matches the version of buildifier in angular/ngcontainer -# If you change this, also check if it matches the version in the angular/ngcontainer -# version in /.circleci/config.yml -BAZEL_BUILDTOOLS_VERSION = "82b21607e00913b16fe1c51bec80232d9d6de31c" +# Fetch transient dependencies of the TypeScript bazel rules. +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +rules_typescript_dependencies() -http_archive( - name = "com_github_bazelbuild_buildtools", - sha256 = "edb24c2f9c55b10a820ec74db0564415c0cf553fa55e9fc709a6332fb6685eff", - strip_prefix = "buildtools-%s" % BAZEL_BUILDTOOLS_VERSION, - url = "https://github.com/bazelbuild/buildtools/archive/%s.zip" % BAZEL_BUILDTOOLS_VERSION, -) +# NOTE: this rule installs nodejs, npm, and yarn, but does NOT install +# your npm dependencies. You must still run the package manager. +load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -http_archive( - name = "io_bazel_rules_go", - sha256 = "feba3278c13cde8d67e341a837f69a029f698d7a27ddbb2a202be7a10b22142a", - url = "https://github.com/bazelbuild/rules_go/releases/download/0.10.3/rules_go-0.10.3.tar.gz", +node_repositories( + # For deterministic builds, specify explicit NodeJS and Yarn versions. Keep the Yarn version + # in sync with the version of Travis. + node_version = "10.10.0", + yarn_version = "1.9.4", ) -load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") -go_rules_dependencies() -go_register_toolchains() - -load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") - -#################################### -# Fetching the Bazel source allows us to compile the Skylark linter -# Fetching the Bazel source code allows us to compile the Skylark linter -http_archive( - name = "io_bazel", - sha256 = "e373d2ae24955c1254c495c9c421c009d88966565c35e4e8444c082cb1f0f48f", - strip_prefix = "bazel-968f87900dce45a7af749a965b72dbac51b176b3", - url = "https://github.com/bazelbuild/bazel/archive/968f87900dce45a7af749a965b72dbac51b176b3.zip", +# Use Bazel managed node modules. See more below: +# https://github.com/bazelbuild/rules_nodejs#bazel-managed-vs-self-managed-dependencies +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) #################################### @@ -107,16 +68,20 @@ http_archive( url = "https://github.com/angular/angular-cli/archive/v6.1.0-rc.0.zip", ) -#################################### -# Tell Bazel about some workspaces that were installed from npm. +# Setup TypeScript Bazel workspace +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +ts_setup_workspace() + +# Add Angular rules local_repository( - name = "angular", - path = "node_modules/@angular/bazel", + name = "angular", + path = "node_modules/@angular/bazel", ) +# Add rxjs local_repository( - name = "rxjs", - path = "node_modules/rxjs/src", + name = "rxjs", + path = "node_modules/rxjs/src", ) load("@angular//:index.bzl", "ng_setup_workspace") diff --git a/yarn.lock b/yarn.lock index c891fb71f0..0af7419f6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -113,9 +113,9 @@ dependencies: tslib "^1.9.0" -"@angular/bazel@^6.1.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-6.1.0.tgz#a875e7c263bcc164c8a81d413053e444e4197f2c" +"@angular/bazel@^6.1.9": + version "6.1.9" + resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-6.1.9.tgz#71a236809c8e059e09489a2f82bf7cfb51df54e8" dependencies: "@bazel/typescript" "^0.15.0" "@types/node" "6.0.84" @@ -332,14 +332,14 @@ version "6.0.84" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.84.tgz#193ffe5a9f42864d425ffd9739d95b753c6a1eab" +"@types/node@^10.9.0": + version "10.11.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.11.4.tgz#e8bd933c3f78795d580ae41d86590bfc1f4f389d" + "@types/node@^6.0.46": version "6.0.109" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.109.tgz#addc070c5b0a528c286ff4188d7dcafdafbfdcce" -"@types/node@^7.0.5": - version "7.0.64" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.64.tgz#8d5fc50e0944437e48e8aef4ab09910ec8661eee" - "@types/ora@^1.3.1": version "1.3.4" resolved "https://registry.yarnpkg.com/@types/ora/-/ora-1.3.4.tgz#b7fbbea8dac9851eb1918a761e2f4fae4cec03f5"