@rushstack/rush-http-build-cache-plugin 5.92.0 → 5.97.1-pr3481.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/.heft/build-cache/jest-cache/haste-map-bae913f9b9aa720eb4deeae0a60a4b27-22ae7f4ce9de4306889d8c05e5cc39b9-f6b1af01a3130057bdfe3d86807211f9 +0 -0
  2. package/.heft/build-cache/jest-cache/jest-transform-cache-bae913f9b9aa720eb4deeae0a60a4b27-474488b31a4a940a3990e9eaf06f1647/{62/package_62ad16cf4b73e547a38b9be0e0826b2e → 26/package_263c59db6933ba9581588638fb19da5c} +2 -2
  3. package/.heft/build-cache/jest-cache/jest-transform-cache-bae913f9b9aa720eb4deeae0a60a4b27-474488b31a4a940a3990e9eaf06f1647/{e2/commons_e2ab730ac4f4b46b65b2b8f85c8616c5 → c7/commons_c77bee95093c1098b4a591f2dadf398d} +2281 -597
  4. package/.heft/build-cache/jest-cache/jest-transform-cache-bae913f9b9aa720eb4deeae0a60a4b27-474488b31a4a940a3990e9eaf06f1647/ce/index_ce3464019fb882539ee9a6f3e36e615a +2 -2
  5. package/.heft/build-cache/jest-cache/jest-transform-cache-bae913f9b9aa720eb4deeae0a60a4b27-474488b31a4a940a3990e9eaf06f1647/ce/index_ce3464019fb882539ee9a6f3e36e615a.map +1 -1
  6. package/.heft/build-cache/jest-cache/jest-transform-cache-bae913f9b9aa720eb4deeae0a60a4b27-474488b31a4a940a3990e9eaf06f1647/e5/HttpBuildCacheProvider_e53bd002cf44ae62693f20b8c4682941 +2 -2
  7. package/.heft/build-cache/jest-cache/jest-transform-cache-bae913f9b9aa720eb4deeae0a60a4b27-474488b31a4a940a3990e9eaf06f1647/e5/HttpBuildCacheProvider_e53bd002cf44ae62693f20b8c4682941.map +1 -1
  8. package/.heft/build-cache/jest-cache/jest-transform-cache-bae913f9b9aa720eb4deeae0a60a4b27-474488b31a4a940a3990e9eaf06f1647/e6/RushHttpBuildCachePlugin_e69b4b7cd4f95aa49455690c88f00247 +2 -2
  9. package/.heft/build-cache/jest-cache/jest-transform-cache-bae913f9b9aa720eb4deeae0a60a4b27-474488b31a4a940a3990e9eaf06f1647/e6/RushHttpBuildCachePlugin_e69b4b7cd4f95aa49455690c88f00247.map +1 -1
  10. package/.heft/build-cache/jest-cache/perf-cache-bae913f9b9aa720eb4deeae0a60a4b27-da39a3ee5e6b4b0d3255bfef95601890 +1 -1
  11. package/.rush/temp/operation/_phase_build/state.json +1 -1
  12. package/.rush/temp/operation/_phase_test/state.json +1 -1
  13. package/.rush/temp/package-deps__phase_build.json +2 -2
  14. package/.rush/temp/package-deps__phase_test.json +2 -2
  15. package/.rush/temp/rushstack+rush-http-build-cache-plugin-_phase_build-5e3cfa01506c2ac77af487ee9732b935a5bbe122.log +27 -0
  16. package/.rush/temp/shrinkwrap-deps.json +10 -10
  17. package/package.json +3 -3
  18. package/rush-logs/rush-http-build-cache-plugin._phase_build.log +23 -4
  19. package/rush-logs/rush-http-build-cache-plugin._phase_test.log +4 -4
  20. package/temp/coverage/clover.xml +2 -2
  21. package/temp/coverage/lcov-report/HttpBuildCacheProvider.ts.html +1 -1
  22. package/temp/coverage/lcov-report/RushHttpBuildCachePlugin.ts.html +1 -1
  23. package/temp/coverage/lcov-report/index.html +1 -1
  24. package/temp/coverage/lcov-report/index.ts.html +1 -1
  25. package/.rush/temp/operation/_phase_test/all.log +0 -29
  26. package/.rush/temp/rushstack+rush-http-build-cache-plugin-_phase_build-b4c5586f0288094c9a07eba9c3a86a35d8839a48.log +0 -10
@@ -1,4 +1,4 @@
1
- f8fe78e272f5f80bf511d42cdf63dd75
1
+ c2f95b5024788dbd5aa5619a6eb50736
2
2
  "use strict";
3
3
  exports.id = "commons";
4
4
  exports.ids = ["commons"];
@@ -551,6 +551,93 @@ class ChangeManager {
551
551
 
552
552
  /***/ }),
553
553
 
554
+ /***/ 13111:
555
+ /*!************************************************!*\
556
+ !*** ./lib-esnext/api/CobuildConfiguration.js ***!
557
+ \************************************************/
558
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
559
+
560
+ __webpack_require__.r(__webpack_exports__);
561
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
562
+ /* harmony export */ "CobuildConfiguration": () => (/* binding */ CobuildConfiguration)
563
+ /* harmony export */ });
564
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ 371017);
565
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
566
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
567
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__);
568
+ /* harmony import */ var _schemas_cobuild_schema_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../schemas/cobuild.schema.json */ 222518);
569
+ /* harmony import */ var _EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EnvironmentConfiguration */ 382806);
570
+ /* harmony import */ var _logic_RushConstants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../logic/RushConstants */ 951904);
571
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
572
+ // See LICENSE in the project root for license information.
573
+
574
+
575
+
576
+
577
+
578
+ /**
579
+ * Use this class to load and save the "common/config/rush/cobuild.json" config file.
580
+ * This file provides configuration options for the Rush Cobuild feature.
581
+ * @beta
582
+ */
583
+ class CobuildConfiguration {
584
+ constructor(options) {
585
+ var _a, _b;
586
+ const { cobuildJson } = options;
587
+ this.cobuildEnabled = (_a = _EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_2__.EnvironmentConfiguration.cobuildEnabled) !== null && _a !== void 0 ? _a : cobuildJson.cobuildEnabled;
588
+ this.cobuildContextId = _EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_2__.EnvironmentConfiguration.cobuildContextId;
589
+ this.cobuildLeafProjectLogOnlyAllowed =
590
+ (_b = _EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_2__.EnvironmentConfiguration.cobuildLeafProjectLogOnlyAllowed) !== null && _b !== void 0 ? _b : false;
591
+ if (!this.cobuildContextId) {
592
+ this.cobuildEnabled = false;
593
+ }
594
+ const cobuildLockProviderFactory = options.rushSession.getCobuildLockProviderFactory(cobuildJson.cobuildLockProvider);
595
+ if (!cobuildLockProviderFactory) {
596
+ throw new Error(`Unexpected cobuild lock provider: ${cobuildJson.cobuildLockProvider}`);
597
+ }
598
+ this.cobuildLockProvider = cobuildLockProviderFactory(cobuildJson);
599
+ }
600
+ /**
601
+ * Attempts to load the cobuild.json data from the standard file path `common/config/rush/cobuild.json`.
602
+ * If the file has not been created yet, then undefined is returned.
603
+ */
604
+ static async tryLoadAsync(terminal, rushConfiguration, rushSession) {
605
+ const jsonFilePath = CobuildConfiguration.getCobuildConfigFilePath(rushConfiguration);
606
+ if (!_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.FileSystem.exists(jsonFilePath)) {
607
+ return undefined;
608
+ }
609
+ return await CobuildConfiguration._loadAsync(jsonFilePath, terminal, rushConfiguration, rushSession);
610
+ }
611
+ static getCobuildConfigFilePath(rushConfiguration) {
612
+ return path__WEBPACK_IMPORTED_MODULE_0__.resolve(rushConfiguration.commonRushConfigFolder, _logic_RushConstants__WEBPACK_IMPORTED_MODULE_3__.RushConstants.cobuildFilename);
613
+ }
614
+ static async _loadAsync(jsonFilePath, terminal, rushConfiguration, rushSession) {
615
+ const cobuildJson = await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.loadAndValidateAsync(jsonFilePath, CobuildConfiguration._jsonSchema);
616
+ return new CobuildConfiguration({
617
+ cobuildJson,
618
+ rushConfiguration,
619
+ rushSession
620
+ });
621
+ }
622
+ get contextId() {
623
+ return this.cobuildContextId;
624
+ }
625
+ async connectLockProviderAsync() {
626
+ if (this.cobuildEnabled) {
627
+ await this.cobuildLockProvider.connectAsync();
628
+ }
629
+ }
630
+ async disconnectLockProviderAsync() {
631
+ if (this.cobuildEnabled) {
632
+ await this.cobuildLockProvider.disconnectAsync();
633
+ }
634
+ }
635
+ }
636
+ CobuildConfiguration._jsonSchema = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonSchema.fromLoadedObject(_schemas_cobuild_schema_json__WEBPACK_IMPORTED_MODULE_4__);
637
+ //# sourceMappingURL=CobuildConfiguration.js.map
638
+
639
+ /***/ }),
640
+
554
641
  /***/ 563114:
555
642
  /*!****************************************************!*\
556
643
  !*** ./lib-esnext/api/CommandLineConfiguration.js ***!
@@ -1274,6 +1361,29 @@ const EnvironmentVariableNames = {
1274
1361
  * this environment variable is ignored.
1275
1362
  */
1276
1363
  RUSH_BUILD_CACHE_WRITE_ALLOWED: 'RUSH_BUILD_CACHE_WRITE_ALLOWED',
1364
+ /**
1365
+ * Setting this environment variable overrides the value of `cobuildEnabled` in the `cobuild.json`
1366
+ * configuration file.
1367
+ *
1368
+ * @remarks
1369
+ * Specify `1` to enable the cobuild or `0` to disable it.
1370
+ *
1371
+ * If there is no cobuild configured, then this environment variable is ignored.
1372
+ */
1373
+ RUSH_COBUILD_ENABLED: 'RUSH_COBUILD_ENABLED',
1374
+ /**
1375
+ * Setting this environment variable opt into running with cobuilds.
1376
+ *
1377
+ * @remarks
1378
+ * If there is no cobuild configured, then this environment variable is ignored.
1379
+ */
1380
+ RUSH_COBUILD_CONTEXT_ID: 'RUSH_COBUILD_CONTEXT_ID',
1381
+ /**
1382
+ * If this variable is set to "1", When getting distributed builds, Rush will automatically handle the leaf project
1383
+ * with build cache "disabled" by writing to the cache in a special "log files only mode". This is useful when you
1384
+ * want to use Cobuilds to improve the performance in CI validations and the leaf projects have not enabled cache.
1385
+ */
1386
+ RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: 'RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED',
1277
1387
  /**
1278
1388
  * Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.
1279
1389
  */
@@ -1390,6 +1500,30 @@ class EnvironmentConfiguration {
1390
1500
  EnvironmentConfiguration._ensureValidated();
1391
1501
  return EnvironmentConfiguration._buildCacheWriteAllowed;
1392
1502
  }
1503
+ /**
1504
+ * If set, enables or disables the cobuild feature.
1505
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_ENABLED}
1506
+ */
1507
+ static get cobuildEnabled() {
1508
+ EnvironmentConfiguration._ensureValidated();
1509
+ return EnvironmentConfiguration._cobuildEnabled;
1510
+ }
1511
+ /**
1512
+ * Provides a determined cobuild context id if configured
1513
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}
1514
+ */
1515
+ static get cobuildContextId() {
1516
+ EnvironmentConfiguration._ensureValidated();
1517
+ return EnvironmentConfiguration._cobuildContextId;
1518
+ }
1519
+ /**
1520
+ * If set, enables or disables the cobuild leaf project log only feature.
1521
+ * See {@link EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED}
1522
+ */
1523
+ static get cobuildLeafProjectLogOnlyAllowed() {
1524
+ EnvironmentConfiguration._ensureValidated();
1525
+ return EnvironmentConfiguration._cobuildLeafProjectLogOnlyAllowed;
1526
+ }
1393
1527
  /**
1394
1528
  * Allows the git binary path to be explicitly provided.
1395
1529
  * See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH}
@@ -1491,6 +1625,20 @@ class EnvironmentConfiguration {
1491
1625
  EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED, value);
1492
1626
  break;
1493
1627
  }
1628
+ case EnvironmentVariableNames.RUSH_COBUILD_ENABLED: {
1629
+ EnvironmentConfiguration._cobuildEnabled =
1630
+ EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_COBUILD_ENABLED, value);
1631
+ break;
1632
+ }
1633
+ case EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID: {
1634
+ EnvironmentConfiguration._cobuildContextId = value;
1635
+ break;
1636
+ }
1637
+ case EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: {
1638
+ EnvironmentConfiguration._cobuildLeafProjectLogOnlyAllowed =
1639
+ EnvironmentConfiguration.parseBooleanEnvironmentVariable(EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED, value);
1640
+ break;
1641
+ }
1494
1642
  case EnvironmentVariableNames.RUSH_GIT_BINARY_PATH: {
1495
1643
  EnvironmentConfiguration._gitBinaryPath = value;
1496
1644
  break;
@@ -1726,15 +1874,14 @@ __webpack_require__.r(__webpack_exports__);
1726
1874
  /* harmony export */ "LastInstallFlag": () => (/* binding */ LastInstallFlag),
1727
1875
  /* harmony export */ "LastInstallFlagFactory": () => (/* binding */ LastInstallFlagFactory)
1728
1876
  /* harmony export */ });
1729
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ 371017);
1730
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
1731
- /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
1732
- /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__);
1877
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
1878
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__);
1879
+ /* harmony import */ var _base_BaseFlag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base/BaseFlag */ 192765);
1733
1880
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
1734
1881
  // See LICENSE in the project root for license information.
1735
1882
 
1736
1883
 
1737
- const lodash = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.Import.lazy('lodash', require);
1884
+ const lodash = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.Import.lazy('lodash', require);
1738
1885
  const LAST_INSTALL_FLAG_FILE_NAME = 'last-install.flag';
1739
1886
  /**
1740
1887
  * A helper class for managing last-install flags, which are persistent and
@@ -1743,17 +1890,9 @@ const LAST_INSTALL_FLAG_FILE_NAME = 'last-install.flag';
1743
1890
  * it can invalidate the last install.
1744
1891
  * @internal
1745
1892
  */
1746
- class LastInstallFlag {
1747
- /**
1748
- * Creates a new LastInstall flag
1749
- * @param folderPath - the folder that this flag is managing
1750
- * @param state - optional, the state that should be managed or compared
1751
- */
1752
- constructor(folderPath, state = {}) {
1753
- this.path = path__WEBPACK_IMPORTED_MODULE_0__.join(folderPath, this.flagName);
1754
- this._state = state;
1755
- }
1893
+ class LastInstallFlag extends _base_BaseFlag__WEBPACK_IMPORTED_MODULE_1__.BaseFlag {
1756
1894
  /**
1895
+ * @override
1757
1896
  * Returns true if the file exists and the contents match the current state.
1758
1897
  */
1759
1898
  isValid(options) {
@@ -1771,12 +1910,12 @@ class LastInstallFlag {
1771
1910
  _isValid(checkValidAndReportStoreIssues, { rushVerb = 'update', statePropertiesToIgnore } = {}) {
1772
1911
  let oldState;
1773
1912
  try {
1774
- oldState = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.load(this.path);
1913
+ oldState = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.JsonFile.load(this.path);
1775
1914
  }
1776
1915
  catch (err) {
1777
1916
  return false;
1778
1917
  }
1779
- const newState = Object.assign({}, this._state);
1918
+ const newState = this._state;
1780
1919
  if (statePropertiesToIgnore) {
1781
1920
  for (const optionToIgnore of statePropertiesToIgnore) {
1782
1921
  delete newState[optionToIgnore];
@@ -1791,10 +1930,10 @@ class LastInstallFlag {
1791
1930
  // Only throw an error if the package manager hasn't changed from PNPM
1792
1931
  oldState.packageManager === pkgManager) {
1793
1932
  const normalizedOldStorePath = oldState.storePath
1794
- ? _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.Path.convertToPlatformDefault(oldState.storePath)
1933
+ ? _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.Path.convertToPlatformDefault(oldState.storePath)
1795
1934
  : '<global>';
1796
1935
  const normalizedNewStorePath = newState.storePath
1797
- ? _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.Path.convertToPlatformDefault(newState.storePath)
1936
+ ? _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.Path.convertToPlatformDefault(newState.storePath)
1798
1937
  : '<global>';
1799
1938
  if (
1800
1939
  // Throw if the store path changed
@@ -1805,26 +1944,33 @@ class LastInstallFlag {
1805
1944
  `New Path: ${normalizedNewStorePath}`);
1806
1945
  }
1807
1946
  }
1947
+ // check ignoreScripts
1948
+ if (newState.ignoreScripts !== oldState.ignoreScripts) {
1949
+ return false;
1950
+ }
1951
+ else {
1952
+ // full install
1953
+ if (!newState.selectedProjectNames && !oldState.selectedProjectNames) {
1954
+ return true;
1955
+ }
1956
+ }
1957
+ // check whether new selected projects are installed
1958
+ if (newState.selectedProjectNames) {
1959
+ if (!oldState.selectedProjectNames) {
1960
+ // used to be a full install
1961
+ return true;
1962
+ }
1963
+ else if (lodash.difference(newState.selectedProjectNames, oldState.selectedProjectNames).length === 0) {
1964
+ // current selected projects are included in old selected projects
1965
+ return true;
1966
+ }
1967
+ }
1808
1968
  }
1809
1969
  }
1810
1970
  return false;
1811
1971
  }
1812
1972
  return true;
1813
1973
  }
1814
- /**
1815
- * Writes the flag file to disk with the current state
1816
- */
1817
- create() {
1818
- _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.save(this._state, this.path, {
1819
- ensureFolderExists: true
1820
- });
1821
- }
1822
- /**
1823
- * Removes the flag file
1824
- */
1825
- clear() {
1826
- _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.FileSystem.deleteFile(this.path);
1827
- }
1828
1974
  /**
1829
1975
  * Returns the name of the flag file
1830
1976
  */
@@ -1856,6 +2002,26 @@ class LastInstallFlagFactory {
1856
2002
  }
1857
2003
  return new LastInstallFlag(rushConfiguration.commonTempFolder, currentState);
1858
2004
  }
2005
+ /**
2006
+ * Gets the LastInstall flag and sets the current state. This state is used to compare
2007
+ * against the last-known-good state tracked by the LastInstall flag.
2008
+ * @param rushConfiguration - the configuration of the Rush repo to get the install
2009
+ * state from
2010
+ *
2011
+ * @internal
2012
+ */
2013
+ static getCommonTempSplitFlag(rushConfiguration) {
2014
+ const currentState = {
2015
+ node: process.versions.node,
2016
+ packageManager: rushConfiguration.packageManager,
2017
+ packageManagerVersion: rushConfiguration.packageManagerToolVersion,
2018
+ rushJsonFolder: rushConfiguration.rushJsonFolder
2019
+ };
2020
+ if (currentState.packageManager === 'pnpm' && rushConfiguration.pnpmOptions) {
2021
+ currentState.storePath = rushConfiguration.pnpmOptions.pnpmStorePath;
2022
+ }
2023
+ return new LastInstallFlag(rushConfiguration.commonTempSplitFolder, currentState);
2024
+ }
1859
2025
  }
1860
2026
  //# sourceMappingURL=LastInstallFlag.js.map
1861
2027
 
@@ -1873,9 +2039,9 @@ __webpack_require__.r(__webpack_exports__);
1873
2039
  /* harmony export */ "LastLinkFlag": () => (/* binding */ LastLinkFlag),
1874
2040
  /* harmony export */ "LastLinkFlagFactory": () => (/* binding */ LastLinkFlagFactory)
1875
2041
  /* harmony export */ });
1876
- /* harmony import */ var _LastInstallFlag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LastInstallFlag */ 919846);
1877
2042
  /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
1878
2043
  /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__);
2044
+ /* harmony import */ var _base_BaseFlag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base/BaseFlag */ 192765);
1879
2045
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
1880
2046
  // See LICENSE in the project root for license information.
1881
2047
 
@@ -1886,20 +2052,7 @@ const LAST_LINK_FLAG_FILE_NAME = 'last-link.flag';
1886
2052
  * indicates that linking was completed successfully.
1887
2053
  * @internal
1888
2054
  */
1889
- class LastLinkFlag extends _LastInstallFlag__WEBPACK_IMPORTED_MODULE_1__.LastInstallFlag {
1890
- /**
1891
- * @override
1892
- */
1893
- isValid() {
1894
- let oldState;
1895
- try {
1896
- oldState = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.JsonFile.load(this.path);
1897
- }
1898
- catch (err) {
1899
- // Swallow error
1900
- }
1901
- return !!oldState;
1902
- }
2055
+ class LastLinkFlag extends _base_BaseFlag__WEBPACK_IMPORTED_MODULE_1__.BaseFlag {
1903
2056
  /**
1904
2057
  * @override
1905
2058
  */
@@ -2472,6 +2625,7 @@ const knownRushConfigFilenames = [
2472
2625
  _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.artifactoryFilename,
2473
2626
  _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.browserApprovedPackagesFilename,
2474
2627
  _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.buildCacheFilename,
2628
+ _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.cobuildFilename,
2475
2629
  _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.commandLineFilename,
2476
2630
  _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.commonVersionsFilename,
2477
2631
  _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.experimentsFilename,
@@ -2522,6 +2676,7 @@ class RushConfiguration {
2522
2676
  this.commonTempFolder =
2523
2677
  _EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_5__.EnvironmentConfiguration.rushTempFolderOverride ||
2524
2678
  path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonFolder, _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.rushTempFolderName);
2679
+ this.commonTempSplitFolder = path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonFolder, _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.rushTempSplitFolderName);
2525
2680
  this.commonScriptsFolder = path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonFolder, 'scripts');
2526
2681
  this.npmCacheFolder = path__WEBPACK_IMPORTED_MODULE_0__.resolve(path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonTempFolder, 'npm-cache'));
2527
2682
  this.npmTmpFolder = path__WEBPACK_IMPORTED_MODULE_0__.resolve(path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonTempFolder, 'npm-tmp'));
@@ -2530,6 +2685,7 @@ class RushConfiguration {
2530
2685
  this.currentVariantJsonFilename = path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonTempFolder, 'current-variant.json');
2531
2686
  this.suppressNodeLtsWarning = !!rushConfigurationJson.suppressNodeLtsWarning;
2532
2687
  this.ensureConsistentVersions = !!rushConfigurationJson.ensureConsistentVersions;
2688
+ this._filteredProjectsCache = new Map();
2533
2689
  const experimentsConfigFile = path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonRushConfigFolder, _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.experimentsFilename);
2534
2690
  this.experimentsConfiguration = new _ExperimentsConfiguration__WEBPACK_IMPORTED_MODULE_6__.ExperimentsConfiguration(experimentsConfigFile);
2535
2691
  const rushPluginsConfigFilename = path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonRushConfigFolder, _logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.rushPluginsConfigFilename);
@@ -2588,6 +2744,10 @@ class RushConfiguration {
2588
2744
  this.packageManagerWrapper = new _packageManager_YarnPackageManager__WEBPACK_IMPORTED_MODULE_13__.YarnPackageManager(this.packageManagerToolVersion);
2589
2745
  }
2590
2746
  this.shrinkwrapFilename = this.packageManagerWrapper.shrinkwrapFilename;
2747
+ /// From "pnpm-lock.yaml" --> "split-workspace-pnpm-lock.yaml"
2748
+ const shrinkwrapFilenameParsedPath = path__WEBPACK_IMPORTED_MODULE_0__.parse(this.shrinkwrapFilename);
2749
+ this.splitWorkspaceShrinkwrapFilename = path__WEBPACK_IMPORTED_MODULE_0__.join(shrinkwrapFilenameParsedPath.dir, 'split-workspace-' + shrinkwrapFilenameParsedPath.name + shrinkwrapFilenameParsedPath.ext);
2750
+ this.tempSplitWorkspaceShrinkwrapFilename = path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonTempSplitFolder, this.shrinkwrapFilename);
2591
2751
  this.tempShrinkwrapFilename = path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonTempFolder, this.shrinkwrapFilename);
2592
2752
  this.packageManagerToolFilename = path__WEBPACK_IMPORTED_MODULE_0__.resolve(path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonTempFolder, `${this.packageManager}-local`, 'node_modules', '.bin', `${this.packageManager}`));
2593
2753
  /// From "C:\repo\common\temp\pnpm-lock.yaml" --> "C:\repo\common\temp\pnpm-lock-preinstall.yaml"
@@ -2705,6 +2865,7 @@ class RushConfiguration {
2705
2865
  }
2706
2866
  this._projectsByName.set(project.packageName, project);
2707
2867
  }
2868
+ this._hasSplitWorkspaceProject = false;
2708
2869
  for (const project of this._projects) {
2709
2870
  project.decoupledLocalDependencies.forEach((decoupledLocalDependency) => {
2710
2871
  if (!this.getProjectByName(decoupledLocalDependency)) {
@@ -2715,6 +2876,9 @@ class RushConfiguration {
2715
2876
  this.versionPolicyConfiguration.validate(this.projectsByName);
2716
2877
  // Consumer relationships will be established the first time one is requested
2717
2878
  }
2879
+ if (this.hasSplitWorkspaceProject) {
2880
+ this._validateSplitWorkspaceRelationships();
2881
+ }
2718
2882
  }
2719
2883
  /**
2720
2884
  * Loads the configuration data from an Rush.json configuration file and returns
@@ -2858,7 +3022,13 @@ class RushConfiguration {
2858
3022
  knownSet.add(packageManagerWrapper.shrinkwrapFilename.toUpperCase());
2859
3023
  // If the package manager is pnpm, then also add the pnpm file to the known set.
2860
3024
  if (packageManagerWrapper.packageManager === 'pnpm') {
2861
- knownSet.add(packageManagerWrapper.pnpmfileFilename.toUpperCase());
3025
+ const pnpmPackageManager = packageManagerWrapper;
3026
+ knownSet.add(pnpmPackageManager.pnpmfileFilename.toUpperCase());
3027
+ knownSet.add(pnpmPackageManager.splitWorkspacePnpmfileFilename.toUpperCase());
3028
+ /// From "pnpm-lock.yaml" --> "split-workspace-pnpm-lock.yaml"
3029
+ const shrinkwrapFilenameParsedPath = path__WEBPACK_IMPORTED_MODULE_0__.parse(pnpmPackageManager.shrinkwrapFilename);
3030
+ const splitWorkspaceShrinkwrapFilename = path__WEBPACK_IMPORTED_MODULE_0__.join(shrinkwrapFilenameParsedPath.dir, 'split-workspace-' + shrinkwrapFilenameParsedPath.name + shrinkwrapFilenameParsedPath.ext);
3031
+ knownSet.add(splitWorkspaceShrinkwrapFilename.toUpperCase());
2862
3032
  }
2863
3033
  // Is the filename something we know? If not, report an error.
2864
3034
  if (!knownSet.has(filename.toUpperCase())) {
@@ -2968,6 +3138,20 @@ class RushConfiguration {
2968
3138
  }
2969
3139
  return this._projectsByTag;
2970
3140
  }
3141
+ /**
3142
+ * Search for projects according to filter
3143
+ * @beta
3144
+ */
3145
+ getFilteredProjects(filter) {
3146
+ const { splitWorkspace } = filter;
3147
+ const cacheKey = `${splitWorkspace}`;
3148
+ let filteredProjects = this._filteredProjectsCache.get(cacheKey);
3149
+ if (!filteredProjects) {
3150
+ filteredProjects = this.projects.filter((project) => project.splitWorkspace === splitWorkspace);
3151
+ this._filteredProjectsCache.set(cacheKey, filteredProjects);
3152
+ }
3153
+ return filteredProjects;
3154
+ }
2971
3155
  /**
2972
3156
  * Settings from the common-versions.json config file.
2973
3157
  * @remarks
@@ -2995,6 +3179,18 @@ class RushConfiguration {
2995
3179
  }
2996
3180
  return variant;
2997
3181
  }
3182
+ /**
3183
+ * Is there any split workspace project.
3184
+ */
3185
+ get hasSplitWorkspaceProject() {
3186
+ if (undefined === this._hasSplitWorkspaceProject) {
3187
+ const splitWorkspaceProjects = this.getFilteredProjects({
3188
+ splitWorkspace: true
3189
+ });
3190
+ this._hasSplitWorkspaceProject = splitWorkspaceProjects.length > 0;
3191
+ }
3192
+ return this._hasSplitWorkspaceProject;
3193
+ }
2998
3194
  /**
2999
3195
  * Gets the path to the common-versions.json config file for a specific variant.
3000
3196
  * @param variant - The name of the current variant in use by the active command.
@@ -3069,6 +3265,13 @@ class RushConfiguration {
3069
3265
  const variantConfigFolderPath = this._getVariantConfigFolderPath(variant);
3070
3266
  return path__WEBPACK_IMPORTED_MODULE_0__.join(variantConfigFolderPath, this.shrinkwrapFilename);
3071
3267
  }
3268
+ /**
3269
+ * Gets the committed shrinkwrap file name for split workspace.
3270
+ * @param variant - The name of the current variant in use by the active command.
3271
+ */
3272
+ getCommittedSplitWorkspaceShrinkwrapFilename() {
3273
+ return path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonRushConfigFolder, this.splitWorkspaceShrinkwrapFilename);
3274
+ }
3072
3275
  /**
3073
3276
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
3074
3277
  * @param variant - The name of the current variant in use by the active command.
@@ -3167,6 +3370,29 @@ class RushConfiguration {
3167
3370
  }
3168
3371
  return path__WEBPACK_IMPORTED_MODULE_0__.join(this.commonRushConfigFolder, ...(variant ? [_logic_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.rushVariantsFolderName, variant] : []));
3169
3372
  }
3373
+ /**
3374
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
3375
+ * The workspace project can NOT depend on a split workspace project.
3376
+ * The split workspace project CAN depend on a workspace project.
3377
+ */
3378
+ _validateSplitWorkspaceRelationships() {
3379
+ if (this.packageManager !== 'pnpm' || !this.pnpmOptions.useWorkspaces) {
3380
+ throw new Error(`Split workspace is only supported on PNPM with "useWorkspaces" enabled. Please specify "pnpmVersion" and set "useWorkspaces": true in your rush.json.`);
3381
+ }
3382
+ for (const project of this.projects) {
3383
+ if (!project.splitWorkspace) {
3384
+ for (const dependencyProject of project.dependencyProjects) {
3385
+ if (dependencyProject.splitWorkspace) {
3386
+ throw new Error(`The "${project.packageName}" cannot depend on "${dependencyProject.packageName}" because regular workspace projects cannot depend on projects from the split workspace.`);
3387
+ }
3388
+ }
3389
+ // For regular workspace project has a shrinkwrap file in its project folder, print a warning about this to avoid confusion.
3390
+ if (_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.FileSystem.exists(path__WEBPACK_IMPORTED_MODULE_0__.join(project.projectFolder, this.packageManagerWrapper.shrinkwrapFilename))) {
3391
+ console.warn(`Project ${project.packageName} has a ${this.packageManagerWrapper.shrinkwrapFilename} file in its project folder. Please consider to delete it to avoid confusion.`);
3392
+ }
3393
+ }
3394
+ }
3395
+ }
3170
3396
  }
3171
3397
  RushConfiguration._jsonSchema = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.JsonSchema.fromLoadedObject(_schemas_rush_schema_json__WEBPACK_IMPORTED_MODULE_24__);
3172
3398
  //# sourceMappingURL=RushConfiguration.js.map
@@ -3314,6 +3540,7 @@ class RushConfigurationProject {
3314
3540
  else {
3315
3541
  this.tags = new Set(projectJson.tags);
3316
3542
  }
3543
+ this.splitWorkspace = Boolean(projectJson.splitWorkspace);
3317
3544
  }
3318
3545
  /**
3319
3546
  * The parsed NPM "package.json" file from projectFolder.
@@ -4426,6 +4653,102 @@ VersionPolicyConfiguration._jsonSchema = _rushstack_node_core_library__WEBPACK_I
4426
4653
 
4427
4654
  /***/ }),
4428
4655
 
4656
+ /***/ 192765:
4657
+ /*!*****************************************!*\
4658
+ !*** ./lib-esnext/api/base/BaseFlag.js ***!
4659
+ \*****************************************/
4660
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4661
+
4662
+ __webpack_require__.r(__webpack_exports__);
4663
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4664
+ /* harmony export */ "BaseFlag": () => (/* binding */ BaseFlag)
4665
+ /* harmony export */ });
4666
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ 371017);
4667
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
4668
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
4669
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__);
4670
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
4671
+ // See LICENSE in the project root for license information.
4672
+
4673
+
4674
+ const lodash = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.Import.lazy('lodash', require);
4675
+ /**
4676
+ * A base class for flag file.
4677
+ * @internal
4678
+ */
4679
+ class BaseFlag {
4680
+ /**
4681
+ * Creates a new flag file
4682
+ * @param folderPath - the folder that this flag is managing
4683
+ * @param state - optional, the state that should be managed or compared
4684
+ */
4685
+ constructor(folderPath, state) {
4686
+ if (!this.flagName) {
4687
+ throw new Error('Do not use this class directly, extends this class instead');
4688
+ }
4689
+ this.path = path__WEBPACK_IMPORTED_MODULE_0__.join(folderPath, this.flagName);
4690
+ this._state = (state || {});
4691
+ this._isModified = true;
4692
+ }
4693
+ /**
4694
+ * Returns true if the file exists and the contents match the current state.
4695
+ */
4696
+ isValid() {
4697
+ let oldState;
4698
+ try {
4699
+ oldState = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.load(this.path);
4700
+ }
4701
+ catch (err) {
4702
+ // Swallow error
4703
+ }
4704
+ return !!oldState;
4705
+ }
4706
+ /**
4707
+ * Writes the flag file to disk with the current state
4708
+ */
4709
+ create() {
4710
+ _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.save(this._state, this.path, {
4711
+ ensureFolderExists: true
4712
+ });
4713
+ }
4714
+ /**
4715
+ * Merge new data into current state by lodash "merge"
4716
+ */
4717
+ mergeFromObject(data) {
4718
+ if (lodash.isMatch(this._state, data)) {
4719
+ return;
4720
+ }
4721
+ lodash.merge(this._state, data);
4722
+ this._isModified = true;
4723
+ }
4724
+ /**
4725
+ * Writes the flag file to disk with the current state if modified
4726
+ */
4727
+ saveIfModified() {
4728
+ if (this._isModified) {
4729
+ _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.save(this._state, this.path, {
4730
+ ensureFolderExists: true
4731
+ });
4732
+ this._isModified = false;
4733
+ }
4734
+ }
4735
+ /**
4736
+ * Removes the flag file
4737
+ */
4738
+ clear() {
4739
+ _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.FileSystem.deleteFile(this.path);
4740
+ }
4741
+ /**
4742
+ * Returns Name of the flag file
4743
+ */
4744
+ get flagName() {
4745
+ throw new Error('Do not use this class directly, extends this class instead');
4746
+ }
4747
+ }
4748
+ //# sourceMappingURL=BaseFlag.js.map
4749
+
4750
+ /***/ }),
4751
+
4429
4752
  /***/ 820330:
4430
4753
  /*!************************************************************!*\
4431
4754
  !*** ./lib-esnext/api/packageManager/NpmPackageManager.js ***!
@@ -4520,10 +4843,20 @@ class PnpmPackageManager extends _PackageManager__WEBPACK_IMPORTED_MODULE_2__.Pa
4520
4843
  else {
4521
4844
  this.pnpmfileFilename = _logic_RushConstants__WEBPACK_IMPORTED_MODULE_3__.RushConstants.pnpmfileV1Filename;
4522
4845
  }
4846
+ this.splitWorkspacePnpmfileFilename = '.pnpmfile-split-workspace.cjs';
4523
4847
  // node_modules/.pnpm/lock.yaml
4524
4848
  // See https://github.com/pnpm/pnpm/releases/tag/v4.0.0 for more details.
4525
4849
  this.internalShrinkwrapRelativePath = path__WEBPACK_IMPORTED_MODULE_1__.join('node_modules', '.pnpm', 'lock.yaml');
4526
4850
  }
4851
+ /**
4852
+ * The filename of the global shrinkwrap file that is used by the package manager.
4853
+ *
4854
+ * @remarks
4855
+ * Example: `global-pnpmfile.cjs`
4856
+ */
4857
+ get globalPnpmfileFilename() {
4858
+ return 'global-pnpmfile.cjs';
4859
+ }
4527
4860
  }
4528
4861
  //# sourceMappingURL=PnpmPackageManager.js.map
4529
4862
 
@@ -4807,7 +5140,8 @@ class RushCommandLineParser extends _rushstack_ts_command_line__WEBPACK_IMPORTED
4807
5140
  (_a = this.telemetry) === null || _a === void 0 ? void 0 : _a.flush();
4808
5141
  }
