@rushstack/rush-sdk 5.101.0 → 5.102.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.
@@ -307,6 +307,58 @@ export declare class CredentialCache {
307
307
  private _validate;
308
308
  }
309
309
 
310
+ /**
311
+ * An identifier representing a Rush message that can be customized by
312
+ * defining a custom tip in `common/config/rush/custom-tips.json`.
313
+ * @remarks
314
+ * Custom tip ids always start with the `TIP_` prefix.
315
+ *
316
+ * @privateRemarks
317
+ * Events from the Rush process should with "TIP_RUSH_".
318
+ * Events from a PNPM subprocess should start with "TIP_PNPM_".
319
+ *
320
+ * @beta
321
+ */
322
+ export declare type CustomTipId = 'TIP_RUSH_INCONSISTENT_VERSIONS' | string;
323
+
324
+ /**
325
+ * Used to access the `common/config/rush/custom-tips.json` config file,
326
+ * which allows repo maintainers to configure extra details to be printed alongside
327
+ * certain Rush messages.
328
+ * @beta
329
+ */
330
+ export declare class CustomTipsConfiguration {
331
+ private static _jsonSchema;
332
+ private readonly _tipMap;
333
+ private readonly _jsonFileName;
334
+ /**
335
+ * The JSON settings loaded from `custom-tips.json`.
336
+ */
337
+ readonly configuration: Readonly<ICustomTipsJson>;
338
+ /**
339
+ * The list of identifiers that are allowed to be used in the "tipId" field
340
+ * of the config file.
341
+ */
342
+ static readonly supportedTipIds: ReadonlySet<string>;
343
+ constructor(configFilename: string);
344
+ private _formatTipMessage;
345
+ /**
346
+ * If custom-tips.json defines a tip for the specified tipId,
347
+ * display the tip on the terminal.
348
+ */
349
+ showInfoTip(terminal: ITerminal, tipId: CustomTipId): void;
350
+ /**
351
+ * If custom-tips.json defines a tip for the specified tipId,
352
+ * display the tip on the terminal.
353
+ */
354
+ showWarningTip(terminal: ITerminal, tipId: CustomTipId): void;
355
+ /**
356
+ * If custom-tips.json defines a tip for the specified tipId,
357
+ * display the tip on the terminal.
358
+ */
359
+ showErrorTip(terminal: ITerminal, tipId: CustomTipId): void;
360
+ }
361
+
310
362
  /**
311
363
  * @public
312
364
  */
@@ -812,6 +864,45 @@ export declare interface ICredentialCacheOptions {
812
864
  supportEditing: boolean;
813
865
  }
814
866
 
867
+ /**
868
+ * An item from the {@link ICustomTipsJson.customTips} list.
869
+ * @beta
870
+ */
871
+ export declare interface ICustomTipItemJson {
872
+ /**
873
+ * (REQUIRED) An identifier indicating a message that may be printed by Rush.
874
+ * If that message is printed, then this custom tip will be shown.
875
+ * Consult the Rush documentation for the current list of possible identifiers.
876
+ */
877
+ tipId: CustomTipId;
878
+ /**
879
+ * (REQUIRED) The message text to be displayed for this tip.
880
+ */
881
+ message: string;
882
+ /**
883
+ * Overrides the "defaultMessagePrefix" for this tip.
884
+ * Specify an empty string to omit the "defaultMessagePrefix" entirely.
885
+ */
886
+ messagePrefix?: string;
887
+ }
888
+
889
+ /**
890
+ * This interface represents the raw custom-tips.json file which allows repo maintainers
891
+ * to configure extra details to be printed alongside certain Rush messages.
892
+ * @beta
893
+ */
894
+ export declare interface ICustomTipsJson {
895
+ /**
896
+ * If specified, this prefix will be prepended to any the tip messages when they are displayed.
897
+ * The default value is an empty string.
898
+ */
899
+ defaultMessagePrefix?: string;
900
+ /**
901
+ * Specifies the custom tips to be displayed by Rush.
902
+ */
903
+ customTips?: ICustomTipItemJson[];
904
+ }
905
+
815
906
  declare interface IEnvironment {
816
907
  [environmentVariableName: string]: string | undefined;
817
908
  }
