|
| 1 | +diff --git a/node_modules/@angular/bazel/src/ng_module/ng_module.bzl b/node_modules/@angular/bazel/src/ng_module/ng_module.bzl |
| 2 | +index 99d7f6d..3ea60ea 100755 |
| 3 | +--- a/node_modules/@angular/bazel/src/ng_module/ng_module.bzl |
| 4 | ++++ b/node_modules/@angular/bazel/src/ng_module/ng_module.bzl |
| 5 | +@@ -18,6 +18,7 @@ load( |
| 6 | + "TsConfigInfo", |
| 7 | + "compile_ts", |
| 8 | + "js_ecma_script_module_info", |
| 9 | ++ "js_named_module_info", |
| 10 | + "js_module_info", |
| 11 | + "node_modules_aspect", |
| 12 | + "ts_providers_dict_to_struct", |
| 13 | +@@ -151,9 +152,9 @@ def _ngc_tsconfig(ctx, files, srcs, **kwargs): |
| 14 | + is_devmode = "devmode_manifest" in kwargs |
| 15 | + outs = _expected_outs(ctx) |
| 16 | + if is_devmode: |
| 17 | +- expected_outs = outs.devmode_js |
| 18 | ++ expected_outs = outs.devmode_js + outs.declarations |
| 19 | + else: |
| 20 | +- expected_outs = outs.closure_js + outs.declarations |
| 21 | ++ expected_outs = outs.closure_js |
| 22 | + |
| 23 | + if not ctx.attr.type_check and ctx.attr.strict_templates: |
| 24 | + fail("Cannot set type_check = False and strict_templates = True for ng_module()") |
| 25 | +@@ -359,11 +360,11 @@ def _compile_action( |
| 26 | + |
| 27 | + def _prodmode_compile_action(ctx, inputs, outputs, tsconfig_file, node_opts): |
| 28 | + outs = _expected_outs(ctx) |
| 29 | +- return _compile_action(ctx, inputs, outputs + outs.closure_js + outs.prod_perf_files + outs.declarations, tsconfig_file, node_opts, "prodmode") |
| 30 | ++ return _compile_action(ctx, inputs, outputs + outs.closure_js + outs.prod_perf_files, tsconfig_file, node_opts, "prodmode") |
| 31 | + |
| 32 | + def _devmode_compile_action(ctx, inputs, outputs, tsconfig_file, node_opts): |
| 33 | + outs = _expected_outs(ctx) |
| 34 | +- compile_action_outputs = outputs + outs.devmode_js + outs.dev_perf_files |
| 35 | ++ compile_action_outputs = outputs + outs.devmode_js + outs.dev_perf_files + outs.declarations |
| 36 | + _compile_action(ctx, inputs, compile_action_outputs, tsconfig_file, node_opts, "devmode") |
| 37 | + |
| 38 | + # Note: We need to define `label` and `srcs_files` as `tsc_wrapped` passes |
| 39 | +@@ -417,9 +418,13 @@ def _ng_module_impl(ctx): |
| 40 | + # and issue https://github.com/bazelbuild/rules_nodejs/issues/57 for more details. |
| 41 | + ts_providers["providers"].extend([ |
| 42 | + js_module_info( |
| 43 | +- sources = ts_providers["typescript"]["es6_sources"], |
| 44 | ++ sources = ts_providers["typescript"]["es5_sources"], |
| 45 | + deps = ctx.attr.deps, |
| 46 | + ), |
| 47 | ++ js_named_module_info( |
| 48 | ++ sources = ts_providers["typescript"]["es5_sources"], |
| 49 | ++ deps = ctx.attr.deps, |
| 50 | ++ ), |
| 51 | + js_ecma_script_module_info( |
| 52 | + sources = ts_providers["typescript"]["es6_sources"], |
| 53 | + deps = ctx.attr.deps, |
| 54 | +@@ -435,7 +440,7 @@ def _ng_module_impl(ctx): |
| 55 | + package_name = ctx.attr.package_name, |
| 56 | + package_path = ctx.attr.package_path, |
| 57 | + path = path, |
| 58 | +- files = ts_providers["typescript"]["es6_sources"], |
| 59 | ++ files = ts_providers["typescript"]["es5_sources"], |
| 60 | + )) |
| 61 | + |
| 62 | + return ts_providers_dict_to_struct(ts_providers) |
| 63 | +diff --git a/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs b/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs |
| 64 | +index 8681a4c..e3b497a 100755 |
| 65 | +--- a/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs |
| 66 | ++++ b/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs |
| 67 | +@@ -13,7 +13,7 @@ import * as fs from 'fs'; |
| 68 | + import * as path from 'path'; |
| 69 | + import * as tsickle from 'tsickle'; |
| 70 | + import ts from 'typescript'; |
| 71 | +-import { EXT, patchNgHostWithFileNameToModuleName as patchNgHost, relativeToRootDirs } from './utils'; |
| 72 | ++import { EXT, patchNgHostWithFileNameToModuleName as patchNgHost, relativeToRootDirs } from './utils.mjs'; |
| 73 | + // FIXME: we should be able to add the assets to the tsconfig so FileLoader |
| 74 | + // knows about them |
| 75 | + const NGC_ASSETS = /\.(css|html)$/; |
| 76 | +@@ -351,6 +351,12 @@ function gatherDiagnosticsForInputsOnly(options, bazelOpts, ngProgram) { |
| 77 | + } |
| 78 | + return diagnostics; |
| 79 | + } |
| 80 | ++ |
| 81 | ++main(process.argv.slice(2)).then(exitCode => process.exitCode = exitCode).catch(e => { |
| 82 | ++ console.error(e); |
| 83 | ++ process.exitCode = 1; |
| 84 | ++}); |
| 85 | ++ |
| 86 | + /** |
| 87 | + * @deprecated |
| 88 | + * Kept here just for compatibility with 1P tools. To be removed soon after 1P update. |
| 89 | +diff --git a/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs b/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs |
| 90 | +index 3649c11..0f4af3c 100755 |
| 91 | +--- a/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs |
| 92 | ++++ b/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs |
| 93 | +@@ -5,7 +5,7 @@ |
| 94 | + * Use of this source code is governed by an MIT-style license that can be |
| 95 | + * found in the LICENSE file at https://angular.io/license |
| 96 | + */ |
| 97 | +-import { main } from './index'; |
| 98 | ++import { main } from './index.mjs'; |
| 99 | + main(process.argv.slice(2)).then(exitCode => process.exitCode = exitCode).catch(e => { |
| 100 | + console.error(e); |
| 101 | + process.exitCode = 1; |
0 commit comments