4809
5142
  async execute(args) {
4810
- this._terminalProvider.verboseEnabled = this.isDebug;
5143
+ // debugParameter will be correctly parsed during super.execute(), so manually parse here.
5144
+ this._terminalProvider.debugEnabled = process.argv.indexOf('--debug') >= 0;
4811
5145
  await this.pluginManager.tryInitializeUnassociatedPluginsAsync();
4812
5146
  return await super.execute(args);
4813
5147
  }
@@ -5334,7 +5668,10 @@ class RushPnpmCommandLineParser {
5334
5668
  variant: undefined,
5335
5669
  maxInstallAttempts: _logic_RushConstants__WEBPACK_IMPORTED_MODULE_5__.RushConstants.defaultMaxInstallAttempts,
5336
5670
  pnpmFilterArguments: [],
5337
- checkOnly: false
5671
+ checkOnly: false,
5672
+ includeSplitWorkspace: false,
5673
+ ignoreScripts: false,
5674
+ splitWorkspacePnpmFilterArguments: []
5338
5675
  };
5339
5676
  const installManagerFactoryModule = await __webpack_require__.e(/*! import() | InstallManagerFactory */ "InstallManagerFactory").then(__webpack_require__.bind(__webpack_require__, /*! ../logic/InstallManagerFactory */ 611779));
5340
5677
  const installManager = await installManagerFactoryModule.InstallManagerFactory.getInstallManagerAsync(this._rushConfiguration, rushGlobalFolder, purgeManager, installManagerOptions);
@@ -5488,7 +5825,11 @@ class RushXCommandLine {
5488
5825
  console.log(`Unable to find a package.json file in the current working directory or any of its parents.`);
5489
5826
  return;
5490
5827
  }
5491
- if (rushConfiguration && !rushConfiguration.tryGetProjectForPath(process.cwd())) {
5828
+ let rushProject;
5829
+ if (rushConfiguration) {
5830
+ rushProject = rushConfiguration.tryGetProjectForPath(process.cwd());
5831
+ }
5832
+ if (!rushConfiguration || !rushProject) {
5492
5833
  // GitHub #2713: Users reported confusion resulting from a situation where "rush install"
5493
5834
  // did not install the project's dependencies, because the project was not registered.
5494
5835
  console.log(colors_safe__WEBPACK_IMPORTED_MODULE_0___default().yellow('Warning: You are invoking "rushx" inside a Rush repository, but this project is not registered in rush.json.'));
@@ -5524,12 +5865,21 @@ class RushXCommandLine {
5524
5865
  console.log(`> ${JSON.stringify(commandWithArgsForDisplay)}\n`);
5525
5866
  }
5526
5867
  const packageFolder = path__WEBPACK_IMPORTED_MODULE_1__.dirname(packageJsonFilePath);
5868
+ // If there is a rush.json then use its .npmrc from the temp folder.
5869
+ // Otherwise look for npmrc in the project folder.
5870
+ let initCwd = packageFolder;
5871
+ if (rushProject === null || rushProject === void 0 ? void 0 : rushProject.splitWorkspace) {
5872
+ if (rushConfiguration === null || rushConfiguration === void 0 ? void 0 : rushConfiguration.commonTempSplitFolder) {
5873
+ initCwd = rushConfiguration.commonTempFolder;
5874
+ }
5875
+ }
5876
+ else if (rushConfiguration === null || rushConfiguration === void 0 ? void 0 : rushConfiguration.commonTempFolder) {
5877
+ initCwd = rushConfiguration === null || rushConfiguration === void 0 ? void 0 : rushConfiguration.commonTempFolder;
5878
+ }
5527
5879
  const exitCode = _utilities_Utilities__WEBPACK_IMPORTED_MODULE_9__.Utilities.executeLifecycleCommand(commandWithArgs, {
5528
5880
  rushConfiguration,
5529
5881
  workingDirectory: packageFolder,
5530
- // If there is a rush.json then use its .npmrc from the temp folder.
5531
- // Otherwise look for npmrc in the project folder.
5532
- initCwd: rushConfiguration ? rushConfiguration.commonTempFolder : packageFolder,
5882
+ initCwd,
5533
5883
  handleOutput: false,
5534
5884
  environmentPathOptions: {
5535
5885
  includeProjectBin: true
@@ -6991,6 +7341,7 @@ class InitAction extends _BaseRushAction__WEBPACK_IMPORTED_MODULE_3__.BaseConfig
6991
7341
  'common/config/rush/[dot]npmrc-publish',
6992
7342
  'common/config/rush/artifactory.json',
6993
7343
  'common/config/rush/build-cache.json',
7344
+ 'common/config/rush/cobuild.json',
6994
7345
  'common/config/rush/command-line.json',
6995
7346
  'common/config/rush/common-versions.json',
6996
7347
  'common/config/rush/experiments.json',
@@ -7332,6 +7683,7 @@ __webpack_require__.r(__webpack_exports__);
7332
7683
 
7333
7684
  class InstallAction extends _BaseInstallAction__WEBPACK_IMPORTED_MODULE_1__.BaseInstallAction {
7334
7685
  constructor(parser) {
7686
+ var _a;
7335
7687
  super({
7336
7688
  actionName: 'install',
7337
7689
  summary: 'Install package dependencies for all projects in the repo according to the shrinkwrap file',
@@ -7354,20 +7706,57 @@ class InstallAction extends _BaseInstallAction__WEBPACK_IMPORTED_MODULE_1__.Base
7354
7706
  // Disable filtering because rush-project.json is riggable and therefore may not be available
7355
7707
  enableFiltering: false
7356
7708
  });
7709
+ if ((_a = this.rushConfiguration) === null || _a === void 0 ? void 0 : _a.hasSplitWorkspaceProject) {
7710
+ this._includeSplitWorkspaceParameter = this.defineFlagParameter({
7711
+ parameterLongName: '--include-split-workspace',
7712
+ description: 'Normally "rush install" only install projects in normal rush workspace.' +
7713
+ ' When you want to install for split workspace projects, you can run' +
7714
+ ' "rush install --include-split-workspace", which installs entire split workspace projects.' +
7715
+ ' Or, you can specify selection parameters to do partial install for split workspace projects, ' +
7716
+ ' such as "rush install --to <split_workspace_package_name>".'
7717
+ });
7718
+ }
7357
7719
  this._checkOnlyParameter = this.defineFlagParameter({
7358
7720
  parameterLongName: '--check-only',
7359
7721
  description: `Only check the validity of the shrinkwrap file without performing an install.`
7360
7722
  });
7723
+ this._ignoreScriptsParameter = this.defineFlagParameter({
7724
+ parameterLongName: '--ignore-scripts',
7725
+ description: 'Do not execute any install lifecycle scripts specified in package.json files and its' +
7726
+ ' dependencies when "rush install". Running with this flag leaves your installation in a uncompleted' +
7727
+ ' state, you need to run without this flag again to complete a full installation. Meanwhile, it makes' +
7728
+ ' your installing faster. Later, you can run "rush install" to run all ignored scripts. Moreover, you' +
7729
+ ' can partial install such as "rush install --to <package>" to run ignored scripts of the dependencies' +
7730
+ ' of the selected projects.'
7731
+ });
7361
7732
  }
7362
7733
  async buildInstallOptionsAsync() {
7734
+ var _a, _b, _c;
7363
7735
  const terminal = new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.Terminal(new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.ConsoleTerminalProvider());
7736
+ const { pnpmFilterArguments, splitWorkspacePnpmFilterArguments, selectedProjects, hasSelectSplitWorkspaceProject } = await this._selectionParameters.getPnpmFilterArgumentsAsync(terminal);
7737
+ // Warn when fully install without selecting any split workspace project
7738
+ if (this._includeSplitWorkspaceParameter &&
7739
+ !this._includeSplitWorkspaceParameter.value &&
7740
+ !((_a = this._selectionParameters) === null || _a === void 0 ? void 0 : _a.isSelectionSpecified)) {
7741
+ terminal.writeWarningLine('Run "rush install" without any selection parameter will not install for split workspace' +
7742
+ ' projects, please run the command again with specifying --include-split-workspace' +
7743
+ ' if you really want to install for split workspace projects.');
7744
+ terminal.writeLine();
7745
+ }
7746
+ let includeSplitWorkspace = (_c = (_b = this._includeSplitWorkspaceParameter) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : false;
7747
+ // turn on includeSplitWorkspace when selecting any split workspace project
7748
+ if (selectedProjects && hasSelectSplitWorkspaceProject) {
7749
+ includeSplitWorkspace = true;
7750
+ }
7364
7751
  return {
7365
7752
  debug: this.parser.isDebug,
7366
7753
  allowShrinkwrapUpdates: false,
7754
+ ignoreScripts: this._ignoreScriptsParameter.value,
7367
7755
  bypassPolicy: this._bypassPolicyParameter.value,
7368
7756
  noLink: this._noLinkParameter.value,
7369
7757
  fullUpgrade: false,
7370
7758
  recheckShrinkwrap: false,
7759
+ includeSplitWorkspace,
7371
7760
  networkConcurrency: this._networkConcurrencyParameter.value,
7372
7761
  collectLogFile: this._debugPackageManagerParameter.value,
7373
7762
  variant: this._variant.value,
@@ -7375,7 +7764,10 @@ class InstallAction extends _BaseInstallAction__WEBPACK_IMPORTED_MODULE_1__.Base
7375
7764
  // it is safe to assume that the value is not null
7376
7765
  maxInstallAttempts: this._maxInstallAttempts.value,
7377
7766
  // These are derived independently of the selection for command line brevity
7378
- pnpmFilterArguments: await this._selectionParameters.getPnpmFilterArgumentsAsync(terminal),
7767
+ pnpmFilterArguments,
7768
+ splitWorkspacePnpmFilterArguments,
7769
+ selectedProjects,
7770
+ selectionParameters: this._selectionParameters,
7379
7771
  checkOnly: this._checkOnlyParameter.value,
7380
7772
  beforeInstallAsync: () => this.rushSession.hooks.beforeInstall.promise(this)
7381
7773
  };
@@ -7538,7 +7930,8 @@ class ListAction extends _BaseRushAction__WEBPACK_IMPORTED_MODULE_1__.BaseRushAc
7538
7930
  versionPolicyName,
7539
7931
  shouldPublish,
7540
7932
  reviewCategory,
7541
- tags: Array.from(config.tags)
7933
+ tags: Array.from(config.tags),
7934
+ splitWorkspace: config.splitWorkspace
7542
7935
  };
7543
7936
  });
7544
7937
  const output = {
@@ -7568,6 +7961,9 @@ class ListAction extends _BaseRushAction__WEBPACK_IMPORTED_MODULE_1__.BaseRushAc
7568
7961
  tableHeader.push('Should publish');
7569
7962
  tableHeader.push('Review category');
7570
7963
  tableHeader.push('Tags');
7964
+ if (this.rushConfiguration.hasSplitWorkspaceProject) {
7965
+ tableHeader.push('Split workspace');
7966
+ }
7571
7967
  }
7572
7968
  const { default: CliTable } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! cli-table */ 13593, 23));
7573
7969
  const table = new CliTable({
@@ -7611,6 +8007,9 @@ class ListAction extends _BaseRushAction__WEBPACK_IMPORTED_MODULE_1__.BaseRushAc
7611
8007
  appendToPackageRow(shouldPublish);
7612
8008
  appendToPackageRow(reviewCategory);
7613
8009
  appendToPackageRow(Array.from(project.tags).join(', '));
8010
+ if (this.rushConfiguration.hasSplitWorkspaceProject) {
8011
+ appendToPackageRow(String(Boolean(project.splitWorkspace)));
8012
+ }
7614
8013
  }
7615
8014
  table.push(packageRow);
7616
8015
  }
@@ -7809,6 +8208,8 @@ class PublishAction extends _BaseRushAction__WEBPACK_IMPORTED_MODULE_4__.BaseRus
7809
8208
  */
7810
8209
  async runAsync() {
7811
8210
  _logic_policy_PolicyValidator__WEBPACK_IMPORTED_MODULE_5__.PolicyValidator.validatePolicy(this.rushConfiguration, { bypassPolicy: false });
8211
+ // FIXME: How to publish for packages in split workspace?
8212
+ // Or, maybe we can not publish packages in split workspace (?)
7812
8213
  // Example: "common\temp\publish-home"
7813
8214
  this._targetNpmrcPublishFolder = path__WEBPACK_IMPORTED_MODULE_1__.join(this.rushConfiguration.commonTempFolder, 'publish-home');
7814
8215
  // Example: "common\temp\publish-home\.npmrc"
@@ -8527,12 +8928,18 @@ __webpack_require__.r(__webpack_exports__);
8527
8928
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8528
8929
  /* harmony export */ "UpdateAction": () => (/* binding */ UpdateAction)
8529
8930
  /* harmony export */ });
8530
- /* harmony import */ var _BaseInstallAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseInstallAction */ 823791);
8931
+ /* harmony import */ var _BaseInstallAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BaseInstallAction */ 823791);
8932
+ /* harmony import */ var _parsing_SelectionParameterSet__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parsing/SelectionParameterSet */ 40787);
8933
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
8934
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__);
8531
8935
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
8532
8936
  // See LICENSE in the project root for license information.
8533
8937
 
8534
- class UpdateAction extends _BaseInstallAction__WEBPACK_IMPORTED_MODULE_0__.BaseInstallAction {
8938
+
8939
+
8940
+ class UpdateAction extends _BaseInstallAction__WEBPACK_IMPORTED_MODULE_1__.BaseInstallAction {
8535
8941
  constructor(parser) {
8942
+ var _a;
8536
8943
  super({
8537
8944
  actionName: 'update',
8538
8945
  summary: 'Install package dependencies for all projects in the repo,' +
@@ -8549,6 +8956,24 @@ class UpdateAction extends _BaseInstallAction__WEBPACK_IMPORTED_MODULE_0__.BaseI
8549
8956
  ' -- for details, see the command help for "rush install".',
8550
8957
  parser
8551
8958
  });
8959
+ if ((_a = this.rushConfiguration) === null || _a === void 0 ? void 0 : _a.hasSplitWorkspaceProject) {
8960
+ // Partial update is supported only when there is split workspace project
8961
+ this._selectionParameters = new _parsing_SelectionParameterSet__WEBPACK_IMPORTED_MODULE_2__.SelectionParameterSet(this.rushConfiguration, this, {
8962
+ // Include lockfile processing since this expands the selection, and we need to select
8963
+ // at least the same projects selected with the same query to "rush build"
8964
+ includeExternalDependencies: true,
8965
+ // Disable filtering because rush-project.json is riggable and therefore may not be available
8966
+ enableFiltering: false
8967
+ });
8968
+ this._includeSplitWorkspaceParameter = this.defineFlagParameter({
8969
+ parameterLongName: '--include-split-workspace',
8970
+ description: 'Normally "rush update" only updates projects in normal rush workspace.' +
8971
+ ' When you want to update for split workspace projects, you can run' +
8972
+ ' "rush update --include-split-workspace", which updates entire split workspace projects.' +
8973
+ ' Or, you can specify selection parameters to do partial update for split workspace projects, ' +
8974
+ ' such as "rush update --to <split_workspace_package_name>".'
8975
+ });
8976
+ }
8552
8977
  this._fullParameter = this.defineFlagParameter({
8553
8978
  parameterLongName: '--full',
8554
8979
  description: 'Normally "rush update" tries to preserve your existing installed versions' +
@@ -8566,6 +8991,15 @@ class UpdateAction extends _BaseInstallAction__WEBPACK_IMPORTED_MODULE_0__.BaseI
8566
8991
  " to process the shrinkwrap file. This will also update your shrinkwrap file with Rush's fixups." +
8567
8992
  ' (To minimize shrinkwrap churn, these fixups are normally performed only in the temporary folder.)'
8568
8993
  });
8994
+ this._ignoreScriptsParameter = this.defineFlagParameter({
8995
+ parameterLongName: '--ignore-scripts',
8996
+ description: 'Do not execute any install lifecycle scripts specified in package.json files and its' +
8997
+ ' dependencies when "rush update". Running with this flag leaves your installation in a uncompleted' +
8998
+ ' state, you need to run this command without this flag again or run "rush install" to complete a ' +
8999
+ ' full installation. Meanwhile, it makes faster retries on running install lifecycle scripts. You' +
9000
+ ' can partial install such as "rush install --to <package>" to run the ignored scripts of the' +
9001
+ ' dependencies of the selected projects.'
9002
+ });
8569
9003
  }
8570
9004
  async runAsync() {
8571
9005
  await this.parser.pluginManager.updateAsync();
@@ -8575,20 +9009,55 @@ class UpdateAction extends _BaseInstallAction__WEBPACK_IMPORTED_MODULE_0__.BaseI
8575
9009
  return super.runAsync();
8576
9010
  }
8577
9011
  async buildInstallOptionsAsync() {
9012
+ var _a, _b, _c, _d, _e;
9013
+ const terminal = new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.Terminal(new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.ConsoleTerminalProvider());
9014
+ /**
9015
+ * Partial update should only affects on split workspace project, and
9016
+ * not affects on normal rush workspace projects.
9017
+ */
9018
+ const pnpmFilterArguments = [];
9019
+ const { splitWorkspacePnpmFilterArguments = [], selectedProjects, hasSelectSplitWorkspaceProject = false } = (await ((_a = this._selectionParameters) === null || _a === void 0 ? void 0 : _a.getPnpmFilterArgumentsAsync(terminal))) || {};
9020
+ if (((_b = this._selectionParameters) === null || _b === void 0 ? void 0 : _b.isSelectionSpecified) && !hasSelectSplitWorkspaceProject) {
9021
+ // Warn when there is no split workspace project selected
9022
+ if (splitWorkspacePnpmFilterArguments.length === 0) {
9023
+ terminal.writeWarningLine('Project filtering arguments are using without selecting any split workspace' +
9024
+ ' projects. Better run "rush update" without specifying selection parameters.');
9025
+ terminal.writeLine();
9026
+ }
9027
+ }
9028
+ // Warn when fully update without selecting any split workspace project
9029
+ if (this._includeSplitWorkspaceParameter &&
9030
+ !this._includeSplitWorkspaceParameter.value &&
9031
+ !((_c = this._selectionParameters) === null || _c === void 0 ? void 0 : _c.isSelectionSpecified)) {
9032
+ terminal.writeWarningLine('Run "rush update" without any selection parameter will not update for split workspace' +
9033
+ ' projects, please run the command again with specifying --include-split-workspace' +
9034
+ ' if you really want to update for split workspace projects.');
9035
+ terminal.writeLine();
9036
+ }
9037
+ let includeSplitWorkspace = (_e = (_d = this._includeSplitWorkspaceParameter) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : false;
9038
+ // turn on includeSplitWorkspace when selecting any split workspace project
9039
+ if (selectedProjects && hasSelectSplitWorkspaceProject) {
9040
+ includeSplitWorkspace = true;
9041
+ }
8578
9042
  return {
8579
9043
  debug: this.parser.isDebug,
8580
9044
  allowShrinkwrapUpdates: true,
9045
+ ignoreScripts: this._ignoreScriptsParameter.value,
8581
9046
  bypassPolicy: this._bypassPolicyParameter.value,
8582
9047
  noLink: this._noLinkParameter.value,
8583
9048
  fullUpgrade: this._fullParameter.value,
8584
9049
  recheckShrinkwrap: this._recheckParameter.value,
9050
+ includeSplitWorkspace,
8585
9051
  networkConcurrency: this._networkConcurrencyParameter.value,
8586
9052
  collectLogFile: this._debugPackageManagerParameter.value,
8587
9053
  variant: this._variant.value,
8588
9054
  // Because the 'defaultValue' option on the _maxInstallAttempts parameter is set,
8589
9055
  // it is safe to assume that the value is not null
8590
9056
  maxInstallAttempts: this._maxInstallAttempts.value,
8591
- pnpmFilterArguments: [],
9057
+ pnpmFilterArguments,
9058
+ splitWorkspacePnpmFilterArguments,
9059
+ selectedProjects,
9060
+ selectionParameters: this._selectionParameters,
8592
9061
  checkOnly: false,
8593
9062
  beforeInstallAsync: () => this.rushSession.hooks.beforeInstall.promise(this)
8594
9063
  };
@@ -9115,10 +9584,11 @@ __webpack_require__.r(__webpack_exports__);
9115
9584
  /* harmony export */ });
9116
9585
  /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
9117
9586
  /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__);
9118
- /* harmony import */ var _logic_Selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logic/Selection */ 138705);
9587
+ /* harmony import */ var _logic_Selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../logic/Selection */ 138705);
9119
9588
  /* harmony import */ var _logic_selectors_GitChangedProjectSelectorParser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logic/selectors/GitChangedProjectSelectorParser */ 920415);
9120
9589
  /* harmony import */ var _logic_selectors_NamedProjectSelectorParser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../logic/selectors/NamedProjectSelectorParser */ 92382);
9121
9590
  /* harmony import */ var _logic_selectors_TagProjectSelectorParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logic/selectors/TagProjectSelectorParser */ 858595);
9591
+ /* harmony import */ var _logic_selectors_SplitWorkspaceProjectSelectorParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logic/selectors/SplitWorkspaceProjectSelectorParser */ 357196);
9122
9592
  /* harmony import */ var _logic_selectors_VersionPolicyProjectSelectorParser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../logic/selectors/VersionPolicyProjectSelectorParser */ 71589);
9123
9593
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
9124
9594
  // See LICENSE in the project root for license information.
@@ -9128,6 +9598,7 @@ __webpack_require__.r(__webpack_exports__);
9128
9598
 
9129
9599
 
9130
9600
 
9601
+
9131
9602
  /**
9132
9603
  * This class is provides the set of command line parameters used to select projects
9133
9604
  * based on dependencies.
@@ -9136,6 +9607,7 @@ __webpack_require__.r(__webpack_exports__);
9136
9607
  */
9137
9608
  class SelectionParameterSet {
9138
9609
  constructor(rushConfiguration, action, gitOptions) {
9610
+ this._selectors = [];
9139
9611
  this._rushConfiguration = rushConfiguration;
9140
9612
  const selectorParsers = new Map();
9141
9613
  const nameSelectorParser = new _logic_selectors_NamedProjectSelectorParser__WEBPACK_IMPORTED_MODULE_1__.NamedProjectSelectorParser(rushConfiguration);
@@ -9143,6 +9615,7 @@ class SelectionParameterSet {
9143
9615
  selectorParsers.set('git', new _logic_selectors_GitChangedProjectSelectorParser__WEBPACK_IMPORTED_MODULE_2__.GitChangedProjectSelectorParser(rushConfiguration, gitOptions));
9144
9616
  selectorParsers.set('tag', new _logic_selectors_TagProjectSelectorParser__WEBPACK_IMPORTED_MODULE_3__.TagProjectSelectorParser(rushConfiguration));
9145
9617
  selectorParsers.set('version-policy', new _logic_selectors_VersionPolicyProjectSelectorParser__WEBPACK_IMPORTED_MODULE_4__.VersionPolicyProjectSelectorParser(rushConfiguration));
9618
+ selectorParsers.set('split', new _logic_selectors_SplitWorkspaceProjectSelectorParser__WEBPACK_IMPORTED_MODULE_5__.SplitWorkspaceProjectSelectorParser(rushConfiguration));
9146
9619
  this._selectorParserByScope = selectorParsers;
9147
9620
  const getSpecifierCompletions = async () => {
9148
9621
  const completions = ['.'];
@@ -9248,6 +9721,25 @@ class SelectionParameterSet {
9248
9721
  ' belonging to VERSION_POLICY_NAME.' +
9249
9722
  ' For details, refer to the website article "Selecting subsets of projects".'
9250
9723
  });
9724
+ this._selectors = [
9725
+ this._onlyProject,
9726
+ this._fromProject,
9727
+ this._toProject,
9728
+ this._toExceptProject,
9729
+ this._impactedByProject,
9730
+ this._impactedByExceptProject
9731
+ ];
9732
+ }
9733
+ /**
9734
+ * Check if any of the selection parameters have a value specified on the command line
9735
+ *
9736
+ * Returns true if specifying any selection parameters, otherwise false.
9737
+ */
9738
+ get isSelectionSpecified() {
9739
+ if (undefined === this._isSelectionSpecified) {
9740
+ this._isSelectionSpecified = this._selectors.some((param) => param.values.length > 0);
9741
+ }
9742
+ return this._isSelectionSpecified;
9251
9743
  }
9252
9744
  /**
9253
9745
  * Computes the set of selected projects based on all parameter values.
@@ -9262,18 +9754,8 @@ class SelectionParameterSet {
9262
9754
  for (const value of this._toVersionPolicy.values) {
9263
9755
  this._toProject.values.push(`version-policy:${value}`);
9264
9756
  }
9265
- const selectors = [
9266
- this._onlyProject,
9267
- this._fromProject,
9268
- this._toProject,
9269
- this._toExceptProject,
9270
- this._impactedByProject,
9271
- this._impactedByExceptProject
9272
- ];
9273
- // Check if any of the selection parameters have a value specified on the command line
9274
- const isSelectionSpecified = selectors.some((param) => param.values.length > 0);
9275
9757
  // If no selection parameters are specified, return everything
9276
- if (!isSelectionSpecified) {
9758
+ if (!this.isSelectionSpecified) {
9277
9759
  return new Set(this._rushConfiguration.projects);
9278
9760
  }
9279
9761
  const [
@@ -9288,62 +9770,107 @@ class SelectionParameterSet {
9288
9770
  // --impacted-by
9289
9771
  impactedByProjects,
9290
9772
  // --impacted-by-except
9291
- impactedByExceptProjects] = await Promise.all(selectors.map((param) => {
9773
+ impactedByExceptProjects] = await Promise.all(this._selectors.map((param) => {
9292
9774
  return this._evaluateProjectParameterAsync(param, terminal);
9293
9775
  }));
9294
- const selection = _logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.union(
9776
+ const selection = _logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.union(
9295
9777
  // Safe command line options
9296
- _logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.expandAllDependencies(_logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.union(toRaw, _logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.directDependenciesOf(toExceptProjects),
9778
+ _logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.expandAllDependencies(_logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.union(toRaw, _logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.directDependenciesOf(toExceptProjects),
9297
9779
  // --from / --from-version-policy
9298
- _logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.expandAllConsumers(fromProjects))),
9780
+ _logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.expandAllConsumers(fromProjects))),
9299
9781
  // Unsafe command line option: --only
9300
9782
  onlyProjects,
9301
9783
  // Unsafe command line options: --impacted-by, --impacted-by-except
9302
- _logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.expandAllConsumers(_logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.union(impactedByProjects, _logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.directConsumersOf(impactedByExceptProjects))));
9784
+ _logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.expandAllConsumers(_logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.union(impactedByProjects, _logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.directConsumersOf(impactedByExceptProjects))));
9303
9785
  return selection;
9304
9786
  }
9305
9787
  /**
9306
- * Represents the selection as `--filter` parameters to pnpm.
9788
+ * Represents the selection as `--filter` parameters to pnpm, and selected projects when partial install
9307
9789
  *
9308
9790
  * @remarks
9309
9791
  * This is a separate from the selection to allow the filters to be represented more concisely.
9310
9792
  *
9311
- * @see https://pnpm.js.org/en/filtering
9793
+ * @see https://pnpm.io/filtering
9312
9794
  */
9313
9795
  async getPnpmFilterArgumentsAsync(terminal) {
9314
- const args = [];
9315
- // Include exactly these projects (--only)
9316
- for (const project of await this._evaluateProjectParameterAsync(this._onlyProject, terminal)) {
9317
- args.push('--filter', project.packageName);
9318
- }
9319
- // Include all projects that depend on these projects, and all dependencies thereof
9320
- const fromProjects = _logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.union(
9321
- // --from
9322
- await this._evaluateProjectParameterAsync(this._fromProject, terminal));
9323
- // All specified projects and all projects that they depend on
9324
- for (const project of _logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.union(
9325
- // --to
9326
- await this._evaluateProjectParameterAsync(this._toProject, terminal),
9327
- // --from / --from-version-policy
9328
- _logic_Selection__WEBPACK_IMPORTED_MODULE_5__.Selection.expandAllConsumers(fromProjects))) {
9329
- args.push('--filter', `${project.packageName}...`);
9330
- }
9331
- // --to-except
9332
- // All projects that the project directly or indirectly declares as a dependency
9333
- for (const project of await this._evaluateProjectParameterAsync(this._toExceptProject, terminal)) {
9334
- args.push('--filter', `${project.packageName}^...`);
9335
- }
9336
- // --impacted-by
9337
- // The project and all projects directly or indirectly declare it as a dependency
9338
- for (const project of await this._evaluateProjectParameterAsync(this._impactedByProject, terminal)) {
9339
- args.push('--filter', `...${project.packageName}`);
9796
+ const pnpmFilterArguments = [];
9797
+ const splitWorkspacePnpmFilterArguments = [];
9798
+ let hasSelectSplitWorkspaceProject = false;
9799
+ if (this._rushConfiguration.hasSplitWorkspaceProject) {
9800
+ // when there are split workspace projects, the selected projects are computed inside Rush.js.
9801
+ const selection = await this.getSelectedProjectsAsync(terminal);
9802
+ const selectedRushProjects = new Set();
9803
+ const selectedSplitWorkspaceProjects = new Set();
9804
+ for (const project of selection) {
9805
+ if (!project.splitWorkspace) {
9806
+ selectedRushProjects.add(project);
9807
+ }
9808
+ else {
9809
+ hasSelectSplitWorkspaceProject = true;
9810
+ selectedSplitWorkspaceProjects.add(project);
9811
+ }
9812
+ }
9813
+ // It is no need to push pnpm filter args if projects are fully selected.
9814
+ if (this._rushConfiguration.getFilteredProjects({
9815
+ splitWorkspace: false
9816
+ }).length !== selectedRushProjects.size) {
9817
+ for (const selectedProject of selectedRushProjects.values()) {
9818
+ pnpmFilterArguments.push('--filter', `${selectedProject.packageName}`);
9819
+ }
9820
+ }
9821
+ if (this._rushConfiguration.getFilteredProjects({
9822
+ splitWorkspace: true
9823
+ }).length !== selectedSplitWorkspaceProjects.size) {
9824
+ for (const selectedProject of selectedSplitWorkspaceProjects.values()) {
9825
+ splitWorkspacePnpmFilterArguments.push('--filter', `${selectedProject.packageName}`);
9826
+ }
9827
+ }
9340
9828
  }
9341
- // --impacted-by-except
9342
- // All projects that directly or indirectly declare the specified project as a dependency
9343
- for (const project of await this._evaluateProjectParameterAsync(this._impactedByExceptProject, terminal)) {
9344
- args.push('--filter', `...^${project.packageName}`);
9829
+ else {
9830
+ // when there are no split workspace projects, replies on pnpm filtering with ellipsis
9831
+ // Include exactly these projects (--only)
9832
+ for (const project of await this._evaluateProjectParameterAsync(this._onlyProject, terminal)) {
9833
+ pnpmFilterArguments.push('--filter', project.packageName);
9834
+ }
9835
+ // Include all projects that depend on these projects, and all dependencies thereof
9836
+ const fromProjects = _logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.union(
9837
+ // --from
9838
+ await this._evaluateProjectParameterAsync(this._fromProject, terminal));
9839
+ // All specified projects and all projects that they depend on
9840
+ for (const project of _logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.union(
9841
+ // --to
9842
+ await this._evaluateProjectParameterAsync(this._toProject, terminal),
9843
+ // --from / --from-version-policy
9844
+ _logic_Selection__WEBPACK_IMPORTED_MODULE_6__.Selection.expandAllConsumers(fromProjects))) {
9845
+ pnpmFilterArguments.push('--filter', `${project.packageName}...`);
9846
+ }
9847
+ // --to-except
9848
+ // All projects that the project directly or indirectly declares as a dependency
9849
+ for (const project of await this._evaluateProjectParameterAsync(this._toExceptProject, terminal)) {
9850
+ pnpmFilterArguments.push('--filter', `${project.packageName}^...`);
9851
+ }
9852
+ // --impacted-by
9853
+ // The project and all projects directly or indirectly declare it as a dependency
9854
+ for (const project of await this._evaluateProjectParameterAsync(this._impactedByProject, terminal)) {
9855
+ pnpmFilterArguments.push('--filter', `...${project.packageName}`);
9856
+ }
9857
+ // --impacted-by-except
9858
+ // All projects that directly or indirectly declare the specified project as a dependency
9859
+ for (const project of await this._evaluateProjectParameterAsync(this._impactedByExceptProject, terminal)) {
9860
+ pnpmFilterArguments.push('--filter', `...^${project.packageName}`);
9861
+ }
9862
+ }
9863
+ // Undefined when full install
9864
+ let selectedProjects;
9865
+ if (this.isSelectionSpecified) {
9866
+ selectedProjects = await this.getSelectedProjectsAsync(terminal);
9345
9867
  }
9346
- return args;
9868
+ return {
9869
+ pnpmFilterArguments,
9870
+ splitWorkspacePnpmFilterArguments,
9871
+ selectedProjects,
9872
+ hasSelectSplitWorkspaceProject
9873
+ };
9347
9874
  }
9348
9875
  /**
9349
9876
  * Usage telemetry for selection parameters. Only saved locally, and if requested in the config.
@@ -9409,6 +9936,15 @@ class SelectionParameterSet {
9409
9936
  }
9410
9937
  return selection;
9411
9938
  }
9939
+ toArguments() {
9940
+ const args = [];
9941
+ for (const selector of this._selectors) {
9942
+ for (const value of selector.values) {
9943
+ args.push(selector.longName, value);
9944
+ }
9945
+ }
9946
+ return args;
9947
+ }
9412
9948
  }
9413
9949
  //# sourceMappingURL=SelectionParameterSet.js.map
9414
9950
 
@@ -9716,22 +10252,24 @@ __webpack_require__.r(__webpack_exports__);
9716
10252
  /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
9717
10253
  /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__);
9718
10254
  /* harmony import */ var _pluginFramework_PhasedCommandHooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../pluginFramework/PhasedCommandHooks */ 580814);
9719
- /* harmony import */ var _logic_SetupChecks__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../logic/SetupChecks */ 60296);
9720
- /* harmony import */ var _utilities_Stopwatch__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utilities/Stopwatch */ 314318);
10255
+ /* harmony import */ var _logic_SetupChecks__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../logic/SetupChecks */ 60296);
10256
+ /* harmony import */ var _utilities_Stopwatch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utilities/Stopwatch */ 314318);
9721
10257
  /* harmony import */ var _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BaseScriptAction */ 994567);
9722
- /* harmony import */ var _logic_operations_OperationExecutionManager__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../logic/operations/OperationExecutionManager */ 576472);
10258
+ /* harmony import */ var _logic_operations_OperationExecutionManager__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../logic/operations/OperationExecutionManager */ 576472);
9723
10259
  /* harmony import */ var _logic_RushConstants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logic/RushConstants */ 951904);
9724
- /* harmony import */ var _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../api/EnvironmentConfiguration */ 382806);
9725
- /* harmony import */ var _api_LastLinkFlag__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../api/LastLinkFlag */ 986208);
9726
- /* harmony import */ var _api_BuildCacheConfiguration__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../api/BuildCacheConfiguration */ 541976);
9727
- /* harmony import */ var _parsing_SelectionParameterSet__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../parsing/SelectionParameterSet */ 40787);
10260
+ /* harmony import */ var _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../api/EnvironmentConfiguration */ 382806);
10261
+ /* harmony import */ var _api_LastLinkFlag__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../api/LastLinkFlag */ 986208);
10262
+ /* harmony import */ var _api_BuildCacheConfiguration__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../api/BuildCacheConfiguration */ 541976);
10263
+ /* harmony import */ var _parsing_SelectionParameterSet__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../parsing/SelectionParameterSet */ 40787);
9728
10264
  /* harmony import */ var _logic_operations_PhasedOperationPlugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logic/operations/PhasedOperationPlugin */ 797379);
9729
10265
  /* harmony import */ var _logic_operations_ShellOperationRunnerPlugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../logic/operations/ShellOperationRunnerPlugin */ 658087);
9730
- /* harmony import */ var _api_EventHooks__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../api/EventHooks */ 519005);
9731
- /* harmony import */ var _logic_ProjectChangeAnalyzer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../logic/ProjectChangeAnalyzer */ 311605);
9732
- /* harmony import */ var _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../logic/operations/OperationStatus */ 476597);
9733
- /* harmony import */ var _logic_operations_OperationResultSummarizerPlugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../logic/operations/OperationResultSummarizerPlugin */ 195183);
9734
- /* harmony import */ var _parsing_ParseParallelism__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../parsing/ParseParallelism */ 798601);
10266
+ /* harmony import */ var _api_EventHooks__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../api/EventHooks */ 519005);
10267
+ /* harmony import */ var _logic_ProjectChangeAnalyzer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../logic/ProjectChangeAnalyzer */ 311605);
10268
+ /* harmony import */ var _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../logic/operations/OperationStatus */ 476597);
10269
+ /* harmony import */ var _logic_operations_OperationResultSummarizerPlugin__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../logic/operations/OperationResultSummarizerPlugin */ 195183);
10270
+ /* harmony import */ var _parsing_ParseParallelism__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../parsing/ParseParallelism */ 798601);
10271
+ /* harmony import */ var _api_CobuildConfiguration__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../api/CobuildConfiguration */ 13111);
10272
+ /* harmony import */ var _logic_operations_CacheableOperationPlugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logic/operations/CacheableOperationPlugin */ 223875);
9735
10273
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
9736
10274
  // See LICENSE in the project root for license information.
