diff --git a/.circleci/config.yml b/.circleci/config.yml index f391d5852bd0..998330c12720 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,18 +7,18 @@ # To validate changes, use an online parser, eg. # http://yaml-online-parser.appspot.com/ -var_1: &docker_image circleci/node:14.16.1 -var_2: &docker-firefox-image circleci/node:14.16.1-browsers +var_1: &docker_image circleci/node:16.6.0 +var_2: &docker-firefox-image circleci/node:16.6.0-browsers # **Note**: When updating the beginning of the cache key, also update the cache key to match # the new cache key prefix. This allows us to take advantage of CircleCI's fallback caching. # Read more here: https://circleci.com/docs/2.0/caching/#restoring-cache. -var_3: &cache_key v8-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }} +var_3: &cache_key v9-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}-{{ checksum "WORKSPACE" }}-{{ checksum "yarn.lock" }} # We want to invalidate the cache if the postinstall patches change. In order to apply new # patches, a clean version of the node modules is needed. Additionally, we invalidate the cache # if the Bazel version changes. We do this because otherwise the `bazelisk` cache folder will # contain all previously used versions and ultimately cause the cache restoring to be slower. -var_4: &cache_fallback_key v8-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}- +var_4: &cache_fallback_key v9-ng-mat-{{ checksum ".bazelversion" }}-{{ checksum "tools/postinstall/apply-patches.js" }}- # Settings common to each job var_5: &job_defaults diff --git a/.nvmrc b/.nvmrc index e8baaea641a2..bd015b903604 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -14.16.1 \ No newline at end of file +16.6.0 diff --git a/WORKSPACE b/WORKSPACE index 14ef704807c8..61f4a645a50d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Add NodeJS rules http_archive( name = "build_bazel_rules_nodejs", - sha256 = "5c40083120eadec50a3497084f99bc75a85400ea727e82e0b2f422720573130f", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0-beta.0/rules_nodejs-4.0.0-beta.0.tar.gz"], + sha256 = "8a7c981217239085f78acc9898a1f7ba99af887c1996ceb3b4504655383a2c3c", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0/rules_nodejs-4.0.0.tar.gz"], ) # Add sass rules @@ -45,7 +45,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "node_repos check_bazel_version("4.0.0") node_repositories( - node_version = "14.16.1", + node_version = "16.6.0", package_json = ["//:package.json"], ) @@ -97,6 +97,6 @@ load( _dev_infra_browser_repositories() -load("@npm//@bazel/esbuild:esbuild_repositories.bzl", "esbuild_repositories") +load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories") esbuild_repositories() diff --git a/package.json b/package.json index 9f69d9759fff..94d186758c59 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "license": "MIT", "engines": { - "node": ">=14.0.0 <16.0.0", + "node": ">=14.0.0 <17.0.0", "yarn": ">= 1.0.0", "npm": "Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/" }, @@ -85,15 +85,15 @@ "@babel/traverse": "^7.13.0", "@bazel/bazelisk": "1.9.0", "@bazel/buildifier": "4.0.1", - "@bazel/concatjs": "4.0.0-beta.0", - "@bazel/esbuild": "4.0.0-beta.0", + "@bazel/concatjs": "4.0.0", + "@bazel/esbuild": "4.0.0", "@bazel/ibazel": "0.15.10", - "@bazel/jasmine": "4.0.0-beta.0", - "@bazel/protractor": "4.0.0-beta.0", - "@bazel/rollup": "4.0.0-beta.0", - "@bazel/runfiles": "4.0.0-beta.0", - "@bazel/terser": "4.0.0-beta.0", - "@bazel/typescript": "4.0.0-beta.0", + "@bazel/jasmine": "4.0.0", + "@bazel/protractor": "4.0.0", + "@bazel/rollup": "4.0.0", + "@bazel/runfiles": "4.0.0", + "@bazel/terser": "4.0.0", + "@bazel/typescript": "4.0.0", "@firebase/app-types": "^0.6.1", "@material/animation": "13.0.0-canary.0a9069300.0", "@material/auto-init": "13.0.0-canary.0a9069300.0", diff --git a/src/cdk/testing/private/e2e/asserts.ts b/src/cdk/testing/private/e2e/asserts.ts index 6dd3b1d03c4c..72c3624715c7 100644 --- a/src/cdk/testing/private/e2e/asserts.ts +++ b/src/cdk/testing/private/e2e/asserts.ts @@ -40,7 +40,7 @@ export async function expectLocation(element: FinderResult, {x, y}: Point) { * Asserts that one element is aligned with another. */ export async function expectAlignedWith(element: FinderResult, otherElement: FinderResult) { - await getElement(otherElement).getLocation().then((location: Point) => { - expectLocation(getElement(element), location); + await getElement(otherElement).getLocation().then(async (location: Point) => { + await expectLocation(getElement(element), location); }); } diff --git a/src/material-date-fns-adapter/BUILD.bazel b/src/material-date-fns-adapter/BUILD.bazel index 1444f99b3770..a779a3c52c8f 100644 --- a/src/material-date-fns-adapter/BUILD.bazel +++ b/src/material-date-fns-adapter/BUILD.bazel @@ -1,5 +1,5 @@ load("//tools:defaults.bzl", "ng_module", "ng_package", "ng_test_library", "ng_web_test_suite") -load(":esbuild-amd.bzl", "esbuild_amd") +load("//tools/esbuild:index.bzl", "esbuild_amd") package(default_visibility = ["//visibility:public"]) diff --git a/src/material-date-fns-adapter/esbuild-amd.bzl b/src/material-date-fns-adapter/esbuild-amd.bzl deleted file mode 100644 index 7490ac8369aa..000000000000 --- a/src/material-date-fns-adapter/esbuild-amd.bzl +++ /dev/null @@ -1,40 +0,0 @@ -load("@npm//@bazel/esbuild:index.bzl", "esbuild") - -"""Creates an ESBuild configuration file for configuring AMD output.""" - -def _create_esbuild_config(module_name): - # Workaround in ESBuild to support AMD module output. - # TODO: Remove once https://github.com/evanw/esbuild/issues/507 is fixed. - return { - "globalName": "__exports", - "banner": {"js": "define(\"%s\",[],function(){" % module_name}, - "footer": {"js": "return __exports;})"}, - } - -"""Generates an AMD bundle for the specified entry-point with the given AMD module name.""" - -def esbuild_amd(name, entry_point, module_name, testonly, deps): - native.genrule( - name = "%s_config" % name, - outs = ["%s_config.json" % name], - cmd = """echo '%s' > $@""" % json.encode(_create_esbuild_config(module_name)), - testonly = testonly, - ) - - esbuild( - name = "%s_bundle" % name, - testonly = testonly, - deps = deps, - minify = True, - sourcemap = "inline", - platform = "browser", - target = "es2015", - entry_point = entry_point, - args_file = "%s_config.json" % name, - ) - - native.filegroup( - name = name, - testonly = testonly, - srcs = ["%s_bundle" % name], - ) diff --git a/tools/esbuild/BUILD.bazel b/tools/esbuild/BUILD.bazel new file mode 100644 index 000000000000..7fcefca5ef55 --- /dev/null +++ b/tools/esbuild/BUILD.bazel @@ -0,0 +1 @@ +exports_files(["esbuild-amd-config.mjs"]) diff --git a/tools/esbuild/esbuild-amd-config.mjs b/tools/esbuild/esbuild-amd-config.mjs new file mode 100644 index 000000000000..f1c17b2d7b41 --- /dev/null +++ b/tools/esbuild/esbuild-amd-config.mjs @@ -0,0 +1,5 @@ +export default { + globalName: "__exports", + banner: {js: 'define("TMPL_MODULE_NAME", [], function() {'}, + footer: {js: 'return __exports;})'}, +}; diff --git a/tools/esbuild/index.bzl b/tools/esbuild/index.bzl new file mode 100644 index 000000000000..e30800951e3a --- /dev/null +++ b/tools/esbuild/index.bzl @@ -0,0 +1,42 @@ +load("@npm//@bazel/esbuild:index.bzl", "esbuild_config", _esbuild = "esbuild") +load("@npm//@angular/dev-infra-private/bazel:expand_template.bzl", "expand_template") + +def esbuild(**kwargs): + _esbuild(**kwargs) + +"""Generates an AMD bundle for the specified entry-point with the given AMD module name.""" + +def esbuild_amd(name, entry_point, module_name, testonly, deps): + expand_template( + name = "%s_config" % name, + testonly = testonly, + template = "//tools/esbuild:esbuild-amd-config.mjs", + output_name = "%s_config.mjs" % name, + substitutions = { + "TMPL_MODULE_NAME": module_name, + }, + ) + + esbuild_config( + name = "%s_config_lib" % name, + testonly = testonly, + config_file = "%s_config" % name, + ) + + _esbuild( + name = "%s_bundle" % name, + testonly = testonly, + deps = deps, + minify = True, + sourcemap = "inline", + platform = "browser", + target = "es2015", + entry_point = entry_point, + config = "%s_config_lib" % name, + ) + + native.filegroup( + name = name, + testonly = testonly, + srcs = ["%s_bundle" % name], + ) diff --git a/yarn.lock b/yarn.lock index a6c1f5d2086a..b024121dd253 100644 --- a/yarn.lock +++ b/yarn.lock @@ -543,19 +543,19 @@ resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-4.0.1.tgz#52cfbad5cbb86e9183a29dde2370cd465730ea0d" integrity sha512-BTmtvJbeeEVrqRApI1gr5hvPgYcHLpdGJ5EXNXEWO692ztMPSj5fB/dH0xUlaW45jn6LimYx8ymqTMhj3538og== -"@bazel/concatjs@4.0.0-beta.0": - version "4.0.0-beta.0" - resolved "https://registry.yarnpkg.com/@bazel/concatjs/-/concatjs-4.0.0-beta.0.tgz#f1dddefe2cefc543ec61f06c5bc28c908bfb4569" - integrity sha512-azGMcLwOIEEbTHm0ORCsSMZ5yBIQaRWlWMN3b7M5uD6C646EaiM7b2wx8CkOJlyZrZOLEajjvePvN7lqkPM1Cg== +"@bazel/concatjs@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@bazel/concatjs/-/concatjs-4.0.0.tgz#fae04e7adb560f7666a71d8552bb424bb53b7d45" + integrity sha512-Ua+8Myq1RJjffASRHUzqFu05Zs5qU5Auzc+aiyq8V9opP5WTT4HR5lymmJrT/S1brhhM/1GZfbMZbYaddgyeVw== dependencies: protobufjs "6.8.8" source-map-support "0.5.9" tsutils "2.27.2" -"@bazel/esbuild@4.0.0-beta.0": - version "4.0.0-beta.0" - resolved "https://registry.yarnpkg.com/@bazel/esbuild/-/esbuild-4.0.0-beta.0.tgz#ff75447b18bc0d56b376d7e44095d9ca9b904583" - integrity sha512-4AxL8IhyeyeTH0fr1XFfdd1ls/AnsiEu1oBXxoplb0ar88pRrdl0UjCUgLylWj75uIcQsqu/l3Xv7qOfDSXWsQ== +"@bazel/esbuild@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@bazel/esbuild/-/esbuild-4.0.0.tgz#daa8286d72a9e6522f6f2c514aed9716a331aa25" + integrity sha512-SrdJexg+PNjdsTDp0voPS0SlU/yovbwrH+ObtFShHQ2X52u9mqvU2Cm7If48pWobkGK4rl7vDbzIHYWVKdGXlw== "@bazel/esbuild@4.0.0-rc.1": version "4.0.0-rc.1" @@ -567,10 +567,10 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.15.10.tgz#cf0cff1aec6d8e7bb23e1fc618d09fbd39b7a13f" integrity sha512-0v+OwCQ6fsGFa50r6MXWbUkSGuWOoZ22K4pMSdtWiL5LKFIE4kfmMmtQS+M7/ICNwk2EIYob+NRreyi/DGUz5A== -"@bazel/jasmine@4.0.0-beta.0": - version "4.0.0-beta.0" - resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-4.0.0-beta.0.tgz#575e9cd88932b19c54447fba43cbd62e14ff3022" - integrity sha512-VYEAaHCi8ot0aSMKbIio6usJZqvINd7LzrrGoChGAGwMgGEpTfMGdprwdlrQPKD6/GbLkVtkCcsViG92ynXhdQ== +"@bazel/jasmine@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-4.0.0.tgz#2e95f1b3458e0d69f16e0c820fe4631a43942a90" + integrity sha512-vi1n+vbLwKki7aa8kXDG709nxRXAmLEvqbijSpm8d3rrW4f68Ad5xKyT2gezO84OeysUHU3cDZViXWwFcoHRng== dependencies: c8 "~7.5.0" jasmine-reporters "~2.4.0" @@ -583,40 +583,40 @@ c8 "~7.5.0" jasmine-reporters "~2.4.0" -"@bazel/protractor@4.0.0-beta.0": - version "4.0.0-beta.0" - resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-4.0.0-beta.0.tgz#fcabfd5c32005fcb93b80f83bcf99058bcf07d4f" - integrity sha512-cIlqzPEXu3zFhFR+5Vqo5D/qLkOEY/gZ1xc74/V/CVAlbkCZsWJ18gDE1bhca9t1Mj41igDqwlvXUndxdQjNtw== +"@bazel/protractor@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-4.0.0.tgz#f29ae81c22790596bfd8212952a8e370406d094f" + integrity sha512-YiSU2IYdiW7HoVC3gAZJs9M0CiH9qluAvA9YLfvM3pM7rI1OmXYCm3hojgOLIRslbThcpfAcmQKjeUfdQPX5bA== "@bazel/protractor@4.0.0-rc.1": version "4.0.0-rc.1" resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-4.0.0-rc.1.tgz#1c7ae5366423ab02f2b5a30352b98cd1729837a5" integrity sha512-qF9QPn/qTbU2yD+1liv5HwfD/2dkmDq7Mrb4OI1TI6Q74XY+k0wplDWh0GZFTQtHTOxzAOzivGCZBC8/9eSxLw== -"@bazel/rollup@4.0.0-beta.0": - version "4.0.0-beta.0" - resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-4.0.0-beta.0.tgz#ec4bc88f401bd555d43c55c34183cda4f004ae96" - integrity sha512-CAl5+iNuVgFA52zOFmoQvY9LpjEf/hPiw/PRPXR0JrXy83xk+Nxnrv7UKvP4Jmux+K24uDf+ZOIr62rGzMHVhA== +"@bazel/rollup@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-4.0.0.tgz#909cfa9bd0243fd78657711b3aa644b8432ba636" + integrity sha512-OcL7QtNk2nyN/v7fnih0VQ0pIDwSxdGkyZvt/m1SwODx/eJpBceam0yboLoer/sYEZPhv7YFyCTk9n2X64TZ5g== -"@bazel/runfiles@4.0.0-beta.0": - version "4.0.0-beta.0" - resolved "https://registry.yarnpkg.com/@bazel/runfiles/-/runfiles-4.0.0-beta.0.tgz#e62679d80cf9fcd84996e5f3ae4bedc33ed1a993" - integrity sha512-pFdanyvI0wf2WtdQXUmcTZw7OJ83uj2bxF3rOskx45wewBRAlQZkm2q2A6WEffSfdf2WaBlk5u/x2kqK2nyG7w== +"@bazel/runfiles@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@bazel/runfiles/-/runfiles-4.0.0.tgz#3d649d93710364515402b873add73947aaa702e8" + integrity sha512-1V0E1ooSw7DARfOBkr24O5GOpqODDd7RuJ2Xb+JljjdpUdJTIaVeqELBpSHAiYzqVJYWAn61sD5JP1CPCllixA== "@bazel/runfiles@4.0.0-rc.1": version "4.0.0-rc.1" resolved "https://registry.yarnpkg.com/@bazel/runfiles/-/runfiles-4.0.0-rc.1.tgz#aaf97d633ba813db2c0bfa5bc126f50118d82066" integrity sha512-0RGbEe4hBpafbLSIIBYGFPRLZ7FRJ+S6PjdVfRkpZlNpe6T1QXxgdg6M5/ETQXNVqfdUhMLdNFZ1heMk4uXhzg== -"@bazel/terser@4.0.0-beta.0": - version "4.0.0-beta.0" - resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-4.0.0-beta.0.tgz#2ca1c59e1e109e2f3b0c561b534730a035844a26" - integrity sha512-qGDLsmg2ekEojDHrTEiPJd0bdqbCPT2/YImsZhg1swpLEFnFCLCUNVnESt62Wd6bKonzvQeFo8zpKaCK326e4g== +"@bazel/terser@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-4.0.0.tgz#9ef0c4635ba0191965f0b6c26eb0cc348c8c1f5e" + integrity sha512-sktDTfEBFD6LIv+g7W0l9nt5pih7N7aQVA09lv09rbTWD/JGX1LSSjG2p16af297XMxCP6GoHyVaxOVXS3IPYA== -"@bazel/typescript@4.0.0-beta.0": - version "4.0.0-beta.0" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-4.0.0-beta.0.tgz#daf2fb0d0bdcd3df331d4320463b1a4beca6031c" - integrity sha512-dfI3QLQ5bLyK3BIrrwxuH9cLbMHuku0UZH7nwjHjXwQX70O0MSGN6yXx2Vrqatj2iw/UfHX/akPuhGlNqrDFRw== +"@bazel/typescript@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-4.0.0.tgz#71a6f0f5e340c6b8516b21fbc0f0853e74055d0c" + integrity sha512-+Le9q+5IR9gEnSH8sXyxDB5dD6NJx2kbm6AL+cijYVat2MczpGV4sI1mu0mdLzYsEX5Tjt5iHkaNb7sFESjnYA== dependencies: protobufjs "6.8.8" semver "5.6.0"