From f39ffd9e4ec53eb7587760a9d215cda599003e34 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Mon, 6 Apr 2026 18:38:59 +0000 Subject: [PATCH 01/13] chore(gapic-generator-typescript): remove bazel dependency from build This change completely removes the Bazel dependency from the gapic-generator-typescript project. All Bazel configuration files have been deleted and package.json scripts have been updated to use the standard TypeScript compiler (tsc) directly. Bazel was originally introduced to export build rules for the googleapis monorepo. However, following the consolidation of the generator into google-cloud-node/core, Bazel is no longer necessary and adds significant overhead (e.g., 4+ minute installations via npm run compile). Since tsc provides all the compilation functionality needed natively, stripping Bazel simplifies the toolchain and significantly speeds up CI pipelines without losing capabilities. To verify this change does not break functionality, the project was locally compiled successfully using `npx tsc -p .` in under 7 seconds. The test scripts were also run, and the overall Librarian CI workflow has been verified to pass with these changes, confirming that the generator builds and executes correctly without Bazel. For https://github.com/googleapis/librarian/issues/4593 --- .../gapic-generator-typescript/.bazeliskrc | 2 - .../gapic-generator-typescript/.bazelrc | 24 -- .../gapic-generator-typescript/MODULE.bazel | 6 - .../MODULE.bazel.lock | 110 -------- .../gapic-generator-typescript/WORKSPACE | 47 ---- .../package-lock.json | 11 - .../gapic-generator-typescript/package.json | 19 +- .../repositories.bzl | 48 ---- .../rules_typescript_gapic/BUILD.bazel | 8 - .../rules_typescript_gapic/combine_script.sh | 117 -------- .../typescript_gapic.bzl | 87 ------ .../typescript_gapic_combined_pkg.bzl | 86 ------ .../typescript_gapic_pkg.bzl | 87 ------ .../gapic-generator-typescript/yarn.lock | 265 +++++++++++------- 14 files changed, 174 insertions(+), 743 deletions(-) delete mode 100644 core/generator/gapic-generator-typescript/.bazeliskrc delete mode 100644 core/generator/gapic-generator-typescript/.bazelrc delete mode 100644 core/generator/gapic-generator-typescript/MODULE.bazel delete mode 100644 core/generator/gapic-generator-typescript/MODULE.bazel.lock delete mode 100644 core/generator/gapic-generator-typescript/WORKSPACE delete mode 100644 core/generator/gapic-generator-typescript/repositories.bzl delete mode 100644 core/generator/gapic-generator-typescript/rules_typescript_gapic/BUILD.bazel delete mode 100755 core/generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh delete mode 100644 core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic.bzl delete mode 100644 core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_combined_pkg.bzl delete mode 100644 core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_pkg.bzl diff --git a/core/generator/gapic-generator-typescript/.bazeliskrc b/core/generator/gapic-generator-typescript/.bazeliskrc deleted file mode 100644 index 74cd900fbd3..00000000000 --- a/core/generator/gapic-generator-typescript/.bazeliskrc +++ /dev/null @@ -1,2 +0,0 @@ -# See https://github.com/bazelbuild/bazelisk -USE_BAZEL_VERSION=6.3.0 diff --git a/core/generator/gapic-generator-typescript/.bazelrc b/core/generator/gapic-generator-typescript/.bazelrc deleted file mode 100644 index 5b84b3d13b8..00000000000 --- a/core/generator/gapic-generator-typescript/.bazelrc +++ /dev/null @@ -1,24 +0,0 @@ -# Copied from https://github.com/googleapis/googleapis/blob/master/.bazelrc -# Need because absl library requires C++14 while the Bazel default is C++0x - -# To make proto_library rules to include source info in the descriptor -build --protocopt=--include_source_info -build --protocopt=--experimental_allow_proto3_optional -# New boringssl requires C++14 -build --repo_env=BAZEL_CXXOPTS="-std=c++14" - - -# This is to avoid JVM SIGBUS crashes on highly parallel builds, -# see https://github.com/bazelbuild/bazel/issues/3236 for more details -build --enable_platform_specific_config -build:linux --sandbox_tmpfs_path=/tmp - -build --cxxopt=-std=c++17 -build --host_cxxopt=-std=c++17 - -common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig - - # Between Bazel 6.0 and 6.3, you need all of this, to avoid discarding the analysis cache: - build --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig - fetch --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig - query --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig \ No newline at end of file diff --git a/core/generator/gapic-generator-typescript/MODULE.bazel b/core/generator/gapic-generator-typescript/MODULE.bazel deleted file mode 100644 index 00bb18361f7..00000000000 --- a/core/generator/gapic-generator-typescript/MODULE.bazel +++ /dev/null @@ -1,6 +0,0 @@ -############################################################################### -# Bazel now uses Bzlmod by default to manage external dependencies. -# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. -# -# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 -############################################################################### diff --git a/core/generator/gapic-generator-typescript/MODULE.bazel.lock b/core/generator/gapic-generator-typescript/MODULE.bazel.lock deleted file mode 100644 index d62a47c0f60..00000000000 --- a/core/generator/gapic-generator-typescript/MODULE.bazel.lock +++ /dev/null @@ -1,110 +0,0 @@ -{ - "lockFileVersion": 11, - "registryFileHashes": { - "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", - "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/source.json": "7e3a9adf473e9af076ae485ed649d5641ad50ec5c11718103f34de03170d94ad", - "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", - "https://bcr.bazel.build/modules/apple_support/1.5.0/source.json": "eb98a7627c0bc486b57f598ad8da50f6625d974c8f723e9ea71bd39f709c9862", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", - "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", - "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", - "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", - "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", - "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749", - "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", - "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", - "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", - "https://bcr.bazel.build/modules/googletest/1.11.0/source.json": "c73d9ef4268c91bd0c1cd88f1f9dfa08e814b1dbe89b5f594a9f08ba0244d206", - "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", - "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", - "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", - "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", - "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", - "https://bcr.bazel.build/modules/platforms/0.0.9/source.json": "cd74d854bf16a9e002fb2ca7b1a421f4403cda29f824a765acd3a8c56f8d43e6", - "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", - "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b", - "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", - "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", - "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", - "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", - "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", - "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", - "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", - "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", - "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", - "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d", - "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", - "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35", - "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", - "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", - "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c", - "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/source.json": "d57902c052424dfda0e71646cb12668d39c4620ee0544294d9d941e7d12bc3a9", - "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", - "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7", - "https://bcr.bazel.build/modules/rules_python/0.22.1/source.json": "57226905e783bae7c37c2dd662be078728e48fa28ee4324a7eabcafb5a43d014", - "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", - "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", - "https://bcr.bazel.build/modules/stardoc/0.5.1/source.json": "a96f95e02123320aa015b956f29c00cb818fa891ef823d55148e1a362caacf29", - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", - "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", - "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d" - }, - "selectedYankedVersions": {}, - "moduleExtensions": { - "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { - "general": { - "bzlTransitiveDigest": "PjIds3feoYE8SGbbIq2SFTZy3zmxeO2tQevJZNDo7iY=", - "usagesDigest": "+hz7IHWN6A1oVJJWNDB6yZRG+RYhF76wAYItpAeIUIg=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "local_config_apple_cc_toolchains": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf_toolchains", - "attributes": {} - }, - "local_config_apple_cc": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [ - [ - "apple_support~", - "bazel_tools", - "bazel_tools" - ] - ] - } - }, - "@@platforms//host:extension.bzl%host_platform": { - "general": { - "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", - "usagesDigest": "pCYpDQmqMbmiiPI1p2Kd3VLm5T48rRAht5WdW0X2GlA=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "host_platform": { - "bzlFile": "@@platforms//host:extension.bzl", - "ruleClassName": "host_platform_repo", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [] - } - } - } -} diff --git a/core/generator/gapic-generator-typescript/WORKSPACE b/core/generator/gapic-generator-typescript/WORKSPACE deleted file mode 100644 index af5d4ebdbcb..00000000000 --- a/core/generator/gapic-generator-typescript/WORKSPACE +++ /dev/null @@ -1,47 +0,0 @@ -workspace( - # How this workspace would be referenced with absolute labels from another workspace - name = "gapic_generator_typescript", -) - -load("//:repositories.bzl", "gapic_generator_typescript_repositories", "NODE_VERSION") -gapic_generator_typescript_repositories() - -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") -protobuf_deps() - -load("@rules_python//python:repositories.bzl", "py_repositories") -py_repositories() - -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") -rules_proto_dependencies() -rules_proto_toolchains() - -load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies") -rules_ts_dependencies( - ts_version_from = "//:package.json", -) - -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") -rules_js_dependencies() - -load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains") - -rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) - -load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock", "pnpm_repository") - - -npm_translate_lock( - name = "npm", - pnpm_lock = "//:pnpm-lock.yaml", - update_pnpm_lock = True, - data = ["//:package.json"], -) -pnpm_repository(name = "pnpm") -load("@npm//:repositories.bzl", "npm_repositories") -npm_repositories() - -# To regenerate the lock file, run: -# bazelisk run -- @pnpm//:pnpm --dir $PWD install --lockfile-only -# More information: https://github.com/aspect-build/rules_js/blob/main/docs/faq.md#can-i-use-bazel-managed-pnpm - diff --git a/core/generator/gapic-generator-typescript/package-lock.json b/core/generator/gapic-generator-typescript/package-lock.json index 076797338a3..ee391c3882d 100644 --- a/core/generator/gapic-generator-typescript/package-lock.json +++ b/core/generator/gapic-generator-typescript/package-lock.json @@ -23,7 +23,6 @@ "protoc-gen-typescript_gapic": "build/typescript/src/protoc-plugin.js" }, "devDependencies": { - "@bazel/bazelisk": "^1.26.0", "@types/mocha": "^10.0.10", "@types/module-alias": "^2.0.4", "@types/node": "^22.18.12", @@ -273,16 +272,6 @@ "node": ">=6.9.0" } }, - "node_modules/@bazel/bazelisk": { - "version": "1.26.0", - "resolved": "https://registry.npmjs.org/@bazel/bazelisk/-/bazelisk-1.26.0.tgz", - "integrity": "sha512-bTNcHdGyEQ9r7SczEYUa0gkEQhJo1ld2BjXI8fWBvsUeoHi03QpUs2HZgDbjjrpQFQqG2ZbO7ihZvH8MjhUTHw==", - "dev": true, - "bin": { - "bazel": "bazelisk.js", - "bazelisk": "bazelisk.js" - } - }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", diff --git a/core/generator/gapic-generator-typescript/package.json b/core/generator/gapic-generator-typescript/package.json index a4db693ff36..60e9ff66b78 100644 --- a/core/generator/gapic-generator-typescript/package.json +++ b/core/generator/gapic-generator-typescript/package.json @@ -26,25 +26,25 @@ "build/templates" ], "scripts": { - "baseline": "node bazel-bin/typescript/tools/update-baselines.js", - "clean": "bazelisk clean && rm -rf build", - "codecov": "c8 --reporter=lcov mocha bazel-bin/typescript/test/unit && c8 report", - "compile": "bazelisk build //...", + "baseline": "node build/typescript/tools/update-baselines.js", + "clean": "rm -rf build", + "codecov": "c8 --reporter=lcov mocha build/typescript/test/unit && c8 report", + "compile": "tsc -p .", "compile-protos-json": "pbjs -t json -o protos/protos.json -p node_modules/google-gax/build/protos -p protos google/api/annotations.proto google/api/field_behavior.proto google/api/field_info.proto google/api/resource.proto google/api/routing.proto google/longrunning/operations.proto google/protobuf/compiler/plugin.proto service_config.proto snippet_index.proto", "compile-protos-js": "pbjs -t static-module -o protos/index.js -p node_modules/google-gax/build/protos -p protos google/api/annotations.proto google/api/field_behavior.proto google/api/field_info.proto google/api/resource.proto google/api/routing.proto google/longrunning/operations.proto google/protobuf/compiler/plugin.proto service_config.proto snippet_index.proto", "compile-protos-dts": "pbts protos/index.js -o protos/index.d.ts", "docker-test": "sh docker/test.sh", "fix": "gts fix", - "js-test-application": "mocha bazel-bin/typescript/test/test-application/test-js --timeout 600000", + "js-test-application": "mocha build/typescript/test/test-application/test-js --timeout 600000", "lint": "gts check", - "prepack:cjs": "npm run compile && cd templates/cjs/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf bazel-bin/typescript templates protos build/", - "prepack:esm": "npm run compile && cd templates/esm/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf bazel-bin/typescript templates protos build/", + "prepack:cjs": "npm run compile && cd templates/cjs/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf build/typescript templates protos build/", + "prepack:esm": "npm run compile && cd templates/esm/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf build/typescript templates protos build/", "prepack": "npm run prepack:cjs && npm run prepack:esm", "postpack:cjs": "cd templates/cjs/typescript_gapic && mv package.json.njk package.json && ln -s package.json package.json.njk", "postpack:esm": "cd templates/esm/typescript_gapic && mv package.json.njk package.json && ln -s package.json package.json.njk", "postpack": "npm run postpack:cjs && npm run postpack:esm", - "test": "bazelisk test --test_output=errors //:unit_tests", - "ts-test-application": "mocha bazel-bin/typescript/test/test-application/test-ts --timeout 600000", + "test": "mocha build/typescript/test/unit --timeout 600000", + "ts-test-application": "mocha build/typescript/test/test-application/test-ts --timeout 600000", "system-test": "echo 'no system test'", "samples-test": "echo 'no samples test'", "docs": "echo no docs needed", @@ -61,7 +61,6 @@ "yargs": "^17.7.2" }, "devDependencies": { - "@bazel/bazelisk": "^1.26.0", "@types/mocha": "^10.0.10", "@types/module-alias": "^2.0.4", "@types/node": "^22.18.12", diff --git a/core/generator/gapic-generator-typescript/repositories.bzl b/core/generator/gapic-generator-typescript/repositories.bzl deleted file mode 100644 index 8a58d3317cd..00000000000 --- a/core/generator/gapic-generator-typescript/repositories.bzl +++ /dev/null @@ -1,48 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def gapic_generator_typescript_repositories(): - maybe( - http_archive, - name = "aspect_rules_js", - sha256 = "9db12fb5013bb2fb0c8ecf1abd4da10781864e1f5e4faa7ba7382cc96f45949c", - strip_prefix = "rules_js-2.1.3", - url = "https://github.com/aspect-build/rules_js/archive/refs/tags/v2.1.3.tar.gz", - ) - - maybe( - http_archive, - name = "aspect_rules_ts", - sha256 = "8bbac753f4b61adbfc1d9878b87b9cd0f64c9e8e6d8fafc8a1bbfa9625bab162", - strip_prefix = "rules_ts-3.2.1", - url = "https://github.com/aspect-build/rules_ts/archive/refs/tags/v3.2.1.tar.gz", - ) - - maybe( - http_archive, - name = "rules_proto", - sha256 = "f5ae0e582238fcd4ea3d0146a3f5f3db9517f8fe24491eab3c105ace53aad1bb", - strip_prefix = "rules_proto-f9b0b880d1e10e18daeeb168cef9d0f8316fdcb5", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/f9b0b880d1e10e18daeeb168cef9d0f8316fdcb5.tar.gz", - "https://github.com/bazelbuild/rules_proto/archive/f9b0b880d1e10e18daeeb168cef9d0f8316fdcb5.tar.gz", - ], - ) - - _rules_gapic_version = "0.9.0" - maybe( - http_archive, - name = "rules_gapic", - strip_prefix = "rules_gapic-%s" % _rules_gapic_version, - urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version], - ) - - maybe( - http_archive, - name = "com_google_protobuf", - sha256 = "79cc6d09d02706c5a73e900ea842b5b3dae160f371b6654774947fe781851423", - strip_prefix = "protobuf-27.5", - urls = ["https://github.com/protocolbuffers/protobuf/archive/v27.5.tar.gz"], - ) -# This is the version of Node.js that would run the generator, it's unrelated to the versions supported by the generated libraries -NODE_VERSION = "18.12.1" # https://github.com/bazelbuild/rules_nodejs/blob/stable/nodejs/private/node_versions.bzl diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/BUILD.bazel b/core/generator/gapic-generator-typescript/rules_typescript_gapic/BUILD.bazel deleted file mode 100644 index bee0c32de7a..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@bazel_skylib//rules:common_settings.bzl", "string_flag") - -package(default_visibility = ["//visibility:public"]) - -sh_binary( - name = "combine_script", - srcs = ["combine_script.sh"], -) diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh b/core/generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh deleted file mode 100755 index 9950c5388f8..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -echo "All arguments: $@" -PACKAGE_DIR="$1" -shift -DEFAULT_VERSION="$1" -shift -TEMPLATES_EXCLUDES="$1" -shift -PKG_PATH="$1" -shift -COMPILE_PROTOS_PATH="$1" -shift -COMBINE_LIBRARIES_PATH="$1" -shift -RELEASE_LEVEL="$1" -shift -# The rest of arguments are source tars -SRCS=("$@") -# Unpack each library version if we're not in a test -if [ -z "$TEST_ENV_DESTINATION_PATH" ]; then - mkdir "$PACKAGE_DIR" - - for src in "${SRCS[@]}"; do - tar -xf "$src" -C "$PACKAGE_DIR" - done -fi - -# Get full paths to refer to throughout the script given Bazel -# puts things in weird spots -echo $PACKAGE_DIR -LIBRARY_DIR=$(realpath "$PACKAGE_DIR") -echo $LIBRARY_DIR -PROCESS_LIBRARIES=$(realpath "$COMBINE_LIBRARIES_PATH") -echo $PROCESS_LIBRARIES -COMPILE_PROTOS=$(realpath "$COMPILE_PROTOS_PATH") -echo $COMPILE_PROTOS -CWD=$(pwd) - -# Go into the library directory and figure out if it's an ESM -# library; if it is, then set values for later on -cd $LIBRARY_DIR -ESM_FLAG="" -DIR="src" -FLAG="" - -# Check if any nested path contains esm/src -FOUND_ESM_SRC=$(find . -type d -path '*/esm/src' -print -quit 2>/dev/null) -if [ -n "$FOUND_ESM_SRC" ]; then - ESM_FLAG="--isEsm=true" - DIR="esm/src" - FLAG=" --esm" -fi -echo "Library is ESM: $FOUND_ESM_SRC" - -# Go back into main directory to run gapic-node-processing -cd $CWD - -DESTINATION_FLAG="" -SOURCE_FLAG_FOR_README=$LIBRARY_DIR -echo "$TEST_ENV_DESTINATION_PATH" -if [[ -n "$TEST_ENV_DESTINATION_PATH" ]]; then - rm -rf $TEST_ENV_DESTINATION_PATH - mkdir $TEST_ENV_DESTINATION_PATH - DESTINATION_FLAG="--destination-path $TEST_ENV_DESTINATION_PATH" - SOURCE_FLAG_FOR_README=$TEST_ENV_DESTINATION_PATH -fi - -$PROCESS_LIBRARIES combine-library --source-path $LIBRARY_DIR --default-version "$DEFAULT_VERSION" $ESM_FLAG $DESTINATION_FLAG -$PROCESS_LIBRARIES generate-readme --initial-generation true --source-path $SOURCE_FLAG_FOR_README --release-level "$RELEASE_LEVEL" --replacement-string-samples '[//]: # "samples"' --replacement-string-release-level '[//]: # "releaseLevel"' $DESTINATION_FLAG - -# We're calling $COMPILE_PROTOS from the LIBRARY_DIR or else the script can't find the protos -if [[ -n "$TEST_ENV_DESTINATION_PATH" ]]; then - cd $TEST_ENV_DESTINATION_PATH -else - cd $LIBRARY_DIR -fi -# Execute the common command -echo "$COMPILE_PROTOS $DIR $FLAG" -$COMPILE_PROTOS $DIR $FLAG - - -# Here we are removing any handwritten templates we don't want -# the generator to clobber over. -echo "EXCLUDING THE FOLLOWING TEMPLATES:" -echo "$TEMPLATES_EXCLUDES" -if [ -n "$TEMPLATES_EXCLUDES" ]; then - echo -e "$TEMPLATES_EXCLUDES" | while read template; do - # Added an extra check for empty lines in case of trailing newline - if [ -n "$template" ]; then - echo "rm -rf $template"; - rm -rf "$template"; - fi - done -fi - -cd $CWD - -if [ -z "$TEST_ENV_DESTINATION_PATH" ]; then - # Rezip package - tar cfz "$PKG_PATH" -C "$LIBRARY_DIR/.." "$PACKAGE_DIR" -fi diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic.bzl b/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic.bzl deleted file mode 100644 index b76a85508c2..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic.bzl +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@rules_gapic//:gapic.bzl", "proto_custom_library") - -def typescript_gapic_library( - name, - src, - deps, - grpc_service_config = None, - package_name = None, - main_service = None, - bundle_config = None, - service_yaml = None, - metadata = None, - transport = None, - diregapic = None, - handwritten_layer = None, - legacy_proto_load = None, - rest_numeric_enums = None, - mixins = None, - format = None, - extra_protoc_parameters = [], - extra_protoc_file_parameters = {}, - **kwargs): - - plugin_args_dict = {} - if package_name: - plugin_args_dict["package-name"] = package_name - if main_service: - plugin_args_dict["main-service"] = main_service - if metadata: - plugin_args_dict["metadata"] = "true" - if transport: - plugin_args_dict["transport"] = transport - if format: - plugin_args_dict["format"] = format - if diregapic: - plugin_args_dict["diregapic"] = "true" - if handwritten_layer: - plugin_args_dict["handwritten-layer"] = "true" - if legacy_proto_load: - plugin_args_dict["legacy-proto-load"] = "true" - if rest_numeric_enums: - plugin_args_dict["rest-numeric-enums"] = "true" - if mixins: - plugin_args_dict["mixins"] = mixins - - file_args = {} # note: keys are filenames, values are parameter name, aligned with the prior art - for key, value in extra_protoc_file_parameters: - file_args[key] = value - if grpc_service_config: - file_args[grpc_service_config] = "grpc-service-config" - if bundle_config: - file_args[bundle_config] = "bundle-config" - if service_yaml: - file_args[service_yaml] = "service-yaml" - - - plugin_args = [] - for parameter in extra_protoc_parameters: - plugin_args.append(parameter) - for key, value in plugin_args_dict.items(): - plugin_args.append("{}={}".format(key, value)) - - output_suffix = ".srcjar" - - proto_custom_library( - name = name, - deps = [src], - plugin = Label("//:protoc_plugin"), - plugin_args = plugin_args, - plugin_file_args = file_args, - output_type = "typescript-gapic", - output_suffix = output_suffix, - ) diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_combined_pkg.bzl b/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_combined_pkg.bzl deleted file mode 100644 index 5da7f51c540..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_combined_pkg.bzl +++ /dev/null @@ -1,86 +0,0 @@ -load("@rules_gapic//:gapic_pkg.bzl", "construct_package_dir_paths") - -def _typescript_gapic_combined_pkg_impl(ctx): - srcs = [] - - for dep in ctx.attr.deps: - srcs.extend(dep.files.to_list()) - - paths = construct_package_dir_paths(ctx.attr.package_dir, ctx.outputs.pkg, ctx.label.name) - - # 1. Check if templates_excludes is NOT None and NOT empty. - # The Starlark attr.string_list defaults to [], which is falsy in Starlark. - if ctx.attr.templates_excludes: - # 2. If it's valid, join the list with newlines. - templates_excludes_var = "\\n".join(ctx.attr.templates_excludes) - else: - # 3. If it's empty or None, use an empty string. - templates_excludes_var = "" - - args = [ - paths.package_dir, - ctx.attr.default_version, - templates_excludes_var, - ctx.outputs.pkg.path, - ctx.executable.compile_protos.path, - ctx.executable.combine_libraries.path, - ctx.attr.release_level, - ] - args.extend([f.path for f in srcs]) - - ctx.actions.run( - executable = ctx.executable._script, - arguments = args, - inputs = srcs, - outputs = [ctx.outputs.pkg], - tools = [ - ctx.executable.compile_protos, - ctx.executable.combine_libraries, - ], - ) - -_typescript_gapic_combined_pkg = rule( - attrs = { - "deps": attr.label_list(allow_files = True, mandatory = True), - "package_dir": attr.string(mandatory = True), - "default_version": attr.string(mandatory = False), - "templates_excludes": attr.string_list(mandatory = False), - "release_level": attr.string(mandatory = False), - "compile_protos": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//:compile_protos_binary"), - ), - "combine_libraries": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//:combine_libraries_binary"), - ), - "_script": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//rules_typescript_gapic:combine_script"), - ), - }, - outputs = {"pkg": "%{name}.tar.gz"}, - implementation = _typescript_gapic_combined_pkg_impl, -) - -def typescript_gapic_combined_pkg(name, deps, default_version = None, templates_excludes = None, release_level = None, assembly_name = None): - package_dir = name - default_version = default_version - templates_excludes = templates_excludes - release_level = release_level - if assembly_name: - package_dir = "%s-%s" % (assembly_name, name) - _typescript_gapic_combined_pkg( - name = name, - deps = deps, - templates_excludes = templates_excludes, - default_version = default_version, - package_dir = package_dir, - release_level = release_level - ) diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_pkg.bzl b/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_pkg.bzl deleted file mode 100644 index 400cd9db9ef..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_pkg.bzl +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@rules_gapic//:gapic_pkg.bzl", "construct_package_dir_paths") - -def _typescript_gapic_src_pkg_impl(ctx): - proto_srcs = [] - gapic_srcs = [] - - for dep in ctx.attr.deps: - if ProtoInfo in dep: - proto_srcs.extend(dep[ProtoInfo].check_deps_sources.to_list()) - else: - gapic_srcs.extend(dep.files.to_list()) - - paths = construct_package_dir_paths(ctx.attr.package_dir, ctx.outputs.pkg, ctx.label.name) - - script = """ - set -e pipefail - echo -e "{gapic_srcs}" | while read gapic_src; do - mkdir -p "{package_dir_path}" - unzip -q -o "$gapic_src" -d "{package_dir_path}" - done - echo -e "{proto_srcs}" | while read proto_src; do - dirname=`dirname "$proto_src"` - mkdir -p "{package_dir_path}/protos/$dirname" - cp -f "$proto_src" "{package_dir_path}/protos/$dirname" - done - COMPILE_PROTOS=$(realpath "{compile_protos}") - CWD=$(pwd) - cd "{package_dir_path}" - if [ -e esm/src ]; then $COMPILE_PROTOS "esm/src" "--esm"; else $COMPILE_PROTOS "src"; fi - cd $CWD - rm -f "{package_dir_path}/proto.list" - tar cfz "{pkg}" -C "{package_dir_path}/.." "{package_dir}" - rm -rf "{package_dir_path}" - """.format( - gapic_srcs = "\\n".join([f.path for f in gapic_srcs]), - proto_srcs = "\\n".join([f.path for f in proto_srcs]), - package_dir_path = paths.package_dir_path, - package_dir = paths.package_dir, - pkg = ctx.outputs.pkg.path, - compile_protos = ctx.executable.compile_protos.path, - ) - - ctx.actions.run_shell( - inputs = proto_srcs + gapic_srcs, - command = script, - outputs = [ctx.outputs.pkg], - tools = [ctx.executable.compile_protos], - ) - -_typescript_gapic_src_pkg = rule( - attrs = { - "deps": attr.label_list(allow_files = True, mandatory = True), - "package_dir": attr.string(mandatory = True), - "compile_protos": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//:compile_protos_binary"), - ), - }, - outputs = {"pkg": "%{name}.tar.gz"}, - implementation = _typescript_gapic_src_pkg_impl, -) - -def typescript_gapic_assembly_pkg(name, deps, assembly_name = None): - package_dir = name - if assembly_name: - package_dir = "%s-%s" % (assembly_name, name) - _typescript_gapic_src_pkg( - name = name, - deps = deps, - package_dir = package_dir, - ) diff --git a/core/generator/gapic-generator-typescript/yarn.lock b/core/generator/gapic-generator-typescript/yarn.lock index 85fe26d98ed..07a3903c998 100644 --- a/core/generator/gapic-generator-typescript/yarn.lock +++ b/core/generator/gapic-generator-typescript/yarn.lock @@ -24,7 +24,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz" integrity sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ== -"@babel/core@^7.26.8": +"@babel/core@^7.0.0", "@babel/core@^7.26.8": version "7.26.10" resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz" integrity sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ== @@ -144,11 +144,6 @@ "@babel/helper-string-parser" "^7.25.9" "@babel/helper-validator-identifier" "^7.25.9" -"@bazel/bazelisk@^1.26.0": - version "1.26.0" - resolved "https://registry.npmjs.org/@bazel/bazelisk/-/bazelisk-1.26.0.tgz" - integrity sha512-bTNcHdGyEQ9r7SczEYUa0gkEQhJo1ld2BjXI8fWBvsUeoHi03QpUs2HZgDbjjrpQFQqG2ZbO7ihZvH8MjhUTHw== - "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz" @@ -208,7 +203,7 @@ "@google-cloud/storage@^7.15.2": version "7.19.0" - resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-7.19.0.tgz#34fb7cc4eacede5a2f1f0d6cefa0c70a22078c5b" + resolved "https://registry.npmjs.org/@google-cloud/storage/-/storage-7.19.0.tgz" integrity sha512-n2FjE7NAOYyshogdc7KQOl/VZb4sneqPjWouSyia9CMDdMhRX5+RIbqalNmC7LOLzuLAN89VlF2HvG8na9G+zQ== dependencies: "@google-cloud/paginator" "^5.0.0" @@ -310,14 +305,6 @@ resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" @@ -326,6 +313,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@js-sdsl/ordered-map@^4.4.2": version "4.4.2" resolved "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz" @@ -346,7 +341,7 @@ "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": +"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": version "2.0.5" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== @@ -364,7 +359,7 @@ resolved "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz" integrity sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA== -"@octokit/core@^5.0.2": +"@octokit/core@^5", "@octokit/core@^5.0.2", "@octokit/core@5": version "5.2.2" resolved "https://registry.npmjs.org/@octokit/core/-/core-5.2.2.tgz" integrity sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg== @@ -569,7 +564,7 @@ dependencies: long "*" -"@types/markdown-it@^14.1.1": +"@types/markdown-it@*", "@types/markdown-it@^14.1.1": version "14.1.2" resolved "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz" integrity sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog== @@ -597,7 +592,7 @@ resolved "https://registry.npmjs.org/@types/module-alias/-/module-alias-2.0.4.tgz" integrity sha512-5+G/QXO/DvHZw60FjvbDzO4JmlD/nG5m2/vVGt25VN1eeP3w2bCoks1Wa7VuptMPM1TxJdx6RjO70N9Fw0nZPA== -"@types/node@*", "@types/node@>=13.7.0", "@types/node@^22.18.12": +"@types/node@*", "@types/node@^22.18.12", "@types/node@>=13.7.0": version "22.18.12" resolved "https://registry.npmjs.org/@types/node/-/node-22.18.12.tgz" integrity sha512-BICHQ67iqxQGFSzfCFTT7MRQ5XcBjG5aeKh5Ok38UBbPe5fxTyE+aHFxwVrGyr8GNlqFMLKD1D3P2K/1ks8tog== @@ -619,7 +614,7 @@ resolved "https://registry.npmjs.org/@types/object-hash/-/object-hash-3.0.6.tgz" integrity sha512-fOBV8C1FIu2ELinoILQ+ApxcUKz4ngq+IWUYrxSGjXzzjUALijilampwkMgEtJ+h2njAW3pi853QpzNVCHB73w== -"@types/request@^2.48.8": +"@types/request@^2.48.12", "@types/request@^2.48.8": version "2.48.12" resolved "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz" integrity sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw== @@ -667,7 +662,7 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@5.62.0": +"@typescript-eslint/parser@^5.0.0", "@typescript-eslint/parser@5.62.0": version "5.62.0" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz" integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA== @@ -774,11 +769,26 @@ acorn@^5.0.0: resolved "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz" integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== -acorn@^8.11.0, acorn@^8.4.1, acorn@^8.9.0: +"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.9.0: version "8.14.1" resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz" integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg== +acorn@^8.11.0: + version "8.14.1" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz" + integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg== + +acorn@^8.4.1: + version "8.14.1" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz" + integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg== + +agent-base@^7.1.2: + version "7.1.3" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz" + integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== + agent-base@6: version "6.0.2" resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" @@ -786,11 +796,6 @@ agent-base@6: dependencies: debug "4" -agent-base@^7.1.2: - version "7.1.3" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz" - integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== - ajv@^6.12.4: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" @@ -934,7 +939,7 @@ browser-stdout@^1.3.1: resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserslist@^4.24.0: +browserslist@^4.24.0, "browserslist@>= 4.21.0": version "4.24.4" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz" integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== @@ -946,7 +951,7 @@ browserslist@^4.24.0: buffer-equal-constant-time@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + resolved "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz" integrity sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA== buffer-from@^1.0.0: @@ -1132,7 +1137,7 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3, cross-spawn@^7.0.6: shebang-command "^2.0.0" which "^2.0.1" -d@1, d@^1.0.1, d@^1.0.2: +d@^1.0.1, d@^1.0.2, d@1: version "1.0.2" resolved "https://registry.npmjs.org/d/-/d-1.0.2.tgz" integrity sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw== @@ -1145,7 +1150,7 @@ data-uri-to-buffer@^4.0.0: resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz" integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== -debug@4, debug@^4.1.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5: +debug@^4.1.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@4: version "4.4.0" resolved "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz" integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== @@ -1263,7 +1268,7 @@ eastasianwidth@^0.2.0: resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -ecdsa-sig-formatter@1.0.11, ecdsa-sig-formatter@^1.0.11: +ecdsa-sig-formatter@^1.0.11, ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz" integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== @@ -1449,7 +1454,7 @@ escope@^3.3.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-prettier@9.1.0: +eslint-config-prettier@*, eslint-config-prettier@9.1.0: version "9.1.0" resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz" integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== @@ -1529,7 +1534,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@8.57.1: +eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", eslint@>=4.19.1, eslint@>=5, eslint@>=7.0.0, eslint@>=8.0.0, eslint@8.57.1: version "8.57.1" resolved "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz" integrity sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA== @@ -1680,7 +1685,12 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== -estraverse@^5.1.0, estraverse@^5.2.0: +estraverse@^5.1.0: + version "5.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +estraverse@^5.2.0: version "5.3.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== @@ -1772,14 +1782,14 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: fast-xml-builder@^1.1.4: version "1.1.4" - resolved "https://registry.yarnpkg.com/fast-xml-builder/-/fast-xml-builder-1.1.4.tgz#0c407a1d9d5996336c0cd76f7ff785cac6413017" + resolved "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.1.4.tgz" integrity sha512-f2jhpN4Eccy0/Uz9csxh3Nu6q4ErKxf0XIsasomfOihuSUa3/xw6w8dnOtCDgEItQFJG8KyXPzQXzcODDrrbOg== dependencies: path-expression-matcher "^1.1.3" fast-xml-parser@^5.3.4: version "5.5.7" - resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.5.7.tgz#e1ddc86662d808450a19cf2fb6ccc9c3c9933c5d" + resolved "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.5.7.tgz" integrity sha512-LteOsISQ2GEiDHZch6L9hB0+MLoYVLToR7xotrzU0opCICBkxOPgHAy1HxAvtxfJNXDJpgAsQN30mkrfpO2Prg== dependencies: fast-xml-builder "^1.1.4" @@ -1854,7 +1864,7 @@ flat@^5.0.2: flatted@^3.2.9: version "3.4.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.4.2.tgz#f5c23c107f0f37de8dbdf24f13722b3b98d52726" + resolved "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz" integrity sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA== foreground-child@^3.1.0: @@ -1935,19 +1945,19 @@ gaxios@^6.0.0, gaxios@^6.0.2, gaxios@^6.1.1: node-fetch "^2.6.9" uuid "^9.0.1" -gaxios@^7.0.0: - version "7.1.1" - resolved "https://registry.npmjs.org/gaxios/-/gaxios-7.1.1.tgz" - integrity sha512-Odju3uBUJyVCkW64nLD4wKLhbh93bh6vIg/ZIXkWiLPBrdgtc65+tls/qml+un3pr6JqYVFDZbbmLDQT68rTOQ== +gaxios@^7.0.0-rc.1, gaxios@^7.0.0-rc.4: + version "7.0.0-rc.5" + resolved "https://registry.npmjs.org/gaxios/-/gaxios-7.0.0-rc.5.tgz" + integrity sha512-s9rlpplwdb/KCq2DYevVTM/MpozeVZuR3pkzDGXtRhY7wD4fXftIYXUAerX07ZPB3J8/dHUJsX7fPnN2O4Psuw== dependencies: extend "^3.0.2" https-proxy-agent "^7.0.1" node-fetch "^3.3.2" -gaxios@^7.0.0-rc.1, gaxios@^7.0.0-rc.4: - version "7.0.0-rc.5" - resolved "https://registry.npmjs.org/gaxios/-/gaxios-7.0.0-rc.5.tgz" - integrity sha512-s9rlpplwdb/KCq2DYevVTM/MpozeVZuR3pkzDGXtRhY7wD4fXftIYXUAerX07ZPB3J8/dHUJsX7fPnN2O4Psuw== +gaxios@^7.0.0: + version "7.1.1" + resolved "https://registry.npmjs.org/gaxios/-/gaxios-7.1.1.tgz" + integrity sha512-Odju3uBUJyVCkW64nLD4wKLhbh93bh6vIg/ZIXkWiLPBrdgtc65+tls/qml+un3pr6JqYVFDZbbmLDQT68rTOQ== dependencies: extend "^3.0.2" https-proxy-agent "^7.0.1" @@ -1962,15 +1972,6 @@ gcp-metadata@^6.1.0: google-logging-utils "^0.0.2" json-bigint "^1.0.0" -gcp-metadata@^7.0.0: - version "7.0.1" - resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-7.0.1.tgz" - integrity sha512-UcO3kefx6dCcZkgcTGgVOTFb7b1LlQ02hY1omMjjrrBzkajRMCFgYOjs7J71WqnuG1k2b+9ppGL7FsOfhZMQKQ== - dependencies: - gaxios "^7.0.0" - google-logging-utils "^1.0.0" - json-bigint "^1.0.0" - gcp-metadata@^7.0.0-rc.1: version "7.0.0-rc.1" resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-7.0.0-rc.1.tgz" @@ -1980,6 +1981,15 @@ gcp-metadata@^7.0.0-rc.1: google-logging-utils "^1.0.0" json-bigint "^1.0.0" +gcp-metadata@^7.0.0: + version "7.0.1" + resolved "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-7.0.1.tgz" + integrity sha512-UcO3kefx6dCcZkgcTGgVOTFb7b1LlQ02hY1omMjjrrBzkajRMCFgYOjs7J71WqnuG1k2b+9ppGL7FsOfhZMQKQ== + dependencies: + gaxios "^7.0.0" + google-logging-utils "^1.0.0" + json-bigint "^1.0.0" + gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" @@ -2035,7 +2045,7 @@ glob-parent@^6.0.2: glob@^10.4.5: version "10.5.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.5.0.tgz#8ec0355919cd3338c28428a23d4f24ecc5fe738c" + resolved "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz" integrity sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg== dependencies: foreground-child "^3.1.0" @@ -2047,7 +2057,7 @@ glob@^10.4.5: glob@^7.1.3: version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" @@ -2059,7 +2069,7 @@ glob@^7.1.3: glob@^8.0.0: version "8.1.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + resolved "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz" integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== dependencies: fs.realpath "^1.0.0" @@ -2206,14 +2216,6 @@ gtoken@^7.0.0: gaxios "^6.0.0" jws "^4.0.0" -gtoken@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz" - integrity sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw== - dependencies: - gaxios "^7.0.0" - jws "^4.0.0" - gtoken@^8.0.0-rc.1: version "8.0.0-rc.1" resolved "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0-rc.1.tgz" @@ -2222,6 +2224,14 @@ gtoken@^8.0.0-rc.1: gaxios "^7.0.0-rc.1" jws "^4.0.0" +gtoken@^8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz" + integrity sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw== + dependencies: + gaxios "^7.0.0" + jws "^4.0.0" + gts@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/gts/-/gts-6.0.2.tgz" @@ -2369,7 +2379,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3: +inherits@^2.0.3, inherits@2: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -2504,7 +2514,7 @@ js-tokens@^4.0.0: js-yaml@^4.1.0, js-yaml@^4.1.1: version "4.1.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz" integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== dependencies: argparse "^2.0.1" @@ -2576,7 +2586,7 @@ json5@^2.1.3, json5@^2.2.3: jwa@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/jwa/-/jwa-2.0.1.tgz#bf8176d1ad0cd72e0f3f58338595a13e110bc804" + resolved "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz" integrity sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg== dependencies: buffer-equal-constant-time "^1.0.1" @@ -2585,7 +2595,7 @@ jwa@^2.0.1: jws@^4.0.0: version "4.0.1" - resolved "https://registry.yarnpkg.com/jws/-/jws-4.0.1.tgz#07edc1be8fac20e677b283ece261498bd38f0690" + resolved "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz" integrity sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA== dependencies: jwa "^2.0.1" @@ -2664,7 +2674,7 @@ lodash.merge@^4.6.2: lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21: version "4.17.23" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.23.tgz#f113b0378386103be4f6893388c73d0bde7f2c5a" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz" integrity sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w== log-symbols@^4.1.0: @@ -2719,9 +2729,9 @@ markdown-it-anchor@^8.6.7: resolved "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz" integrity sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA== -markdown-it@^14.1.0: +markdown-it@*, markdown-it@^14.1.0: version "14.1.1" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.1.tgz#856f90b66fc39ae70affd25c1b18b581d7deee1f" + resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.1.tgz" integrity sha512-BuU2qnTti9YKgK5N+IeMubp14ZUKUUw7yeJbkjtosvHiP0AZ5c8IAgEMk79D0eC8F23r4Ac/q8cAIFdm2FtyoA== dependencies: argparse "^2.0.1" @@ -2816,23 +2826,44 @@ min-indent@^1.0.0: resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.0.5: + version "3.1.5" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz" + integrity sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^3.1.1: + version "3.1.5" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz" + integrity sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^3.1.2: version "3.1.5" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.5.tgz#580c88f8d5445f2bd6aa8f3cadefa0de79fbd69e" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz" integrity sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w== dependencies: brace-expansion "^1.1.7" minimatch@^5.0.1, minimatch@^5.1.0: version "5.1.9" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.9.tgz#1293ef15db0098b394540e8f9f744f9fda8dee4b" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz" integrity sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw== dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.4, minimatch@^9.0.5: +minimatch@^9.0.4: + version "9.0.9" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz" + integrity sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg== + dependencies: + brace-expansion "^2.0.2" + +minimatch@^9.0.5: version "9.0.9" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.9.tgz#9b0cb9fcb78087f6fd7eababe2511c4d3d60574e" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz" integrity sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg== dependencies: brace-expansion "^2.0.2" @@ -3110,7 +3141,7 @@ path-exists@^4.0.0: path-expression-matcher@^1.1.3: version "1.1.3" - resolved "https://registry.yarnpkg.com/path-expression-matcher/-/path-expression-matcher-1.1.3.tgz#8bf7c629dc1b114e42b633c071f06d14625b4e0d" + resolved "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.1.3.tgz" integrity sha512-qdVgY8KXmVdJZRSS1JdEPOKPdTiEK/pi0RkcT2sw1RhXxohdujUlJFPuS1TSkevZ9vzd3ZlL7ULl1MHGTApKzQ== path-is-absolute@^1.0.0: @@ -3168,7 +3199,7 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@3.3.3: +prettier@>=3.0.0, prettier@3.3.3: version "3.3.3" resolved "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz" integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== @@ -3196,7 +3227,7 @@ protobufjs-cli@^1.2.0: tmp "^0.2.1" uglify-js "^3.7.7" -protobufjs@7.5.4, protobufjs@^7.2.5, protobufjs@^7.4.0, protobufjs@^7.5.3, protobufjs@^7.5.4: +protobufjs@^7.0.0, protobufjs@^7.2.5, protobufjs@^7.4.0, protobufjs@^7.5.3, protobufjs@^7.5.4, protobufjs@7.5.4: version "7.5.4" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz" integrity sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg== @@ -3360,7 +3391,7 @@ reusify@^1.0.4: resolved "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz" integrity sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw== -rimraf@3.0.2, rimraf@^3.0.2: +rimraf@^3.0.2, rimraf@3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -3396,21 +3427,41 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -"semver@2 || 3 || 4 || 5": - version "5.7.2" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - semver@^6.3.1: version "6.3.1" resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.1.2, semver@^7.3.4, semver@^7.3.7, semver@^7.3.8: +semver@^7.0.0: + version "7.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz" + integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== + +semver@^7.1.2: + version "7.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz" + integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== + +semver@^7.3.4: + version "7.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz" + integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== + +semver@^7.3.7: + version "7.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz" + integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== + +semver@^7.3.8: version "7.7.1" resolved "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz" integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== +"semver@2 || 3 || 4 || 5": + version "5.7.2" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + serialize-javascript@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz" @@ -3530,6 +3581,13 @@ stream-shift@^1.0.2: resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz" integrity sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ== +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + "string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" @@ -3548,7 +3606,7 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^5.0.1, string-width@^5.1.2: +string-width@^5.0.1: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== @@ -3557,12 +3615,14 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== +string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== dependencies: - safe-buffer "~5.2.0" + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" "strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" @@ -3603,9 +3663,9 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== strnum@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/strnum/-/strnum-2.2.1.tgz#d28f896b4ef9985212494ce8bcf7ca304fad8368" - integrity sha512-BwRvNd5/QoAtyW1na1y1LsJGQNvRlkde6Q/ipqqEaivoMdV+B1OMOTVdwR+N/cwVUcIt9PYyHmV8HyexCZSupg== + version "2.2.0" + resolved "https://registry.npmjs.org/strnum/-/strnum-2.2.0.tgz" + integrity sha512-Y7Bj8XyJxnPAORMZj/xltsfo55uOiyHcU2tnAVzHUnSJR/KsEX+9RoDeXEnsXtl/CX4fAcrt64gZ13aGaWPeBg== stubs@^3.0.0: version "3.0.0" @@ -3784,7 +3844,7 @@ type@^2.7.2: resolved "https://registry.npmjs.org/type/-/type-2.7.3.tgz" integrity sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ== -typescript@5.6.2: +"typescript@>= 2.7", typescript@>=2.7, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", typescript@>=5, typescript@5.6.2: version "5.6.2" resolved "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz" integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw== @@ -3801,7 +3861,7 @@ uglify-js@^3.19.3, uglify-js@^3.7.7: underscore@~1.13.2: version "1.13.8" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.8.tgz#a93a21186c049dbf0e847496dba72b7bd8c1e92b" + resolved "https://registry.npmjs.org/underscore/-/underscore-1.13.8.tgz" integrity sha512-DXtD3ZtEQzc7M8m4cXotyHR+FAS18C64asBYY5vqZexfYryNNnDc02W4hKg3rdQuqOYas1jkseX0+nZXjTXnvQ== undici-types@~6.21.0: @@ -3839,7 +3899,12 @@ uuid@^8.0.0: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^9.0.0, uuid@^9.0.1: +uuid@^9.0.0: + version "9.0.1" + resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== + +uuid@^9.0.1: version "9.0.1" resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== From 24c6dc3aa04a3a2c48a88e64d0ee975a729cfcda Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Mon, 6 Apr 2026 19:32:53 +0000 Subject: [PATCH 02/13] chore(gapic-generator-typescript): remove bazel dependency from build This change completely removes the Bazel dependency from the gapic-generator-typescript project. All Bazel configuration files have been deleted and package.json scripts have been updated to use the standard TypeScript compiler (tsc) directly. Bazel was originally introduced to export build rules for the googleapis monorepo. However, following the consolidation of the generator into google-cloud-node/core, Bazel is no longer necessary and adds significant overhead (e.g., 4+ minute installations via npm run compile). Since tsc provides all the compilation functionality needed natively, stripping Bazel simplifies the toolchain and significantly speeds up CI pipelines without losing capabilities. To verify this change does not break functionality, the project was locally compiled successfully using `npx tsc -p .` in under 7 seconds. The test scripts were also run, and the overall Librarian CI workflow has been verified to pass with these changes, confirming that the generator builds and executes correctly without Bazel. For https://github.com/googleapis/librarian/issues/4593 --- .../gapic-generator-typescript/.bazeliskrc | 2 - .../gapic-generator-typescript/.bazelrc | 24 ---- .../gapic-generator-typescript/MODULE.bazel | 6 - .../MODULE.bazel.lock | 110 ---------------- .../gapic-generator-typescript/WORKSPACE | 47 ------- .../gapic-generator-typescript/package.json | 19 ++- .../repositories.bzl | 48 ------- .../rules_typescript_gapic/BUILD.bazel | 8 -- .../rules_typescript_gapic/combine_script.sh | 117 ------------------ .../typescript_gapic.bzl | 87 ------------- .../typescript_gapic_combined_pkg.bzl | 86 ------------- .../typescript_gapic_pkg.bzl | 87 ------------- 12 files changed, 9 insertions(+), 632 deletions(-) delete mode 100644 core/generator/gapic-generator-typescript/.bazeliskrc delete mode 100644 core/generator/gapic-generator-typescript/.bazelrc delete mode 100644 core/generator/gapic-generator-typescript/MODULE.bazel delete mode 100644 core/generator/gapic-generator-typescript/MODULE.bazel.lock delete mode 100644 core/generator/gapic-generator-typescript/WORKSPACE delete mode 100644 core/generator/gapic-generator-typescript/repositories.bzl delete mode 100644 core/generator/gapic-generator-typescript/rules_typescript_gapic/BUILD.bazel delete mode 100755 core/generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh delete mode 100644 core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic.bzl delete mode 100644 core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_combined_pkg.bzl delete mode 100644 core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_pkg.bzl diff --git a/core/generator/gapic-generator-typescript/.bazeliskrc b/core/generator/gapic-generator-typescript/.bazeliskrc deleted file mode 100644 index 74cd900fbd3..00000000000 --- a/core/generator/gapic-generator-typescript/.bazeliskrc +++ /dev/null @@ -1,2 +0,0 @@ -# See https://github.com/bazelbuild/bazelisk -USE_BAZEL_VERSION=6.3.0 diff --git a/core/generator/gapic-generator-typescript/.bazelrc b/core/generator/gapic-generator-typescript/.bazelrc deleted file mode 100644 index 5b84b3d13b8..00000000000 --- a/core/generator/gapic-generator-typescript/.bazelrc +++ /dev/null @@ -1,24 +0,0 @@ -# Copied from https://github.com/googleapis/googleapis/blob/master/.bazelrc -# Need because absl library requires C++14 while the Bazel default is C++0x - -# To make proto_library rules to include source info in the descriptor -build --protocopt=--include_source_info -build --protocopt=--experimental_allow_proto3_optional -# New boringssl requires C++14 -build --repo_env=BAZEL_CXXOPTS="-std=c++14" - - -# This is to avoid JVM SIGBUS crashes on highly parallel builds, -# see https://github.com/bazelbuild/bazel/issues/3236 for more details -build --enable_platform_specific_config -build:linux --sandbox_tmpfs_path=/tmp - -build --cxxopt=-std=c++17 -build --host_cxxopt=-std=c++17 - -common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig - - # Between Bazel 6.0 and 6.3, you need all of this, to avoid discarding the analysis cache: - build --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig - fetch --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig - query --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig \ No newline at end of file diff --git a/core/generator/gapic-generator-typescript/MODULE.bazel b/core/generator/gapic-generator-typescript/MODULE.bazel deleted file mode 100644 index 00bb18361f7..00000000000 --- a/core/generator/gapic-generator-typescript/MODULE.bazel +++ /dev/null @@ -1,6 +0,0 @@ -############################################################################### -# Bazel now uses Bzlmod by default to manage external dependencies. -# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. -# -# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 -############################################################################### diff --git a/core/generator/gapic-generator-typescript/MODULE.bazel.lock b/core/generator/gapic-generator-typescript/MODULE.bazel.lock deleted file mode 100644 index d62a47c0f60..00000000000 --- a/core/generator/gapic-generator-typescript/MODULE.bazel.lock +++ /dev/null @@ -1,110 +0,0 @@ -{ - "lockFileVersion": 11, - "registryFileHashes": { - "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", - "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", - "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/source.json": "7e3a9adf473e9af076ae485ed649d5641ad50ec5c11718103f34de03170d94ad", - "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef", - "https://bcr.bazel.build/modules/apple_support/1.5.0/source.json": "eb98a7627c0bc486b57f598ad8da50f6625d974c8f723e9ea71bd39f709c9862", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", - "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015", - "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", - "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", - "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", - "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", - "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749", - "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", - "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", - "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", - "https://bcr.bazel.build/modules/googletest/1.11.0/source.json": "c73d9ef4268c91bd0c1cd88f1f9dfa08e814b1dbe89b5f594a9f08ba0244d206", - "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", - "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", - "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", - "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", - "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", - "https://bcr.bazel.build/modules/platforms/0.0.9/source.json": "cd74d854bf16a9e002fb2ca7b1a421f4403cda29f824a765acd3a8c56f8d43e6", - "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", - "https://bcr.bazel.build/modules/protobuf/21.7/source.json": "bbe500720421e582ff2d18b0802464205138c06056f443184de39fbb8187b09b", - "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", - "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", - "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", - "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", - "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", - "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", - "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430", - "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", - "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", - "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d", - "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", - "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/source.json": "a075731e1b46bc8425098512d038d416e966ab19684a10a34f4741295642fc35", - "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", - "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", - "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", - "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c", - "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", - "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/source.json": "d57902c052424dfda0e71646cb12668d39c4620ee0544294d9d941e7d12bc3a9", - "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", - "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7", - "https://bcr.bazel.build/modules/rules_python/0.22.1/source.json": "57226905e783bae7c37c2dd662be078728e48fa28ee4324a7eabcafb5a43d014", - "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", - "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", - "https://bcr.bazel.build/modules/stardoc/0.5.1/source.json": "a96f95e02123320aa015b956f29c00cb818fa891ef823d55148e1a362caacf29", - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", - "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/source.json": "f1ef7d3f9e0e26d4b23d1c39b5f5de71f584dd7d1b4ef83d9bbba6ec7a6a6459", - "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", - "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79", - "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d" - }, - "selectedYankedVersions": {}, - "moduleExtensions": { - "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { - "general": { - "bzlTransitiveDigest": "PjIds3feoYE8SGbbIq2SFTZy3zmxeO2tQevJZNDo7iY=", - "usagesDigest": "+hz7IHWN6A1oVJJWNDB6yZRG+RYhF76wAYItpAeIUIg=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "local_config_apple_cc_toolchains": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf_toolchains", - "attributes": {} - }, - "local_config_apple_cc": { - "bzlFile": "@@apple_support~//crosstool:setup.bzl", - "ruleClassName": "_apple_cc_autoconf", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [ - [ - "apple_support~", - "bazel_tools", - "bazel_tools" - ] - ] - } - }, - "@@platforms//host:extension.bzl%host_platform": { - "general": { - "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", - "usagesDigest": "pCYpDQmqMbmiiPI1p2Kd3VLm5T48rRAht5WdW0X2GlA=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "host_platform": { - "bzlFile": "@@platforms//host:extension.bzl", - "ruleClassName": "host_platform_repo", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [] - } - } - } -} diff --git a/core/generator/gapic-generator-typescript/WORKSPACE b/core/generator/gapic-generator-typescript/WORKSPACE deleted file mode 100644 index af5d4ebdbcb..00000000000 --- a/core/generator/gapic-generator-typescript/WORKSPACE +++ /dev/null @@ -1,47 +0,0 @@ -workspace( - # How this workspace would be referenced with absolute labels from another workspace - name = "gapic_generator_typescript", -) - -load("//:repositories.bzl", "gapic_generator_typescript_repositories", "NODE_VERSION") -gapic_generator_typescript_repositories() - -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") -protobuf_deps() - -load("@rules_python//python:repositories.bzl", "py_repositories") -py_repositories() - -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") -rules_proto_dependencies() -rules_proto_toolchains() - -load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies") -rules_ts_dependencies( - ts_version_from = "//:package.json", -) - -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") -rules_js_dependencies() - -load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains") - -rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) - -load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock", "pnpm_repository") - - -npm_translate_lock( - name = "npm", - pnpm_lock = "//:pnpm-lock.yaml", - update_pnpm_lock = True, - data = ["//:package.json"], -) -pnpm_repository(name = "pnpm") -load("@npm//:repositories.bzl", "npm_repositories") -npm_repositories() - -# To regenerate the lock file, run: -# bazelisk run -- @pnpm//:pnpm --dir $PWD install --lockfile-only -# More information: https://github.com/aspect-build/rules_js/blob/main/docs/faq.md#can-i-use-bazel-managed-pnpm - diff --git a/core/generator/gapic-generator-typescript/package.json b/core/generator/gapic-generator-typescript/package.json index a4db693ff36..60e9ff66b78 100644 --- a/core/generator/gapic-generator-typescript/package.json +++ b/core/generator/gapic-generator-typescript/package.json @@ -26,25 +26,25 @@ "build/templates" ], "scripts": { - "baseline": "node bazel-bin/typescript/tools/update-baselines.js", - "clean": "bazelisk clean && rm -rf build", - "codecov": "c8 --reporter=lcov mocha bazel-bin/typescript/test/unit && c8 report", - "compile": "bazelisk build //...", + "baseline": "node build/typescript/tools/update-baselines.js", + "clean": "rm -rf build", + "codecov": "c8 --reporter=lcov mocha build/typescript/test/unit && c8 report", + "compile": "tsc -p .", "compile-protos-json": "pbjs -t json -o protos/protos.json -p node_modules/google-gax/build/protos -p protos google/api/annotations.proto google/api/field_behavior.proto google/api/field_info.proto google/api/resource.proto google/api/routing.proto google/longrunning/operations.proto google/protobuf/compiler/plugin.proto service_config.proto snippet_index.proto", "compile-protos-js": "pbjs -t static-module -o protos/index.js -p node_modules/google-gax/build/protos -p protos google/api/annotations.proto google/api/field_behavior.proto google/api/field_info.proto google/api/resource.proto google/api/routing.proto google/longrunning/operations.proto google/protobuf/compiler/plugin.proto service_config.proto snippet_index.proto", "compile-protos-dts": "pbts protos/index.js -o protos/index.d.ts", "docker-test": "sh docker/test.sh", "fix": "gts fix", - "js-test-application": "mocha bazel-bin/typescript/test/test-application/test-js --timeout 600000", + "js-test-application": "mocha build/typescript/test/test-application/test-js --timeout 600000", "lint": "gts check", - "prepack:cjs": "npm run compile && cd templates/cjs/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf bazel-bin/typescript templates protos build/", - "prepack:esm": "npm run compile && cd templates/esm/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf bazel-bin/typescript templates protos build/", + "prepack:cjs": "npm run compile && cd templates/cjs/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf build/typescript templates protos build/", + "prepack:esm": "npm run compile && cd templates/esm/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf build/typescript templates protos build/", "prepack": "npm run prepack:cjs && npm run prepack:esm", "postpack:cjs": "cd templates/cjs/typescript_gapic && mv package.json.njk package.json && ln -s package.json package.json.njk", "postpack:esm": "cd templates/esm/typescript_gapic && mv package.json.njk package.json && ln -s package.json package.json.njk", "postpack": "npm run postpack:cjs && npm run postpack:esm", - "test": "bazelisk test --test_output=errors //:unit_tests", - "ts-test-application": "mocha bazel-bin/typescript/test/test-application/test-ts --timeout 600000", + "test": "mocha build/typescript/test/unit --timeout 600000", + "ts-test-application": "mocha build/typescript/test/test-application/test-ts --timeout 600000", "system-test": "echo 'no system test'", "samples-test": "echo 'no samples test'", "docs": "echo no docs needed", @@ -61,7 +61,6 @@ "yargs": "^17.7.2" }, "devDependencies": { - "@bazel/bazelisk": "^1.26.0", "@types/mocha": "^10.0.10", "@types/module-alias": "^2.0.4", "@types/node": "^22.18.12", diff --git a/core/generator/gapic-generator-typescript/repositories.bzl b/core/generator/gapic-generator-typescript/repositories.bzl deleted file mode 100644 index 8a58d3317cd..00000000000 --- a/core/generator/gapic-generator-typescript/repositories.bzl +++ /dev/null @@ -1,48 +0,0 @@ -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def gapic_generator_typescript_repositories(): - maybe( - http_archive, - name = "aspect_rules_js", - sha256 = "9db12fb5013bb2fb0c8ecf1abd4da10781864e1f5e4faa7ba7382cc96f45949c", - strip_prefix = "rules_js-2.1.3", - url = "https://github.com/aspect-build/rules_js/archive/refs/tags/v2.1.3.tar.gz", - ) - - maybe( - http_archive, - name = "aspect_rules_ts", - sha256 = "8bbac753f4b61adbfc1d9878b87b9cd0f64c9e8e6d8fafc8a1bbfa9625bab162", - strip_prefix = "rules_ts-3.2.1", - url = "https://github.com/aspect-build/rules_ts/archive/refs/tags/v3.2.1.tar.gz", - ) - - maybe( - http_archive, - name = "rules_proto", - sha256 = "f5ae0e582238fcd4ea3d0146a3f5f3db9517f8fe24491eab3c105ace53aad1bb", - strip_prefix = "rules_proto-f9b0b880d1e10e18daeeb168cef9d0f8316fdcb5", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/f9b0b880d1e10e18daeeb168cef9d0f8316fdcb5.tar.gz", - "https://github.com/bazelbuild/rules_proto/archive/f9b0b880d1e10e18daeeb168cef9d0f8316fdcb5.tar.gz", - ], - ) - - _rules_gapic_version = "0.9.0" - maybe( - http_archive, - name = "rules_gapic", - strip_prefix = "rules_gapic-%s" % _rules_gapic_version, - urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version], - ) - - maybe( - http_archive, - name = "com_google_protobuf", - sha256 = "79cc6d09d02706c5a73e900ea842b5b3dae160f371b6654774947fe781851423", - strip_prefix = "protobuf-27.5", - urls = ["https://github.com/protocolbuffers/protobuf/archive/v27.5.tar.gz"], - ) -# This is the version of Node.js that would run the generator, it's unrelated to the versions supported by the generated libraries -NODE_VERSION = "18.12.1" # https://github.com/bazelbuild/rules_nodejs/blob/stable/nodejs/private/node_versions.bzl diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/BUILD.bazel b/core/generator/gapic-generator-typescript/rules_typescript_gapic/BUILD.bazel deleted file mode 100644 index bee0c32de7a..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@bazel_skylib//rules:common_settings.bzl", "string_flag") - -package(default_visibility = ["//visibility:public"]) - -sh_binary( - name = "combine_script", - srcs = ["combine_script.sh"], -) diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh b/core/generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh deleted file mode 100755 index 9950c5388f8..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/combine_script.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -echo "All arguments: $@" -PACKAGE_DIR="$1" -shift -DEFAULT_VERSION="$1" -shift -TEMPLATES_EXCLUDES="$1" -shift -PKG_PATH="$1" -shift -COMPILE_PROTOS_PATH="$1" -shift -COMBINE_LIBRARIES_PATH="$1" -shift -RELEASE_LEVEL="$1" -shift -# The rest of arguments are source tars -SRCS=("$@") -# Unpack each library version if we're not in a test -if [ -z "$TEST_ENV_DESTINATION_PATH" ]; then - mkdir "$PACKAGE_DIR" - - for src in "${SRCS[@]}"; do - tar -xf "$src" -C "$PACKAGE_DIR" - done -fi - -# Get full paths to refer to throughout the script given Bazel -# puts things in weird spots -echo $PACKAGE_DIR -LIBRARY_DIR=$(realpath "$PACKAGE_DIR") -echo $LIBRARY_DIR -PROCESS_LIBRARIES=$(realpath "$COMBINE_LIBRARIES_PATH") -echo $PROCESS_LIBRARIES -COMPILE_PROTOS=$(realpath "$COMPILE_PROTOS_PATH") -echo $COMPILE_PROTOS -CWD=$(pwd) - -# Go into the library directory and figure out if it's an ESM -# library; if it is, then set values for later on -cd $LIBRARY_DIR -ESM_FLAG="" -DIR="src" -FLAG="" - -# Check if any nested path contains esm/src -FOUND_ESM_SRC=$(find . -type d -path '*/esm/src' -print -quit 2>/dev/null) -if [ -n "$FOUND_ESM_SRC" ]; then - ESM_FLAG="--isEsm=true" - DIR="esm/src" - FLAG=" --esm" -fi -echo "Library is ESM: $FOUND_ESM_SRC" - -# Go back into main directory to run gapic-node-processing -cd $CWD - -DESTINATION_FLAG="" -SOURCE_FLAG_FOR_README=$LIBRARY_DIR -echo "$TEST_ENV_DESTINATION_PATH" -if [[ -n "$TEST_ENV_DESTINATION_PATH" ]]; then - rm -rf $TEST_ENV_DESTINATION_PATH - mkdir $TEST_ENV_DESTINATION_PATH - DESTINATION_FLAG="--destination-path $TEST_ENV_DESTINATION_PATH" - SOURCE_FLAG_FOR_README=$TEST_ENV_DESTINATION_PATH -fi - -$PROCESS_LIBRARIES combine-library --source-path $LIBRARY_DIR --default-version "$DEFAULT_VERSION" $ESM_FLAG $DESTINATION_FLAG -$PROCESS_LIBRARIES generate-readme --initial-generation true --source-path $SOURCE_FLAG_FOR_README --release-level "$RELEASE_LEVEL" --replacement-string-samples '[//]: # "samples"' --replacement-string-release-level '[//]: # "releaseLevel"' $DESTINATION_FLAG - -# We're calling $COMPILE_PROTOS from the LIBRARY_DIR or else the script can't find the protos -if [[ -n "$TEST_ENV_DESTINATION_PATH" ]]; then - cd $TEST_ENV_DESTINATION_PATH -else - cd $LIBRARY_DIR -fi -# Execute the common command -echo "$COMPILE_PROTOS $DIR $FLAG" -$COMPILE_PROTOS $DIR $FLAG - - -# Here we are removing any handwritten templates we don't want -# the generator to clobber over. -echo "EXCLUDING THE FOLLOWING TEMPLATES:" -echo "$TEMPLATES_EXCLUDES" -if [ -n "$TEMPLATES_EXCLUDES" ]; then - echo -e "$TEMPLATES_EXCLUDES" | while read template; do - # Added an extra check for empty lines in case of trailing newline - if [ -n "$template" ]; then - echo "rm -rf $template"; - rm -rf "$template"; - fi - done -fi - -cd $CWD - -if [ -z "$TEST_ENV_DESTINATION_PATH" ]; then - # Rezip package - tar cfz "$PKG_PATH" -C "$LIBRARY_DIR/.." "$PACKAGE_DIR" -fi diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic.bzl b/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic.bzl deleted file mode 100644 index b76a85508c2..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic.bzl +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@rules_gapic//:gapic.bzl", "proto_custom_library") - -def typescript_gapic_library( - name, - src, - deps, - grpc_service_config = None, - package_name = None, - main_service = None, - bundle_config = None, - service_yaml = None, - metadata = None, - transport = None, - diregapic = None, - handwritten_layer = None, - legacy_proto_load = None, - rest_numeric_enums = None, - mixins = None, - format = None, - extra_protoc_parameters = [], - extra_protoc_file_parameters = {}, - **kwargs): - - plugin_args_dict = {} - if package_name: - plugin_args_dict["package-name"] = package_name - if main_service: - plugin_args_dict["main-service"] = main_service - if metadata: - plugin_args_dict["metadata"] = "true" - if transport: - plugin_args_dict["transport"] = transport - if format: - plugin_args_dict["format"] = format - if diregapic: - plugin_args_dict["diregapic"] = "true" - if handwritten_layer: - plugin_args_dict["handwritten-layer"] = "true" - if legacy_proto_load: - plugin_args_dict["legacy-proto-load"] = "true" - if rest_numeric_enums: - plugin_args_dict["rest-numeric-enums"] = "true" - if mixins: - plugin_args_dict["mixins"] = mixins - - file_args = {} # note: keys are filenames, values are parameter name, aligned with the prior art - for key, value in extra_protoc_file_parameters: - file_args[key] = value - if grpc_service_config: - file_args[grpc_service_config] = "grpc-service-config" - if bundle_config: - file_args[bundle_config] = "bundle-config" - if service_yaml: - file_args[service_yaml] = "service-yaml" - - - plugin_args = [] - for parameter in extra_protoc_parameters: - plugin_args.append(parameter) - for key, value in plugin_args_dict.items(): - plugin_args.append("{}={}".format(key, value)) - - output_suffix = ".srcjar" - - proto_custom_library( - name = name, - deps = [src], - plugin = Label("//:protoc_plugin"), - plugin_args = plugin_args, - plugin_file_args = file_args, - output_type = "typescript-gapic", - output_suffix = output_suffix, - ) diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_combined_pkg.bzl b/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_combined_pkg.bzl deleted file mode 100644 index 5da7f51c540..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_combined_pkg.bzl +++ /dev/null @@ -1,86 +0,0 @@ -load("@rules_gapic//:gapic_pkg.bzl", "construct_package_dir_paths") - -def _typescript_gapic_combined_pkg_impl(ctx): - srcs = [] - - for dep in ctx.attr.deps: - srcs.extend(dep.files.to_list()) - - paths = construct_package_dir_paths(ctx.attr.package_dir, ctx.outputs.pkg, ctx.label.name) - - # 1. Check if templates_excludes is NOT None and NOT empty. - # The Starlark attr.string_list defaults to [], which is falsy in Starlark. - if ctx.attr.templates_excludes: - # 2. If it's valid, join the list with newlines. - templates_excludes_var = "\\n".join(ctx.attr.templates_excludes) - else: - # 3. If it's empty or None, use an empty string. - templates_excludes_var = "" - - args = [ - paths.package_dir, - ctx.attr.default_version, - templates_excludes_var, - ctx.outputs.pkg.path, - ctx.executable.compile_protos.path, - ctx.executable.combine_libraries.path, - ctx.attr.release_level, - ] - args.extend([f.path for f in srcs]) - - ctx.actions.run( - executable = ctx.executable._script, - arguments = args, - inputs = srcs, - outputs = [ctx.outputs.pkg], - tools = [ - ctx.executable.compile_protos, - ctx.executable.combine_libraries, - ], - ) - -_typescript_gapic_combined_pkg = rule( - attrs = { - "deps": attr.label_list(allow_files = True, mandatory = True), - "package_dir": attr.string(mandatory = True), - "default_version": attr.string(mandatory = False), - "templates_excludes": attr.string_list(mandatory = False), - "release_level": attr.string(mandatory = False), - "compile_protos": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//:compile_protos_binary"), - ), - "combine_libraries": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//:combine_libraries_binary"), - ), - "_script": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//rules_typescript_gapic:combine_script"), - ), - }, - outputs = {"pkg": "%{name}.tar.gz"}, - implementation = _typescript_gapic_combined_pkg_impl, -) - -def typescript_gapic_combined_pkg(name, deps, default_version = None, templates_excludes = None, release_level = None, assembly_name = None): - package_dir = name - default_version = default_version - templates_excludes = templates_excludes - release_level = release_level - if assembly_name: - package_dir = "%s-%s" % (assembly_name, name) - _typescript_gapic_combined_pkg( - name = name, - deps = deps, - templates_excludes = templates_excludes, - default_version = default_version, - package_dir = package_dir, - release_level = release_level - ) diff --git a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_pkg.bzl b/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_pkg.bzl deleted file mode 100644 index 400cd9db9ef..00000000000 --- a/core/generator/gapic-generator-typescript/rules_typescript_gapic/typescript_gapic_pkg.bzl +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@rules_gapic//:gapic_pkg.bzl", "construct_package_dir_paths") - -def _typescript_gapic_src_pkg_impl(ctx): - proto_srcs = [] - gapic_srcs = [] - - for dep in ctx.attr.deps: - if ProtoInfo in dep: - proto_srcs.extend(dep[ProtoInfo].check_deps_sources.to_list()) - else: - gapic_srcs.extend(dep.files.to_list()) - - paths = construct_package_dir_paths(ctx.attr.package_dir, ctx.outputs.pkg, ctx.label.name) - - script = """ - set -e pipefail - echo -e "{gapic_srcs}" | while read gapic_src; do - mkdir -p "{package_dir_path}" - unzip -q -o "$gapic_src" -d "{package_dir_path}" - done - echo -e "{proto_srcs}" | while read proto_src; do - dirname=`dirname "$proto_src"` - mkdir -p "{package_dir_path}/protos/$dirname" - cp -f "$proto_src" "{package_dir_path}/protos/$dirname" - done - COMPILE_PROTOS=$(realpath "{compile_protos}") - CWD=$(pwd) - cd "{package_dir_path}" - if [ -e esm/src ]; then $COMPILE_PROTOS "esm/src" "--esm"; else $COMPILE_PROTOS "src"; fi - cd $CWD - rm -f "{package_dir_path}/proto.list" - tar cfz "{pkg}" -C "{package_dir_path}/.." "{package_dir}" - rm -rf "{package_dir_path}" - """.format( - gapic_srcs = "\\n".join([f.path for f in gapic_srcs]), - proto_srcs = "\\n".join([f.path for f in proto_srcs]), - package_dir_path = paths.package_dir_path, - package_dir = paths.package_dir, - pkg = ctx.outputs.pkg.path, - compile_protos = ctx.executable.compile_protos.path, - ) - - ctx.actions.run_shell( - inputs = proto_srcs + gapic_srcs, - command = script, - outputs = [ctx.outputs.pkg], - tools = [ctx.executable.compile_protos], - ) - -_typescript_gapic_src_pkg = rule( - attrs = { - "deps": attr.label_list(allow_files = True, mandatory = True), - "package_dir": attr.string(mandatory = True), - "compile_protos": attr.label( - executable = True, - cfg = "exec", - allow_files = True, - default = Label("//:compile_protos_binary"), - ), - }, - outputs = {"pkg": "%{name}.tar.gz"}, - implementation = _typescript_gapic_src_pkg_impl, -) - -def typescript_gapic_assembly_pkg(name, deps, assembly_name = None): - package_dir = name - if assembly_name: - package_dir = "%s-%s" % (assembly_name, name) - _typescript_gapic_src_pkg( - name = name, - deps = deps, - package_dir = package_dir, - ) From d3c679aee9a9e1f236c28e4a52e61f97d9b9af2b Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Mon, 6 Apr 2026 23:50:43 +0000 Subject: [PATCH 03/13] ci: fix generator tests after bazel removal Since Bazel was completely stripped out of the repository, the generator-tests.yaml workflow was failing because it attempted to strip GCC flags from .bazelrc and run bazelisk commands. This commit updates the CI workflow to: - Use standard 'npm run compile' and 'npm test' instead of bazelisk. - Reference the built protoc-plugin.js path directly instead of bazel-bin. - Manually zip the generated .test-out directories instead of relying on Bazel's testlogs. --- .github/workflows/generator-tests.yaml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/generator-tests.yaml b/.github/workflows/generator-tests.yaml index efa80d2caeb..388fd7b0348 100644 --- a/.github/workflows/generator-tests.yaml +++ b/.github/workflows/generator-tests.yaml @@ -40,18 +40,14 @@ jobs: - name: Install Node dependencies with npm run: npm install working-directory: core/generator/gapic-generator-typescript - - - name: Strip local GCC 15 flags for CI - working-directory: core/generator/gapic-generator-typescript - run: sed -i '/--gsframe/d' .bazelrc - - name: Run bazel build + - name: Run compile working-directory: core/generator/gapic-generator-typescript - run: bazelisk build --noremote_accept_cached '//...' + run: npm run compile - - name: Run bazel test + - name: Run test working-directory: core/generator/gapic-generator-typescript - run: bazelisk test --test_output=errors --noremote_accept_cached //... + run: npm test - name: Verify error conformance working-directory: core/generator/gapic-generator-typescript @@ -59,15 +55,15 @@ jobs: curl -sSL https://github.com/googleapis/gapic-config-validator/releases/download/v0.6.0/gapic-config-validator-0.6.0-linux-amd64.tar.gz > config-validator.tar.gz tar xzf config-validator.tar.gz --no-same-owner chmod +x gapic-error-conformance - chmod +x bazel-bin/protoc_plugin_/protoc_plugin - ./gapic-error-conformance -plugin="bazel-bin/protoc_plugin_/protoc_plugin" + chmod +x build/typescript/src/protoc-plugin.js + ./gapic-error-conformance -plugin="build/typescript/src/protoc-plugin.js" - name: Prepare baseline artifacts working-directory: core/generator/gapic-generator-typescript run: | mkdir -p ~/artifacts - cp bazel-testlogs/unit_tests/test.outputs/outputs.zip ~/artifacts/ - bazelisk run -- @pnpm//:pnpm --dir $PWD install + zip -r ~/artifacts/outputs.zip .test-out-* + npm install tar cfz ~/artifacts/node_modules.tar.gz node_modules - name: Save artifacts @@ -93,7 +89,6 @@ jobs: npm run docs cd ../.. done - - name: Test generated ESM libraries working-directory: core/generator/gapic-generator-typescript run: | From 8ef61962f038b5618b75c4a3a1569b685d4872e6 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 7 Apr 2026 00:32:52 +0000 Subject: [PATCH 04/13] test: fix permission denied error in generator baselines When running tests locally or in CI without Bazel, the generated TypeScript entry point (gapic-generator-typescript.js) was losing its executable permissions, causing baseline tests to fail with 'Permission denied'. This commit explicitly invokes the generator with 'node' in the test utility to ensure cross-platform execution without relying on file permissions. --- .../gapic-generator-typescript/typescript/test/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/generator/gapic-generator-typescript/typescript/test/util.ts b/core/generator/gapic-generator-typescript/typescript/test/util.ts index 617a44463c0..3f9b5587e7f 100644 --- a/core/generator/gapic-generator-typescript/typescript/test/util.ts +++ b/core/generator/gapic-generator-typescript/typescript/test/util.ts @@ -102,7 +102,7 @@ export function runBaselineTest(options: BaselineOptions) { fs.mkdirSync(outputDir); let commandLine = - `${entryPointPath} ` + + `node ${entryPointPath} ` + `--output_dir=${outputDir} ` + `-I${protosDirRoot} ${protoPaths.join(' ')}`; if (options.useCommonProto) { From 32a2130e7e6ccd007eaa33a2f68b0edc187c502c Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 7 Apr 2026 02:31:52 +0000 Subject: [PATCH 05/13] fix: ensure templates are copied to build dir during compilation When Bazel was removed, the build step stopped copying the 'templates/' directory to the 'build/' output folder. This caused the generator to fail with ENOENT errors when it tried to locate the Nunjucks templates during code generation. This commit updates the 'npm run compile' script to explicitly copy the templates directory into 'build/' after tsc finishes. --- core/generator/gapic-generator-typescript/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/generator/gapic-generator-typescript/package.json b/core/generator/gapic-generator-typescript/package.json index bfb4399fc86..05db7775433 100644 --- a/core/generator/gapic-generator-typescript/package.json +++ b/core/generator/gapic-generator-typescript/package.json @@ -29,7 +29,7 @@ "baseline": "node build/typescript/tools/update-baselines.js", "clean": "rm -rf build", "codecov": "c8 --reporter=lcov mocha build/typescript/test/unit && c8 report", - "compile": "tsc -p .", + "compile": "tsc -p . && cp -r templates build/", "compile-protos-json": "pbjs -t json -o protos/protos.json -p node_modules/google-gax/build/protos -p protos google/api/annotations.proto google/api/field_behavior.proto google/api/field_info.proto google/api/resource.proto google/api/routing.proto google/longrunning/operations.proto google/protobuf/compiler/plugin.proto service_config.proto snippet_index.proto", "compile-protos-js": "pbjs -t static-module -o protos/index.js -p node_modules/google-gax/build/protos -p protos google/api/annotations.proto google/api/field_behavior.proto google/api/field_info.proto google/api/resource.proto google/api/routing.proto google/longrunning/operations.proto google/protobuf/compiler/plugin.proto service_config.proto snippet_index.proto", "compile-protos-dts": "pbts protos/index.js -o protos/index.d.ts", From f0eefc4abfb54132207d6cb2c6616a4bfb161c18 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 7 Apr 2026 18:01:55 +0000 Subject: [PATCH 06/13] fix: rely on system protoc in CI With Bazel removed, the gapic-generator-typescript no longer has a local, managed version of the `protoc` binary injected via the environment variable. When it attempts to find `protoc` in the local file system using `fs.existsSync('protoc')`, it fails and throws an error. This commit updates the check to skip `fs.existsSync` if the resolved path is just the string 'protoc', allowing the generator to correctly defer to the system PATH where protoc is already installed in CI. --- .../typescript/src/gapic-generator-typescript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts b/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts index df9a4646025..a86aacc23d8 100755 --- a/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts +++ b/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts @@ -164,7 +164,7 @@ async function main(processArgv: string[]) { protocParameter = protocParameter[protocParameter.length - 1]; } const protoc = protocParameter ?? protocEnv ?? 'protoc'; - if (!fs.existsSync(protoc)) { + if (protoc !== 'protoc' && !fs.existsSync(protoc)) { throw new Error( `ERROR: protoc binary is not found at ${protoc}, use --protoc option to point to your protoc binary`, ); From ebb1a64a03a12e134a7fefc554bf16fe256ff36f Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 7 Apr 2026 18:25:20 +0000 Subject: [PATCH 07/13] ci: install protoc before running generator tests With Bazel removed, the gapic-generator-typescript no longer has a local, managed version of the `protoc` binary. The generator-tests.yaml workflow was failing because it attempted to spawn `protoc` without it being installed in the container environment. This commit updates the CI workflow to download and install protoc v25.3 globally before running the tests. --- .github/workflows/generator-tests.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/generator-tests.yaml b/.github/workflows/generator-tests.yaml index 388fd7b0348..160ad4b3baa 100644 --- a/.github/workflows/generator-tests.yaml +++ b/.github/workflows/generator-tests.yaml @@ -37,6 +37,12 @@ jobs: with: node-version: 18.x + - name: Install protoc + run: | + curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-linux-x86_64.zip" + unzip protoc-25.3-linux-x86_64.zip -d /usr/local + chmod +x /usr/local/bin/protoc + - name: Install Node dependencies with npm run: npm install working-directory: core/generator/gapic-generator-typescript From db1eeff5fc7318236dd981985698444520d72fb1 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 7 Apr 2026 19:49:53 +0000 Subject: [PATCH 08/13] test: provide PROTOC_PATH in CI The gapic-generator-typescript expects the 'PROTOC_PATH' environment variable to point to the protoc binary, or it falls back to looking for 'protoc' in the system PATH. This commit updates generator-tests.yaml to explicitly provide the PROTOC_PATH environment variable to 'npm test' pointing to the newly installed /usr/local/bin/protoc binary, ensuring the tests don't fail with ENOENT when trying to spawn protoc. --- .github/workflows/generator-tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/generator-tests.yaml b/.github/workflows/generator-tests.yaml index 160ad4b3baa..0c25088699c 100644 --- a/.github/workflows/generator-tests.yaml +++ b/.github/workflows/generator-tests.yaml @@ -54,6 +54,8 @@ jobs: - name: Run test working-directory: core/generator/gapic-generator-typescript run: npm test + env: + PROTOC_PATH: /usr/local/bin/protoc - name: Verify error conformance working-directory: core/generator/gapic-generator-typescript From 5da54168588e58e12a010f0ffe25e1d3532a957c Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 7 Apr 2026 20:56:25 +0000 Subject: [PATCH 09/13] fix: ensure protoc-plugin is executed with node When Bazel was removed, the protoc-plugin.js file generated by tsc no longer had executable permissions. When protoc attempted to invoke it via the --plugin flag, it failed with 'program not found or is not executable'. This commit updates the fallback logic in gapic-generator-typescript.ts to prepend 'node ' to the protoc plugin path, ensuring protoc executes it correctly using the Node.js runtime without relying on file permissions. --- .../typescript/src/gapic-generator-typescript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts b/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts index a86aacc23d8..fbefe18da69 100755 --- a/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts +++ b/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts @@ -52,7 +52,7 @@ async function main(processArgv: string[]) { const protocPluginBash = path.join(__dirname, '..', 'protoc_plugin.sh'); const protocPlugin = fs.existsSync(protocPluginBash) ? protocPluginBash - : path.join(__dirname, 'protoc-plugin.js'); + : `node ${path.join(__dirname, 'protoc-plugin.js')}`; const argv = await yargs(processArgv) .array('I') From 7e0eac9ca11e3a898fe7c5bf38b617262667fa4a Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 7 Apr 2026 20:57:40 +0000 Subject: [PATCH 10/13] ci: execute error conformance plugin with node The gapic-error-conformance binary invoked the protoc-plugin.js directly, which failed because the generated script no longer has executable permissions after the removal of Bazel. This updates the CI workflow to execute the plugin via the Node.js runtime ('node ...') instead of relying on chmod and the file's shebang. --- .github/workflows/generator-tests.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/generator-tests.yaml b/.github/workflows/generator-tests.yaml index 0c25088699c..ec83e8d92d5 100644 --- a/.github/workflows/generator-tests.yaml +++ b/.github/workflows/generator-tests.yaml @@ -63,8 +63,7 @@ jobs: curl -sSL https://github.com/googleapis/gapic-config-validator/releases/download/v0.6.0/gapic-config-validator-0.6.0-linux-amd64.tar.gz > config-validator.tar.gz tar xzf config-validator.tar.gz --no-same-owner chmod +x gapic-error-conformance - chmod +x build/typescript/src/protoc-plugin.js - ./gapic-error-conformance -plugin="build/typescript/src/protoc-plugin.js" + ./gapic-error-conformance -plugin="node build/typescript/src/protoc-plugin.js" - name: Prepare baseline artifacts working-directory: core/generator/gapic-generator-typescript From 98d0c014d60393e36a00326fafdb62e51c4aba67 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 7 Apr 2026 22:27:54 +0000 Subject: [PATCH 11/13] fix: ensure protoc-plugin is executable for protoc When protoc invokes a plugin via the --plugin=name=path flag, it expects 'path' to be an actual executable binary/script. Prepending 'node' to the path caused protoc to fail to find the executable. This commit updates gapic-generator-typescript to explicitly run fs.chmodSync(pluginPath, 0o755) before passing the path to protoc, ensuring the generated script is executable and can use its node shebang. --- .../typescript/src/gapic-generator-typescript.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts b/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts index fbefe18da69..2ae4379a649 100755 --- a/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts +++ b/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts @@ -50,9 +50,21 @@ async function main(processArgv: string[]) { // Just in case if someone builds us without bazel, let's have a fallback to an actual // JS protoc plugin without a wrapper. const protocPluginBash = path.join(__dirname, '..', 'protoc_plugin.sh'); - const protocPlugin = fs.existsSync(protocPluginBash) + let protocPlugin = fs.existsSync(protocPluginBash) ? protocPluginBash - : `node ${path.join(__dirname, 'protoc-plugin.js')}`; + : path.join(__dirname, 'protoc-plugin.js'); + + if (protocPlugin.endsWith('.js') && process.platform === 'win32') { + protocPlugin = `node ${protocPlugin}`; + } else if (protocPlugin.endsWith('.js')) { + // In Unix, protoc expects an actual executable file. We cannot pass "node file.js". + // Instead, we ensure the file has execution permissions so the shebang takes over. + try { + fs.chmodSync(protocPlugin, 0o755); + } catch (e) { + // ignore + } + } const argv = await yargs(processArgv) .array('I') From ff718a135e99577840d162d751fba45295160991 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 7 Apr 2026 23:47:12 +0000 Subject: [PATCH 12/13] fix: enable --experimental_editions in protoc When protoc compiles proto files that use the experimental Editions feature (like google/showcase/v1beta1/testing.proto), it throws a fatal error unless the --experimental_editions flag is explicitly passed. This commit updates the generator to always pass this flag to protoc, ensuring it doesn't crash when encountering these newer proto files now that we are relying on the system protoc (v25+). --- .../typescript/src/gapic-generator-typescript.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts b/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts index 2ae4379a649..85b5d859408 100755 --- a/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts +++ b/core/generator/gapic-generator-typescript/typescript/src/gapic-generator-typescript.ts @@ -201,6 +201,7 @@ async function main(processArgv: string[]) { const protocCommand = [ `--plugin=protoc-gen-typescript_gapic=${protocPlugin}`, `--typescript_gapic_out=${outputDir}`, + `--experimental_editions`, ]; if (gapicValidatorOut && validation === 'true') { protocCommand.push(`--gapic-validator_out=${gapicValidatorOut}`); From 8027ef803d2aac2fb58d59fe4cf8b6c19ad8c724 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Wed, 8 Apr 2026 19:21:49 +0000 Subject: [PATCH 13/13] ci: revert gapic-error-conformance plugin execution The gapic-error-conformance tool expects an executable binary or script for the -plugin flag and fails with 'no such file or directory' when passed a string like 'node file.js'. This commit reverts the workflow to use chmod +x on the generated plugin script so it can be passed directly to the conformance tool, since we previously updated the typescript code to ensure the script itself is generated with execution permissions. --- .github/workflows/generator-tests.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generator-tests.yaml b/.github/workflows/generator-tests.yaml index ec83e8d92d5..0c25088699c 100644 --- a/.github/workflows/generator-tests.yaml +++ b/.github/workflows/generator-tests.yaml @@ -63,7 +63,8 @@ jobs: curl -sSL https://github.com/googleapis/gapic-config-validator/releases/download/v0.6.0/gapic-config-validator-0.6.0-linux-amd64.tar.gz > config-validator.tar.gz tar xzf config-validator.tar.gz --no-same-owner chmod +x gapic-error-conformance - ./gapic-error-conformance -plugin="node build/typescript/src/protoc-plugin.js" + chmod +x build/typescript/src/protoc-plugin.js + ./gapic-error-conformance -plugin="build/typescript/src/protoc-plugin.js" - name: Prepare baseline artifacts working-directory: core/generator/gapic-generator-typescript