9737
10275
 
@@ -9752,6 +10290,8 @@ __webpack_require__.r(__webpack_exports__);
9752
10290
 
9753
10291
 
9754
10292
 
10293
+
10294
+
9755
10295
 
9756
10296
  /**
9757
10297
  * This class implements phased commands which are run individually for each project in the repo,
@@ -9783,12 +10323,14 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
9783
10323
  new _logic_operations_PhasedOperationPlugin__WEBPACK_IMPORTED_MODULE_5__.PhasedOperationPlugin().apply(this.hooks);
9784
10324
  // Applies the Shell Operation Runner to selected operations
9785
10325
  new _logic_operations_ShellOperationRunnerPlugin__WEBPACK_IMPORTED_MODULE_6__.ShellOperationRunnerPlugin().apply(this.hooks);
10326
+ // Applies the build cache related logic to the selected operations
10327
+ new _logic_operations_CacheableOperationPlugin__WEBPACK_IMPORTED_MODULE_7__.CacheableOperationPlugin().apply(this.hooks);
9786
10328
  if (this._enableParallelism) {
9787
10329
  this._parallelismParameter = this.defineStringParameter({
9788
10330
  parameterLongName: '--parallelism',
9789
10331
  parameterShortName: '-p',
9790
10332
  argumentName: 'COUNT',
9791
- environmentVariable: _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_7__.EnvironmentVariableNames.RUSH_PARALLELISM,
10333
+ environmentVariable: _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_8__.EnvironmentVariableNames.RUSH_PARALLELISM,
9792
10334
  description: 'Specifies the maximum number of concurrent processes to launch during a build.' +
9793
10335
  ' The COUNT should be a positive integer, a percentage value (eg. "50%%") or the word "max"' +
9794
10336
  ' to specify a count that is equal to the number of CPU cores. If this parameter is omitted,' +
@@ -9800,7 +10342,7 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
9800
10342
  ' including an ASCII chart of the start and stop times for each operation.'
9801
10343
  });
9802
10344
  }
9803
- this._selectionParameters = new _parsing_SelectionParameterSet__WEBPACK_IMPORTED_MODULE_8__.SelectionParameterSet(this.rushConfiguration, this, {
10345
+ this._selectionParameters = new _parsing_SelectionParameterSet__WEBPACK_IMPORTED_MODULE_9__.SelectionParameterSet(this.rushConfiguration, this, {
9804
10346
  // Include lockfile processing since this expands the selection, and we need to select
9805
10347
  // at least the same projects selected with the same query to "rush build"
9806
10348
  includeExternalDependencies: true,
@@ -9867,7 +10409,7 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
9867
10409
  });
9868
10410
  }
9869
10411
  // TODO: Replace with last-install.flag when "rush link" and "rush unlink" are deprecated
9870
- const lastLinkFlag = _api_LastLinkFlag__WEBPACK_IMPORTED_MODULE_9__.LastLinkFlagFactory.getCommonTempFlag(this.rushConfiguration);
10412
+ const lastLinkFlag = _api_LastLinkFlag__WEBPACK_IMPORTED_MODULE_10__.LastLinkFlagFactory.getCommonTempFlag(this.rushConfiguration);
9871
10413
  if (!lastLinkFlag.isValid()) {
9872
10414
  const useWorkspaces = this.rushConfiguration.pnpmOptions && this.rushConfiguration.pnpmOptions.useWorkspaces;
9873
10415
  if (useWorkspaces) {
@@ -9881,17 +10423,17 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
9881
10423
  // if this is parallelizable, then use the value from the flag (undefined or a number),
9882
10424
  // if parallelism is not enabled, then restrict to 1 core
9883
10425
  const parallelism = this._enableParallelism
9884
- ? (0,_parsing_ParseParallelism__WEBPACK_IMPORTED_MODULE_10__.parseParallelism)((_b = this._parallelismParameter) === null || _b === void 0 ? void 0 : _b.value)
10426
+ ? (0,_parsing_ParseParallelism__WEBPACK_IMPORTED_MODULE_11__.parseParallelism)((_b = this._parallelismParameter) === null || _b === void 0 ? void 0 : _b.value)
9885
10427
  : 1;
9886
10428
  const terminal = this._terminal;
9887
- const stopwatch = _utilities_Stopwatch__WEBPACK_IMPORTED_MODULE_11__.Stopwatch.start();
10429
+ const stopwatch = _utilities_Stopwatch__WEBPACK_IMPORTED_MODULE_12__.Stopwatch.start();
9888
10430
  const showTimeline = this._timelineParameter ? this._timelineParameter.value : false;
9889
10431
  if (showTimeline) {
9890
10432
  const { ConsoleTimelinePlugin } = await __webpack_require__.e(/*! import() | ConsoleTimelinePlugin */ "ConsoleTimelinePlugin").then(__webpack_require__.bind(__webpack_require__, /*! ../../logic/operations/ConsoleTimelinePlugin */ 598358));
9891
10433
  new ConsoleTimelinePlugin(terminal).apply(this.hooks);
9892
10434
  }
9893
10435
  // Enable the standard summary
9894
- new _logic_operations_OperationResultSummarizerPlugin__WEBPACK_IMPORTED_MODULE_12__.OperationResultSummarizerPlugin(terminal).apply(this.hooks);
10436
+ new _logic_operations_OperationResultSummarizerPlugin__WEBPACK_IMPORTED_MODULE_13__.OperationResultSummarizerPlugin(terminal).apply(this.hooks);
9895
10437
  const { hooks: sessionHooks } = this.rushSession;
9896
10438
  if (sessionHooks.runAnyPhasedCommand.isUsed()) {
9897
10439
  // Avoid the cost of compiling the hook if it wasn't tapped.
@@ -9905,8 +10447,11 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
9905
10447
  const isQuietMode = !this._verboseParameter.value;
9906
10448
  const changedProjectsOnly = !!((_c = this._changedProjectsOnly) === null || _c === void 0 ? void 0 : _c.value);
9907
10449
  let buildCacheConfiguration;
10450
+ let cobuildConfiguration;
9908
10451
  if (!this._disableBuildCache) {
9909
- buildCacheConfiguration = await _api_BuildCacheConfiguration__WEBPACK_IMPORTED_MODULE_13__.BuildCacheConfiguration.tryLoadAsync(terminal, this.rushConfiguration, this.rushSession);
10452
+ buildCacheConfiguration = await _api_BuildCacheConfiguration__WEBPACK_IMPORTED_MODULE_14__.BuildCacheConfiguration.tryLoadAsync(terminal, this.rushConfiguration, this.rushSession);
10453
+ cobuildConfiguration = await _api_CobuildConfiguration__WEBPACK_IMPORTED_MODULE_15__.CobuildConfiguration.tryLoadAsync(terminal, this.rushConfiguration, this.rushSession);
10454
+ await (cobuildConfiguration === null || cobuildConfiguration === void 0 ? void 0 : cobuildConfiguration.connectLockProviderAsync());
9910
10455
  }
9911
10456
  const projectSelection = await this._selectionParameters.getSelectedProjectsAsync(terminal);
9912
10457
  if (!projectSelection.size) {
@@ -9918,9 +10463,10 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
9918
10463
  for (const [configParameter, parserParameter] of this.customParameters) {
9919
10464
  customParametersByName.set(configParameter.longName, parserParameter);
9920
10465
  }
9921
- const projectChangeAnalyzer = new _logic_ProjectChangeAnalyzer__WEBPACK_IMPORTED_MODULE_14__.ProjectChangeAnalyzer(this.rushConfiguration);
10466
+ const projectChangeAnalyzer = new _logic_ProjectChangeAnalyzer__WEBPACK_IMPORTED_MODULE_16__.ProjectChangeAnalyzer(this.rushConfiguration);
9922
10467
  const initialCreateOperationsContext = {
9923
10468
  buildCacheConfiguration,
10469
+ cobuildConfiguration,
9924
10470
  customParameters: customParametersByName,
9925
10471
  isIncrementalBuildAllowed: this._isIncrementalBuildAllowed,
9926
10472
  isInitial: true,
@@ -9937,6 +10483,12 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
9937
10483
  debugMode: this.parser.isDebug,
9938
10484
  parallelism,
9939
10485
  changedProjectsOnly,
10486
+ beforeExecuteOperation: async (record) => {
10487
+ await this.hooks.beforeExecuteOperation.promise(record);
10488
+ },
10489
+ afterExecuteOperation: async (record) => {
10490
+ await this.hooks.afterExecuteOperation.promise(record);
10491
+ },
9940
10492
  beforeExecuteOperations: async (records) => {
9941
10493
  await this.hooks.beforeExecuteOperations.promise(records);
9942
10494
  },
@@ -9951,7 +10503,7 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
9951
10503
  terminal
9952
10504
  };
9953
10505
  terminal.write('Analyzing repo state... ');
9954
- const repoStateStopwatch = new _utilities_Stopwatch__WEBPACK_IMPORTED_MODULE_11__.Stopwatch();
10506
+ const repoStateStopwatch = new _utilities_Stopwatch__WEBPACK_IMPORTED_MODULE_12__.Stopwatch();
9955
10507
  repoStateStopwatch.start();
9956
10508
  await projectChangeAnalyzer._ensureInitializedAsync(terminal);
9957
10509
  repoStateStopwatch.stop();
@@ -9965,6 +10517,7 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
9965
10517
  }
9966
10518
  await this._runWatchPhases(internalOptions);
9967
10519
  }
10520
+ await (cobuildConfiguration === null || cobuildConfiguration === void 0 ? void 0 : cobuildConfiguration.disconnectLockProviderAsync());
9968
10521
  }
9969
10522
  async _runInitialPhases(options) {
9970
10523
  const { initialCreateOperationsContext, executionManagerOptions, stopwatch, terminal } = options;
@@ -10011,7 +10564,7 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
10011
10564
  while (true) {
10012
10565
  // On the initial invocation, this promise will return immediately with the full set of projects
10013
10566
  const { changedProjects, state } = await projectWatcher.waitForChange(onWaitingForChanges);
10014
- if (stopwatch.state === _utilities_Stopwatch__WEBPACK_IMPORTED_MODULE_11__.StopwatchState.Stopped) {
10567
+ if (stopwatch.state === _utilities_Stopwatch__WEBPACK_IMPORTED_MODULE_12__.StopwatchState.Stopped) {
10015
10568
  // Clear and reset the stopwatch so that we only report time from a single execution at a time
10016
10569
  stopwatch.reset();
10017
10570
  stopwatch.start();
@@ -10052,17 +10605,17 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
10052
10605
  async _executeOperations(options) {
10053
10606
  var _a;
10054
10607
  const { executionManagerOptions, ignoreHooks, operations, stopwatch, terminal } = options;
10055
- const executionManager = new _logic_operations_OperationExecutionManager__WEBPACK_IMPORTED_MODULE_15__.OperationExecutionManager(operations, executionManagerOptions);
10608
+ const executionManager = new _logic_operations_OperationExecutionManager__WEBPACK_IMPORTED_MODULE_17__.OperationExecutionManager(operations, executionManagerOptions);
10056
10609
  const { isInitial, isWatch } = options.createOperationsContext;
10057
10610
  let success = false;
10058
10611
  let result;
10059
10612
  try {
10060
10613
  result = await executionManager.executeAsync();
10061
- success = result.status === _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__.OperationStatus.Success;
10614
+ success = result.status === _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__.OperationStatus.Success;
10062
10615
  await this.hooks.afterExecuteOperations.promise(result, options.createOperationsContext);
10063
10616
  stopwatch.stop();
10064
10617
  const message = `rush ${this.actionName} (${stopwatch.toString()})`;
10065
- if (result.status === _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__.OperationStatus.Success) {
10618
+ if (result.status === _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__.OperationStatus.Success) {
10066
10619
  terminal.writeLine(colors_safe__WEBPACK_IMPORTED_MODULE_0___default().green(message));
10067
10620
  }
10068
10621
  else {
@@ -10130,25 +10683,25 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
10130
10683
  };
10131
10684
  extraData.countAll++;
10132
10685
  switch (operationResult.status) {
10133
- case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__.OperationStatus.Success:
10686
+ case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__.OperationStatus.Success:
10134
10687
  extraData.countSuccess++;
10135
10688
  break;
10136
- case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__.OperationStatus.SuccessWithWarning:
10689
+ case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__.OperationStatus.SuccessWithWarning:
10137
10690
  extraData.countSuccessWithWarnings++;
10138
10691
  break;
10139
- case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__.OperationStatus.Failure:
10692
+ case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__.OperationStatus.Failure:
10140
10693
  extraData.countFailure++;
10141
10694
  break;
10142
- case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__.OperationStatus.Blocked:
10695
+ case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__.OperationStatus.Blocked:
10143
10696
  extraData.countBlocked++;
10144
10697
  break;
10145
- case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__.OperationStatus.FromCache:
10698
+ case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__.OperationStatus.FromCache:
10146
10699
  extraData.countFromCache++;
10147
10700
  break;
10148
- case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__.OperationStatus.Skipped:
10701
+ case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__.OperationStatus.Skipped:
10149
10702
  extraData.countSkipped++;
10150
10703
  break;
10151
- case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_16__.OperationStatus.NoOp:
10704
+ case _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_18__.OperationStatus.NoOp:
10152
10705
  extraData.countNoOp++;
10153
10706
  break;
10154
10707
  default:
@@ -10176,8 +10729,8 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
10176
10729
  // Only collects information for built-in commands like build or rebuild.
10177
10730
  return;
10178
10731
  }
10179
- _logic_SetupChecks__WEBPACK_IMPORTED_MODULE_17__.SetupChecks.validate(this.rushConfiguration);
10180
- this.eventHooksManager.handle(_api_EventHooks__WEBPACK_IMPORTED_MODULE_18__.Event.preRushBuild, this.parser.isDebug, this._ignoreHooksParameter.value);
10732
+ _logic_SetupChecks__WEBPACK_IMPORTED_MODULE_19__.SetupChecks.validate(this.rushConfiguration);
10733
+ this.eventHooksManager.handle(_api_EventHooks__WEBPACK_IMPORTED_MODULE_20__.Event.preRushBuild, this.parser.isDebug, this._ignoreHooksParameter.value);
10181
10734
  }
10182
10735
  _doAfterTask() {
10183
10736
  if (this.actionName !== _logic_RushConstants__WEBPACK_IMPORTED_MODULE_3__.RushConstants.buildCommandName &&
@@ -10185,7 +10738,7 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
10185
10738
  // Only collects information for built-in commands like build or rebuild.
10186
10739
  return;
10187
10740
  }
10188
- this.eventHooksManager.handle(_api_EventHooks__WEBPACK_IMPORTED_MODULE_18__.Event.postRushBuild, this.parser.isDebug, this._ignoreHooksParameter.value);
10741
+ this.eventHooksManager.handle(_api_EventHooks__WEBPACK_IMPORTED_MODULE_20__.Event.postRushBuild, this.parser.isDebug, this._ignoreHooksParameter.value);
10189
10742
  }
10190
10743
  }
10191
10744
  //# sourceMappingURL=PhasedScriptAction.js.map
@@ -10200,51 +10753,53 @@ class PhasedScriptAction extends _BaseScriptAction__WEBPACK_IMPORTED_MODULE_2__.
10200
10753
 
10201
10754
  __webpack_require__.r(__webpack_exports__);
10202
10755
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10203
- /* harmony export */ "ApprovedPackagesConfiguration": () => (/* reexport safe */ _api_ApprovedPackagesConfiguration__WEBPACK_IMPORTED_MODULE_14__.ApprovedPackagesConfiguration),
10204
- /* harmony export */ "ApprovedPackagesItem": () => (/* reexport safe */ _api_ApprovedPackagesConfiguration__WEBPACK_IMPORTED_MODULE_14__.ApprovedPackagesItem),
10756
+ /* harmony export */ "ApprovedPackagesConfiguration": () => (/* reexport safe */ _api_ApprovedPackagesConfiguration__WEBPACK_IMPORTED_MODULE_15__.ApprovedPackagesConfiguration),
10757
+ /* harmony export */ "ApprovedPackagesItem": () => (/* reexport safe */ _api_ApprovedPackagesConfiguration__WEBPACK_IMPORTED_MODULE_15__.ApprovedPackagesItem),
10205
10758
  /* harmony export */ "ApprovedPackagesPolicy": () => (/* reexport safe */ _api_ApprovedPackagesPolicy__WEBPACK_IMPORTED_MODULE_0__.ApprovedPackagesPolicy),
10206
10759
  /* harmony export */ "BuildCacheConfiguration": () => (/* reexport safe */ _api_BuildCacheConfiguration__WEBPACK_IMPORTED_MODULE_6__.BuildCacheConfiguration),
10207
- /* harmony export */ "BumpType": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_22__.BumpType),
10208
- /* harmony export */ "ChangeManager": () => (/* reexport safe */ _api_ChangeManager__WEBPACK_IMPORTED_MODULE_20__.ChangeManager),
10209
- /* harmony export */ "CommonVersionsConfiguration": () => (/* reexport safe */ _api_CommonVersionsConfiguration__WEBPACK_IMPORTED_MODULE_15__.CommonVersionsConfiguration),
10210
- /* harmony export */ "CredentialCache": () => (/* reexport safe */ _logic_CredentialCache__WEBPACK_IMPORTED_MODULE_33__.CredentialCache),
10211
- /* harmony export */ "DependencyType": () => (/* reexport safe */ _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_16__.DependencyType),
10212
- /* harmony export */ "EnvironmentConfiguration": () => (/* reexport safe */ _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_8__.EnvironmentConfiguration),
10213
- /* harmony export */ "EnvironmentVariableNames": () => (/* reexport safe */ _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_8__.EnvironmentVariableNames),
10214
- /* harmony export */ "Event": () => (/* reexport safe */ _api_EventHooks__WEBPACK_IMPORTED_MODULE_19__.Event),
10215
- /* harmony export */ "EventHooks": () => (/* reexport safe */ _api_EventHooks__WEBPACK_IMPORTED_MODULE_19__.EventHooks),
10216
- /* harmony export */ "ExperimentsConfiguration": () => (/* reexport safe */ _api_ExperimentsConfiguration__WEBPACK_IMPORTED_MODULE_26__.ExperimentsConfiguration),
10217
- /* harmony export */ "FileSystemBuildCacheProvider": () => (/* reexport safe */ _logic_buildCache_FileSystemBuildCacheProvider__WEBPACK_IMPORTED_MODULE_7__.FileSystemBuildCacheProvider),
10218
- /* harmony export */ "IndividualVersionPolicy": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_22__.IndividualVersionPolicy),
10219
- /* harmony export */ "LockStepVersionPolicy": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_22__.LockStepVersionPolicy),
10220
- /* harmony export */ "LookupByPath": () => (/* reexport safe */ _logic_LookupByPath__WEBPACK_IMPORTED_MODULE_18__.LookupByPath),
10760
+ /* harmony export */ "BumpType": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_24__.BumpType),
10761
+ /* harmony export */ "ChangeManager": () => (/* reexport safe */ _api_ChangeManager__WEBPACK_IMPORTED_MODULE_21__.ChangeManager),
10762
+ /* harmony export */ "CobuildConfiguration": () => (/* reexport safe */ _api_CobuildConfiguration__WEBPACK_IMPORTED_MODULE_7__.CobuildConfiguration),
10763
+ /* harmony export */ "CommonVersionsConfiguration": () => (/* reexport safe */ _api_CommonVersionsConfiguration__WEBPACK_IMPORTED_MODULE_16__.CommonVersionsConfiguration),
10764
+ /* harmony export */ "CredentialCache": () => (/* reexport safe */ _logic_CredentialCache__WEBPACK_IMPORTED_MODULE_35__.CredentialCache),
10765
+ /* harmony export */ "DependencyType": () => (/* reexport safe */ _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_17__.DependencyType),
10766
+ /* harmony export */ "EnvironmentConfiguration": () => (/* reexport safe */ _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_9__.EnvironmentConfiguration),
10767
+ /* harmony export */ "EnvironmentVariableNames": () => (/* reexport safe */ _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_9__.EnvironmentVariableNames),
10768
+ /* harmony export */ "Event": () => (/* reexport safe */ _api_EventHooks__WEBPACK_IMPORTED_MODULE_20__.Event),
10769
+ /* harmony export */ "EventHooks": () => (/* reexport safe */ _api_EventHooks__WEBPACK_IMPORTED_MODULE_20__.EventHooks),
10770
+ /* harmony export */ "ExperimentsConfiguration": () => (/* reexport safe */ _api_ExperimentsConfiguration__WEBPACK_IMPORTED_MODULE_28__.ExperimentsConfiguration),
10771
+ /* harmony export */ "FileSystemBuildCacheProvider": () => (/* reexport safe */ _logic_buildCache_FileSystemBuildCacheProvider__WEBPACK_IMPORTED_MODULE_8__.FileSystemBuildCacheProvider),
10772
+ /* harmony export */ "IndividualVersionPolicy": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_24__.IndividualVersionPolicy),
10773
+ /* harmony export */ "LockStepVersionPolicy": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_24__.LockStepVersionPolicy),
10774
+ /* harmony export */ "LookupByPath": () => (/* reexport safe */ _logic_LookupByPath__WEBPACK_IMPORTED_MODULE_19__.LookupByPath),
10221
10775
  /* harmony export */ "NpmOptionsConfiguration": () => (/* reexport safe */ _logic_npm_NpmOptionsConfiguration__WEBPACK_IMPORTED_MODULE_3__.NpmOptionsConfiguration),
10222
- /* harmony export */ "Operation": () => (/* reexport safe */ _logic_operations_Operation__WEBPACK_IMPORTED_MODULE_28__.Operation),
10223
- /* harmony export */ "OperationStatus": () => (/* reexport safe */ _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_29__.OperationStatus),
10224
- /* harmony export */ "PackageJsonDependency": () => (/* reexport safe */ _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_16__.PackageJsonDependency),
10225
- /* harmony export */ "PackageJsonEditor": () => (/* reexport safe */ _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_16__.PackageJsonEditor),
10226
- /* harmony export */ "PackageManager": () => (/* reexport safe */ _api_packageManager_PackageManager__WEBPACK_IMPORTED_MODULE_10__.PackageManager),
10776
+ /* harmony export */ "Operation": () => (/* reexport safe */ _logic_operations_Operation__WEBPACK_IMPORTED_MODULE_30__.Operation),
10777
+ /* harmony export */ "OperationStatus": () => (/* reexport safe */ _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_31__.OperationStatus),
10778
+ /* harmony export */ "PackageJsonDependency": () => (/* reexport safe */ _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_17__.PackageJsonDependency),
10779
+ /* harmony export */ "PackageJsonEditor": () => (/* reexport safe */ _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_17__.PackageJsonEditor),
10780
+ /* harmony export */ "PackageManager": () => (/* reexport safe */ _api_packageManager_PackageManager__WEBPACK_IMPORTED_MODULE_11__.PackageManager),
10227
10781
  /* harmony export */ "PackageManagerOptionsConfigurationBase": () => (/* reexport safe */ _logic_base_BasePackageManagerOptionsConfiguration__WEBPACK_IMPORTED_MODULE_2__.PackageManagerOptionsConfigurationBase),
10228
- /* harmony export */ "PhasedCommandHooks": () => (/* reexport safe */ _pluginFramework_PhasedCommandHooks__WEBPACK_IMPORTED_MODULE_32__.PhasedCommandHooks),
10782
+ /* harmony export */ "PhasedCommandHooks": () => (/* reexport safe */ _pluginFramework_PhasedCommandHooks__WEBPACK_IMPORTED_MODULE_34__.PhasedCommandHooks),
10229
10783
  /* harmony export */ "PnpmOptionsConfiguration": () => (/* reexport safe */ _logic_pnpm_PnpmOptionsConfiguration__WEBPACK_IMPORTED_MODULE_5__.PnpmOptionsConfiguration),
10230
- /* harmony export */ "ProjectChangeAnalyzer": () => (/* reexport safe */ _logic_ProjectChangeAnalyzer__WEBPACK_IMPORTED_MODULE_27__.ProjectChangeAnalyzer),
10231
- /* harmony export */ "RepoStateFile": () => (/* reexport safe */ _logic_RepoStateFile__WEBPACK_IMPORTED_MODULE_17__.RepoStateFile),
10232
- /* harmony export */ "Rush": () => (/* reexport safe */ _api_Rush__WEBPACK_IMPORTED_MODULE_24__.Rush),
10784
+ /* harmony export */ "ProjectChangeAnalyzer": () => (/* reexport safe */ _logic_ProjectChangeAnalyzer__WEBPACK_IMPORTED_MODULE_29__.ProjectChangeAnalyzer),
10785
+ /* harmony export */ "RepoStateFile": () => (/* reexport safe */ _logic_RepoStateFile__WEBPACK_IMPORTED_MODULE_18__.RepoStateFile),
10786
+ /* harmony export */ "Rush": () => (/* reexport safe */ _api_Rush__WEBPACK_IMPORTED_MODULE_26__.Rush),
10233
10787
  /* harmony export */ "RushConfiguration": () => (/* reexport safe */ _api_RushConfiguration__WEBPACK_IMPORTED_MODULE_1__.RushConfiguration),
10234
- /* harmony export */ "RushConfigurationProject": () => (/* reexport safe */ _api_RushConfigurationProject__WEBPACK_IMPORTED_MODULE_11__.RushConfigurationProject),
10235
- /* harmony export */ "RushConstants": () => (/* reexport safe */ _logic_RushConstants__WEBPACK_IMPORTED_MODULE_9__.RushConstants),
10236
- /* harmony export */ "RushLifecycleHooks": () => (/* reexport safe */ _pluginFramework_RushLifeCycle__WEBPACK_IMPORTED_MODULE_31__.RushLifecycleHooks),
10237
- /* harmony export */ "RushSession": () => (/* reexport safe */ _pluginFramework_RushSession__WEBPACK_IMPORTED_MODULE_30__.RushSession),
10238
- /* harmony export */ "RushUserConfiguration": () => (/* reexport safe */ _api_RushUserConfiguration__WEBPACK_IMPORTED_MODULE_12__.RushUserConfiguration),
10239
- /* harmony export */ "VersionPolicy": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_22__.VersionPolicy),
10240
- /* harmony export */ "VersionPolicyConfiguration": () => (/* reexport safe */ _api_VersionPolicyConfiguration__WEBPACK_IMPORTED_MODULE_23__.VersionPolicyConfiguration),
10241
- /* harmony export */ "VersionPolicyDefinitionName": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_22__.VersionPolicyDefinitionName),
10788
+ /* harmony export */ "RushConfigurationProject": () => (/* reexport safe */ _api_RushConfigurationProject__WEBPACK_IMPORTED_MODULE_12__.RushConfigurationProject),
10789
+ /* harmony export */ "RushConstants": () => (/* reexport safe */ _logic_RushConstants__WEBPACK_IMPORTED_MODULE_10__.RushConstants),
10790
+ /* harmony export */ "RushLifecycleHooks": () => (/* reexport safe */ _pluginFramework_RushLifeCycle__WEBPACK_IMPORTED_MODULE_33__.RushLifecycleHooks),
10791
+ /* harmony export */ "RushSession": () => (/* reexport safe */ _pluginFramework_RushSession__WEBPACK_IMPORTED_MODULE_32__.RushSession),
10792
+ /* harmony export */ "RushUserConfiguration": () => (/* reexport safe */ _api_RushUserConfiguration__WEBPACK_IMPORTED_MODULE_13__.RushUserConfiguration),
10793
+ /* harmony export */ "VersionPolicy": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_24__.VersionPolicy),
10794
+ /* harmony export */ "VersionPolicyConfiguration": () => (/* reexport safe */ _api_VersionPolicyConfiguration__WEBPACK_IMPORTED_MODULE_25__.VersionPolicyConfiguration),
10795
+ /* harmony export */ "VersionPolicyDefinitionName": () => (/* reexport safe */ _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_24__.VersionPolicyDefinitionName),
10242
10796
  /* harmony export */ "YarnOptionsConfiguration": () => (/* reexport safe */ _logic_yarn_YarnOptionsConfiguration__WEBPACK_IMPORTED_MODULE_4__.YarnOptionsConfiguration),
10243
- /* harmony export */ "_LastInstallFlag": () => (/* reexport safe */ _api_LastInstallFlag__WEBPACK_IMPORTED_MODULE_21__.LastInstallFlag),
10244
- /* harmony export */ "_OperationMetadataManager": () => (/* reexport safe */ _logic_operations_OperationMetadataManager__WEBPACK_IMPORTED_MODULE_35__.OperationMetadataManager),
10245
- /* harmony export */ "_OperationStateFile": () => (/* reexport safe */ _logic_operations_OperationStateFile__WEBPACK_IMPORTED_MODULE_34__.OperationStateFile),
10246
- /* harmony export */ "_RushGlobalFolder": () => (/* reexport safe */ _api_RushGlobalFolder__WEBPACK_IMPORTED_MODULE_13__.RushGlobalFolder),
10247
- /* harmony export */ "_RushInternals": () => (/* reexport safe */ _api_RushInternals__WEBPACK_IMPORTED_MODULE_25__.RushInternals)
10797
+ /* harmony export */ "_BaseFlag": () => (/* reexport safe */ _api_base_BaseFlag__WEBPACK_IMPORTED_MODULE_23__.BaseFlag),
10798
+ /* harmony export */ "_LastInstallFlag": () => (/* reexport safe */ _api_LastInstallFlag__WEBPACK_IMPORTED_MODULE_22__.LastInstallFlag),
10799
+ /* harmony export */ "_OperationMetadataManager": () => (/* reexport safe */ _logic_operations_OperationMetadataManager__WEBPACK_IMPORTED_MODULE_37__.OperationMetadataManager),
10800
+ /* harmony export */ "_OperationStateFile": () => (/* reexport safe */ _logic_operations_OperationStateFile__WEBPACK_IMPORTED_MODULE_36__.OperationStateFile),
10801
+ /* harmony export */ "_RushGlobalFolder": () => (/* reexport safe */ _api_RushGlobalFolder__WEBPACK_IMPORTED_MODULE_14__.RushGlobalFolder),
10802
+ /* harmony export */ "_RushInternals": () => (/* reexport safe */ _api_RushInternals__WEBPACK_IMPORTED_MODULE_27__.RushInternals)
10248
10803
  /* harmony export */ });
10249
10804
  /* harmony import */ var _api_ApprovedPackagesPolicy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./api/ApprovedPackagesPolicy */ 986096);
10250
10805
  /* harmony import */ var _api_RushConfiguration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./api/RushConfiguration */ 126002);
@@ -10253,35 +10808,37 @@ __webpack_require__.r(__webpack_exports__);
10253
10808
  /* harmony import */ var _logic_yarn_YarnOptionsConfiguration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./logic/yarn/YarnOptionsConfiguration */ 17314);
10254
10809
  /* harmony import */ var _logic_pnpm_PnpmOptionsConfiguration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./logic/pnpm/PnpmOptionsConfiguration */ 402835);
10255
10810
  /* harmony import */ var _api_BuildCacheConfiguration__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./api/BuildCacheConfiguration */ 541976);
10256
- /* harmony import */ var _logic_buildCache_FileSystemBuildCacheProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./logic/buildCache/FileSystemBuildCacheProvider */ 339043);
10257
- /* harmony import */ var _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./api/EnvironmentConfiguration */ 382806);
10258
- /* harmony import */ var _logic_RushConstants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./logic/RushConstants */ 951904);
10259
- /* harmony import */ var _api_packageManager_PackageManager__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./api/packageManager/PackageManager */ 923109);
10260
- /* harmony import */ var _api_RushConfigurationProject__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./api/RushConfigurationProject */ 900491);
10261
- /* harmony import */ var _api_RushUserConfiguration__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./api/RushUserConfiguration */ 354981);
10262
- /* harmony import */ var _api_RushGlobalFolder__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./api/RushGlobalFolder */ 164409);
10263
- /* harmony import */ var _api_ApprovedPackagesConfiguration__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./api/ApprovedPackagesConfiguration */ 589083);
10264
- /* harmony import */ var _api_CommonVersionsConfiguration__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./api/CommonVersionsConfiguration */ 989216);
10265
- /* harmony import */ var _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./api/PackageJsonEditor */ 73666);
10266
- /* harmony import */ var _logic_RepoStateFile__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./logic/RepoStateFile */ 880175);
10267
- /* harmony import */ var _logic_LookupByPath__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./logic/LookupByPath */ 590211);
10268
- /* harmony import */ var _api_EventHooks__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./api/EventHooks */ 519005);
10269
- /* harmony import */ var _api_ChangeManager__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./api/ChangeManager */ 714304);
10270
- /* harmony import */ var _api_LastInstallFlag__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./api/LastInstallFlag */ 919846);
10271
- /* harmony import */ var _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./api/VersionPolicy */ 734331);
10272
- /* harmony import */ var _api_VersionPolicyConfiguration__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./api/VersionPolicyConfiguration */ 904624);
10273
- /* harmony import */ var _api_Rush__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./api/Rush */ 465002);
10274
- /* harmony import */ var _api_RushInternals__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./api/RushInternals */ 882917);
10275
- /* harmony import */ var _api_ExperimentsConfiguration__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./api/ExperimentsConfiguration */ 259205);
10276
- /* harmony import */ var _logic_ProjectChangeAnalyzer__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./logic/ProjectChangeAnalyzer */ 311605);
10277
- /* harmony import */ var _logic_operations_Operation__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./logic/operations/Operation */ 768667);
10278
- /* harmony import */ var _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./logic/operations/OperationStatus */ 476597);
10279
- /* harmony import */ var _pluginFramework_RushSession__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./pluginFramework/RushSession */ 964818);
10280
- /* harmony import */ var _pluginFramework_RushLifeCycle__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pluginFramework/RushLifeCycle */ 804876);
10281
- /* harmony import */ var _pluginFramework_PhasedCommandHooks__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pluginFramework/PhasedCommandHooks */ 580814);
10282
- /* harmony import */ var _logic_CredentialCache__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./logic/CredentialCache */ 963954);
10283
- /* harmony import */ var _logic_operations_OperationStateFile__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./logic/operations/OperationStateFile */ 600463);
10284
- /* harmony import */ var _logic_operations_OperationMetadataManager__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./logic/operations/OperationMetadataManager */ 441895);
10811
+ /* harmony import */ var _api_CobuildConfiguration__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./api/CobuildConfiguration */ 13111);
10812
+ /* harmony import */ var _logic_buildCache_FileSystemBuildCacheProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./logic/buildCache/FileSystemBuildCacheProvider */ 339043);
10813
+ /* harmony import */ var _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./api/EnvironmentConfiguration */ 382806);
10814
+ /* harmony import */ var _logic_RushConstants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./logic/RushConstants */ 951904);
10815
+ /* harmony import */ var _api_packageManager_PackageManager__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./api/packageManager/PackageManager */ 923109);
10816
+ /* harmony import */ var _api_RushConfigurationProject__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./api/RushConfigurationProject */ 900491);
10817
+ /* harmony import */ var _api_RushUserConfiguration__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./api/RushUserConfiguration */ 354981);
10818
+ /* harmony import */ var _api_RushGlobalFolder__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./api/RushGlobalFolder */ 164409);
10819
+ /* harmony import */ var _api_ApprovedPackagesConfiguration__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./api/ApprovedPackagesConfiguration */ 589083);
10820
+ /* harmony import */ var _api_CommonVersionsConfiguration__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./api/CommonVersionsConfiguration */ 989216);
10821
+ /* harmony import */ var _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./api/PackageJsonEditor */ 73666);
10822
+ /* harmony import */ var _logic_RepoStateFile__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./logic/RepoStateFile */ 880175);
10823
+ /* harmony import */ var _logic_LookupByPath__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./logic/LookupByPath */ 590211);
10824
+ /* harmony import */ var _api_EventHooks__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./api/EventHooks */ 519005);
10825
+ /* harmony import */ var _api_ChangeManager__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./api/ChangeManager */ 714304);
10826
+ /* harmony import */ var _api_LastInstallFlag__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./api/LastInstallFlag */ 919846);
10827
+ /* harmony import */ var _api_base_BaseFlag__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./api/base/BaseFlag */ 192765);
10828
+ /* harmony import */ var _api_VersionPolicy__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./api/VersionPolicy */ 734331);
10829
+ /* harmony import */ var _api_VersionPolicyConfiguration__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./api/VersionPolicyConfiguration */ 904624);
10830
+ /* harmony import */ var _api_Rush__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./api/Rush */ 465002);
10831
+ /* harmony import */ var _api_RushInternals__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./api/RushInternals */ 882917);
10832
+ /* harmony import */ var _api_ExperimentsConfiguration__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./api/ExperimentsConfiguration */ 259205);
10833
+ /* harmony import */ var _logic_ProjectChangeAnalyzer__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./logic/ProjectChangeAnalyzer */ 311605);
10834
+ /* harmony import */ var _logic_operations_Operation__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./logic/operations/Operation */ 768667);
10835
+ /* harmony import */ var _logic_operations_OperationStatus__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./logic/operations/OperationStatus */ 476597);
10836
+ /* harmony import */ var _pluginFramework_RushSession__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pluginFramework/RushSession */ 964818);
10837
+ /* harmony import */ var _pluginFramework_RushLifeCycle__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./pluginFramework/RushLifeCycle */ 804876);
10838
+ /* harmony import */ var _pluginFramework_PhasedCommandHooks__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pluginFramework/PhasedCommandHooks */ 580814);
10839
+ /* harmony import */ var _logic_CredentialCache__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./logic/CredentialCache */ 963954);
10840
+ /* harmony import */ var _logic_operations_OperationStateFile__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./logic/operations/OperationStateFile */ 600463);
10841
+ /* harmony import */ var _logic_operations_OperationMetadataManager__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./logic/operations/OperationMetadataManager */ 441895);
10285
10842
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
10286
10843
  // See LICENSE in the project root for license information.
