diff --git a/.aspect/rules/external_repository_action_cache/npm_translate_lock_LTkzNjczMzk3Mw== b/.aspect/rules/external_repository_action_cache/npm_translate_lock_LTkzNjczMzk3Mw== index 9c71d7b37..55b61f5fa 100755 --- a/.aspect/rules/external_repository_action_cache/npm_translate_lock_LTkzNjczMzk3Mw== +++ b/.aspect/rules/external_repository_action_cache/npm_translate_lock_LTkzNjczMzk3Mw== @@ -20,7 +20,7 @@ github-actions/pull-request-labeling/package.json=-197755049 github-actions/saucelabs/package.json=855472374 github-actions/unified-status-check/package.json=-337882335 ng-dev/package.json=1323489217 -package.json=-1202209611 -pnpm-lock.yaml=-1602715196 +package.json=-791801366 +pnpm-lock.yaml=-1788436055 pnpm-workspace.yaml=1110472849 yarn.lock=-598328143 diff --git a/.github/local-actions/branch-manager/BUILD.bazel b/.github/local-actions/branch-manager/BUILD.bazel index 2edbb153e..ce0e1e784 100644 --- a/.github/local-actions/branch-manager/BUILD.bazel +++ b/.github/local-actions/branch-manager/BUILD.bazel @@ -16,19 +16,19 @@ ts_project( "//.github/local-actions/branch-manager:node_modules/@types/node", "//.github/local-actions/branch-manager:node_modules/typed-graphqlify", "//.github/local-actions/branch-manager:node_modules/undici", - "//github-actions:utils_rjs", - "//ng-dev/pr/common:common_rjs", - "//ng-dev/pr/common/labels:labels_rjs", - "//ng-dev/pr/config:config_rjs", - "//ng-dev/pr/merge:merge_rjs", - "//ng-dev/utils:utils_rjs", + "//github-actions:utils", + "//ng-dev/pr/common", + "//ng-dev/pr/common/labels", + "//ng-dev/pr/config", + "//ng-dev/pr/merge", + "//ng-dev/utils", ], ) esbuild_checked_in( name = "main", srcs = [ - ":lib_rjs", + ":lib", ], entry_point = "lib/main.ts", format = "esm", diff --git a/.github/local-actions/labels-sync/BUILD.bazel b/.github/local-actions/labels-sync/BUILD.bazel index 7de4be497..e3d19d0ee 100644 --- a/.github/local-actions/labels-sync/BUILD.bazel +++ b/.github/local-actions/labels-sync/BUILD.bazel @@ -16,15 +16,15 @@ ts_project( "//.github/local-actions/labels-sync:node_modules/@octokit/types", "//.github/local-actions/labels-sync:node_modules/@types/node", "//.github/local-actions/labels-sync:node_modules/undici", - "//github-actions:utils_rjs", - "//ng-dev/pr/common/labels:labels_rjs", + "//github-actions:utils", + "//ng-dev/pr/common/labels", ], ) esbuild_checked_in( name = "main", srcs = [ - ":lib_rjs", + ":lib", ], entry_point = "lib/main.ts", format = "esm", diff --git a/.github/local-actions/lock-closed/BUILD.bazel b/.github/local-actions/lock-closed/BUILD.bazel index 21b40c40d..c2f49849d 100644 --- a/.github/local-actions/lock-closed/BUILD.bazel +++ b/.github/local-actions/lock-closed/BUILD.bazel @@ -15,14 +15,14 @@ ts_project( "//.github/local-actions/lock-closed:node_modules/@octokit/rest", "//.github/local-actions/lock-closed:node_modules/@types/node", "//.github/local-actions/lock-closed:node_modules/undici", - "//github-actions:utils_rjs", + "//github-actions:utils", ], ) esbuild_checked_in( name = "main", srcs = [ - ":lib_rjs", + ":lib", ], entry_point = "lib/main.ts", format = "esm", diff --git a/BUILD.bazel b/BUILD.bazel index 45f41f38e..ef8ea8af3 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,15 +1,10 @@ -load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "pkg_npm") load("@devinfra_npm//:defs.bzl", "npm_link_all_packages") -load("@npm//@bazel/typescript:index.bzl", "ts_config") - -# BEGIN-INTERNAL -load("//:package.bzl", "NPM_PACKAGE_SUBSTITUTIONS") +load("//tools:defaults2.bzl", "js_binary", "ts_config") npm_link_all_packages() -rules_js_tsconfig( - name = "rjs-tsconfig", +ts_config( + name = "tsconfig", src = "tsconfig.json", visibility = ["//visibility:public"], ) @@ -19,52 +14,16 @@ exports_files([ ".yarnrc.yml", ]) -ts_config( - name = "tsconfig", - src = "tsconfig.json", - visibility = ["//visibility:public"], -) - -nodejs_binary( +js_binary( name = "yarn_berry_vendored", data = [".yarn/releases/yarn-4.9.1.cjs"], entry_point = ".yarn/releases/yarn-4.9.1.cjs", visibility = ["//bazel/integration/tests:__subpackages__"], ) -nodejs_binary( +js_binary( name = "yarn_classic_vendored", data = [".yarn/releases/yarn-1.22.17.cjs"], entry_point = ".yarn/releases/yarn-1.22.17.cjs", visibility = ["//bazel/integration/tests:__subpackages__"], ) - -package_group( - name = "npm", - packages = [ - "//", - ], -) - -pkg_npm( - name = "npm_package", - package_name = "@angular/build-tooling", - srcs = [ - "BUILD.bazel", - "package.json", - "tsconfig.json", - ":index.bzl", - "//bazel:static_files", - "//lint-rules/stylelint:static_files", - "//lint-rules/tslint:static_files", - "//shared-scripts:static_files", - ], - substitutions = NPM_PACKAGE_SUBSTITUTIONS, - deps = [ - "//lint-rules/stylelint:lib", - "//lint-rules/tslint:lib", - ], -) -# END-INTERNAL - -exports_files(["tsconfig.json"]) diff --git a/WORKSPACE b/WORKSPACE index 997dad618..81a059b59 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -209,3 +209,13 @@ rules_angular_step3( angular_compiler_cli = "@devinfra//:node_modules/@angular/compiler-cli", typescript = "@devinfra//:node_modules/typescript", ) + +git_repository( + name = "rules_sass", + commit = "cc1e845339fc45d3c8390445014d5824b85a0948", + remote = "https://github.com/devversion/rules_sass.git", +) + +load("@rules_sass//src/toolchain:repositories.bzl", "setup_rules_sass") + +setup_rules_sass() diff --git a/apps/BUILD.bazel b/apps/BUILD.bazel index 67980b550..6c8ae99ae 100644 --- a/apps/BUILD.bazel +++ b/apps/BUILD.bazel @@ -1,4 +1,13 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", "nodejs_binary") +load("@devinfra_npm//:firebase-tools/package_json.bzl", firebase = "bin") +load("//tools:defaults2.bzl", "copy_to_bin", "ts_config") + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + visibility = [ + "//apps:__subpackages__", + ], +) copy_to_bin( name = "static_runfiles", @@ -10,7 +19,7 @@ copy_to_bin( ], ) -nodejs_binary( +firebase.firebase_binary( name = "serve", chdir = package_name(), data = [ @@ -18,24 +27,22 @@ nodejs_binary( ":static_runfiles", # Firebase function files - "//apps/functions:functions_compiled", "//apps/functions:functions_files", # Firebase hosted application files "//apps/code-of-conduct:application_files", ], - entry_point = "@npm//:node_modules/firebase-tools/lib/bin/firebase.js", - tags = ["ibazel_notify_changes"], - templated_args = [ + fixed_args = [ "--project", "internal-200822", "--config", "firebase.json", "emulators:start", ], + tags = ["ibazel_notify_changes"], ) -nodejs_binary( +firebase.firebase_binary( name = "deploy", chdir = package_name(), data = [ @@ -43,14 +50,13 @@ nodejs_binary( ":static_runfiles", # Firebase function files - "//apps/functions:functions_compiled", "//apps/functions:functions_files", # Firebase hosted application files "//apps/code-of-conduct:application_files", + "//:node_modules/firebase-functions", ], - entry_point = "@npm//:node_modules/firebase-tools/lib/bin/firebase.js", - templated_args = [ + fixed_args = [ "--project", "internal-200822", "--config", diff --git a/apps/code-of-conduct/BUILD.bazel b/apps/code-of-conduct/BUILD.bazel index 5da595cb8..964ba8498 100644 --- a/apps/code-of-conduct/BUILD.bazel +++ b/apps/code-of-conduct/BUILD.bazel @@ -1,79 +1,59 @@ -load("//tools:defaults.bzl", "esbuild", "esbuild_config", "ng_module") -load("@io_bazel_rules_sass//:defs.bzl", "npm_sass_library", "sass_binary") -load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin") +load("//tools:defaults2.bzl", "copy_to_bin", "esbuild", "ng_project", "npm_sass_library", "sass_binary") package(default_visibility = ["//apps/code-of-conduct:__subpackages__"]) -ng_module( +ng_project( name = "main", srcs = [ "environment.ts", "main.ts", ], deps = [ + "//:node_modules/@angular/common", + "//:node_modules/@angular/compiler", + "//:node_modules/@angular/fire", + "//:node_modules/@angular/platform-browser", + "//:node_modules/@angular/router", + "//:node_modules/zone.js", "//apps/code-of-conduct/app", "//apps/code-of-conduct/app:app_routes", - "@npm//@angular/common", - "@npm//@angular/compiler", - "@npm//@angular/fire", - "@npm//@angular/platform-browser", - "@npm//@angular/router", - "@npm//zone.js", ], ) npm_sass_library( name = "angular_material_sass_deps", - deps = ["@npm//@angular/material"], + deps = [ + "//:node_modules/@angular/cdk", + "//:node_modules/@angular/material", + ], ) sass_binary( name = "styles", src = "styles.scss", - include_paths = [ - "external/npm/node_modules", - ], deps = [ ":angular_material_sass_deps", ], ) -esbuild_config( - name = "esbuild_config", - config_file = "esbuild.config.mjs", - deps = [ - "//shared-scripts/angular-optimization:js_lib", - "@npm//@angular/compiler-cli", - ], -) - esbuild( - name = "bundles", - config = ":esbuild_config", - entry_points = [":main.ts"], - platform = "browser", - target = "es2016", - deps = [ + name = "bundle", + srcs = [ ":main", ], + entry_points = [":main.js"], + platform = "browser", + target = "es2022", ) copy_to_bin( - name = "application_files_in_bin", + name = "application_files", srcs = [ "favicon.ico", "index.html", "robots.txt", - ], -) - -filegroup( - name = "application_files", - srcs = [ - ":application_files_in_bin", - ":bundles", + ":bundle", ":styles", - "@npm//:node_modules/zone.js/bundles/zone.umd.min.js", ], visibility = ["//apps:__pkg__"], ) diff --git a/apps/code-of-conduct/app/BUILD.bazel b/apps/code-of-conduct/app/BUILD.bazel index 78a4b4658..2bc520014 100644 --- a/apps/code-of-conduct/app/BUILD.bazel +++ b/apps/code-of-conduct/app/BUILD.bazel @@ -1,9 +1,8 @@ -load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults2.bzl", "ng_project", "sass_binary") package(default_visibility = ["//apps/code-of-conduct:__subpackages__"]) -ng_module( +ng_project( name = "app", srcs = [ "app.component.ts", @@ -13,12 +12,12 @@ ng_module( "app.component.html", ], deps = [ + "//:node_modules/@angular/common", + "//:node_modules/@angular/core", + "//:node_modules/@angular/router", "//apps/code-of-conduct/app/account", "//apps/code-of-conduct/app/block-user", "//apps/code-of-conduct/app/user-table", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/router", ], ) @@ -27,29 +26,29 @@ sass_binary( src = "app.component.scss", ) -ng_module( +ng_project( name = "block_service", srcs = [ "block.service.ts", ], deps = [ - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/fire", - "@npm//@angular/material", - "@npm//rxjs", + "//:node_modules/@angular/common", + "//:node_modules/@angular/core", + "//:node_modules/@angular/fire", + "//:node_modules/@angular/material", + "//:node_modules/rxjs", ], ) -ng_module( +ng_project( name = "app_routes", srcs = [ "app.routes.ts", ], deps = [ + "//:node_modules/@angular/router", "//apps/code-of-conduct/app/account", "//apps/code-of-conduct/app/login", "//apps/code-of-conduct/app/main", - "@npm//@angular/router", ], ) diff --git a/apps/code-of-conduct/app/account/BUILD.bazel b/apps/code-of-conduct/app/account/BUILD.bazel index a954bdbf6..e7aad5963 100644 --- a/apps/code-of-conduct/app/account/BUILD.bazel +++ b/apps/code-of-conduct/app/account/BUILD.bazel @@ -1,7 +1,6 @@ -load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults2.bzl", "ng_project", "sass_binary") -ng_module( +ng_project( name = "account", srcs = glob(["*.ts"]), assets = [ @@ -12,14 +11,14 @@ ng_module( "//apps:__subpackages__", ], deps = [ - "@npm//@angular/cdk", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/fire", - "@npm//@angular/material", - "@npm//@angular/router", - "@npm//@octokit/rest", - "@npm//rxjs", + "//:node_modules/@angular/cdk", + "//:node_modules/@angular/common", + "//:node_modules/@angular/core", + "//:node_modules/@angular/fire", + "//:node_modules/@angular/material", + "//:node_modules/@angular/router", + "//:node_modules/@octokit/rest", + "//:node_modules/rxjs", ], ) diff --git a/apps/code-of-conduct/app/block-user/BUILD.bazel b/apps/code-of-conduct/app/block-user/BUILD.bazel index 7f7eb08c5..5cc7e4082 100644 --- a/apps/code-of-conduct/app/block-user/BUILD.bazel +++ b/apps/code-of-conduct/app/block-user/BUILD.bazel @@ -1,9 +1,8 @@ -load("//tools:defaults.bzl", "ng_module") -load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") +load("//tools:defaults2.bzl", "ng_project", "sass_binary") package(default_visibility = ["//apps/code-of-conduct:__subpackages__"]) -ng_module( +ng_project( name = "block-user", srcs = glob( ["*.ts"], @@ -14,12 +13,12 @@ ng_module( ":block-user.component.html", ], deps = [ + "//:node_modules/@angular/common", + "//:node_modules/@angular/core", + "//:node_modules/@angular/fire", + "//:node_modules/@angular/forms", + "//:node_modules/@angular/material", "//apps/code-of-conduct/app:block_service", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/fire", - "@npm//@angular/forms", - "@npm//@angular/material", ], ) diff --git a/apps/code-of-conduct/app/login/BUILD.bazel b/apps/code-of-conduct/app/login/BUILD.bazel index d90980b3c..523a73027 100644 --- a/apps/code-of-conduct/app/login/BUILD.bazel +++ b/apps/code-of-conduct/app/login/BUILD.bazel @@ -1,9 +1,8 @@ -load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults2.bzl", "ng_project", "sass_binary") package(default_visibility = ["//apps/code-of-conduct:__subpackages__"]) -ng_module( +ng_project( name = "login", srcs = glob(["*.ts"]), assets = [ @@ -11,10 +10,10 @@ ng_module( "login.component.html", ], deps = [ + "//:node_modules/@angular/common", + "//:node_modules/@angular/core", + "//:node_modules/@angular/material", "//apps/code-of-conduct/app/account", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/material", ], ) diff --git a/apps/code-of-conduct/app/main/BUILD.bazel b/apps/code-of-conduct/app/main/BUILD.bazel index 4c5972c0a..eb7ed489b 100644 --- a/apps/code-of-conduct/app/main/BUILD.bazel +++ b/apps/code-of-conduct/app/main/BUILD.bazel @@ -1,9 +1,8 @@ -load("//tools:defaults.bzl", "ng_module") -load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") +load("//tools:defaults2.bzl", "ng_project", "sass_binary") package(default_visibility = ["//apps/code-of-conduct:__subpackages__"]) -ng_module( +ng_project( name = "main", srcs = glob(["*.ts"]), assets = [ @@ -11,11 +10,11 @@ ng_module( "main.component.html", ], deps = [ + "//:node_modules/@angular/common", + "//:node_modules/@angular/core", + "//:node_modules/@angular/material", "//apps/code-of-conduct/app/block-user", "//apps/code-of-conduct/app/user-table", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/material", ], ) diff --git a/apps/code-of-conduct/app/user-table/BUILD.bazel b/apps/code-of-conduct/app/user-table/BUILD.bazel index 21a11b5d7..0bbeae30b 100644 --- a/apps/code-of-conduct/app/user-table/BUILD.bazel +++ b/apps/code-of-conduct/app/user-table/BUILD.bazel @@ -1,9 +1,8 @@ -load("//tools:defaults.bzl", "ng_module") -load("@io_bazel_rules_sass//:defs.bzl", "sass_binary") +load("//tools:defaults2.bzl", "ng_project", "sass_binary") package(default_visibility = ["//apps/code-of-conduct:__subpackages__"]) -ng_module( +ng_project( name = "user-table", srcs = glob(["*.ts"]), assets = [ @@ -11,11 +10,11 @@ ng_module( "user-table.component.html", ], deps = [ + "//:node_modules/@angular/common", + "//:node_modules/@angular/core", + "//:node_modules/@angular/material", "//apps/code-of-conduct/app:block_service", "//apps/code-of-conduct/app/block-user", - "@npm//@angular/common", - "@npm//@angular/core", - "@npm//@angular/material", ], ) diff --git a/apps/code-of-conduct/esbuild.config.mjs b/apps/code-of-conduct/esbuild.config.mjs deleted file mode 100644 index a2f888866..000000000 --- a/apps/code-of-conduct/esbuild.config.mjs +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import {createEsbuildAngularOptimizePlugin} from '../../shared-scripts/angular-optimization/esbuild-plugin.mjs'; - -export default { - // Note: We support `.mjs` here as this is the extension used by Angular APF packages. - resolveExtensions: ['.mjs', '.js'], - format: 'esm', - plugins: [ - await createEsbuildAngularOptimizePlugin({ - enableLinker: { - linkerOptions: { - // We enable JIT mode as unit tests may need it for overriding. - linkerJitMode: true, - }, - }, - }), - ], -}; diff --git a/apps/code-of-conduct/index.html b/apps/code-of-conduct/index.html index c773ab7e6..5d46bd580 100644 --- a/apps/code-of-conduct/index.html +++ b/apps/code-of-conduct/index.html @@ -14,5 +14,5 @@