From 891bd57c8b89ab0b4b6de306ccdc3d6672742fb9 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 28 Aug 2024 19:56:10 +0200 Subject: [PATCH] build: update `@angular/bazel` to consume new format of APF (#29654) See: https://github.com/angular/angular/pull/57559 --- package.json | 2 +- .../@angular+bazel+16.0.0-next.6.patch | 29 ++++++++++++++----- yarn.lock | 16 +++------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index ef0002ba5b5c..ff5addf9b1e5 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@angular-devkit/build-angular": "^18.2.0-next.2", "@angular-devkit/core": "^18.2.0-next.2", "@angular-devkit/schematics": "^18.2.0-next.2", - "@angular/bazel": "https://github.com/angular/bazel-builds.git#bac9c1abe1e6ac1801fbbccb53353a1ed7126469", + "@angular/bazel": "https://github.com/angular/bazel-builds.git#9e6140d1eef8ddf7113d00738f603e9cc3c310f1", "@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#74e0e7b090c6e16056290836b2d936ca7820b86f", "@angular/build": "^18.2.0-next.2", "@angular/cli": "^18.2.0-next.2", diff --git a/tools/postinstall/patches/@angular+bazel+16.0.0-next.6.patch b/tools/postinstall/patches/@angular+bazel+16.0.0-next.6.patch index 5cc8e9d422f1..75d5af2208d6 100644 --- a/tools/postinstall/patches/@angular+bazel+16.0.0-next.6.patch +++ b/tools/postinstall/patches/@angular+bazel+16.0.0-next.6.patch @@ -60,20 +60,33 @@ index 99d7f6d..3ea60ea 100755 )) return ts_providers_dict_to_struct(ts_providers) +diff --git a/node_modules/@angular/bazel/src/ng_package/packager.mjs b/node_modules/@angular/bazel/src/ng_package/packager.mjs +index 12d5f0c..8868e27 100755 +--- a/node_modules/@angular/bazel/src/ng_package/packager.mjs ++++ b/node_modules/@angular/bazel/src/ng_package/packager.mjs +@@ -7,7 +7,7 @@ + */ + import * as fs from 'fs'; + import * as path from 'path'; +-import { analyzeFileAndEnsureNoCrossImports } from './cross_entry_points_imports'; ++import { analyzeFileAndEnsureNoCrossImports } from './cross_entry_points_imports.mjs'; + /** + * List of known `package.json` fields which provide information about + * supported package formats and their associated entry paths. diff --git a/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs b/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs -index 8681a4c..e3b497a 100755 +index 09deff8..00d24be 100755 --- a/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs +++ b/node_modules/@angular/bazel/src/ngc-wrapped/index.mjs -@@ -13,7 +13,7 @@ import * as fs from 'fs'; +@@ -12,7 +12,7 @@ import tscw from '@bazel/concatjs/internal/tsc_wrapped/index.js'; + import * as fs from 'fs'; import * as path from 'path'; - import * as tsickle from 'tsickle'; import ts from 'typescript'; -import { EXT, patchNgHostWithFileNameToModuleName as patchNgHost, relativeToRootDirs } from './utils'; +import { EXT, patchNgHostWithFileNameToModuleName as patchNgHost, relativeToRootDirs } from './utils.mjs'; // FIXME: we should be able to add the assets to the tsconfig so FileLoader // knows about them const NGC_ASSETS = /\.(css|html)$/; -@@ -351,6 +351,12 @@ function gatherDiagnosticsForInputsOnly(options, bazelOpts, ngProgram) { +@@ -348,6 +348,12 @@ function gatherDiagnosticsForInputsOnly(options, bazelOpts, ngProgram) { } return diagnostics; } @@ -87,7 +100,7 @@ index 8681a4c..e3b497a 100755 * @deprecated * Kept here just for compatibility with 1P tools. To be removed soon after 1P update. 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 -index 3649c11..0f4af3c 100755 +index ccf82d2..daaa783 100755 --- a/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs +++ b/node_modules/@angular/bazel/src/ngc-wrapped/ngc-wrapped-main.mjs @@ -5,7 +5,7 @@ @@ -96,6 +109,6 @@ index 3649c11..0f4af3c 100755 */ -import { main } from './index'; +import { main } from './index.mjs'; - main(process.argv.slice(2)).then(exitCode => process.exitCode = exitCode).catch(e => { - console.error(e); - process.exitCode = 1; + main(process.argv.slice(2)) + .then((exitCode) => (process.exitCode = exitCode)) + .catch((e) => { diff --git a/yarn.lock b/yarn.lock index f5c6872734ca..651015145b6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -146,13 +146,12 @@ dependencies: tslib "^2.3.0" -"@angular/bazel@https://github.com/angular/bazel-builds.git#bac9c1abe1e6ac1801fbbccb53353a1ed7126469": - version "16.0.0-next.6" - resolved "https://github.com/angular/bazel-builds.git#bac9c1abe1e6ac1801fbbccb53353a1ed7126469" +"@angular/bazel@https://github.com/angular/bazel-builds.git#9e6140d1eef8ddf7113d00738f603e9cc3c310f1": + version "19.0.0-next.1" + resolved "https://github.com/angular/bazel-builds.git#9e6140d1eef8ddf7113d00738f603e9cc3c310f1" dependencies: "@microsoft/api-extractor" "^7.24.2" magic-string "^0.30.0" - tsickle "^0.46.3" tslib "^2.3.0" "@angular/benchpress@0.3.0": @@ -3744,7 +3743,7 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== -"@types/minimist@^1.2.0", "@types/minimist@^1.2.1", "@types/minimist@^1.2.2": +"@types/minimist@^1.2.0", "@types/minimist@^1.2.2": version "1.2.5" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e" integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== @@ -15407,13 +15406,6 @@ tsickle@0.39.1: resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.39.1.tgz#7ccf672cde5b430f5dd0b281ee49e170ef390ff9" integrity sha512-CCc9cZhZbKoNizVM+K3Uqgit/go8GacjpqTv1cpwG/n2P0gB9GMoWZbxrUULDE9Wz26Lh86CGf6QyIPUVV1lnQ== -tsickle@^0.46.3: - version "0.46.3" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.46.3.tgz#b74918a77e3ca1310a2ce4d019f5d6294360b56d" - integrity sha512-9PDXxOrtn2AdpvDin6FLGveXVGg8ec3ga8fh8mPR5lz9KtitW6riVgxgagicdfF1rgiBxDeH+5hVowPXhmZbYQ== - dependencies: - "@types/minimist" "^1.2.1" - tslib@2.6.3, tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.2.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.5.2: version "2.6.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"