10287
10844
  /**
@@ -10321,6 +10878,8 @@ __webpack_require__.r(__webpack_exports__);
10321
10878
 
10322
10879
 
10323
10880
 
10881
+
10882
+
10324
10883
 
10325
10884
 
10326
10885
 
@@ -11172,6 +11731,9 @@ class DependencyAnalyzer {
11172
11731
  const allVersionsByPackageName = new Map();
11173
11732
  const allowedAlternativeVersions = commonVersionsConfiguration.allowedAlternativeVersions;
11174
11733
  for (const project of this._rushConfiguration.projects) {
11734
+ if (project.splitWorkspace) {
11735
+ continue;
11736
+ }
11175
11737
  const dependencies = [
11176
11738
  ...project.packageJsonEditor.dependencyList,
11177
11739
  ...project.packageJsonEditor.devDependencyList
@@ -12944,18 +13506,18 @@ class ProjectChangeAnalyzer {
12944
13506
  // Include project shrinkwrap files as part of the computation
12945
13507
  const additionalFilesToHash = [];
12946
13508
  if (this._rushConfiguration.packageManager === 'pnpm') {
12947
- const absoluteFilePathsToCheck = [];
12948
- for (const project of this._rushConfiguration.projects) {
13509
+ await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.Async.forEachAsync(this._rushConfiguration.projects, async (project) => {
12949
13510
  const projectShrinkwrapFilePath = _base_BaseProjectShrinkwrapFile__WEBPACK_IMPORTED_MODULE_10__.BaseProjectShrinkwrapFile.getFilePathForProject(project);
12950
- absoluteFilePathsToCheck.push(projectShrinkwrapFilePath);
12951
- const relativeProjectShrinkwrapFilePath = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.Path.convertToSlashes(path__WEBPACK_IMPORTED_MODULE_0__.relative(rootDir, projectShrinkwrapFilePath));
12952
- additionalFilesToHash.push(relativeProjectShrinkwrapFilePath);
12953
- }
12954
- await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.Async.forEachAsync(absoluteFilePathsToCheck, async (filePath) => {
12955
- if (!(await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.FileSystem.existsAsync(filePath))) {
12956
- throw new Error(`A project dependency file (${filePath}) is missing. You may need to run ` +
13511
+ if (!(await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.FileSystem.existsAsync(projectShrinkwrapFilePath))) {
13512
+ // Missing shrinkwrap of split workspace project is allowed because split workspace project can be partial installed
13513
+ if (project.splitWorkspace) {
13514
+ return;
13515
+ }
13516
+ throw new Error(`A project dependency file (${projectShrinkwrapFilePath}) is missing. You may need to run ` +
12957
13517
  '"rush install" or "rush update".');
12958
13518
  }
13519
+ const relativeProjectShrinkwrapFilePath = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.Path.convertToSlashes(path__WEBPACK_IMPORTED_MODULE_0__.relative(rootDir, projectShrinkwrapFilePath));
13520
+ additionalFilesToHash.push(relativeProjectShrinkwrapFilePath);
12959
13521
  });
12960
13522
  }
12961
13523
  const hashes = await (0,_rushstack_package_deps_hash__WEBPACK_IMPORTED_MODULE_3__.getRepoStateAsync)(rootDir, additionalFilesToHash, gitPath);
@@ -13661,29 +14223,26 @@ class PublishUtilities {
13661
14223
  const requiredVersion = new _DependencySpecifier__WEBPACK_IMPORTED_MODULE_7__.DependencySpecifier(change.packageName, dependencies[change.packageName]);
13662
14224
  const isWorkspaceWildcardVersion = requiredVersion.specifierType === _DependencySpecifier__WEBPACK_IMPORTED_MODULE_7__.DependencySpecifierType.Workspace &&
13663
14225
  requiredVersion.versionSpecifier === '*';
13664
- const alwaysUpdate = (!!prereleaseToken &&
13665
- prereleaseToken.hasValue &&
13666
- !allChanges.packageChanges.has(parentPackageName)) ||
13667
- isWorkspaceWildcardVersion;
14226
+ const isPrerelease = !!prereleaseToken && prereleaseToken.hasValue && !allChanges.packageChanges.has(parentPackageName);
13668
14227
  // If the version range exists and has not yet been updated to this version, update it.
13669
- if (requiredVersion.versionSpecifier !== change.newRangeDependency || alwaysUpdate) {
14228
+ if (isPrerelease ||
14229
+ isWorkspaceWildcardVersion ||
14230
+ requiredVersion.versionSpecifier !== change.newRangeDependency) {
13670
14231
  let changeType;
13671
- if (changeType === undefined) {
13672
- // Propagate hotfix changes to dependencies
13673
- if (change.changeType === _api_ChangeManagement__WEBPACK_IMPORTED_MODULE_5__.ChangeType.hotfix) {
13674
- changeType = _api_ChangeManagement__WEBPACK_IMPORTED_MODULE_5__.ChangeType.hotfix;
13675
- }
13676
- else {
13677
- // Either it already satisfies the new version, or doesn't.
13678
- // If not, the downstream dep needs to be republished.
13679
- // The downstream dep will also need to be republished if using `workspace:*` as this will publish
13680
- // as the exact version.
13681
- changeType =
13682
- semver__WEBPACK_IMPORTED_MODULE_1__.satisfies(change.newVersion, requiredVersion.versionSpecifier) &&
13683
- !isWorkspaceWildcardVersion
13684
- ? _api_ChangeManagement__WEBPACK_IMPORTED_MODULE_5__.ChangeType.dependency
13685
- : _api_ChangeManagement__WEBPACK_IMPORTED_MODULE_5__.ChangeType.patch;
13686
- }
14232
+ // Propagate hotfix changes to dependencies
14233
+ if (change.changeType === _api_ChangeManagement__WEBPACK_IMPORTED_MODULE_5__.ChangeType.hotfix) {
14234
+ changeType = _api_ChangeManagement__WEBPACK_IMPORTED_MODULE_5__.ChangeType.hotfix;
14235
+ }
14236
+ else {
14237
+ // Either it already satisfies the new version, or doesn't.
14238
+ // If not, the downstream dep needs to be republished.
14239
+ // The downstream dep will also need to be republished if using `workspace:*` as this will publish
14240
+ // as the exact version.
14241
+ changeType =
14242
+ !isWorkspaceWildcardVersion &&
14243
+ semver__WEBPACK_IMPORTED_MODULE_1__.satisfies(change.newVersion, requiredVersion.versionSpecifier)
14244
+ ? _api_ChangeManagement__WEBPACK_IMPORTED_MODULE_5__.ChangeType.dependency
14245
+ : _api_ChangeManagement__WEBPACK_IMPORTED_MODULE_5__.ChangeType.patch;
13687
14246
  }
13688
14247
  hasChanges = PublishUtilities._addChange({
13689
14248
  change: {
@@ -13696,7 +14255,7 @@ class PublishUtilities {
13696
14255
  prereleaseToken,
13697
14256
  projectsToExclude
13698
14257
  });
13699
- if (hasChanges || alwaysUpdate) {
14258
+ if (hasChanges || isPrerelease) {
13700
14259
  // Only re-evaluate downstream dependencies if updating the parent package's dependency
13701
14260
  // caused a version bump.
13702
14261
  hasChanges =
@@ -13775,6 +14334,8 @@ class PurgeManager {
13775
14334
  this._rushGlobalFolder = rushGlobalFolder;
13776
14335
  const commonAsyncRecyclerPath = path__WEBPACK_IMPORTED_MODULE_1__.join(this._rushConfiguration.commonTempFolder, _logic_RushConstants__WEBPACK_IMPORTED_MODULE_2__.RushConstants.rushRecyclerFolderName);
13777
14336
  this.commonTempFolderRecycler = new _utilities_AsyncRecycler__WEBPACK_IMPORTED_MODULE_3__.AsyncRecycler(commonAsyncRecyclerPath);
14337
+ const commonSplitAsyncRecyclerPath = path__WEBPACK_IMPORTED_MODULE_1__.join(this._rushConfiguration.commonTempSplitFolder, _logic_RushConstants__WEBPACK_IMPORTED_MODULE_2__.RushConstants.rushRecyclerFolderName);
14338
+ this.commonTempSplitFolderRecycler = new _utilities_AsyncRecycler__WEBPACK_IMPORTED_MODULE_3__.AsyncRecycler(commonSplitAsyncRecyclerPath);
13778
14339
  const rushUserAsyncRecyclerPath = path__WEBPACK_IMPORTED_MODULE_1__.join(this._rushGlobalFolder.path, _logic_RushConstants__WEBPACK_IMPORTED_MODULE_2__.RushConstants.rushRecyclerFolderName);
13779
14340
  this._rushUserFolderRecycler = new _utilities_AsyncRecycler__WEBPACK_IMPORTED_MODULE_3__.AsyncRecycler(rushUserAsyncRecyclerPath);
13780
14341
  }
@@ -13784,6 +14345,7 @@ class PurgeManager {
13784
14345
  */
13785
14346
  deleteAll() {
13786
14347
  this.commonTempFolderRecycler.deleteAll();
14348
+ this.commonTempSplitFolderRecycler.deleteAll();
13787
14349
  this._rushUserFolderRecycler.deleteAll();
13788
14350
  }
13789
14351
  /**
@@ -13793,6 +14355,7 @@ class PurgeManager {
13793
14355
  // Delete everything under common\temp except for the recycler folder itself
13794
14356
  console.log('Purging ' + this._rushConfiguration.commonTempFolder);
13795
14357
  this.commonTempFolderRecycler.moveAllItemsInFolder(this._rushConfiguration.commonTempFolder, this._getMembersToExclude(this._rushConfiguration.commonTempFolder, true));
14358
+ this.commonTempSplitFolderRecycler.moveAllItemsInFolder(this._rushConfiguration.commonTempSplitFolder, this._getMembersToExclude(this._rushConfiguration.commonTempFolder, true));
13796
14359
  }
13797
14360
  /**
13798
14361
  * In addition to performing the purgeNormal() operation, this method also cleans the
@@ -14075,6 +14638,12 @@ RushConstants.rushTempNpmScope = '@rush-temp';
14075
14638
  * Example: `C:\MyRepo\common\temp`
14076
14639
  */
14077
14640
  RushConstants.rushTempFolderName = 'temp';
14641
+ /**
14642
+ * The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
14643
+ * temporary files will be stored.
14644
+ * Example: `C:\MyRepo\common\temp-split`
14645
+ */
14646
+ RushConstants.rushTempSplitFolderName = 'temp-split';
14078
14647
  /**
14079
14648
  * The folder name ("projects") where temporary projects will be stored.
14080
14649
  * Example: `C:\MyRepo\common\temp\projects`
@@ -14182,6 +14751,15 @@ RushConstants.buildCacheFilename = 'build-cache.json';
14182
14751
  * Changing this ensures that cache entries generated by an old version will no longer register as a cache hit.
14183
14752
  */
14184
14753
  RushConstants.buildCacheVersion = 1;
14754
+ /**
14755
+ * Cobuild configuration file.
14756
+ */
14757
+ RushConstants.cobuildFilename = 'cobuild.json';
14758
+ /**
14759
+ * Cobuild version number, incremented when the logic to create cobuild lock changes.
14760
+ * Changing this ensures that lock generated by an old version will no longer access as a cobuild lock.
14761
+ */
14762
+ RushConstants.cobuildLockVersion = 1;
14185
14763
  /**
14186
14764
  * Per-project configuration filename.
14187
14765
  */
@@ -14422,7 +15000,8 @@ class SetupChecks {
14422
15000
  `, but NPM ${MINIMUM_SUPPORTED_NPM_VERSION} is the minimum supported by Rush.`);
14423
15001
  }
14424
15002
  }
14425
- SetupChecks._checkForPhantomFolders(rushConfiguration);
15003
+ // To avoid confusion, suppress phantom dependencies warning
15004
+ // SetupChecks._checkForPhantomFolders(rushConfiguration);
14426
15005
  }
14427
15006
  static _checkForPhantomFolders(rushConfiguration) {
14428
15007
  const phantomFolders = [];
@@ -15371,8 +15950,8 @@ __webpack_require__.r(__webpack_exports__);
15371
15950
 
15372
15951
  class ProjectBuildCache {
15373
15952
  constructor(cacheId, options) {
15374
- const { buildCacheConfiguration, projectConfiguration, projectOutputFolderNames, additionalProjectOutputFilePaths } = options;
15375
- this._project = projectConfiguration.project;
15953
+ const { buildCacheConfiguration, project, projectOutputFolderNames, additionalProjectOutputFilePaths } = options;
15954
+ this._project = project;
15376
15955
  this._localBuildCacheProvider = buildCacheConfiguration.localCacheProvider;
15377
15956
  this._cloudBuildCacheProvider = buildCacheConfiguration.cloudCacheProvider;
15378
15957
  this._buildCacheEnabled = buildCacheConfiguration.buildCacheEnabled;
@@ -15387,19 +15966,22 @@ class ProjectBuildCache {
15387
15966
  }
15388
15967
  return ProjectBuildCache._tarUtilityPromise;
15389
15968
  }
15969
+ get cacheId() {
15970
+ return this._cacheId;
15971
+ }
15390
15972
  static async tryGetProjectBuildCache(options) {
15391
- const { terminal, projectConfiguration, projectOutputFolderNames, trackedProjectFiles } = options;
15973
+ const { terminal, project, projectOutputFolderNames, trackedProjectFiles } = options;
15392
15974
  if (!trackedProjectFiles) {
15393
15975
  return undefined;
15394
15976
  }
15395
- if (!ProjectBuildCache._validateProject(terminal, projectConfiguration, projectOutputFolderNames, trackedProjectFiles)) {
15977
+ if (!ProjectBuildCache._validateProject(terminal, project, projectOutputFolderNames, trackedProjectFiles)) {
15396
15978
  return undefined;
15397
15979
  }
15398
15980
  const cacheId = await ProjectBuildCache._getCacheId(options);
15399
15981
  return new ProjectBuildCache(cacheId, options);
15400
15982
  }
15401
- static _validateProject(terminal, projectConfiguration, projectOutputFolderNames, trackedProjectFiles) {
15402
- const normalizedProjectRelativeFolder = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.Path.convertToSlashes(projectConfiguration.project.projectRelativeFolder);
15983
+ static _validateProject(terminal, project, projectOutputFolderNames, trackedProjectFiles) {
15984
+ const normalizedProjectRelativeFolder = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.Path.convertToSlashes(project.projectRelativeFolder);
15403
15985
  const outputFolders = [];
15404
15986
  if (projectOutputFolderNames) {
15405
15987
  for (const outputFolderName of projectOutputFolderNames) {
@@ -15423,8 +16005,8 @@ class ProjectBuildCache {
15423
16005
  return true;
15424
16006
  }
15425
16007
  }
15426
- async tryRestoreFromCacheAsync(terminal) {
15427
- const cacheId = this._cacheId;
16008
+ async tryRestoreFromCacheAsync(terminal, specifiedCacheId) {
16009
+ const cacheId = specifiedCacheId || this._cacheId;
15428
16010
  if (!cacheId) {
15429
16011
  terminal.writeWarningLine('Unable to get cache ID. Ensure Git is installed.');
15430
16012
  return false;
@@ -15480,13 +16062,13 @@ class ProjectBuildCache {
15480
16062
  }
15481
16063
  return restoreSuccess;
15482
16064
  }
15483
- async trySetCacheEntryAsync(terminal) {
16065
+ async trySetCacheEntryAsync(terminal, specifiedCacheId) {
15484
16066
  var _a, _b, _c;
15485
16067
  if (!this._cacheWriteEnabled) {
15486
16068
  // Skip writing local and cloud build caches, without any noise
15487
16069
  return true;
15488
16070
  }
15489
- const cacheId = this._cacheId;
16071
+ const cacheId = specifiedCacheId || this._cacheId;
15490
16072
  if (!cacheId) {
15491
16073
  terminal.writeWarningLine('Unable to get cache ID. Ensure Git is installed.');
15492
16074
  return false;
@@ -15663,7 +16245,7 @@ class ProjectBuildCache {
15663
16245
  const projectStates = [];
15664
16246
  const projectsThatHaveBeenProcessed = new Set();
15665
16247
  let projectsToProcess = new Set();
15666
- projectsToProcess.add(options.projectConfiguration.project);
16248
+ projectsToProcess.add(options.project);
15667
16249
  while (projectsToProcess.size > 0) {
15668
16250
  const newProjectsToProcess = new Set();
15669
16251
  for (const projectToProcess of projectsToProcess) {
@@ -15712,7 +16294,7 @@ class ProjectBuildCache {
15712
16294
  }
15713
16295
  const projectStateHash = hash.digest('hex');
15714
16296
  return options.buildCacheConfiguration.getCacheEntryId({
15715
- projectName: options.projectConfiguration.project.packageName,
16297
+ projectName: options.project.packageName,
15716
16298
  projectStateHash,
15717
16299
  phaseName: options.phaseName
15718
16300
  });
@@ -15828,6 +16410,66 @@ async function getHashesForGlobsAsync(globPatterns, packagePath, repoState) {
15828
16410
 
15829
16411
  /***/ }),
15830
16412
 
16413
+ /***/ 676896:
16414
+ /*!*************************************************!*\
16415
+ !*** ./lib-esnext/logic/cobuild/CobuildLock.js ***!
16416
+ \*************************************************/
16417
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16418
+
16419
+ __webpack_require__.r(__webpack_exports__);
16420
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16421
+ /* harmony export */ "CobuildLock": () => (/* binding */ CobuildLock)
16422
+ /* harmony export */ });
16423
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
16424
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__);
16425
+ /* harmony import */ var _RushConstants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../RushConstants */ 951904);
16426
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
16427
+ // See LICENSE in the project root for license information.
16428
+
16429
+
16430
+ class CobuildLock {
16431
+ constructor(options) {
16432
+ const { cobuildConfiguration, projectBuildCache } = options;
16433
+ this.projectBuildCache = projectBuildCache;
16434
+ this.cobuildConfiguration = cobuildConfiguration;
16435
+ const { contextId } = cobuildConfiguration;
16436
+ const { cacheId } = projectBuildCache;
16437
+ if (!cacheId) {
16438
+ // This should never happen
16439
+ throw new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.InternalError(`Cache id is require for cobuild lock`);
16440
+ }
16441
+ if (!contextId) {
16442
+ // This should never happen
16443
+ throw new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.InternalError(`Cobuild context id is require for cobuild lock`);
16444
+ }
16445
+ this._cobuildContext = {
16446
+ contextId,
16447
+ cacheId,
16448
+ version: _RushConstants__WEBPACK_IMPORTED_MODULE_1__.RushConstants.cobuildLockVersion
16449
+ };
16450
+ }
16451
+ async setCompletedStateAsync(state) {
16452
+ await this.cobuildConfiguration.cobuildLockProvider.setCompletedStateAsync(this._cobuildContext, state);
16453
+ }
16454
+ async getCompletedStateAsync() {
16455
+ const state = await this.cobuildConfiguration.cobuildLockProvider.getCompletedStateAsync(this._cobuildContext);
16456
+ return state;
16457
+ }
16458
+ async tryAcquireLockAsync() {
16459
+ const acquireLockResult = await this.cobuildConfiguration.cobuildLockProvider.acquireLockAsync(this._cobuildContext);
16460
+ return acquireLockResult;
16461
+ }
16462
+ async renewLockAsync() {
16463
+ await this.cobuildConfiguration.cobuildLockProvider.renewLockAsync(this._cobuildContext);
16464
+ }
16465
+ get cobuildContext() {
16466
+ return this._cobuildContext;
16467
+ }
16468
+ }
16469
+ //# sourceMappingURL=CobuildLock.js.map
16470
+
16471
+ /***/ }),
16472
+
15831
16473
  /***/ 544987:
15832
16474
  /*!****************************************************************!*\
15833
16475
  !*** ./lib-esnext/logic/deploy/DeployScenarioConfiguration.js ***!
@@ -15992,6 +16634,20 @@ class InstallHelpers {
15992
16634
  // will consider this timestamp
15993
16635
  _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.JsonFile.save(commonPackageJson, commonPackageJsonFilename, { onlyIfChanged: true });
15994
16636
  }
16637
+ static generateCommonSplitPackageJson(rushConfiguration) {
16638
+ const commonPackageJson = {
16639
+ dependencies: {},
16640
+ description: 'Temporary file generated by the Rush tool',
16641
+ name: 'rush-common-split',
16642
+ private: true,
16643
+ version: '0.0.0'
16644
+ };
16645
+ // Example: "C:\MyRepo\common\temp-split\package.json"
16646
+ const commonPackageJsonFilename = path__WEBPACK_IMPORTED_MODULE_1__.join(rushConfiguration.commonTempSplitFolder, _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.FileConstants.PackageJson);
16647
+ // Don't update the file timestamp unless the content has changed, since "rush install"
16648
+ // will consider this timestamp
16649
+ _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.JsonFile.save(commonPackageJson, commonPackageJsonFilename, { onlyIfChanged: true });
16650
+ }
15995
16651
  static getPackageManagerEnvironment(rushConfiguration, options = {}) {
15996
16652
  let configurationEnvironment = undefined;
15997
16653
  if (rushConfiguration.packageManager === 'npm') {
@@ -16069,6 +16725,9 @@ class InstallHelpers {
16069
16725
  packageManagerMarker.create();
16070
16726
  // Example: "C:\MyRepo\common\temp"
16071
16727
  _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.FileSystem.ensureFolder(rushConfiguration.commonTempFolder);
16728
+ if (rushConfiguration.hasSplitWorkspaceProject) {
16729
+ _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.FileSystem.ensureFolder(rushConfiguration.commonTempSplitFolder);
16730
+ }
16072
16731
  // Example: "C:\MyRepo\common\temp\pnpm-local"
16073
16732
  const localPackageManagerToolFolder = path__WEBPACK_IMPORTED_MODULE_1__.join(rushConfiguration.commonTempFolder, `${packageManager}-local`);
16074
16733
  logIfConsoleOutputIsNotRestricted(`\nSymlinking "${localPackageManagerToolFolder}"`);
@@ -16273,14 +16932,24 @@ class NpmShrinkwrapFile extends _base_BaseShrinkwrapFile__WEBPACK_IMPORTED_MODUL
16273
16932
 
16274
16933
  __webpack_require__.r(__webpack_exports__);
16275
16934
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16276
- /* harmony export */ "AsyncOperationQueue": () => (/* binding */ AsyncOperationQueue)
16935
+ /* harmony export */ "AsyncOperationQueue": () => (/* binding */ AsyncOperationQueue),
16936
+ /* harmony export */ "UNASSIGNED_OPERATION": () => (/* binding */ UNASSIGNED_OPERATION)
16277
16937
  /* harmony export */ });
16278
16938
  /* harmony import */ var _OperationStatus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./OperationStatus */ 476597);
16279
16939
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
16280
16940
  // See LICENSE in the project root for license information.
16281
16941
 
16282
16942
  /**
16283
- * Implmentation of the async iteration protocol for a collection of IOperation objects.
16943
+ * When the queue returns an unassigned operation, it means there is at least one remote executing operation,
16944
+ * at this time, the caller has a chance to make a decision:
16945
+ * 1. Manually invoke `tryGetRemoteExecutingOperation()` to get the remote executing operation.
16946
+ * 2. If there is no remote executing operation available, wait for some time and return in callback, which
16947
+ * internally invoke `assignOperations()` to assign new operations.
16948
+ * NOTE: the caller must wait for some time to avoid busy loop and burn CPU cycles.
16949
+ */
16950
+ const UNASSIGNED_OPERATION = 'UNASSIGNED_OPERATION';
16951
+ /**
16952
+ * Implementation of the async iteration protocol for a collection of IOperation objects.
16284
16953
  * The async iterator will wait for an operation to be ready for execution, or terminate if there are no more operations.
16285
16954
  *
16286
16955
  * @remarks
@@ -16299,6 +16968,9 @@ class AsyncOperationQueue {
16299
16968
  constructor(operations, sortFn) {
16300
16969
  this._queue = computeTopologyAndSort(operations, sortFn);
16301
16970
  this._pendingIterators = [];
16971
+ this._totalOperations = this._queue.length;
16972
+ this._isDone = false;
16973
+ this._completedOperations = new Set();
16302
16974
  }
16303
16975
  /**
16304
16976
  * For use with `for await (const operation of taskQueue)`
@@ -16312,27 +16984,63 @@ class AsyncOperationQueue {
16312
16984
  this.assignOperations();
16313
16985
  return promise;
16314
16986
  }
16987
+ /**
16988
+ * Set a callback to be invoked when one operation is completed.
16989
+ * If all operations are completed, set the queue to done, resolve all pending iterators in next cycle.
16990
+ */
16991
+ complete(record) {
16992
+ this._completedOperations.add(record);
16993
+ if (this._completedOperations.size === this._totalOperations) {
16994
+ this._isDone = true;
16995
+ }
16996
+ }
16315
16997
  /**
16316
16998
  * Routes ready operations with 0 dependencies to waiting iterators. Normally invoked as part of `next()`, but
16317
16999
  * if the caller does not update operation dependencies prior to calling `next()`, may need to be invoked manually.
16318
17000
  */
16319
17001
  assignOperations() {
16320
17002
  const { _queue: queue, _pendingIterators: waitingIterators } = this;
17003
+ if (this._isDone) {
17004
+ for (const resolveAsyncIterator of waitingIterators.splice(0)) {
17005
+ resolveAsyncIterator({
17006
+ value: undefined,
17007
+ done: true
17008
+ });
17009
+ }
17010
+ return;
17011
+ }
16321
17012
  // By iterating in reverse order we do less array shuffling when removing operations
16322
17013
  for (let i = queue.length - 1; waitingIterators.length > 0 && i >= 0; i--) {
16323
17014
  const operation = queue[i];
16324
- if (operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.Blocked) {
17015
+ if (operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.Blocked ||
17016
+ operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.Skipped ||
17017
+ operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.Success ||
17018
+ operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.SuccessWithWarning ||
17019
+ operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.FromCache ||
17020
+ operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.NoOp ||
17021
+ operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.Failure) {
16325
17022
  // It shouldn't be on the queue, remove it
16326
17023
  queue.splice(i, 1);
16327
17024
  }
17025
+ else if (operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.Queued ||
17026
+ operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.Executing) {
17027
+ // This operation is currently executing
17028
+ // next one plz :)
17029
+ continue;
17030
+ }
17031
+ else if (operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.RemoteExecuting) {
17032
+ // This operation is not ready to execute yet, but it may become ready later
17033
+ // next one plz :)
17034
+ continue;
17035
+ }
16328
17036
  else if (operation.status !== _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.Ready) {
16329
17037
  // Sanity check
16330
17038
  throw new Error(`Unexpected status "${operation.status}" for queued operation: ${operation.name}`);
16331
17039
  }
16332
17040
  else if (operation.dependencies.size === 0) {
16333
17041
  // This task is ready to process, hand it to the iterator.
16334
- queue.splice(i, 1);
16335
17042
  // Needs to have queue semantics, otherwise tools that iterate it get confused
17043
+ operation.status = _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.Queued;
16336
17044
  waitingIterators.shift()({
16337
17045
  value: operation,
16338
17046
  done: false
@@ -16340,16 +17048,28 @@ class AsyncOperationQueue {
16340
17048
  }
16341
17049
  // Otherwise operation is still waiting
16342
17050
  }
16343
- if (queue.length === 0) {
16344
- // Queue is empty, flush
16345
- for (const resolveAsyncIterator of waitingIterators.splice(0)) {
16346
- resolveAsyncIterator({
16347
- value: undefined,
16348
- done: true
17051
+ if (waitingIterators.length > 0) {
17052
+ // returns an unassigned operation to let caller decide when there is at least one
17053
+ // remote executing operation which is not ready to process.
17054
+ if (queue.some((operation) => operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.RemoteExecuting)) {
17055
+ waitingIterators.shift()({
17056
+ value: UNASSIGNED_OPERATION,
17057
+ done: false
16349
17058
  });
16350
17059
  }
16351
17060
  }
16352
17061
  }
17062
+ tryGetRemoteExecutingOperation() {
17063
+ const { _queue: queue } = this;
17064
+ // cycle through the queue to find the next operation that is executed remotely
17065
+ for (let i = queue.length - 1; i >= 0; i--) {
17066
+ const operation = queue[i];
17067
+ if (operation.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_0__.OperationStatus.RemoteExecuting) {
17068
+ return operation;
17069
+ }
17070
+ }
17071
+ return undefined;
17072
+ }
16353
17073
  /**
16354
17074
  * Returns this queue as an async iterator, such that multiple functions iterating this object concurrently
16355
17075
  * receive distinct iteration results.
@@ -16407,98 +17127,549 @@ function calculateCriticalPathLength(operation, dependencyChain) {
16407
17127
 
16408
17128
  /***/ }),
16409
17129
 
16410
- /***/ 969003:
16411
- /*!************************************************************!*\
16412
- !*** ./lib-esnext/logic/operations/NullOperationRunner.js ***!
16413
- \************************************************************/
17130
+ /***/ 223875:
17131
+ /*!*****************************************************************!*\
17132
+ !*** ./lib-esnext/logic/operations/CacheableOperationPlugin.js ***!
17133
+ \*****************************************************************/
16414
17134
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16415
17135
 
16416
17136
  __webpack_require__.r(__webpack_exports__);
16417
17137
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16418
- /* harmony export */ "NullOperationRunner": () => (/* binding */ NullOperationRunner)
17138
+ /* harmony export */ "CacheableOperationPlugin": () => (/* binding */ CacheableOperationPlugin)
16419
17139
  /* harmony export */ });
17140
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
17141
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__);
17142
+ /* harmony import */ var _ShellOperationRunner__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ShellOperationRunner */ 953621);
17143
+ /* harmony import */ var _OperationStatus__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./OperationStatus */ 476597);
17144
+ /* harmony import */ var _cobuild_CobuildLock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../cobuild/CobuildLock */ 676896);
17145
+ /* harmony import */ var _buildCache_ProjectBuildCache__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../buildCache/ProjectBuildCache */ 700587);
17146
+ /* harmony import */ var _rushstack_terminal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rushstack/terminal */ 569956);
17147
+ /* harmony import */ var _rushstack_terminal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rushstack_terminal__WEBPACK_IMPORTED_MODULE_1__);
17148
+ /* harmony import */ var _RushConstants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../RushConstants */ 951904);
17149
+ /* harmony import */ var _api_RushProjectConfiguration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../api/RushProjectConfiguration */ 514639);
17150
+ /* harmony import */ var _buildCache_getHashesForGlobsAsync__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../buildCache/getHashesForGlobsAsync */ 653062);
16420
17151
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
16421
17152
  // See LICENSE in the project root for license information.
16422
- /**
16423
- * Implementation of `IOperationRunner` for operations that require no work, such as empty scripts,
16424
- * skipped operations, or blocked operations.
16425
- */
16426
- class NullOperationRunner {
16427
- constructor({ name, result, silent }) {
16428
- // This operation does nothing, so timing is meaningless
16429
- this.reportTiming = false;
16430
- // The operation may be skipped; it doesn't do anything anyway
16431
- this.isSkipAllowed = true;
16432
- // The operation is a no-op, so is cacheable.
16433
- this.isCacheWriteAllowed = true;
16434
- // Nothing will get logged, no point allowing warnings
16435
- this.warningsAreAllowed = false;
16436
- this.name = name;
16437
- this.result = result;
16438
- this.silent = silent;
16439
- }
16440
- async executeAsync(context) {
16441
- return this.result;
16442
- }
16443
- }
16444
- //# sourceMappingURL=NullOperationRunner.js.map
16445
17153
 
16446
- /***/ }),
16447
17154
 
16448
- /***/ 768667:
16449
- /*!**************************************************!*\
16450
- !*** ./lib-esnext/logic/operations/Operation.js ***!
16451
- \**************************************************/
16452
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16453
17155
 
