diff --git a/packages/core/BUILD.bazel b/packages/core/BUILD.bazel index 8079532b867..02dbb374caa 100644 --- a/packages/core/BUILD.bazel +++ b/packages/core/BUILD.bazel @@ -1,9 +1,12 @@ +load("@npm//:defs.bzl", "npm_link_all_packages") load("//adev/shared-docs/pipeline/api-gen:generate_api_docs.bzl", "generate_api_docs") load("//packages/common/locales:index.bzl", "generate_base_locale_file") load("//tools:defaults.bzl", "api_golden_test", "api_golden_test_npm_package", "ng_package", "ng_project", "ts_config", "tsec_test") package(default_visibility = ["//visibility:public"]) +npm_link_all_packages(name = "node_modules") + # This generates the `src/i18n/locale_en.ts` file through the `generate-locales` tool. Since # the base locale file is checked-in for Google3, it is additionally stored in a golden location. generate_base_locale_file( @@ -61,10 +64,20 @@ ng_package( ":event_dispatch_contract_binary", "//packages/core/resources", ], + externals = [ + # Don't bundle vendored `@mcp-b/webmcp-types` dependency. + "../third_party/@mcp-b/webmcp-types", + "../../third_party/@mcp-b/webmcp-types", + ], nested_packages = [ "//packages/core/schematics:npm_package", + "//packages/core/third_party/@mcp-b/webmcp-types", ], package = "@angular/core", + substitutions = { + # Link `@mcp-b/webmcp-types` to the vendored package. + "\\./third_party/@mcp-b/webmcp-types": "../third_party/@mcp-b/webmcp-types/index.js", + }, tags = [ "release-with-framework", ], diff --git a/packages/core/package.json b/packages/core/package.json index 11e452904a9..89f99044469 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -18,6 +18,9 @@ "dependencies": { "tslib": "^2.3.0" }, + "devDependencies": { + "@mcp-b/webmcp-types": "^2.2.0" + }, "peerDependencies": { "@angular/compiler": "0.0.0-PLACEHOLDER", "rxjs": "^6.5.3 || ^7.4.0", diff --git a/packages/core/third_party/@mcp-b/webmcp-types/BUILD.bazel b/packages/core/third_party/@mcp-b/webmcp-types/BUILD.bazel new file mode 100644 index 00000000000..fb796453155 --- /dev/null +++ b/packages/core/third_party/@mcp-b/webmcp-types/BUILD.bazel @@ -0,0 +1,27 @@ +load("//tools:defaults.bzl", "js_library") + +genrule( + name = "sources", + srcs = ["//packages/core:node_modules/@mcp-b/webmcp-types/dir"], + outs = [ + "dist/common.d.ts", + "dist/json-schema.d.ts", + "LICENSE", + ], + cmd = """ + readonly SRC_DIR="$(location //packages/core:node_modules/@mcp-b/webmcp-types/dir)" + mkdir -p "$$(dirname "$(location dist/common.d.ts)")" + cp "$${SRC_DIR}/dist/common.d.ts" "$(location dist/common.d.ts)" + cp "$${SRC_DIR}/dist/json-schema.d.ts" "$(location dist/json-schema.d.ts)" + cp "$${SRC_DIR}/LICENSE" "$(location LICENSE)" + """, +) + +js_library( + name = "webmcp-types", + srcs = [ + "index.d.ts", + ":sources", + ], + visibility = ["//packages/core:__subpackages__"], +) diff --git a/packages/core/third_party/@mcp-b/webmcp-types/README.md b/packages/core/third_party/@mcp-b/webmcp-types/README.md new file mode 100644 index 00000000000..fb36d098e83 --- /dev/null +++ b/packages/core/third_party/@mcp-b/webmcp-types/README.md @@ -0,0 +1,4 @@ +# WebMCP Types + +This directory contains types vendored from `@mcp-b/webmcp-types` to +address API extractor issues. diff --git a/packages/core/third_party/@mcp-b/webmcp-types/index.d.ts b/packages/core/third_party/@mcp-b/webmcp-types/index.d.ts new file mode 100644 index 00000000000..e06dd8cf606 --- /dev/null +++ b/packages/core/third_party/@mcp-b/webmcp-types/index.d.ts @@ -0,0 +1,9 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +export {InferArgsFromInputSchema, JsonSchemaForInference} from './dist/json-schema.js'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27d52449b48..770b370d6e8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1004,6 +1004,10 @@ importers: zone.js: specifier: ~0.15.0 || ~0.16.0 version: 0.16.1 + devDependencies: + '@mcp-b/webmcp-types': + specifier: ^2.2.0 + version: 2.2.0 packages/core/test/bundling: dependencies: @@ -3831,6 +3835,9 @@ packages: '@marijn/find-cluster-break@1.0.2': resolution: {integrity: sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==} + '@mcp-b/webmcp-types@2.2.0': + resolution: {integrity: sha512-1/UYAwQKBkqRgK18GkbGR4m6Cn9vz6Qy6pTL5LIIinUOhR5dMLaNl/blH/tJT+nJleMmgDoFZWGAmmr+fAz2PQ==} + '@mermaid-js/parser@1.1.0': resolution: {integrity: sha512-gxK9ZX2+Fex5zu8LhRQoMeMPEHbc73UKZ0FQ54YrQtUxE1VVhMwzeNtKRPAu5aXks4FasbMe4xB4bWrmq6Jlxw==} @@ -15828,6 +15835,8 @@ snapshots: '@marijn/find-cluster-break@1.0.2': {} + '@mcp-b/webmcp-types@2.2.0': {} + '@mermaid-js/parser@1.1.0': dependencies: langium: 4.2.3