@rushstack/rush-sdk 5.149.1 → 5.151.0

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.
@@ -1239,6 +1239,13 @@ export declare interface ICreateOperationsContext {
1239
1239
  * The Rush configuration
1240
1240
  */
1241
1241
  readonly rushConfiguration: RushConfiguration;
1242
+ /**
1243
+ * If true, Rush will automatically include the dependent phases for the specified set of phases.
1244
+ * @remarks
1245
+ * If the selection of projects was "unsafe" (i.e. missing some dependencies), this will add the
1246
+ * minimum number of phases required to make it safe.
1247
+ */
1248
+ readonly includePhaseDeps: boolean;
1242
1249
  /**
1243
1250
  * Marks an operation's result as invalid, potentially triggering a new build. Only applicable in watch mode.
1244
1251
  * @param operation - The operation to invalidate
@@ -1799,8 +1806,6 @@ export declare interface _IOperationMetadata {
1799
1806
  * @internal
1800
1807
  */
1801
1808
  export declare interface _IOperationMetadataManagerOptions {
1802
- rushProject: RushConfigurationProject;
1803
- phase: IPhase;
1804
1809
  operation: Operation;
1805
1810
  }
1806
1811
 
@@ -1810,13 +1815,13 @@ export declare interface _IOperationMetadataManagerOptions {
1810
1815
  */
1811
1816
  export declare interface IOperationOptions {
1812
1817
  /**
1813
- * The Rush phase associated with this Operation, if any
1818
+ * The Rush phase associated with this Operation
1814
1819
  */
1815
- phase?: IPhase | undefined;
1820
+ phase: IPhase;
1816
1821
  /**
1817
- * The Rush project associated with this Operation, if any
1822
+ * The Rush project associated with this Operation
1818
1823
  */
1819
- project?: RushConfigurationProject | undefined;
1824
+ project: RushConfigurationProject;
1820
1825
  /**
1821
1826
  * When the scheduler is ready to process this `Operation`, the `runner` implements the actual work of
1822
1827
  * running the operation.
@@ -1899,7 +1904,7 @@ export declare interface IOperationRunnerContext {
1899
1904
  *
1900
1905
  * @internal
1901
1906
  */
1902
- _operationMetadataManager?: _OperationMetadataManager;
1907
+ _operationMetadataManager: _OperationMetadataManager;
1903
1908
  /**
1904
1909
  * Object used to track elapsed time.
1905
1910
  */
@@ -2764,13 +2769,13 @@ export declare class NpmOptionsConfiguration extends PackageManagerOptionsConfig
2764
2769
  */
2765
2770
  export declare class Operation {
2766
2771
  /**
2767
- * The Rush phase associated with this Operation, if any
2772
+ * The Rush phase associated with this Operation
2768
2773
  */
2769
- readonly associatedPhase: IPhase | undefined;
2774
+ readonly associatedPhase: IPhase;
2770
2775
  /**
2771
- * The Rush project associated with this Operation, if any
2776
+ * The Rush project associated with this Operation
2772
2777
  */
2773
- readonly associatedProject: RushConfigurationProject | undefined;
2778
+ readonly associatedProject: RushConfigurationProject;
2774
2779
  /**
2775
2780
  * A set of all operations which depend on this operation.
2776
2781
  */
@@ -2817,7 +2822,7 @@ export declare class Operation {
2817
2822
  /**
2818
2823
  * The name of this operation, for logging.
2819
2824
  */
2820
- get name(): string | undefined;
2825
+ get name(): string;
2821
2826
  /**
2822
2827
  * If set to true, this operation is considered a no-op and can be considered always skipped for analysis purposes.
2823
2828
  */
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.50.0"
8
+ "packageVersion": "7.52.2"
9
9
  }
10
10
  ]
11
11
  }
@@ -140,6 +140,7 @@ export declare class CommandLineConfiguration {
140
140
  * @param cycleFreePhases Phases that have already been fully walked and confirmed to not be in any cycles
141
141
  */
142
142
  private _checkForPhaseSelfCycles;
143
+ private static _applyBuildCommandDefaults;
143
144
  /**
144
145
  * Load the command-line.json configuration file from the specified path. Note that this
145
146
  * does not include the default build settings. This option is intended to be used to load
@@ -154,7 +155,7 @@ export declare class CommandLineConfiguration {
154
155
  * settings. If the file does not exist, then a default instance is returned.
155
156
  * If the file contains errors, then an exception is thrown.
156
157
  */
157
- static loadFromFileOrDefault(jsonFilePath?: string): CommandLineConfiguration;
158
+ static loadFromFileOrDefault(jsonFilePath?: string, doNotIncludeDefaultBuildCommands?: boolean): CommandLineConfiguration;
158
159
  prependAdditionalPathFolder(pathFolder: string): void;
159
160
  private _translateBulkCommandToPhasedCommand;
160
161
  }
@@ -26,6 +26,7 @@ export declare class RushCommandLineParser extends CommandLineParser {
26
26
  private readonly _rushOptions;
27
27
  private readonly _terminalProvider;
28
28
  private readonly _terminal;
29
+ private readonly _autocreateBuildCommand;
29
30
  constructor(options?: Partial<IRushCommandLineParserOptions>);
30
31
  get isDebug(): boolean;
31
32
  get isQuiet(): boolean;
@@ -54,6 +54,7 @@ export declare class PhasedScriptAction extends BaseScriptAction<IPhasedCommandC
54
54
  private readonly _variantParameter;
55
55
  private readonly _noIPCParameter;
56
56
  private readonly _nodeDiagnosticDirParameter;
57
+ private readonly _includePhaseDeps;
57
58
  constructor(options: IPhasedScriptActionOptions);
58
59
  runAsync(): Promise<void>;
59
60
  private _runInitialPhasesAsync;
package/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" preserve="true" />
1
2
  /**
2
3
  * A library for writing scripts that interact with the {@link https://rushjs.io/ | Rush} tool.
3
4
  * @packageDocumentation
@@ -1,3 +1,4 @@
1
+ /// <reference path="../../src/npm-check-typings.d.ts" preserve="true" />
1
2
  import type { RushConfiguration } from '../api/RushConfiguration';
2
3
  import { type IDepsToUpgradeAnswers } from '../utilities/InteractiveUpgradeUI';
3
4
  import type { RushConfigurationProject } from '../api/RushConfigurationProject';
@@ -1,4 +1,4 @@
1
- /// <reference path="../../src/npm-check-typings.d.ts" />
1
+ /// <reference path="../../src/npm-check-typings.d.ts" preserve="true" />
2
2
  import type * as NpmCheck from 'npm-check';
3
3
  import type { RushConfiguration } from '../api/RushConfiguration';
4
4
  import { DependencyType } from '../api/PackageJsonEditor';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ITerminal } from '@rushstack/terminal';
3
2
  import type { RushConfiguration } from '../../api/RushConfiguration';
4
3
  import type { RushUserConfiguration } from '../../api/RushUserConfiguration';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ITerminal } from '@rushstack/terminal';
3
2
  /**
4
3
  * @beta
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { type ITerminal } from '@rushstack/terminal';
3
2
  import type { RushConfiguration } from '../../api/RushConfiguration';
4
3
  import type { RushGlobalFolder } from '../../api/RushGlobalFolder';
@@ -27,7 +27,7 @@ export interface IOperationRunnerContext {
27
27
  *
28
28
  * @internal
29
29
  */
30
- _operationMetadataManager?: OperationMetadataManager;
30
+ _operationMetadataManager: OperationMetadataManager;
31
31
  /**
32
32
  * Object used to track elapsed time.
33
33
  */
@@ -8,13 +8,13 @@ import type { IOperationSettings } from '../../api/RushProjectConfiguration';
8
8
  */
9
9
  export interface IOperationOptions {
10
10
  /**
11
- * The Rush phase associated with this Operation, if any
11
+ * The Rush phase associated with this Operation
12
12
  */
13
- phase?: IPhase | undefined;
13
+ phase: IPhase;
14
14
  /**
15
- * The Rush project associated with this Operation, if any
15
+ * The Rush project associated with this Operation
16
16
  */
17
- project?: RushConfigurationProject | undefined;
17
+ project: RushConfigurationProject;
18
18
  /**
19
19
  * When the scheduler is ready to process this `Operation`, the `runner` implements the actual work of
20
20
  * running the operation.
@@ -40,13 +40,13 @@ export interface IOperationOptions {
40
40
  */
41
41
  export declare class Operation {
42
42
  /**
43
- * The Rush phase associated with this Operation, if any
43
+ * The Rush phase associated with this Operation
44
44
  */
45
- readonly associatedPhase: IPhase | undefined;
45
+ readonly associatedPhase: IPhase;
46
46
  /**
47
- * The Rush project associated with this Operation, if any
47
+ * The Rush project associated with this Operation
48
48
  */
49
- readonly associatedProject: RushConfigurationProject | undefined;
49
+ readonly associatedProject: RushConfigurationProject;
50
50
  /**
51
51
  * A set of all operations which depend on this operation.
52
52
  */
@@ -93,7 +93,7 @@ export declare class Operation {
93
93
  /**
94
94
  * The name of this operation, for logging.
95
95
  */
96
- get name(): string | undefined;
96
+ get name(): string;
97
97
  /**
98
98
  * If set to true, this operation is considered a no-op and can be considered always skipped for analysis purposes.
99
99
  */
@@ -77,9 +77,9 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
77
77
  readonly stopwatch: Stopwatch;
78
78
  readonly stdioSummarizer: StdioSummarizer;
79
79
  readonly runner: IOperationRunner;
80
- readonly associatedPhase: IPhase | undefined;
81
- readonly associatedProject: RushConfigurationProject | undefined;
82
- readonly _operationMetadataManager: OperationMetadataManager | undefined;
80
+ readonly associatedPhase: IPhase;
81
+ readonly associatedProject: RushConfigurationProject;
82
+ readonly _operationMetadataManager: OperationMetadataManager;
83
83
  logFilePaths: ILogFilePaths | undefined;
84
84
  private readonly _context;
85
85
  private _collatedWriter;
@@ -1,14 +1,10 @@
1
1
  import { type ITerminalChunk, type ITerminal, type ITerminalProvider } from '@rushstack/terminal';
2
2
  import { OperationStateFile } from './OperationStateFile';
3
- import type { IPhase } from '../../api/CommandLineConfiguration';
4
- import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
5
3
  import type { Operation } from './Operation';
6
4
  /**
7
5
  * @internal
8
6
  */
9
7
  export interface IOperationMetadataManagerOptions {
10
- rushProject: RushConfigurationProject;
11
- phase: IPhase;
12
8
  operation: Operation;
13
9
  }
14
10
  /**
@@ -10,7 +10,7 @@ export interface IShellOperationRunnerOptions {
10
10
  commandForHash: string;
11
11
  }
12
12
  /**
13
- * An `IOperationRunner` subclass that performs an operation via a shell command.
13
+ * An `IOperationRunner` implementation that performs an operation via a shell command.
14
14
  * Currently contains the build cache logic, pending extraction as separate operations.
15
15
  * Supports skipping an operation if allowed and it is already up-to-date.
16
16
  */
@@ -21,6 +21,10 @@ export declare class ShellOperationRunner implements IOperationRunner {
21
21
  readonly cacheable: boolean;
22
22
  readonly warningsAreAllowed: boolean;
23
23
  readonly commandToRun: string;
24
+ /**
25
+ * The creator is expected to use a different runner if the command is known to be a noop.
26
+ */
27
+ readonly isNoOp: boolean;
24
28
  private readonly _commandForHash;
25
29
  private readonly _rushProject;
26
30
  constructor(options: IShellOperationRunnerOptions);
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import * as readline from 'readline';
4
2
  export declare class KeyboardLoop {
5
3
  protected stdin: NodeJS.ReadStream;
@@ -80,6 +80,13 @@ export interface ICreateOperationsContext {
80
80
  * The Rush configuration
81
81
  */
82
82
  readonly rushConfiguration: RushConfiguration;
83
+ /**
84
+ * If true, Rush will automatically include the dependent phases for the specified set of phases.
85
+ * @remarks
86
+ * If the selection of projects was "unsafe" (i.e. missing some dependencies), this will add the
87
+ * minimum number of phases required to make it safe.
88
+ */
89
+ readonly includePhaseDeps: boolean;
83
90
  /**
84
91
  * Marks an operation's result as invalid, potentially triggering a new build. Only applicable in watch mode.
85
92
  * @param operation - The operation to invalidate
@@ -1,4 +1,4 @@
1
- /// <reference path="../../src/npm-check-typings.d.ts" />
1
+ /// <reference path="../../src/npm-check-typings.d.ts" preserve="true" />
2
2
  import type * as NpmCheck from 'npm-check';
3
3
  export interface IUIGroup {
4
4
  title: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import * as child_process from 'child_process';
3
2
  import { type IWaitForExitResult } from '@rushstack/node-core-library';
4
3
  import type { RushConfiguration } from '../api/RushConfiguration';
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { type RequestOptions } from 'node:https';
4
2
  /**
5
3
  * For use with {@link WebClient}.
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export interface ILogger {
3
2
  info: (string: string) => void;
4
3
  error: (string: string) => void;
package/lib-shim/index.js CHANGED
@@ -269,9 +269,12 @@ function syncNpmrc(options) {
269
269
  if (!external_fs_.existsSync(targetNpmrcFolder)) {
270
270
  external_fs_.mkdirSync(targetNpmrcFolder, { recursive: true });
271
271
  }
272
- return _copyAndTrimNpmrcFile(Object.assign({ sourceNpmrcPath,
272
+ return _copyAndTrimNpmrcFile({
273
+ sourceNpmrcPath,
273
274
  targetNpmrcPath,
274
- logger }, options));
275
+ logger,
276
+ ...options
277
+ });
275
278
  }
276
279
  else if (external_fs_.existsSync(targetNpmrcPath)) {
277
280
  // If the source .npmrc doesn't exist and there is one in the target, delete the one in the target
@@ -1493,7 +1496,12 @@ class Utilities {
1493
1496
  const environment = Utilities._createEnvironmentForRushCommand({
1494
1497
  initCwd: options.initCwd,
1495
1498
  initialEnvironment: options.initialEnvironment,
1496
- pathOptions: Object.assign(Object.assign({}, options.environmentPathOptions), { rushJsonFolder: (_a = options.rushConfiguration) === null || _a === void 0 ? void 0 : _a.rushJsonFolder, projectRoot: options.workingDirectory, commonTempFolder: options.rushConfiguration ? options.rushConfiguration.commonTempFolder : undefined })
1499
+ pathOptions: {
1500
+ ...options.environmentPathOptions,
1501
+ rushJsonFolder: (_a = options.rushConfiguration) === null || _a === void 0 ? void 0 : _a.rushJsonFolder,
1502
+ projectRoot: options.workingDirectory,
1503
+ commonTempFolder: options.rushConfiguration ? options.rushConfiguration.commonTempFolder : undefined
1504
+ }
1497
1505
  });
1498
1506
  const stdio = options.handleOutput ? ['pipe', 'pipe', 'pipe'] : [0, 1, 2];
1499
1507
  if (options.ipc) {
@@ -1707,15 +1715,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
1707
1715
  }) : function(o, v) {
1708
1716
  o["default"] = v;
1709
1717
  });
1710
- var __importStar = (this && this.__importStar) || function (mod) {
1711
- if (mod && mod.__esModule) return mod;
1712
- var result = {};
1713
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1714
- __setModuleDefault(result, mod);
1715
- return result;
1716
- };
1718
+ var __importStar = (this && this.__importStar) || (function () {
1719
+ var ownKeys = function(o) {
1720
+ ownKeys = Object.getOwnPropertyNames || function (o) {
1721
+ var ar = [];
1722
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
1723
+ return ar;
1724
+ };
1725
+ return ownKeys(o);
1726
+ };
1727
+ return function (mod) {
1728
+ if (mod && mod.__esModule) return mod;
1729
+ var result = {};
1730
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
1731
+ __setModuleDefault(result, mod);
1732
+ return result;
1733
+ };
1734
+ })();
1717
1735
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1718
- exports.requireRushLibUnderFolderPath = exports._require = exports.tryFindRushJsonLocation = exports.sdkContext = exports.RUSH_LIB_PATH_ENV_VAR_NAME = exports.RUSH_LIB_NAME = void 0;
1736
+ exports.sdkContext = exports.RUSH_LIB_PATH_ENV_VAR_NAME = exports.RUSH_LIB_NAME = void 0;
1737
+ exports.tryFindRushJsonLocation = tryFindRushJsonLocation;
1738
+ exports._require = _require;
1739
+ exports.requireRushLibUnderFolderPath = requireRushLibUnderFolderPath;
1719
1740
  const path = __importStar(__webpack_require__(/*! path */ "path"));
1720
1741
  const node_core_library_1 = __webpack_require__(/*! @rushstack/node-core-library */ "@rushstack/node-core-library");
1721
1742
  exports.RUSH_LIB_NAME = '@microsoft/rush-lib';
@@ -1745,7 +1766,6 @@ function tryFindRushJsonLocation(startingFolder) {
1745
1766
  }
1746
1767
  return undefined;
1747
1768
  }
1748
- exports.tryFindRushJsonLocation = tryFindRushJsonLocation;
1749
1769
  function _require(moduleName) {
1750
1770
  if (typeof require === 'function') {
1751
1771
  // If this library has been bundled with Webpack, we need to call the real `require` function
@@ -1758,7 +1778,6 @@ function _require(moduleName) {
1758
1778
  return require(moduleName);
1759
1779
  }
1760
1780
  }
1761
- exports._require = _require;
1762
1781
  /**
1763
1782
  * Require `@microsoft/rush-lib` under the specified folder path.
1764
1783
  */
@@ -1769,7 +1788,6 @@ function requireRushLibUnderFolderPath(folderPath) {
1769
1788
  });
1770
1789
  return _require(rushLibModulePath);
1771
1790
  }
1772
- exports.requireRushLibUnderFolderPath = requireRushLibUnderFolderPath;
1773
1791
  //# sourceMappingURL=helpers.js.map
1774
1792
 
1775
1793
  /***/ }),
@@ -1800,16 +1818,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
1800
1818
  }) : function(o, v) {
1801
1819
  o["default"] = v;
1802
1820
  });