16454
- __webpack_require__.r(__webpack_exports__);
16455
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16456
- /* harmony export */ "Operation": () => (/* binding */ Operation)
16457
- /* harmony export */ });
16458
- // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
16459
- // See LICENSE in the project root for license information.
16460
- /**
16461
- * The `Operation` class is a node in the dependency graph of work that needs to be scheduled by the
16462
- * `OperationExecutionManager`. Each `Operation` has a `runner` member of type `IOperationRunner`, whose
16463
- * implementation manages the actual process of running a single operation.
16464
- *
16465
- * The graph of `Operation` instances will be cloned into a separate execution graph after processing.
16466
- *
16467
- * @alpha
16468
- */
16469
- class Operation {
16470
- constructor(options) {
16471
- /**
16472
- * A set of all operations which depend on this operation.
16473
- */
16474
- this.consumers = new Set();
16475
- /**
16476
- * A set of all dependencies which must be executed before this operation is complete.
16477
- */
16478
- this.dependencies = new Set();
16479
- /**
16480
- * When the scheduler is ready to process this `Operation`, the `runner` implements the actual work of
16481
- * running the operation.
16482
- */
16483
- this.runner = undefined;
16484
- /**
16485
- * The weight for this operation. This scalar is the contribution of this operation to the
16486
- * `criticalPathLength` calculation above. Modify to indicate the following:
16487
- * - `weight` === 1: indicates that this operation has an average duration
16488
- * - `weight` &gt; 1: indicates that this operation takes longer than average and so the scheduler
16489
- * should try to favor starting it over other, shorter operations. An example might be an operation that
16490
- * bundles an entire application and runs whole-program optimization.
16491
- * - `weight` &lt; 1: indicates that this operation takes less time than average and so the scheduler
16492
- * should favor other, longer operations over it. An example might be an operation to unpack a cached
16493
- * output, or an operation using NullOperationRunner, which might use a value of 0.
16494
- */
16495
- this.weight = 1;
16496
- this.associatedPhase = options === null || options === void 0 ? void 0 : options.phase;
16497
- this.associatedProject = options === null || options === void 0 ? void 0 : options.project;
16498
- this.runner = options === null || options === void 0 ? void 0 : options.runner;
16499
- }
16500
- /**
16501
- * The name of this operation, for logging.
17156
+
17157
+
17158
+
17159
+
17160
+
17161
+
17162
+ const PLUGIN_NAME = 'CacheablePhasedOperationPlugin';
17163
+ class CacheableOperationPlugin {
17164
+ constructor() {
17165
+ this._buildCacheContextByOperationRunner = new Map();
17166
+ }
17167
+ apply(hooks) {
17168
+ hooks.createOperations.tapPromise(PLUGIN_NAME, async (operations, context) => {
17169
+ const { buildCacheConfiguration, isIncrementalBuildAllowed } = context;
17170
+ if (!buildCacheConfiguration) {
17171
+ return operations;
17172
+ }
17173
+ for (const operation of operations) {
17174
+ if (operation.runner) {
17175
+ const buildCacheContext = {
17176
+ // ShellOperationRunner supports cache writes by default.
17177
+ isCacheWriteAllowed: true,
17178
+ isCacheReadAllowed: isIncrementalBuildAllowed,
17179
+ isSkipAllowed: isIncrementalBuildAllowed,
17180
+ projectBuildCache: undefined,
17181
+ cobuildLock: undefined
17182
+ };
17183
+ // Upstream runners may mutate the property of build cache context for downstream runners
17184
+ this._buildCacheContextByOperationRunner.set(operation.runner, buildCacheContext);
17185
+ if (operation.runner instanceof _ShellOperationRunner__WEBPACK_IMPORTED_MODULE_2__.ShellOperationRunner) {
17186
+ this._applyShellOperationRunner(operation.runner, context);
17187
+ }
17188
+ }
17189
+ }
17190
+ return operations;
17191
+ });
17192
+ hooks.afterExecuteOperation.tapPromise(PLUGIN_NAME, async (runnerContext) => {
17193
+ const { runner, status, consumers, changedProjectsOnly } = runnerContext;
17194
+ const buildCacheContext = this._getBuildCacheContextByRunner(runner);
17195
+ let blockCacheWrite = !(buildCacheContext === null || buildCacheContext === void 0 ? void 0 : buildCacheContext.isCacheWriteAllowed);
17196
+ let blockSkip = !(buildCacheContext === null || buildCacheContext === void 0 ? void 0 : buildCacheContext.isSkipAllowed);
17197
+ switch (status) {
17198
+ case _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.Skipped: {
17199
+ // Skipping means cannot guarantee integrity, so prevent cache writes in dependents.
17200
+ blockCacheWrite = true;
17201
+ break;
17202
+ }
17203
+ case _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.SuccessWithWarning:
17204
+ case _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.Success: {
17205
+ // Legacy incremental build, if asked, prevent skip in dependents if the operation executed.
17206
+ blockSkip || (blockSkip = !changedProjectsOnly);
17207
+ break;
17208
+ }
17209
+ }
17210
+ // Apply status changes to direct dependents
17211
+ for (const item of consumers) {
17212
+ const itemRunnerBuildCacheContext = this._getBuildCacheContextByRunner(item.runner);
17213
+ if (itemRunnerBuildCacheContext) {
17214
+ if (blockCacheWrite) {
17215
+ itemRunnerBuildCacheContext.isCacheWriteAllowed = false;
17216
+ }
17217
+ if (blockSkip) {
17218
+ itemRunnerBuildCacheContext.isSkipAllowed = false;
17219
+ }
17220
+ }
17221
+ }
17222
+ });
17223
+ hooks.afterExecuteOperations.tapPromise(PLUGIN_NAME, async () => {
17224
+ this._buildCacheContextByOperationRunner.clear();
17225
+ });
17226
+ }
17227
+ _applyShellOperationRunner(runner, context) {
17228
+ const { buildCacheConfiguration, cobuildConfiguration, phaseSelection: selectedPhases, projectChangeAnalyzer } = context;
17229
+ const { hooks } = runner;
17230
+ const buildCacheContext = this._getBuildCacheContextByRunnerOrThrow(runner);
17231
+ hooks.beforeExecute.tapPromise(PLUGIN_NAME, async (beforeExecuteContext) => {
17232
+ const earlyReturnStatus = await (async () => {
17233
+ var _a, _b;
17234
+ const { context, runner, terminal, lastProjectDeps, projectDeps, trackedProjectFiles, logPath, errorLogPath, rushProject, phase, commandName, commandToRun, earlyReturnStatus } = beforeExecuteContext;
17235
+ if (earlyReturnStatus) {
17236
+ // If there is existing early return status, we don't need to do anything
17237
+ return earlyReturnStatus;
17238
+ }
17239
+ if (!projectDeps && buildCacheContext.isSkipAllowed) {
17240
+ // To test this code path:
17241
+ // Remove the `.git` folder then run "rush build --verbose"
17242
+ terminal.writeLine({
17243
+ text: _rushstack_terminal__WEBPACK_IMPORTED_MODULE_1__.PrintUtilities.wrapWords('This workspace does not appear to be tracked by Git. ' +
17244
+ 'Rush will proceed without incremental execution, caching, and change detection.'),
17245
+ foregroundColor: _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.ColorValue.Cyan
17246
+ });
17247
+ }
17248
+ let projectBuildCache = await this._tryGetProjectBuildCacheAsync({
17249
+ buildCacheConfiguration,
17250
+ runner,
17251
+ rushProject,
17252
+ phase,
17253
+ selectedPhases,
17254
+ projectChangeAnalyzer,
17255
+ commandName,
17256
+ commandToRun,
17257
+ terminal,
17258
+ trackedProjectFiles,
17259
+ operationMetadataManager: context._operationMetadataManager
17260
+ });
17261
+ // Try to acquire the cobuild lock
17262
+ let cobuildLock;
17263
+ if (cobuildConfiguration === null || cobuildConfiguration === void 0 ? void 0 : cobuildConfiguration.cobuildEnabled) {
17264
+ if ((cobuildConfiguration === null || cobuildConfiguration === void 0 ? void 0 : cobuildConfiguration.cobuildLeafProjectLogOnlyAllowed) &&
17265
+ rushProject.consumingProjects.size === 0 &&
17266
+ !projectBuildCache) {
17267
+ // When the leaf project log only is allowed and the leaf project is build cache "disabled", try to get
17268
+ // a log files only project build cache
17269
+ projectBuildCache = await this._tryGetLogOnlyProjectBuildCacheAsync({
17270
+ buildCacheConfiguration,
17271
+ runner,
17272
+ rushProject,
17273
+ phase,
17274
+ projectChangeAnalyzer,
17275
+ commandName,
17276
+ commandToRun,
17277
+ terminal,
17278
+ trackedProjectFiles,
17279
+ operationMetadataManager: context._operationMetadataManager
17280
+ });
17281
+ if (projectBuildCache) {
17282
+ terminal.writeVerboseLine(`Log files only build cache is enabled for the project "${rushProject.packageName}" because the cobuild leaf project log only is allowed`);
17283
+ }
17284
+ else {
17285
+ terminal.writeWarningLine(`Failed to get log files only build cache for the project "${rushProject.packageName}"`);
17286
+ }
17287
+ }
17288
+ cobuildLock = await this._tryGetCobuildLockAsync({
17289
+ runner,
17290
+ projectBuildCache,
17291
+ cobuildConfiguration
17292
+ });
17293
+ }
17294
+ // eslint-disable-next-line require-atomic-updates -- we are mutating the build cache context intentionally
17295
+ buildCacheContext.cobuildLock = cobuildLock;
17296
+ // If possible, we want to skip this operation -- either by restoring it from the
17297
+ // cache, if caching is enabled, or determining that the project
17298
+ // is unchanged (using the older incremental execution logic). These two approaches,
17299
+ // "caching" and "skipping", are incompatible, so only one applies.
17300
+ //
17301
+ // Note that "caching" and "skipping" take two different approaches
17302
+ // to tracking dependents:
17303
+ //
17304
+ // - For caching, "isCacheReadAllowed" is set if a project supports
17305
+ // incremental builds, and determining whether this project or a dependent
17306
+ // has changed happens inside the hashing logic.
17307
+ //
17308
+ // - For skipping, "isSkipAllowed" is set to true initially, and during
17309
+ // the process of running dependents, it will be changed by OperationExecutionManager to
17310
+ // false if a dependency wasn't able to be skipped.
17311
+ //
17312
+ let buildCacheReadAttempted = false;
17313
+ if (cobuildLock) {
17314
+ // handling rebuilds. "rush rebuild" or "rush retest" command will save operations to
17315
+ // the build cache once completed, but does not retrieve them (since the "incremental"
17316
+ // flag is disabled). However, we still need a cobuild to be able to retrieve a finished
17317
+ // build from another cobuild in this case.
17318
+ const cobuildCompletedState = await cobuildLock.getCompletedStateAsync();
17319
+ if (cobuildCompletedState) {
17320
+ const { status, cacheId } = cobuildCompletedState;
17321
+ const restoreFromCacheSuccess = await cobuildLock.projectBuildCache.tryRestoreFromCacheAsync(terminal, cacheId);
17322
+ if (restoreFromCacheSuccess) {
17323
+ // Restore the original state of the operation without cache
17324
+ await ((_a = context._operationMetadataManager) === null || _a === void 0 ? void 0 : _a.tryRestoreAsync({
17325
+ terminal,
17326
+ logPath,
17327
+ errorLogPath
17328
+ }));
17329
+ if (cobuildCompletedState) {
17330
+ return cobuildCompletedState.status;
17331
+ }
17332
+ return status;
17333
+ }
17334
+ }
17335
+ }
17336
+ else if (buildCacheContext.isCacheReadAllowed) {
17337
+ buildCacheReadAttempted = !!projectBuildCache;
17338
+ const restoreFromCacheSuccess = await (projectBuildCache === null || projectBuildCache === void 0 ? void 0 : projectBuildCache.tryRestoreFromCacheAsync(terminal));
17339
+ if (restoreFromCacheSuccess) {
17340
+ // Restore the original state of the operation without cache
17341
+ await ((_b = context._operationMetadataManager) === null || _b === void 0 ? void 0 : _b.tryRestoreAsync({
17342
+ terminal,
17343
+ logPath,
17344
+ errorLogPath
17345
+ }));
17346
+ return _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.FromCache;
17347
+ }
17348
+ }
17349
+ if (buildCacheContext.isSkipAllowed && !buildCacheReadAttempted) {
17350
+ const isPackageUnchanged = !!(lastProjectDeps &&
17351
+ projectDeps &&
17352
+ projectDeps.arguments === lastProjectDeps.arguments &&
17353
+ _areShallowEqual(projectDeps.files, lastProjectDeps.files));
17354
+ if (isPackageUnchanged) {
17355
+ return _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.Skipped;
17356
+ }
17357
+ }
17358
+ if (buildCacheContext.isCacheWriteAllowed && cobuildLock) {
17359
+ const acquireSuccess = await cobuildLock.tryAcquireLockAsync();
17360
+ if (acquireSuccess) {
17361
+ // The operation may be used to marked remote executing, now change it to executing
17362
+ context.status = _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.Executing;
17363
+ runner.periodicCallback.addCallback(async () => {
17364
+ await (cobuildLock === null || cobuildLock === void 0 ? void 0 : cobuildLock.renewLockAsync());
17365
+ });
17366
+ }
17367
+ else {
17368
+ // failed to acquire the lock, mark current operation to remote executing
17369
+ context.stopwatch.reset();
17370
+ return _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.RemoteExecuting;
17371
+ }
17372
+ }
17373
+ })();
17374
+ if (earlyReturnStatus) {
17375
+ beforeExecuteContext.earlyReturnStatus = earlyReturnStatus;
17376
+ }
17377
+ return beforeExecuteContext;
17378
+ });
17379
+ runner.hooks.afterExecute.tapPromise(PLUGIN_NAME, async (afterExecuteContext) => {
17380
+ var _a;
17381
+ const { context, terminal, status, taskIsSuccessful } = afterExecuteContext;
17382
+ const { cobuildLock, projectBuildCache, isCacheWriteAllowed } = buildCacheContext;
17383
+ let setCompletedStatePromiseFunction;
17384
+ let setCacheEntryPromise;
17385
+ if (cobuildLock && isCacheWriteAllowed) {
17386
+ if (context.error) {
17387
+ // In order to preventing the worst case that all cobuild tasks go through the same failure,
17388
+ // allowing a failing build to be cached and retrieved, print the error message to the terminal
17389
+ // and clear the error in context.
17390
+ const message = (_a = context.error) === null || _a === void 0 ? void 0 : _a.message;
17391
+ if (message) {
17392
+ context.collatedWriter.terminal.writeStderrLine(message);
17393
+ }
17394
+ context.error = undefined;
17395
+ }
17396
+ const { cacheId, contextId } = cobuildLock.cobuildContext;
17397
+ const finalCacheId = status === _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.Failure ? `${cacheId}-${contextId}-failed` : cacheId;
17398
+ switch (status) {
17399
+ case _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.SuccessWithWarning:
17400
+ case _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.Success:
17401
+ case _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.Failure: {
17402
+ const currentStatus = status;
17403
+ setCompletedStatePromiseFunction = () => {
17404
+ return cobuildLock === null || cobuildLock === void 0 ? void 0 : cobuildLock.setCompletedStateAsync({
17405
+ status: currentStatus,
17406
+ cacheId: finalCacheId
17407
+ });
17408
+ };
17409
+ setCacheEntryPromise = cobuildLock.projectBuildCache.trySetCacheEntryAsync(terminal, finalCacheId);
17410
+ }
17411
+ }
17412
+ }
17413
+ // If the command is successful, we can calculate project hash, and no dependencies were skipped,
17414
+ // write a new cache entry.
17415
+ if (!setCacheEntryPromise && taskIsSuccessful && isCacheWriteAllowed && projectBuildCache) {
17416
+ setCacheEntryPromise = projectBuildCache.trySetCacheEntryAsync(terminal);
17417
+ }
17418
+ const cacheWriteSuccess = await setCacheEntryPromise;
17419
+ await (setCompletedStatePromiseFunction === null || setCompletedStatePromiseFunction === void 0 ? void 0 : setCompletedStatePromiseFunction());
17420
+ if (cacheWriteSuccess === false && afterExecuteContext.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.Success) {
17421
+ afterExecuteContext.status = _OperationStatus__WEBPACK_IMPORTED_MODULE_3__.OperationStatus.SuccessWithWarning;
17422
+ }
17423
+ return afterExecuteContext;
17424
+ });
17425
+ }
17426
+ _getBuildCacheContextByRunner(runner) {
17427
+ const buildCacheContext = this._buildCacheContextByOperationRunner.get(runner);
17428
+ return buildCacheContext;
17429
+ }
17430
+ _getBuildCacheContextByRunnerOrThrow(runner) {
17431
+ const buildCacheContext = this._getBuildCacheContextByRunner(runner);
17432
+ if (!buildCacheContext) {
17433
+ // This should not happen
17434
+ throw new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.InternalError(`Build cache context for runner ${runner.name} should be defined`);
17435
+ }
17436
+ return buildCacheContext;
17437
+ }
17438
+ async _tryGetProjectBuildCacheAsync({ buildCacheConfiguration, runner, rushProject, phase, selectedPhases, projectChangeAnalyzer, commandName, commandToRun, terminal, trackedProjectFiles, operationMetadataManager }) {
17439
+ const buildCacheContext = this._getBuildCacheContextByRunnerOrThrow(runner);
17440
+ if (!buildCacheContext.projectBuildCache) {
17441
+ if (buildCacheConfiguration && buildCacheConfiguration.buildCacheEnabled) {
17442
+ // Disable legacy skip logic if the build cache is in play
17443
+ buildCacheContext.isSkipAllowed = false;
17444
+ const projectConfiguration = await _api_RushProjectConfiguration__WEBPACK_IMPORTED_MODULE_4__.RushProjectConfiguration.tryLoadForProjectAsync(rushProject, terminal);
17445
+ if (projectConfiguration) {
17446
+ projectConfiguration.validatePhaseConfiguration(selectedPhases, terminal);
17447
+ if (projectConfiguration.disableBuildCacheForProject) {
17448
+ terminal.writeVerboseLine('Caching has been disabled for this project.');
17449
+ }
17450
+ else {
17451
+ const operationSettings = projectConfiguration.operationSettingsByOperationName.get(commandName);
17452
+ if (!operationSettings) {
17453
+ terminal.writeVerboseLine(`This project does not define the caching behavior of the "${commandName}" command, so caching has been disabled.`);
17454
+ }
17455
+ else if (operationSettings.disableBuildCacheForOperation) {
17456
+ terminal.writeVerboseLine(`Caching has been disabled for this project's "${commandName}" command.`);
17457
+ }
17458
+ else {
17459
+ const projectOutputFolderNames = operationSettings.outputFolderNames || [];
17460
+ const additionalProjectOutputFilePaths = [
17461
+ ...((operationMetadataManager === null || operationMetadataManager === void 0 ? void 0 : operationMetadataManager.relativeFilepaths) || [])
17462
+ ];
17463
+ const additionalContext = {};
17464
+ if (operationSettings.dependsOnEnvVars) {
17465
+ for (const varName of operationSettings.dependsOnEnvVars) {
17466
+ additionalContext['$' + varName] = process.env[varName] || '';
17467
+ }
17468
+ }
17469
+ if (operationSettings.dependsOnAdditionalFiles) {
17470
+ const repoState = await projectChangeAnalyzer._ensureInitializedAsync(terminal);
17471
+ const additionalFiles = await (0,_buildCache_getHashesForGlobsAsync__WEBPACK_IMPORTED_MODULE_5__.getHashesForGlobsAsync)(operationSettings.dependsOnAdditionalFiles, rushProject.projectFolder, repoState);
17472
+ terminal.writeDebugLine(`Including additional files to calculate build cache hash:\n ${Array.from(additionalFiles.keys()).join('\n ')} `);
17473
+ for (const [filePath, fileHash] of additionalFiles) {
17474
+ additionalContext['file://' + filePath] = fileHash;
17475
+ }
17476
+ }
17477
+ buildCacheContext.projectBuildCache = await _buildCache_ProjectBuildCache__WEBPACK_IMPORTED_MODULE_6__.ProjectBuildCache.tryGetProjectBuildCache({
17478
+ project: rushProject,
17479
+ projectOutputFolderNames,
17480
+ additionalProjectOutputFilePaths,
17481
+ additionalContext,
17482
+ buildCacheConfiguration,
17483
+ terminal,
17484
+ command: commandToRun,
17485
+ trackedProjectFiles: trackedProjectFiles,
17486
+ projectChangeAnalyzer: projectChangeAnalyzer,
17487
+ phaseName: phase.name
17488
+ });
17489
+ }
17490
+ }
17491
+ }
17492
+ else {
17493
+ terminal.writeVerboseLine(`Project does not have a ${_RushConstants__WEBPACK_IMPORTED_MODULE_7__.RushConstants.rushProjectConfigFilename} configuration file, ` +
17494
+ 'or one provided by a rig, so it does not support caching.');
17495
+ }
17496
+ }
17497
+ }
17498
+ return buildCacheContext.projectBuildCache;
17499
+ }
17500
+ async _tryGetLogOnlyProjectBuildCacheAsync({ runner, rushProject, terminal, commandName, commandToRun, buildCacheConfiguration, phase, trackedProjectFiles, projectChangeAnalyzer, operationMetadataManager }) {
17501
+ const buildCacheContext = this._getBuildCacheContextByRunnerOrThrow(runner);
17502
+ if (buildCacheConfiguration && buildCacheConfiguration.buildCacheEnabled) {
17503
+ // Disable legacy skip logic if the build cache is in play
17504
+ buildCacheContext.isSkipAllowed = false;
17505
+ const projectConfiguration = await _api_RushProjectConfiguration__WEBPACK_IMPORTED_MODULE_4__.RushProjectConfiguration.tryLoadForProjectAsync(rushProject, terminal);
17506
+ let projectOutputFolderNames = [];
17507
+ const additionalProjectOutputFilePaths = [
17508
+ ...((operationMetadataManager === null || operationMetadataManager === void 0 ? void 0 : operationMetadataManager.relativeFilepaths) || [])
17509
+ ];
17510
+ const additionalContext = {
17511
+ // Force the cache to be a log files only cache
17512
+ logFilesOnly: '1'
17513
+ };
17514
+ if (projectConfiguration) {
17515
+ const operationSettings = projectConfiguration.operationSettingsByOperationName.get(commandName);
17516
+ if (operationSettings) {
17517
+ if (operationSettings.outputFolderNames) {
17518
+ projectOutputFolderNames = operationSettings.outputFolderNames;
17519
+ }
17520
+ if (operationSettings.dependsOnEnvVars) {
17521
+ for (const varName of operationSettings.dependsOnEnvVars) {
17522
+ additionalContext['$' + varName] = process.env[varName] || '';
17523
+ }
17524
+ }
17525
+ if (operationSettings.dependsOnAdditionalFiles) {
17526
+ const repoState = await projectChangeAnalyzer._ensureInitializedAsync(terminal);
17527
+ const additionalFiles = await (0,_buildCache_getHashesForGlobsAsync__WEBPACK_IMPORTED_MODULE_5__.getHashesForGlobsAsync)(operationSettings.dependsOnAdditionalFiles, rushProject.projectFolder, repoState);
17528
+ for (const [filePath, fileHash] of additionalFiles) {
17529
+ additionalContext['file://' + filePath] = fileHash;
17530
+ }
17531
+ }
17532
+ }
17533
+ }
17534
+ const projectBuildCache = await _buildCache_ProjectBuildCache__WEBPACK_IMPORTED_MODULE_6__.ProjectBuildCache.tryGetProjectBuildCache({
17535
+ project: rushProject,
17536
+ projectOutputFolderNames,
17537
+ additionalProjectOutputFilePaths,
17538
+ additionalContext,
17539
+ buildCacheConfiguration,
17540
+ terminal,
17541
+ command: commandToRun,
17542
+ trackedProjectFiles,
17543
+ projectChangeAnalyzer: projectChangeAnalyzer,
17544
+ phaseName: phase.name
17545
+ });
17546
+ buildCacheContext.projectBuildCache = projectBuildCache;
17547
+ return projectBuildCache;
17548
+ }
17549
+ }
17550
+ async _tryGetCobuildLockAsync({ cobuildConfiguration, runner, projectBuildCache }) {
17551
+ const buildCacheContext = this._getBuildCacheContextByRunnerOrThrow(runner);
17552
+ if (!buildCacheContext.cobuildLock) {
17553
+ buildCacheContext.cobuildLock = undefined;
17554
+ if (projectBuildCache && cobuildConfiguration && cobuildConfiguration.cobuildEnabled) {
17555
+ buildCacheContext.cobuildLock = new _cobuild_CobuildLock__WEBPACK_IMPORTED_MODULE_8__.CobuildLock({
17556
+ cobuildConfiguration,
17557
+ projectBuildCache
17558
+ });
17559
+ }
17560
+ }
17561
+ return buildCacheContext.cobuildLock;
17562
+ }
17563
+ }
17564
+ function _areShallowEqual(object1, object2) {
17565
+ for (const n in object1) {
17566
+ if (!(n in object2) || object1[n] !== object2[n]) {
17567
+ return false;
17568
+ }
17569
+ }
17570
+ for (const n in object2) {
17571
+ if (!(n in object1)) {
17572
+ return false;
17573
+ }
17574
+ }
17575
+ return true;
17576
+ }
17577
+ //# sourceMappingURL=CacheableOperationPlugin.js.map
17578
+
17579
+ /***/ }),
17580
+
17581
+ /***/ 969003:
17582
+ /*!************************************************************!*\
17583
+ !*** ./lib-esnext/logic/operations/NullOperationRunner.js ***!
17584
+ \************************************************************/
17585
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
17586
+
17587
+ __webpack_require__.r(__webpack_exports__);
17588
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17589
+ /* harmony export */ "NullOperationRunner": () => (/* binding */ NullOperationRunner)
17590
+ /* harmony export */ });
17591
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
17592
+ // See LICENSE in the project root for license information.
17593
+ /**
17594
+ * Implementation of `IOperationRunner` for operations that require no work, such as empty scripts,
17595
+ * skipped operations, or blocked operations.
17596
+ */
17597
+ class NullOperationRunner {
17598
+ constructor({ name, result, silent }) {
17599
+ // This operation does nothing, so timing is meaningless
17600
+ this.reportTiming = false;
17601
+ // The operation may be skipped; it doesn't do anything anyway
17602
+ this.isSkipAllowed = true;
17603
+ // The operation is a no-op, so is cacheable.
17604
+ this.isCacheWriteAllowed = true;
17605
+ // Nothing will get logged, no point allowing warnings
17606
+ this.warningsAreAllowed = false;
17607
+ this.name = name;
17608
+ this.result = result;
17609
+ this.silent = silent;
17610
+ }
17611
+ async executeAsync(context) {
17612
+ return this.result;
17613
+ }
17614
+ }
17615
+ //# sourceMappingURL=NullOperationRunner.js.map
17616
+
17617
+ /***/ }),
17618
+
17619
+ /***/ 768667:
17620
+ /*!**************************************************!*\
17621
+ !*** ./lib-esnext/logic/operations/Operation.js ***!
17622
+ \**************************************************/
17623
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
17624
+
17625
+ __webpack_require__.r(__webpack_exports__);
17626
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
17627
+ /* harmony export */ "Operation": () => (/* binding */ Operation)
17628
+ /* harmony export */ });
17629
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
17630
+ // See LICENSE in the project root for license information.
17631
+ /**
17632
+ * The `Operation` class is a node in the dependency graph of work that needs to be scheduled by the
17633
+ * `OperationExecutionManager`. Each `Operation` has a `runner` member of type `IOperationRunner`, whose
17634
+ * implementation manages the actual process of running a single operation.
17635
+ *
17636
+ * The graph of `Operation` instances will be cloned into a separate execution graph after processing.
17637
+ *
17638
+ * @alpha
17639
+ */
17640
+ class Operation {
17641
+ constructor(options) {
17642
+ /**
17643
+ * A set of all operations which depend on this operation.
17644
+ */
17645
+ this.consumers = new Set();
17646
+ /**
17647
+ * A set of all dependencies which must be executed before this operation is complete.
17648
+ */
17649
+ this.dependencies = new Set();
17650
+ /**
17651
+ * When the scheduler is ready to process this `Operation`, the `runner` implements the actual work of
17652
+ * running the operation.
17653
+ */
17654
+ this.runner = undefined;
17655
+ /**
17656
+ * The weight for this operation. This scalar is the contribution of this operation to the
17657
+ * `criticalPathLength` calculation above. Modify to indicate the following:
17658
+ * - `weight` === 1: indicates that this operation has an average duration
17659
+ * - `weight` &gt; 1: indicates that this operation takes longer than average and so the scheduler
17660
+ * should try to favor starting it over other, shorter operations. An example might be an operation that
17661
+ * bundles an entire application and runs whole-program optimization.
17662
+ * - `weight` &lt; 1: indicates that this operation takes less time than average and so the scheduler
17663
+ * should favor other, longer operations over it. An example might be an operation to unpack a cached
17664
+ * output, or an operation using NullOperationRunner, which might use a value of 0.
17665
+ */
17666
+ this.weight = 1;
17667
+ this.associatedPhase = options === null || options === void 0 ? void 0 : options.phase;
17668
+ this.associatedProject = options === null || options === void 0 ? void 0 : options.project;
17669
+ this.runner = options === null || options === void 0 ? void 0 : options.runner;
17670
+ }
17671
+ /**
17672
+ * The name of this operation, for logging.
16502
17673
  */
16503
17674
  get name() {
16504
17675
  var _a;
@@ -16591,6 +17762,9 @@ __webpack_require__.r(__webpack_exports__);
16591
17762
  * Format "======" lines for a shell window with classic 80 columns
16592
17763
  */
16593
17764
  const ASCII_HEADER_WIDTH = 79;
17765
+ const prioritySort = (a, b) => {
17766
+ return a.criticalPathLength - b.criticalPathLength;
17767
+ };
16594
17768
  /**
16595
17769
  * A class which manages the execution of a set of tasks with interdependencies.
16596
17770
  * Initially, and at the end of each task execution, all unblocked tasks
@@ -16622,13 +17796,15 @@ class OperationExecutionManager {
16622
17796
  }
16623
17797
  }
16624
17798
  };
16625
- const { quietMode, debugMode, parallelism, changedProjectsOnly, onOperationStatusChanged, beforeExecuteOperations } = options;
17799
+ const { quietMode, debugMode, parallelism, changedProjectsOnly, beforeExecuteOperation, afterExecuteOperation, onOperationStatusChanged, beforeExecuteOperations } = options;
16626
17800
  this._completedOperations = 0;
16627
17801
  this._quietMode = quietMode;
16628
17802
  this._hasAnyFailures = false;
16629
17803
  this._hasAnyNonAllowedWarnings = false;
16630
17804
  this._changedProjectsOnly = changedProjectsOnly;
16631
17805
  this._parallelism = parallelism;
17806
+ this._beforeExecuteOperation = beforeExecuteOperation;
17807
+ this._afterExecuteOperation = afterExecuteOperation;
16632
17808
  this._beforeExecuteOperations = beforeExecuteOperations;
16633
17809
  this._onOperationStatusChanged = onOperationStatusChanged;
16634
17810
  // TERMINAL PIPELINE:
@@ -16651,7 +17827,8 @@ class OperationExecutionManager {
16651
17827
  streamCollator: this._streamCollator,
16652
17828
  onOperationStatusChanged,
16653
17829
  debugMode,
16654
- quietMode
17830
+ quietMode,
17831
+ changedProjectsOnly
16655
17832
  };
16656
17833
  let totalOperations = 0;
16657
17834
  const executionRecords = (this._executionRecords = new Map());
@@ -16674,6 +17851,8 @@ class OperationExecutionManager {
16674
17851
  dependencyRecord.consumers.add(consumer);
16675
17852
  }
16676
17853
  }
17854
+ const executionQueue = new _AsyncOperationQueue__WEBPACK_IMPORTED_MODULE_5__.AsyncOperationQueue(this._executionRecords.values(), prioritySort);
17855
+ this._executionQueue = executionQueue;
16677
17856
  }
16678
17857
  /**
16679
17858
  * Executes all operations which have been registered, returning a promise which is resolved when all the
@@ -16700,18 +17879,38 @@ class OperationExecutionManager {
16700
17879
  }
16701
17880
  this._terminal.writeStdoutLine(`Executing a maximum of ${this._parallelism} simultaneous processes...`);
16702
17881
  const maxParallelism = Math.min(totalOperations, this._parallelism);
16703
- const prioritySort = (a, b) => {
16704
- return a.criticalPathLength - b.criticalPathLength;
16705
- };
16706
- const executionQueue = new _AsyncOperationQueue__WEBPACK_IMPORTED_MODULE_5__.AsyncOperationQueue(this._executionRecords.values(), prioritySort);
16707
17882
  await ((_a = this._beforeExecuteOperations) === null || _a === void 0 ? void 0 : _a.call(this, this._executionRecords));
16708
17883
  // This function is a callback because it may write to the collatedWriter before
16709
17884
  // operation.executeAsync returns (and cleans up the writer)
16710
- const onOperationComplete = (record) => {
17885
+ const onOperationComplete = async (record) => {
17886
+ var _a;
16711
17887
  this._onOperationComplete(record);
17888
+ await ((_a = this._afterExecuteOperation) === null || _a === void 0 ? void 0 : _a.call(this, record));
16712
17889
  };
16713
- await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_3__.Async.forEachAsync(executionQueue, async (operation) => {
16714
- await operation.executeAsync(onOperationComplete);
17890
+ await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_3__.Async.forEachAsync(this._executionQueue, async (operation) => {
17891
+ var _a;
17892
+ let record;
17893
+ /**
17894
+ * If the operation is UNASSIGNED_OPERATION, it means that the queue is not able to assign a operation.
17895
+ * This happens when some operations run remotely. So, we should try to get a remote executing operation
17896
+ * from the queue manually here.
17897
+ */
17898
+ if (operation === _AsyncOperationQueue__WEBPACK_IMPORTED_MODULE_5__.UNASSIGNED_OPERATION) {
17899
+ // Pause for a few time
17900
+ await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_3__.Async.sleep(5000);
17901
+ record = this._executionQueue.tryGetRemoteExecutingOperation();
17902
+ }
17903
+ else {
17904
+ record = operation;
17905
+ }
17906
+ if (!record) {
17907
+ // Fail to assign a operation, start over again
17908
+ return;
17909
+ }
17910
+ else {
17911
+ await ((_a = this._beforeExecuteOperation) === null || _a === void 0 ? void 0 : _a.call(this, record));
17912
+ await record.executeAsync(onOperationComplete);
17913
+ }
16715
17914
  }, {
16716
17915
  concurrency: maxParallelism
16717
17916
  });
@@ -16731,8 +17930,6 @@ class OperationExecutionManager {
16731
17930
  _onOperationComplete(record) {
16732
17931
  var _a, _b;
16733
17932
  const { runner, name, status } = record;
16734
- let blockCacheWrite = !runner.isCacheWriteAllowed;
16735
- let blockSkip = !runner.isSkipAllowed;
16736
17933
  const silent = runner.silent;
16737
17934
  switch (status) {
16738
17935
  /**
@@ -16751,6 +17948,7 @@ class OperationExecutionManager {
16751
17948
  const blockedQueue = new Set(record.consumers);
16752
17949
  for (const blockedRecord of blockedQueue) {
16753
17950
  if (blockedRecord.status === _OperationStatus__WEBPACK_IMPORTED_MODULE_6__.OperationStatus.Ready) {
17951
+ this._executionQueue.complete(blockedRecord);
16754
17952
  this._completedOperations++;
16755
17953
  // Now that we have the concept of architectural no-ops, we could implement this by replacing
16756
17954
  // {blockedRecord.runner} with a no-op that sets status to Blocked and logs the blocking
@@ -16784,8 +17982,6 @@ class OperationExecutionManager {
16784
17982
  if (!silent) {
16785
17983
  record.collatedWriter.terminal.writeStdoutLine(colors_safe__WEBPACK_IMPORTED_MODULE_0___default().green(`"${name}" was skipped.`));
16786
17984
  }
16787
- // Skipping means cannot guarantee integrity, so prevent cache writes in dependents.
16788
- blockCacheWrite = true;
16789
17985
  break;
16790
17986
  }
16791
17987
  /**
@@ -16801,30 +17997,24 @@ class OperationExecutionManager {
16801
17997
  if (!silent) {
16802
17998
  record.collatedWriter.terminal.writeStdoutLine(colors_safe__WEBPACK_IMPORTED_MODULE_0___default().green(`"${name}" completed successfully in ${record.stopwatch.toString()}.`));
16803
17999
  }
16804
- // Legacy incremental build, if asked, prevent skip in dependents if the operation executed.
16805
- blockSkip || (blockSkip = !this._changedProjectsOnly);
16806
18000
  break;
16807
18001
  }
16808
18002
  case _OperationStatus__WEBPACK_IMPORTED_MODULE_6__.OperationStatus.SuccessWithWarning: {
16809
18003
  if (!silent) {
16810
18004
  record.collatedWriter.terminal.writeStderrLine(colors_safe__WEBPACK_IMPORTED_MODULE_0___default().yellow(`"${name}" completed with warnings in ${record.stopwatch.toString()}.`));
16811
18005
  }
16812
- // Legacy incremental build, if asked, prevent skip in dependents if the operation executed.
16813
- blockSkip || (blockSkip = !this._changedProjectsOnly);
16814
18006
  this._hasAnyNonAllowedWarnings = this._hasAnyNonAllowedWarnings || !runner.warningsAreAllowed;
16815
18007
  break;
16816
18008
  }
16817
18009
  }
16818
- // Apply status changes to direct dependents
16819
- for (const item of record.consumers) {
16820
- if (blockCacheWrite) {
16821
- item.runner.isCacheWriteAllowed = false;
16822
- }
16823
- if (blockSkip) {
16824
- item.runner.isSkipAllowed = false;
18010
+ if (record.status !== _OperationStatus__WEBPACK_IMPORTED_MODULE_6__.OperationStatus.RemoteExecuting) {
18011
+ // If the operation was not remote, then we can notify queue that it is complete
18012
+ this._executionQueue.complete(record);
18013
+ // Apply status changes to direct dependents
18014
+ for (const item of record.consumers) {
18015
+ // Remove this operation from the dependencies, to unblock the scheduler
18016
+ item.dependencies.delete(record);
16825
18017
  }
16826
- // Remove this operation from the dependencies, to unblock the scheduler
16827
- item.dependencies.delete(record);
16828
18018
  }
16829
18019
  }
16830
18020
  }
@@ -16858,6 +18048,8 @@ __webpack_require__.r(__webpack_exports__);
16858
18048
 
16859
18049
  /**
16860
18050
  * Internal class representing everything about executing an operation
18051
+ *
18052
+ * @internal
16861
18053
  */
16862
18054
  class OperationExecutionRecord {
16863
18055
  constructor(operation, context) {
@@ -16884,6 +18076,7 @@ class OperationExecutionRecord {
16884
18076
  * operation to execute, the operation with the highest criticalPathLength is chosen.
16885
18077
  *
16886
18078
  * Example:
18079
+ * ```
16887
18080
  * (0) A
16888
18081
  * \
16889
18082
  * (1) B C (0) (applications)
@@ -16900,6 +18093,7 @@ class OperationExecutionRecord {
16900
18093
  * X has a score of 1, since the only package which depends on it is A
16901
18094
  * Z has a score of 2, since only X depends on it, and X has a score of 1
16902
18095
  * Y has a score of 2, since the chain Y->X->C is longer than Y->C
18096
+ * ```
16903
18097
  *
16904
18098
  * The algorithm is implemented in AsyncOperationQueue.ts as calculateCriticalPathLength()
16905
18099
  */
@@ -16938,6 +18132,9 @@ class OperationExecutionRecord {
16938
18132
  get quietMode() {
16939
18133
  return this._context.quietMode;
16940
18134
  }
18135
+ get changedProjectsOnly() {
18136
+ return this._context.changedProjectsOnly;
18137
+ }
16941
18138
  get collatedWriter() {
16942
18139
  // Lazy instantiate because the registerTask() call affects display ordering
16943
18140
  if (!this._collatedWriter) {
@@ -16958,18 +18155,20 @@ class OperationExecutionRecord {
16958
18155
  try {
16959
18156
  this.status = await this.runner.executeAsync(this);
16960
18157
  // Delegate global state reporting
16961
- onResult(this);
18158
+ await onResult(this);
16962
18159
  }
16963
18160
  catch (error) {
16964
18161
  this.status = _OperationStatus__WEBPACK_IMPORTED_MODULE_2__.OperationStatus.Failure;
16965
18162
  this.error = error;
16966
18163
  // Delegate global state reporting
16967
- onResult(this);
18164
+ await onResult(this);
16968
18165
  }
16969
18166
  finally {
16970
- (_c = this._collatedWriter) === null || _c === void 0 ? void 0 : _c.close();
16971
- this.stdioSummarizer.close();
16972
- this.stopwatch.stop();
18167
+ if (this.status !== _OperationStatus__WEBPACK_IMPORTED_MODULE_2__.OperationStatus.RemoteExecuting) {
18168
+ (_c = this._collatedWriter) === null || _c === void 0 ? void 0 : _c.close();
18169
+ this.stdioSummarizer.close();
18170
+ this.stopwatch.stop();
18171
+ }
16973
18172
  (_e = (_d = this._context).onOperationStatusChanged) === null || _e === void 0 ? void 0 : _e.call(_d, this);
16974
18173
  }
16975
18174
  }
@@ -17297,6 +18496,35 @@ function writeSummaryHeader(terminal, status, operations, headingColor) {
17297
18496
 
17298
18497
  /***/ }),
17299
18498
 
18499
+ /***/ 478998:
18500
+ /*!*************************************************************!*\
18501
+ !*** ./lib-esnext/logic/operations/OperationRunnerHooks.js ***!
18502
+ \*************************************************************/
18503
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18504
+
18505
+ __webpack_require__.r(__webpack_exports__);
18506
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18507
+ /* harmony export */ "OperationRunnerHooks": () => (/* binding */ OperationRunnerHooks)
18508
+ /* harmony export */ });
18509
+ /* harmony import */ var tapable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tapable */ 934828);
18510
+ /* harmony import */ var tapable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tapable__WEBPACK_IMPORTED_MODULE_0__);
18511
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
18512
+ // See LICENSE in the project root for license information.
18513
+
18514
+ /**
18515
+ * Hooks into the lifecycle of the operation runner
18516
+ *
18517
+ */
18518
+ class OperationRunnerHooks {
18519
+ constructor() {
18520
+ this.beforeExecute = new tapable__WEBPACK_IMPORTED_MODULE_0__.AsyncSeriesWaterfallHook(['beforeExecuteContext'], 'beforeExecute');
18521
+ this.afterExecute = new tapable__WEBPACK_IMPORTED_MODULE_0__.AsyncSeriesWaterfallHook(['afterExecuteContext'], 'afterExecute');
18522
+ }
18523
+ }
18524
+ //# sourceMappingURL=OperationRunnerHooks.js.map
18525
+
18526
+ /***/ }),
18527
+
17300
18528
  /***/ 600463:
17301
18529
  /*!***********************************************************!*\
17302
18530
  !*** ./lib-esnext/logic/operations/OperationStateFile.js ***!
@@ -17327,7 +18555,7 @@ class OperationStateFile {
17327
18555
  return this._state;
17328
18556
  }
17329
18557
  async writeAsync(json) {
17330
- await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.JsonFile.saveAsync(json, this.filepath, { ensureFolderExists: true, updateExistingFile: true });
18558
+ await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.JsonFile.saveAsync(json, this.filepath, { ensureFolderExists: true });
17331
18559
  this._state = json;
17332
18560
  }
17333
18561
  async tryRestoreAsync() {
@@ -17373,10 +18601,18 @@ var OperationStatus;
17373
18601
  * The Operation is on the queue, ready to execute (but may be waiting for dependencies)
17374
18602
  */
17375
18603
  OperationStatus["Ready"] = "READY";
18604
+ /**
18605
+ * The Operation is Queued
18606
+ */
18607
+ OperationStatus["Queued"] = "QUEUED";
17376
18608
  /**
17377
18609
  * The Operation is currently executing
17378
18610
  */
17379
18611
  OperationStatus["Executing"] = "EXECUTING";
18612
+ /**
18613
+ * The Operation is currently executing by a remote process
18614
+ */
18615
+ OperationStatus["RemoteExecuting"] = "REMOTE EXECUTING";
17380
18616
  /**
17381
18617
  * The Operation completed successfully and did not write to standard output
17382
18618
  */
@@ -17410,6 +18646,59 @@ var OperationStatus;
17410
18646
 
17411
18647
  /***/ }),
