diff --git a/docs/install.md b/docs/install.md index cdb5228522..a70931c399 100644 --- a/docs/install.md +++ b/docs/install.md @@ -9,6 +9,7 @@ stylesheet: docs First, you need Bazel. We recommend using Bazelisk, which is a version-selection wrapper, similar to the `nvm` tool managing your version of Node. This is available on npm. +We also recommend installing `ibazel` which is the "watch mode" for Bazel. ```sh $ yarn add -D @bazel/bazelisk @bazel/ibazel @@ -17,8 +18,12 @@ $ npm install --save-dev @bazel/bazelisk @bazel/ibazel ``` > You could install a current bazel distribution, following the [bazel instructions]. + > If you use Bazelisk, see [this workaround](https://github.com/bazelbuild/bazelisk/issues/29#issuecomment-478062147) to get working command-line completion. +> It's reasonable to globally-install bazelisk so you get a `bazel` command in your $PATH. +> We don't recommend this with ibazel as the version is frequently changing. + Next, create a `WORKSPACE` file in your project root (or edit the existing one) containing: diff --git a/examples/angular/package.json b/examples/angular/package.json index 4b5d1982a0..6e591afe42 100644 --- a/examples/angular/package.json +++ b/examples/angular/package.json @@ -34,7 +34,7 @@ "@babel/cli": "^7.6.0", "@babel/core": "^7.6.0", "@babel/preset-env": "^7.6.0", - "@bazel/bazelisk": "^1.3.0", + "@bazel/bazelisk": "^1.4.0", "@bazel/benchmark-runner": "^0.1.0", "@bazel/buildifier": "^2.2.1", "@bazel/ibazel": "^0.12.4", @@ -64,13 +64,13 @@ "typescript": "3.8.3" }, "scripts": { - "build": "bazelisk build //src:prodapp", + "build": "bazel build //src:prodapp", "serve": "ibazel run //src:devserver", "deploy": "ng build && firebase deploy", - "serve-prod": "bazelisk run //src:prodserver", - "serve-ssr": "bazelisk run //src:universal_server", - "e2e": "bazelisk test //e2e:all", - "test": "bazelisk test //src/...", + "serve-prod": "bazel run //src:prodserver", + "serve-ssr": "bazel run //src:universal_server", + "e2e": "bazel test //e2e:all", + "test": "bazel test //src/...", "benchmark": "ibazel-benchmark-runner //src:devserver src/app/hello-world/hello-world.component.ts --url=http://localhost:5432", "postinstall": "ngcc", "generate": "node tools/generator/index.js", diff --git a/examples/angular/yarn.lock b/examples/angular/yarn.lock index 90c45766b8..df68a7c8e1 100644 --- a/examples/angular/yarn.lock +++ b/examples/angular/yarn.lock @@ -795,10 +795,10 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@bazel/bazelisk@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.3.0.tgz#dc312dd30ad01e9af86e53b40795ab6e545fa55b" - integrity sha512-73H1nq3572tTf+dhDT86aWQN+LCyfxrh05jabqPXp6cpR8soxte3gS5oUqkN36fUe+J2HzNiV4CXZTz4Xytd3Q== +"@bazel/bazelisk@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.4.0.tgz#401d7b89b8d89dd579d1e16cc24cd4d9281a4fbb" + integrity sha512-VNI/jF7baQiBy4x+u8gmSDsFehqaAuzMyLuCj0j6/aZCZSw2OssytJVj73m8sFYbXgj67D8iYEQ0gbuoafDk6w== "@bazel/benchmark-runner@^0.1.0": version "0.1.0" diff --git a/examples/angular_bazel_architect/package.json b/examples/angular_bazel_architect/package.json index dcfddbd51f..87b54ccbda 100644 --- a/examples/angular_bazel_architect/package.json +++ b/examples/angular_bazel_architect/package.json @@ -3,11 +3,11 @@ "version": "0.0.0", "scripts": { "ng": "ng", - "start": "bazelisk run :serve", - "build": "bazelisk build :build", - "test": "bazelisk test :test", - "lint": "bazelisk run :lint", - "e2e": "bazelisk test :e2e", + "start": "bazel run :serve", + "build": "bazel build :build", + "test": "bazel test :test", + "lint": "bazel run :lint", + "e2e": "bazel test :e2e", "postinstall": "patch-package && ngcc --properties es2015 browser module main --first-only" }, "private": true, @@ -33,7 +33,7 @@ "@angular/cli": "9.0.1", "@angular/compiler-cli": "9.0.0", "@angular/language-service": "9.0.0", - "@bazel/bazelisk": "^1.3.0", + "@bazel/bazelisk": "^1.4.0", "@bazel/buildifier": "^2.2.1", "@bazel/ibazel": "^0.12.4", "@types/jasmine": "~3.3.8", diff --git a/examples/angular_bazel_architect/yarn.lock b/examples/angular_bazel_architect/yarn.lock index 4b28395af7..fd5c2a854c 100644 --- a/examples/angular_bazel_architect/yarn.lock +++ b/examples/angular_bazel_architect/yarn.lock @@ -1029,10 +1029,10 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@bazel/bazelisk@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.3.0.tgz#dc312dd30ad01e9af86e53b40795ab6e545fa55b" - integrity sha512-73H1nq3572tTf+dhDT86aWQN+LCyfxrh05jabqPXp6cpR8soxte3gS5oUqkN36fUe+J2HzNiV4CXZTz4Xytd3Q== +"@bazel/bazelisk@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.4.0.tgz#401d7b89b8d89dd579d1e16cc24cd4d9281a4fbb" + integrity sha512-VNI/jF7baQiBy4x+u8gmSDsFehqaAuzMyLuCj0j6/aZCZSw2OssytJVj73m8sFYbXgj67D8iYEQ0gbuoafDk6w== "@bazel/buildifier@^2.2.1": version "2.2.1" diff --git a/examples/angular_view_engine/package.json b/examples/angular_view_engine/package.json index 51a30e6c39..6bce964993 100644 --- a/examples/angular_view_engine/package.json +++ b/examples/angular_view_engine/package.json @@ -32,7 +32,7 @@ "@babel/cli": "^7.6.0", "@babel/core": "^7.6.0", "@babel/preset-env": "^7.6.0", - "@bazel/bazelisk": "^1.3.0", + "@bazel/bazelisk": "^1.4.0", "@bazel/benchmark-runner": "^0.1.0", "@bazel/buildifier": "^2.2.1", "@bazel/ibazel": "^0.12.4", @@ -65,12 +65,12 @@ "typescript": "3.4.5" }, "scripts": { - "build": "bazelisk build //src:prodapp", + "build": "bazel build //src:prodapp", "serve": "ibazel run //src:devserver", "deploy": "ng build && firebase deploy", - "serve-prod": "bazelisk run //src:prodserver", - "e2e": "bazelisk test //e2e:all", - "test": "bazelisk test //src/...", + "serve-prod": "bazel run //src:prodserver", + "e2e": "bazel test //e2e:all", + "test": "bazel test //src/...", "benchmark": "ibazel-benchmark-runner //src:devserver src/app/hello-world/hello-world.component.ts --url=http://localhost:5432", "postinstall": "patch-package && ngc -p angular-metadata.tsconfig.json", "generate": "node tools/generator/index.js", diff --git a/examples/angular_view_engine/yarn.lock b/examples/angular_view_engine/yarn.lock index 3d797c3748..38dc54b763 100644 --- a/examples/angular_view_engine/yarn.lock +++ b/examples/angular_view_engine/yarn.lock @@ -803,10 +803,10 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@bazel/bazelisk@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.3.0.tgz#dc312dd30ad01e9af86e53b40795ab6e545fa55b" - integrity sha512-73H1nq3572tTf+dhDT86aWQN+LCyfxrh05jabqPXp6cpR8soxte3gS5oUqkN36fUe+J2HzNiV4CXZTz4Xytd3Q== +"@bazel/bazelisk@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.4.0.tgz#401d7b89b8d89dd579d1e16cc24cd4d9281a4fbb" + integrity sha512-VNI/jF7baQiBy4x+u8gmSDsFehqaAuzMyLuCj0j6/aZCZSw2OssytJVj73m8sFYbXgj67D8iYEQ0gbuoafDk6w== "@bazel/benchmark-runner@^0.1.0": version "0.1.0" diff --git a/examples/nestjs/package.json b/examples/nestjs/package.json index c6f8b38468..9b379f4a0e 100644 --- a/examples/nestjs/package.json +++ b/examples/nestjs/package.json @@ -1,7 +1,7 @@ { "private": true, "dependencies": { - "@bazel/bazelisk": "^1.3.0", + "@bazel/bazelisk": "^1.4.0", "@bazel/ibazel": "^0.12.4", "@bazel/jasmine": "^1.6.0", "@nestjs/common": "6.5.2", diff --git a/examples/nestjs/yarn.lock b/examples/nestjs/yarn.lock index 2b83c5a9f0..1114e5398a 100644 --- a/examples/nestjs/yarn.lock +++ b/examples/nestjs/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@bazel/bazelisk@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.3.0.tgz#dc312dd30ad01e9af86e53b40795ab6e545fa55b" - integrity sha512-73H1nq3572tTf+dhDT86aWQN+LCyfxrh05jabqPXp6cpR8soxte3gS5oUqkN36fUe+J2HzNiV4CXZTz4Xytd3Q== +"@bazel/bazelisk@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.4.0.tgz#401d7b89b8d89dd579d1e16cc24cd4d9281a4fbb" + integrity sha512-VNI/jF7baQiBy4x+u8gmSDsFehqaAuzMyLuCj0j6/aZCZSw2OssytJVj73m8sFYbXgj67D8iYEQ0gbuoafDk6w== "@bazel/ibazel@^0.12.4": version "0.12.4" diff --git a/examples/react_webpack/package.json b/examples/react_webpack/package.json index ff4feba3a8..2891e808bb 100644 --- a/examples/react_webpack/package.json +++ b/examples/react_webpack/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "@bazel/bazelisk": "^1.3.0", + "@bazel/bazelisk": "^1.4.0", "@bazel/buildifier": "^2.2.1", "@bazel/ibazel": "^0.12.4", "@bazel/typescript": "^1.6.0", diff --git a/examples/react_webpack/yarn.lock b/examples/react_webpack/yarn.lock index e5e76001c0..c7fd746512 100644 --- a/examples/react_webpack/yarn.lock +++ b/examples/react_webpack/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@bazel/bazelisk@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.3.0.tgz#dc312dd30ad01e9af86e53b40795ab6e545fa55b" - integrity sha512-73H1nq3572tTf+dhDT86aWQN+LCyfxrh05jabqPXp6cpR8soxte3gS5oUqkN36fUe+J2HzNiV4CXZTz4Xytd3Q== +"@bazel/bazelisk@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.4.0.tgz#401d7b89b8d89dd579d1e16cc24cd4d9281a4fbb" + integrity sha512-VNI/jF7baQiBy4x+u8gmSDsFehqaAuzMyLuCj0j6/aZCZSw2OssytJVj73m8sFYbXgj67D8iYEQ0gbuoafDk6w== "@bazel/buildifier@^2.2.1": version "2.2.1" diff --git a/package.json b/package.json index caf7152ecf..a7c9e1a5c1 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@babel/cli": "^7.6.2", "@babel/core": "^7.6.2", "@babel/preset-env": "^7.6.2", - "@bazel/bazelisk": "^1.3.0", + "@bazel/bazelisk": "^1.4.0", "@bazel/buildifier": "^0.26.0", "@bazel/buildozer": "^0.29.0", "@bazel/ibazel": "^0.10.3", @@ -95,15 +95,14 @@ "**/jest-serializer": "24.3.0" }, "scripts": { - "test": "bazelisk test --test_tag_filters=-e2e,-examples,-manual,-browser:firefox-local", - "test_windows": "bazelisk test --test_tag_filters=-e2e,-examples,-fix-windows,-manual,-browser:firefox-local", - "test_e2e": "bazelisk --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test --test_tag_filters=e2e --local_ram_resources=792 --test_arg=--local_ram_resources=13288", - "test_examples": "bazelisk --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test --test_tag_filters=examples --local_ram_resources=792 --test_arg=--local_ram_resources=13288", - "run_integration_test": "bazelisk --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m run --local_ram_resources=792 --test_arg=--local_ram_resources=13288", + "test": "bazel test --test_tag_filters=-e2e,-examples,-manual,-browser:firefox-local", + "test_windows": "bazel test --test_tag_filters=-e2e,-examples,-fix-windows,-manual,-browser:firefox-local", + "test_e2e": "bazel --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test --test_tag_filters=e2e --local_ram_resources=792 --test_arg=--local_ram_resources=13288", + "test_examples": "bazel --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test --test_tag_filters=examples --local_ram_resources=792 --test_arg=--local_ram_resources=13288", + "run_integration_test": "bazel --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m run --local_ram_resources=792 --test_arg=--local_ram_resources=13288", "run_integration_test_debug": "yarn run_integration_test --define=BAZEL_INTEGRATION_TEST_DEBUG=1", "test_all": "./scripts/test_all.sh", "clean_all": "./scripts/clean_all.sh", - "bazel": "bazelisk", "// Unchecked warnings": "The following warnings are not checked as disabling them locally is broken", "// rule-impl-return": "./internal/common/typescript_mock_lib.bzl:29: rule-impl-return: Avoid using the legacy provider syntax. (https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#rule-impl-return)", "// rule-impl-return(2)": "./packages/typescript/internal/protobufjs/ts_proto_library.bzl:105: rule-impl-return: Avoid using the legacy provider syntax. (https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#rule-impl-return)", @@ -121,7 +120,7 @@ "update-codeowners": "./scripts/update_codeowners.sh", "format": "git-clang-format", "format-all": "clang-format --glob='{internal/**/,examples/**/}*.{js,ts}' -i", - "stardoc": "bazelisk build //docs && cp -f dist/bin/docs/*.md docs", + "stardoc": "bazel build //docs && cp -f dist/bin/docs/*.md docs", "version": "conventional-changelog -p angular -i CHANGELOG.md -s && node ./scripts/on-version.js && bazel build //:release && node ./scripts/on-release.js && git stage version.bzl docs/install.md packages/create/index.js README.md CHANGELOG.md e2e/*/WORKSPACE examples/*/WORKSPACE", "postinstall": "patch-package && node internal/npm_install/test/postinstall.js" }, diff --git a/packages/create/index.js b/packages/create/index.js index 0a4111f33d..3697be6c0b 100644 --- a/packages/create/index.js +++ b/packages/create/index.js @@ -187,8 +187,8 @@ bazel-out private: true, devDependencies, scripts: { - 'build': 'bazelisk build //...', - 'test': 'bazelisk test //...', + 'build': 'bazel build //...', + 'test': 'bazel test //...', } }, null, 4)); diff --git a/scripts/publish_release.sh b/scripts/publish_release.sh index 3e208e178b..44f89aff12 100755 --- a/scripts/publish_release.sh +++ b/scripts/publish_release.sh @@ -11,7 +11,7 @@ set -u -e -o pipefail # $ npm login --registry https://wombat-dressing-room.appspot.com readonly NPM_COMMAND=${1:-publish} -readonly BAZEL_BIN=./node_modules/.bin/bazelisk +readonly BAZEL_BIN=./node_modules/.bin/bazel # Use a new output_base so we get a clean build # Bazel can't know if the git metadata changed diff --git a/scripts/update_codeowners.sh b/scripts/update_codeowners.sh index 95a95e3141..0c8c20172c 100755 --- a/scripts/update_codeowners.sh +++ b/scripts/update_codeowners.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Update the owners=[] attribute in //.github:gen_codeowners -BAZEL=./node_modules/.bin/bazelisk +BAZEL=./node_modules/.bin/bazel BUILDOZER=./node_modules/.bin/buildozer readonly new_owners=$( diff --git a/yarn.lock b/yarn.lock index f1c2e2e515..f5b4a465cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -937,10 +937,10 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@bazel/bazelisk@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.3.0.tgz#dc312dd30ad01e9af86e53b40795ab6e545fa55b" - integrity sha512-73H1nq3572tTf+dhDT86aWQN+LCyfxrh05jabqPXp6cpR8soxte3gS5oUqkN36fUe+J2HzNiV4CXZTz4Xytd3Q== +"@bazel/bazelisk@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.4.0.tgz#401d7b89b8d89dd579d1e16cc24cd4d9281a4fbb" + integrity sha512-VNI/jF7baQiBy4x+u8gmSDsFehqaAuzMyLuCj0j6/aZCZSw2OssytJVj73m8sFYbXgj67D8iYEQ0gbuoafDk6w== "@bazel/buildifier-darwin_x64@0.26.0": version "0.26.0"