1803
- var __importStar = (this && this.__importStar) || function (mod) {
1804
- if (mod && mod.__esModule) return mod;
1805
- var result = {};
1806
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1807
- __setModuleDefault(result, mod);
1808
- return result;
1809
- };
1821
+ var __importStar = (this && this.__importStar) || (function () {
1822
+ var ownKeys = function(o) {
1823
+ ownKeys = Object.getOwnPropertyNames || function (o) {
1824
+ var ar = [];
1825
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
1826
+ return ar;
1827
+ };
1828
+ return ownKeys(o);
1829
+ };
1830
+ return function (mod) {
1831
+ if (mod && mod.__esModule) return mod;
1832
+ var result = {};
1833
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
1834
+ __setModuleDefault(result, mod);
1835
+ return result;
1836
+ };
1837
+ })();
1810
1838
  var _a;
1811
1839
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1812
- exports._rushSdk_loadInternalModule = void 0;
1840
+ exports._rushSdk_loadInternalModule = _rushSdk_loadInternalModule;
1813
1841
  const path = __importStar(__webpack_require__(/*! path */ "path"));
1814
1842
  const node_core_library_1 = __webpack_require__(/*! @rushstack/node-core-library */ "@rushstack/node-core-library");
1815
1843
  const terminal_1 = __webpack_require__(/*! @rushstack/terminal */ "@rushstack/terminal");
@@ -1986,7 +2014,6 @@ function _rushSdk_loadInternalModule(srcImportPath) {
1986
2014
  }
1987
2015
  return exports._RushInternals.loadModule(srcImportPath);
1988
2016
  }
1989
- exports._rushSdk_loadInternalModule = _rushSdk_loadInternalModule;
1990
2017
  //# sourceMappingURL=index.js.map
1991
2018
 
1992
2019
  /***/ }),