17412
18648
 
18649
+ /***/ 476093:
18650
+ /*!*********************************************************!*\
18651
+ !*** ./lib-esnext/logic/operations/PeriodicCallback.js ***!
18652
+ \*********************************************************/
18653
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18654
+
18655
+ __webpack_require__.r(__webpack_exports__);
18656
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18657
+ /* harmony export */ "PeriodicCallback": () => (/* binding */ PeriodicCallback)
18658
+ /* harmony export */ });
18659
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
18660
+ // See LICENSE in the project root for license information.
18661
+ /**
18662
+ * A help class to run callbacks in a loop with a specified interval.
18663
+ *
18664
+ * @beta
18665
+ */
18666
+ class PeriodicCallback {
18667
+ constructor(options) {
18668
+ this._callbacks = [];
18669
+ this._interval = options.interval;
18670
+ this._isRunning = false;
18671
+ }
18672
+ addCallback(callback) {
18673
+ if (this._isRunning) {
18674
+ throw new Error('Can not add callback while watcher is running');
18675
+ }
18676
+ this._callbacks.push(callback);
18677
+ }
18678
+ start() {
18679
+ if (this._intervalId) {
18680
+ throw new Error('Watcher already started');
18681
+ }
18682
+ if (this._callbacks.length === 0) {
18683
+ return;
18684
+ }
18685
+ this._isRunning = true;
18686
+ this._intervalId = setInterval(() => {
18687
+ this._callbacks.forEach((callback) => callback());
18688
+ }, this._interval);
18689
+ }
18690
+ stop() {
18691
+ if (this._intervalId) {
18692
+ clearInterval(this._intervalId);
18693
+ this._intervalId = undefined;
18694
+ this._isRunning = false;
18695
+ }
18696
+ }
18697
+ }
18698
+ //# sourceMappingURL=PeriodicCallback.js.map
18699
+
18700
+ /***/ }),
18701
+
17413
18702
  /***/ 797379:
17414
18703
  /*!**************************************************************!*\
17415
18704
  !*** ./lib-esnext/logic/operations/PhasedOperationPlugin.js ***!
@@ -17641,16 +18930,14 @@ __webpack_require__.r(__webpack_exports__);
17641
18930
  /* harmony import */ var _rushstack_terminal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_rushstack_terminal__WEBPACK_IMPORTED_MODULE_2__);
17642
18931
  /* harmony import */ var _rushstack_stream_collator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @rushstack/stream-collator */ 121452);
17643
18932
  /* harmony import */ var _rushstack_stream_collator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_rushstack_stream_collator__WEBPACK_IMPORTED_MODULE_3__);
17644
- /* harmony import */ var _utilities_Utilities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utilities/Utilities */ 827501);
17645
- /* harmony import */ var _OperationStatus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./OperationStatus */ 476597);
17646
- /* harmony import */ var _OperationError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./OperationError */ 593956);
17647
- /* harmony import */ var _ProjectLogWritable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ProjectLogWritable */ 471311);
17648
- /* harmony import */ var _buildCache_ProjectBuildCache__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../buildCache/ProjectBuildCache */ 700587);
17649
- /* harmony import */ var _buildCache_getHashesForGlobsAsync__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../buildCache/getHashesForGlobsAsync */ 653062);
17650
- /* harmony import */ var _api_RushProjectConfiguration__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../api/RushProjectConfiguration */ 514639);
17651
- /* harmony import */ var _utilities_CollatedTerminalProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utilities/CollatedTerminalProvider */ 782038);
17652
- /* harmony import */ var _RushConstants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../RushConstants */ 951904);
17653
- /* harmony import */ var _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../api/EnvironmentConfiguration */ 382806);
18933
+ /* harmony import */ var _utilities_Utilities__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utilities/Utilities */ 827501);
18934
+ /* harmony import */ var _OperationStatus__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./OperationStatus */ 476597);
18935
+ /* harmony import */ var _OperationError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./OperationError */ 593956);
18936
+ /* harmony import */ var _ProjectLogWritable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ProjectLogWritable */ 471311);
18937
+ /* harmony import */ var _utilities_CollatedTerminalProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utilities/CollatedTerminalProvider */ 782038);
18938
+ /* harmony import */ var _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../api/EnvironmentConfiguration */ 382806);
18939
+ /* harmony import */ var _PeriodicCallback__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PeriodicCallback */ 476093);
18940
+ /* harmony import */ var _OperationRunnerHooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./OperationRunnerHooks */ 478998);
17654
18941
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
17655
18942
  // See LICENSE in the project root for license information.
17656
18943
 
@@ -17665,21 +18952,6 @@ __webpack_require__.r(__webpack_exports__);
17665
18952
 
17666
18953
 
17667
18954
 
17668
-
17669
-
17670
- function _areShallowEqual(object1, object2) {
17671
- for (const n in object1) {
17672
- if (!(n in object2) || object1[n] !== object2[n]) {
17673
- return false;
17674
- }
17675
- }
17676
- for (const n in object2) {
17677
- if (!(n in object1)) {
17678
- return false;
17679
- }
17680
- }
17681
- return true;
17682
- }
17683
18955
  /**
17684
18956
  * An `IOperationRunner` subclass that performs an operation via a shell command.
17685
18957
  * Currently contains the build cache logic, pending extraction as separate operations.
@@ -17687,42 +18959,36 @@ function _areShallowEqual(object1, object2) {
17687
18959
  */
17688
18960
  class ShellOperationRunner {
17689
18961
  constructor(options) {
17690
- // This runner supports cache writes by default.
17691
- this.isCacheWriteAllowed = true;
17692
18962
  this.reportTiming = true;
17693
18963
  this.silent = false;
17694
- /**
17695
- * UNINITIALIZED === we haven't tried to initialize yet
17696
- * undefined === we didn't create one because the feature is not enabled
17697
- */
17698
- this._projectBuildCache = _utilities_Utilities__WEBPACK_IMPORTED_MODULE_4__.UNINITIALIZED;
17699
18964
  const { phase } = options;
17700
18965
  this.name = options.displayName;
17701
18966
  this._rushProject = options.rushProject;
17702
18967
  this._phase = phase;
17703
18968
  this._rushConfiguration = options.rushConfiguration;
17704
- this._buildCacheConfiguration = options.buildCacheConfiguration;
17705
18969
  this._commandName = phase.name;
17706
18970
  this._commandToRun = options.commandToRun;
17707
- this._isCacheReadAllowed = options.isIncrementalBuildAllowed;
17708
- this.isSkipAllowed = options.isIncrementalBuildAllowed;
17709
18971
  this._projectChangeAnalyzer = options.projectChangeAnalyzer;
17710
18972
  this._packageDepsFilename = `package-deps_${phase.logFilenameIdentifier}.json`;
17711
18973
  this.warningsAreAllowed =
17712
- _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_5__.EnvironmentConfiguration.allowWarningsInSuccessfulBuild || phase.allowWarningsOnSuccess || false;
18974
+ _api_EnvironmentConfiguration__WEBPACK_IMPORTED_MODULE_4__.EnvironmentConfiguration.allowWarningsInSuccessfulBuild || phase.allowWarningsOnSuccess || false;
17713
18975
  this._logFilenameIdentifier = phase.logFilenameIdentifier;
17714
18976
  this._selectedPhases = options.selectedPhases;
18977
+ this.hooks = new _OperationRunnerHooks__WEBPACK_IMPORTED_MODULE_5__.OperationRunnerHooks();
18978
+ this.periodicCallback = new _PeriodicCallback__WEBPACK_IMPORTED_MODULE_6__.PeriodicCallback({
18979
+ interval: 10 * 1000
18980
+ });
17715
18981
  }
17716
18982
  async executeAsync(context) {
17717
18983
  try {
17718
18984
  return await this._executeAsync(context);
17719
18985
  }
17720
18986
  catch (error) {
17721
- throw new _OperationError__WEBPACK_IMPORTED_MODULE_6__.OperationError('executing', error.message);
18987
+ throw new _OperationError__WEBPACK_IMPORTED_MODULE_7__.OperationError('executing', error.message);
17722
18988
  }
17723
18989
  }
17724
18990
  async _executeAsync(context) {
17725
- var _a, _b, _c;
18991
+ var _a;
17726
18992
  // TERMINAL PIPELINE:
17727
18993
  //
17728
18994
  // +--> quietModeTransform? --> collatedWriter
@@ -17730,7 +18996,7 @@ class ShellOperationRunner {
17730
18996
  // normalizeNewlineTransform --1--> stderrLineTransform --2--> removeColorsTransform --> projectLogWritable
17731
18997
  // |
17732
18998
  // +--> stdioSummarizer
17733
- const projectLogWritable = new _ProjectLogWritable__WEBPACK_IMPORTED_MODULE_7__.ProjectLogWritable(this._rushProject, context.collatedWriter.terminal, this._logFilenameIdentifier);
18999
+ const projectLogWritable = new _ProjectLogWritable__WEBPACK_IMPORTED_MODULE_8__.ProjectLogWritable(this._rushProject, context.collatedWriter.terminal, this._logFilenameIdentifier);
17734
19000
  try {
17735
19001
  const removeColorsTransform = new _rushstack_terminal__WEBPACK_IMPORTED_MODULE_2__.TextRewriterTransform({
17736
19002
  destination: projectLogWritable,
@@ -17756,7 +19022,7 @@ class ShellOperationRunner {
17756
19022
  ensureNewlineAtEnd: true
17757
19023
  });
17758
19024
  const collatedTerminal = new _rushstack_stream_collator__WEBPACK_IMPORTED_MODULE_3__.CollatedTerminal(normalizeNewlineTransform);
17759
- const terminalProvider = new _utilities_CollatedTerminalProvider__WEBPACK_IMPORTED_MODULE_8__.CollatedTerminalProvider(collatedTerminal, {
19025
+ const terminalProvider = new _utilities_CollatedTerminalProvider__WEBPACK_IMPORTED_MODULE_9__.CollatedTerminalProvider(collatedTerminal, {
17760
19026
  debugEnabled: context.debugMode
17761
19027
  });
17762
19028
  const terminal = new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.Terminal(terminalProvider);
@@ -17790,15 +19056,6 @@ class ShellOperationRunner {
17790
19056
  arguments: this._commandToRun
17791
19057
  };
17792
19058
  }
17793
- else if (this.isSkipAllowed) {
17794
- // To test this code path:
17795
- // Remove the `.git` folder then run "rush build --verbose"
17796
- terminal.writeLine({
17797
- text: _rushstack_terminal__WEBPACK_IMPORTED_MODULE_2__.PrintUtilities.wrapWords('This workspace does not appear to be tracked by Git. ' +
17798
- 'Rush will proceed without incremental execution, caching, and change detection.'),
17799
- foregroundColor: _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.ColorValue.Cyan
17800
- });
17801
- }
17802
19059
  }
17803
19060
  catch (error) {
17804
19061
  // To test this code path:
@@ -17809,49 +19066,24 @@ class ShellOperationRunner {
17809
19066
  foregroundColor: _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.ColorValue.Cyan
17810
19067
  });
17811
19068
  }
17812
- // If possible, we want to skip this operation -- either by restoring it from the
17813
- // cache, if caching is enabled, or determining that the project
17814
- // is unchanged (using the older incremental execution logic). These two approaches,
17815
- // "caching" and "skipping", are incompatible, so only one applies.
17816
- //
17817
- // Note that "caching" and "skipping" take two different approaches
17818
- // to tracking dependents:
17819
- //
17820
- // - For caching, "isCacheReadAllowed" is set if a project supports
17821
- // incremental builds, and determining whether this project or a dependent
17822
- // has changed happens inside the hashing logic.
17823
- //
17824
- // - For skipping, "isSkipAllowed" is set to true initially, and during
17825
- // the process of running dependents, it will be changed by OperationExecutionManager to
17826
- // false if a dependency wasn't able to be skipped.
17827
- //
17828
- let buildCacheReadAttempted = false;
17829
- if (this._isCacheReadAllowed) {
17830
- const projectBuildCache = await this._tryGetProjectBuildCacheAsync({
17831
- terminal,
17832
- trackedProjectFiles,
17833
- operationMetadataManager: context._operationMetadataManager
17834
- });
17835
- buildCacheReadAttempted = !!projectBuildCache;
17836
- const restoreFromCacheSuccess = await (projectBuildCache === null || projectBuildCache === void 0 ? void 0 : projectBuildCache.tryRestoreFromCacheAsync(terminal));
17837
- if (restoreFromCacheSuccess) {
17838
- // Restore the original state of the operation without cache
17839
- await ((_a = context._operationMetadataManager) === null || _a === void 0 ? void 0 : _a.tryRestoreAsync({
17840
- terminal,
17841
- logPath: projectLogWritable.logPath,
17842
- errorLogPath: projectLogWritable.errorLogPath
17843
- }));
17844
- return _OperationStatus__WEBPACK_IMPORTED_MODULE_9__.OperationStatus.FromCache;
17845
- }
17846
- }
17847
- if (this.isSkipAllowed && !buildCacheReadAttempted) {
17848
- const isPackageUnchanged = !!(lastProjectDeps &&
17849
- projectDeps &&
17850
- projectDeps.arguments === lastProjectDeps.arguments &&
17851
- _areShallowEqual(projectDeps.files, lastProjectDeps.files));
17852
- if (isPackageUnchanged) {
17853
- return _OperationStatus__WEBPACK_IMPORTED_MODULE_9__.OperationStatus.Skipped;
17854
- }
19069
+ const beforeExecuteContext = {
19070
+ context,
19071
+ runner: this,
19072
+ terminal,
19073
+ projectDeps,
19074
+ lastProjectDeps,
19075
+ trackedProjectFiles,
19076
+ logPath: projectLogWritable.logPath,
19077
+ errorLogPath: projectLogWritable.errorLogPath,
19078
+ rushProject: this._rushProject,
19079
+ phase: this._phase,
19080
+ commandName: this._commandName,
19081
+ commandToRun: this._commandToRun,
19082
+ earlyReturnStatus: undefined
19083
+ };
19084
+ await this.hooks.beforeExecute.promise(beforeExecuteContext);
19085
+ if (beforeExecuteContext.earlyReturnStatus) {
19086
+ return beforeExecuteContext.earlyReturnStatus;
17855
19087
  }
17856
19088
  // If the deps file exists, remove it before starting execution.
17857
19089
  _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.FileSystem.deleteFile(currentDepsPath);
@@ -17866,11 +19098,12 @@ class ShellOperationRunner {
17866
19098
  ensureFolderExists: true
17867
19099
  });
17868
19100
  }
17869
- return _OperationStatus__WEBPACK_IMPORTED_MODULE_9__.OperationStatus.Success;
19101
+ return _OperationStatus__WEBPACK_IMPORTED_MODULE_10__.OperationStatus.Success;
17870
19102
  }
17871
19103
  // Run the operation
17872
19104
  terminal.writeLine('Invoking: ' + this._commandToRun);
17873
- const subProcess = _utilities_Utilities__WEBPACK_IMPORTED_MODULE_4__.Utilities.executeLifecycleCommandAsync(this._commandToRun, {
19105
+ this.periodicCallback.start();
19106
+ const subProcess = _utilities_Utilities__WEBPACK_IMPORTED_MODULE_11__.Utilities.executeLifecycleCommandAsync(this._commandToRun, {
17874
19107
  rushConfiguration: this._rushConfiguration,
17875
19108
  workingDirectory: projectFolder,
17876
19109
  initCwd: this._rushConfiguration.commonTempFolder,
@@ -17893,17 +19126,21 @@ class ShellOperationRunner {
17893
19126
  hasWarningOrError = true;
17894
19127
  });
17895
19128
  }
19129
+ let exitCode = 1;
17896
19130
  let status = await new Promise((resolve, reject) => {
17897
19131
  subProcess.on('close', (code) => {
19132
+ exitCode = code;
17898
19133
  try {
17899
19134
  if (code !== 0) {
17900
- reject(new _OperationError__WEBPACK_IMPORTED_MODULE_6__.OperationError('error', `Returned error code: ${code}`));
19135
+ // Do NOT reject here immediately, give a chance for hooks to suppress the error
19136
+ context.error = new _OperationError__WEBPACK_IMPORTED_MODULE_7__.OperationError('error', `Returned error code: ${code}`);
19137
+ resolve(_OperationStatus__WEBPACK_IMPORTED_MODULE_10__.OperationStatus.Failure);
17901
19138
  }
17902
19139
  else if (hasWarningOrError) {
17903
- resolve(_OperationStatus__WEBPACK_IMPORTED_MODULE_9__.OperationStatus.SuccessWithWarning);
19140
+ resolve(_OperationStatus__WEBPACK_IMPORTED_MODULE_10__.OperationStatus.SuccessWithWarning);
17904
19141
  }
17905
19142
  else {
17906
- resolve(_OperationStatus__WEBPACK_IMPORTED_MODULE_9__.OperationStatus.Success);
19143
+ resolve(_OperationStatus__WEBPACK_IMPORTED_MODULE_10__.OperationStatus.Success);
17907
19144
  }
17908
19145
  }
17909
19146
  catch (error) {
@@ -17911,39 +19148,39 @@ class ShellOperationRunner {
17911
19148
  }
17912
19149
  });
17913
19150
  });
17914
- const taskIsSuccessful = status === _OperationStatus__WEBPACK_IMPORTED_MODULE_9__.OperationStatus.Success ||
17915
- (status === _OperationStatus__WEBPACK_IMPORTED_MODULE_9__.OperationStatus.SuccessWithWarning &&
19151
+ // Save the metadata to disk
19152
+ const { duration: durationInSeconds } = context.stopwatch;
19153
+ await ((_a = context._operationMetadataManager) === null || _a === void 0 ? void 0 : _a.saveAsync({
19154
+ durationInSeconds,
19155
+ logPath: projectLogWritable.logPath,
19156
+ errorLogPath: projectLogWritable.errorLogPath
19157
+ }));
19158
+ const taskIsSuccessful = status === _OperationStatus__WEBPACK_IMPORTED_MODULE_10__.OperationStatus.Success ||
19159
+ (status === _OperationStatus__WEBPACK_IMPORTED_MODULE_10__.OperationStatus.SuccessWithWarning &&
17916
19160
  this.warningsAreAllowed &&
17917
19161
  !!this._rushConfiguration.experimentsConfiguration.configuration
17918
19162
  .buildCacheWithAllowWarningsInSuccessfulBuild);
17919
19163
  if (taskIsSuccessful && projectDeps) {
17920
19164
  // Write deps on success.
17921
- const writeProjectStatePromise = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.saveAsync(projectDeps, currentDepsPath, {
19165
+ await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.saveAsync(projectDeps, currentDepsPath, {
17922
19166
  ensureFolderExists: true
17923
19167
  });
17924
- // If the operation without cache was successful, we can save the metadata to disk
17925
- const { duration: durationInSeconds } = context.stopwatch;
17926
- await ((_b = context._operationMetadataManager) === null || _b === void 0 ? void 0 : _b.saveAsync({
17927
- durationInSeconds,
17928
- logPath: projectLogWritable.logPath,
17929
- errorLogPath: projectLogWritable.errorLogPath
17930
- }));
17931
- // If the command is successful, we can calculate project hash, and no dependencies were skipped,
17932
- // write a new cache entry.
17933
- const setCacheEntryPromise = this.isCacheWriteAllowed
17934
- ? (_c = (await this._tryGetProjectBuildCacheAsync({
17935
- terminal,
17936
- trackedProjectFiles,
17937
- operationMetadataManager: context._operationMetadataManager
17938
- }))) === null || _c === void 0 ? void 0 : _c.trySetCacheEntryAsync(terminal)
17939
- : undefined;
17940
- const [, cacheWriteSuccess] = await Promise.all([writeProjectStatePromise, setCacheEntryPromise]);
17941
- if (terminalProvider.hasErrors) {
17942
- status = _OperationStatus__WEBPACK_IMPORTED_MODULE_9__.OperationStatus.Failure;
17943
- }
17944
- else if (cacheWriteSuccess === false) {
17945
- status = _OperationStatus__WEBPACK_IMPORTED_MODULE_9__.OperationStatus.SuccessWithWarning;
17946
- }
19168
+ }
19169
+ const afterExecuteContext = {
19170
+ context,
19171
+ terminal,
19172
+ exitCode,
19173
+ status,
19174
+ taskIsSuccessful
19175
+ };
19176
+ await this.hooks.afterExecute.promise(afterExecuteContext);
19177
+ if (context.error) {
19178
+ throw context.error;
19179
+ }
19180
+ // Sync the status in case it was changed by the hook
19181
+ status = afterExecuteContext.status;
19182
+ if (terminalProvider.hasErrors) {
19183
+ status = _OperationStatus__WEBPACK_IMPORTED_MODULE_10__.OperationStatus.Failure;
17947
19184
  }
17948
19185
  normalizeNewlineTransform.close();
17949
19186
  // If the pipeline is wired up correctly, then closing normalizeNewlineTransform should
@@ -17955,70 +19192,9 @@ class ShellOperationRunner {
17955
19192
  }
17956
19193
  finally {
17957
19194
  projectLogWritable.close();
19195
+ this.periodicCallback.stop();
17958
19196
  }
17959
19197
  }
17960
- async _tryGetProjectBuildCacheAsync({ terminal, trackedProjectFiles, operationMetadataManager }) {
17961
- if (this._projectBuildCache === _utilities_Utilities__WEBPACK_IMPORTED_MODULE_4__.UNINITIALIZED) {
17962
- this._projectBuildCache = undefined;
17963
- if (this._buildCacheConfiguration && this._buildCacheConfiguration.buildCacheEnabled) {
17964
- // Disable legacy skip logic if the build cache is in play
17965
- this.isSkipAllowed = false;
17966
- const projectConfiguration = await _api_RushProjectConfiguration__WEBPACK_IMPORTED_MODULE_10__.RushProjectConfiguration.tryLoadForProjectAsync(this._rushProject, terminal);
17967
- if (projectConfiguration) {
17968
- projectConfiguration.validatePhaseConfiguration(this._selectedPhases, terminal);
17969
- if (projectConfiguration.disableBuildCacheForProject) {
17970
- terminal.writeVerboseLine('Caching has been disabled for this project.');
17971
- }
17972
- else {
17973
- const operationSettings = projectConfiguration.operationSettingsByOperationName.get(this._commandName);
17974
- if (!operationSettings) {
17975
- terminal.writeVerboseLine(`This project does not define the caching behavior of the "${this._commandName}" command, so caching has been disabled.`);
17976
- }
17977
- else if (operationSettings.disableBuildCacheForOperation) {
17978
- terminal.writeVerboseLine(`Caching has been disabled for this project's "${this._commandName}" command.`);
17979
- }
17980
- else {
17981
- const projectOutputFolderNames = operationSettings.outputFolderNames || [];
17982
- const additionalProjectOutputFilePaths = [
17983
- ...((operationMetadataManager === null || operationMetadataManager === void 0 ? void 0 : operationMetadataManager.relativeFilepaths) || [])
17984
- ];
17985
- const additionalContext = {};
17986
- if (operationSettings.dependsOnEnvVars) {
17987
- for (const varName of operationSettings.dependsOnEnvVars) {
17988
- additionalContext['$' + varName] = process.env[varName] || '';
17989
- }
17990
- }
17991
- if (operationSettings.dependsOnAdditionalFiles) {
17992
- const repoState = await this._projectChangeAnalyzer._ensureInitializedAsync(terminal);
17993
- const additionalFiles = await (0,_buildCache_getHashesForGlobsAsync__WEBPACK_IMPORTED_MODULE_11__.getHashesForGlobsAsync)(operationSettings.dependsOnAdditionalFiles, this._rushProject.projectFolder, repoState);
17994
- terminal.writeDebugLine(`Including additional files to calculate build cache hash:\n ${Array.from(additionalFiles.keys()).join('\n ')} `);
17995
- for (const [filePath, fileHash] of additionalFiles) {
17996
- additionalContext['file://' + filePath] = fileHash;
17997
- }
17998
- }
17999
- this._projectBuildCache = await _buildCache_ProjectBuildCache__WEBPACK_IMPORTED_MODULE_12__.ProjectBuildCache.tryGetProjectBuildCache({
18000
- projectConfiguration,
18001
- projectOutputFolderNames,
18002
- additionalProjectOutputFilePaths,
18003
- additionalContext,
18004
- buildCacheConfiguration: this._buildCacheConfiguration,
18005
- terminal,
18006
- command: this._commandToRun,
18007
- trackedProjectFiles: trackedProjectFiles,
18008
- projectChangeAnalyzer: this._projectChangeAnalyzer,
18009
- phaseName: this._phase.name
18010
- });
18011
- }
18012
- }
18013
- }
18014
- else {
18015
- terminal.writeVerboseLine(`Project does not have a ${_RushConstants__WEBPACK_IMPORTED_MODULE_13__.RushConstants.rushProjectConfigFilename} configuration file, ` +
18016
- 'or one provided by a rig, so it does not support caching.');
18017
- }
18018
- }
18019
- }
18020
- return this._projectBuildCache;
18021
- }
18022
19198
  }
18023
19199
  /**
18024
19200
  * When running a command from the "scripts" block in package.json, if the command
@@ -18102,7 +19278,7 @@ class ShellOperationRunnerPlugin {
18102
19278
  }
18103
19279
  }
18104
19280
  function createShellOperations(operations, context) {
18105
- const { buildCacheConfiguration, isIncrementalBuildAllowed, phaseSelection: selectedPhases, projectChangeAnalyzer, rushConfiguration } = context;
19281
+ const { phaseSelection: selectedPhases, projectChangeAnalyzer, rushConfiguration } = context;
18106
19282
  const customParametersByPhase = new Map();
18107
19283
  function getCustomParameterValuesForPhase(phase) {
18108
19284
  let customParameterValues = customParametersByPhase.get(phase);
@@ -18127,17 +19303,16 @@ function createShellOperations(operations, context) {
18127
19303
  }
18128
19304
  const displayName = getDisplayName(phase, project);
18129
19305
  if (commandToRun) {
18130
- operation.runner = new _ShellOperationRunner__WEBPACK_IMPORTED_MODULE_0__.ShellOperationRunner({
18131
- buildCacheConfiguration,
19306
+ const shellOperationRunner = new _ShellOperationRunner__WEBPACK_IMPORTED_MODULE_0__.ShellOperationRunner({
18132
19307
  commandToRun: commandToRun || '',
18133
19308
  displayName,
18134
- isIncrementalBuildAllowed,
18135
19309
  phase,
18136
19310
  projectChangeAnalyzer,
18137
19311
  rushConfiguration,
18138
19312
  rushProject: project,
18139
19313
  selectedPhases
18140
19314
  });
19315
+ operation.runner = shellOperationRunner;
18141
19316
  }
18142
19317
  else {
18143
19318
  // Empty build script indicates a no-op, so use a no-op runner
@@ -18286,20 +19461,40 @@ __webpack_require__.r(__webpack_exports__);
18286
19461
  /* harmony export */ });
18287
19462
  /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crypto */ 706113);
18288
19463
  /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_0__);
18289
- /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
18290
- /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__);
18291
- /* harmony import */ var _base_BaseProjectShrinkwrapFile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base/BaseProjectShrinkwrapFile */ 894306);
18292
- /* harmony import */ var _RushConstants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../RushConstants */ 951904);
19464
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ 371017);
19465
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
19466
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
19467
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__);
19468
+ /* harmony import */ var _base_BaseProjectShrinkwrapFile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/BaseProjectShrinkwrapFile */ 894306);
19469
+ /* harmony import */ var _PnpmShrinkwrapFile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PnpmShrinkwrapFile */ 930997);
19470
+ /* harmony import */ var _RushConstants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../RushConstants */ 951904);
18293
19471
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
18294
19472
  // See LICENSE in the project root for license information.
18295
19473
 
18296
19474
 
18297
19475
 
18298
19476
 
19477
+
19478
+
18299
19479
  /**
18300
19480
  *
18301
19481
  */
18302
- class PnpmProjectShrinkwrapFile extends _base_BaseProjectShrinkwrapFile__WEBPACK_IMPORTED_MODULE_2__.BaseProjectShrinkwrapFile {
19482
+ class PnpmProjectShrinkwrapFile extends _base_BaseProjectShrinkwrapFile__WEBPACK_IMPORTED_MODULE_3__.BaseProjectShrinkwrapFile {
19483
+ /**
19484
+ * When split workspace projects turn off shared-workspace-lockfiles, Pnpm creates individual
19485
+ * shrinkwrap files for each project.
19486
+ */
19487
+ static async generateIndividualProjectShrinkwrapAsync(project) {
19488
+ const shrinkwrapPath = path__WEBPACK_IMPORTED_MODULE_1__.join(project.projectFolder, _RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.pnpmV3ShrinkwrapFilename);
19489
+ const shrinkwrapFile = _PnpmShrinkwrapFile__WEBPACK_IMPORTED_MODULE_5__.PnpmShrinkwrapFile.loadFromFile(shrinkwrapPath);
19490
+ if (!shrinkwrapFile) {
19491
+ // Individual shrinkwrap may does not exist when partial install.
19492
+ return;
19493
+ }
19494
+ shrinkwrapFile.setIndividualPackage(project.packageName);
19495
+ const projectShrinkwrapFile = new PnpmProjectShrinkwrapFile(shrinkwrapFile, project);
19496
+ await projectShrinkwrapFile.updateProjectShrinkwrapAsync();
19497
+ }
18303
19498
  /**
18304
19499
  * Generate and write the project shrinkwrap file to <project>/.rush/temp/shrinkwrap-deps.json.
18305
19500
  * @returns True if the project shrinkwrap was created or updated, false otherwise.
@@ -18336,9 +19531,16 @@ class PnpmProjectShrinkwrapFile extends _base_BaseProjectShrinkwrapFile__WEBPACK
18336
19531
  * Generate the project shrinkwrap file content
18337
19532
  */
18338
19533
  generateProjectShrinkwrapMap() {
18339
- const projectShrinkwrapMap = this.shrinkwrapFile.isWorkspaceCompatible
18340
- ? this.generateWorkspaceProjectShrinkwrapMap()
18341
- : this.generateLegacyProjectShrinkwrapMap();
19534
+ let projectShrinkwrapMap = undefined;
19535
+ if (this.shrinkwrapFile.isIndividual) {
19536
+ projectShrinkwrapMap = this.generateIndividualProjectShrinkwrapMap();
19537
+ }
19538
+ else if (this.shrinkwrapFile.isWorkspaceCompatible) {
19539
+ projectShrinkwrapMap = this.generateWorkspaceProjectShrinkwrapMap();
19540
+ }
19541
+ else {
19542
+ projectShrinkwrapMap = this.generateLegacyProjectShrinkwrapMap();
19543
+ }
18342
19544
  return projectShrinkwrapMap;
18343
19545
  }
18344
19546
  generateWorkspaceProjectShrinkwrapMap() {
@@ -18359,7 +19561,7 @@ class PnpmProjectShrinkwrapFile extends _base_BaseProjectShrinkwrapFile__WEBPACK
18359
19561
  ];
18360
19562
  const projectShrinkwrapMap = new Map();
18361
19563
  for (const [name, version] of allDependencies) {
18362
- if (name.indexOf(`${_RushConstants__WEBPACK_IMPORTED_MODULE_3__.RushConstants.rushTempNpmScope}/`) < 0) {
19564
+ if (name.indexOf(`${_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.rushTempNpmScope}/`) < 0) {
18363
19565
  // Only select the shrinkwrap dependencies that are non-local since we already handle local
18364
19566
  // project changes
18365
19567
  this._addDependencyRecursive(projectShrinkwrapMap, name, version, parentShrinkwrapEntry);
@@ -18370,6 +19572,10 @@ class PnpmProjectShrinkwrapFile extends _base_BaseProjectShrinkwrapFile__WEBPACK
18370
19572
  this._resolveAndAddPeerDependencies(projectShrinkwrapMap, parentShrinkwrapEntry);
18371
19573
  return projectShrinkwrapMap;
18372
19574
  }
19575
+ generateIndividualProjectShrinkwrapMap() {
19576
+ const projectShrinkwrapMap = this.shrinkwrapFile.getIntegrityForIndividualProject();
19577
+ return projectShrinkwrapMap;
19578
+ }
18373
19579
  _addDependencyRecursive(projectShrinkwrapMap, name, version, parentShrinkwrapEntry, throwIfShrinkwrapEntryMissing = true) {
18374
19580
  var _a;
18375
19581
  const specifier = `${name}@${version}`;
@@ -18380,7 +19586,7 @@ class PnpmProjectShrinkwrapFile extends _base_BaseProjectShrinkwrapFile__WEBPACK
18380
19586
  const shrinkwrapEntry = this.shrinkwrapFile.getShrinkwrapEntry(name, version);
18381
19587
  if (!shrinkwrapEntry) {
18382
19588
  if (throwIfShrinkwrapEntryMissing) {
18383
- throw new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.InternalError(`Unable to find dependency ${name} with version ${version} in shrinkwrap.`);
19589
+ throw new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.InternalError(`Unable to find dependency ${name} with version ${version} in shrinkwrap.`);
18384
19590
  }
18385
19591
  return;
18386
19592
  }
@@ -18421,7 +19627,7 @@ class PnpmProjectShrinkwrapFile extends _base_BaseProjectShrinkwrapFile__WEBPACK
18421
19627
  var _a, _b, _c;
18422
19628
  for (const peerDependencyName of Object.keys(shrinkwrapEntry.peerDependencies || {})) {
18423
19629
  // Skip peer dependency resolution of local package peer dependencies
18424
- if (peerDependencyName.indexOf(_RushConstants__WEBPACK_IMPORTED_MODULE_3__.RushConstants.rushTempNpmScope) !== -1) {
19630
+ if (peerDependencyName.indexOf(_RushConstants__WEBPACK_IMPORTED_MODULE_4__.RushConstants.rushTempNpmScope) !== -1) {
18425
19631
  continue;
18426
19632
  }
18427
19633
  // Check to see if the peer dependency is satisfied with the current shrinkwrap
@@ -18452,7 +19658,7 @@ class PnpmProjectShrinkwrapFile extends _base_BaseProjectShrinkwrapFile__WEBPACK
18452
19658
  for (const key of keys) {
18453
19659
  file[key] = projectShrinkwrapMap.get(key);
18454
19660
  }
18455
- await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.saveAsync(file, this.projectShrinkwrapFilePath, { ensureFolderExists: true });
19661
+ await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_2__.JsonFile.saveAsync(file, this.projectShrinkwrapFilePath, { ensureFolderExists: true });
18456
19662
  }
18457
19663
  }
18458
19664
  //# sourceMappingURL=PnpmProjectShrinkwrapFile.js.map
@@ -18482,9 +19688,10 @@ __webpack_require__.r(__webpack_exports__);
18482
19688
  /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__);
18483
19689
  /* harmony import */ var _base_BaseShrinkwrapFile__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../base/BaseShrinkwrapFile */ 411534);
18484
19690
  /* harmony import */ var _DependencySpecifier__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../DependencySpecifier */ 68654);
18485
- /* harmony import */ var _PnpmYamlCommon__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./PnpmYamlCommon */ 730862);
19691
+ /* harmony import */ var _PnpmYamlCommon__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./PnpmYamlCommon */ 730862);
18486
19692
  /* harmony import */ var _RushConstants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../RushConstants */ 951904);
