mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: make webmcp-types sources genrule cross-platform
Replace `sed -i` in-place substitution with direct stdout redirection from the source file to destination outputs. `sed -i` behaves differently between GNU and BSD sed, which caused build failures on macOS.
This commit is contained in:
@@ -11,11 +11,9 @@ genrule(
|
||||
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)"
|
||||
# Rewrite bare imports of @modelcontextprotocol/server to use the vendored relative path
|
||||
sed -i 's|@modelcontextprotocol/server|../../../@modelcontextprotocol/server/index.js|g' "$(location dist/common.d.ts)" || true
|
||||
cp "$${SRC_DIR}/dist/json-schema.d.ts" "$(location dist/json-schema.d.ts)"
|
||||
sed -i 's|@modelcontextprotocol/server|../../../@modelcontextprotocol/server/index.js|g' "$(location dist/json-schema.d.ts)" || true
|
||||
sed 's|@modelcontextprotocol/server|../../../@modelcontextprotocol/server/index.js|g' "$${SRC_DIR}/dist/common.d.ts" > "$(location dist/common.d.ts)"
|
||||
sed 's|@modelcontextprotocol/server|../../../@modelcontextprotocol/server/index.js|g' "$${SRC_DIR}/dist/json-schema.d.ts" > "$(location dist/json-schema.d.ts)"
|
||||
cp "$${SRC_DIR}/LICENSE" "$(location LICENSE)"
|
||||
""",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user