From 8603132fc6f41245ed900b6684de6140d8a03b7b Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 15 Apr 2019 08:47:35 -0700 Subject: [PATCH 1/5] build: use Bazel from npm Also hook up bazel format/lint --- .circleci/config.yml | 11 +++++++---- package.json | 6 ++++++ tools/ts_json_schema.bzl | 8 ++------ yarn.lock | 42 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 54362128dbc1..9d503505552b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,12 +10,10 @@ # Variables ## IMPORTANT -# If you change the `docker_image` version, also change the `cache_key` suffix and the version of -# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file. # If you change the cache key prefix, also sync the restore_cache fallback to match. # Keep the static part of the cache key as prefix to enable correct fallbacks. # See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI. -var_1: &docker_image angular/ngcontainer:0.10.0 +var_1: &docker_image circleci/node:10.12 var_2: &cache_key angular_devkit-0.10.0-{{ checksum "yarn.lock" }} # Settings common to each job @@ -71,6 +69,11 @@ jobs: steps: - attach_workspace: *attach_options - run: npm run lint + - run: 'yarn bazel:format -mode=check || + (echo "BUILD files not formatted. Please run ''yarn bazel:format''" ; exit 1)' + # Run the skylark linter to check our Bazel rules + - run: 'yarn bazel:lint || + (echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)' validate: <<: *defaults @@ -145,7 +148,7 @@ jobs: steps: - attach_workspace: *attach_options - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - - run: bazel test ... + - run: yarn bazel:test snapshot_publish: <<: *defaults diff --git a/package.json b/package.json index 893335ecff3d..2a596c240cda 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,10 @@ ], "scripts": { "admin": "node ./bin/devkit-admin", + "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unused-variable", + "bazel:lint": "yarn bazel:format --lint=warn", + "bazel:lint-fix": "yarn bazel:format --lint=fix", + "bazel:test": "bazel test //...", "build": "npm run admin -- build", "build-tsc": "tsc -p tsconfig.json", "fix": "npm run admin -- lint --fix", @@ -79,6 +83,8 @@ "devDependencies": { "@angular/compiler": "^8.0.0-beta.12", "@angular/compiler-cli": "^8.0.0-beta.12", + "@bazel/bazel": "^0.24.0", + "@bazel/buildifier": "^0.22.0", "@bazel/karma": "~0.26.0", "@bazel/typescript": "~0.26.0", "@ngtools/json-schema": "^1.1.0", diff --git a/tools/ts_json_schema.bzl b/tools/ts_json_schema.bzl index 71f0923a401c..4615e8a94e34 100644 --- a/tools/ts_json_schema.bzl +++ b/tools/ts_json_schema.bzl @@ -26,18 +26,14 @@ _ts_json_schema_interface = rule( _ts_json_schema_interface_impl, attrs = { "src": attr.label( - allow_files = FileType([ - ".json", - ]), + allow_files = [".json"], mandatory = True, ), "out": attr.string( mandatory = True, ), "data": attr.label_list( - allow_files = FileType([ - ".json", - ]), + allow_files = [".json"], ), "_binary": attr.label( default = Label("//tools:quicktype_runner"), diff --git a/yarn.lock b/yarn.lock index 483eb9ae4e17..0d52d8c39246 100644 --- a/yarn.lock +++ b/yarn.lock @@ -188,6 +188,48 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" +"@bazel/bazel-darwin_x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.24.0.tgz#828ef298d8d542961df388f17b0244f4f4302a74" + integrity sha512-xly44vkcD/fauUb7Lm5Lme4qhEZdkuuyBKSVQUHPbYAGDdbj/W8dupI3bZREkJAgG/WrRU+WXUemMj4U8ZcLcw== + +"@bazel/bazel-linux_x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.24.0.tgz#9ef2e7266833ad2221fe4af4ceb6763d2897e3ff" + integrity sha512-p5ylPLWnJZDGbaIFBrtD/tp3Su5rMdzeeNJKU24XyiWQTHVZ3OD3I2Fb0ILCgfBjY8AlA7EtCtOI4hYnAuIOtg== + +"@bazel/bazel-win32_x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.24.0.tgz#02d83113a6c6ed99795a3e41bff5631aa141638d" + integrity sha512-/bcSEx+GoV/q7H4WM0jazfxTcurSiIIePhRv+d05mxRDcaWwhCO8KzmmZRWH1abW6npvq5tLkbSQi7G7nUBhgg== + +"@bazel/bazel@^0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.24.0.tgz#f4e68e3680ac299858c24c26be3d08d1151e78fc" + integrity sha512-/5E55tqH9ogAGF9Dd7RSCJmk7/xdlsPTAhsX3yEsEMs7GLdHlgD3jbeePsKUiHKKr8LXAufjTs2pXQfjrkZRMg== + optionalDependencies: + "@bazel/bazel-darwin_x64" "0.24.0" + "@bazel/bazel-linux_x64" "0.24.0" + "@bazel/bazel-win32_x64" "0.24.0" + +"@bazel/buildifier-darwin_x64@0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.22.0.tgz#00dde7ce03be8c550b3908dd91cf1fc0baef7ff7" + integrity sha512-tpJ6w3mmh8wBm/k5AidAZvjWm3Hge3ipSjGtxTfq/xgUCacAtGt219nwyAMs0CwLPuABLbcINQmmKtG5VpxK9A== + +"@bazel/buildifier-linux_x64@0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-linux_x64/-/buildifier-linux_x64-0.22.0.tgz#146c44bafbb1e4711725414582a49835d04b8618" + integrity sha512-qaE7QF2YHKOXFBk2QcwOBfA3Ipm08vP9ZK9Vxtubbq9O0MM5tWvfKI48VkfX6pg8QNXDJ+sBndznxQSSWstsWQ== + +"@bazel/buildifier@^0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-0.22.0.tgz#d1abc2ce4317ba71351276c6b1b9e1533abf8e3d" + integrity sha512-S+mrUwanR8HMcp92iEDk4D1oOLsVhCM42Hx0rqL1eVmXPwLYL+F/sIjeGTw/6BgxMEHVSl2M3CcTFAS0b60BTQ== + optionalDependencies: + "@bazel/buildifier-darwin_x64" "0.22.0" + "@bazel/buildifier-linux_x64" "0.22.0" + "@bazel/karma@~0.26.0": version "0.26.0" resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.26.0.tgz#6ad796686f5775df33a96fa5ef3df76a66aed3b2" From 63b39a2cb2edead8b9c45c153cd220bc2fab405d Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 15 Apr 2019 08:49:22 -0700 Subject: [PATCH 2/5] build: run Bazel format/lint fix --- WORKSPACE | 25 ++++---- etc/api/BUILD | 14 ++-- package.json | 2 +- packages/angular/cli/BUILD | 5 +- packages/angular/pwa/BUILD | 2 +- packages/angular_devkit/architect/BUILD | 30 ++++----- packages/angular_devkit/architect_cli/BUILD | 5 +- packages/angular_devkit/benchmark/BUILD | 22 +++---- packages/angular_devkit/build_optimizer/BUILD | 12 ++-- packages/angular_devkit/core/BUILD | 43 ++++++------- packages/angular_devkit/schematics/BUILD | 64 ++++++++----------- packages/angular_devkit/schematics_cli/BUILD | 4 +- packages/schematics/angular/BUILD | 19 +++--- packages/schematics/schematics/BUILD | 6 +- packages/schematics/update/BUILD | 17 ++--- .../tools/file-system-engine-host/BUILD | 7 +- tools/BUILD | 6 +- tools/build_event_protocol/BUILD | 9 ++- tools/ts_json_schema.bzl | 6 +- 19 files changed, 140 insertions(+), 158 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 02e12eec9d94..746d1a21c301 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -5,8 +5,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.7/rules_nodejs-0.27.7.tar.gz"], sha256 = "fb87ed5965cef93188af9a7287511639403f4b0da418961ce6defb9dcf658f51", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.7/rules_nodejs-0.27.7.tar.gz"], ) # TS API Guardian resides in Angular @@ -20,8 +20,8 @@ http_archive( # We use protocol buffers for the Build Event Protocol git_repository( name = "com_google_protobuf", - remote = "https://github.com/protocolbuffers/protobuf", commit = "b6375e03aa80274dae89410efdf46346413b2247", + remote = "https://github.com/protocolbuffers/protobuf", ) load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") @@ -29,47 +29,50 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install") + # 0.18.0 is needed for .bazelignore -check_bazel_version("0.18.0") +check_bazel_version(minimum_bazel_version = "0.18.0") + node_repositories( - 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" + "3c4fe75dacfcc495a432a7ba2dec9045cff359af2a5d7d0429c84a424ef686fc", ), "10.9.0-linux_amd64": ( "node-v10.9.0-linux-x64.tar.xz", "node-v10.9.0-linux-x64", - "c5acb8b7055ee0b6ac653dc4e458c5db45348cecc564b388f4ed1def84a329ff" + "c5acb8b7055ee0b6ac653dc4e458c5db45348cecc564b388f4ed1def84a329ff", ), "10.9.0-windows_amd64": ( "node-v10.9.0-win-x64.zip", "node-v10.9.0-win-x64", - "6a75cdbb69d62ed242d6cbf0238a470bcbf628567ee339d4d098a5efcda2401e" + "6a75cdbb69d62ed242d6cbf0238a470bcbf628567ee339d4d098a5efcda2401e", ), }, + node_version = "10.9.0", yarn_repositories = { "1.9.2": ( "yarn-v1.9.2.tar.gz", "yarn-v1.9.2", - "3ad69cc7f68159a562c676e21998eb21b44138cae7e8fe0749a7d620cf940204" + "3ad69cc7f68159a562c676e21998eb21b44138cae7e8fe0749a7d620cf940204", ), }, + yarn_version = "1.9.2", ) yarn_install( name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", data = [ "//:tools/yarn/check-yarn.js", ], + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + install_bazel_dependencies() load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/etc/api/BUILD b/etc/api/BUILD index 3e8f83d9bea7..cd8577ba9d76 100644 --- a/etc/api/BUILD +++ b/etc/api/BUILD @@ -11,6 +11,13 @@ load("@angular//tools/ts-api-guardian:index.bzl", "ts_api_guardian_test") bundle[1], bundle[2], ), + allow_module_identifiers = [ + "fs", + "ts", + "ajv", + "Symbol", + "webpack", + ], data = glob([ "%s/%s/**/*.d.ts" % ( bundle[0], @@ -38,13 +45,6 @@ load("@angular//tools/ts-api-guardian:index.bzl", "ts_api_guardian_test") # @angular-devkit/build-optimizer "^buildOptimizerLoader$", ], - allow_module_identifiers = [ - "fs", - "ts", - "ajv", - "Symbol", - "webpack", - ], # At the moment using this will ignore a big change use_angular_tag_rules = False, ) for bundle in [b[:-len(".d.ts")].split("/", 2) for b in glob( diff --git a/package.json b/package.json index 2a596c240cda..2b40dad170d5 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ ], "scripts": { "admin": "node ./bin/devkit-admin", - "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unused-variable", + "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unused-variable", "bazel:lint": "yarn bazel:format --lint=warn", "bazel:lint-fix": "yarn bazel:format --lint=fix", "bazel:test": "bazel test //...", diff --git a/packages/angular/cli/BUILD b/packages/angular/cli/BUILD index 73a0d47bdda2..f225157d9a26 100644 --- a/packages/angular/cli/BUILD +++ b/packages/angular/cli/BUILD @@ -19,7 +19,10 @@ ts_library( "**/*_spec_large.ts", ], ), - data = glob(["**/*.json", "**/*.md"]), + data = glob([ + "**/*.json", + "**/*.md", + ]), module_name = "@angular/cli", # strict_checks = False, deps = [ diff --git a/packages/angular/pwa/BUILD b/packages/angular/pwa/BUILD index 1cbc93bc1477..62d5bb02bb1b 100644 --- a/packages/angular/pwa/BUILD +++ b/packages/angular/pwa/BUILD @@ -29,8 +29,8 @@ ts_library( ":pwa_schema", "//packages/angular_devkit/core", "//packages/angular_devkit/schematics", - "@npm//rxjs", "@npm//@types/node", + "@npm//rxjs", ], ) diff --git a/packages/angular_devkit/architect/BUILD b/packages/angular_devkit/architect/BUILD index 138ebff8da75..c2736412f275 100644 --- a/packages/angular_devkit/architect/BUILD +++ b/packages/angular_devkit/architect/BUILD @@ -15,14 +15,17 @@ ts_json_schema( name = "builder_input_schema", src = "src/input-schema.json", ) + ts_json_schema( name = "builder_output_schema", src = "src/output-schema.json", ) + ts_json_schema( name = "builder_builders_schema", src = "src/builders-schema.json", ) + ts_json_schema( name = "progress_schema", src = "src/progress-schema.json", @@ -41,15 +44,14 @@ ts_library( module_root = "node/index.d.ts", # strict_checks = False, deps = [ - "//packages/angular_devkit/core", - "//packages/angular_devkit/core:node", - "@npm//rxjs", - - "@npm//@types/node", ":architect", ":builder_builders_schema", ":builder_input_schema", ":builder_output_schema", + "//packages/angular_devkit/core", + "//packages/angular_devkit/core:node", + "@npm//@types/node", + "@npm//rxjs", ], ) @@ -62,18 +64,18 @@ ts_library( "**/*_spec_large.ts", ], ), - module_name = "@angular-devkit/architect", - module_root = "src/index.d.ts", # strict_checks = False, data = glob(["**/*.json"]), + module_name = "@angular-devkit/architect", + module_root = "src/index.d.ts", deps = [ - "//packages/angular_devkit/core", - "//packages/angular_devkit/core:node", - "@npm//rxjs", - "@npm//@types/node", ":builder_input_schema", ":builder_output_schema", ":progress_schema", + "//packages/angular_devkit/core", + "//packages/angular_devkit/core:node", + "@npm//@types/node", + "@npm//rxjs", ], ) @@ -92,17 +94,15 @@ ts_library( ":architect", "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", - "@npm//rxjs", - "@npm//@types/node", + "@npm//rxjs", ], ) - npm_package( name = "npm_package", deps = [ ":architect", - ":testing" + ":testing", ], ) diff --git a/packages/angular_devkit/architect_cli/BUILD b/packages/angular_devkit/architect_cli/BUILD index ad26cb545dc7..9dfd78cf63c9 100644 --- a/packages/angular_devkit/architect_cli/BUILD +++ b/packages/angular_devkit/architect_cli/BUILD @@ -19,10 +19,9 @@ ts_library( "//packages/angular_devkit/architect:node", "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", - "@npm//rxjs", - - "@npm//@types/node", "@npm//@types/minimist", + "@npm//@types/node", "@npm//@types/progress", + "@npm//rxjs", ], ) diff --git a/packages/angular_devkit/benchmark/BUILD b/packages/angular_devkit/benchmark/BUILD index 807343503c27..b1a4160c7e4e 100644 --- a/packages/angular_devkit/benchmark/BUILD +++ b/packages/angular_devkit/benchmark/BUILD @@ -25,15 +25,15 @@ ts_library( deps = [ "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", - "@npm//rxjs", - - "@npm//@types/node", "@npm//@types/minimist", + "@npm//@types/node", + "@npm//rxjs", ], ) ts_library( name = "benchmark_test_lib", + testonly = True, srcs = glob( include = [ "src/**/*_spec.ts", @@ -45,18 +45,16 @@ ts_library( "src/test/fibonacci.js", "src/test/test-script.js", ], + # @external_begin + tsconfig = "//:tsconfig-test.json", deps = [ ":benchmark", "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", - "@npm//rxjs", - - "@npm//@types/node", "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//rxjs", ], - testonly = True, - # @external_begin - tsconfig = "//:tsconfig-test.json", # @external_end ) @@ -65,12 +63,12 @@ jasmine_node_test( srcs = [":benchmark_test_lib"], deps = [ "@npm//jasmine", - "@npm//source-map", "@npm//minimist", - "@npm//pidusage", "@npm//pidtree", - "@npm//tree-kill", + "@npm//pidusage", + "@npm//source-map", "@npm//temp", + "@npm//tree-kill", ], ) diff --git a/packages/angular_devkit/build_optimizer/BUILD b/packages/angular_devkit/build_optimizer/BUILD index cacfa7db0a64..602373f36e8c 100644 --- a/packages/angular_devkit/build_optimizer/BUILD +++ b/packages/angular_devkit/build_optimizer/BUILD @@ -26,29 +26,29 @@ ts_library( deps = [ "@npm//@types/node", "@npm//@types/source-map", - "@npm//typescript", "@npm//@types/webpack", + "@npm//typescript", ], ) ts_library( name = "build_optimizer_test_lib", + testonly = True, srcs = glob( include = [ "src/**/*_spec.ts", "src/**/*_spec_large.ts", ], ), + # @external_begin + tsconfig = "//:tsconfig-test.json", deps = [ ":build_optimizer", "//packages/angular_devkit/core", - "@npm//@types/node", "@npm//@types/jasmine", + "@npm//@types/node", "@npm//@types/source-map", ], - testonly = True, - # @external_begin - tsconfig = "//:tsconfig-test.json", # @external_end ) @@ -58,7 +58,7 @@ jasmine_node_test( deps = [ "@npm//jasmine", "@npm//source-map", - ] + ], ) npm_package( diff --git a/packages/angular_devkit/core/BUILD b/packages/angular_devkit/core/BUILD index c26ae254b782..33930c4bc806 100644 --- a/packages/angular_devkit/core/BUILD +++ b/packages/angular_devkit/core/BUILD @@ -29,7 +29,6 @@ ts_library( # strict_checks = False, deps = [ "@npm//rxjs", - "@npm//@types/node", "@npm//@types/source-map", "@npm//ajv", @@ -42,28 +41,27 @@ ts_library( ts_library( name = "core_test_lib", + testonly = True, srcs = glob( include = [ "src/**/*_spec.ts", "src/**/*_spec_large.ts", ], ), + data = [ + "src/experimental/workspace/test/test-workspace.json", + "src/experimental/workspace/workspace-schema.json", + ], + # @external_begin + tsconfig = "//:tsconfig-test.json", # strict_checks = False, deps = [ ":core", ":node", - "@npm//rxjs", - - "@npm//@types/node", "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//rxjs", ], - data = [ - "src/experimental/workspace/workspace-schema.json", - "src/experimental/workspace/test/test-workspace.json" - ], - testonly = True, - # @external_begin - tsconfig = "//:tsconfig-test.json", # @external_end ) @@ -76,7 +74,6 @@ jasmine_node_test( ], ) - # @angular-devkit/core/node ts_library( @@ -94,32 +91,30 @@ ts_library( module_root = "node/index.d.ts", deps = [ ":core", - "@npm//rxjs", - "@npm//@types/node", + "@npm//rxjs", ], ) ts_library( name = "node_test_lib", + testonly = True, srcs = glob( include = [ "node/**/*_spec.ts", "node/**/*_spec_large.ts", ], ), + # @external_begin + tsconfig = "//:tsconfig-test.json", deps = [ ":core", ":node", "//tests/angular_devkit/core/node/jobs:jobs_test_lib", - "@npm//rxjs", - - "@npm//@types/node", "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//rxjs", ], - testonly = True, - # @external_begin - tsconfig = "//:tsconfig-test.json", # @external_end ) @@ -127,15 +122,14 @@ jasmine_node_test( name = "node_test", srcs = [":node_test_lib"], deps = [ - "@npm//jasmine", "@npm//chokidar", + "@npm//jasmine", "@npm//source-map", "@npm//temp", "@npm//tslint", ], ) - # @angular-devkit/core/node/testing ts_library( @@ -154,10 +148,9 @@ ts_library( deps = [ ":core", ":node", - "@npm//rxjs", - - "@npm//@types/node", "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//rxjs", ], ) diff --git a/packages/angular_devkit/schematics/BUILD b/packages/angular_devkit/schematics/BUILD index d218e503e6e6..0732766c5afa 100644 --- a/packages/angular_devkit/schematics/BUILD +++ b/packages/angular_devkit/schematics/BUILD @@ -27,33 +27,31 @@ ts_library( deps = [ "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", # TODO: get rid of this for 6.0 - "@npm//rxjs", - "@npm//@types/node", + "@npm//rxjs", ], ) ts_library( name = "schematics_test_lib", + testonly = True, srcs = glob( include = [ "src/**/*_spec.ts", "src/**/*_spec_large.ts", ], ), + # @external_begin + tsconfig = "//:tsconfig-test.json", deps = [ ":schematics", ":testing", "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", - "@npm//rxjs", - - "@npm//@types/node", "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//rxjs", ], - testonly = True, - # @external_begin - tsconfig = "//:tsconfig-test.json", # @external_end ) @@ -66,7 +64,6 @@ jasmine_node_test( ], ) - # @angular-devkit/schematics/tasks ts_library( @@ -85,13 +82,12 @@ ts_library( # strict_checks = False, deps = [ ":schematics", + "//packages/angular_devkit/core", + "//packages/angular_devkit/core:node", "@npm//@types/node", + "@npm//rxjs", "@npm//tslint", "@npm//typescript", - "@npm//rxjs", - - "//packages/angular_devkit/core:node", - "//packages/angular_devkit/core", ], ) @@ -114,14 +110,14 @@ ts_library( ":tasks", "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", - "@npm//rxjs", - "@npm//@types/node", + "@npm//rxjs", ], ) ts_library( name = "tasks_test_lib", + testonly = True, srcs = glob( include = [ "tasks/**/*_spec.ts", @@ -133,25 +129,22 @@ ts_library( "tasks/tslint-fix/test/collection.json", "tasks/tslint-fix/test/rules/customRuleRule.js", ], + # @external_begin + tsconfig = "//:tsconfig-test.json", deps = [ + ":schematics", ":tasks", ":testing", - ":schematics", "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", "//packages/angular_devkit/core:node_testing", - "@npm//rxjs", - - "@npm//@types/node", "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//rxjs", ], - testonly = True, - # @external_begin - tsconfig = "//:tsconfig-test.json", # @external_end ) - jasmine_node_test( name = "tasks_test", srcs = [":tasks_test_lib"], @@ -161,7 +154,6 @@ jasmine_node_test( ], ) - # @angular-devkit/schematics/tools ts_library( @@ -183,14 +175,14 @@ ts_library( ":tasks_node", "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", - "@npm//rxjs", - "@npm//@types/node", + "@npm//rxjs", ], ) ts_library( name = "tools_test_lib", + testonly = True, srcs = glob( include = [ "tools/**/*_spec.ts", @@ -198,22 +190,20 @@ ts_library( "tools/test/**/*.ts", ], ), + # @external_begin + tsconfig = "//:tsconfig-test.json", deps = [ - ":tools", - ":tasks", ":schematics", + ":tasks", ":testing", + ":tools", "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", "//tests/angular_devkit/schematics/tools/file-system-engine-host:file_system_engine_host_test_lib", - "@npm//rxjs", - - "@npm//@types/node", "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//rxjs", ], - testonly = True, - # @external_begin - tsconfig = "//:tsconfig-test.json", # @external_end ) @@ -226,7 +216,6 @@ jasmine_node_test( ], ) - # @angular-devkit/schematics/testing ts_library( @@ -242,9 +231,8 @@ ts_library( ":tasks_node", ":tools", "//packages/angular_devkit/core", - "@npm//rxjs", - "@npm//@types/node", + "@npm//rxjs", ], ) @@ -253,7 +241,7 @@ npm_package( deps = [ ":schematics", ":tasks", + ":testing", ":tools", - ":testing" ], ) diff --git a/packages/angular_devkit/schematics_cli/BUILD b/packages/angular_devkit/schematics_cli/BUILD index 1c112566c6a9..8faa850b8c97 100644 --- a/packages/angular_devkit/schematics_cli/BUILD +++ b/packages/angular_devkit/schematics_cli/BUILD @@ -8,7 +8,6 @@ load("@npm_bazel_typescript//:defs.bzl", "ts_library") licenses(["notice"]) # MIT License - # @angular-devkit/schematics-cli ts_library( @@ -29,10 +28,9 @@ ts_library( "//packages/angular_devkit/schematics", "//packages/angular_devkit/schematics:tasks", "//packages/angular_devkit/schematics:tools", - "@npm//rxjs", - "@npm//@types/inquirer", "@npm//@types/minimist", "@npm//@types/node", + "@npm//rxjs", ], ) diff --git a/packages/schematics/angular/BUILD b/packages/schematics/angular/BUILD index 809ca81cb12e..4cde533fc2d0 100644 --- a/packages/schematics/angular/BUILD +++ b/packages/schematics/angular/BUILD @@ -13,7 +13,10 @@ package(default_visibility = ["//visibility:public"]) # Create a list of Tuple("path/file.json", "path_file") to be used as rules ALL_SCHEMA_TARGETS_PAIR = [ - (x, x.replace("/", "_").replace("-", "_").replace(".json", "")) + ( + x, + x.replace("/", "_").replace("-", "_").replace(".json", ""), + ) for x in glob(["*/schema.json"]) ] @@ -40,7 +43,7 @@ ts_library( "*/files/**/*.ts", "*/other-files/**/*.ts", # Exclude test helpers. - "utility/test/**/*.ts" + "utility/test/**/*.ts", ], ), module_name = "@schematics/angular", @@ -66,11 +69,12 @@ jasmine_node_test( ts_library( name = "angular_test_lib", + testonly = True, srcs = glob( include = [ "**/*_spec.ts", "**/*_spec_large.ts", - "utility/test/**/*.ts" + "utility/test/**/*.ts", ], ), data = glob( @@ -78,8 +82,10 @@ ts_library( "**/*.json", "*/files/**", "*/other-files/**", - ] + ], ), + # @external_begin + tsconfig = "//:tsconfig-test.json", deps = ALL_SCHEMA_DEPS + [ ":angular", "//packages/angular_devkit/core", @@ -90,9 +96,6 @@ ts_library( "@npm//@types/jasmine", "@npm//rxjs", ], - testonly = True, - # @external_begin - tsconfig = "//:tsconfig-test.json", # @external_end ) @@ -100,8 +103,8 @@ jasmine_node_test( name = "angular_test", srcs = [":angular_test_lib"], deps = [ + "//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript", "@npm//jasmine", "@npm//source-map", - "//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript", ], ) diff --git a/packages/schematics/schematics/BUILD b/packages/schematics/schematics/BUILD index 2247b2b3169a..2ed5ded5e831 100644 --- a/packages/schematics/schematics/BUILD +++ b/packages/schematics/schematics/BUILD @@ -6,6 +6,7 @@ licenses(["notice"]) # MIT load("@npm_bazel_typescript//:defs.bzl", "ts_library") + # load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") load("//tools:ts_json_schema.bzl", "ts_json_schema") @@ -30,9 +31,8 @@ ts_library( "//packages/angular_devkit/core", "//packages/angular_devkit/schematics", "//packages/angular_devkit/schematics:tasks", - "@npm//rxjs", - "@npm//@types/node", + "@npm//rxjs", ], ) @@ -75,7 +75,7 @@ ts_json_schema( # "//packages/angular_devkit/schematics", # "//packages/angular_devkit/schematics:testing", # "@npm//rxjs", -# +# # "@npm//@types/node", # "@npm//@types/jasmine", # ], diff --git a/packages/schematics/update/BUILD b/packages/schematics/update/BUILD index 146f202f90eb..a34004461e64 100644 --- a/packages/schematics/update/BUILD +++ b/packages/schematics/update/BUILD @@ -27,11 +27,9 @@ ts_library( "//packages/angular_devkit/core", "//packages/angular_devkit/schematics", "//packages/angular_devkit/schematics:tasks", - "@npm//rxjs", - "@npm//semver", - "@npm//@types/node", "@npm//@types/semver", + "@npm//rxjs", ], ) @@ -47,6 +45,7 @@ ts_json_schema( ts_library( name = "update_test_lib", + testonly = True, srcs = glob( include = [ "**/*_spec.ts", @@ -56,25 +55,23 @@ ts_library( data = glob( include = [ "**/*.json", - ] + ], ), + # @external_begin + tsconfig = "//:tsconfig-test.json", deps = [ ":update", "//packages/angular_devkit/core", "//packages/angular_devkit/schematics", "//packages/angular_devkit/schematics:testing", - "@npm//rxjs", - "@npm//@types/jasmine", "@npm//@types/node", "@npm//@types/semver", "@npm//@yarnpkg/lockfile", "@npm//ini", "@npm//pacote", + "@npm//rxjs", ], - testonly = True, - # @external_begin - tsconfig = "//:tsconfig-test.json", # @external_end ) @@ -83,7 +80,7 @@ jasmine_node_test( srcs = [":update_test_lib"], deps = [ "@npm//jasmine", - "@npm//source-map", "@npm//npm-registry-client", + "@npm//source-map", ], ) diff --git a/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD b/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD index 8f5209b06536..3a8d30e24538 100644 --- a/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD +++ b/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD @@ -16,7 +16,10 @@ ts_library( ], ), data = glob( - include = ["**/collection.json", "**/*.js"], + include = [ + "**/collection.json", + "**/*.js", + ], ), deps = [ "//packages/angular_devkit/schematics", @@ -24,7 +27,7 @@ ts_library( # "//packages/angular_devkit/core", # "//packages/angular_devkit/core:node", # "@npm//rxjs", - # + # "@npm//@types/jasmine", "@npm//@types/node", ], diff --git a/tools/BUILD b/tools/BUILD index 4c09dc0603cf..707a63093457 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -8,17 +8,17 @@ package(default_visibility = ["//visibility:public"]) load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") nodejs_binary( - name = 'quicktype_runner', + name = "quicktype_runner", data = [ "quicktype_runner.js", ], - node_modules = "@npm//quicktype-core", entry_point = "angular_cli/tools/quicktype_runner.js", + install_source_map_support = False, + node_modules = "@npm//quicktype-core", templated_args = [ # Needed so that node doesn't walk back to the source directory. # From there, the relative imports would point to .ts files. "--node_options=--preserve-symlinks", ], - install_source_map_support = False, ) # @external_end diff --git a/tools/build_event_protocol/BUILD b/tools/build_event_protocol/BUILD index 45ee40373780..aabf6d4b91f1 100644 --- a/tools/build_event_protocol/BUILD +++ b/tools/build_event_protocol/BUILD @@ -14,15 +14,14 @@ ts_library( name = "parse_bep", srcs = ["parse_bep.ts"], deps = [ - ":build_event_stream", - "@npm//@types/node", - "@npm//rxjs", - + ":build_event_stream", + "@npm//@types/node", + "@npm//rxjs", ], ) nodejs_binary( name = "parse", - entry_point = "angular_devkit/tools/build_event_protocol/parse_bep", data = [":parse_bep"], + entry_point = "angular_devkit/tools/build_event_protocol/parse_bep", ) diff --git a/tools/ts_json_schema.bzl b/tools/ts_json_schema.bzl index 4615e8a94e34..5cb9483aaa1f 100644 --- a/tools/ts_json_schema.bzl +++ b/tools/ts_json_schema.bzl @@ -21,7 +21,6 @@ def _ts_json_schema_interface_impl(ctx): return [DefaultInfo()] - _ts_json_schema_interface = rule( _ts_json_schema_interface_impl, attrs = { @@ -42,12 +41,11 @@ _ts_json_schema_interface = rule( ), }, outputs = { - "ts": "%{out}" + "ts": "%{out}", }, ) # @external_end - # Generates a library that contains the interface for a JSON Schema file. Takes a single `src` # argument as input, an optional data field for reference files, and produces a ts_library() # rule containing the typescript interface. @@ -74,6 +72,6 @@ def ts_json_schema(name, src, data = []): # @external_begin srcs = [ out, - ] + ], # @external_end ) From bc5d280be731409f6eba1ebd972cb9c34f1fb486 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 15 Apr 2019 09:09:30 -0700 Subject: [PATCH 3/5] build: update to latest bazel --- .circleci/config.yml | 2 ++ package.json | 2 +- yarn.lock | 44 ++++++++++++++++++++++---------------------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d503505552b..ce1a41cae5b8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -100,6 +100,7 @@ jobs: <<: *defaults environment: BASH_ENV: ~/.profile + NPM_CONFIG_PREFIX: ~/.npm-global resource_class: xlarge parallelism: 4 steps: @@ -113,6 +114,7 @@ jobs: <<: *defaults environment: BASH_ENV: ~/.profile + NPM_CONFIG_PREFIX: ~/.npm-global resource_class: xlarge parallelism: 4 steps: diff --git a/package.json b/package.json index 2b40dad170d5..580c2cdc4716 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "devDependencies": { "@angular/compiler": "^8.0.0-beta.12", "@angular/compiler-cli": "^8.0.0-beta.12", - "@bazel/bazel": "^0.24.0", + "@bazel/bazel": "0.24.1", "@bazel/buildifier": "^0.22.0", "@bazel/karma": "~0.26.0", "@bazel/typescript": "~0.26.0", diff --git a/yarn.lock b/yarn.lock index 0d52d8c39246..aae035b0edb8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -188,29 +188,29 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" -"@bazel/bazel-darwin_x64@0.24.0": - version "0.24.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.24.0.tgz#828ef298d8d542961df388f17b0244f4f4302a74" - integrity sha512-xly44vkcD/fauUb7Lm5Lme4qhEZdkuuyBKSVQUHPbYAGDdbj/W8dupI3bZREkJAgG/WrRU+WXUemMj4U8ZcLcw== - -"@bazel/bazel-linux_x64@0.24.0": - version "0.24.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.24.0.tgz#9ef2e7266833ad2221fe4af4ceb6763d2897e3ff" - integrity sha512-p5ylPLWnJZDGbaIFBrtD/tp3Su5rMdzeeNJKU24XyiWQTHVZ3OD3I2Fb0ILCgfBjY8AlA7EtCtOI4hYnAuIOtg== - -"@bazel/bazel-win32_x64@0.24.0": - version "0.24.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.24.0.tgz#02d83113a6c6ed99795a3e41bff5631aa141638d" - integrity sha512-/bcSEx+GoV/q7H4WM0jazfxTcurSiIIePhRv+d05mxRDcaWwhCO8KzmmZRWH1abW6npvq5tLkbSQi7G7nUBhgg== - -"@bazel/bazel@^0.24.0": - version "0.24.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.24.0.tgz#f4e68e3680ac299858c24c26be3d08d1151e78fc" - integrity sha512-/5E55tqH9ogAGF9Dd7RSCJmk7/xdlsPTAhsX3yEsEMs7GLdHlgD3jbeePsKUiHKKr8LXAufjTs2pXQfjrkZRMg== +"@bazel/bazel-darwin_x64@0.24.1": + version "0.24.1" + resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.24.1.tgz#11479d0548d83fea22e664452d3e70c5f2edf94e" + integrity sha512-EF2WlPIQeq4zhkwwSCDJncG/rA1C2xnjUynabzB04KOxEBj0lveqYLgoCvs6L3Y+1vp2TQJmKGVEG6GpYb4uUA== + +"@bazel/bazel-linux_x64@0.24.1": + version "0.24.1" + resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.24.1.tgz#59c61c4ed885fd7ceed1bc9d605db563a51b83bd" + integrity sha512-oFLpfUOzZK4VSOM49FMJjb5UOJ5HXpTZ+zBOVO0hfK+oAkRaRfZjQZoKm6wa67MxfvU4tP/LDWcw7uj6swaGLw== + +"@bazel/bazel-win32_x64@0.24.1": + version "0.24.1" + resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.24.1.tgz#ebc7b9958a5d0bb5ccca761852bcc750d07ec343" + integrity sha512-s+zFYNawvzDLnb0TBY4LmkT+8ZfjMJ6/dyVnH6w8Q24mevnJqTBflcPJUlXoLRCAtaK/S3+1KOfKPccIwDNDDg== + +"@bazel/bazel@0.24.1": + version "0.24.1" + resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.24.1.tgz#15380c4d5945de47c7be1e3a83e9a8d1607aa33b" + integrity sha512-iTTUqdI2dX4S+fQOGbhr84jRRv9FbYr8GX3L69Z/HurgcDrgErOKo1LGtOuSYqZYaEvQ+ZpV0aP7OzaUsv59WA== optionalDependencies: - "@bazel/bazel-darwin_x64" "0.24.0" - "@bazel/bazel-linux_x64" "0.24.0" - "@bazel/bazel-win32_x64" "0.24.0" + "@bazel/bazel-darwin_x64" "0.24.1" + "@bazel/bazel-linux_x64" "0.24.1" + "@bazel/bazel-win32_x64" "0.24.1" "@bazel/buildifier-darwin_x64@0.22.0": version "0.22.0" From 396f3d1353b41855172c072545c27a430e6234d0 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 15 Apr 2019 09:45:35 -0700 Subject: [PATCH 4/5] build: skip license check for @bazel packages need to fix them upstream --- .circleci/config.yml | 4 ++-- scripts/validate-licenses.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ce1a41cae5b8..bb1bdea29fca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,7 +105,7 @@ jobs: parallelism: 4 steps: - attach_workspace: *attach_options - - run: xvfb-run -a node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} + - run: PATH=~/.npm-global/bin:$PATH xvfb-run -a node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} - store_artifacts: path: /tmp/dist destination: cli/new-production @@ -119,7 +119,7 @@ jobs: parallelism: 4 steps: - attach_workspace: *attach_options - - run: xvfb-run -a node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} --ivy + - run: PATH=~/.npm-global/bin:$PATH xvfb-run -a node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} --ivy e2e-cli-ng-snapshots: <<: *defaults diff --git a/scripts/validate-licenses.ts b/scripts/validate-licenses.ts index 2aaa0478804c..40b8f0bce473 100644 --- a/scripts/validate-licenses.ts +++ b/scripts/validate-licenses.ts @@ -73,6 +73,14 @@ const ignoredPackages = [ 'true-case-path@1.0.2', // Apache-2.0 but broken license in package.json 'uws@9.14.0', // zlib license + // * Need to publish these with LICENSE files + // see https://github.com/bazelbuild/rules_nodejs/pull/696 + // TODO(alexeagle): remove these after a release that fixes it + '@bazel/bazel@0.24.1', + '@bazel/bazel-linux_x64@0.24.1', + '@bazel/buildifier@0.22.0', + '@bazel/buildifier-linux_x64@0.22.0', + // * Other 'font-awesome@4.7.0', // (OFL-1.1 AND MIT) 'stream-json@0.5.2', // 'New BSD' From ee1a09351899c7b45a779edc49cc8ba1e1643ed5 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 15 Apr 2019 14:39:10 -0700 Subject: [PATCH 5/5] build: update jasmine_node_test rules to come from npm --- .circleci/config.yml | 13 ++++++++++--- package.json | 3 +-- packages/angular_devkit/benchmark/BUILD | 3 ++- packages/angular_devkit/build_optimizer/BUILD | 3 ++- packages/angular_devkit/core/BUILD | 3 ++- packages/angular_devkit/schematics/BUILD | 3 ++- packages/schematics/angular/BUILD | 2 +- packages/schematics/schematics/BUILD | 2 -- packages/schematics/update/BUILD | 3 ++- scripts/validate-licenses.ts | 1 + yarn.lock | 9 ++++++++- 11 files changed, 31 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb1bdea29fca..79d6808dc248 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,14 +13,15 @@ # If you change the cache key prefix, also sync the restore_cache fallback to match. # Keep the static part of the cache key as prefix to enable correct fallbacks. # See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI. -var_1: &docker_image circleci/node:10.12 -var_2: &cache_key angular_devkit-0.10.0-{{ checksum "yarn.lock" }} +var_1: &default_docker_image circleci/node:10.12 +var_2: &browsers_docker_image circleci/node:10.12-browsers +var_3: &cache_key angular_devkit-0.10.0-{{ checksum "yarn.lock" }} # Settings common to each job anchor_1: &defaults working_directory: ~/ng docker: - - image: *docker_image + - image: *default_docker_image # After checkout, rebase on top of target branch. anchor_2: &post_checkout @@ -89,6 +90,8 @@ jobs: test-large: <<: *defaults + docker: + - image: *browsers_docker_image resource_class: large parallelism: 4 steps: @@ -98,6 +101,8 @@ jobs: e2e-cli: <<: *defaults + docker: + - image: *browsers_docker_image environment: BASH_ENV: ~/.profile NPM_CONFIG_PREFIX: ~/.npm-global @@ -112,6 +117,8 @@ jobs: e2e-cli-ivy: <<: *defaults + docker: + - image: *browsers_docker_image environment: BASH_ENV: ~/.profile NPM_CONFIG_PREFIX: ~/.npm-global diff --git a/package.json b/package.json index 580c2cdc4716..1b996eb2b8d7 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,6 @@ "build-tsc": "tsc -p tsconfig.json", "fix": "npm run admin -- lint --fix", "lint": "npm run admin -- lint", - "prebuildifier": "bazel build --noshow_progress @com_github_bazelbuild_buildtools//buildifier", - "buildifier": "find . -type f \\( -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/com_github_bazelbuild_buildtools/buildifier/buildifier", "templates": "node ./bin/devkit-admin templates", "test": "node ./bin/devkit-admin test", "test-large": "node ./bin/devkit-admin test --large --spec-reporter", @@ -85,6 +83,7 @@ "@angular/compiler-cli": "^8.0.0-beta.12", "@bazel/bazel": "0.24.1", "@bazel/buildifier": "^0.22.0", + "@bazel/jasmine": "~0.26.0", "@bazel/karma": "~0.26.0", "@bazel/typescript": "~0.26.0", "@ngtools/json-schema": "^1.1.0", diff --git a/packages/angular_devkit/benchmark/BUILD b/packages/angular_devkit/benchmark/BUILD index b1a4160c7e4e..423c6a642125 100644 --- a/packages/angular_devkit/benchmark/BUILD +++ b/packages/angular_devkit/benchmark/BUILD @@ -5,8 +5,9 @@ licenses(["notice"]) # MIT +load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:defs.bzl", "ts_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "npm_package") +load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") package(default_visibility = ["//visibility:public"]) diff --git a/packages/angular_devkit/build_optimizer/BUILD b/packages/angular_devkit/build_optimizer/BUILD index 602373f36e8c..03cc8af56aa7 100644 --- a/packages/angular_devkit/build_optimizer/BUILD +++ b/packages/angular_devkit/build_optimizer/BUILD @@ -5,8 +5,9 @@ licenses(["notice"]) # MIT +load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:defs.bzl", "ts_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "npm_package") +load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") package(default_visibility = ["//visibility:public"]) diff --git a/packages/angular_devkit/core/BUILD b/packages/angular_devkit/core/BUILD index 33930c4bc806..7466504a7b1d 100644 --- a/packages/angular_devkit/core/BUILD +++ b/packages/angular_devkit/core/BUILD @@ -4,8 +4,9 @@ # found in the LICENSE file at https://angular.io/license package(default_visibility = ["//visibility:public"]) +load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:defs.bzl", "ts_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "npm_package") +load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") licenses(["notice"]) # MIT License diff --git a/packages/angular_devkit/schematics/BUILD b/packages/angular_devkit/schematics/BUILD index 0732766c5afa..41d0462cca05 100644 --- a/packages/angular_devkit/schematics/BUILD +++ b/packages/angular_devkit/schematics/BUILD @@ -4,8 +4,9 @@ # found in the LICENSE file at https://angular.io/license package(default_visibility = ["//visibility:public"]) +load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:defs.bzl", "ts_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "npm_package") +load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") licenses(["notice"]) # MIT License diff --git a/packages/schematics/angular/BUILD b/packages/schematics/angular/BUILD index 4cde533fc2d0..d019922a14b8 100644 --- a/packages/schematics/angular/BUILD +++ b/packages/schematics/angular/BUILD @@ -5,8 +5,8 @@ licenses(["notice"]) # MIT +load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:defs.bzl", "ts_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") load("//tools:ts_json_schema.bzl", "ts_json_schema") package(default_visibility = ["//visibility:public"]) diff --git a/packages/schematics/schematics/BUILD b/packages/schematics/schematics/BUILD index 2ed5ded5e831..2534b7fbcb9c 100644 --- a/packages/schematics/schematics/BUILD +++ b/packages/schematics/schematics/BUILD @@ -6,8 +6,6 @@ licenses(["notice"]) # MIT load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -# load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") load("//tools:ts_json_schema.bzl", "ts_json_schema") package(default_visibility = ["//visibility:public"]) diff --git a/packages/schematics/update/BUILD b/packages/schematics/update/BUILD index a34004461e64..dc2b8c99d7e0 100644 --- a/packages/schematics/update/BUILD +++ b/packages/schematics/update/BUILD @@ -5,8 +5,8 @@ licenses(["notice"]) # MIT +load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:defs.bzl", "ts_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") load("//tools:ts_json_schema.bzl", "ts_json_schema") package(default_visibility = ["//visibility:public"]) @@ -30,6 +30,7 @@ ts_library( "@npm//@types/node", "@npm//@types/semver", "@npm//rxjs", + "@npm//semver", ], ) diff --git a/scripts/validate-licenses.ts b/scripts/validate-licenses.ts index 40b8f0bce473..c0c7a82ff82c 100644 --- a/scripts/validate-licenses.ts +++ b/scripts/validate-licenses.ts @@ -80,6 +80,7 @@ const ignoredPackages = [ '@bazel/bazel-linux_x64@0.24.1', '@bazel/buildifier@0.22.0', '@bazel/buildifier-linux_x64@0.22.0', + '@bazel/jasmine@0.26.0', // * Other 'font-awesome@4.7.0', // (OFL-1.1 AND MIT) diff --git a/yarn.lock b/yarn.lock index aae035b0edb8..3c15277ffd76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -230,6 +230,13 @@ "@bazel/buildifier-darwin_x64" "0.22.0" "@bazel/buildifier-linux_x64" "0.22.0" +"@bazel/jasmine@~0.26.0": + version "0.26.0" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.26.0.tgz#f7aed169b057b5af547d2573657b394ecbda0b5d" + integrity sha512-lkvzPHdbSEe1zitnV1hIBwodriXqp/ClHSZQJ5Y486UaLQ6Sm7k7gV2phOwtg7LqLVZnElZDmFLSI0/O1UYYyQ== + dependencies: + jasmine "~3.3.1" + "@bazel/karma@~0.26.0": version "0.26.0" resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.26.0.tgz#6ad796686f5775df33a96fa5ef3df76a66aed3b2" @@ -5247,7 +5254,7 @@ jasmine@2.8.0: glob "^7.0.6" jasmine-core "~2.8.0" -jasmine@^3.3.1: +jasmine@^3.3.1, jasmine@~3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.3.1.tgz#d61bb1dd8888859bd11ea83074a78ee13d949905" integrity sha512-/vU3/H7U56XsxIXHwgEuWpCgQ0bRi2iiZeUpx7Nqo8n1TpoDHfZhkPIc7CO8I4pnMzYsi3XaSZEiy8cnTfujng==