18487
19693
  /* harmony import */ var _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../api/PackageJsonEditor */ 73666);
19694
+ /* harmony import */ var _SplitWorkspacePnpmfileConfiguration__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./SplitWorkspacePnpmfileConfiguration */ 608961);
18488
19695
  /* harmony import */ var _PnpmfileConfiguration__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./PnpmfileConfiguration */ 238032);
18489
19696
  /* harmony import */ var _PnpmProjectShrinkwrapFile__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PnpmProjectShrinkwrapFile */ 390053);
18490
19697
  /* harmony import */ var _PnpmOptionsConfiguration__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PnpmOptionsConfiguration */ 402835);
@@ -18503,6 +19710,7 @@ __webpack_require__.r(__webpack_exports__);
18503
19710
 
18504
19711
 
18505
19712
 
19713
+
18506
19714
  const yamlModule = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.Import.lazy('js-yaml', require);
18507
19715
  /**
18508
19716
  * Given an encoded "dependency key" from the PNPM shrinkwrap file, this parses it into an equivalent
@@ -18591,9 +19799,12 @@ class PnpmShrinkwrapFile extends _base_BaseShrinkwrapFile__WEBPACK_IMPORTED_MODU
18591
19799
  // Normalize the data
18592
19800
  this.registry = shrinkwrapJson.registry || '';
18593
19801
  this.dependencies = new Map(Object.entries(shrinkwrapJson.dependencies || {}));
19802
+ this.devDependencies = new Map(Object.entries(shrinkwrapJson.devDependencies || {}));
19803
+ this.optionalDependencies = new Map(Object.entries(shrinkwrapJson.optionalDependencies || {}));
18594
19804
  this.importers = new Map(Object.entries(shrinkwrapJson.importers || {}));
18595
19805
  this.specifiers = new Map(Object.entries(shrinkwrapJson.specifiers || {}));
18596
19806
  this.packages = new Map(Object.entries(shrinkwrapJson.packages || {}));
19807
+ this.overrides = new Map(Object.entries(shrinkwrapJson.overrides || {}));
18597
19808
  // Importers only exist in workspaces
18598
19809
  this.isWorkspaceCompatible = this.importers.size > 0;
18599
19810
  this._integrities = new Map();
@@ -18614,6 +19825,15 @@ class PnpmShrinkwrapFile extends _base_BaseShrinkwrapFile__WEBPACK_IMPORTED_MODU
18614
19825
  const parsedData = yamlModule.safeLoad(shrinkwrapContent);
18615
19826
  return new PnpmShrinkwrapFile(parsedData);
18616
19827
  }
19828
+ setIndividualPackage(packageName, splitWorkspaceGlobalPnpmfileConfiguration) {
19829
+ this._individualPackageName = packageName;
19830
+ if (splitWorkspaceGlobalPnpmfileConfiguration) {
19831
+ this._splitWorkspaceGlobalPnpmfileConfiguration = splitWorkspaceGlobalPnpmfileConfiguration;
19832
+ }
19833
+ }
19834
+ get isIndividual() {
19835
+ return this._individualPackageName !== undefined;
19836
+ }
18617
19837
  getShrinkwrapHash(experimentsConfig) {
18618
19838
  // The 'omitImportersFromPreventManualShrinkwrapChanges' experiment skips the 'importers' section
18619
19839
  // when computing the hash, since the main concern is changes to the overall external dependency footprint
@@ -18849,6 +20069,34 @@ class PnpmShrinkwrapFile extends _base_BaseShrinkwrapFile__WEBPACK_IMPORTED_MODU
18849
20069
  }
18850
20070
  return integrityMap;
18851
20071
  }
20072
+ getIntegrityForIndividualProject() {
20073
+ const packageName = this._individualPackageName;
20074
+ if (undefined === packageName) {
20075
+ throw new Error(`Can not generate integrities for shared shrinkwrap file`);
20076
+ }
20077
+ let integrityMap = this._integrities.get(packageName);
20078
+ if (!integrityMap) {
20079
+ integrityMap = new Map();
20080
+ this._integrities.set(packageName, integrityMap);
20081
+ const shrinkwrapHash = this.getShrinkwrapHash();
20082
+ const selfIntegrity = `${packageName}:${shrinkwrapHash}:`;
20083
+ integrityMap.set(packageName, selfIntegrity);
20084
+ const { dependencies, devDependencies, optionalDependencies } = this._getIndividualShrinkwrapImporter();
20085
+ const externalFilter = (name, version) => {
20086
+ return !version.includes('link:');
20087
+ };
20088
+ if (dependencies) {
20089
+ this._addIntegrities(integrityMap, dependencies, false, externalFilter);
20090
+ }
20091
+ if (devDependencies) {
20092
+ this._addIntegrities(integrityMap, devDependencies, false, externalFilter);
20093
+ }
20094
+ if (optionalDependencies) {
20095
+ this._addIntegrities(integrityMap, optionalDependencies, true, externalFilter);
20096
+ }
20097
+ }
20098
+ return integrityMap;
20099
+ }
18852
20100
  /** @override */
18853
20101
  async isWorkspaceProjectModifiedAsync(project, variant) {
18854
20102
  const importerKey = this.getImporterKeyByPath(project.rushConfiguration.commonTempFolder, project.projectFolder);
@@ -18866,7 +20114,76 @@ class PnpmShrinkwrapFile extends _base_BaseShrinkwrapFile__WEBPACK_IMPORTED_MODU
18866
20114
  }
18867
20115
  // Use a new PackageJsonEditor since it will classify each dependency type, making tracking the
18868
20116
  // found versions much simpler.
18869
- const { dependencyList, devDependencyList } = _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_11__.PackageJsonEditor.fromObject(this._pnpmfileConfiguration.transform(packageJson), project.packageJsonEditor.filePath);
20117
+ const transformedPackageJsonEditor = _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_11__.PackageJsonEditor.fromObject(this._pnpmfileConfiguration.transform(packageJson), project.packageJsonEditor.filePath);
20118
+ return this._isProjectModified(transformedPackageJsonEditor, importer);
20119
+ }
20120
+ isSplitWorkspaceProjectModified(project) {
20121
+ const importerKey = this.getImporterKeyByPath(project.rushConfiguration.commonTempSplitFolder, project.projectFolder);
20122
+ const importer = this.getImporter(importerKey);
20123
+ if (!importer) {
20124
+ return true;
20125
+ }
20126
+ if (!this._splitWorkspaceGlobalPnpmfileConfiguration) {
20127
+ this._splitWorkspaceGlobalPnpmfileConfiguration = new _SplitWorkspacePnpmfileConfiguration__WEBPACK_IMPORTED_MODULE_12__.SplitWorkspacePnpmfileConfiguration(project.rushConfiguration);
20128
+ }
20129
+ const packageJson = project.packageJsonEditor.saveToObject();
20130
+ // Use a new PackageJsonEditor since it will classify each dependency type, making tracking the
20131
+ // found versions much simpler.
20132
+ const transformedPackageJsonEditor = _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_11__.PackageJsonEditor.fromObject(this._splitWorkspaceGlobalPnpmfileConfiguration.transform(packageJson), project.packageJsonEditor.filePath);
20133
+ return this._isProjectModified(transformedPackageJsonEditor, importer);
20134
+ }
20135
+ isSplitWorkspaceIndividualProjectModified(project) {
20136
+ var _a, _b;
20137
+ if (!this.isIndividual) {
20138
+ throw new Error(`Can not calculate modified for shared workspace shrinkwrap file`);
20139
+ }
20140
+ if (!this._splitWorkspaceGlobalPnpmfileConfiguration) {
20141
+ this._splitWorkspaceGlobalPnpmfileConfiguration = new _SplitWorkspacePnpmfileConfiguration__WEBPACK_IMPORTED_MODULE_12__.SplitWorkspacePnpmfileConfiguration(project.rushConfiguration);
20142
+ }
20143
+ const packageJson = project.packageJsonEditor.saveToObject();
20144
+ let transformedPackageJson = packageJson;
20145
+ // .pnpmfile.cjs under project folder
20146
+ const individualPnpmfilePath = path__WEBPACK_IMPORTED_MODULE_0__.join(project.projectFolder, _RushConstants__WEBPACK_IMPORTED_MODULE_8__.RushConstants.pnpmfileV6Filename);
20147
+ let individualPnpmfile;
20148
+ if (_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.FileSystem.exists(individualPnpmfilePath)) {
20149
+ try {
20150
+ individualPnpmfile = require(individualPnpmfilePath);
20151
+ }
20152
+ catch (err) {
20153
+ if (err instanceof SyntaxError) {
20154
+ console.error(colors_safe__WEBPACK_IMPORTED_MODULE_3___default().red(`A syntax error in the ${_RushConstants__WEBPACK_IMPORTED_MODULE_8__.RushConstants.pnpmfileV6Filename} at ${individualPnpmfilePath}\n`));
20155
+ }
20156
+ else {
20157
+ console.error(colors_safe__WEBPACK_IMPORTED_MODULE_3___default().red(`Error during pnpmfile execution. pnpmfile: "${individualPnpmfilePath}". Error: "${err.message}".` +
20158
+ '\n'));
20159
+ }
20160
+ }
20161
+ }
20162
+ transformedPackageJson =
20163
+ this._splitWorkspaceGlobalPnpmfileConfiguration.transform(transformedPackageJson);
20164
+ if (individualPnpmfile) {
20165
+ const individualContext = {
20166
+ log: (message) => {
20167
+ console.log(message);
20168
+ }
20169
+ };
20170
+ try {
20171
+ transformedPackageJson =
20172
+ ((_b = (_a = individualPnpmfile.hooks) === null || _a === void 0 ? void 0 : _a.readPackage) === null || _b === void 0 ? void 0 : _b.call(_a, transformedPackageJson, individualContext)) ||
20173
+ transformedPackageJson;
20174
+ }
20175
+ catch (err) {
20176
+ console.error(colors_safe__WEBPACK_IMPORTED_MODULE_3___default().red(`Error during readPackage hook execution. pnpmfile: "${individualPnpmfilePath}". Error: "${err.message}".` +
20177
+ '\n'));
20178
+ }
20179
+ }
20180
+ // Use a new PackageJsonEditor since it will classify each dependency type, making tracking the
20181
+ // found versions much simpler.
20182
+ const transformedPackageJsonEditor = _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_11__.PackageJsonEditor.fromObject(transformedPackageJson, project.packageJsonEditor.filePath);
20183
+ return this._isProjectModified(transformedPackageJsonEditor, this._getIndividualShrinkwrapImporter());
20184
+ }
20185
+ _isProjectModified(packageJsonEditor, projectShrinkwrap) {
20186
+ const { dependencyList, devDependencyList } = packageJsonEditor;
18870
20187
  // Then get the unique package names and map them to package versions.
18871
20188
  const dependencyVersions = new Map();
18872
20189
  for (const packageDependency of [...dependencyList, ...devDependencyList]) {
@@ -18901,30 +20218,42 @@ class PnpmShrinkwrapFile extends _base_BaseShrinkwrapFile__WEBPACK_IMPORTED_MODU
18901
20218
  for (const dependencyVersion of dependencyVersions.values()) {
18902
20219
  switch (dependencyVersion.dependencyType) {
18903
20220
  case _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_11__.DependencyType.Optional:
18904
- if (!importer.optionalDependencies || !importer.optionalDependencies[dependencyVersion.name])
20221
+ if (!projectShrinkwrap.optionalDependencies ||
20222
+ !projectShrinkwrap.optionalDependencies[dependencyVersion.name])
18905
20223
  return true;
18906
20224
  break;
18907
20225
  case _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_11__.DependencyType.Regular:
18908
- if (!importer.dependencies || !importer.dependencies[dependencyVersion.name])
20226
+ if (!projectShrinkwrap.dependencies || !projectShrinkwrap.dependencies[dependencyVersion.name])
18909
20227
  return true;
18910
20228
  break;
18911
20229
  case _api_PackageJsonEditor__WEBPACK_IMPORTED_MODULE_11__.DependencyType.Dev:
18912
- if (!importer.devDependencies || !importer.devDependencies[dependencyVersion.name])
20230
+ if (!projectShrinkwrap.devDependencies ||
20231
+ !projectShrinkwrap.devDependencies[dependencyVersion.name])
18913
20232
  return true;
18914
20233
  break;
18915
20234
  }
18916
20235
  }
18917
20236
  // Then validate the length matches between the importer and the dependency list, since duplicates are
18918
20237
  // a valid use-case. Importers will only take one of these values, so no need to do more work here.
18919
- if (dependencyVersions.size !== Object.keys(importer.specifiers).length) {
20238
+ if (dependencyVersions.size !== Object.keys(projectShrinkwrap.specifiers).length) {
18920
20239
  return true;
18921
20240
  }
18922
20241
  // Finally, validate that all values in the importer are also present in the dependency list.
18923
- for (const [importerPackageName, importerVersionSpecifier] of Object.entries(importer.specifiers)) {
20242
+ for (const [importerPackageName, importerVersionSpecifier] of Object.entries(projectShrinkwrap.specifiers)) {
18924
20243
  const foundDependency = dependencyVersions.get(importerPackageName);
18925
- if (!foundDependency || foundDependency.version !== importerVersionSpecifier) {
20244
+ if (!foundDependency) {
18926
20245
  return true;
18927
20246
  }
20247
+ if (this.overrides.has(importerPackageName)) {
20248
+ if (this.overrides.get(importerPackageName) !== importerVersionSpecifier) {
20249
+ return true;
20250
+ }
20251
+ }
20252
+ else {
20253
+ if (foundDependency.version !== importerVersionSpecifier) {
20254
+ return true;
20255
+ }
20256
+ }
18928
20257
  }
18929
20258
  return false;
18930
20259
  }
@@ -19024,7 +20353,22 @@ class PnpmShrinkwrapFile extends _base_BaseShrinkwrapFile__WEBPACK_IMPORTED_MODU
19024
20353
  shrinkwrapToSerialize[key] = value;
19025
20354
  }
19026
20355
  }
19027
- return yamlModule.safeDump(shrinkwrapToSerialize, _PnpmYamlCommon__WEBPACK_IMPORTED_MODULE_12__.PNPM_SHRINKWRAP_YAML_FORMAT);
20356
+ return yamlModule.safeDump(shrinkwrapToSerialize, _PnpmYamlCommon__WEBPACK_IMPORTED_MODULE_13__.PNPM_SHRINKWRAP_YAML_FORMAT);
20357
+ }
20358
+ _getIndividualShrinkwrapImporter() {
20359
+ if (!this._individualShrinkwrapImporter) {
20360
+ const dependencies = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.MapExtensions.toObject(this.dependencies);
20361
+ const devDependencies = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.MapExtensions.toObject(this.devDependencies);
20362
+ const optionalDependencies = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.MapExtensions.toObject(this.optionalDependencies);
20363
+ const specifiers = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_4__.MapExtensions.toObject(this.specifiers);
20364
+ this._individualShrinkwrapImporter = {
20365
+ dependencies,
20366
+ devDependencies,
20367
+ optionalDependencies,
20368
+ specifiers
20369
+ };
20370
+ }
20371
+ return this._individualShrinkwrapImporter;
19028
20372
  }
19029
20373
  }
19030
20374
  //# sourceMappingURL=PnpmShrinkwrapFile.js.map
@@ -19126,6 +20470,9 @@ class PnpmfileConfiguration {
19126
20470
  allPreferredVersions = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.MapExtensions.toObject(preferredVersions);
19127
20471
  allowedAlternativeVersions = _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.MapExtensions.toObject(commonVersionsConfiguration.allowedAlternativeVersions);
19128
20472
  for (const project of rushConfiguration.projects) {
20473
+ if (!project.packageJson.version) {
20474
+ throw new Error(`Missing version for the "${project.packageName}" project. Please specify "version" field in package.json under ${project.projectFolder}`);
20475
+ }
19129
20476
  workspaceVersions[project.packageName] = project.packageJson.version;
19130
20477
  }
19131
20478
  }
@@ -19273,6 +20620,250 @@ const hooks = {
19273
20620
 
19274
20621
  /***/ }),
19275
20622
 
20623
+ /***/ 848654:
20624
+ /*!*******************************************************************!*\
20625
+ !*** ./lib-esnext/logic/pnpm/SplitWorkspaceGlobalPnpmfileShim.js ***!
20626
+ \*******************************************************************/
20627
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20628
+
20629
+ __webpack_require__.r(__webpack_exports__);
20630
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20631
+ /* harmony export */ "hooks": () => (/* binding */ hooks)
20632
+ /* harmony export */ });
20633
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ 371017);
20634
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
20635
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
20636
+ // See LICENSE in the project root for license information.
20637
+ var _a;
20638
+ // The "rush install" or "rush update" commands will copy this template to
20639
+ // "common/temp-split/global-pnpmfile.js" so that it can implement Rush-specific features.
20640
+ // It reads its input data from "common/temp/pnpmfileSettings.json",
20641
+ // which includes the path to the user's pnpmfile for the currently selected variant. The pnpmfile is
20642
+ // required directly by this shim and is called after Rush's transformations are applied.
20643
+
20644
+ let settings;
20645
+ let userPnpmfile;
20646
+ let semver;
20647
+ let normalizePath;
20648
+ // Initialize all external aspects of the pnpmfile shim. When using the shim, settings
20649
+ // are always expected to be available. Init must be called before running any hook that
20650
+ // depends on a resource obtained from or related to the settings, and will require modules
20651
+ // once so they aren't repeatedly required in the hook functions.
20652
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20653
+ function init(context) {
20654
+ // Sometimes PNPM may provide us a context arg that doesn't fit spec, ex.:
20655
+ // https://github.com/pnpm/pnpm/blob/97c64bae4d14a8c8f05803f1d94075ee29c2df2f/packages/get-context/src/index.ts#L134
20656
+ // So we need to normalize the context format before we move on
20657
+ if (typeof context !== 'object' || Array.isArray(context)) {
20658
+ context = {
20659
+ log: (message) => { },
20660
+ originalContext: context
20661
+ };
20662
+ }
20663
+ if (!settings) {
20664
+ // Initialize the settings from file
20665
+ if (!context.splitWorkspacePnpmfileShimSettings) {
20666
+ context.splitWorkspacePnpmfileShimSettings = require('./pnpmfileSettings.json');
20667
+ }
20668
+ settings = context.splitWorkspacePnpmfileShimSettings;
20669
+ }
20670
+ else if (!context.splitWorkspacePnpmfileShimSettings) {
20671
+ // Reuse the already initialized settings
20672
+ context.splitWorkspacePnpmfileShimSettings = settings;
20673
+ }
20674
+ // If a userPnpmfilePath is provided, we expect it to exist
20675
+ if (!userPnpmfile && settings.userPnpmfilePath) {
20676
+ userPnpmfile = require(settings.userPnpmfilePath);
20677
+ }
20678
+ // If a semverPath is provided, we expect it to exist
20679
+ if (!semver && settings.semverPath) {
20680
+ semver = require(settings.semverPath);
20681
+ }
20682
+ if (!normalizePath && settings.pathNormalizerPath) {
20683
+ normalizePath = require(settings.pathNormalizerPath);
20684
+ }
20685
+ // Return the normalized context
20686
+ return context;
20687
+ }
20688
+ // Rewrite rush project referenced in split workspace.
20689
+ // For example: "project-a": "workspace:*" --> "project-a": "link:../../project-a"
20690
+ function rewriteRushProjectVersions(packageName, dependencies) {
20691
+ if (!dependencies) {
20692
+ return;
20693
+ }
20694
+ if (!settings || !normalizePath) {
20695
+ throw new Error(`splitWorkspaceGlobalPnpmfileShimSettings not initialized`);
20696
+ }
20697
+ const splitWorkspaceProject = settings.splitWorkspaceProjects[packageName];
20698
+ if (!splitWorkspaceProject) {
20699
+ return;
20700
+ }
20701
+ for (const dependencyName of Object.keys(dependencies)) {
20702
+ const currentVersion = dependencies[dependencyName];
20703
+ if (currentVersion.startsWith('workspace:')) {
20704
+ const workspaceProjectInfo = settings.workspaceProjects[dependencyName];
20705
+ if (workspaceProjectInfo) {
20706
+ // Case 1. "<package_name>": "workspace:*"
20707
+ const relativePath = normalizePath(path__WEBPACK_IMPORTED_MODULE_0___default().relative(splitWorkspaceProject.projectRelativeFolder, workspaceProjectInfo.projectRelativeFolder));
20708
+ const newVersion = 'link:' + relativePath;
20709
+ dependencies[dependencyName] = newVersion;
20710
+ }
20711
+ else {
20712
+ // Case 2. "<alias>": "workspace:<aliased_package_name>@<version>"
20713
+ const packageSpec = currentVersion.slice('workspace:'.length);
20714
+ const nameEndsAt = packageSpec[0] === '@' ? packageSpec.slice(1).indexOf('@') + 1 : packageSpec.indexOf('@');
20715
+ const aliasedPackageName = nameEndsAt > 0 ? packageSpec.slice(0, nameEndsAt) : packageSpec;
20716
+ // const depVersion: string = nameEndsAt > 0 ? packageSpec.slice(nameEndsAt + 1) : '';
20717
+ const aliasedWorkspaceProjectInfo = settings.workspaceProjects[aliasedPackageName];
20718
+ if (aliasedWorkspaceProjectInfo) {
20719
+ const relativePath = normalizePath(path__WEBPACK_IMPORTED_MODULE_0___default().relative(splitWorkspaceProject.projectRelativeFolder, aliasedWorkspaceProjectInfo.projectRelativeFolder));
20720
+ const newVersion = 'link:' + relativePath;
20721
+ dependencies[dependencyName] = newVersion;
20722
+ }
20723
+ }
20724
+ }
20725
+ else if (currentVersion.startsWith('npm:')) {
20726
+ // Case 3. "<alias>": "npm:<package_name>@<dep_version>"
20727
+ const packageSpec = currentVersion.slice('npm:'.length);
20728
+ const nameEndsAt = packageSpec[0] === '@' ? packageSpec.slice(1).indexOf('@') + 1 : packageSpec.indexOf('@');
20729
+ const aliasedPackageName = nameEndsAt > 0 ? packageSpec.slice(0, nameEndsAt) : packageSpec;
20730
+ // const depVersion: string = nameEndsAt > 0 ? packageSpec.slice(nameEndsAt + 1) : '';
20731
+ const aliasedWorkspaceProjectInfo = settings.workspaceProjects[aliasedPackageName];
20732
+ if (aliasedWorkspaceProjectInfo) {
20733
+ const relativePath = normalizePath(path__WEBPACK_IMPORTED_MODULE_0___default().relative(splitWorkspaceProject.projectRelativeFolder, aliasedWorkspaceProjectInfo.projectRelativeFolder));
20734
+ const newVersion = 'link:' + relativePath;
20735
+ dependencies[dependencyName] = newVersion;
20736
+ }
20737
+ }
20738
+ }
20739
+ }
20740
+ const hooks = {
20741
+ // Call the original pnpmfile (if it exists)
20742
+ afterAllResolved: (lockfile, context) => {
20743
+ var _a;
20744
+ context = init(context);
20745
+ return ((_a = userPnpmfile === null || userPnpmfile === void 0 ? void 0 : userPnpmfile.hooks) === null || _a === void 0 ? void 0 : _a.afterAllResolved)
20746
+ ? userPnpmfile.hooks.afterAllResolved(lockfile, context)
20747
+ : lockfile;
20748
+ },
20749
+ // Rewrite workspace protocol to link protocol for non split workspace projects
20750
+ readPackage: (pkg, context) => {
20751
+ var _a;
20752
+ context = init(context);
20753
+ rewriteRushProjectVersions(pkg.name, pkg.dependencies);
20754
+ rewriteRushProjectVersions(pkg.name, pkg.devDependencies);
20755
+ return ((_a = userPnpmfile === null || userPnpmfile === void 0 ? void 0 : userPnpmfile.hooks) === null || _a === void 0 ? void 0 : _a.readPackage) ? userPnpmfile.hooks.readPackage(pkg, context) : pkg;
20756
+ },
20757
+ // Call the original pnpmfile (if it exists)
20758
+ filterLog: (_a = userPnpmfile === null || userPnpmfile === void 0 ? void 0 : userPnpmfile.hooks) === null || _a === void 0 ? void 0 : _a.filterLog
20759
+ };
20760
+ //# sourceMappingURL=SplitWorkspaceGlobalPnpmfileShim.js.map
20761
+
20762
+ /***/ }),
20763
+
20764
+ /***/ 608961:
20765
+ /*!**********************************************************************!*\
20766
+ !*** ./lib-esnext/logic/pnpm/SplitWorkspacePnpmfileConfiguration.js ***!
20767
+ \**********************************************************************/
20768
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20769
+
20770
+ __webpack_require__.r(__webpack_exports__);
20771
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20772
+ /* harmony export */ "SplitWorkspacePnpmfileConfiguration": () => (/* binding */ SplitWorkspacePnpmfileConfiguration)
20773
+ /* harmony export */ });
20774
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ 371017);
20775
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
20776
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
20777
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__);
20778
+ /* harmony import */ var _SplitWorkspaceGlobalPnpmfileShim__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SplitWorkspaceGlobalPnpmfileShim */ 848654);
20779
+ /* harmony import */ var _utilities_PathConstants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utilities/PathConstants */ 287644);
20780
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
20781
+ // See LICENSE in the project root for license information.
20782
+
20783
+
20784
+
20785
+
20786
+ /**
20787
+ * Loads PNPM's pnpmfile.js configuration, and invokes it to preprocess package.json files,
20788
+ * optionally utilizing a pnpmfile shim to inject preferred versions.
20789
+ */
20790
+ class SplitWorkspacePnpmfileConfiguration {
20791
+ constructor(rushConfiguration) {
20792
+ if (rushConfiguration.packageManager !== 'pnpm') {
20793
+ throw new Error(`PnpmfileConfiguration cannot be used with package manager "${rushConfiguration.packageManager}"`);
20794
+ }
20795
+ // Set the context to swallow log output and store our settings
20796
+ this._context = {
20797
+ log: (message) => { },
20798
+ splitWorkspacePnpmfileShimSettings: SplitWorkspacePnpmfileConfiguration._getSplitWorkspacePnpmfileShimSettings(rushConfiguration)
20799
+ };
20800
+ }
20801
+ /**
20802
+ * Split workspace use global pnpmfile, because in split workspace, user may set `shared-workspace-lockfile=false`.
20803
+ * That means each project owns their individual pnpmfile under project folder. While the global pnpmfile could be
20804
+ * under the common/temp-split/ folder and be used by all split workspace projects.
20805
+ */
20806
+ static async writeCommonTempSplitGlobalPnpmfileAsync(rushConfiguration) {
20807
+ if (rushConfiguration.packageManager !== 'pnpm') {
20808
+ throw new Error(`PnpmfileConfiguration cannot be used with package manager "${rushConfiguration.packageManager}"`);
20809
+ }
20810
+ const targetDir = rushConfiguration.commonTempSplitFolder;
20811
+ const splitWorkspaceGlobalPnpmfilePath = path__WEBPACK_IMPORTED_MODULE_0__.join(targetDir, rushConfiguration.packageManagerWrapper.globalPnpmfileFilename);
20812
+ // Write the shim itself
20813
+ await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.FileSystem.copyFileAsync({
20814
+ sourcePath: `${_utilities_PathConstants__WEBPACK_IMPORTED_MODULE_2__.scriptsFolderPath}/${_utilities_PathConstants__WEBPACK_IMPORTED_MODULE_2__.splitWorkspacePnpmfileShimFilename}`,
20815
+ destinationPath: splitWorkspaceGlobalPnpmfilePath
20816
+ });
20817
+ const splitWorkspaceGlobalPnpmfileShimSettings = SplitWorkspacePnpmfileConfiguration._getSplitWorkspacePnpmfileShimSettings(rushConfiguration);
20818
+ // Write the settings file used by the shim
20819
+ await _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.JsonFile.saveAsync(splitWorkspaceGlobalPnpmfileShimSettings, path__WEBPACK_IMPORTED_MODULE_0__.join(targetDir, 'pnpmfileSettings.json'), {
20820
+ ensureFolderExists: true
20821
+ });
20822
+ }
20823
+ static _getSplitWorkspacePnpmfileShimSettings(rushConfiguration) {
20824
+ const workspaceProjects = {};
20825
+ const splitWorkspaceProjects = {};
20826
+ for (const project of rushConfiguration.projects) {
20827
+ const { packageName, projectRelativeFolder, packageJson } = project;
20828
+ const workspaceProjectInfo = {
20829
+ packageName,
20830
+ projectRelativeFolder,
20831
+ packageVersion: packageJson.version
20832
+ };
20833
+ (project.splitWorkspace ? splitWorkspaceProjects : workspaceProjects)[packageName] =
20834
+ workspaceProjectInfo;
20835
+ }
20836
+ const settings = {
20837
+ workspaceProjects,
20838
+ splitWorkspaceProjects,
20839
+ semverPath: _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.Import.resolveModule({ modulePath: 'semver', baseFolderPath: __dirname }),
20840
+ pathNormalizerPath: _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.Import.resolveModule({ modulePath: 'normalize-path', baseFolderPath: __dirname })
20841
+ };
20842
+ // common/config/rush/.pnpmfile-split-workspace.cjs
20843
+ const userPnpmfilePath = path__WEBPACK_IMPORTED_MODULE_0__.join(rushConfiguration.commonRushConfigFolder, rushConfiguration.packageManagerWrapper.splitWorkspacePnpmfileFilename);
20844
+ if (_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_1__.FileSystem.exists(userPnpmfilePath)) {
20845
+ settings.userPnpmfilePath = userPnpmfilePath;
20846
+ }
20847
+ return settings;
20848
+ }
20849
+ /**
20850
+ * Transform a package.json file using the pnpmfile.js hook.
20851
+ * @returns the tranformed object, or the original input if pnpmfile.js was not found.
20852
+ */
20853
+ transform(packageJson) {
20854
+ var _a;
20855
+ if (!((_a = _SplitWorkspaceGlobalPnpmfileShim__WEBPACK_IMPORTED_MODULE_3__.hooks) === null || _a === void 0 ? void 0 : _a.readPackage) || !this._context) {
20856
+ return packageJson;
20857
+ }
20858
+ else {
20859
+ return _SplitWorkspaceGlobalPnpmfileShim__WEBPACK_IMPORTED_MODULE_3__.hooks.readPackage(packageJson, this._context);
20860
+ }
20861
+ }
20862
+ }
20863
+ //# sourceMappingURL=SplitWorkspacePnpmfileConfiguration.js.map
20864
+
20865
+ /***/ }),
20866
+
19276
20867
  /***/ 613207:
19277
20868
  /*!***************************************************!*\
19278
20869
  !*** ./lib-esnext/logic/policy/GitEmailPolicy.js ***!
@@ -19546,6 +21137,58 @@ class NamedProjectSelectorParser {
19546
21137
 
19547
21138
  /***/ }),
19548
21139
 
21140
+ /***/ 357196:
21141
+ /*!***************************************************************************!*\
21142
+ !*** ./lib-esnext/logic/selectors/SplitWorkspaceProjectSelectorParser.js ***!
21143
+ \***************************************************************************/
21144
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
21145
+
21146
+ __webpack_require__.r(__webpack_exports__);
21147
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21148
+ /* harmony export */ "SplitWorkspaceProjectSelectorParser": () => (/* binding */ SplitWorkspaceProjectSelectorParser)
21149
+ /* harmony export */ });
21150
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
21151
+ /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__);
21152
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
21153
+ // See LICENSE in the project root for license information.
21154
+
21155
+ class SplitWorkspaceProjectSelectorParser {
21156
+ constructor(rushConfiguration) {
21157
+ this._rushConfiguration = rushConfiguration;
21158
+ }
21159
+ async evaluateSelectorAsync({ unscopedSelector, terminal, parameterName }) {
21160
+ let selection;
21161
+ let projectsFilter;
21162
+ switch (unscopedSelector) {
21163
+ case 'true': {
21164
+ projectsFilter = {
21165
+ splitWorkspace: true
21166
+ };
21167
+ break;
21168
+ }
21169
+ case 'false': {
21170
+ projectsFilter = {
21171
+ splitWorkspace: false
21172
+ };
21173
+ }
21174
+ }
21175
+ if (projectsFilter) {
21176
+ selection = this._rushConfiguration.getFilteredProjects(projectsFilter);
21177
+ }
21178
+ if (!selection) {
21179
+ terminal.writeErrorLine(`The split "${unscopedSelector}" passed to "${parameterName}" is not specified for any projects in rush.json.`);
21180
+ throw new _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__.AlreadyReportedError();
21181
+ }
21182
+ return selection;
21183
+ }
21184
+ getCompletions() {
21185
+ return ['true', 'false'];
21186
+ }
21187
+ }
21188
+ //# sourceMappingURL=SplitWorkspaceProjectSelectorParser.js.map
21189
+
21190
+ /***/ }),
21191
+
19549
21192
  /***/ 858595:
19550
21193
  /*!****************************************************************!*\
19551
21194
  !*** ./lib-esnext/logic/selectors/TagProjectSelectorParser.js ***!
@@ -20497,7 +22140,7 @@ class VersionMismatchFinder {
20497
22140
  // Create an object for the purposes of reporting conflicts with preferredVersions from common-versions.json
20498
22141
  // Make sure this one is first so it doesn't get truncated when a long list is printed
20499
22142
  projects.push(new _VersionMismatchFinderCommonVersions__WEBPACK_IMPORTED_MODULE_2__.VersionMismatchFinderCommonVersions(commonVersions));
20500
- for (const project of rushConfiguration.projects) {
22143
+ for (const project of rushConfiguration.getFilteredProjects({ splitWorkspace: false })) {
20501
22144
  projects.push(new _VersionMismatchFinderProject__WEBPACK_IMPORTED_MODULE_3__.VersionMismatchFinderProject(project));
20502
22145
  }
20503
22146
  return new VersionMismatchFinder(projects, commonVersions.allowedAlternativeVersions);
@@ -20769,11 +22412,15 @@ class VersionMismatchFinderProject extends _VersionMismatchFinderEntity__WEBPACK
20769
22412
  skipRushCheck: project.skipRushCheck
20770
22413
  });
20771
22414
  this._fileManager = project.packageJsonEditor;
22415
+ this._project = project;
20772
22416
  this.packageName = project.packageName;
20773
22417
  }
20774
22418
  get filePath() {
20775
22419
  return this._fileManager.filePath;
20776
22420
  }
22421
+ get project() {
22422
+ return this._project;
22423
+ }
20777
22424
  get allDependencies() {
20778
22425
  return [...this._fileManager.dependencyList, ...this._fileManager.devDependencyList];
20779
22426
  }
@@ -21052,6 +22699,14 @@ class PhasedCommandHooks {
21052
22699
  * Hook is series for stable output.
21053
22700
  */
