From 66b266b2c47fb2990774d74a612e605162610af9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 12:54:19 +0000 Subject: [PATCH 1/2] Bump @microsoft/rush from 5.179.0 to 5.180.0 Bumps [@microsoft/rush](https://github.com/microsoft/rushstack/tree/HEAD/apps/rush) from 5.179.0 to 5.180.0. - [Changelog](https://github.com/microsoft/rushstack/blob/main/apps/rush/CHANGELOG.md) - [Commits](https://github.com/microsoft/rushstack/commits/HEAD/apps/rush) --- updated-dependencies: - dependency-name: "@microsoft/rush" dependency-version: 5.180.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c4bb459..3363ef3 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.2", - "@microsoft/rush": "5.179.0", + "@microsoft/rush": "5.180.0", "@nevware21/grunt-eslint-ts": "0.5.2", "@nevware21/grunt-ts-plugin": "0.5.2", "@nevware21/coverage-tools": ">= 0.1.4 < 2.x", From 35dadfb0e5dfb9de40ac91469191afafcdae42a8 Mon Sep 17 00:00:00 2001 From: nevware21-bot <252503968+nevware21-bot@users.noreply.github.com> Date: Mon, 5 Oct 2026 05:58:16 -0700 Subject: [PATCH 2/2] chore: syncing versions and shrinkwrap --- common/config/rush/npm-shrinkwrap.json | 248 ++++---- common/scripts/install-run-rush.js | 780 ++++++++++++++++++++++++- common/scripts/install-run.js | 269 ++++++++- rush.json | 3 +- 4 files changed, 1130 insertions(+), 170 deletions(-) diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index bb80104..1932626 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -927,9 +927,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.5.tgz", - "integrity": "sha512-J25QJU+B78T4FhhBsNpLJyVWOi31mwtpcMwywHmOKH65Q9IWGA81gPj+dnwlhU8wktVriYE+tFAaQgrnJRzAZg==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.64.0.tgz", + "integrity": "sha512-FLLpX941CD/7aBvX3GqLGBM9OvY5PGXTryPJkG5r5/OuBpZpV5k45Uo3RxAvqd35tsyc3hH1bhtz921IKzoIzg==", "cpu": [ "arm" ], @@ -939,9 +939,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.5.tgz", - "integrity": "sha512-LDopB3zuZM5Ux9TT2luNEBJW/tYbGU2g1d+VpKk6I+gSKDb+/7sYE6M225gRQt4RbMX6MSwMsVR/phdjVUgRLg==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.64.0.tgz", + "integrity": "sha512-iI32XM/jnDYJsvx5ai/za/7gWO9XoSeFFtU06/ZCaRgyilfJOjaopD3nOpk2WrTCGOyeDt4hleUiGOAnd5tHNg==", "cpu": [ "arm64" ], @@ -951,9 +951,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.5.tgz", - "integrity": "sha512-wlJEERGfeuHeBavCL2qVnNacOK43NDoZM4sjkeRPymd04OAE9T1zBqDJgmZ+CIsPTYKwdzpUC8vmOw84dwY4Tg==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.64.0.tgz", + "integrity": "sha512-dRBZlbt2sEtF8Mn4MODThze9fIPdDoOhVSlXMAKy5dQbOYK9pOOoPY4Fat3OTtr0+8zbJo5TTZwlsfxY/kDNJg==", "cpu": [ "arm64" ], @@ -963,9 +963,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.5.tgz", - "integrity": "sha512-4nJJGg5jbo2wwPP4JP+LfEBA3bvP8rU9CLuhp7jWvq9sxEyhjQFTFdrqi+/dHEin/pd8jpT0vcehIpnZtmEdcQ==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.64.0.tgz", + "integrity": "sha512-Y3whrJOMucfkhgNkvcM93M6j8C53iEAMmPMYD99C6G1kUy4ELigLWk9ar2/4aCBSRgsql0zdlOemLgW2m5GZgQ==", "cpu": [ "x64" ], @@ -975,9 +975,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.5.tgz", - "integrity": "sha512-DrZbyCDF1hneuO6jRbvZ2D7+PIBM6yIwYnJpg2vIk58T+wuFpiaGZrfUr59lDWw45bg+IrpTGLPiNi/Fk4w3Cg==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.64.0.tgz", + "integrity": "sha512-S6S1GEzPjFF6IONYJX3AKt/799+8RgBgCcwRnUo+Ep1IvBxUbw5M51iU0TDdK2NWWVnSvCQ8yi6Em0fGASMOng==", "cpu": [ "arm64" ], @@ -987,9 +987,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.5.tgz", - "integrity": "sha512-gqfUVMJMB3mehqywxp6hTBFfgtMQykZY19+cfiaYP0toIJLb/1DZRJHVkQQGP13W4TAwfZDWeg1qBcheTRioXQ==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.64.0.tgz", + "integrity": "sha512-Ed1DPoFENkXj4IGzSB12SesV40iP6LxCCrbTIkSGIQBpOOxpBM+0kj62lmaeIHfMWTDoddqTOtqc7s8LYfn+Pw==", "cpu": [ "x64" ], @@ -999,9 +999,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.5.tgz", - "integrity": "sha512-CFmhpvAwzSaWMlN3VN7UtmoTihlZNzoP0juQib5TQRnYUyDV8dXeWOp29sobWAT6gXl/hQgAClLlEiYozQG3OQ==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.64.0.tgz", + "integrity": "sha512-J/6xhutJPtFyIkmHdf4olOdHHKH5kOJNumojdWn+Elv5ICEYTVOa362Vw27TxsK0BLzb1le3EDlO3UbvFK1lnQ==", "cpu": [ "arm" ], @@ -1011,9 +1011,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.5.tgz", - "integrity": "sha512-Uc9H8eXCOayV6JLTH5bXKMId6qbhNHa818/BgYjm4jrlq3vZquC9cqyvHBw17xy5Mnj5f+I3gFK5JcEf3hSqrw==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.64.0.tgz", + "integrity": "sha512-G4L/Nnx59d2LvDoV/P4S5lZ7oVLT6hodOHMacqjiq2LL2gts86KbkEBTYL53+fBt0odhf7XPIbIATGoYiJctxg==", "cpu": [ "arm" ], @@ -1023,9 +1023,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.5.tgz", - "integrity": "sha512-VcPr/szv/1BFw112Kt//fxulXt/JPqzzidU84iW68L2DdjnOO8QFUv2zTSYBEPHD6movBD4z+bbr5y60GYM7Jw==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.64.0.tgz", + "integrity": "sha512-zF16pvJDEUksGYRbfnXne7pdklAyj2XDmJeYKgP93oq0cUyX9Y8O7lUo1R+IY1GagP/YBvCEDCe7eEcAKpw//g==", "cpu": [ "arm64" ], @@ -1035,9 +1035,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.5.tgz", - "integrity": "sha512-BnxtJ5/91BrIHYIkGrmjz/lbMhqEHt1dPFqIxIFR+jPn0xVc/oUSCtIT089zfp5ufwGDlYz2UC+Fe1SRBpYFbQ==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.64.0.tgz", + "integrity": "sha512-nIggWn8n+w12+R5lsV+PYYoUY8vuObxPAQqJI7WES+9v0qspYuAHoZMfYM0yLxlipasT5BY9ht5W8t5c/rSCkg==", "cpu": [ "arm64" ], @@ -1047,9 +1047,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.5.tgz", - "integrity": "sha512-LrYcHZwF+fAMNKHYTOQ5osWM4AZF7YF6D+XtsjDyEvljtt11twc+zHVXBLNEjxVSUnKYsOhvVz4Z213eW02COQ==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.64.0.tgz", + "integrity": "sha512-WLOTiHPzszP0dxIMsHpFeDSOSB5I49Mj8K4+yKE3H1X/D0JRG5XZ5jrctJLMjnUc/LUzaKiwq6EHWNJ8pup8PA==", "cpu": [ "loong64" ], @@ -1059,9 +1059,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.5.tgz", - "integrity": "sha512-nj7QKQePAAUpCpJHtg0pR0W/b92A9NO17JS3BAQmHDn/yhmkir2p8llrKY9TOhleKIaSzy1JhxS3T9FVld6coA==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.64.0.tgz", + "integrity": "sha512-35RK9aRhh7g7Pmeu5gQ01aCvrhXzj9LoBE6xtUcEH1ns+nyTaSzxSpADmBQINu4QiTDGvmQYwo1j5hlg1rRXFw==", "cpu": [ "loong64" ], @@ -1071,9 +1071,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.5.tgz", - "integrity": "sha512-5ylkX6dWMeBKge9nTU+Rxfb+ZfaCIJ9lRqIFaK0eAMcWp7OJbYnLveLgXmm0VrvuLKb8qIK+mHyH0qu88RM+iA==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.64.0.tgz", + "integrity": "sha512-RqTfnpoTjuWfPAmqK5p2edt2AMCDJWm6oTn7sKfmyx+6tRga0ip05SJ977o6udTcIiDeF/CJMUfkaN4gtWt6Aw==", "cpu": [ "ppc64" ], @@ -1083,9 +1083,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.5.tgz", - "integrity": "sha512-oHK4ZHYFDKjZviK34I+NwgfbGxgI7ztrNxj2hPTSSNFgeq1a/lEd7dHV2fdGAuTH4Iym3RHJg+vAbWaWG4B7Zg==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.64.0.tgz", + "integrity": "sha512-RQjZPigjxFvFZDijG6rjlSXxhRaTf9zLYVpGK+lVcga64oMqP1GbgVqCb46eHTTceSIgp89Ja0y5aPe3GFBYHg==", "cpu": [ "ppc64" ], @@ -1095,9 +1095,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.5.tgz", - "integrity": "sha512-UcetmHZ6XOXuUByiKZyQmb55ZPr0LABr3Ec/HB9wKZn6CEAFWZkE+hsJErJ9hbPBC7nI0dKuELx7CoV6IM7TMg==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.64.0.tgz", + "integrity": "sha512-tjL58mgQcTRnDRpeky+Sth1MKQeYi2Ct6r3Luq9E5aTSjnM/i/JbozqZkKqp9thM5+oDSZxo+05f9kdQedfTGA==", "cpu": [ "riscv64" ], @@ -1107,9 +1107,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.5.tgz", - "integrity": "sha512-C5CmDPQBtvjVo8cgQsBs+w6WB0JLkiixhgi6hVLV11hERWdn/p0XcPU2OUcZzac9BPOFq7SbaHFa8r3SWEysCQ==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.64.0.tgz", + "integrity": "sha512-ictoRyVaoZ8C67myHef+8hhCa6IplXJJ/xUCkVCxziV4zxMZh+jvhkhGsPBLqj1S72fnqD0QH5zL4lcaa4X7DQ==", "cpu": [ "riscv64" ], @@ -1119,9 +1119,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.5.tgz", - "integrity": "sha512-lHVQHJFKsuuxLMi3MQO9XVL8Tje3JR82CzB+QDKC5NWBcsIWuwsn9uIM5e3lBhI+fF1/s63qnyYqsg65+8rV/w==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.64.0.tgz", + "integrity": "sha512-8aVvZ2hfr9RLFzBQkQNmYeHLDja8fLeQAmLt757zdKN/B+8L809KlLJKctQjS22wZotptV8G6o7fVPuAs8S1tQ==", "cpu": [ "s390x" ], @@ -1143,9 +1143,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.5.tgz", - "integrity": "sha512-VDC7rRJlee/scpki96GZ27Omf6yU87s1YXwVTpjE5841faVlDYYT565rgfmoR1U0sqL7z5ivQSDjcsF6VRXyBA==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.64.0.tgz", + "integrity": "sha512-3XHTvoo2hKkh0MiOfS7SkhHjMaaWF7P4F3drocZZaho/Z8w7h/jpnuBHm91BOQLfvrKHs1yR+zir4E8RI3XzTQ==", "cpu": [ "x64" ], @@ -1155,9 +1155,9 @@ ] }, "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.5.tgz", - "integrity": "sha512-z86Ok2p4pTdv5xqCKZsTooO7yBEiaJR/HzU3Wx8RmWsPoLppnMKROhJusQob8B3IE1ghC343kUW9rC2r+Wf3ig==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.64.0.tgz", + "integrity": "sha512-HKtkzodL4a3KFWDXDoO61cRynAWTR3LnAE0oGtfG9lcNFpNuVYUFOByxDgNqEvic9rvaQbAj+SFwTEWDptRaIw==", "cpu": [ "x64" ], @@ -1167,9 +1167,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.5.tgz", - "integrity": "sha512-IzQmj+xXwQFGhMAMKMQVXkMwMZN3TqkJgAE0nSsqvVwWWciP4AIPMmWRqOQ2GfX7TUDZr+xqGFcBS36CRPGw0g==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.64.0.tgz", + "integrity": "sha512-JBsxqiY16uyyCujtoC3s7zL+SrYyNElptD7K4V+KUoJ2V8/XG3hPWpheK+SuPwNh1cikJvIZmIdsrYXvD6PLJw==", "cpu": [ "arm64" ], @@ -1179,9 +1179,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.5.tgz", - "integrity": "sha512-F6qpTaPc9bwBH85kjy0/BLmLSW1uv7AoOXCoRIkg2arlgCYlWYcAbiMkvZuAcaWk9TpCRG//okznLAqLGshkMw==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.64.0.tgz", + "integrity": "sha512-S5Qrijh37qhnUYQ0ay8WN3LuWeKjow7wTUyCOPMZtnXiBXYXdsZETI6ZLfYnQAKovltckPLBFdNeD61P2rJc7g==", "cpu": [ "arm64" ], @@ -1191,9 +1191,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.5.tgz", - "integrity": "sha512-igoDsTFhhwECBeGbUuLeIk7t8Y1apa+cs6mDWpx2EZ0ch7oEQgzHbFUXN9euoHekCAQzXdXApAGkV6jznS7tWw==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.64.0.tgz", + "integrity": "sha512-zbZ6iMmLFEsCtTdc2/y1F/cDFVNNCPF7Ae8PCT/wdPE//hGwYp6r+MyCLMFX+kOeIe09Pz6ASfnnfpSTN1FJQQ==", "cpu": [ "ia32" ], @@ -1203,9 +1203,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.5.tgz", - "integrity": "sha512-U3teMeMbXFmaM5D+OTJpsOXd+wV/qftIeYF9kBKL4v73641qyJmoXFtA28DQLsnmlyayEsTe72xpLHrArq6vHw==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.64.0.tgz", + "integrity": "sha512-L6Hw69oNpuYaOr1zCG30v0/DqKYCSRwodPGwIcVZ/6f8SOzq9rxtL/xNVI5MO4wjli+Ko0ErK9uHJL3mNPt8wQ==", "cpu": [ "x64" ], @@ -1215,9 +1215,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.5.tgz", - "integrity": "sha512-ypfC34F3RKXvCXBglGqGMsUSMKlgwd1HX9AOAlx9RoZZ6GaI42YHVeKpzg3JG+wpBUJYTG+NNZhqbDWL8tBZkw==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.64.0.tgz", + "integrity": "sha512-nl+CTWIgOGszQmUz/kanfgrfFZ4qiwxKIfT/ryl3N3Ewk5tqizmYtNXiqb7Bu/fDtNgu1kyxdFiAUJNur3iysg==", "cpu": [ "x64" ], @@ -1612,9 +1612,9 @@ "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==" }, "node_modules/@types/node": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.3.tgz", - "integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==", + "version": "26.6.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.4.tgz", + "integrity": "sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==", "dependencies": { "undici-types": "~8.9.0" } @@ -1676,9 +1676,9 @@ } }, "node_modules/acorn": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", - "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", "bin": { "acorn": "bin/acorn" }, @@ -1948,9 +1948,9 @@ ] }, "node_modules/baseline-browser-mapping": { - "version": "2.11.26", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.26.tgz", - "integrity": "sha512-GLQdD3y6UF8iVuMJl5fHgE4jdn/ua7n+toKfLgNlg3BqQtOZjpy68T8Tup8/wGWZCDlm7KMg7tPb4MPn7oN0TQ==", + "version": "2.11.27", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.27.tgz", + "integrity": "sha512-ElY12DaROGuan+lMmZ8Cvo/ZUbXPe7Enc/9VU/b1T3Kp4dwytRcNdR8DoSJN5SNJT/CuvcCA0DHDVmMOCePdRQ==", "bin": { "baseline-browser-mapping": "dist/cli.cjs" }, @@ -3074,9 +3074,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.5.443", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.443.tgz", - "integrity": "sha512-TDJG36L9A3CWWwZ97HKaE+Iz1sW80pNp6sAU0owzCIV3Zc9eVyRqZK8Vz6NKuMIU8WjP0pIkoqCa0VRf/yFD0Q==" + "version": "1.5.444", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.444.tgz", + "integrity": "sha512-5ss/uJfoDYDHT0lfJzT6FbcskIzROIOPf0BbbFkGcvDzoJU7i//9GDrwwIHQVmIsrAGiF3ihpADBRIsrEFt1rQ==" }, "node_modules/elliptic": { "version": "6.6.1", @@ -3591,9 +3591,9 @@ "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==" }, "node_modules/follow-redirects": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", - "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.1.tgz", + "integrity": "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==", "funding": [ { "type": "individual", @@ -4264,9 +4264,9 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==" }, "node_modules/http-cache-semantics": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", - "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==" + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.3.0.tgz", + "integrity": "sha512-M5t5LlJpS1UHMjvwRQVdFHvPISGeLAxNcrWuJkeGh0KxsqCHZ1O3NXZU/8x7cD0BDcGW8kapxMKTvwlqrNkHkA==" }, "node_modules/http-errors": { "version": "2.0.1", @@ -6021,9 +6021,9 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/nanoid": { - "version": "3.3.19", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz", - "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "funding": [ { "type": "github", @@ -7296,9 +7296,9 @@ } }, "node_modules/rollup": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.5.tgz", - "integrity": "sha512-KRWwmNLlPw5M7HcdYfm15oBv9n9LPtjzpzCIxS/phwqvPyxHSoKX6Y2YU3pxSPfy0CLquVgsx/j/hBi6OvH1Nw==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.64.0.tgz", + "integrity": "sha512-gjA/kFeDfffII8COoPsvLPvE16hWDTEc1+0QKQNKUkuV8iJjqsC4xXs8/FzuL0v9EV39kuxTbAgcFoTRyy2TGQ==", "dependencies": { "@types/estree": "1.0.9" }, @@ -7311,31 +7311,31 @@ }, "optionalDependencies": { "@napi-rs/lzma-linux-x64-gnu": "1.5.1", - "@rollup/rollup-android-arm-eabi": "4.63.5", - "@rollup/rollup-android-arm64": "4.63.5", - "@rollup/rollup-darwin-arm64": "4.63.5", - "@rollup/rollup-darwin-x64": "4.63.5", - "@rollup/rollup-freebsd-arm64": "4.63.5", - "@rollup/rollup-freebsd-x64": "4.63.5", - "@rollup/rollup-linux-arm-gnueabihf": "4.63.5", - "@rollup/rollup-linux-arm-musleabihf": "4.63.5", - "@rollup/rollup-linux-arm64-gnu": "4.63.5", - "@rollup/rollup-linux-arm64-musl": "4.63.5", - "@rollup/rollup-linux-loong64-gnu": "4.63.5", - "@rollup/rollup-linux-loong64-musl": "4.63.5", - "@rollup/rollup-linux-ppc64-gnu": "4.63.5", - "@rollup/rollup-linux-ppc64-musl": "4.63.5", - "@rollup/rollup-linux-riscv64-gnu": "4.63.5", - "@rollup/rollup-linux-riscv64-musl": "4.63.5", - "@rollup/rollup-linux-s390x-gnu": "4.63.5", - "@rollup/rollup-linux-x64-gnu": "4.63.5", - "@rollup/rollup-linux-x64-musl": "4.63.5", - "@rollup/rollup-openbsd-x64": "4.63.5", - "@rollup/rollup-openharmony-arm64": "4.63.5", - "@rollup/rollup-win32-arm64-msvc": "4.63.5", - "@rollup/rollup-win32-ia32-msvc": "4.63.5", - "@rollup/rollup-win32-x64-gnu": "4.63.5", - "@rollup/rollup-win32-x64-msvc": "4.63.5", + "@rollup/rollup-android-arm-eabi": "4.64.0", + "@rollup/rollup-android-arm64": "4.64.0", + "@rollup/rollup-darwin-arm64": "4.64.0", + "@rollup/rollup-darwin-x64": "4.64.0", + "@rollup/rollup-freebsd-arm64": "4.64.0", + "@rollup/rollup-freebsd-x64": "4.64.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.64.0", + "@rollup/rollup-linux-arm-musleabihf": "4.64.0", + "@rollup/rollup-linux-arm64-gnu": "4.64.0", + "@rollup/rollup-linux-arm64-musl": "4.64.0", + "@rollup/rollup-linux-loong64-gnu": "4.64.0", + "@rollup/rollup-linux-loong64-musl": "4.64.0", + "@rollup/rollup-linux-ppc64-gnu": "4.64.0", + "@rollup/rollup-linux-ppc64-musl": "4.64.0", + "@rollup/rollup-linux-riscv64-gnu": "4.64.0", + "@rollup/rollup-linux-riscv64-musl": "4.64.0", + "@rollup/rollup-linux-s390x-gnu": "4.64.0", + "@rollup/rollup-linux-x64-gnu": "4.64.0", + "@rollup/rollup-linux-x64-musl": "4.64.0", + "@rollup/rollup-openbsd-x64": "4.64.0", + "@rollup/rollup-openharmony-arm64": "4.64.0", + "@rollup/rollup-win32-arm64-msvc": "4.64.0", + "@rollup/rollup-win32-ia32-msvc": "4.64.0", + "@rollup/rollup-win32-x64-gnu": "4.64.0", + "@rollup/rollup-win32-x64-msvc": "4.64.0", "fsevents": "~2.3.2" } }, @@ -7408,9 +7408,9 @@ "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==" }, "node_modules/rollup/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.63.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.5.tgz", - "integrity": "sha512-3W9bTFcQNJn71cSJVM9RKIiZOy8DO/XLDii8Uv/Pm6WKqDRj7JV3ZfuXIEfyuy5LXpIzAbB/1M4Ukp9GKNa7nA==", + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.64.0.tgz", + "integrity": "sha512-2dEF8GAcDKwshUfydD+GhosppNyBzhVUHkdFF3CXd3FpOkzj/RZzF5aoEtzklujklT5qFVRU2GK/cFeLaTNKVg==", "cpu": [ "x64" ], diff --git a/common/scripts/install-run-rush.js b/common/scripts/install-run-rush.js index d4545bd..40b4918 100644 --- a/common/scripts/install-run-rush.js +++ b/common/scripts/install-run-rush.js @@ -16,6 +16,652 @@ /******/ "use strict"; /******/ var __webpack_modules__ = ({ +/***/ 27702 +/*!****************************************************************!*\ + !*** ./lib-intermediate-esm/logic/RushCommandLineConstants.js ***! + \****************************************************************/ +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ NATIVE_RUSH_COMMANDS: () => (/* binding */ NATIVE_RUSH_COMMANDS) +/* harmony export */ }); +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. +const NATIVE_RUSH_COMMANDS = new Set([ + 'add', + 'alert', + 'bridge-package', + 'change', + 'check', + 'deploy', + 'init', + 'init-autoinstaller', + 'init-deploy', + 'init-subspace', + 'install', + 'install-autoinstaller', + 'link', + 'link-package', + 'list', + 'publish', + 'purge', + 'remove', + 'scan', + 'setup', + 'unlink', + 'update', + 'update-autoinstaller', + 'update-cloud-credentials', + 'upgrade-interactive', + 'version' +]); +//# sourceMappingURL=RushCommandLineConstants.js.map + +/***/ }, + +/***/ 924320 +/*!*****************************************************************!*\ + !*** ./lib-intermediate-esm/scripts/InstallRunRushBootstrap.js ***! + \*****************************************************************/ +(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ createInstallRunRushBootstrap: () => (/* binding */ createInstallRunRushBootstrap) +/* harmony export */ }); +/* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:crypto */ 977598); +/* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_crypto__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node:fs */ 973024); +/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(node_fs__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! node:os */ 848161); +/* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(node_os__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! node:path */ 176760); +/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(node_path__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _logic_RushCommandLineConstants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../logic/RushCommandLineConstants */ 27702); +/* harmony import */ var _generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./generated/BootstrapProtocol */ 207008); +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. +// IMPORTANT: This file is bundled into install-run-rush.js and must use only Node.js built-ins. + + + + + + +const TRUNCATION_NOTICE_RESERVE_BYTES = 512; +const BOOTSTRAP_HANDOFF_FILE_PREFIX = 'rush-reporter-bootstrap-'; +const BOOTSTRAP_HANDOFF_FILE_SUFFIX = '.ndjson'; +const SUPPORTED_REPORTERS = new Set([ + 'default', + 'ai', + 'json', + 'plaintext', + 'file', + 'legacy' +]); +const SUPPORTED_LOG_LEVELS = new Set(['quiet', 'normal', 'verbose', 'debug']); +function readFlagValues(argv, flag, strict) { + const result = []; + const prefix = `${flag}=`; + for (let index = 0; index < argv.length; index++) { + const argument = argv[index]; + if (argument === '--') { + break; + } + let value; + if (argument.startsWith(prefix)) { + value = argument.slice(prefix.length); + } + else if (argument === flag) { + value = argv[index + 1]; + if (!value || value.startsWith('-')) { + if (strict) { + throw new Error(`${flag} requires a value.`); + } + continue; + } + index++; + } + if (value !== undefined) { + if (!value) { + if (strict) { + throw new Error(`${flag} requires a value.`); + } + continue; + } + if (strict && result.length > 0) { + throw new Error(`${flag} may be specified only once.`); + } + result.push(value); + } + } + return result; +} +function readMultipleFlagValues(argv, flag) { + const result = []; + const prefix = `${flag}=`; + for (let index = 0; index < argv.length; index++) { + const argument = argv[index]; + if (argument === '--') { + break; + } + let value; + if (argument.startsWith(prefix)) { + value = argument.slice(prefix.length); + } + else if (argument === flag) { + value = argv[index + 1]; + if (!value || value.startsWith('-')) { + throw new Error(`${flag} requires a value.`); + } + index++; + } + if (value !== undefined) { + if (!value) { + throw new Error(`${flag} requires a value.`); + } + result.push(value); + } + } + return result; +} +function readBootstrapConfiguration(filePath) { + let contents; + try { + contents = node_fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync(filePath, 'utf8'); + } + catch (error) { + if (error.code === 'ENOENT') { + return undefined; + } + throw error; + } + // Remove trailing commas only outside quoted strings, after stripping comments. + return JSON.parse(stripJsonComments(contents).replace(/("(?:\\.|[^"\\])*")|,\s*(?=[}\]])/g, (match, quoted) => (quoted === undefined ? '' : match))); +} +function ownsImplicitOutput(options) { + let actionName; + for (let index = 0; index < options.argv.length; index++) { + const argument = options.argv[index]; + if (argument === '--') + break; + if (argument === '--reporter' || argument === '--log-level' || argument === '--output') { + if (options.argv[index + 1] && !options.argv[index + 1].startsWith('-')) + index++; + } + else if (!argument.startsWith('-')) { + actionName = argument; + break; + } + } + if (!actionName) + return false; + if (_logic_RushCommandLineConstants__WEBPACK_IMPORTED_MODULE_4__.NATIVE_RUSH_COMMANDS.has(actionName)) + return true; + const configFolder = node_path__WEBPACK_IMPORTED_MODULE_3__.join(options.rushJsonFolder, 'common', 'config', 'rush'); + const plugins = readBootstrapConfiguration(node_path__WEBPACK_IMPORTED_MODULE_3__.join(configFolder, 'rush-plugins.json')); + if (plugins?.plugins?.length) + return false; + const commandLine = readBootstrapConfiguration(node_path__WEBPACK_IMPORTED_MODULE_3__.join(configFolder, 'command-line.json')); + const command = commandLine?.commands?.find((candidate) => candidate.name === actionName); + if (!command && actionName !== 'build' && actionName !== 'rebuild') + return false; + const usesBuildParameters = actionName === 'rebuild' && !command; + return !commandLine?.parameters?.some((parameter) => parameter.longName === '--output' && + (parameter.associatedCommands?.includes(actionName) || + (usesBuildParameters && parameter.associatedCommands?.includes('build')))); +} +function repositoryUsesRushReporter(rushJsonFolder) { + const experimentsPath = node_path__WEBPACK_IMPORTED_MODULE_3__.join(rushJsonFolder, 'common', 'config', 'rush', 'experiments.json'); + let contents; + try { + contents = node_fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync(experimentsPath, 'utf8'); + } + catch (error) { + const code = error.code; + if (code === 'ENOENT') { + return false; + } + throw error; + } + const matches = [ + ...stripJsonComments(contents).matchAll(/"useRushReporter"\s*:\s*(true|false)/g) + ]; + return matches.length > 0 && matches[matches.length - 1][1] === 'true'; +} +function stripJsonComments(text) { + let result = ''; + let inString = false; + let escaped = false; + let lineComment = false; + let blockComment = false; + for (let index = 0; index < text.length; index++) { + const character = text[index]; + const nextCharacter = text[index + 1]; + if (lineComment) { + if (character === '\n' || character === '\r') { + lineComment = false; + result += character; + } + continue; + } + if (blockComment) { + if (character === '*' && nextCharacter === '/') { + blockComment = false; + index++; + } + else if (character === '\n' || character === '\r') { + result += character; + } + continue; + } + if (inString) { + result += character; + if (escaped) { + escaped = false; + } + else if (character === '\\') { + escaped = true; + } + else if (character === '"') { + inString = false; + } + continue; + } + if (character === '"') { + inString = true; + result += character; + } + else if (character === '/' && nextCharacter === '/') { + lineComment = true; + index++; + } + else if (character === '/' && nextCharacter === '*') { + blockComment = true; + index++; + } + else { + result += character; + } + } + return result; +} +function parseVersion(version) { + const match = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(version); + if (!match) { + return undefined; + } + return { + core: [Number(match[1]), Number(match[2]), Number(match[3])], + prerelease: match[4]?.split('.') + }; +} +function comparePrerelease(left, right) { + if (!left) { + return right ? 1 : 0; + } + if (!right) { + return -1; + } + const length = Math.max(left.length, right.length); + for (let index = 0; index < length; index++) { + const leftPart = left[index]; + const rightPart = right[index]; + if (leftPart === undefined) { + return -1; + } + if (rightPart === undefined) { + return 1; + } + if (leftPart === rightPart) { + continue; + } + const leftNumeric = /^\d+$/.test(leftPart); + const rightNumeric = /^\d+$/.test(rightPart); + if (leftNumeric && rightNumeric) { + return Number(leftPart) - Number(rightPart); + } + if (leftNumeric !== rightNumeric) { + return leftNumeric ? -1 : 1; + } + return leftPart < rightPart ? -1 : 1; + } + return 0; +} +function supportsBootstrapHandoff(rushVersion, bootstrapVersion) { + const rush = parseVersion(rushVersion); + const bootstrap = parseVersion(bootstrapVersion); + if (!rush || !bootstrap) { + return false; + } + for (let index = 0; index < rush.core.length; index++) { + if (rush.core[index] !== bootstrap.core[index]) { + return rush.core[index] > bootstrap.core[index]; + } + } + return comparePrerelease(rush.prerelease, bootstrap.prerelease) >= 0; +} +function* chunkUtf8Text(text, maxChunkBytes) { + let chunkStart = 0; + let chunkBytes = 0; + let offset = 0; + while (offset < text.length) { + const codePoint = text.codePointAt(offset); + const codeUnits = codePoint > 0xffff ? 2 : 1; + const codePointBytes = codePoint <= 0x7f ? 1 : codePoint <= 0x7ff ? 2 : codePoint <= 0xffff ? 3 : 4; + if (chunkBytes > 0 && chunkBytes + codePointBytes > maxChunkBytes) { + yield text.slice(chunkStart, offset); + chunkStart = offset; + chunkBytes = 0; + } + chunkBytes += codePointBytes; + offset += codeUnits; + } + if (chunkStart < text.length) { + yield text.slice(chunkStart); + } +} +class InstallRunRushBootstrap { + enabled = true; + logger; + externalOutputCaptureMaxBytes; + externalOutputHandler; + externalOutputLiveStreams; + externalOutputOverflowHandler; + prepareToRun; + _entries; + _env; + _stdout; + _stderr; + _handoffDirectory; + _maxBytes; + _now; + _randomUUID; + _sessionId; + _sourceVersion; + _entryLimit; + _fallbackStdoutStream; + _usedBytes; + _nextSequence; + _nextEventNumber; + _droppedReplaceable; + _droppedRequired; + _failureFlushed; + constructor(options, liveStdout) { + this._entries = []; + this._env = options.env; + this._stdout = options.stdout ?? ((text) => process.stdout.write(text)); + this._stderr = options.stderr ?? ((text) => process.stderr.write(text)); + this._handoffDirectory = options.handoffDirectory ?? node_os__WEBPACK_IMPORTED_MODULE_2__.tmpdir(); + this._maxBytes = options.maxBytes ?? _generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.BOOTSTRAP_BUFFER_MAX_BYTES; + this._now = options.now ?? (() => new Date().toISOString()); + this._randomUUID = options.randomUUID ?? (() => node_crypto__WEBPACK_IMPORTED_MODULE_0__.randomUUID()); + this._sessionId = `rush_bootstrap_${process.pid}_${this._randomUUID()}`; + this._sourceVersion = options.bootstrapVersion; + this._entryLimit = this._maxBytes - TRUNCATION_NOTICE_RESERVE_BYTES; + this._fallbackStdoutStream = liveStdout ? 'stdout' : 'stderr'; + if (this._entryLimit <= 0) { + throw new RangeError(`maxBytes must be greater than ${TRUNCATION_NOTICE_RESERVE_BYTES}.`); + } + this._usedBytes = 0; + this._nextSequence = 1; + this._nextEventNumber = 1; + this._droppedReplaceable = 0; + this._droppedRequired = 0; + this._failureFlushed = false; + this.externalOutputCaptureMaxBytes = this._maxBytes; + this.externalOutputLiveStreams = { stdout: liveStdout, stderr: true }; + this._addEvent({ + type: 'sessionStarted', + privacy: 'public', + payload: { rushVersion: options.rushVersion } + }); + this.logger = { + info: (text, privacy = 'public') => { + this._addEvent({ + type: 'activityChanged', + privacy, + payload: { kind: 'bootstrap', text } + }, { stream: this._fallbackStdoutStream, text: `${text}\n` }); + }, + error: (text) => { + const droppedRequiredBefore = this._droppedRequired; + this._addExternalOutput('stderr', `${text}\n`, false); + this._flushFailureOutput(); + if (this._droppedRequired > droppedRequiredBefore) { + this._stderr(`${text}\n`); + } + }, + warning: (text) => { + this._stderr(`${text}\n`); + } + }; + this.externalOutputHandler = (stream, text, wasRendered) => { + this._addExternalOutput(stream, text, wasRendered); + }; + this.externalOutputOverflowHandler = () => { + this._droppedRequired++; + }; + this.prepareToRun = () => { + this._writeHandoff(); + }; + } + _addEvent(event, fallbackWrite) { + const required = event.type !== 'activityChanged'; + const line = (0,_generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.encodeBootstrapEnvelope)({ + eventId: `boot_${this._nextEventNumber++}`, + sessionId: this._sessionId, + sequence: this._nextSequence++, + timestamp: this._now(), + source: { packageName: 'install-run-rush', packageVersion: this._sourceVersion }, + privacy: event.privacy, + required, + type: event.type, + payload: event.payload + }); + const bytes = Buffer.byteLength(line, 'utf8') + 1; + if (this._usedBytes + bytes <= this._entryLimit) { + this._entries.push({ line, bytes, required, fallbackWrite }); + this._usedBytes += bytes; + return; + } + if (!required) { + this._droppedReplaceable++; + return; + } + for (let index = 0; this._usedBytes + bytes > this._entryLimit && index < this._entries.length;) { + const entry = this._entries[index]; + if (entry.required) { + index++; + } + else { + this._entries.splice(index, 1); + this._usedBytes -= entry.bytes; + this._droppedReplaceable++; + } + } + if (this._usedBytes + bytes <= this._entryLimit) { + this._entries.push({ line, bytes, required, fallbackWrite }); + this._usedBytes += bytes; + } + else { + this._droppedRequired++; + } + } + _addExternalOutput(stream, text, wasRendered) { + if (!text) { + return; + } + for (const chunk of chunkUtf8Text(text, _generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.BOOTSTRAP_EXTERNAL_CHUNK_MAX_BYTES)) { + this._addEvent({ + type: 'externalOutput', + privacy: 'local-sensitive', + payload: { stream, text: chunk, ...(wasRendered ? { wasRendered: true } : {}) } + }, wasRendered + ? undefined + : { stream: stream === 'stdout' ? this._fallbackStdoutStream : stream, text: chunk }); + } + } + _flushFailureOutput() { + if (this._failureFlushed) { + return; + } + this._failureFlushed = true; + for (const entry of this._entries) { + const write = entry.fallbackWrite; + if (write) { + (write.stream === 'stdout' ? this._stdout : this._stderr)(write.text); + } + } + } + _writeHandoff() { + const serialized = this._serializeEvents(); + const nonce = this._randomUUID(); + const fileName = `${BOOTSTRAP_HANDOFF_FILE_PREFIX}${process.pid}-${nonce}${BOOTSTRAP_HANDOFF_FILE_SUFFIX}`; + const handoffPath = node_path__WEBPACK_IMPORTED_MODULE_3__.join(this._handoffDirectory, fileName); + node_fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync(this._handoffDirectory, { recursive: true }); + node_fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync(handoffPath, `${JSON.stringify({ kind: 'bootstrapHandoff', nonce })}\n${serialized}`, { + encoding: 'utf8', + mode: 0o600, + flag: 'wx' + }); + if (process.platform !== 'win32') { + node_fs__WEBPACK_IMPORTED_MODULE_1__.chmodSync(handoffPath, 0o600); + } + this._env[_generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.RUSH_REPORTER_BOOTSTRAP_HANDOFF_ENV_VAR] = handoffPath; + this._env[_generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.RUSH_REPORTER_BOOTSTRAP_NONCE_ENV_VAR] = nonce; + } + _serializeEvents() { + const truncated = this._droppedReplaceable + this._droppedRequired > 0; + if (truncated) { + const notice = (0,_generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.encodeBootstrapEnvelope)({ + eventId: 'boot_bufferTruncated', + sessionId: this._sessionId, + sequence: this._nextSequence++, + timestamp: this._now(), + source: { packageName: 'install-run-rush', packageVersion: this._sourceVersion }, + privacy: 'public', + required: true, + type: 'extension', + payload: { + name: _generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.BOOTSTRAP_BUFFER_TRUNCATED_EXTENSION_NAME, + droppedReplaceable: this._droppedReplaceable, + droppedOther: 0, + droppedRequired: this._droppedRequired, + failed: this._droppedRequired > 0 + } + }); + if (Buffer.byteLength(notice, 'utf8') + 1 > TRUNCATION_NOTICE_RESERVE_BYTES) { + throw new Error('The bootstrap truncation notice exceeded its reserved capacity.'); + } + this._entries.push({ + line: notice, + bytes: Buffer.byteLength(notice, 'utf8') + 1, + required: true + }); + } + if (this._droppedRequired > 0) { + throw new Error(`The Rush reporter bootstrap buffer exceeded ${this._maxBytes} bytes and could not preserve ` + + `${this._droppedRequired} required event(s).`); + } + return this._entries.length > 0 + ? `${this._entries.map((entry) => entry.line).join('\n')}\n` + : ''; + } +} +function createLegacyBootstrap(options) { + const stdout = options.stdout ?? ((text) => process.stdout.write(text)); + const stderr = options.stderr ?? ((text) => process.stderr.write(text)); + const warning = (text) => stderr(`${text}\n`); + return { + enabled: false, + // Legacy mode cannot create npm captures because it exposes no external output handler. + // Keep warning routing available so future diagnostic finalization remains stderr-only. + logger: options.quiet + ? { info: () => { }, error: (text) => stderr(`${text}\n`), warning } + : { + info: (text) => stdout(`${text}\n`), + error: (text) => stderr(`${text}\n`), + warning + }, + externalOutputHandler: undefined, + externalOutputCaptureMaxBytes: undefined, + externalOutputLiveStreams: undefined, + externalOutputOverflowHandler: undefined, + prepareToRun: undefined + }; +} +function createInstallRunRushBootstrap(options) { + if (_generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.BOOTSTRAP_PROTOCOL_MAJOR < 1) { + throw new Error('The generated Rush reporter bootstrap protocol is invalid.'); + } + delete options.env[_generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.RUSH_REPORTER_BOOTSTRAP_HANDOFF_ENV_VAR]; + delete options.env[_generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_5__.RUSH_REPORTER_BOOTSTRAP_NONCE_ENV_VAR]; + if (options.commandName !== 'rush') { + return createLegacyBootstrap(options); + } + const environmentReporter = options.env.RUSH_REPORTER?.trim().toLowerCase(); + if (environmentReporter === 'legacy') { + return createLegacyBootstrap(options); + } + const repositoryOptIn = repositoryUsesRushReporter(options.rushJsonFolder); + const reporterControlsOwned = repositoryOptIn || + readFlagValues(options.argv, '--reporter', false).some((value) => SUPPORTED_REPORTERS.has(value)); + if (!reporterControlsOwned) { + return createLegacyBootstrap(options); + } + const explicitReporter = readFlagValues(options.argv, '--reporter', true)[0]; + if (explicitReporter !== undefined && !SUPPORTED_REPORTERS.has(explicitReporter)) { + throw new Error(`Unsupported reporter ${JSON.stringify(explicitReporter)}. ` + + 'Supported values are default, ai, json, plaintext, file, and legacy.'); + } + if (explicitReporter === 'legacy') { + return createLegacyBootstrap(options); + } + const logLevelProbe = readFlagValues(options.argv, '--log-level', false); + const logLevelOwned = explicitReporter !== undefined || + (logLevelProbe.length > 0 && logLevelProbe.every((value) => SUPPORTED_LOG_LEVELS.has(value))); + const explicitLogLevel = logLevelOwned + ? readFlagValues(options.argv, '--log-level', true)[0] + : undefined; + if (explicitLogLevel !== undefined && !SUPPORTED_LOG_LEVELS.has(explicitLogLevel)) { + throw new Error(`Unsupported log level ${JSON.stringify(explicitLogLevel)}. ` + + 'Supported values are quiet, normal, verbose, and debug.'); + } + const explicitOptIn = explicitReporter !== undefined; + if (!supportsBootstrapHandoff(options.rushVersion, options.bootstrapVersion)) { + if (explicitOptIn) { + throw new Error(`Rush version ${options.rushVersion} does not support the reporter bootstrap requested by ` + + `${JSON.stringify(`--reporter=${explicitReporter}`)}. Update the repository Rush version or ` + + 'use --reporter=legacy.'); + } + return createLegacyBootstrap(options); + } + const separatorIndex = options.argv.indexOf('--'); + const commandArgs = separatorIndex < 0 ? options.argv : options.argv.slice(0, separatorIndex); + const isHelp = commandArgs.includes('--help') || commandArgs.includes('-h'); + const outputs = !isHelp && (explicitOptIn || ownsImplicitOutput(options)) + ? readMultipleFlagValues(options.argv, '--output') + : []; + const outputOwnsStdout = outputs.some((output) => { + const match = /^([a-z][a-z0-9]*):\/\/(.*)$/i.exec(output); + if (!match) { + throw new Error(`Invalid --output control: ${JSON.stringify(output)}`); + } + return match[2].split('?', 1)[0] === 'stdout'; + }); + const stdoutReserved = explicitReporter === 'json' || + explicitReporter === 'ai' || + explicitReporter === 'file' || + commandArgs.includes('--json') || + outputOwnsStdout; + return new InstallRunRushBootstrap(options, !stdoutReserved); +} +//# sourceMappingURL=InstallRunRushBootstrap.js.map + +/***/ }, + /***/ 207008 /*!*********************************************************************!*\ !*** ./lib-intermediate-esm/scripts/generated/BootstrapProtocol.js ***! @@ -24,7 +670,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BOOTSTRAP_BUFFER_MAX_BYTES: () => (/* binding */ BOOTSTRAP_BUFFER_MAX_BYTES), +/* harmony export */ BOOTSTRAP_BUFFER_TRUNCATED_EXTENSION_NAME: () => (/* binding */ BOOTSTRAP_BUFFER_TRUNCATED_EXTENSION_NAME), +/* harmony export */ BOOTSTRAP_EXTERNAL_CHUNK_MAX_BYTES: () => (/* binding */ BOOTSTRAP_EXTERNAL_CHUNK_MAX_BYTES), /* harmony export */ BOOTSTRAP_PROTOCOL_MAJOR: () => (/* binding */ BOOTSTRAP_PROTOCOL_MAJOR), +/* harmony export */ RUSH_REPORTER_BOOTSTRAP_HANDOFF_ENV_VAR: () => (/* binding */ RUSH_REPORTER_BOOTSTRAP_HANDOFF_ENV_VAR), +/* harmony export */ RUSH_REPORTER_BOOTSTRAP_NONCE_ENV_VAR: () => (/* binding */ RUSH_REPORTER_BOOTSTRAP_NONCE_ENV_VAR), /* harmony export */ encodeBootstrapEnvelope: () => (/* binding */ encodeBootstrapEnvelope) /* harmony export */ }); // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. @@ -62,10 +713,57 @@ function encodeBootstrapEnvelope(input) { payload: input.payload === undefined ? {} : input.payload }); } +/** + * The maximum size of the buffered bootstrap event stream, in bytes (1 MiB). + * + * @beta + */ +const BOOTSTRAP_BUFFER_MAX_BYTES = 1024 * 1024; +/** + * The maximum size of a single raw external-output chunk, in bytes (64 KiB). + * + * @beta + */ +const BOOTSTRAP_EXTERNAL_CHUNK_MAX_BYTES = 64 * 1024; +/** + * The private environment variable used to hand the bootstrap NDJSON file path + * to the installed frontend. + * + * @beta + */ +const RUSH_REPORTER_BOOTSTRAP_HANDOFF_ENV_VAR = '_RUSH_REPORTER_BOOTSTRAP_HANDOFF'; +/** + * The private environment variable carrying the one-time nonce that must match + * the handoff file's header line. + * + * @remarks + * The nonce proves the handoff file was written by the same bootstrap process + * that set the environment variable: a stale or foreign handoff file (same + * temp directory, different invocation) is rejected rather than replayed. + * + * @beta + */ +const RUSH_REPORTER_BOOTSTRAP_NONCE_ENV_VAR = '_RUSH_REPORTER_BOOTSTRAP_NONCE'; +/** + * The namespaced extension event name that describes bootstrap buffer truncation. + * + * @beta + */ +const BOOTSTRAP_BUFFER_TRUNCATED_EXTENSION_NAME = 'rush.reporter.buffer-truncated'; //# sourceMappingURL=BootstrapProtocol.js.map /***/ }, +/***/ 977598 +/*!******************************!*\ + !*** external "node:crypto" ***! + \******************************/ +(module) { + +module.exports = require("node:crypto"); + +/***/ }, + /***/ 973024 /*!**************************!*\ !*** external "node:fs" ***! @@ -76,6 +774,16 @@ module.exports = require("node:fs"); /***/ }, +/***/ 848161 +/*!**************************!*\ + !*** external "node:os" ***! + \**************************/ +(module) { + +module.exports = require("node:os"); + +/***/ }, + /***/ 176760 /*!****************************!*\ !*** external "node:path" ***! @@ -171,28 +879,32 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_path__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node:fs */ 973024); /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(node_fs__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./generated/BootstrapProtocol */ 207008); +/* harmony import */ var _InstallRunRushBootstrap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./InstallRunRushBootstrap */ 924320); +/* harmony import */ var _generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generated/BootstrapProtocol */ 207008); // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. /* eslint-disable no-console */ -const { installAndRun, findRushJsonFolder, RUSH_JSON_FILENAME, runWithErrorAndStatusCode } = require('./install-run'); + +const { installAndRun, findRushJsonFolder, RUSH_JSON_FILENAME } = require('./install-run'); const PACKAGE_NAME = '@microsoft/rush'; const RUSH_PREVIEW_VERSION = 'RUSH_PREVIEW_VERSION'; const RUSH_QUIET_MODE = 'RUSH_QUIET_MODE'; const INSTALL_RUN_RUSH_LOCKFILE_PATH_VARIABLE = 'INSTALL_RUN_RUSH_LOCKFILE_PATH'; function _validateBundledBootstrapProtocol() { - if (_generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_2__.BOOTSTRAP_PROTOCOL_MAJOR < 1 || typeof _generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_2__.encodeBootstrapEnvelope !== 'function') { + if (_generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_3__.BOOTSTRAP_PROTOCOL_MAJOR < 1 || typeof _generated_BootstrapProtocol__WEBPACK_IMPORTED_MODULE_3__.encodeBootstrapEnvelope !== 'function') { throw new Error('The bundled Rush reporter bootstrap protocol is invalid.'); } } -function _getRushVersion(logger) { +function _getRushVersion() { const rushPreviewVersion = process.env[RUSH_PREVIEW_VERSION]; if (rushPreviewVersion !== undefined) { - logger.info(`Using Rush version from environment variable ${RUSH_PREVIEW_VERSION}=${rushPreviewVersion}`); - return rushPreviewVersion; + return { + version: rushPreviewVersion, + sourceMessage: `Using Rush version from environment variable ${RUSH_PREVIEW_VERSION}=${rushPreviewVersion}` + }; } const rushJsonFolder = findRushJsonFolder(); const rushJsonPath = node_path__WEBPACK_IMPORTED_MODULE_0__.join(rushJsonFolder, RUSH_JSON_FILENAME); @@ -201,7 +913,7 @@ function _getRushVersion(logger) { // Use a regular expression to parse out the rushVersion value because rush.json supports comments, // but JSON.parse does not and we don't want to pull in more dependencies than we need to in this script. const rushJsonMatches = rushJsonContents.match(/\"rushVersion\"\s*\:\s*\"([0-9a-zA-Z.+\-]+)\"/); - return rushJsonMatches[1]; + return { version: rushJsonMatches[1] }; } catch (e) { throw new Error(`Unable to determine the required version of Rush from ${RUSH_JSON_FILENAME} (${rushJsonFolder}). ` + @@ -220,7 +932,6 @@ function _getBin(scriptName) { } } function _run() { - _validateBundledBootstrapProtocol(); const [nodePath /* Ex: /bin/node */, scriptPath /* /repo/common/scripts/install-run-rush.js */, ...packageBinArgs /* [build, --to, myproject] */] = process.argv; // Detect if this script was directly invoked, or if the install-run-rushx script was invokved to select the // appropriate binary inside the rush package to run @@ -233,7 +944,10 @@ function _run() { const quietModeEnvValue = process.env[RUSH_QUIET_MODE]; let quiet = quietModeEnvValue === '1' || quietModeEnvValue === 'true'; for (const arg of packageBinArgs) { - if (arg === '-q' || arg === '--quiet') { + if (arg === '--') { + break; + } + else if (arg === '-q' || arg === '--quiet') { // The -q/--quiet flag is supported by both `rush` and `rushx`, and will suppress // any normal informational/diagnostic information printed during startup. // @@ -261,18 +975,48 @@ function _run() { } process.exit(1); } - const logger = quiet - ? { info: () => { }, error: console.error } - : { info: console.log, error: console.error }; - runWithErrorAndStatusCode(logger, () => { - const version = _getRushVersion(logger); - logger.info(`The ${RUSH_JSON_FILENAME} configuration requests Rush version ${version}`); + let bootstrap; + process.exitCode = 1; + try { + _validateBundledBootstrapProtocol(); + const rushJsonFolder = findRushJsonFolder(); + const rushVersion = _getRushVersion(); + bootstrap = (0,_InstallRunRushBootstrap__WEBPACK_IMPORTED_MODULE_2__.createInstallRunRushBootstrap)({ + argv: packageBinArgs, + env: process.env, + rushJsonFolder, + rushVersion: rushVersion.version, + bootstrapVersion: "5.179.0", + commandName: bin, + quiet + }); + const logger = bootstrap.logger; + if (rushVersion.sourceMessage) { + logger.info(rushVersion.sourceMessage); + } + logger.info(`The ${RUSH_JSON_FILENAME} configuration requests Rush version ${rushVersion.version}`); const lockFilePath = process.env[INSTALL_RUN_RUSH_LOCKFILE_PATH_VARIABLE]; if (lockFilePath) { - logger.info(`Found ${INSTALL_RUN_RUSH_LOCKFILE_PATH_VARIABLE}="${lockFilePath}", installing with lockfile.`); + logger.info(`Found ${INSTALL_RUN_RUSH_LOCKFILE_PATH_VARIABLE}="${lockFilePath}", installing with lockfile.`, 'local-sensitive'); } - return installAndRun(logger, PACKAGE_NAME, version, bin, packageBinArgs, lockFilePath); - }); + process.exitCode = installAndRun(logger, PACKAGE_NAME, rushVersion.version, bin, packageBinArgs, lockFilePath, { + onExternalOutput: bootstrap.externalOutputHandler, + onExternalOutputOverflow: bootstrap.externalOutputOverflowHandler, + externalOutputCaptureMaxBytes: bootstrap.externalOutputCaptureMaxBytes, + externalOutputLiveStreams: bootstrap.externalOutputLiveStreams, + prepareToRun: bootstrap.prepareToRun + }); + } + catch (error) { + const logger = bootstrap?.logger ?? + (quiet + ? { info: () => { }, error: (text) => console.error(text) } + : { + info: (text) => console.log(text), + error: (text) => console.error(text) + }); + logger.error(`\n\n${String(error)}\n`); + } } _run(); //# sourceMappingURL=install-run-rush.js.map diff --git a/common/scripts/install-run.js b/common/scripts/install-run.js index ec8851f..0a88487 100644 --- a/common/scripts/install-run.js +++ b/common/scripts/install-run.js @@ -452,8 +452,8 @@ function trimNpmrcFileLines(npmrcFileLines, env, supportEnvVarFallbackSyntax, fi } function _copyAndTrimNpmrcFile(options) { const { logger, sourceNpmrcPath, targetNpmrcPath } = options; - logger.info(`Transforming ${sourceNpmrcPath}`); // Verbose - logger.info(` --> "${targetNpmrcPath}"`); + logger.info(`Transforming ${sourceNpmrcPath}`, 'local-sensitive'); // Verbose + logger.info(` --> "${targetNpmrcPath}"`, 'local-sensitive'); const combinedNpmrc = _trimNpmrcFile(options); node_fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(targetNpmrcPath, combinedNpmrc); return combinedNpmrc; @@ -461,9 +461,9 @@ function _copyAndTrimNpmrcFile(options) { function syncNpmrc(options) { const { sourceNpmrcFolder, targetNpmrcFolder, useNpmrcPublish, logger = { // eslint-disable-next-line no-console - info: console.log, + info: (text) => console.log(text), // eslint-disable-next-line no-console - error: console.error + error: (text) => console.error(text) }, createIfMissing = false } = options; const sourceNpmrcPath = node_path__WEBPACK_IMPORTED_MODULE_1__.join(sourceNpmrcFolder, !useNpmrcPublish ? '.npmrc' : '.npmrc-publish'); const targetNpmrcPath = node_path__WEBPACK_IMPORTED_MODULE_1__.join(targetNpmrcFolder, '.npmrc'); @@ -482,7 +482,7 @@ function syncNpmrc(options) { } else if (node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(targetNpmrcPath)) { // If the source .npmrc doesn't exist and there is one in the target, delete the one in the target - logger.info(`Deleting ${targetNpmrcPath}`); // Verbose + logger.info(`Deleting ${targetNpmrcPath}`, 'local-sensitive'); // Verbose node_fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(targetNpmrcPath); } } @@ -585,6 +585,16 @@ module.exports = require("node:os"); module.exports = require("node:path"); +/***/ }, + +/***/ 446193 +/*!**************************************!*\ + !*** external "node:string_decoder" ***! + \**************************************/ +(module) { + +module.exports = require("node:string_decoder"); + /***/ } /******/ }); @@ -669,7 +679,9 @@ var __webpack_exports__ = {}; \*****************************************************/ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ NPM_OUTPUT_CAPTURE_SCRIPT: () => (/* binding */ NPM_OUTPUT_CAPTURE_SCRIPT), /* harmony export */ RUSH_JSON_FILENAME: () => (/* binding */ RUSH_JSON_FILENAME), +/* harmony export */ finalizeCapturedNpmOutput: () => (/* binding */ finalizeCapturedNpmOutput), /* harmony export */ findRushJsonFolder: () => (/* binding */ findRushJsonFolder), /* harmony export */ getNpmPath: () => (/* binding */ getNpmPath), /* harmony export */ installAndRun: () => (/* binding */ installAndRun), @@ -683,8 +695,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(node_os__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! node:path */ 176760); /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(node_path__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _utilities_npmrcUtilities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utilities/npmrcUtilities */ 359480); -/* harmony import */ var _utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/executionUtilities */ 953844); +/* harmony import */ var node_string_decoder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! node:string_decoder */ 446193); +/* harmony import */ var node_string_decoder__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(node_string_decoder__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _utilities_npmrcUtilities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/npmrcUtilities */ 359480); +/* harmony import */ var _utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utilities/executionUtilities */ 953844); // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. /* eslint-disable no-console */ @@ -694,12 +708,76 @@ __webpack_require__.r(__webpack_exports__); + const RUSH_JSON_FILENAME = 'rush.json'; const RUSH_TEMP_FOLDER_ENV_VARIABLE_NAME = 'RUSH_TEMP_FOLDER'; const INSTALL_RUN_LOCKFILE_PATH_VARIABLE = 'INSTALL_RUN_LOCKFILE_PATH'; const INSTALLED_FLAG_FILENAME = 'installed.flag'; const NODE_MODULES_FOLDER_NAME = 'node_modules'; const PACKAGE_JSON_FILENAME = 'package.json'; +let _externalOutputCaptureId = 0; +const NPM_OUTPUT_CAPTURE_SCRIPT = ` +const childProcess = require('node:child_process'); +const fs = require('node:fs'); +const { StringDecoder } = require('node:string_decoder'); +const [ + command, + argsJson, + capturePath, + useShell, + maxBytesText, + renderStdoutText, + renderStderrText +] = process.argv.slice(1); +const child = childProcess.spawn(command, JSON.parse(argsJson), { + cwd: process.cwd(), + env: process.env, + shell: useShell === '1', + windowsVerbatimArguments: false, + stdio: ['inherit', 'pipe', 'pipe'] +}); +const decoders = { stdout: new StringDecoder('utf8'), stderr: new StringDecoder('utf8') }; +const maxBytes = Number(maxBytesText); +let capturedBytes = 0; +let overflowed = false; +const renderedStreams = { stdout: renderStdoutText === '1', stderr: renderStderrText === '1' }; +function capture(stream, text) { + if (!text || overflowed) { + return; + } + const record = JSON.stringify({ stream, text, wasRendered: renderedStreams[stream] }) + '\\n'; + const recordBytes = Buffer.byteLength(record); + if (capturedBytes + recordBytes <= maxBytes) { + fs.appendFileSync(capturePath, record); + capturedBytes += recordBytes; + } else { + overflowed = true; + fs.appendFileSync(capturePath, JSON.stringify({ overflow: true }) + '\\n'); + } +} +function forwardAndCapture(stream, chunk) { + if (renderedStreams[stream]) { + (stream === 'stdout' ? process.stdout : process.stderr).write(chunk); + } + capture(stream, decoders[stream].write(chunk)); +} +child.stdout.on('data', (chunk) => forwardAndCapture('stdout', chunk)); +child.stderr.on('data', (chunk) => forwardAndCapture('stderr', chunk)); +child.on('error', (error) => { + process.stderr.write(String(error) + '\\n'); + process.exitCode = 1; +}); +child.on('close', (code, signal) => { + capture('stdout', decoders.stdout.end()); + capture('stderr', decoders.stderr.end()); + if (signal) { + process.stderr.write('npm was terminated by signal: ' + signal + '\\n'); + process.exitCode = 1; + } else { + process.exitCode = code === null ? 1 : code; + } +}); +`; /** * Parse a package specifier (in the form of name\@version) into name and version parts. */ @@ -732,7 +810,7 @@ let _npmPath = undefined; function getNpmPath() { if (!_npmPath) { try { - if (_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_5__.IS_WINDOWS) { + if (_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__.IS_WINDOWS) { // We're on Windows const whereOutput = node_child_process__WEBPACK_IMPORTED_MODULE_0__.execSync('where npm', { stdio: [] }).toString(); const lines = whereOutput.split(node_os__WEBPACK_IMPORTED_MODULE_2__.EOL).filter((line) => !!line); @@ -828,7 +906,7 @@ function _resolvePackageVersion(logger, rushCommonFolder, { name, version }) { try { const rushTempFolder = _getRushTempFolder(rushCommonFolder); const sourceNpmrcFolder = node_path__WEBPACK_IMPORTED_MODULE_3__.join(rushCommonFolder, 'config', 'rush'); - (0,_utilities_npmrcUtilities__WEBPACK_IMPORTED_MODULE_4__.syncNpmrc)({ + (0,_utilities_npmrcUtilities__WEBPACK_IMPORTED_MODULE_5__.syncNpmrc)({ sourceNpmrcFolder, targetNpmrcFolder: rushTempFolder, logger, @@ -984,31 +1062,140 @@ function _createPackageJson(packageInstallFolder, name, version) { /** * Run "npm install" in the package install folder. */ -function _installPackage(logger, packageInstallFolder, name, version, npmCommand) { +function _installPackage(logger, packageInstallFolder, name, version, npmCommand, onExternalOutput, onExternalOutputOverflow, externalOutputCaptureMaxBytes, externalOutputLiveStreams) { + let capturePath; try { logger.info(`Installing ${name}...`); - _runNpmConfirmSuccess([npmCommand], { - stdio: 'inherit', - cwd: packageInstallFolder, - env: process.env - }, `npm ${npmCommand}`); - logger.info(`Successfully installed ${name}@${version}`); + if (onExternalOutput) { + capturePath = node_path__WEBPACK_IMPORTED_MODULE_3__.join(packageInstallFolder, `.install-run-output-${process.pid}-${_externalOutputCaptureId++}.log`); + node_fs__WEBPACK_IMPORTED_MODULE_1__.closeSync(node_fs__WEBPACK_IMPORTED_MODULE_1__.openSync(capturePath, 'wx', 0o600)); + } + if (capturePath) { + _runNpmWithCaptureConfirmSuccess([npmCommand], { + stdio: 'inherit', + cwd: packageInstallFolder, + env: process.env + }, capturePath, externalOutputCaptureMaxBytes ?? 1024 * 1024, externalOutputLiveStreams ?? { stdout: true, stderr: true }, `npm ${npmCommand}`); + } + else { + _runNpmConfirmSuccess([npmCommand], { + stdio: 'inherit', + cwd: packageInstallFolder, + env: process.env + }, `npm ${npmCommand}`); + } } catch (e) { throw new Error(`Unable to install package: ${e}`); } + finally { + if (capturePath !== undefined) { + finalizeCapturedNpmOutput(capturePath, logger, onExternalOutput, onExternalOutputOverflow); + } + } + logger.info(`Successfully installed ${name}@${version}`); +} +function _reportCaptureDamage(logger, capturePath, detail) { + const message = `Warning: npm output capture ${JSON.stringify(capturePath)} ${detail}`; + try { + if (logger.warning) { + logger.warning(message, 'local-sensitive'); + } + else { + logger.error(message, 'local-sensitive'); + } + } + catch { + try { + process.stderr.write(`${message}\n`); + } + catch { + // Capture diagnostics are best-effort and must not change the install result. + } + } +} +function finalizeCapturedNpmOutput(capturePath, logger, onExternalOutput, onExternalOutputOverflow) { + let firstDamageDetail; + let damageCount = 0; + try { + _readCapturedNpmOutput(capturePath, onExternalOutput, onExternalOutputOverflow, (detail) => { + firstDamageDetail ??= detail; + damageCount++; + }); + } + catch (error) { + firstDamageDetail ??= `could not be read: ${String(error)}.`; + damageCount++; + } + if (firstDamageDetail) { + const additionalDamage = damageCount > 1 ? ` ${damageCount - 1} additional capture issue(s) were discarded.` : ''; + _reportCaptureDamage(logger, capturePath, `${firstDamageDetail}${additionalDamage}`); + } + try { + _deleteFile(capturePath); + } + catch (error) { + _reportCaptureDamage(logger, capturePath, `could not be deleted: ${String(error)}.`); + } +} +function _readCapturedNpmOutput(capturePath, onExternalOutput, onExternalOutputOverflow, onCaptureDamage) { + const fileDescriptor = node_fs__WEBPACK_IMPORTED_MODULE_1__.openSync(capturePath, 'r'); + const buffer = Buffer.allocUnsafe(64 * 1024); + const decoder = new node_string_decoder__WEBPACK_IMPORTED_MODULE_4__.StringDecoder('utf8'); + let pending = ''; + try { + for (;;) { + const bytesRead = node_fs__WEBPACK_IMPORTED_MODULE_1__.readSync(fileDescriptor, buffer, 0, buffer.length, null); + if (bytesRead === 0) { + break; + } + pending += decoder.write(buffer.subarray(0, bytesRead)); + let newlineIndex; + while ((newlineIndex = pending.indexOf('\n')) >= 0) { + const line = pending.slice(0, newlineIndex); + pending = pending.slice(newlineIndex + 1); + if (line) { + let record; + try { + record = JSON.parse(line); + } + catch (error) { + onCaptureDamage(`contains a corrupt record that was discarded: ${String(error)}.`); + continue; + } + if (record.overflow === true) { + onExternalOutputOverflow?.(); + } + else if ((record.stream === 'stdout' || record.stream === 'stderr') && + typeof record.text === 'string') { + onExternalOutput(record.stream, record.text, record.wasRendered === true); + } + else { + onCaptureDamage('contains an invalid record that was discarded.'); + } + } + } + } + pending += decoder.end(); + if (pending.trim()) { + onCaptureDamage('ended with a partial record that was discarded.'); + } + } + finally { + node_fs__WEBPACK_IMPORTED_MODULE_1__.closeSync(fileDescriptor); + } } /** * Get the ".bin" path for the package. */ function _getBinPath(packageInstallFolder, binName) { const binFolderPath = node_path__WEBPACK_IMPORTED_MODULE_3__.resolve(packageInstallFolder, NODE_MODULES_FOLDER_NAME, '.bin'); - const resolvedBinName = _utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_5__.IS_WINDOWS ? `${binName}.cmd` : binName; + const resolvedBinName = _utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__.IS_WINDOWS ? `${binName}.cmd` : binName; return node_path__WEBPACK_IMPORTED_MODULE_3__.resolve(binFolderPath, resolvedBinName); } function _buildShellCommand(command, args) { - const escapedCommand = (0,_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_5__.escapeArgumentIfNeeded)(command); - const escapedArgs = args.map((arg) => (0,_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_5__.escapeArgumentIfNeeded)(arg)); + const escapedCommand = (0,_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__.escapeArgumentIfNeeded)(command); + const escapedArgs = args.map((arg) => (0,_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__.escapeArgumentIfNeeded)(arg)); return [escapedCommand, ...escapedArgs].join(' '); } /** @@ -1029,7 +1216,7 @@ function _writeFlagFile(packageInstallFolder) { function _runNpmConfirmSuccess(args, options, commandNameForLogging) { const command = getNpmPath(); let result; - if (_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_5__.IS_WINDOWS) { + if (_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__.IS_WINDOWS) { result = node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync(_buildShellCommand(command, args), { ...options, shell: true, @@ -1039,6 +1226,28 @@ function _runNpmConfirmSuccess(args, options, commandNameForLogging) { else { result = node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync(command, args, options); } + _throwIfSpawnFailed(result, commandNameForLogging); + return result; +} +function _runNpmWithCaptureConfirmSuccess(args, options, capturePath, captureMaxBytes, liveStreams, commandNameForLogging) { + const npmPath = getNpmPath(); + const command = _utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__.IS_WINDOWS ? _buildShellCommand(npmPath, args) : npmPath; + const commandArgs = _utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__.IS_WINDOWS ? [] : args; + const result = node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync(process.execPath, [ + '-e', + NPM_OUTPUT_CAPTURE_SCRIPT, + command, + JSON.stringify(commandArgs), + capturePath, + _utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__.IS_WINDOWS ? '1' : '0', + String(captureMaxBytes), + liveStreams.stdout ? '1' : '0', + liveStreams.stderr ? '1' : '0' + ], options); + _throwIfSpawnFailed(result, commandNameForLogging); + return result; +} +function _throwIfSpawnFailed(result, commandNameForLogging) { if (result.status !== 0) { if (!result.status) { // Is status null or undefined? @@ -1056,9 +1265,8 @@ function _runNpmConfirmSuccess(args, options, commandNameForLogging) { throw new Error(`"${commandNameForLogging}" returned error code ${result.status}`); } } - return result; } -function installAndRun(logger, packageName, packageVersion, packageBinName, packageBinArgs, lockFilePath = process.env[INSTALL_RUN_LOCKFILE_PATH_VARIABLE]) { +function installAndRun(logger, packageName, packageVersion, packageBinName, packageBinArgs, lockFilePath = process.env[INSTALL_RUN_LOCKFILE_PATH_VARIABLE], options = {}) { const rushJsonFolder = findRushJsonFolder(); const rushCommonFolder = node_path__WEBPACK_IMPORTED_MODULE_3__.join(rushJsonFolder, 'common'); const rushTempFolder = _getRushTempFolder(rushCommonFolder); @@ -1067,7 +1275,7 @@ function installAndRun(logger, packageName, packageVersion, packageBinName, pack // The package isn't already installed _cleanInstallFolder(rushTempFolder, packageInstallFolder, lockFilePath); const sourceNpmrcFolder = node_path__WEBPACK_IMPORTED_MODULE_3__.join(rushCommonFolder, 'config', 'rush'); - (0,_utilities_npmrcUtilities__WEBPACK_IMPORTED_MODULE_4__.syncNpmrc)({ + (0,_utilities_npmrcUtilities__WEBPACK_IMPORTED_MODULE_5__.syncNpmrc)({ sourceNpmrcFolder, targetNpmrcFolder: packageInstallFolder, logger, @@ -1078,12 +1286,16 @@ function installAndRun(logger, packageName, packageVersion, packageBinName, pack }); _createPackageJson(packageInstallFolder, packageName, packageVersion); const installCommand = lockFilePath ? 'ci' : 'install'; - _installPackage(logger, packageInstallFolder, packageName, packageVersion, installCommand); + _installPackage(logger, packageInstallFolder, packageName, packageVersion, installCommand, options.onExternalOutput, options.onExternalOutputOverflow, options.externalOutputCaptureMaxBytes, options.externalOutputLiveStreams); _writeFlagFile(packageInstallFolder); } - const statusMessage = `Invoking "${packageBinName} ${packageBinArgs.join(' ')}"`; + const invocation = options.onExternalOutput + ? packageBinName + : `${packageBinName} ${packageBinArgs.join(' ')}`; + const statusMessage = `Invoking "${invocation}"`; const statusMessageLine = new Array(statusMessage.length + 1).join('-'); logger.info('\n' + statusMessage + '\n' + statusMessageLine + '\n'); + options.prepareToRun?.(); const binPath = _getBinPath(packageInstallFolder, packageBinName); const binFolderPath = node_path__WEBPACK_IMPORTED_MODULE_3__.resolve(packageInstallFolder, NODE_MODULES_FOLDER_NAME, '.bin'); // Windows environment variables are case-insensitive. Instead of using SpawnSyncOptions.env, we need to @@ -1097,7 +1309,7 @@ function installAndRun(logger, packageName, packageVersion, packageBinName, pack cwd: process.cwd(), env: process.env }; - if (_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_5__.IS_WINDOWS) { + if (_utilities_executionUtilities__WEBPACK_IMPORTED_MODULE_6__.IS_WINDOWS) { result = node_child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync(_buildShellCommand(binPath, packageBinArgs), { ...spawnOptions, windowsVerbatimArguments: false, @@ -1146,7 +1358,10 @@ function _run() { console.log('Example: install-run.js qrcode@1.2.2 qrcode https://rushjs.io'); process.exit(1); } - const logger = { info: console.log, error: console.error }; + const logger = { + info: (text) => console.log(text), + error: (text) => console.error(text) + }; runWithErrorAndStatusCode(logger, () => { const rushJsonFolder = findRushJsonFolder(); const rushCommonFolder = _ensureAndJoinPath(rushJsonFolder, 'common'); diff --git a/rush.json b/rush.json index c0f003c..a14fa2e 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", "npmVersion": "9.9.4", - "rushVersion": "5.179.0", + "rushVersion": "5.180.0", "projectFolderMaxDepth": 4, "projects": [ { @@ -35,4 +35,5 @@ +