|
| 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 5e82bcb..3c239f8 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 | +@@ -355,11 +356,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 | +@@ -413,9 +414,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 | +@@ -431,7 +436,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/ng_package/packager.mjs b/node_modules/@angular/bazel/src/ng_package/packager.mjs |
| 64 | +index 7184fd9..ef3e508 100755 |
| 65 | +--- a/node_modules/@angular/bazel/src/ng_package/packager.mjs |
| 66 | ++++ b/node_modules/@angular/bazel/src/ng_package/packager.mjs |
| 67 | +@@ -7,7 +7,7 @@ |
| 68 | + */ |
| 69 | + import * as fs from 'fs'; |
| 70 | + import * as path from 'path'; |
| 71 | +-import { analyzeFileAndEnsureNoCrossImports } from './cross_entry_points_imports'; |
| 72 | ++import { analyzeFileAndEnsureNoCrossImports } from './cross_entry_points_imports.mjs'; |
| 73 | + /** |
| 74 | + * List of known `package.json` fields which provide information about |
| 75 | + * supported package formats and their associated entry paths. |
| 76 | +diff --git a/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs b/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs |
| 77 | +index def2972..3de33ba 100755 |
| 78 | +--- a/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs |
| 79 | ++++ b/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs |
| 80 | +@@ -12,7 +12,7 @@ import tscw from '@bazel/concatjs/internal/tsc_wrapped/index.js'; |
| 81 | + import * as fs from 'fs'; |
| 82 | + import * as path from 'path'; |
| 83 | + import ts from 'typescript'; |
| 84 | +-import { EXT, patchNgHostWithFileNameToModuleName as patchNgHost, relativeToRootDirs } from './utils'; |
| 85 | ++import { EXT, patchNgHostWithFileNameToModuleName as patchNgHost, relativeToRootDirs } from './utils.mjs'; |
| 86 | + // FIXME: we should be able to add the assets to the tsconfig so FileLoader |
| 87 | + // knows about them |
| 88 | + const NGC_ASSETS = /\.(css|html)$/; |
| 89 | +@@ -349,6 +349,12 @@ function gatherDiagnosticsForInputsOnly(options, bazelOpts, ngProgram) { |
| 90 | + } |
| 91 | + return diagnostics; |
| 92 | + } |
| 93 | ++ |
| 94 | ++main(process.argv.slice(2)).then(exitCode => process.exitCode = exitCode).catch(e => { |
| 95 | ++ console.error(e); |
| 96 | ++ process.exitCode = 1; |
| 97 | ++}); |
| 98 | ++ |
| 99 | + /** |
| 100 | + * @deprecated |
| 101 | + * Kept here just for compatibility with 1P tools. To be removed soon after 1P update. |
| 102 | +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 |
| 103 | +index 8efba56..be29334 100755 |
| 104 | +--- a/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs |
| 105 | ++++ b/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs |
| 106 | +@@ -5,7 +5,7 @@ |
| 107 | + * Use of this source code is governed by an MIT-style license that can be |
| 108 | + * found in the LICENSE file at https://angular.dev/license |
| 109 | + */ |
| 110 | +-import { main } from './index'; |
| 111 | ++import { main } from './index.mjs'; |
| 112 | + main(process.argv.slice(2)) |
| 113 | + .then((exitCode) => (process.exitCode = exitCode)) |
| 114 | + .catch((e) => { |
0 commit comments