21054
22701
  this.afterExecuteOperations = new tapable__WEBPACK_IMPORTED_MODULE_0__.AsyncSeriesHook(['results', 'context']);
22702
+ /**
22703
+ * Hook invoked before executing a operation.
22704
+ */
22705
+ this.beforeExecuteOperation = new tapable__WEBPACK_IMPORTED_MODULE_0__.AsyncSeriesHook(['runnerContext'], 'beforeExecuteOperation');
22706
+ /**
22707
+ * Hook invoked after executing a operation.
22708
+ */
22709
+ this.afterExecuteOperation = new tapable__WEBPACK_IMPORTED_MODULE_0__.AsyncSeriesHook(['runnerContext'], 'afterExecuteOperation');
21055
22710
  /**
21056
22711
  * Hook invoked after a run has finished and the command is watching for changes.
21057
22712
  * May be used to display additional relevant data to the user.
@@ -21671,6 +23326,7 @@ __webpack_require__.r(__webpack_exports__);
21671
23326
  class RushSession {
21672
23327
  constructor(options) {
21673
23328
  this._cloudBuildCacheProviderFactories = new Map();
23329
+ this._cobuildLockProviderFactories = new Map();
21674
23330
  this._options = options;
21675
23331
  this.hooks = new _RushLifeCycle__WEBPACK_IMPORTED_MODULE_1__.RushLifecycleHooks();
21676
23332
  }
@@ -21698,6 +23354,15 @@ class RushSession {
21698
23354
  getCloudBuildCacheProviderFactory(cacheProviderName) {
21699
23355
  return this._cloudBuildCacheProviderFactories.get(cacheProviderName);
21700
23356
  }
23357
+ registerCobuildLockProviderFactory(cobuildLockProviderName, factory) {
23358
+ if (this._cobuildLockProviderFactories.has(cobuildLockProviderName)) {
23359
+ throw new Error(`A cobuild lock provider factory for ${cobuildLockProviderName} has already been registered`);
23360
+ }
23361
+ this._cobuildLockProviderFactories.set(cobuildLockProviderName, factory);
23362
+ }
23363
+ getCobuildLockProviderFactory(cobuildLockProviderName) {
23364
+ return this._cobuildLockProviderFactories.get(cobuildLockProviderName);
23365
+ }
21701
23366
  }
21702
23367
  //# sourceMappingURL=RushSession.js.map
21703
23368
 
@@ -22159,7 +23824,8 @@ __webpack_require__.r(__webpack_exports__);
22159
23824
  /* harmony export */ "pnpmfileShimFilename": () => (/* binding */ pnpmfileShimFilename),
22160
23825
  /* harmony export */ "rushLibFolderRootPath": () => (/* binding */ rushLibFolderRootPath),
22161
23826
  /* harmony export */ "scriptsFolderName": () => (/* binding */ scriptsFolderName),
22162
- /* harmony export */ "scriptsFolderPath": () => (/* binding */ scriptsFolderPath)
23827
+ /* harmony export */ "scriptsFolderPath": () => (/* binding */ scriptsFolderPath),
23828
+ /* harmony export */ "splitWorkspacePnpmfileShimFilename": () => (/* binding */ splitWorkspacePnpmfileShimFilename)
22163
23829
  /* harmony export */ });
22164
23830
  /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rushstack/node-core-library */ 132939);
22165
23831
  /* harmony import */ var _rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rushstack_node_core_library__WEBPACK_IMPORTED_MODULE_0__);
@@ -22179,6 +23845,7 @@ const assetsFolderPath = `${rushLibFolderRootPath}/assets`;
22179
23845
  */
22180
23846
  const scriptsFolderName = 'scripts';
22181
23847
  const pnpmfileShimFilename = 'PnpmfileShim.js';
23848
+ const splitWorkspacePnpmfileShimFilename = 'SplitWorkspaceGlobalPnpmfileShim.js';
22182
23849
  const installRunScriptFilename = 'install-run.js';
22183
23850
  const installRunRushScriptFilename = 'install-run-rush.js';
22184
23851
  const installRunRushxScriptFilename = 'install-run-rushx.js';
@@ -23173,11 +24840,18 @@ function _copyAndTrimNpmrcFile(logger, sourceNpmrcPath, targetNpmrcPath) {
23173
24840
  * @returns
23174
24841
  * The text of the the synced .npmrc, if one exists. If one does not exist, then undefined is returned.
23175
24842
  */
23176
- function syncNpmrc(sourceNpmrcFolder, targetNpmrcFolder, useNpmrcPublish, logger = {
24843
+ function syncNpmrc(sourceNpmrcFolder, targetNpmrcFolder, useNpmrcPublish, sourceNpmrcFilename, logger = {
23177
24844
  info: console.log,
23178
24845
  error: console.error
23179
24846
  }) {
23180
- const sourceNpmrcPath = path__WEBPACK_IMPORTED_MODULE_1__.join(sourceNpmrcFolder, !useNpmrcPublish ? '.npmrc' : '.npmrc-publish');
24847
+ let resolvedSourceNpmrcFilename = '.npmrc';
24848
+ if (useNpmrcPublish) {
24849
+ resolvedSourceNpmrcFilename = '.npmrc-publish';
24850
+ }
24851
+ if (sourceNpmrcFilename) {
24852
+ resolvedSourceNpmrcFilename = sourceNpmrcFilename;
24853
+ }
24854
+ const sourceNpmrcPath = path__WEBPACK_IMPORTED_MODULE_1__.join(sourceNpmrcFolder, resolvedSourceNpmrcFilename);
23181
24855
  const targetNpmrcPath = path__WEBPACK_IMPORTED_MODULE_1__.join(targetNpmrcFolder, '.npmrc');
23182
24856
  try {
23183
24857
  if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(sourceNpmrcPath)) {
@@ -23247,6 +24921,16 @@ module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#
23247
24921
 
23248
24922
  /***/ }),
23249
24923
 
24924
+ /***/ 222518:
24925
+ /*!************************************************!*\
24926
+ !*** ./lib-esnext/schemas/cobuild.schema.json ***!
24927
+ \************************************************/
24928
+ /***/ ((module) => {
24929
+
24930
+ module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"Configuration for Rush\'s cobuild.","description":"For use with the Rush tool, this file provides configuration options for cobuild feature. See http://rushjs.io for details.","definitions":{"anything":{"type":["array","boolean","integer","number","object","string"],"items":{"$ref":"#/definitions/anything"}}},"type":"object","allOf":[{"type":"object","additionalProperties":false,"required":["cobuildEnabled","cobuildLockProvider"],"properties":{"$schema":{"description":"Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.","type":"string"},"cobuildEnabled":{"description":"Set this to true to enable the cobuild feature.","type":"boolean"},"cobuildLockProvider":{"description":"Specify the cobuild lock provider to use","type":"string"}}}]}');
24931
+
24932
+ /***/ }),
24933
+
23250
24934
  /***/ 703450:
23251
24935
  /*!*****************************************************!*\
23252
24936
  !*** ./lib-esnext/schemas/command-line.schema.json ***!
@@ -23293,7 +24977,7 @@ module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#
23293
24977
  \****************************************************/
23294
24978
  /***/ ((module) => {
23295
24979
 
23296
- module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"Rush experiments.json config file","description":"For use with the Rush tool, this file allows repo maintainers to enable and disable experimental Rush features.","type":"object","properties":{"$schema":{"description":"Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.","type":"string"},"usePnpmFrozenLockfileForRushInstall":{"description":"By default, \'rush install\' passes --no-prefer-frozen-lockfile to \'pnpm install\'. Set this option to true to pass \'--frozen-lockfile\' instead.","type":"boolean"},"usePnpmPreferFrozenLockfileForRushUpdate":{"description":"By default, \'rush update\' passes --no-prefer-frozen-lockfile to \'pnpm install\'. Set this option to true to pass \'--prefer-frozen-lockfile\' instead.","type":"boolean"},"omitImportersFromPreventManualShrinkwrapChanges":{"description":"If using the \'preventManualShrinkwrapChanges\' option, only prevent manual changes to the total set of external dependencies referenced by the repository, not which projects reference which dependencies. This offers a balance between lockfile integrity and merge conflicts.","type":"boolean"},"noChmodFieldInTarHeaderNormalization":{"description":"If true, the chmod field in temporary project tar headers will not be normalized. This normalization can help ensure consistent tarball integrity across platforms.","type":"boolean"},"buildCacheWithAllowWarningsInSuccessfulBuild":{"description":"If true, build caching will respect the allowWarningsInSuccessfulBuild flag and cache builds with warnings. This will not replay warnings from the cached build.","type":"boolean"},"phasedCommands":{"description":"If true, the phased commands feature is enabled. To use this feature, create a \\"phased\\" command in common/config/rush/command-line.json.","type":"boolean"},"cleanInstallAfterNpmrcChanges":{"description":"If true, perform a clean install after when running `rush install` or `rush update` if the `.npmrc` file has changed since the last install.","type":"boolean"},"printEventHooksOutputToConsole":{"description":"If true, print the outputs of shell commands defined in event hooks to the console.","type":"boolean"}},"additionalProperties":false}');
24980
+ module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"Rush experiments.json config file","description":"For use with the Rush tool, this file allows repo maintainers to enable and disable experimental Rush features.","type":"object","properties":{"$schema":{"description":"Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.","type":"string"},"usePnpmFrozenLockfileForRushInstall":{"description":"By default, \'rush install\' passes --no-prefer-frozen-lockfile to \'pnpm install\'. Set this option to true to pass \'--frozen-lockfile\' instead.","type":"boolean"},"usePnpmPreferFrozenLockfileForRushUpdate":{"description":"By default, \'rush update\' passes --no-prefer-frozen-lockfile to \'pnpm install\'. Set this option to true to pass \'--prefer-frozen-lockfile\' instead.","type":"boolean"},"omitImportersFromPreventManualShrinkwrapChanges":{"description":"If using the \'preventManualShrinkwrapChanges\' option, only prevent manual changes to the total set of external dependencies referenced by the repository, not which projects reference which dependencies. This offers a balance between lockfile integrity and merge conflicts.","type":"boolean"},"noChmodFieldInTarHeaderNormalization":{"description":"If true, the chmod field in temporary project tar headers will not be normalized. This normalization can help ensure consistent tarball integrity across platforms.","type":"boolean"},"buildCacheWithAllowWarningsInSuccessfulBuild":{"description":"If true, build caching will respect the allowWarningsInSuccessfulBuild flag and cache builds with warnings. This will not replay warnings from the cached build.","type":"boolean"},"phasedCommands":{"description":"If true, the phased commands feature is enabled. To use this feature, create a \\"phased\\" command in common/config/rush/command-line.json.","type":"boolean"},"deferredInstallationScripts":{"description":"If true, rush install or rush update implicitly specify --ignore-scripts during pnpm install, and run install lifecycle scripts by pnpm rebuild --pending after pnpm install successfully.","type":"boolean"},"cleanInstallAfterNpmrcChanges":{"description":"If true, perform a clean install after when running `rush install` or `rush update` if the `.npmrc` file has changed since the last install.","type":"boolean"},"printEventHooksOutputToConsole":{"description":"If true, print the outputs of shell commands defined in event hooks to the console.","type":"boolean"}},"additionalProperties":false}');
23297
24981
 
23298
24982
  /***/ }),
23299
24983
 
@@ -23363,7 +25047,7 @@ module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#
23363
25047
  \*********************************************/
23364
25048
  /***/ ((module) => {
23365
25049
 
23366
- module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"Rush main config File","description":"The main configuration file for the Rush multi-project build tool. See http://rushjs.io for details.","type":"object","definitions":{"environmentVariables":{"description":"Environment variables for the package manager","type":"object","additionalProperties":{"type":"object","properties":{"value":{"type":"string"},"override":{"type":"boolean"}},"additionalProperties":false}}},"properties":{"$schema":{"description":"Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.","type":"string"},"npmVersion":{"description":"If specified, selects NPM as the package manager and specifies the deterministic version to be installed by Rush.","type":"string","pattern":"^[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z.+\\\\-]+$"},"pnpmVersion":{"description":"If specified, selects PNPM as the package manager and specifies the deterministic version to be installed by Rush.","type":"string","pattern":"^[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z.+\\\\-]+$"},"yarnVersion":{"description":"If specified, selects Yarn as the package manager and specifies the deterministic version to be installed by Rush.","type":"string","pattern":"^[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z.+\\\\-]+$"},"rushVersion":{"description":"The version of the Rush tool that will be used to build this repository.","type":"string","pattern":"^[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z.+\\\\-]+$"},"nodeSupportedVersionRange":{"description":"A node-semver expression (e.g. \\">=1.2.3 <2.0.0\\", see https://github.com/npm/node-semver) indicating which versions of Node.js can safely be used to build this repository. If omitted, no validation is performed.","type":"string"},"nodeSupportedVersionInstructions":{"description":"If specified, when a rush command fails due to an unsupported node version, this additional instructional message is printed below the failure message.","type":"string"},"suppressNodeLtsWarning":{"description":"Rush normally prints a warning if it detects a pre-LTS Node.js version. If you are testing pre-LTS versions in preparation for supporting the first LTS version, you can use this setting to disable Rush\'s warning.","type":"boolean"},"projectFolderMinDepth":{"description":"The minimum folder depth for the projectFolder field. The default value is 1, i.e. no slashes in the path name.","type":"number"},"ensureConsistentVersions":{"description":"If true, consistent version specifiers for dependencies will be enforced (i.e. \\"rush check\\" is run before some commands).","type":"boolean"},"hotfixChangeEnabled":{"description":"Allows creation of hotfix changes. This feature is experimental so it is disabled by default. If this is set, \\"rush change\\" only allows a \\"hotfix\\" change type to be specified. This change type will be used when publishing subsequent changes from the monorepo.","type":"boolean"},"npmOptions":{"description":"Options that are only used when the NPM package manager is selected.","type":"object","properties":{"environmentVariables":{"$ref":"#/definitions/environmentVariables"}},"additionalProperties":false},"pnpmOptions":{"description":"Options that are only used when the PNPM pacakge manager is selected.","type":"object","properties":{"pnpmStore":{"description":"Specifies the location of the PNPM store. There are two possible values:\\n\\n\\"local\\" - use the \\"pnpm-store\\" folder in the current configured temp folder: \\"common/temp/pnpm-store\\" by default.\\n\\"global\\" - use PNPM\'s global store, which has the benefit of being shared across multiple repo folders, but the disadvantage of less isolation for builds (e.g. bugs or incompatibilities when two repos use different releases of PNPM)\\n\\nIn all cases, the store path will be overridden by the environment variable RUSH_PNPM_STORE_PATH.\\n\\nThe default value is \\"local\\".","type":"string","enum":["local","global"]},"strictPeerDependencies":{"description":"If true, then the installation will fail if there is a missing or invalid peer dependency in the tree, which is an invalid state that can cause build failures or incompatible dependency versions. (For historical reasons, JavaScript package managers generally do not treat this invalid state as an error.) This is done via the \\"--strict-peer-dependencies\\" flag in PNPM version < 7.0.0 and via the \\"--no-strict-peer-dependencies\\" flag in PNPM >= 7.0.0. The default value is false.","type":"boolean"},"resolutionStrategy":{"description":"(Deprecated) Configures the strategy used to select versions during installation. This feature requires PNPM version 3.1 or newer. It corresponds to the \\"--resolution-strategy\\" command-line option for PNPM. Possible values are \\"fast\\" and \\"fewer-dependencies\\". PNPM\'s default is \\"fast\\", but this may be incompatible with certain packages, for example the \\"@types\\" packages from DefinitelyTyped. Rush\'s default is \\"fewer-dependencies\\", which causes PNPM to avoid installing a newer version if an already installed version can be reused; this is more similar to NPM\'s algorithm.","type":"string","enum":["fewer-dependencies","fast"]},"environmentVariables":{"$ref":"#/definitions/environmentVariables"},"preventManualShrinkwrapChanges":{"description":"If true, then \\"rush install\\" will report an error if manual modifications were made to the PNPM shrinkwrap file without running `rush update` afterwards. To temporarily disable this validation when invoking \\"rush install\\", use the \\"--bypassPolicy\\" command-line parameter. The default value is false.","type":"boolean"},"useWorkspaces":{"description":"If true, then Rush will use the workspaces feature to install and link packages when invoking PNPM. The default value is false.","type":"boolean"}},"additionalProperties":false},"yarnOptions":{"description":"Options that are only used when the Yarn pacakge manager is selected.","type":"object","properties":{"ignoreEngines":{"description":"If true, then Rush will add the \\"--ignore-engines\\" option when invoking Yarn. * This allows \\"rush install\\" to succeed if there are dependencies with engines defined in package.json which do not match the current environment. The default value is false.","type":"boolean"},"environmentVariables":{"$ref":"#/definitions/environmentVariables"}},"additionalProperties":false},"projectFolderMaxDepth":{"description":"The maximum folder depth for the projectFolder field. The default value is 2, i.e. a single slash in the path name.","type":"number"},"allowMostlyStandardPackageNames":{"description":"Today the npmjs.com registry enforces fairly strict naming rules for packages, but in the early days there was no standard and hardly any enforcement. A few large legacy projects are still using nonstandard package names, and private registries sometimes allow it. Set \\"allowMostlyStandardPackageNames\\" to true to relax Rush\'s enforcement of package names. This allows upper case letters and in the future may relax other rules, however we want to minimize these exceptions. Many popular tools use certain punctuation characters as delimiters, based on the assumption that they will never appear in a package name; thus if we relax the rules too much it is likely to cause very confusing malfunctions. The default value is false.","type":"boolean"},"approvedPackagesPolicy":{"description":"Controls a package review workflow driven by the two config files \\"browser-approved-packages.json\\" and \\"nonbrowser-approved-packages.json\\"","type":"object","properties":{"reviewCategories":{"description":"A list of category names that can be applied to each project, and then referenced in \\"browser-approved-packages.json\\" and \\"nonbrowser-approved-packages.json\\"","type":"array","items":{"type":"string"}},"ignoredNpmScopes":{"description":"A list of NPM package scopes that will be excluded from review (e.g. \\"@types\\")","type":"array","items":{"type":"string","pattern":"^@"}}},"additionalProperties":false},"gitPolicy":{"description":"If the project is stored in a Git repository, additional settings related to Git","type":"object","properties":{"allowedEmailRegExps":{"description":"A list of regular expressions describing allowable e-mail patterns for Git commits. They are case-insensitive anchored JavaScript RegExps. Example: \\".*@example\\\\.com\\"","type":"array","items":{"type":"string"}},"sampleEmail":{"description":"An example valid e-mail address for \\"Mr. Example\\" that conforms to one of the allowedEmailRegExps. Example: \\"mr-example@contoso\\\\.com\\"","type":"string"},"versionBumpCommitMessage":{"description":"The commit message to use when committing changes during \\"rush publish\\". Defaults to \\"Bump versions [skip ci]\\"","type":"string"},"changeLogUpdateCommitMessage":{"description":"The commit message to use when committing change log files \\"rush version\\". Defaults to \\"Update changelogs [skip ci]\\"","type":"string"},"changefilesCommitMessage":{"description":"The commit message to use when commiting change files made by \\"rush change\\". Defaults to \\"Rush change\\"","type":"string"},"tagSeparator":{"description":"The separator between package name and version in git tag. Defaults to \\"_\\"","type":"string"}},"additionalProperties":false},"variants":{"description":"Defines the list of installation variants for this repository. For more details about this feature, see this article: https://rushjs.io/pages/advanced/installation_variants/","type":"array","items":{"type":"object","properties":{"variantName":{"description":"The name of the variant. Maps to common/rush/variants/{name} under the repository root.","type":"string"},"description":{"description":"","type":"string"}},"required":["variantName","description"]}},"repository":{"description":"The repository location","type":"object","properties":{"url":{"type":"string","description":"The remote url of the repository. If a value is provided, \\"rush change\\" will use it to find the right remote to compare against."},"urls":{"description":"All allowed remote urls of the repository. If a value is provided, \\"rush change\\" will use one of these to find the right remote to compare against. Specifying multiple URLs is useful if a GitHub repository is renamed or for \\"<projectName>.visualstudio.com\\" vs \\"dev.azure.com/<projectName>\\" URLs.","type":"array","items":{"type":"string"}},"defaultBranch":{"description":"The default branch name. This tells \\"rush change\\" which remote branch to compare against. The default value is \\"main\\"","type":"string"},"defaultRemote":{"description":"The default remote. This tells \\"rush change\\" which remote to compare against if the remote URL is not set or if a remote matching the provided remote URL is not found.","type":"string"}},"additionalProperties":false},"telemetryEnabled":{"description":"Indicates whether telemetry data should be collected and stored in the Rush temp folder during Rush runs.","type":"boolean"},"allowedProjectTags":{"description":"This is an optional, but recommended, list of allowed tags that can be applied to Rush projects using the \\"tags\\" setting in this file. This list is useful for preventing mistakes such as misspelling, and it also provides a centralized place to document your tags. If \\"allowedProjectTags\\" list is not specified, then any valid tag is allowed. A tag name must be one or more words separated by hyphens or slashes, where a word may contain lowercase ASCII letters, digits, \\".\\", and \\"@\\" characters.","type":"array","items":{"type":"string","pattern":"^[a-z0-9.@]+([-/][a-z0-9.@]+)*$"}},"projects":{"description":"A list of projects managed by this tool.","type":"array","items":{"type":"object","properties":{"packageName":{"description":"The NPM package name of the project.","type":"string"},"projectFolder":{"description":"The path to the project folder relative to the Rush config file.","type":"string"},"reviewCategory":{"description":"An optional category for usage in the \\"browser-approved-packages.json\\" and \\"nonbrowser-approved-packages.json\\" files. Only strings from reviewCategories are allowed here.","type":"string"},"cyclicDependencyProjects":{"description":"(Deprecated) This field was renamed to \\"decoupledLocalDependencies\\".","type":"array","items":{"type":"string"}},"decoupledLocalDependencies":{"description":"A list of local projects that appear as devDependencies for this project, but cannot be locally linked because it would create a cyclic dependency; instead, the last published version will be installed in the Common folder.","type":"array","items":{"type":"string"}},"shouldPublish":{"description":"A flag indicating that changes to this project will be published to npm, which affects the Rush change and publish workflows.","type":"boolean"},"skipRushCheck":{"description":"If true, then this project will be ignored by the \\"rush check\\" command. The default value is false.","type":"boolean"},"versionPolicyName":{"description":"An optional version policy associated with the project. Version policies are defined in \\"version-policies.json\\" file.","type":"string"},"publishFolder":{"description":"Facilitates postprocessing of a project\'s files prior to publishing. If specified, the \\"publishFolder\\" is the relative path to a subfolder of the project folder. The \\"rush publish\\" command will publish the subfolder instead of the project folder. The subfolder must contain its own package.json file, which is typically a build output.","type":"string"},"tags":{"description":"An optional set of custom tags that can be used to select this project. For example, adding \\"my-custom-tag\\" will allow this project to be selected by the command \\"rush list --only tag:my-custom-tag\\". The tag name must be one or more words separated by hyphens or slashes, where a word may contain lowercase ASCII letters, digits, \\".\\", and \\"@\\" characters.","type":"array","items":{"type":"string","pattern":"^[a-z0-9.@]+([-/][a-z0-9.@]+)*$"}}},"additionalProperties":false,"required":["packageName","projectFolder"]}},"eventHooks":{"description":"Hooks are customized script actions that Rush executes when specific events occur.","type":"object","properties":{"preRushInstall":{"description":"The list of scripts to run before the Rush installation starts.","type":"array","items":{"type":"string"}},"postRushInstall":{"description":"The list of scripts to run after the Rush installation finishes.","type":"array","items":{"type":"string"}},"preRushBuild":{"description":"The list of scripts to run before the Rush build command starts.","type":"array","items":{"type":"string"}},"postRushBuild":{"description":"The list of scripts to run after the Rush build command finishes.","type":"array","items":{"type":"string"}}},"additionalProperties":false}},"additionalProperties":false,"required":["rushVersion","projects"]}');
25050
+ module.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-04/schema#","title":"Rush main config File","description":"The main configuration file for the Rush multi-project build tool. See http://rushjs.io for details.","type":"object","definitions":{"environmentVariables":{"description":"Environment variables for the package manager","type":"object","additionalProperties":{"type":"object","properties":{"value":{"type":"string"},"override":{"type":"boolean"}},"additionalProperties":false}}},"properties":{"$schema":{"description":"Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.","type":"string"},"npmVersion":{"description":"If specified, selects NPM as the package manager and specifies the deterministic version to be installed by Rush.","type":"string","pattern":"^[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z.+\\\\-]+$"},"pnpmVersion":{"description":"If specified, selects PNPM as the package manager and specifies the deterministic version to be installed by Rush.","type":"string","pattern":"^[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z.+\\\\-]+$"},"yarnVersion":{"description":"If specified, selects Yarn as the package manager and specifies the deterministic version to be installed by Rush.","type":"string","pattern":"^[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z.+\\\\-]+$"},"rushVersion":{"description":"The version of the Rush tool that will be used to build this repository.","type":"string","pattern":"^[0-9]+\\\\.[0-9]+\\\\.[0-9a-zA-Z.+\\\\-]+$"},"nodeSupportedVersionRange":{"description":"A node-semver expression (e.g. \\">=1.2.3 <2.0.0\\", see https://github.com/npm/node-semver) indicating which versions of Node.js can safely be used to build this repository. If omitted, no validation is performed.","type":"string"},"nodeSupportedVersionInstructions":{"description":"If specified, when a rush command fails due to an unsupported node version, this additional instructional message is printed below the failure message.","type":"string"},"suppressNodeLtsWarning":{"description":"Rush normally prints a warning if it detects a pre-LTS Node.js version. If you are testing pre-LTS versions in preparation for supporting the first LTS version, you can use this setting to disable Rush\'s warning.","type":"boolean"},"projectFolderMinDepth":{"description":"The minimum folder depth for the projectFolder field. The default value is 1, i.e. no slashes in the path name.","type":"number"},"ensureConsistentVersions":{"description":"If true, consistent version specifiers for dependencies will be enforced (i.e. \\"rush check\\" is run before some commands).","type":"boolean"},"hotfixChangeEnabled":{"description":"Allows creation of hotfix changes. This feature is experimental so it is disabled by default. If this is set, \\"rush change\\" only allows a \\"hotfix\\" change type to be specified. This change type will be used when publishing subsequent changes from the monorepo.","type":"boolean"},"npmOptions":{"description":"Options that are only used when the NPM package manager is selected.","type":"object","properties":{"environmentVariables":{"$ref":"#/definitions/environmentVariables"}},"additionalProperties":false},"pnpmOptions":{"description":"Options that are only used when the PNPM pacakge manager is selected.","type":"object","properties":{"pnpmStore":{"description":"Specifies the location of the PNPM store. There are two possible values:\\n\\n\\"local\\" - use the \\"pnpm-store\\" folder in the current configured temp folder: \\"common/temp/pnpm-store\\" by default.\\n\\"global\\" - use PNPM\'s global store, which has the benefit of being shared across multiple repo folders, but the disadvantage of less isolation for builds (e.g. bugs or incompatibilities when two repos use different releases of PNPM)\\n\\nIn all cases, the store path will be overridden by the environment variable RUSH_PNPM_STORE_PATH.\\n\\nThe default value is \\"local\\".","type":"string","enum":["local","global"]},"strictPeerDependencies":{"description":"If true, then the installation will fail if there is a missing or invalid peer dependency in the tree, which is an invalid state that can cause build failures or incompatible dependency versions. (For historical reasons, JavaScript package managers generally do not treat this invalid state as an error.) This is done via the \\"--strict-peer-dependencies\\" flag in PNPM version < 7.0.0 and via the \\"--no-strict-peer-dependencies\\" flag in PNPM >= 7.0.0. The default value is false.","type":"boolean"},"resolutionStrategy":{"description":"(Deprecated) Configures the strategy used to select versions during installation. This feature requires PNPM version 3.1 or newer. It corresponds to the \\"--resolution-strategy\\" command-line option for PNPM. Possible values are \\"fast\\" and \\"fewer-dependencies\\". PNPM\'s default is \\"fast\\", but this may be incompatible with certain packages, for example the \\"@types\\" packages from DefinitelyTyped. Rush\'s default is \\"fewer-dependencies\\", which causes PNPM to avoid installing a newer version if an already installed version can be reused; this is more similar to NPM\'s algorithm.","type":"string","enum":["fewer-dependencies","fast"]},"environmentVariables":{"$ref":"#/definitions/environmentVariables"},"preventManualShrinkwrapChanges":{"description":"If true, then \\"rush install\\" will report an error if manual modifications were made to the PNPM shrinkwrap file without running `rush update` afterwards. To temporarily disable this validation when invoking \\"rush install\\", use the \\"--bypassPolicy\\" command-line parameter. The default value is false.","type":"boolean"},"useWorkspaces":{"description":"If true, then Rush will use the workspaces feature to install and link packages when invoking PNPM. The default value is false.","type":"boolean"}},"additionalProperties":false},"yarnOptions":{"description":"Options that are only used when the Yarn pacakge manager is selected.","type":"object","properties":{"ignoreEngines":{"description":"If true, then Rush will add the \\"--ignore-engines\\" option when invoking Yarn. * This allows \\"rush install\\" to succeed if there are dependencies with engines defined in package.json which do not match the current environment. The default value is false.","type":"boolean"},"environmentVariables":{"$ref":"#/definitions/environmentVariables"}},"additionalProperties":false},"projectFolderMaxDepth":{"description":"The maximum folder depth for the projectFolder field. The default value is 2, i.e. a single slash in the path name.","type":"number"},"allowMostlyStandardPackageNames":{"description":"Today the npmjs.com registry enforces fairly strict naming rules for packages, but in the early days there was no standard and hardly any enforcement. A few large legacy projects are still using nonstandard package names, and private registries sometimes allow it. Set \\"allowMostlyStandardPackageNames\\" to true to relax Rush\'s enforcement of package names. This allows upper case letters and in the future may relax other rules, however we want to minimize these exceptions. Many popular tools use certain punctuation characters as delimiters, based on the assumption that they will never appear in a package name; thus if we relax the rules too much it is likely to cause very confusing malfunctions. The default value is false.","type":"boolean"},"approvedPackagesPolicy":{"description":"Controls a package review workflow driven by the two config files \\"browser-approved-packages.json\\" and \\"nonbrowser-approved-packages.json\\"","type":"object","properties":{"reviewCategories":{"description":"A list of category names that can be applied to each project, and then referenced in \\"browser-approved-packages.json\\" and \\"nonbrowser-approved-packages.json\\"","type":"array","items":{"type":"string"}},"ignoredNpmScopes":{"description":"A list of NPM package scopes that will be excluded from review (e.g. \\"@types\\")","type":"array","items":{"type":"string","pattern":"^@"}}},"additionalProperties":false},"gitPolicy":{"description":"If the project is stored in a Git repository, additional settings related to Git","type":"object","properties":{"allowedEmailRegExps":{"description":"A list of regular expressions describing allowable e-mail patterns for Git commits. They are case-insensitive anchored JavaScript RegExps. Example: \\".*@example\\\\.com\\"","type":"array","items":{"type":"string"}},"sampleEmail":{"description":"An example valid e-mail address for \\"Mr. Example\\" that conforms to one of the allowedEmailRegExps. Example: \\"mr-example@contoso\\\\.com\\"","type":"string"},"versionBumpCommitMessage":{"description":"The commit message to use when committing changes during \\"rush publish\\". Defaults to \\"Bump versions [skip ci]\\"","type":"string"},"changeLogUpdateCommitMessage":{"description":"The commit message to use when committing change log files \\"rush version\\". Defaults to \\"Update changelogs [skip ci]\\"","type":"string"},"changefilesCommitMessage":{"description":"The commit message to use when commiting change files made by \\"rush change\\". Defaults to \\"Rush change\\"","type":"string"},"tagSeparator":{"description":"The separator between package name and version in git tag. Defaults to \\"_\\"","type":"string"}},"additionalProperties":false},"variants":{"description":"Defines the list of installation variants for this repository. For more details about this feature, see this article: https://rushjs.io/pages/advanced/installation_variants/","type":"array","items":{"type":"object","properties":{"variantName":{"description":"The name of the variant. Maps to common/rush/variants/{name} under the repository root.","type":"string"},"description":{"description":"","type":"string"}},"required":["variantName","description"]}},"repository":{"description":"The repository location","type":"object","properties":{"url":{"type":"string","description":"The remote url of the repository. If a value is provided, \\"rush change\\" will use it to find the right remote to compare against."},"urls":{"description":"All allowed remote urls of the repository. If a value is provided, \\"rush change\\" will use one of these to find the right remote to compare against. Specifying multiple URLs is useful if a GitHub repository is renamed or for \\"<projectName>.visualstudio.com\\" vs \\"dev.azure.com/<projectName>\\" URLs.","type":"array","items":{"type":"string"}},"defaultBranch":{"description":"The default branch name. This tells \\"rush change\\" which remote branch to compare against. The default value is \\"main\\"","type":"string"},"defaultRemote":{"description":"The default remote. This tells \\"rush change\\" which remote to compare against if the remote URL is not set or if a remote matching the provided remote URL is not found.","type":"string"}},"additionalProperties":false},"telemetryEnabled":{"description":"Indicates whether telemetry data should be collected and stored in the Rush temp folder during Rush runs.","type":"boolean"},"allowedProjectTags":{"description":"This is an optional, but recommended, list of allowed tags that can be applied to Rush projects using the \\"tags\\" setting in this file. This list is useful for preventing mistakes such as misspelling, and it also provides a centralized place to document your tags. If \\"allowedProjectTags\\" list is not specified, then any valid tag is allowed. A tag name must be one or more words separated by hyphens or slashes, where a word may contain lowercase ASCII letters, digits, \\".\\", and \\"@\\" characters.","type":"array","items":{"type":"string","pattern":"^[a-z0-9.@]+([-/][a-z0-9.@]+)*$"}},"projects":{"description":"A list of projects managed by this tool.","type":"array","items":{"type":"object","properties":{"packageName":{"description":"The NPM package name of the project.","type":"string"},"projectFolder":{"description":"The path to the project folder relative to the Rush config file.","type":"string"},"reviewCategory":{"description":"An optional category for usage in the \\"browser-approved-packages.json\\" and \\"nonbrowser-approved-packages.json\\" files. Only strings from reviewCategories are allowed here.","type":"string"},"cyclicDependencyProjects":{"description":"(Deprecated) This field was renamed to \\"decoupledLocalDependencies\\".","type":"array","items":{"type":"string"}},"decoupledLocalDependencies":{"description":"A list of local projects that appear as devDependencies for this project, but cannot be locally linked because it would create a cyclic dependency; instead, the last published version will be installed in the Common folder.","type":"array","items":{"type":"string"}},"shouldPublish":{"description":"A flag indicating that changes to this project will be published to npm, which affects the Rush change and publish workflows.","type":"boolean"},"skipRushCheck":{"description":"If true, then this project will be ignored by the \\"rush check\\" command. The default value is false.","type":"boolean"},"versionPolicyName":{"description":"An optional version policy associated with the project. Version policies are defined in \\"version-policies.json\\" file.","type":"string"},"publishFolder":{"description":"Facilitates postprocessing of a project\'s files prior to publishing. If specified, the \\"publishFolder\\" is the relative path to a subfolder of the project folder. The \\"rush publish\\" command will publish the subfolder instead of the project folder. The subfolder must contain its own package.json file, which is typically a build output.","type":"string"},"tags":{"description":"An optional set of custom tags that can be used to select this project. For example, adding \\"my-custom-tag\\" will allow this project to be selected by the command \\"rush list --only tag:my-custom-tag\\". The tag name must be one or more words separated by hyphens or slashes, where a word may contain lowercase ASCII letters, digits, \\".\\", and \\"@\\" characters.","type":"array","items":{"type":"string","pattern":"^[a-z0-9.@]+([-/][a-z0-9.@]+)*$"}},"splitWorkspace":{"description":"If true, then this project will be split out into a separate workspace folder. The default value is false.","type":"boolean"}},"additionalProperties":false,"required":["packageName","projectFolder"]}},"eventHooks":{"description":"Hooks are customized script actions that Rush executes when specific events occur.","type":"object","properties":{"preRushInstall":{"description":"The list of scripts to run before the Rush installation starts.","type":"array","items":{"type":"string"}},"postRushInstall":{"description":"The list of scripts to run after the Rush installation finishes.","type":"array","items":{"type":"string"}},"preRushBuild":{"description":"The list of scripts to run before the Rush build command starts.","type":"array","items":{"type":"string"}},"postRushBuild":{"description":"The list of scripts to run after the Rush build command finishes.","type":"array","items":{"type":"string"}}},"additionalProperties":false}},"additionalProperties":false,"required":["rushVersion","projects"]}');
23367
25051
 
23368
25052
  /***/ }),
23369
25053