@@ -865,6 +956,12 @@ export declare interface IExperimentsJson {
865
956
  * Set this option to true to pass '--prefer-frozen-lockfile' instead.
866
957
  */
867
958
  usePnpmPreferFrozenLockfileForRushUpdate?: boolean;
959
+ /**
960
+ * By default, 'rush update' runs as a single operation.
961
+ * Set this option to true to instead update the lockfile with `--lockfile-only`, then perform a `--frozen-lockfile` install.
962
+ * Necessary when using the `afterAllResolved` hook in .pnpmfile.cjs.
963
+ */
964
+ usePnpmLockfileOnlyThenFrozenLockfileForRushUpdate?: boolean;
868
965
  /**
869
966
  * If using the 'preventManualShrinkwrapChanges' option, restricts the hash to only include the layout of external dependencies.
870
967
  * Used to allow links between workspace projects or the addition/removal of references to existing dependency versions to not
@@ -2907,6 +3004,16 @@ export declare class RushConfiguration {
2907
3004
  * @beta
2908
3005
  */
2909
3006
  readonly versionPolicyConfigurationFilePath: string;
3007
+ /**
3008
+ * Accesses the custom-tips.json configuration.
3009
+ * @beta
3010
+ */
3011
+ readonly customTipsConfiguration: CustomTipsConfiguration;
3012
+ /**
3013
+ * The absolute path to the custom tips configuration file.
3014
+ * @beta
3015
+ */
3016
+ readonly customTipsConfigurationFilePath: string;
2910
3017
  /**
2911
3018
  * This configuration object contains settings repo maintainers have specified to enable
2912
3019
  * and disable experimental Rush features.
@@ -3375,6 +3482,12 @@ export declare class RushConstants {
3375
3482
  * store the state of various features as they stand in the repo.
3376
3483
  */
3377
3484
  static readonly repoStateFilename: string;
3485
+ /**
3486
+ * The filename ("custom-tips.json") for the file used by Rush to
3487
+ * print user-customized messages.
3488
+ * This configuration file should go in the "common/config/rush" folder.
3489
+ */
3490
+ static readonly customTipsFilename: string;
3378
3491
  /**
3379
3492
  * The name of the per-project folder where project-specific Rush files are stored. For example,
3380
3493
  * the package-deps files, which are used by commands to determine if a particular project needs to be rebuilt.
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.36.3"
8
+ "packageVersion": "7.36.4"
9
9
  }
10
10
  ]
11
11
  }
@@ -0,0 +1,89 @@
1
+ import { ITerminal } from '@rushstack/node-core-library';
2
+ /**
3
+ * This interface represents the raw custom-tips.json file which allows repo maintainers
4
+ * to configure extra details to be printed alongside certain Rush messages.
5
+ * @beta
6
+ */
7
+ export interface ICustomTipsJson {
8
+ /**
9
+ * If specified, this prefix will be prepended to any the tip messages when they are displayed.
10
+ * The default value is an empty string.
11
+ */
12
+ defaultMessagePrefix?: string;
13
+ /**
14
+ * Specifies the custom tips to be displayed by Rush.
15
+ */
16
+ customTips?: ICustomTipItemJson[];
17
+ }
18
+ /**
19
+ * An item from the {@link ICustomTipsJson.customTips} list.
20
+ * @beta
21
+ */
22
+ export interface ICustomTipItemJson {
23
+ /**
24
+ * (REQUIRED) An identifier indicating a message that may be printed by Rush.
25
+ * If that message is printed, then this custom tip will be shown.
26
+ * Consult the Rush documentation for the current list of possible identifiers.
27
+ */
28
+ tipId: CustomTipId;
29
+ /**
30
+ * (REQUIRED) The message text to be displayed for this tip.
31
+ */
32
+ message: string;
33
+ /**
34
+ * Overrides the "defaultMessagePrefix" for this tip.
35
+ * Specify an empty string to omit the "defaultMessagePrefix" entirely.
36
+ */
37
+ messagePrefix?: string;
38
+ }
39
+ /**
40
+ * An identifier representing a Rush message that can be customized by
41
+ * defining a custom tip in `common/config/rush/custom-tips.json`.
42
+ * @remarks
43
+ * Custom tip ids always start with the `TIP_` prefix.
44
+ *
45
+ * @privateRemarks
46
+ * Events from the Rush process should with "TIP_RUSH_".
47
+ * Events from a PNPM subprocess should start with "TIP_PNPM_".
48
+ *
49
+ * @beta
50
+ */
51
+ export type CustomTipId = 'TIP_RUSH_INCONSISTENT_VERSIONS' | string;
52
+ /**
53
+ * Used to access the `common/config/rush/custom-tips.json` config file,
54
+ * which allows repo maintainers to configure extra details to be printed alongside
55
+ * certain Rush messages.
56
+ * @beta
57
+ */
58
+ export declare class CustomTipsConfiguration {
59
+ private static _jsonSchema;
60
+ private readonly _tipMap;
61
+ private readonly _jsonFileName;
62
+ /**
63
+ * The JSON settings loaded from `custom-tips.json`.
64
+ */
65
+ readonly configuration: Readonly<ICustomTipsJson>;
66
+ /**
67
+ * The list of identifiers that are allowed to be used in the "tipId" field
68
+ * of the config file.
69
+ */
70
+ static readonly supportedTipIds: ReadonlySet<string>;
71
+ constructor(configFilename: string);
72
+ private _formatTipMessage;
73
+ /**
74
+ * If custom-tips.json defines a tip for the specified tipId,
75
+ * display the tip on the terminal.
76
+ */
77
+ showInfoTip(terminal: ITerminal, tipId: CustomTipId): void;
78
+ /**
79
+ * If custom-tips.json defines a tip for the specified tipId,
80
+ * display the tip on the terminal.
81
+ */
82
+ showWarningTip(terminal: ITerminal, tipId: CustomTipId): void;
83
+ /**
84
+ * If custom-tips.json defines a tip for the specified tipId,
85
+ * display the tip on the terminal.
86
+ */
87
+ showErrorTip(terminal: ITerminal, tipId: CustomTipId): void;
88
+ }
89
+ //# sourceMappingURL=CustomTipsConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../lib-shim/index")._rushSdk_loadInternalModule("api/CustomTipsConfiguration");
@@ -14,6 +14,12 @@ export interface IExperimentsJson {
14
14
  * Set this option to true to pass '--prefer-frozen-lockfile' instead.
15
15
  */
16
16
  usePnpmPreferFrozenLockfileForRushUpdate?: boolean;
17
+ /**
18
+ * By default, 'rush update' runs as a single operation.
19
+ * Set this option to true to instead update the lockfile with `--lockfile-only`, then perform a `--frozen-lockfile` install.
20
+ * Necessary when using the `afterAllResolved` hook in .pnpmfile.cjs.
21
+ */
22
+ usePnpmLockfileOnlyThenFrozenLockfileForRushUpdate?: boolean;
17
23
  /**
18
24
  * If using the 'preventManualShrinkwrapChanges' option, restricts the hash to only include the layout of external dependencies.
19
25
  * Used to allow links between workspace projects or the addition/removal of references to existing dependency versions to not
@@ -13,6 +13,7 @@ import { IPnpmOptionsJson, PnpmOptionsConfiguration } from '../logic/pnpm/PnpmOp
13
13
  import { INpmOptionsJson, NpmOptionsConfiguration } from '../logic/npm/NpmOptionsConfiguration';
14
14
  import { IYarnOptionsJson, YarnOptionsConfiguration } from '../logic/yarn/YarnOptionsConfiguration';
15
15
  import { PackageManagerOptionsConfigurationBase } from '../logic/base/BasePackageManagerOptionsConfiguration';
16
+ import { CustomTipsConfiguration } from './CustomTipsConfiguration';
16
17
  /**
17
18
  * Part of IRushConfigurationJson.
18
19
  */
@@ -413,6 +414,16 @@ export declare class RushConfiguration {
413
414
  * @beta
414
415
  */
415
416
  readonly versionPolicyConfigurationFilePath: string;
417
+ /**
418
+ * Accesses the custom-tips.json configuration.
419
+ * @beta
420
+ */
421
+ readonly customTipsConfiguration: CustomTipsConfiguration;
422
+ /**
423
+ * The absolute path to the custom tips configuration file.
424
+ * @beta
425
+ */
426
+ readonly customTipsConfigurationFilePath: string;
416
427
  /**
417
428
  * This configuration object contains settings repo maintainers have specified to enable
418
429
  * and disable experimental Rush features.
@@ -2,10 +2,12 @@ import type { CommandLineFlagParameter, CommandLineIntegerParameter, CommandLine
2
2
  import { BaseRushAction, IBaseRushActionOptions } from './BaseRushAction';
3
3
  import type { IInstallManagerOptions } from '../../logic/base/BaseInstallManagerTypes';
4
4
  import { SelectionParameterSet } from '../parsing/SelectionParameterSet';
5
+ import { ITerminal } from '@rushstack/node-core-library';
5
6
  /**
6
7
  * This is the common base class for InstallAction and UpdateAction.
7
8
  */
8
9
  export declare abstract class BaseInstallAction extends BaseRushAction {
10
+ protected readonly _terminal: ITerminal;
9
11
  protected readonly _variant: CommandLineStringParameter;
10
12
  protected readonly _purgeParameter: CommandLineFlagParameter;
11
13
  protected readonly _bypassPolicyParameter: CommandLineFlagParameter;
@@ -1,6 +1,7 @@
1
1
  import { RushCommandLineParser } from '../RushCommandLineParser';
2
2
  import { BaseRushAction } from './BaseRushAction';
3
3
  export declare class CheckAction extends BaseRushAction {
4
+ private readonly _terminal;
4
5
  private readonly _variant;
5
6
  private readonly _jsonFlag;
6
7
  private readonly _verboseFlag;
package/lib/index.d.ts CHANGED
@@ -31,6 +31,7 @@ export { VersionPolicyConfiguration } from './api/VersionPolicyConfiguration';
31
31
  export { ILaunchOptions, Rush } from './api/Rush';
32
32
  export { RushInternals as _RushInternals } from './api/RushInternals';
33
33
  export { ExperimentsConfiguration, IExperimentsJson } from './api/ExperimentsConfiguration';
34
+ export { CustomTipsConfiguration, CustomTipId, ICustomTipsJson, ICustomTipItemJson } from './api/CustomTipsConfiguration';
34
35
  export { ProjectChangeAnalyzer, IGetChangedProjectsOptions } from './logic/ProjectChangeAnalyzer';
35
36
  export { IOperationRunner, IOperationRunnerContext } from './logic/operations/IOperationRunner';
36
37
  export { IExecutionResult, IOperationExecutionResult } from './logic/operations/IOperationExecutionResult';
@@ -108,6 +108,12 @@ export declare class RushConstants {
108
108
  * store the state of various features as they stand in the repo.
109
109
  */
110
110
  static readonly repoStateFilename: string;
111
+ /**
112
+ * The filename ("custom-tips.json") for the file used by Rush to
113
+ * print user-customized messages.
114
+ * This configuration file should go in the "common/config/rush" folder.
115
+ */
116
+ static readonly customTipsFilename: string;
111
117
  /**
112
118
  * The name of the per-project folder where project-specific Rush files are stored. For example,
113
119
  * the package-deps files, which are used by commands to determine if a particular project needs to be rebuilt.
@@ -29,6 +29,10 @@ export interface IInstallManagerOptions {
29
29
  * will be upgraded to the latest SemVer-compatible version.
30
30
  */
31
31
  fullUpgrade: boolean;
32
+ /**
33
+ * If set, only update the shrinkwrap file; do not create node_modules.
34
+ */
35
+ onlyShrinkwrap?: boolean;
32
36
  /**
33
37
  * Whether to force an update to the shrinkwrap file even if it appears to be unnecessary.
34
38
  * Normally Rush uses heuristics to determine when "pnpm install" can be skipped,
@@ -1,3 +1,4 @@
1
+ import { ITerminal } from '@rushstack/node-core-library';
1
2
  import { RushConfiguration } from '../../api/RushConfiguration';
2
3
  import { VersionMismatchFinderEntity } from './VersionMismatchFinderEntity';
3
4
  export interface IVersionMismatchFinderOptions {
@@ -27,8 +28,8 @@ export declare class VersionMismatchFinder {
27
28
  private _mismatches;
28
29
  private _projects;
29
30
  constructor(projects: VersionMismatchFinderEntity[], allowedAlternativeVersions?: Map<string, ReadonlyArray<string>>);
30
- static rushCheck(rushConfiguration: RushConfiguration, options?: IVersionMismatchFinderRushCheckOptions): void;
31
- static ensureConsistentVersions(rushConfiguration: RushConfiguration, options?: IVersionMismatchFinderEnsureConsistentVersionsOptions): void;
31
+ static rushCheck(rushConfiguration: RushConfiguration, terminal: ITerminal, options?: IVersionMismatchFinderRushCheckOptions): void;
32
+ static ensureConsistentVersions(rushConfiguration: RushConfiguration, terminal: ITerminal, options?: IVersionMismatchFinderEnsureConsistentVersionsOptions): void;
32
33
  /**
33
34
  * Populates a version mismatch finder object given a Rush Configuration.
34
35
  * Intentionally considers preferred versions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.101.0",
3
+ "version": "5.102.0",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  "@types/node": "14.18.36",
32
32
  "@types/semver": "7.5.0",
33
33
  "@types/webpack-env": "1.18.0",
34
- "@microsoft/rush-lib": "5.101.0",
34
+ "@microsoft/rush-lib": "5.102.0",
35
35
  "@rushstack/eslint-config": "3.3.3",
36
36
  "@rushstack/heft": "0.58.2",
37
37
  "@rushstack/heft-node-rig": "2.2.22",