Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(bazel): remove hacky mock @angular/bazel npm package under tools/npm/@angular_bazel #36009

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -41,7 +41,6 @@
"@angular-devkit/build-optimizer": "0.900.3",
"@angular-devkit/core": "9.0.3",
"@angular-devkit/schematics": "9.0.3",
"@angular/bazel": "file:./tools/npm/@angular_bazel",
"@babel/core": "^7.8.6",
"@babel/generator": "^7.8.6",
"@babel/template": "^7.8.6",
Expand Down
1 change: 1 addition & 0 deletions packages/bazel/BUILD.bazel
Expand Up @@ -19,6 +19,7 @@ pkg_npm(
],
substitutions = {
"(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "",
"//packages/bazel/src/ngc-wrapped": "@npm//@angular/bazel/bin:ngc-wrapped",
"//packages/bazel/": "//",
"angular/packages/bazel/": "npm_angular_bazel/",
},
Expand Down
26 changes: 2 additions & 24 deletions packages/bazel/src/esm5.bzl
Expand Up @@ -12,8 +12,6 @@ However we need to publish this flavor on NPM, so it's necessary to be able
to produce it.
"""

load(":external.bzl", "DEFAULT_NG_COMPILER")

# The provider downstream rules use to access the outputs
ESM5Info = provider(
doc = "Typescript compilation outputs in ES5 syntax with ES Modules",
Expand Down Expand Up @@ -94,15 +92,6 @@ def _esm5_outputs_aspect(target, ctx):
compiler = ctx.executable._tsc_wrapped
elif replay_compiler_name.startswith("ngc-wrapped"):
compiler = ctx.executable._ngc_wrapped

# BEGIN-INTERNAL
# If the "replay_compiler" path does not refer to "ngc_wrapped" from the "@npm" workspace,
# we use "ngc_wrapped" from within the Angular workspace. This is necessary because we
# don't have a "npm" workspace with the "@angular/bazel" NPM package installed.
if replay_compiler_path != ctx.executable._ngc_wrapped.short_path:
compiler = ctx.executable._internal_ngc_wrapped

# END-INTERNAL
else:
fail("Unknown replay compiler", target.typescript.replay_params.compiler.path)

Expand Down Expand Up @@ -149,14 +138,6 @@ esm5_outputs_aspect = aspect(
# Recurse to the deps of any target we visit
attr_aspects = ["deps"],
attrs = {
# This is only used if the replay_compiler refers to the "angular" workspace. In that
# case we need to use "ngc_wrapped" from its source location because we can't have
# the "npm" workspace that has the "@angular/bazel" NPM package installed.
"_internal_ngc_wrapped": attr.label(
default = Label("//packages/bazel/src/ngc-wrapped"),
executable = True,
cfg = "host",
),
"_modify_tsconfig": attr.label(
default = Label("//packages/bazel/src:modify_tsconfig"),
executable = True,
Expand All @@ -167,12 +148,9 @@ esm5_outputs_aspect = aspect(
executable = True,
cfg = "host",
),
# This is the default "ngc_wrapped" executable that will be used to replay the compilation
# for ESM5 mode. The default compiler consumes "ngc_wrapped" from the "@npm" workspace.
# This is needed for downstream Bazel users that can have a different TypeScript
# version installed.
# Replaced with "@npm//@angular/bazel/bin:ngc-wrapped" in the published package
"_ngc_wrapped": attr.label(
default = Label(DEFAULT_NG_COMPILER),
default = Label("//packages/bazel/src/ngc-wrapped"),
executable = True,
cfg = "host",
),
Expand Down
14 changes: 0 additions & 14 deletions tools/npm/@angular_bazel/index.js

This file was deleted.

6 changes: 0 additions & 6 deletions tools/npm/@angular_bazel/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions yarn.lock
Expand Up @@ -127,9 +127,6 @@
ora "4.0.2"
rxjs "6.5.3"

"@angular/bazel@file:./tools/npm/@angular_bazel":
version "0.0.0"

"@angular/cli@9.0.3":
version "9.0.3"
resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-9.0.3.tgz#114bf16fd00685d814840f6fece286e0f8f6f1e3"
Expand Down