@rushstack/rush-sdk 0.0.0 → 5.57.0-dev.1
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.
- package/LICENSE +24 -0
- package/README.md +26 -0
- package/dist/rush-lib.d.ts +2700 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +90 -0
- package/lib/index.js.map +1 -0
- package/package.json +29 -3
|
@@ -0,0 +1,2700 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A library for writing scripts that interact with the {@link https://rushjs.io/ | Rush} tool.
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/// <reference types="node" />
|
|
7
|
+
|
|
8
|
+
import { AsyncSeriesHook } from 'tapable';
|
|
9
|
+
import { IPackageJson } from '@rushstack/node-core-library';
|
|
10
|
+
import { ITerminal } from '@rushstack/node-core-library';
|
|
11
|
+
import { ITerminalProvider } from '@rushstack/node-core-library';
|
|
12
|
+
import { JsonObject } from '@rushstack/node-core-library';
|
|
13
|
+
import { PackageNameParser } from '@rushstack/node-core-library';
|
|
14
|
+
import { Terminal } from '@rushstack/node-core-library';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This represents the JSON file specified via the "approvedPackagesFile" option in rush.json.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export declare class ApprovedPackagesConfiguration {
|
|
21
|
+
private static _jsonSchema;
|
|
22
|
+
items: ApprovedPackagesItem[];
|
|
23
|
+
private _itemsByName;
|
|
24
|
+
private _loadedJson;
|
|
25
|
+
private _jsonFilename;
|
|
26
|
+
constructor(jsonFilename: string);
|
|
27
|
+
/**
|
|
28
|
+
* Clears all the settings, returning to an empty state.
|
|
29
|
+
*/
|
|
30
|
+
clear(): void;
|
|
31
|
+
getItemByName(packageName: string): ApprovedPackagesItem | undefined;
|
|
32
|
+
addOrUpdatePackage(packageName: string, reviewCategory: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* If the file exists, calls loadFromFile().
|
|
35
|
+
*/
|
|
36
|
+
tryLoadFromFile(approvedPackagesPolicyEnabled: boolean): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Loads the configuration data from the filename that was passed to the constructor.
|
|
39
|
+
*/
|
|
40
|
+
loadFromFile(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Loads the configuration data to the filename that was passed to the constructor.
|
|
43
|
+
*/
|
|
44
|
+
saveToFile(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Helper function only used by the constructor when loading the file.
|
|
47
|
+
*/
|
|
48
|
+
private _addItemJson;
|
|
49
|
+
/**
|
|
50
|
+
* Helper function that adds an already created ApprovedPackagesItem to the
|
|
51
|
+
* list and set.
|
|
52
|
+
*/
|
|
53
|
+
private _addItem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* An item returned by ApprovedPackagesConfiguration
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export declare class ApprovedPackagesItem {
|
|
61
|
+
/**
|
|
62
|
+
* The NPM package name
|
|
63
|
+
*/
|
|
64
|
+
packageName: string;
|
|
65
|
+
/**
|
|
66
|
+
* The project categories that are allowed to use this package.
|
|
67
|
+
*/
|
|
68
|
+
allowedCategories: Set<string>;
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
constructor(packageName: string);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* This is a helper object for RushConfiguration.
|
|
77
|
+
* It exposes the "approvedPackagesPolicy" feature from rush.json.
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
export declare class ApprovedPackagesPolicy {
|
|
81
|
+
private _enabled;
|
|
82
|
+
private _ignoredNpmScopes;
|
|
83
|
+
private _reviewCategories;
|
|
84
|
+
private _browserApprovedPackages;
|
|
85
|
+
private _nonbrowserApprovedPackages;
|
|
86
|
+
/** @internal */
|
|
87
|
+
constructor(rushConfiguration: RushConfiguration, rushConfigurationJson: IRushConfigurationJson);
|
|
88
|
+
/**
|
|
89
|
+
* Whether the feature is enabled. The feature is enabled if the "approvedPackagesPolicy"
|
|
90
|
+
* field is assigned in rush.json.
|
|
91
|
+
*/
|
|
92
|
+
get enabled(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* A list of NPM package scopes that will be excluded from review (e.g. `@types`)
|
|
95
|
+
*/
|
|
96
|
+
get ignoredNpmScopes(): Set<string>;
|
|
97
|
+
/**
|
|
98
|
+
* A list of category names that are valid for usage as the RushConfigurationProject.reviewCategory field.
|
|
99
|
+
* This array will never be undefined.
|
|
100
|
+
*/
|
|
101
|
+
get reviewCategories(): Set<string>;
|
|
102
|
+
/**
|
|
103
|
+
* Packages approved for usage in a web browser. This is the stricter of the two types, so by default
|
|
104
|
+
* all new packages are added to this file.
|
|
105
|
+
*
|
|
106
|
+
* @remarks
|
|
107
|
+
*
|
|
108
|
+
* This is part of an optional approval workflow, whose purpose is to review any new dependencies
|
|
109
|
+
* that are introduced (e.g. maybe a legal review is required, or maybe we are trying to minimize bloat).
|
|
110
|
+
* When Rush discovers a new dependency has been added to package.json, it will update the file.
|
|
111
|
+
* The intent is that the file will be stored in Git and tracked by a branch policy that notifies
|
|
112
|
+
* reviewers when a PR attempts to modify the file.
|
|
113
|
+
*
|
|
114
|
+
* Example filename: `C:\MyRepo\common\config\rush\browser-approved-packages.json`
|
|
115
|
+
*/
|
|
116
|
+
get browserApprovedPackages(): ApprovedPackagesConfiguration;
|
|
117
|
+
/**
|
|
118
|
+
* Packages approved for usage everywhere *except* in a web browser.
|
|
119
|
+
*
|
|
120
|
+
* @remarks
|
|
121
|
+
*
|
|
122
|
+
* This is part of an optional approval workflow, whose purpose is to review any new dependencies
|
|
123
|
+
* that are introduced (e.g. maybe a legal review is required, or maybe we are trying to minimize bloat).
|
|
124
|
+
* The intent is that the file will be stored in Git and tracked by a branch policy that notifies
|
|
125
|
+
* reviewers when a PR attempts to modify the file.
|
|
126
|
+
*
|
|
127
|
+
* Example filename: `C:\MyRepo\common\config\rush\browser-approved-packages.json`
|
|
128
|
+
*/
|
|
129
|
+
get nonbrowserApprovedPackages(): ApprovedPackagesConfiguration;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Type of version bumps
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
export declare enum BumpType {
|
|
137
|
+
'none' = 0,
|
|
138
|
+
'prerelease' = 1,
|
|
139
|
+
'patch' = 2,
|
|
140
|
+
'preminor' = 3,
|
|
141
|
+
'minor' = 4,
|
|
142
|
+
'major' = 5
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* A class that helps with programmatically interacting with Rush's change files.
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
149
|
+
export declare class ChangeManager {
|
|
150
|
+
/**
|
|
151
|
+
* Creates a change file that has a 'none' type.
|
|
152
|
+
* @param rushConfiguration - The rush configuration we are working with
|
|
153
|
+
* @param projectName - The name of the project for which to create a change file
|
|
154
|
+
* @param emailAddress - The email address which should be associated with this change
|
|
155
|
+
* @returns the path to the file that was created, or undefined if no file was written
|
|
156
|
+
*/
|
|
157
|
+
static createEmptyChangeFiles(rushConfiguration: RushConfiguration, projectName: string, emailAddress: string): string | undefined;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @beta
|
|
162
|
+
*/
|
|
163
|
+
export declare type CloudBuildCacheProviderFactory = (buildCacheJson: IBuildCacheJson) => ICloudBuildCacheProvider;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Use this class to load and save the "common/config/rush/common-versions.json" config file.
|
|
167
|
+
* This config file stores dependency version information that affects all projects in the repo.
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
export declare class CommonVersionsConfiguration {
|
|
171
|
+
private static _jsonSchema;
|
|
172
|
+
private _filePath;
|
|
173
|
+
private _preferredVersions;
|
|
174
|
+
private _implicitlyPreferredVersions;
|
|
175
|
+
private _xstitchPreferredVersions;
|
|
176
|
+
private _allowedAlternativeVersions;
|
|
177
|
+
private _modified;
|
|
178
|
+
private constructor();
|
|
179
|
+
/**
|
|
180
|
+
* Loads the common-versions.json data from the specified file path.
|
|
181
|
+
* If the file has not been created yet, then an empty object is returned.
|
|
182
|
+
*/
|
|
183
|
+
static loadFromFile(jsonFilename: string): CommonVersionsConfiguration;
|
|
184
|
+
private static _deserializeTable;
|
|
185
|
+
private static _serializeTable;
|
|
186
|
+
/**
|
|
187
|
+
* Get the absolute file path of the common-versions.json file.
|
|
188
|
+
*/
|
|
189
|
+
get filePath(): string;
|
|
190
|
+
/**
|
|
191
|
+
* Get a sha1 hash of the preferred versions.
|
|
192
|
+
*/
|
|
193
|
+
getPreferredVersionsHash(): string;
|
|
194
|
+
/**
|
|
195
|
+
* Writes the "common-versions.json" file to disk, using the filename that was passed to loadFromFile().
|
|
196
|
+
*/
|
|
197
|
+
save(): boolean;
|
|
198
|
+
/**
|
|
199
|
+
* A table that specifies a "preferred version" for a given NPM package. This feature is typically used
|
|
200
|
+
* to hold back an indirect dependency to a specific older version, or to reduce duplication of indirect dependencies.
|
|
201
|
+
*
|
|
202
|
+
* @remarks
|
|
203
|
+
* The "preferredVersions" value can be any SemVer range specifier (e.g. `~1.2.3`). Rush injects these values into
|
|
204
|
+
* the "dependencies" field of the top-level common/temp/package.json, which influences how the package manager
|
|
205
|
+
* will calculate versions. The specific effect depends on your package manager. Generally it will have no
|
|
206
|
+
* effect on an incompatible or already constrained SemVer range. If you are using PNPM, similar effects can be
|
|
207
|
+
* achieved using the pnpmfile.js hook. See the Rush documentation for more details.
|
|
208
|
+
*
|
|
209
|
+
* After modifying this field, it's recommended to run `rush update --full` so that the package manager
|
|
210
|
+
* will recalculate all version selections.
|
|
211
|
+
*/
|
|
212
|
+
get preferredVersions(): Map<string, string>;
|
|
213
|
+
/**
|
|
214
|
+
* When set to true, for all projects in the repo, all dependencies will be automatically added as preferredVersions,
|
|
215
|
+
* except in cases where different projects specify different version ranges for a given dependency. For older
|
|
216
|
+
* package managers, this tended to reduce duplication of indirect dependencies. However, it can sometimes cause
|
|
217
|
+
* trouble for indirect dependencies with incompatible peerDependencies ranges.
|
|
218
|
+
*
|
|
219
|
+
* If the value is `undefined`, then the default value is `true`.
|
|
220
|
+
*/
|
|
221
|
+
get implicitlyPreferredVersions(): boolean | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* A table of specifies preferred versions maintained by the XStitch tool.
|
|
224
|
+
*
|
|
225
|
+
* @remarks
|
|
226
|
+
* This property has the same behavior as the "preferredVersions" property, except these entries
|
|
227
|
+
* are automatically managed by the XStitch tool. It is an error for the same dependency name
|
|
228
|
+
* to appear in both tables.
|
|
229
|
+
*/
|
|
230
|
+
get xstitchPreferredVersions(): Map<string, string>;
|
|
231
|
+
/**
|
|
232
|
+
* A table that stores, for a given dependency, a list of SemVer ranges that will be accepted
|
|
233
|
+
* by "rush check" in addition to the normal version range.
|
|
234
|
+
*
|
|
235
|
+
* @remarks
|
|
236
|
+
* The "rush check" command can be used to enforce that every project in the repo
|
|
237
|
+
* must specify the same SemVer range for a given dependency. However, sometimes
|
|
238
|
+
* exceptions are needed. The allowedAlternativeVersions table allows you to list
|
|
239
|
+
* other SemVer ranges that will be accepted by "rush check" for a given dependency.
|
|
240
|
+
* Note that the normal version range (as inferred by looking at all projects in the repo)
|
|
241
|
+
* should NOT be included in this list.
|
|
242
|
+
*/
|
|
243
|
+
get allowedAlternativeVersions(): Map<string, ReadonlyArray<string>>;
|
|
244
|
+
/**
|
|
245
|
+
* Returns the union of preferredVersions and xstitchPreferredVersions.
|
|
246
|
+
*/
|
|
247
|
+
getAllPreferredVersions(): Map<string, string>;
|
|
248
|
+
private _onSetPreferredVersions;
|
|
249
|
+
private _onSetAllowedAlternativeVersions;
|
|
250
|
+
private _serialize;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @beta
|
|
255
|
+
*/
|
|
256
|
+
export declare class CredentialCache {
|
|
257
|
+
private readonly _cacheFilePath;
|
|
258
|
+
private readonly _cacheEntries;
|
|
259
|
+
private _modified;
|
|
260
|
+
private _disposed;
|
|
261
|
+
private _supportsEditing;
|
|
262
|
+
private readonly _lockfile;
|
|
263
|
+
private constructor();
|
|
264
|
+
static initializeAsync(options: ICredentialCacheOptions): Promise<CredentialCache>;
|
|
265
|
+
static usingAsync(options: ICredentialCacheOptions, doActionAsync: (credentialCache: CredentialCache) => Promise<void> | void): Promise<void>;
|
|
266
|
+
setCacheEntry(cacheId: string, credential: string, expires?: Date): void;
|
|
267
|
+
tryGetCacheEntry(cacheId: string): ICredentialCacheEntry | undefined;
|
|
268
|
+
deleteCacheEntry(cacheId: string): void;
|
|
269
|
+
trimExpiredEntries(): void;
|
|
270
|
+
saveIfModifiedAsync(): Promise<void>;
|
|
271
|
+
dispose(): void;
|
|
272
|
+
private _validate;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @public
|
|
277
|
+
*/
|
|
278
|
+
export declare enum DependencyType {
|
|
279
|
+
Regular = "dependencies",
|
|
280
|
+
Dev = "devDependencies",
|
|
281
|
+
Optional = "optionalDependencies",
|
|
282
|
+
Peer = "peerDependencies",
|
|
283
|
+
YarnResolutions = "resolutions"
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Provides Rush-specific environment variable data. All Rush environment variables must start with "RUSH_". This class
|
|
288
|
+
* is designed to be used by RushConfiguration.
|
|
289
|
+
* @beta
|
|
290
|
+
*
|
|
291
|
+
* @remarks
|
|
292
|
+
* Initialize will throw if any unknown parameters are present.
|
|
293
|
+
*/
|
|
294
|
+
export declare class EnvironmentConfiguration {
|
|
295
|
+
private static _hasBeenValidated;
|
|
296
|
+
private static _rushTempFolderOverride;
|
|
297
|
+
private static _absoluteSymlinks;
|
|
298
|
+
private static _allowUnsupportedNodeVersion;
|
|
299
|
+
private static _allowWarningsInSuccessfulBuild;
|
|
300
|
+
private static _pnpmStorePathOverride;
|
|
301
|
+
private static _rushGlobalFolderOverride;
|
|
302
|
+
private static _buildCacheCredential;
|
|
303
|
+
private static _buildCacheEnabled;
|
|
304
|
+
private static _buildCacheWriteAllowed;
|
|
305
|
+
private static _gitBinaryPath;
|
|
306
|
+
private static _tarBinaryPath;
|
|
307
|
+
/**
|
|
308
|
+
* An override for the common/temp folder path.
|
|
309
|
+
*/
|
|
310
|
+
static get rushTempFolderOverride(): string | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* If "1", create symlinks with absolute paths instead of relative paths.
|
|
313
|
+
* See {@link EnvironmentVariableNames.RUSH_ABSOLUTE_SYMLINKS}
|
|
314
|
+
*/
|
|
315
|
+
static get absoluteSymlinks(): boolean;
|
|
316
|
+
/**
|
|
317
|
+
* If this environment variable is set to "1", the Node.js version check will print a warning
|
|
318
|
+
* instead of causing a hard error if the environment's Node.js version doesn't match the
|
|
319
|
+
* version specifier in `rush.json`'s "nodeSupportedVersionRange" property.
|
|
320
|
+
*
|
|
321
|
+
* See {@link EnvironmentVariableNames.RUSH_ALLOW_UNSUPPORTED_NODEJS}.
|
|
322
|
+
*/
|
|
323
|
+
static get allowUnsupportedNodeVersion(): boolean;
|
|
324
|
+
/**
|
|
325
|
+
* Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`
|
|
326
|
+
* in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,
|
|
327
|
+
* or `0` to disallow them. (See the comments in the command-line.json file for more information).
|
|
328
|
+
*/
|
|
329
|
+
static get allowWarningsInSuccessfulBuild(): boolean;
|
|
330
|
+
/**
|
|
331
|
+
* An override for the PNPM store path, if `pnpmStore` configuration is set to 'path'
|
|
332
|
+
* See {@link EnvironmentVariableNames.RUSH_PNPM_STORE_PATH}
|
|
333
|
+
*/
|
|
334
|
+
static get pnpmStorePathOverride(): string | undefined;
|
|
335
|
+
/**
|
|
336
|
+
* Overrides the location of the `~/.rush` global folder where Rush stores temporary files.
|
|
337
|
+
* See {@link EnvironmentVariableNames.RUSH_GLOBAL_FOLDER}
|
|
338
|
+
*/
|
|
339
|
+
static get rushGlobalFolderOverride(): string | undefined;
|
|
340
|
+
/**
|
|
341
|
+
* Provides a credential for reading from and writing to a remote build cache, if configured.
|
|
342
|
+
* See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_CREDENTIAL}
|
|
343
|
+
*/
|
|
344
|
+
static get buildCacheCredential(): string | undefined;
|
|
345
|
+
/**
|
|
346
|
+
* If set, enables or disables the cloud build cache feature.
|
|
347
|
+
* See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_ENABLED}
|
|
348
|
+
*/
|
|
349
|
+
static get buildCacheEnabled(): boolean | undefined;
|
|
350
|
+
/**
|
|
351
|
+
* If set, enables or disables writing to the cloud build cache.
|
|
352
|
+
* See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED}
|
|
353
|
+
*/
|
|
354
|
+
static get buildCacheWriteAllowed(): boolean | undefined;
|
|
355
|
+
/**
|
|
356
|
+
* Allows the git binary path to be explicitly provided.
|
|
357
|
+
* See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH}
|
|
358
|
+
*/
|
|
359
|
+
static get gitBinaryPath(): string | undefined;
|
|
360
|
+
/**
|
|
361
|
+
* Allows the tar binary path to be explicitly provided.
|
|
362
|
+
* See {@link EnvironmentVariableNames.RUSH_TAR_BINARY_PATH}
|
|
363
|
+
*/
|
|
364
|
+
static get tarBinaryPath(): string | undefined;
|
|
365
|
+
/**
|
|
366
|
+
* The front-end RushVersionSelector relies on `RUSH_GLOBAL_FOLDER`, so its value must be read before
|
|
367
|
+
* `EnvironmentConfiguration` is initialized (and actually before the correct version of `EnvironmentConfiguration`
|
|
368
|
+
* is even installed). Thus we need to read this environment variable differently from all the others.
|
|
369
|
+
* @internal
|
|
370
|
+
*/
|
|
371
|
+
static _getRushGlobalFolderOverride(processEnv: IEnvironment): string | undefined;
|
|
372
|
+
/**
|
|
373
|
+
* Reads and validates environment variables. If any are invalid, this function will throw.
|
|
374
|
+
*/
|
|
375
|
+
static validate(options?: IEnvironmentConfigurationInitializeOptions): void;
|
|
376
|
+
/**
|
|
377
|
+
* Resets EnvironmentConfiguration into an un-initialized state.
|
|
378
|
+
*/
|
|
379
|
+
static reset(): void;
|
|
380
|
+
private static _ensureValidated;
|
|
381
|
+
static parseBooleanEnvironmentVariable(name: string, value: string | undefined): boolean | undefined;
|
|
382
|
+
/**
|
|
383
|
+
* Given a path to a folder (that may or may not exist), normalize the path, including casing,
|
|
384
|
+
* to the first existing parent folder in the path.
|
|
385
|
+
*
|
|
386
|
+
* If no existing path can be found (for example, if the root is a volume that doesn't exist),
|
|
387
|
+
* this function returns undefined.
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* If the following path exists on disk: `C:\Folder1\folder2\`
|
|
391
|
+
* _normalizeFirstExistingFolderPath('c:\\folder1\\folder2\\temp\\subfolder')
|
|
392
|
+
* returns 'C:\\Folder1\\folder2\\temp\\subfolder'
|
|
393
|
+
*/
|
|
394
|
+
private static _normalizeDeepestParentFolderPath;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Names of environment variables used by Rush.
|
|
399
|
+
* @beta
|
|
400
|
+
*/
|
|
401
|
+
export declare enum EnvironmentVariableNames {
|
|
402
|
+
/**
|
|
403
|
+
* This variable overrides the temporary folder used by Rush.
|
|
404
|
+
* The default value is "common/temp" under the repository root.
|
|
405
|
+
*
|
|
406
|
+
* @remarks This environment variable is not compatible with workspace installs. If attempting
|
|
407
|
+
* to move the PNPM store path, see the `RUSH_PNPM_STORE_PATH` environment variable.
|
|
408
|
+
*/
|
|
409
|
+
RUSH_TEMP_FOLDER = "RUSH_TEMP_FOLDER",
|
|
410
|
+
/**
|
|
411
|
+
* This variable overrides the version of Rush that will be installed by
|
|
412
|
+
* the version selector. The default value is determined by the "rushVersion"
|
|
413
|
+
* field from rush.json.
|
|
414
|
+
*/
|
|
415
|
+
RUSH_PREVIEW_VERSION = "RUSH_PREVIEW_VERSION",
|
|
416
|
+
/**
|
|
417
|
+
* If this variable is set to "1", Rush will not fail the build when running a version
|
|
418
|
+
* of Node that does not match the criteria specified in the "nodeSupportedVersionRange"
|
|
419
|
+
* field from rush.json.
|
|
420
|
+
*/
|
|
421
|
+
RUSH_ALLOW_UNSUPPORTED_NODEJS = "RUSH_ALLOW_UNSUPPORTED_NODEJS",
|
|
422
|
+
/**
|
|
423
|
+
* Setting this environment variable overrides the value of `allowWarningsInSuccessfulBuild`
|
|
424
|
+
* in the `command-line.json` configuration file. Specify `1` to allow warnings in a successful build,
|
|
425
|
+
* or `0` to disallow them. (See the comments in the command-line.json file for more information).
|
|
426
|
+
*/
|
|
427
|
+
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD = "RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD",
|
|
428
|
+
/**
|
|
429
|
+
* This variable selects a specific installation variant for Rush to use when installing
|
|
430
|
+
* and linking package dependencies.
|
|
431
|
+
* For more information, see the command-line help for the `--variant` parameter
|
|
432
|
+
* and this article: https://rushjs.io/pages/advanced/installation_variants/
|
|
433
|
+
*/
|
|
434
|
+
RUSH_VARIANT = "RUSH_VARIANT",
|
|
435
|
+
/**
|
|
436
|
+
* Specifies the maximum number of concurrent processes to launch during a build.
|
|
437
|
+
* For more information, see the command-line help for the `--parallelism` parameter for "rush build".
|
|
438
|
+
*/
|
|
439
|
+
RUSH_PARALLELISM = "RUSH_PARALLELISM",
|
|
440
|
+
/**
|
|
441
|
+
* If this variable is set to "1", Rush will create symlinks with absolute paths instead
|
|
442
|
+
* of relative paths. This can be necessary when a repository is moved during a build or
|
|
443
|
+
* if parts of a repository are moved into a sandbox.
|
|
444
|
+
*/
|
|
445
|
+
RUSH_ABSOLUTE_SYMLINKS = "RUSH_ABSOLUTE_SYMLINKS",
|
|
446
|
+
/**
|
|
447
|
+
* When using PNPM as the package manager, this variable can be used to configure the path that
|
|
448
|
+
* PNPM will use as the store directory.
|
|
449
|
+
*
|
|
450
|
+
* If a relative path is used, then the store path will be resolved relative to the process's
|
|
451
|
+
* current working directory. An absolute path is recommended.
|
|
452
|
+
*/
|
|
453
|
+
RUSH_PNPM_STORE_PATH = "RUSH_PNPM_STORE_PATH",
|
|
454
|
+
/**
|
|
455
|
+
* This environment variable can be used to specify the `--target-folder` parameter
|
|
456
|
+
* for the "rush deploy" command.
|
|
457
|
+
*/
|
|
458
|
+
RUSH_DEPLOY_TARGET_FOLDER = "RUSH_DEPLOY_TARGET_FOLDER",
|
|
459
|
+
/**
|
|
460
|
+
* Overrides the location of the `~/.rush` global folder where Rush stores temporary files.
|
|
461
|
+
*
|
|
462
|
+
* @remarks
|
|
463
|
+
*
|
|
464
|
+
* Most of the temporary files created by Rush are stored separately for each monorepo working folder,
|
|
465
|
+
* to avoid issues of concurrency and compatibility between tool versions. However, a small set
|
|
466
|
+
* of files (e.g. installations of the `@microsoft/rush-lib` engine and the package manager) are stored
|
|
467
|
+
* in a global folder to speed up installations. The default location is `~/.rush` on POSIX-like
|
|
468
|
+
* operating systems or `C:\Users\YourName` on Windows.
|
|
469
|
+
*
|
|
470
|
+
* Use `RUSH_GLOBAL_FOLDER` to specify a different folder path. This is useful for example if a Windows
|
|
471
|
+
* group policy forbids executing scripts installed in a user's home directory.
|
|
472
|
+
*
|
|
473
|
+
* POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc.
|
|
474
|
+
*/
|
|
475
|
+
RUSH_GLOBAL_FOLDER = "RUSH_GLOBAL_FOLDER",
|
|
476
|
+
/**
|
|
477
|
+
* Provides a credential for a remote build cache, if configured. Setting this environment variable
|
|
478
|
+
* overrides whatever credential has been saved in the local cloud cache credentials using
|
|
479
|
+
* `rush update-cloud-credentials`.
|
|
480
|
+
*
|
|
481
|
+
* @remarks
|
|
482
|
+
* This credential overrides any cached credentials.
|
|
483
|
+
*
|
|
484
|
+
* If Azure Blob Storage is used to store cache entries, this must be a SAS token serialized as query
|
|
485
|
+
* parameters.
|
|
486
|
+
*
|
|
487
|
+
* For information on SAS tokens, see here: https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview
|
|
488
|
+
*/
|
|
489
|
+
RUSH_BUILD_CACHE_CREDENTIAL = "RUSH_BUILD_CACHE_CREDENTIAL",
|
|
490
|
+
/**
|
|
491
|
+
* Setting this environment variable overrides the value of `buildCacheEnabled` in the `build-cache.json`
|
|
492
|
+
* configuration file. Specify `1` to enable the build cache or `0` to disable it.
|
|
493
|
+
*
|
|
494
|
+
* If set to `0`, this is equivalent to passing the `--disable-build-cache` flag.
|
|
495
|
+
*/
|
|
496
|
+
RUSH_BUILD_CACHE_ENABLED = "RUSH_BUILD_CACHE_ENABLED",
|
|
497
|
+
/**
|
|
498
|
+
* Setting this environment variable overrides the value of `isCacheWriteAllowed` in the `build-cache.json`
|
|
499
|
+
* configuration file. Specify `1` to allow cache write and `0` to disable it.
|
|
500
|
+
*/
|
|
501
|
+
RUSH_BUILD_CACHE_WRITE_ALLOWED = "RUSH_BUILD_CACHE_WRITE_ALLOWED",
|
|
502
|
+
/**
|
|
503
|
+
* Allows the git binary path to be explicitly specified.
|
|
504
|
+
*/
|
|
505
|
+
RUSH_GIT_BINARY_PATH = "RUSH_GIT_BINARY_PATH",
|
|
506
|
+
/**
|
|
507
|
+
* Allows the tar binary path to be explicitly specified.
|
|
508
|
+
*/
|
|
509
|
+
RUSH_TAR_BINARY_PATH = "RUSH_TAR_BINARY_PATH",
|
|
510
|
+
/**
|
|
511
|
+
* When Rush executes shell scripts, it sometimes changes the working directory to be a project folder or
|
|
512
|
+
* the repository root folder. The original working directory (where the Rush command was invoked) is assigned
|
|
513
|
+
* to the the child process's `RUSH_INVOKED_FOLDER` environment variable, in case it is needed by the script.
|
|
514
|
+
*
|
|
515
|
+
* @remarks
|
|
516
|
+
* The `RUSH_INVOKED_FOLDER` variable is the same idea as the `INIT_CWD` variable that package managers
|
|
517
|
+
* assign when they execute lifecycle scripts.
|
|
518
|
+
*/
|
|
519
|
+
RUSH_INVOKED_FOLDER = "RUSH_INVOKED_FOLDER"
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Events happen during Rush runs.
|
|
524
|
+
* @beta
|
|
525
|
+
*/
|
|
526
|
+
export declare enum Event {
|
|
527
|
+
/**
|
|
528
|
+
* Pre Rush install event
|
|
529
|
+
*/
|
|
530
|
+
preRushInstall = 1,
|
|
531
|
+
/**
|
|
532
|
+
* Post Rush install event
|
|
533
|
+
*/
|
|
534
|
+
postRushInstall = 2,
|
|
535
|
+
/**
|
|
536
|
+
* Pre Rush build event
|
|
537
|
+
*/
|
|
538
|
+
preRushBuild = 3,
|
|
539
|
+
/**
|
|
540
|
+
* Post Rush build event
|
|
541
|
+
*/
|
|
542
|
+
postRushBuild = 4
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* This class represents Rush event hooks configured for this repo.
|
|
547
|
+
* Hooks are customized script actions that Rush executes when specific events occur.
|
|
548
|
+
* The actions are expressed as a command-line that is executed using the operating system shell.
|
|
549
|
+
* @beta
|
|
550
|
+
*/
|
|
551
|
+
export declare class EventHooks {
|
|
552
|
+
private _hooks;
|
|
553
|
+
/**
|
|
554
|
+
* @internal
|
|
555
|
+
*/
|
|
556
|
+
constructor(eventHooksJson: IEventHooksJson);
|
|
557
|
+
/**
|
|
558
|
+
* Return all the scripts associated with the specified event.
|
|
559
|
+
* @param event - Rush event
|
|
560
|
+
*/
|
|
561
|
+
get(event: Event): string[];
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Use this class to load the "common/config/rush/experiments.json" config file.
|
|
566
|
+
* This file allows repo maintainers to enable and disable experimental Rush features.
|
|
567
|
+
* @public
|
|
568
|
+
*/
|
|
569
|
+
export declare class ExperimentsConfiguration {
|
|
570
|
+
private static _jsonSchema;
|
|
571
|
+
private _experimentConfiguration;
|
|
572
|
+
private _jsonFileName;
|
|
573
|
+
/**
|
|
574
|
+
* @internal
|
|
575
|
+
*/
|
|
576
|
+
constructor(jsonFileName: string);
|
|
577
|
+
/**
|
|
578
|
+
* Get the experiments configuration.
|
|
579
|
+
* @beta
|
|
580
|
+
*/
|
|
581
|
+
get configuration(): Readonly<IExperimentsJson>;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Part of IRushConfigurationJson.
|
|
586
|
+
*/
|
|
587
|
+
declare interface IApprovedPackagesPolicyJson {
|
|
588
|
+
reviewCategories?: string[];
|
|
589
|
+
ignoredNpmScopes?: string[];
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Describes the file structure for the "common/config/rush/build-cache.json" config file.
|
|
594
|
+
*/
|
|
595
|
+
declare interface IBaseBuildCacheJson {
|
|
596
|
+
buildCacheEnabled: boolean;
|
|
597
|
+
cacheProvider: string;
|
|
598
|
+
cacheEntryNamePattern?: string;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* @beta
|
|
603
|
+
*/
|
|
604
|
+
declare type IBuildCacheJson = ICloudBuildCacheJson | ILocalBuildCacheJson;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* @beta
|
|
608
|
+
*/
|
|
609
|
+
declare interface ICloudBuildCacheJson extends IBaseBuildCacheJson {
|
|
610
|
+
readonly cacheProvider: string;
|
|
611
|
+
[otherConfigKey: string]: JsonObject;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* @beta
|
|
616
|
+
*/
|
|
617
|
+
export declare interface ICloudBuildCacheProvider {
|
|
618
|
+
readonly isCacheWriteAllowed: boolean;
|
|
619
|
+
tryGetCacheEntryBufferByIdAsync(terminal: ITerminal, cacheId: string): Promise<Buffer | undefined>;
|
|
620
|
+
trySetCacheEntryBufferAsync(terminal: ITerminal, cacheId: string, entryBuffer: Buffer): Promise<boolean>;
|
|
621
|
+
updateCachedCredentialAsync(terminal: ITerminal, credential: string): Promise<void>;
|
|
622
|
+
updateCachedCredentialInteractiveAsync(terminal: ITerminal): Promise<void>;
|
|
623
|
+
deleteCachedCredentialsAsync(terminal: ITerminal): Promise<void>;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* A collection of environment variables
|
|
628
|
+
* @public
|
|
629
|
+
*/
|
|
630
|
+
export declare interface IConfigurationEnvironment {
|
|
631
|
+
/**
|
|
632
|
+
* Environment variables
|
|
633
|
+
*/
|
|
634
|
+
[environmentVariableName: string]: IConfigurationEnvironmentVariable;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Represents the value of an environment variable, and if the value should be overridden if the variable is set
|
|
639
|
+
* in the parent environment.
|
|
640
|
+
* @public
|
|
641
|
+
*/
|
|
642
|
+
export declare interface IConfigurationEnvironmentVariable {
|
|
643
|
+
/**
|
|
644
|
+
* Value of the environment variable
|
|
645
|
+
*/
|
|
646
|
+
value: string;
|
|
647
|
+
/**
|
|
648
|
+
* Set to true to override the environment variable even if it is set in the parent environment.
|
|
649
|
+
* The default value is false.
|
|
650
|
+
*/
|
|
651
|
+
override?: boolean;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* @beta
|
|
656
|
+
*/
|
|
657
|
+
export declare interface ICredentialCacheEntry {
|
|
658
|
+
expires?: Date;
|
|
659
|
+
credential: string;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* @beta
|
|
664
|
+
*/
|
|
665
|
+
export declare interface ICredentialCacheOptions {
|
|
666
|
+
supportEditing: boolean;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
declare interface IEnvironment {
|
|
670
|
+
[environmentVariableName: string]: string | undefined;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* @beta
|
|
675
|
+
*/
|
|
676
|
+
export declare interface IEnvironmentConfigurationInitializeOptions {
|
|
677
|
+
doNotNormalizePaths?: boolean;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Part of IRushConfigurationJson.
|
|
682
|
+
* @beta
|
|
683
|
+
*/
|
|
684
|
+
declare interface IEventHooksJson {
|
|
685
|
+
/**
|
|
686
|
+
* The list of scripts to run after every Rush build command finishes
|
|
687
|
+
*/
|
|
688
|
+
postRushBuild?: string[];
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* This interface represents the raw experiments.json file which allows repo
|
|
693
|
+
* maintainers to enable and disable experimental Rush features.
|
|
694
|
+
* @beta
|
|
695
|
+
*/
|
|
696
|
+
export declare interface IExperimentsJson {
|
|
697
|
+
/**
|
|
698
|
+
* By default, 'rush install' passes --no-prefer-frozen-lockfile to 'pnpm install'.
|
|
699
|
+
* Set this option to true to pass '--frozen-lockfile' instead.
|
|
700
|
+
*/
|
|
701
|
+
usePnpmFrozenLockfileForRushInstall?: boolean;
|
|
702
|
+
/**
|
|
703
|
+
* By default, 'rush update' passes --no-prefer-frozen-lockfile to 'pnpm install'.
|
|
704
|
+
* Set this option to true to pass '--prefer-frozen-lockfile' instead.
|
|
705
|
+
*/
|
|
706
|
+
usePnpmPreferFrozenLockfileForRushUpdate?: boolean;
|
|
707
|
+
/**
|
|
708
|
+
* If using the 'preventManualShrinkwrapChanges' option, restricts the hash to only include the layout of external dependencies.
|
|
709
|
+
* Used to allow links between workspace projects or the addition/removal of references to existing dependency versions to not
|
|
710
|
+
* cause hash changes.
|
|
711
|
+
*/
|
|
712
|
+
omitImportersFromPreventManualShrinkwrapChanges?: boolean;
|
|
713
|
+
/**
|
|
714
|
+
* If true, the chmod field in temporary project tar headers will not be normalized.
|
|
715
|
+
* This normalization can help ensure consistent tarball integrity across platforms.
|
|
716
|
+
*/
|
|
717
|
+
noChmodFieldInTarHeaderNormalization?: boolean;
|
|
718
|
+
/**
|
|
719
|
+
* If true, build caching will respect the allowWarningsInSuccessfulBuild flag and cache builds with warnings.
|
|
720
|
+
* This will not replay warnings from the cached build.
|
|
721
|
+
*/
|
|
722
|
+
buildCacheWithAllowWarningsInSuccessfulBuild?: boolean;
|
|
723
|
+
/**
|
|
724
|
+
* If true, the multi-phase commands feature is enabled. To use this feature, create a "phased" command
|
|
725
|
+
* in common/config/rush/command-line.json.
|
|
726
|
+
*
|
|
727
|
+
* THIS FEATURE IS NOT READY FOR USAGE YET. SEE GITHUB #2300 FOR STATUS.
|
|
728
|
+
*/
|
|
729
|
+
_multiPhaseCommands?: boolean;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* @beta
|
|
734
|
+
*/
|
|
735
|
+
export declare interface IGetChangedProjectsOptions {
|
|
736
|
+
targetBranchName: string;
|
|
737
|
+
terminal: ITerminal;
|
|
738
|
+
shouldFetch?: boolean;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
declare interface IIndividualVersionJson extends IVersionPolicyJson {
|
|
742
|
+
lockedMajor?: number;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Options to pass to the rush "launch" functions.
|
|
747
|
+
*
|
|
748
|
+
* @public
|
|
749
|
+
*/
|
|
750
|
+
export declare interface ILaunchOptions {
|
|
751
|
+
/**
|
|
752
|
+
* True if the tool was invoked from within a project with a rush.json file, otherwise false. We
|
|
753
|
+
* consider a project without a rush.json to be "unmanaged" and we'll print that to the command line when
|
|
754
|
+
* the tool is executed. This is mainly used for debugging purposes.
|
|
755
|
+
*/
|
|
756
|
+
isManaged: boolean;
|
|
757
|
+
/**
|
|
758
|
+
* If true, the wrapper process already printed a warning that the version of Node.js hasn't been tested
|
|
759
|
+
* with this version of Rush, so we shouldn't print a similar error.
|
|
760
|
+
*/
|
|
761
|
+
alreadyReportedNodeTooNewError?: boolean;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* @public
|
|
766
|
+
*/
|
|
767
|
+
declare interface ILocalBuildCacheJson extends IBaseBuildCacheJson {
|
|
768
|
+
readonly cacheProvider: 'local-only';
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
declare interface ILockStepVersionJson extends IVersionPolicyJson {
|
|
772
|
+
version: string;
|
|
773
|
+
nextBump: string;
|
|
774
|
+
mainProject?: string;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* @beta
|
|
779
|
+
*/
|
|
780
|
+
export declare interface ILogger {
|
|
781
|
+
readonly terminal: Terminal;
|
|
782
|
+
/**
|
|
783
|
+
* Call this function to emit an error to the Rush runtime.
|
|
784
|
+
*/
|
|
785
|
+
emitError(error: Error): void;
|
|
786
|
+
/**
|
|
787
|
+
* Call this function to emit a warning to the Rush runtime.
|
|
788
|
+
*/
|
|
789
|
+
emitWarning(warning: Error): void;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* This policy indicates all related projects get version bump driven by their own changes.
|
|
794
|
+
* @public
|
|
795
|
+
*/
|
|
796
|
+
export declare class IndividualVersionPolicy extends VersionPolicy {
|
|
797
|
+
private _lockedMajor;
|
|
798
|
+
/**
|
|
799
|
+
* @internal
|
|
800
|
+
*/
|
|
801
|
+
constructor(versionPolicyJson: IIndividualVersionJson);
|
|
802
|
+
/**
|
|
803
|
+
* The major version that has been locked
|
|
804
|
+
*/
|
|
805
|
+
get lockedMajor(): number | undefined;
|
|
806
|
+
/**
|
|
807
|
+
* Serialized json for this policy
|
|
808
|
+
*
|
|
809
|
+
* @internal
|
|
810
|
+
*/
|
|
811
|
+
get _json(): IIndividualVersionJson;
|
|
812
|
+
/**
|
|
813
|
+
* Returns an updated package json that satisfies the version policy.
|
|
814
|
+
*
|
|
815
|
+
* @param project - input package json
|
|
816
|
+
* @param force - force update even when the project version is higher than the policy version.
|
|
817
|
+
*/
|
|
818
|
+
ensure(project: IPackageJson, force?: boolean): IPackageJson | undefined;
|
|
819
|
+
/**
|
|
820
|
+
* Bumps version.
|
|
821
|
+
* Individual version policy lets change files drive version bump. This method currently does not do anything.
|
|
822
|
+
*
|
|
823
|
+
* @param bumpType - bump type
|
|
824
|
+
* @param identifier - prerelease id
|
|
825
|
+
*/
|
|
826
|
+
bump(bumpType?: BumpType, identifier?: string): void;
|
|
827
|
+
/**
|
|
828
|
+
* Validates the specified version and throws if the version does not satisfy the policy.
|
|
829
|
+
*
|
|
830
|
+
* @param versionString - version string
|
|
831
|
+
* @param packageName - package name
|
|
832
|
+
*/
|
|
833
|
+
validate(versionString: string, packageName: string): void;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* Part of IRushConfigurationJson.
|
|
838
|
+
* @internal
|
|
839
|
+
*/
|
|
840
|
+
export declare interface _INpmOptionsJson extends IPackageManagerOptionsJsonBase {
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Options for the package manager.
|
|
845
|
+
* @public
|
|
846
|
+
*/
|
|
847
|
+
export declare interface IPackageManagerOptionsJsonBase {
|
|
848
|
+
/**
|
|
849
|
+
* Environment variables for the package manager
|
|
850
|
+
*/
|
|
851
|
+
environmentVariables?: IConfigurationEnvironment;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Part of IRushConfigurationJson.
|
|
856
|
+
* @internal
|
|
857
|
+
*/
|
|
858
|
+
export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBase {
|
|
859
|
+
/**
|
|
860
|
+
* The store resolution method for PNPM to use
|
|
861
|
+
*/
|
|
862
|
+
pnpmStore?: PnpmStoreOptions;
|
|
863
|
+
/**
|
|
864
|
+
* Should PNPM fail if peer dependencies aren't installed?
|
|
865
|
+
*/
|
|
866
|
+
strictPeerDependencies?: boolean;
|
|
867
|
+
/**
|
|
868
|
+
* {@inheritDoc PnpmOptionsConfiguration.preventManualShrinkwrapChanges}
|
|
869
|
+
*/
|
|
870
|
+
preventManualShrinkwrapChanges?: boolean;
|
|
871
|
+
/**
|
|
872
|
+
* {@inheritDoc PnpmOptionsConfiguration.useWorkspaces}
|
|
873
|
+
*/
|
|
874
|
+
useWorkspaces?: boolean;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* This represents the JSON data structure for the "rush.json" configuration file.
|
|
879
|
+
* See rush.schema.json for documentation.
|
|
880
|
+
*/
|
|
881
|
+
declare interface IRushConfigurationJson {
|
|
882
|
+
$schema: string;
|
|
883
|
+
npmVersion?: string;
|
|
884
|
+
pnpmVersion?: string;
|
|
885
|
+
yarnVersion?: string;
|
|
886
|
+
rushVersion: string;
|
|
887
|
+
repository?: IRushRepositoryJson;
|
|
888
|
+
nodeSupportedVersionRange?: string;
|
|
889
|
+
suppressNodeLtsWarning?: boolean;
|
|
890
|
+
projectFolderMinDepth?: number;
|
|
891
|
+
projectFolderMaxDepth?: number;
|
|
892
|
+
allowMostlyStandardPackageNames?: boolean;
|
|
893
|
+
approvedPackagesPolicy?: IApprovedPackagesPolicyJson;
|
|
894
|
+
gitPolicy?: IRushGitPolicyJson;
|
|
895
|
+
telemetryEnabled?: boolean;
|
|
896
|
+
projects: IRushConfigurationProjectJson[];
|
|
897
|
+
eventHooks?: IEventHooksJson;
|
|
898
|
+
hotfixChangeEnabled?: boolean;
|
|
899
|
+
npmOptions?: _INpmOptionsJson;
|
|
900
|
+
pnpmOptions?: _IPnpmOptionsJson;
|
|
901
|
+
yarnOptions?: _IYarnOptionsJson;
|
|
902
|
+
ensureConsistentVersions?: boolean;
|
|
903
|
+
variants?: IRushVariantOptionsJson[];
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* This represents the JSON data object for a project entry in the rush.json configuration file.
|
|
908
|
+
*/
|
|
909
|
+
declare interface IRushConfigurationProjectJson {
|
|
910
|
+
packageName: string;
|
|
911
|
+
projectFolder: string;
|
|
912
|
+
reviewCategory?: string;
|
|
913
|
+
cyclicDependencyProjects: string[];
|
|
914
|
+
versionPolicyName?: string;
|
|
915
|
+
shouldPublish?: boolean;
|
|
916
|
+
skipRushCheck?: boolean;
|
|
917
|
+
publishFolder?: string;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Part of IRushConfigurationJson.
|
|
922
|
+
*/
|
|
923
|
+
declare interface IRushGitPolicyJson {
|
|
924
|
+
allowedEmailRegExps?: string[];
|
|
925
|
+
sampleEmail?: string;
|
|
926
|
+
versionBumpCommitMessage?: string;
|
|
927
|
+
changeLogUpdateCommitMessage?: string;
|
|
928
|
+
tagSeparator?: string;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* @beta
|
|
933
|
+
*/
|
|
934
|
+
export declare interface IRushPlugin {
|
|
935
|
+
apply(rushSession: RushSession, rushConfiguration: RushConfiguration): void;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
declare interface IRushPluginConfiguration extends IRushPluginConfigurationBase {
|
|
939
|
+
autoinstallerName: string;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
declare interface IRushPluginConfigurationBase {
|
|
943
|
+
packageName: string;
|
|
944
|
+
pluginName: string;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
declare interface IRushPluginsConfigurationJson {
|
|
948
|
+
plugins: IRushPluginConfiguration[];
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Part of IRushConfigurationJson.
|
|
953
|
+
*/
|
|
954
|
+
declare interface IRushRepositoryJson {
|
|
955
|
+
/**
|
|
956
|
+
* The remote url of the repository. This helps "rush change" find the right remote to compare against.
|
|
957
|
+
*/
|
|
958
|
+
url?: string;
|
|
959
|
+
/**
|
|
960
|
+
* The default branch name. This tells "rush change" which remote branch to compare against.
|
|
961
|
+
*/
|
|
962
|
+
defaultBranch?: string;
|
|
963
|
+
/**
|
|
964
|
+
* The default remote. This tells "rush change" which remote to compare against if the remote URL is not set
|
|
965
|
+
* or if a remote matching the provided remote URL is not found.
|
|
966
|
+
*/
|
|
967
|
+
defaultRemote?: string;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* @beta
|
|
972
|
+
*/
|
|
973
|
+
export declare interface IRushSessionOptions {
|
|
974
|
+
terminalProvider: ITerminalProvider;
|
|
975
|
+
getIsDebugMode: () => boolean;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* Options defining an allowed variant as part of IRushConfigurationJson.
|
|
980
|
+
*/
|
|
981
|
+
declare interface IRushVariantOptionsJson {
|
|
982
|
+
variantName: string;
|
|
983
|
+
description: string;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Options for `RushConfiguration.tryFindRushJsonLocation`.
|
|
988
|
+
* @public
|
|
989
|
+
*/
|
|
990
|
+
export declare interface ITryFindRushJsonLocationOptions {
|
|
991
|
+
/**
|
|
992
|
+
* Whether to show verbose console messages. Defaults to false.
|
|
993
|
+
*/
|
|
994
|
+
showVerbose?: boolean;
|
|
995
|
+
/**
|
|
996
|
+
* The folder path where the search will start. Defaults tot he current working directory.
|
|
997
|
+
*/
|
|
998
|
+
startingFolder?: string;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
declare interface IVersionPolicyDependencyJson {
|
|
1002
|
+
versionFormatForPublish?: VersionFormatForPublish;
|
|
1003
|
+
versionFormatForCommit?: VersionFormatForCommit;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
declare interface IVersionPolicyJson {
|
|
1007
|
+
policyName: string;
|
|
1008
|
+
definitionName: string;
|
|
1009
|
+
dependencies?: IVersionPolicyDependencyJson;
|
|
1010
|
+
exemptFromRushChange?: boolean;
|
|
1011
|
+
includeEmailInChangeFile?: boolean;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* Part of IRushConfigurationJson.
|
|
1016
|
+
* @internal
|
|
1017
|
+
*/
|
|
1018
|
+
export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBase {
|
|
1019
|
+
/**
|
|
1020
|
+
* If true, then Rush will add the "--ignore-engines" option when invoking Yarn.
|
|
1021
|
+
* This allows "rush install" to succeed if there are dependencies with engines defined in
|
|
1022
|
+
* package.json which do not match the current environment.
|
|
1023
|
+
*
|
|
1024
|
+
* The default value is false.
|
|
1025
|
+
*/
|
|
1026
|
+
ignoreEngines?: boolean;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* A helper class for managing last-install flags, which are persistent and
|
|
1031
|
+
* indicate that something installed in the folder was successfully completed.
|
|
1032
|
+
* It also compares state, so that if something like the Node.js version has changed,
|
|
1033
|
+
* it can invalidate the last install.
|
|
1034
|
+
* @internal
|
|
1035
|
+
*/
|
|
1036
|
+
export declare class _LastInstallFlag {
|
|
1037
|
+
private _path;
|
|
1038
|
+
private _state;
|
|
1039
|
+
/**
|
|
1040
|
+
* Creates a new LastInstall flag
|
|
1041
|
+
* @param folderPath - the folder that this flag is managing
|
|
1042
|
+
* @param state - optional, the state that should be managed or compared
|
|
1043
|
+
*/
|
|
1044
|
+
constructor(folderPath: string, state?: JsonObject);
|
|
1045
|
+
/**
|
|
1046
|
+
* Returns true if the file exists and the contents match the current state.
|
|
1047
|
+
*/
|
|
1048
|
+
isValid(): boolean;
|
|
1049
|
+
/**
|
|
1050
|
+
* Same as isValid(), but with an additional check: If the current state is not equal to the previous
|
|
1051
|
+
* state, and an the current state causes an error, then throw an exception with a friendly message.
|
|
1052
|
+
*
|
|
1053
|
+
* @internal
|
|
1054
|
+
*/
|
|
1055
|
+
checkValidAndReportStoreIssues(): boolean;
|
|
1056
|
+
private _isValid;
|
|
1057
|
+
/**
|
|
1058
|
+
* Writes the flag file to disk with the current state
|
|
1059
|
+
*/
|
|
1060
|
+
create(): void;
|
|
1061
|
+
/**
|
|
1062
|
+
* Removes the flag file
|
|
1063
|
+
*/
|
|
1064
|
+
clear(): void;
|
|
1065
|
+
/**
|
|
1066
|
+
* Returns the full path to the flag file
|
|
1067
|
+
*/
|
|
1068
|
+
get path(): string;
|
|
1069
|
+
/**
|
|
1070
|
+
* Returns the name of the flag file
|
|
1071
|
+
*/
|
|
1072
|
+
protected get flagName(): string;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
/**
|
|
1076
|
+
* This policy indicates all related projects should use the same version.
|
|
1077
|
+
* @public
|
|
1078
|
+
*/
|
|
1079
|
+
export declare class LockStepVersionPolicy extends VersionPolicy {
|
|
1080
|
+
private _version;
|
|
1081
|
+
private _nextBump;
|
|
1082
|
+
private _mainProject;
|
|
1083
|
+
/**
|
|
1084
|
+
* @internal
|
|
1085
|
+
*/
|
|
1086
|
+
constructor(versionPolicyJson: ILockStepVersionJson);
|
|
1087
|
+
/**
|
|
1088
|
+
* The value of the lockstep version
|
|
1089
|
+
*/
|
|
1090
|
+
get version(): string;
|
|
1091
|
+
/**
|
|
1092
|
+
* The type of bump for next bump.
|
|
1093
|
+
*/
|
|
1094
|
+
get nextBump(): BumpType;
|
|
1095
|
+
/**
|
|
1096
|
+
* The main project for the version policy.
|
|
1097
|
+
*
|
|
1098
|
+
* If the value is provided, change logs will only be generated in that project.
|
|
1099
|
+
* If the value is not provided, change logs will be hosted in each project associated with the policy.
|
|
1100
|
+
*/
|
|
1101
|
+
get mainProject(): string | undefined;
|
|
1102
|
+
/**
|
|
1103
|
+
* Serialized json for this policy
|
|
1104
|
+
*
|
|
1105
|
+
* @internal
|
|
1106
|
+
*/
|
|
1107
|
+
get _json(): ILockStepVersionJson;
|
|
1108
|
+
/**
|
|
1109
|
+
* Returns an updated package json that satisfies the version policy.
|
|
1110
|
+
*
|
|
1111
|
+
* @param project - input package json
|
|
1112
|
+
* @param force - force update even when the project version is higher than the policy version.
|
|
1113
|
+
*/
|
|
1114
|
+
ensure(project: IPackageJson, force?: boolean): IPackageJson | undefined;
|
|
1115
|
+
/**
|
|
1116
|
+
* Bumps the version of the lockstep policy
|
|
1117
|
+
*
|
|
1118
|
+
* @param bumpType - Overwrite bump type in version-policy.json with the provided value.
|
|
1119
|
+
* @param identifier - Prerelease identifier if bump type is prerelease.
|
|
1120
|
+
*/
|
|
1121
|
+
bump(bumpType?: BumpType, identifier?: string): void;
|
|
1122
|
+
/**
|
|
1123
|
+
* Updates the version of the policy directly with a new value
|
|
1124
|
+
* @param newVersionString - New version
|
|
1125
|
+
*/
|
|
1126
|
+
update(newVersionString: string): boolean;
|
|
1127
|
+
/**
|
|
1128
|
+
* Validates the specified version and throws if the version does not satisfy lockstep version.
|
|
1129
|
+
*
|
|
1130
|
+
* @param versionString - version string
|
|
1131
|
+
* @param packageName - package name
|
|
1132
|
+
*/
|
|
1133
|
+
validate(versionString: string, packageName: string): void;
|
|
1134
|
+
private _updatePackageVersion;
|
|
1135
|
+
private _getReleaseType;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
/**
|
|
1139
|
+
* This class is used to associate POSIX relative paths, such as those returned by `git` commands,
|
|
1140
|
+
* with entities that correspond with ancestor folders, such as Rush Projects.
|
|
1141
|
+
*
|
|
1142
|
+
* It is optimized for efficiently locating the nearest ancestor path with an associated value.
|
|
1143
|
+
*
|
|
1144
|
+
* @example
|
|
1145
|
+
* ```ts
|
|
1146
|
+
* const tree = new LookupByPath([['foo', 1], ['bar', 2], ['foo/bar', 3]]);
|
|
1147
|
+
* tree.getNearestAncestor('foo'); // returns 1
|
|
1148
|
+
* tree.getNearestAncestor('foo/baz'); // returns 1
|
|
1149
|
+
* tree.getNearestAncestor('baz'); // returns undefined
|
|
1150
|
+
* tree.getNearestAncestor('foo/bar/baz'); returns 3
|
|
1151
|
+
* tree.getNearestAncestor('bar/foo/bar'); returns 2
|
|
1152
|
+
* ```
|
|
1153
|
+
* @beta
|
|
1154
|
+
*/
|
|
1155
|
+
export declare class LookupByPath<TItem> {
|
|
1156
|
+
/**
|
|
1157
|
+
* The delimiter used to split paths
|
|
1158
|
+
*/
|
|
1159
|
+
readonly delimiter: string;
|
|
1160
|
+
/**
|
|
1161
|
+
* The root node of the tree, corresponding to the path ''
|
|
1162
|
+
*/
|
|
1163
|
+
private readonly _root;
|
|
1164
|
+
/**
|
|
1165
|
+
* Constructs a new `LookupByPath`
|
|
1166
|
+
*
|
|
1167
|
+
* @param entries - Initial path-value pairs to populate the tree.
|
|
1168
|
+
*/
|
|
1169
|
+
constructor(entries?: Iterable<[string, TItem]>, delimiter?: string);
|
|
1170
|
+
/**
|
|
1171
|
+
* Iterates over the segments of a serialized path.
|
|
1172
|
+
*
|
|
1173
|
+
* @example
|
|
1174
|
+
*
|
|
1175
|
+
* `LookupByPath.iteratePathSegments('foo/bar/baz')` yields 'foo', 'bar', 'baz'
|
|
1176
|
+
*
|
|
1177
|
+
* `LookupByPath.iteratePathSegments('foo\\bar\\baz', '\\')` yields 'foo', 'bar', 'baz'
|
|
1178
|
+
*/
|
|
1179
|
+
static iteratePathSegments(serializedPath: string, delimiter?: string): Iterable<string>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Associates the value with the specified serialized path.
|
|
1182
|
+
* If a value is already associated, will overwrite.
|
|
1183
|
+
*
|
|
1184
|
+
* @returns this, for chained calls
|
|
1185
|
+
*/
|
|
1186
|
+
setItem(serializedPath: string, value: TItem): this;
|
|
1187
|
+
/**
|
|
1188
|
+
* Associates the value with the specified path.
|
|
1189
|
+
* If a value is already associated, will overwrite.
|
|
1190
|
+
*
|
|
1191
|
+
* @returns this, for chained calls
|
|
1192
|
+
*/
|
|
1193
|
+
setItemFromSegments(pathSegments: Iterable<string>, value: TItem): this;
|
|
1194
|
+
/**
|
|
1195
|
+
* Searches for the item associated with `childPath`, or the nearest ancestor of that path that
|
|
1196
|
+
* has an associated item.
|
|
1197
|
+
*
|
|
1198
|
+
* @returns the found item, or `undefined` if no item was found
|
|
1199
|
+
*
|
|
1200
|
+
* @example
|
|
1201
|
+
* ```ts
|
|
1202
|
+
* const tree = new LookupByPath([['foo', 1], ['foo/bar', 2]]);
|
|
1203
|
+
* tree.findChildPath('foo/baz'); // returns 1
|
|
1204
|
+
* tree.findChildPath('foo/bar/baz'); // returns 2
|
|
1205
|
+
* ```
|
|
1206
|
+
*/
|
|
1207
|
+
findChildPath(childPath: string): TItem | undefined;
|
|
1208
|
+
/**
|
|
1209
|
+
* Searches for the item associated with `childPathSegments`, or the nearest ancestor of that path that
|
|
1210
|
+
* has an associated item.
|
|
1211
|
+
*
|
|
1212
|
+
* @returns the found item, or `undefined` if no item was found
|
|
1213
|
+
*
|
|
1214
|
+
* @example
|
|
1215
|
+
* ```ts
|
|
1216
|
+
* const tree = new LookupByPath([['foo', 1], ['foo/bar', 2]]);
|
|
1217
|
+
* tree.findChildPathFromSegments(['foo', 'baz']); // returns 1
|
|
1218
|
+
* tree.findChildPathFromSegments(['foo','bar', 'baz']); // returns 2
|
|
1219
|
+
* ```
|
|
1220
|
+
*/
|
|
1221
|
+
findChildPathFromSegments(childPathSegments: Iterable<string>): TItem | undefined;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Options that are only used when the NPM package manager is selected.
|
|
1226
|
+
*
|
|
1227
|
+
* @remarks
|
|
1228
|
+
* It is valid to define these options in rush.json even if the NPM package manager
|
|
1229
|
+
* is not being used.
|
|
1230
|
+
*
|
|
1231
|
+
* @public
|
|
1232
|
+
*/
|
|
1233
|
+
export declare class NpmOptionsConfiguration extends PackageManagerOptionsConfigurationBase {
|
|
1234
|
+
/** @internal */
|
|
1235
|
+
constructor(json: _INpmOptionsJson);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* @public
|
|
1240
|
+
*/
|
|
1241
|
+
export declare class PackageJsonDependency {
|
|
1242
|
+
private _type;
|
|
1243
|
+
private _name;
|
|
1244
|
+
private _version;
|
|
1245
|
+
private _onChange;
|
|
1246
|
+
constructor(name: string, version: string, type: DependencyType, onChange: () => void);
|
|
1247
|
+
get name(): string;
|
|
1248
|
+
get version(): string;
|
|
1249
|
+
setVersion(newVersion: string): void;
|
|
1250
|
+
get dependencyType(): DependencyType;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* @public
|
|
1255
|
+
*/
|
|
1256
|
+
export declare class PackageJsonEditor {
|
|
1257
|
+
private readonly _filePath;
|
|
1258
|
+
private readonly _dependencies;
|
|
1259
|
+
private readonly _devDependencies;
|
|
1260
|
+
private readonly _resolutions;
|
|
1261
|
+
private _modified;
|
|
1262
|
+
private _sourceData;
|
|
1263
|
+
private constructor();
|
|
1264
|
+
static load(filePath: string): PackageJsonEditor;
|
|
1265
|
+
static fromObject(object: IPackageJson, filename: string): PackageJsonEditor;
|
|
1266
|
+
get name(): string;
|
|
1267
|
+
get version(): string;
|
|
1268
|
+
get filePath(): string;
|
|
1269
|
+
/**
|
|
1270
|
+
* The list of dependencies of type DependencyType.Regular, DependencyType.Optional, or DependencyType.Peer.
|
|
1271
|
+
*/
|
|
1272
|
+
get dependencyList(): ReadonlyArray<PackageJsonDependency>;
|
|
1273
|
+
/**
|
|
1274
|
+
* The list of dependencies of type DependencyType.Dev.
|
|
1275
|
+
*/
|
|
1276
|
+
get devDependencyList(): ReadonlyArray<PackageJsonDependency>;
|
|
1277
|
+
/**
|
|
1278
|
+
* This field is a Yarn-specific feature that allows overriding of package resolution.
|
|
1279
|
+
*
|
|
1280
|
+
* @remarks
|
|
1281
|
+
* See the {@link https://github.com/yarnpkg/rfcs/blob/master/implemented/0000-selective-versions-resolutions.md
|
|
1282
|
+
* | 0000-selective-versions-resolutions.md RFC} for details.
|
|
1283
|
+
*/
|
|
1284
|
+
get resolutionsList(): ReadonlyArray<PackageJsonDependency>;
|
|
1285
|
+
tryGetDependency(packageName: string): PackageJsonDependency | undefined;
|
|
1286
|
+
tryGetDevDependency(packageName: string): PackageJsonDependency | undefined;
|
|
1287
|
+
addOrUpdateDependency(packageName: string, newVersion: string, dependencyType: DependencyType): void;
|
|
1288
|
+
saveIfModified(): boolean;
|
|
1289
|
+
/**
|
|
1290
|
+
* Get the normalized package.json that represents the current state of the
|
|
1291
|
+
* PackageJsonEditor. This method does not save any changes that were made to the
|
|
1292
|
+
* package.json, but instead returns the object representation of what would be saved
|
|
1293
|
+
* if saveIfModified() is called.
|
|
1294
|
+
*/
|
|
1295
|
+
saveToObject(): IPackageJson;
|
|
1296
|
+
private _onChange;
|
|
1297
|
+
/**
|
|
1298
|
+
* Create a normalized shallow copy of the provided package.json without modifying the
|
|
1299
|
+
* original. If the result of this method is being returned via a public facing method,
|
|
1300
|
+
* it will still need to be deep-cloned to avoid propogating changes back to the
|
|
1301
|
+
* original dataset.
|
|
1302
|
+
*/
|
|
1303
|
+
private _normalize;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* An abstraction for controlling the supported package managers: PNPM, NPM, and Yarn.
|
|
1308
|
+
* @public
|
|
1309
|
+
*/
|
|
1310
|
+
export declare abstract class PackageManager {
|
|
1311
|
+
/**
|
|
1312
|
+
* The package manager.
|
|
1313
|
+
*/
|
|
1314
|
+
readonly packageManager: PackageManagerName;
|
|
1315
|
+
/**
|
|
1316
|
+
* The SemVer version of the package manager.
|
|
1317
|
+
*/
|
|
1318
|
+
readonly version: string;
|
|
1319
|
+
protected _shrinkwrapFilename: string;
|
|
1320
|
+
/** @internal */
|
|
1321
|
+
protected constructor(version: string, packageManager: PackageManagerName);
|
|
1322
|
+
/**
|
|
1323
|
+
* The filename of the shrinkwrap file that is used by the package manager.
|
|
1324
|
+
*
|
|
1325
|
+
* @remarks
|
|
1326
|
+
* Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
|
|
1327
|
+
*/
|
|
1328
|
+
get shrinkwrapFilename(): string;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* This represents the available Package Manager tools as a string
|
|
1333
|
+
* @public
|
|
1334
|
+
*/
|
|
1335
|
+
export declare type PackageManagerName = 'pnpm' | 'npm' | 'yarn';
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* Options that all package managers share.
|
|
1339
|
+
*
|
|
1340
|
+
* @public
|
|
1341
|
+
*/
|
|
1342
|
+
export declare abstract class PackageManagerOptionsConfigurationBase implements IPackageManagerOptionsJsonBase {
|
|
1343
|
+
/**
|
|
1344
|
+
* Environment variables for the package manager
|
|
1345
|
+
*/
|
|
1346
|
+
readonly environmentVariables?: IConfigurationEnvironment;
|
|
1347
|
+
/** @internal */
|
|
1348
|
+
protected constructor(json: IPackageManagerOptionsJsonBase);
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* Options that are only used when the PNPM package manager is selected.
|
|
1353
|
+
*
|
|
1354
|
+
* @remarks
|
|
1355
|
+
* It is valid to define these options in rush.json even if the PNPM package manager
|
|
1356
|
+
* is not being used.
|
|
1357
|
+
*
|
|
1358
|
+
* @public
|
|
1359
|
+
*/
|
|
1360
|
+
export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfigurationBase {
|
|
1361
|
+
/**
|
|
1362
|
+
* The method used to resolve the store used by PNPM.
|
|
1363
|
+
*
|
|
1364
|
+
* @remarks
|
|
1365
|
+
* Available options:
|
|
1366
|
+
* - local: Use the standard Rush store path: common/temp/pnpm-store
|
|
1367
|
+
* - global: Use PNPM's global store path
|
|
1368
|
+
*/
|
|
1369
|
+
readonly pnpmStore: PnpmStoreOptions;
|
|
1370
|
+
/**
|
|
1371
|
+
* The path for PNPM to use as the store directory.
|
|
1372
|
+
*
|
|
1373
|
+
* Will be overridden by environment variable RUSH_PNPM_STORE_PATH
|
|
1374
|
+
*/
|
|
1375
|
+
readonly pnpmStorePath: string;
|
|
1376
|
+
/**
|
|
1377
|
+
* If true, then Rush will add the "--strict-peer-dependencies" option when invoking PNPM.
|
|
1378
|
+
*
|
|
1379
|
+
* @remarks
|
|
1380
|
+
* This causes "rush install" to fail if there are unsatisfied peer dependencies, which is
|
|
1381
|
+
* an invalid state that can cause build failures or incompatible dependency versions.
|
|
1382
|
+
* (For historical reasons, JavaScript package managers generally do not treat this invalid state
|
|
1383
|
+
* as an error.)
|
|
1384
|
+
*
|
|
1385
|
+
* The default value is false. (For now.)
|
|
1386
|
+
*/
|
|
1387
|
+
readonly strictPeerDependencies: boolean;
|
|
1388
|
+
/**
|
|
1389
|
+
* If true, then `rush install` will report an error if manual modifications
|
|
1390
|
+
* were made to the PNPM shrinkwrap file without running `rush update` afterwards.
|
|
1391
|
+
*
|
|
1392
|
+
* @remarks
|
|
1393
|
+
* This feature protects against accidental inconsistencies that may be introduced
|
|
1394
|
+
* if the PNPM shrinkwrap file (`pnpm-lock.yaml`) is manually edited. When this
|
|
1395
|
+
* feature is enabled, `rush update` will write a hash of the shrinkwrap contents to repo-state.json,
|
|
1396
|
+
* and then `rush update` and `rush install` will validate the hash. Note that this does not prohibit
|
|
1397
|
+
* manual modifications, but merely requires `rush update` be run
|
|
1398
|
+
* afterwards, ensuring that PNPM can report or repair any potential inconsistencies.
|
|
1399
|
+
*
|
|
1400
|
+
* To temporarily disable this validation when invoking `rush install`, use the
|
|
1401
|
+
* `--bypass-policy` command-line parameter.
|
|
1402
|
+
*
|
|
1403
|
+
* The default value is false.
|
|
1404
|
+
*/
|
|
1405
|
+
readonly preventManualShrinkwrapChanges: boolean;
|
|
1406
|
+
/**
|
|
1407
|
+
* If true, then Rush will use the workspaces feature to install and link packages when invoking PNPM.
|
|
1408
|
+
*
|
|
1409
|
+
* @remarks
|
|
1410
|
+
* The default value is false. (For now.)
|
|
1411
|
+
*/
|
|
1412
|
+
readonly useWorkspaces: boolean;
|
|
1413
|
+
/** @internal */
|
|
1414
|
+
constructor(json: _IPnpmOptionsJson, commonTempFolder: string);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* This represents the available PNPM store options
|
|
1419
|
+
* @public
|
|
1420
|
+
*/
|
|
1421
|
+
export declare type PnpmStoreOptions = 'local' | 'global';
|
|
1422
|
+
|
|
1423
|
+
/**
|
|
1424
|
+
* @beta
|
|
1425
|
+
*/
|
|
1426
|
+
export declare class ProjectChangeAnalyzer {
|
|
1427
|
+
/**
|
|
1428
|
+
* UNINITIALIZED === we haven't looked
|
|
1429
|
+
* undefined === data isn't available (i.e. - git isn't present)
|
|
1430
|
+
*/
|
|
1431
|
+
private _data;
|
|
1432
|
+
private _filteredData;
|
|
1433
|
+
private _projectStateCache;
|
|
1434
|
+
private _rushConfiguration;
|
|
1435
|
+
private readonly _git;
|
|
1436
|
+
constructor(rushConfiguration: RushConfiguration);
|
|
1437
|
+
/**
|
|
1438
|
+
* Try to get a list of the specified project's dependencies and their hashes.
|
|
1439
|
+
*
|
|
1440
|
+
* @remarks
|
|
1441
|
+
* If the data can't be generated (i.e. - if Git is not present) this returns undefined.
|
|
1442
|
+
*
|
|
1443
|
+
* @internal
|
|
1444
|
+
*/
|
|
1445
|
+
_tryGetProjectDependenciesAsync(project: RushConfigurationProject, terminal: ITerminal): Promise<Map<string, string> | undefined>;
|
|
1446
|
+
/**
|
|
1447
|
+
* The project state hash is calculated in the following way:
|
|
1448
|
+
* - Project dependencies are collected (see ProjectChangeAnalyzer.getPackageDeps)
|
|
1449
|
+
* - If project dependencies cannot be collected (i.e. - if Git isn't available),
|
|
1450
|
+
* this function returns `undefined`
|
|
1451
|
+
* - The (path separator normalized) repo-root-relative dependencies' file paths are sorted
|
|
1452
|
+
* - A SHA1 hash is created and each (sorted) file path is fed into the hash and then its
|
|
1453
|
+
* Git SHA is fed into the hash
|
|
1454
|
+
* - A hex digest of the hash is returned
|
|
1455
|
+
*
|
|
1456
|
+
* @internal
|
|
1457
|
+
*/
|
|
1458
|
+
_tryGetProjectStateHashAsync(project: RushConfigurationProject, terminal: ITerminal): Promise<string | undefined>;
|
|
1459
|
+
_filterProjectDataAsync<T>(project: RushConfigurationProject, unfilteredProjectData: Map<string, T>, rootDir: string, terminal: ITerminal): Promise<Map<string, T>>;
|
|
1460
|
+
/**
|
|
1461
|
+
* Gets a list of projects that have changed in the current state of the repo
|
|
1462
|
+
* when compared to the specified branch.
|
|
1463
|
+
*/
|
|
1464
|
+
getChangedProjectsAsync(options: IGetChangedProjectsOptions): Promise<Set<RushConfigurationProject>>;
|
|
1465
|
+
private _getData;
|
|
1466
|
+
private _getIgnoreMatcherForProjectAsync;
|
|
1467
|
+
private _getRepoDeps;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
/**
|
|
1471
|
+
* This file is used to track the state of various Rush-related features. It is generated
|
|
1472
|
+
* and updated by Rush.
|
|
1473
|
+
*
|
|
1474
|
+
* @public
|
|
1475
|
+
*/
|
|
1476
|
+
export declare class RepoStateFile {
|
|
1477
|
+
private static _jsonSchema;
|
|
1478
|
+
private _repoStateFilePath;
|
|
1479
|
+
private _variant;
|
|
1480
|
+
private _pnpmShrinkwrapHash;
|
|
1481
|
+
private _preferredVersionsHash;
|
|
1482
|
+
private _isValid;
|
|
1483
|
+
private _modified;
|
|
1484
|
+
private constructor();
|
|
1485
|
+
/**
|
|
1486
|
+
* Get the absolute file path of the repo-state.json file.
|
|
1487
|
+
*/
|
|
1488
|
+
get filePath(): string;
|
|
1489
|
+
/**
|
|
1490
|
+
* The hash of the pnpm shrinkwrap file at the end of the last update.
|
|
1491
|
+
*/
|
|
1492
|
+
get pnpmShrinkwrapHash(): string | undefined;
|
|
1493
|
+
/**
|
|
1494
|
+
* The hash of all preferred versions at the end of the last update.
|
|
1495
|
+
*/
|
|
1496
|
+
get preferredVersionsHash(): string | undefined;
|
|
1497
|
+
/**
|
|
1498
|
+
* If false, the repo-state.json file is not valid and its values cannot be relied upon
|
|
1499
|
+
*/
|
|
1500
|
+
get isValid(): boolean;
|
|
1501
|
+
/**
|
|
1502
|
+
* Loads the repo-state.json data from the specified file path.
|
|
1503
|
+
* If the file has not been created yet, then an empty object is returned.
|
|
1504
|
+
*
|
|
1505
|
+
* @param jsonFilename - The path to the repo-state.json file.
|
|
1506
|
+
* @param variant - The variant currently being used by Rush.
|
|
1507
|
+
*/
|
|
1508
|
+
static loadFromFile(jsonFilename: string, variant: string | undefined): RepoStateFile;
|
|
1509
|
+
/**
|
|
1510
|
+
* Refresh the data contained in repo-state.json using the current state
|
|
1511
|
+
* of the Rush repo, and save the file if changes were made.
|
|
1512
|
+
*
|
|
1513
|
+
* @param rushConfiguration - The Rush configuration for the repo.
|
|
1514
|
+
*
|
|
1515
|
+
* @returns true if the file was modified, otherwise false.
|
|
1516
|
+
*/
|
|
1517
|
+
refreshState(rushConfiguration: RushConfiguration): boolean;
|
|
1518
|
+
/**
|
|
1519
|
+
* Writes the "repo-state.json" file to disk, using the filename that was passed to loadFromFile().
|
|
1520
|
+
*/
|
|
1521
|
+
private _saveIfModified;
|
|
1522
|
+
private _serialize;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* General operations for the Rush engine.
|
|
1527
|
+
*
|
|
1528
|
+
* @public
|
|
1529
|
+
*/
|
|
1530
|
+
export declare class Rush {
|
|
1531
|
+
private static _version;
|
|
1532
|
+
/**
|
|
1533
|
+
* This API is used by the `@microsoft/rush` front end to launch the "rush" command-line.
|
|
1534
|
+
* Third-party tools should not use this API. Instead, they should execute the "rush" binary
|
|
1535
|
+
* and start a new Node.js process.
|
|
1536
|
+
*
|
|
1537
|
+
* @param launcherVersion - The version of the `@microsoft/rush` wrapper used to call invoke the CLI.
|
|
1538
|
+
*
|
|
1539
|
+
* @remarks
|
|
1540
|
+
* Earlier versions of the rush frontend used a different API contract. In the old contract,
|
|
1541
|
+
* the second argument was the `isManaged` value of the {@link ILaunchOptions} object.
|
|
1542
|
+
*
|
|
1543
|
+
* Even though this API isn't documented, it is still supported for legacy compatibility.
|
|
1544
|
+
*/
|
|
1545
|
+
static launch(launcherVersion: string, arg: ILaunchOptions): void;
|
|
1546
|
+
/**
|
|
1547
|
+
* This API is used by the `@microsoft/rush` front end to launch the "rushx" command-line.
|
|
1548
|
+
* Third-party tools should not use this API. Instead, they should execute the "rushx" binary
|
|
1549
|
+
* and start a new Node.js process.
|
|
1550
|
+
*
|
|
1551
|
+
* @param launcherVersion - The version of the `@microsoft/rush` wrapper used to call invoke the CLI.
|
|
1552
|
+
*/
|
|
1553
|
+
static launchRushX(launcherVersion: string, options: ILaunchOptions): void;
|
|
1554
|
+
/**
|
|
1555
|
+
* The currently executing version of the "rush-lib" library.
|
|
1556
|
+
* This is the same as the Rush tool version for that release.
|
|
1557
|
+
*/
|
|
1558
|
+
static get version(): string;
|
|
1559
|
+
/**
|
|
1560
|
+
* Assign the `RUSH_INVOKED_FOLDER` environment variable during startup. This is only applied when
|
|
1561
|
+
* Rush is invoked via the CLI, not via the `@microsoft/rush-lib` automation API.
|
|
1562
|
+
*
|
|
1563
|
+
* @remarks
|
|
1564
|
+
* Modifying the parent process's environment is not a good design. The better design is (1) to consolidate
|
|
1565
|
+
* Rush's code paths that invoke scripts, and (2) to pass down the invoked folder with each code path,
|
|
1566
|
+
* so that it can finally be applied in a centralized helper like `Utilities._createEnvironmentForRushCommand()`.
|
|
1567
|
+
* The natural time to do that refactoring is when we rework `Utilities.executeCommand()` to use
|
|
1568
|
+
* `Executable.spawn()` or rushell.
|
|
1569
|
+
*/
|
|
1570
|
+
private static _assignRushInvokedFolder;
|
|
1571
|
+
/**
|
|
1572
|
+
* This function normalizes legacy options to the current {@link ILaunchOptions} object.
|
|
1573
|
+
*/
|
|
1574
|
+
private static _normalizeLaunchOptions;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* This represents the Rush configuration for a repository, based on the "rush.json"
|
|
1579
|
+
* configuration file.
|
|
1580
|
+
* @public
|
|
1581
|
+
*/
|
|
1582
|
+
export declare class RushConfiguration {
|
|
1583
|
+
private static _jsonSchema;
|
|
1584
|
+
private _rushJsonFile;
|
|
1585
|
+
private _rushJsonFolder;
|
|
1586
|
+
private _changesFolder;
|
|
1587
|
+
private _commonFolder;
|
|
1588
|
+
private _commonTempFolder;
|
|
1589
|
+
private _commonScriptsFolder;
|
|
1590
|
+
private _commonRushConfigFolder;
|
|
1591
|
+
private _packageManager;
|
|
1592
|
+
private _packageManagerWrapper;
|
|
1593
|
+
private _npmCacheFolder;
|
|
1594
|
+
private _npmTmpFolder;
|
|
1595
|
+
private _yarnCacheFolder;
|
|
1596
|
+
private _shrinkwrapFilename;
|
|
1597
|
+
private _tempShrinkwrapFilename;
|
|
1598
|
+
private _tempShrinkwrapPreinstallFilename;
|
|
1599
|
+
private _currentVariantJsonFilename;
|
|
1600
|
+
private _packageManagerToolVersion;
|
|
1601
|
+
private _packageManagerToolFilename;
|
|
1602
|
+
private _projectFolderMinDepth;
|
|
1603
|
+
private _projectFolderMaxDepth;
|
|
1604
|
+
private _allowMostlyStandardPackageNames;
|
|
1605
|
+
private _ensureConsistentVersions;
|
|
1606
|
+
private _suppressNodeLtsWarning;
|
|
1607
|
+
private _variants;
|
|
1608
|
+
private readonly _pathTrees;
|
|
1609
|
+
private _approvedPackagesPolicy;
|
|
1610
|
+
private _gitAllowedEmailRegExps;
|
|
1611
|
+
private _gitSampleEmail;
|
|
1612
|
+
private _gitVersionBumpCommitMessage;
|
|
1613
|
+
private _gitChangeLogUpdateCommitMessage;
|
|
1614
|
+
private _gitTagSeparator;
|
|
1615
|
+
private _hotfixChangeEnabled;
|
|
1616
|
+
private _repositoryUrl;
|
|
1617
|
+
private _repositoryDefaultBranch;
|
|
1618
|
+
private _repositoryDefaultRemote;
|
|
1619
|
+
private _npmOptions;
|
|
1620
|
+
private _pnpmOptions;
|
|
1621
|
+
private _yarnOptions;
|
|
1622
|
+
private _packageManagerConfigurationOptions;
|
|
1623
|
+
private _eventHooks;
|
|
1624
|
+
private readonly _packageNameParser;
|
|
1625
|
+
private _telemetryEnabled;
|
|
1626
|
+
private _projects;
|
|
1627
|
+
private _projectsByName;
|
|
1628
|
+
private _commonVersionsConfigurations;
|
|
1629
|
+
private _implicitlyPreferredVersions;
|
|
1630
|
+
private _versionPolicyConfiguration;
|
|
1631
|
+
private _versionPolicyConfigurationFilePath;
|
|
1632
|
+
private _experimentsConfiguration;
|
|
1633
|
+
private __rushPluginsConfiguration;
|
|
1634
|
+
private readonly _rushConfigurationJson;
|
|
1635
|
+
/**
|
|
1636
|
+
* Use RushConfiguration.loadFromConfigurationFile() or Use RushConfiguration.loadFromDefaultLocation()
|
|
1637
|
+
* instead.
|
|
1638
|
+
*/
|
|
1639
|
+
private constructor();
|
|
1640
|
+
private _initializeAndValidateLocalProjects;
|
|
1641
|
+
/**
|
|
1642
|
+
* Loads the configuration data from an Rush.json configuration file and returns
|
|
1643
|
+
* an RushConfiguration object.
|
|
1644
|
+
*/
|
|
1645
|
+
static loadFromConfigurationFile(rushJsonFilename: string): RushConfiguration;
|
|
1646
|
+
static loadFromDefaultLocation(options?: ITryFindRushJsonLocationOptions): RushConfiguration;
|
|
1647
|
+
/**
|
|
1648
|
+
* Find the rush.json location and return the path, or undefined if a rush.json can't be found.
|
|
1649
|
+
*/
|
|
1650
|
+
static tryFindRushJsonLocation(options?: ITryFindRushJsonLocationOptions): string | undefined;
|
|
1651
|
+
/**
|
|
1652
|
+
* This generates the unique names that are used to create temporary projects
|
|
1653
|
+
* in the Rush common folder.
|
|
1654
|
+
* NOTE: sortedProjectJsons is sorted by the caller.
|
|
1655
|
+
*/
|
|
1656
|
+
private static _generateTempNamesForProjects;
|
|
1657
|
+
/**
|
|
1658
|
+
* If someone adds a config file in the "common/rush/config" folder, it would be a bad
|
|
1659
|
+
* experience for Rush to silently ignore their file simply because they misspelled the
|
|
1660
|
+
* filename, or maybe it's an old format that's no longer supported. The
|
|
1661
|
+
* _validateCommonRushConfigFolder() function makes sure that this folder only contains
|
|
1662
|
+
* recognized config files.
|
|
1663
|
+
*/
|
|
1664
|
+
private static _validateCommonRushConfigFolder;
|
|
1665
|
+
/**
|
|
1666
|
+
* The name of the package manager being used to install dependencies
|
|
1667
|
+
*/
|
|
1668
|
+
get packageManager(): PackageManagerName;
|
|
1669
|
+
/**
|
|
1670
|
+
* {@inheritdoc PackageManager}
|
|
1671
|
+
*
|
|
1672
|
+
* @privateremarks
|
|
1673
|
+
* In the next major breaking API change, we will rename this property to "packageManager" and eliminate the
|
|
1674
|
+
* old property with that name.
|
|
1675
|
+
*
|
|
1676
|
+
* @beta
|
|
1677
|
+
*/
|
|
1678
|
+
get packageManagerWrapper(): PackageManager;
|
|
1679
|
+
/**
|
|
1680
|
+
* Gets the JSON data structure for the "rush.json" configuration file.
|
|
1681
|
+
*
|
|
1682
|
+
* @internal
|
|
1683
|
+
*/
|
|
1684
|
+
get rushConfigurationJson(): IRushConfigurationJson;
|
|
1685
|
+
/**
|
|
1686
|
+
* The absolute path to the "rush.json" configuration file that was loaded to construct this object.
|
|
1687
|
+
*/
|
|
1688
|
+
get rushJsonFile(): string;
|
|
1689
|
+
/**
|
|
1690
|
+
* The absolute path of the folder that contains rush.json for this project.
|
|
1691
|
+
*/
|
|
1692
|
+
get rushJsonFolder(): string;
|
|
1693
|
+
/**
|
|
1694
|
+
* The folder that contains all change files.
|
|
1695
|
+
*/
|
|
1696
|
+
get changesFolder(): string;
|
|
1697
|
+
/**
|
|
1698
|
+
* The fully resolved path for the "common" folder where Rush will store settings that
|
|
1699
|
+
* affect all Rush projects. This is always a subfolder of the folder containing "rush.json".
|
|
1700
|
+
* Example: `C:\MyRepo\common`
|
|
1701
|
+
*/
|
|
1702
|
+
get commonFolder(): string;
|
|
1703
|
+
/**
|
|
1704
|
+
* The folder where Rush's additional config files are stored. This folder is always a
|
|
1705
|
+
* subfolder called `config\rush` inside the common folder. (The `common\config` folder
|
|
1706
|
+
* is reserved for configuration files used by other tools.) To avoid confusion or mistakes,
|
|
1707
|
+
* Rush will report an error if this this folder contains any unrecognized files.
|
|
1708
|
+
*
|
|
1709
|
+
* Example: `C:\MyRepo\common\config\rush`
|
|
1710
|
+
*/
|
|
1711
|
+
get commonRushConfigFolder(): string;
|
|
1712
|
+
/**
|
|
1713
|
+
* The folder where temporary files will be stored. This is always a subfolder called "temp"
|
|
1714
|
+
* under the common folder.
|
|
1715
|
+
* Example: `C:\MyRepo\common\temp`
|
|
1716
|
+
*/
|
|
1717
|
+
get commonTempFolder(): string;
|
|
1718
|
+
/**
|
|
1719
|
+
* The folder where automation scripts are stored. This is always a subfolder called "scripts"
|
|
1720
|
+
* under the common folder.
|
|
1721
|
+
* Example: `C:\MyRepo\common\scripts`
|
|
1722
|
+
*/
|
|
1723
|
+
get commonScriptsFolder(): string;
|
|
1724
|
+
/**
|
|
1725
|
+
* The fully resolved path for the "autoinstallers" folder.
|
|
1726
|
+
* Example: `C:\MyRepo\common\autoinstallers`
|
|
1727
|
+
*/
|
|
1728
|
+
get commonAutoinstallersFolder(): string;
|
|
1729
|
+
/**
|
|
1730
|
+
* The folder where rush-plugin options json files are stored.
|
|
1731
|
+
* Example: `C:\MyRepo\common\config\rush-plugins`
|
|
1732
|
+
*/
|
|
1733
|
+
get rushPluginOptionsFolder(): string;
|
|
1734
|
+
/**
|
|
1735
|
+
* The local folder that will store the NPM package cache. Rush does not rely on the
|
|
1736
|
+
* npm's default global cache folder, because npm's caching implementation does not
|
|
1737
|
+
* reliably handle multiple processes. (For example, if a build box is running
|
|
1738
|
+
* "rush install" simultaneously for two different working folders, it may fail randomly.)
|
|
1739
|
+
*
|
|
1740
|
+
* Example: `C:\MyRepo\common\temp\npm-cache`
|
|
1741
|
+
*/
|
|
1742
|
+
get npmCacheFolder(): string;
|
|
1743
|
+
/**
|
|
1744
|
+
* The local folder where npm's temporary files will be written during installation.
|
|
1745
|
+
* Rush does not rely on the global default folder, because it may be on a different
|
|
1746
|
+
* hard disk.
|
|
1747
|
+
*
|
|
1748
|
+
* Example: `C:\MyRepo\common\temp\npm-tmp`
|
|
1749
|
+
*/
|
|
1750
|
+
get npmTmpFolder(): string;
|
|
1751
|
+
/**
|
|
1752
|
+
* The local folder that will store the Yarn package cache.
|
|
1753
|
+
*
|
|
1754
|
+
* Example: `C:\MyRepo\common\temp\yarn-cache`
|
|
1755
|
+
*/
|
|
1756
|
+
get yarnCacheFolder(): string;
|
|
1757
|
+
/**
|
|
1758
|
+
* The full path of the shrinkwrap file that is tracked by Git. (The "rush install"
|
|
1759
|
+
* command uses a temporary copy, whose path is tempShrinkwrapFilename.)
|
|
1760
|
+
* @remarks
|
|
1761
|
+
* This property merely reports the filename; the file itself may not actually exist.
|
|
1762
|
+
* Example: `C:\MyRepo\common\npm-shrinkwrap.json` or `C:\MyRepo\common\pnpm-lock.yaml`
|
|
1763
|
+
*
|
|
1764
|
+
* @deprecated Use `getCommittedShrinkwrapFilename` instead, which gets the correct common
|
|
1765
|
+
* shrinkwrap file name for a given active variant.
|
|
1766
|
+
*/
|
|
1767
|
+
get committedShrinkwrapFilename(): string;
|
|
1768
|
+
/**
|
|
1769
|
+
* The filename (without any path) of the shrinkwrap file that is used by the package manager.
|
|
1770
|
+
* @remarks
|
|
1771
|
+
* This property merely reports the filename; the file itself may not actually exist.
|
|
1772
|
+
* Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
|
|
1773
|
+
*/
|
|
1774
|
+
get shrinkwrapFilename(): string;
|
|
1775
|
+
/**
|
|
1776
|
+
* The full path of the temporary shrinkwrap file that is used during "rush install".
|
|
1777
|
+
* This file may get rewritten by the package manager during installation.
|
|
1778
|
+
* @remarks
|
|
1779
|
+
* This property merely reports the filename; the file itself may not actually exist.
|
|
1780
|
+
* Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
|
|
1781
|
+
*/
|
|
1782
|
+
get tempShrinkwrapFilename(): string;
|
|
1783
|
+
/**
|
|
1784
|
+
* The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
|
|
1785
|
+
* before installation begins, and can be compared to determine how the package manager
|
|
1786
|
+
* modified tempShrinkwrapFilename.
|
|
1787
|
+
* @remarks
|
|
1788
|
+
* This property merely reports the filename; the file itself may not actually exist.
|
|
1789
|
+
* Example: `C:\MyRepo\common\temp\npm-shrinkwrap-preinstall.json`
|
|
1790
|
+
* or `C:\MyRepo\common\temp\pnpm-lock-preinstall.yaml`
|
|
1791
|
+
*/
|
|
1792
|
+
get tempShrinkwrapPreinstallFilename(): string;
|
|
1793
|
+
/**
|
|
1794
|
+
* Returns an English phrase such as "shrinkwrap file" that can be used in logging messages
|
|
1795
|
+
* to refer to the shrinkwrap file using appropriate terminology for the currently selected
|
|
1796
|
+
* package manager.
|
|
1797
|
+
*/
|
|
1798
|
+
get shrinkwrapFilePhrase(): string;
|
|
1799
|
+
/**
|
|
1800
|
+
* The filename of the build dependency data file. By default this is
|
|
1801
|
+
* called 'rush-link.json' resides in the Rush common folder.
|
|
1802
|
+
* Its data structure is defined by IRushLinkJson.
|
|
1803
|
+
*
|
|
1804
|
+
* Example: `C:\MyRepo\common\temp\rush-link.json`
|
|
1805
|
+
*
|
|
1806
|
+
* @deprecated The "rush-link.json" file was removed in Rush 5.30.0.
|
|
1807
|
+
* Use `RushConfigurationProject.localDependencyProjects` instead.
|
|
1808
|
+
*/
|
|
1809
|
+
get rushLinkJsonFilename(): string;
|
|
1810
|
+
/**
|
|
1811
|
+
* The filename of the variant dependency data file. By default this is
|
|
1812
|
+
* called 'current-variant.json' resides in the Rush common folder.
|
|
1813
|
+
* Its data structure is defined by ICurrentVariantJson.
|
|
1814
|
+
*
|
|
1815
|
+
* Example: `C:\MyRepo\common\temp\current-variant.json`
|
|
1816
|
+
*/
|
|
1817
|
+
get currentVariantJsonFilename(): string;
|
|
1818
|
+
/**
|
|
1819
|
+
* The version of the locally installed NPM tool. (Example: "1.2.3")
|
|
1820
|
+
*/
|
|
1821
|
+
get packageManagerToolVersion(): string;
|
|
1822
|
+
/**
|
|
1823
|
+
* The absolute path to the locally installed NPM tool. If "rush install" has not
|
|
1824
|
+
* been run, then this file may not exist yet.
|
|
1825
|
+
* Example: `C:\MyRepo\common\temp\npm-local\node_modules\.bin\npm`
|
|
1826
|
+
*/
|
|
1827
|
+
get packageManagerToolFilename(): string;
|
|
1828
|
+
/**
|
|
1829
|
+
* The minimum allowable folder depth for the projectFolder field in the rush.json file.
|
|
1830
|
+
* This setting provides a way for repository maintainers to discourage nesting of project folders
|
|
1831
|
+
* that makes the directory tree more difficult to navigate. The default value is 2,
|
|
1832
|
+
* which implements a standard 2-level hierarchy of <categoryFolder>/<projectFolder>/package.json.
|
|
1833
|
+
*/
|
|
1834
|
+
get projectFolderMinDepth(): number;
|
|
1835
|
+
/**
|
|
1836
|
+
* The maximum allowable folder depth for the projectFolder field in the rush.json file.
|
|
1837
|
+
* This setting provides a way for repository maintainers to discourage nesting of project folders
|
|
1838
|
+
* that makes the directory tree more difficult to navigate. The default value is 2,
|
|
1839
|
+
* which implements on a standard convention of <categoryFolder>/<projectFolder>/package.json.
|
|
1840
|
+
*/
|
|
1841
|
+
get projectFolderMaxDepth(): number;
|
|
1842
|
+
/**
|
|
1843
|
+
* Today the npmjs.com registry enforces fairly strict naming rules for packages, but in the early
|
|
1844
|
+
* days there was no standard and hardly any enforcement. A few large legacy projects are still using
|
|
1845
|
+
* nonstandard package names, and private registries sometimes allow it. Set "allowMostlyStandardPackageNames"
|
|
1846
|
+
* to true to relax Rush's enforcement of package names. This allows upper case letters and in the future may
|
|
1847
|
+
* relax other rules, however we want to minimize these exceptions. Many popular tools use certain punctuation
|
|
1848
|
+
* characters as delimiters, based on the assumption that they will never appear in a package name; thus if we relax
|
|
1849
|
+
* the rules too much it is likely to cause very confusing malfunctions.
|
|
1850
|
+
*
|
|
1851
|
+
* The default value is false.
|
|
1852
|
+
*/
|
|
1853
|
+
get allowMostlyStandardPackageNames(): boolean;
|
|
1854
|
+
/**
|
|
1855
|
+
* The "approvedPackagesPolicy" settings.
|
|
1856
|
+
*/
|
|
1857
|
+
get approvedPackagesPolicy(): ApprovedPackagesPolicy;
|
|
1858
|
+
/**
|
|
1859
|
+
* [Part of the "gitPolicy" feature.]
|
|
1860
|
+
* A list of regular expressions describing allowable email patterns for Git commits.
|
|
1861
|
+
* They are case-insensitive anchored JavaScript RegExps.
|
|
1862
|
+
* Example: `".*@example\.com"`
|
|
1863
|
+
* This array will never be undefined.
|
|
1864
|
+
*/
|
|
1865
|
+
get gitAllowedEmailRegExps(): string[];
|
|
1866
|
+
/**
|
|
1867
|
+
* [Part of the "gitPolicy" feature.]
|
|
1868
|
+
* An example valid email address that conforms to one of the allowedEmailRegExps.
|
|
1869
|
+
* Example: `"foxtrot@example\.com"`
|
|
1870
|
+
* This will never be undefined, and will always be nonempty if gitAllowedEmailRegExps is used.
|
|
1871
|
+
*/
|
|
1872
|
+
get gitSampleEmail(): string;
|
|
1873
|
+
/**
|
|
1874
|
+
* [Part of the "gitPolicy" feature.]
|
|
1875
|
+
* The commit message to use when committing changes during 'rush publish'
|
|
1876
|
+
*/
|
|
1877
|
+
get gitVersionBumpCommitMessage(): string | undefined;
|
|
1878
|
+
/**
|
|
1879
|
+
* [Part of the "gitPolicy" feature.]
|
|
1880
|
+
* The commit message to use when committing change log files 'rush version'
|
|
1881
|
+
*/
|
|
1882
|
+
get gitChangeLogUpdateCommitMessage(): string | undefined;
|
|
1883
|
+
/**
|
|
1884
|
+
* [Part of the "gitPolicy" feature.]
|
|
1885
|
+
* The separator between package name and version in git tag.
|
|
1886
|
+
*/
|
|
1887
|
+
get gitTagSeparator(): string | undefined;
|
|
1888
|
+
/**
|
|
1889
|
+
* [Part of the "hotfixChange" feature.]
|
|
1890
|
+
* Enables creating hotfix changes
|
|
1891
|
+
*/
|
|
1892
|
+
get hotfixChangeEnabled(): boolean;
|
|
1893
|
+
/**
|
|
1894
|
+
* The remote url of the repository. This helps "rush change" find the right remote to compare against.
|
|
1895
|
+
*/
|
|
1896
|
+
get repositoryUrl(): string | undefined;
|
|
1897
|
+
/**
|
|
1898
|
+
* The default branch name. This tells "rush change" which remote branch to compare against.
|
|
1899
|
+
*/
|
|
1900
|
+
get repositoryDefaultBranch(): string;
|
|
1901
|
+
/**
|
|
1902
|
+
* The default remote. This tells "rush change" which remote to compare against if the remote URL is not set
|
|
1903
|
+
* or if a remote matching the provided remote URL is not found.
|
|
1904
|
+
*/
|
|
1905
|
+
get repositoryDefaultRemote(): string;
|
|
1906
|
+
/**
|
|
1907
|
+
* The default fully-qualified git remote branch of the repository. This helps "rush change" find the right branch to compare against.
|
|
1908
|
+
*/
|
|
1909
|
+
get repositoryDefaultFullyQualifiedRemoteBranch(): string;
|
|
1910
|
+
/**
|
|
1911
|
+
* Odd-numbered major versions of Node.js are experimental. Even-numbered releases
|
|
1912
|
+
* spend six months in a stabilization period before the first Long Term Support (LTS) version.
|
|
1913
|
+
* For example, 8.9.0 was the first LTS version of Node.js 8. Pre-LTS versions are not recommended
|
|
1914
|
+
* for production usage because they frequently have bugs. They may cause Rush itself
|
|
1915
|
+
* to malfunction.
|
|
1916
|
+
*
|
|
1917
|
+
* Rush normally prints a warning if it detects a pre-LTS Node.js version. If you are testing
|
|
1918
|
+
* pre-LTS versions in preparation for supporting the first LTS version, you can use this setting
|
|
1919
|
+
* to disable Rush's warning.
|
|
1920
|
+
*/
|
|
1921
|
+
get suppressNodeLtsWarning(): boolean;
|
|
1922
|
+
/**
|
|
1923
|
+
* If true, then consistent version specifiers for dependencies will be enforced.
|
|
1924
|
+
* I.e. "rush check" is run before some commands.
|
|
1925
|
+
*/
|
|
1926
|
+
get ensureConsistentVersions(): boolean;
|
|
1927
|
+
/**
|
|
1928
|
+
* Indicates whether telemetry collection is enabled for Rush runs.
|
|
1929
|
+
* @beta
|
|
1930
|
+
*/
|
|
1931
|
+
get telemetryEnabled(): boolean;
|
|
1932
|
+
get projects(): RushConfigurationProject[];
|
|
1933
|
+
get projectsByName(): Map<string, RushConfigurationProject>;
|
|
1934
|
+
/**
|
|
1935
|
+
* {@inheritDoc NpmOptionsConfiguration}
|
|
1936
|
+
*/
|
|
1937
|
+
get npmOptions(): NpmOptionsConfiguration;
|
|
1938
|
+
/**
|
|
1939
|
+
* {@inheritDoc PnpmOptionsConfiguration}
|
|
1940
|
+
*/
|
|
1941
|
+
get pnpmOptions(): PnpmOptionsConfiguration;
|
|
1942
|
+
/**
|
|
1943
|
+
* {@inheritDoc YarnOptionsConfiguration}
|
|
1944
|
+
*/
|
|
1945
|
+
get yarnOptions(): YarnOptionsConfiguration;
|
|
1946
|
+
/**
|
|
1947
|
+
* The configuration options used by the current package manager.
|
|
1948
|
+
* @remarks
|
|
1949
|
+
* For package manager specific variants, reference {@link RushConfiguration.npmOptions | npmOptions},
|
|
1950
|
+
* {@link RushConfiguration.pnpmOptions | pnpmOptions}, or {@link RushConfiguration.yarnOptions | yarnOptions}.
|
|
1951
|
+
*/
|
|
1952
|
+
get packageManagerOptions(): PackageManagerOptionsConfigurationBase;
|
|
1953
|
+
/**
|
|
1954
|
+
* Settings from the common-versions.json config file.
|
|
1955
|
+
* @remarks
|
|
1956
|
+
* If the common-versions.json file is missing, this property will not be undefined.
|
|
1957
|
+
* Instead it will be initialized in an empty state, and calling CommonVersionsConfiguration.save()
|
|
1958
|
+
* will create the file.
|
|
1959
|
+
*
|
|
1960
|
+
* @deprecated Use `getCommonVersions` instead, which gets the correct common version data
|
|
1961
|
+
* for a given active variant.
|
|
1962
|
+
*/
|
|
1963
|
+
get commonVersions(): CommonVersionsConfiguration;
|
|
1964
|
+
/**
|
|
1965
|
+
* Gets the currently-installed variant, if an installation has occurred.
|
|
1966
|
+
* For Rush operations which do not take a --variant parameter, this method
|
|
1967
|
+
* determines which variant, if any, was last specified when performing "rush install"
|
|
1968
|
+
* or "rush update".
|
|
1969
|
+
*/
|
|
1970
|
+
get currentInstalledVariant(): string | undefined;
|
|
1971
|
+
/**
|
|
1972
|
+
* The rush hooks. It allows customized scripts to run at the specified point.
|
|
1973
|
+
* @beta
|
|
1974
|
+
*/
|
|
1975
|
+
get eventHooks(): EventHooks;
|
|
1976
|
+
/**
|
|
1977
|
+
* The rush hooks. It allows customized scripts to run at the specified point.
|
|
1978
|
+
*/
|
|
1979
|
+
get packageNameParser(): PackageNameParser;
|
|
1980
|
+
/**
|
|
1981
|
+
* Gets the path to the common-versions.json config file for a specific variant.
|
|
1982
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
1983
|
+
*/
|
|
1984
|
+
getCommonVersionsFilePath(variant?: string | undefined): string;
|
|
1985
|
+
/**
|
|
1986
|
+
* Gets the settings from the common-versions.json config file for a specific variant.
|
|
1987
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
1988
|
+
*/
|
|
1989
|
+
getCommonVersions(variant?: string | undefined): CommonVersionsConfiguration;
|
|
1990
|
+
/**
|
|
1991
|
+
* Returns a map of all direct dependencies that only have a single semantic version specifier.
|
|
1992
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
1993
|
+
*
|
|
1994
|
+
* @returns A map of dependency name --\> version specifier for implicitly preferred versions.
|
|
1995
|
+
*/
|
|
1996
|
+
getImplicitlyPreferredVersions(variant?: string | undefined): Map<string, string>;
|
|
1997
|
+
/**
|
|
1998
|
+
* Gets the path to the repo-state.json file for a specific variant.
|
|
1999
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
2000
|
+
*/
|
|
2001
|
+
getRepoStateFilePath(variant?: string | undefined): string;
|
|
2002
|
+
/**
|
|
2003
|
+
* Gets the contents from the repo-state.json file for a specific variant.
|
|
2004
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
2005
|
+
*/
|
|
2006
|
+
getRepoState(variant?: string | undefined): RepoStateFile;
|
|
2007
|
+
/**
|
|
2008
|
+
* Gets the committed shrinkwrap file name for a specific variant.
|
|
2009
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
2010
|
+
*/
|
|
2011
|
+
getCommittedShrinkwrapFilename(variant?: string | undefined): string;
|
|
2012
|
+
/**
|
|
2013
|
+
* Gets the absolute path for "pnpmfile.js" for a specific variant.
|
|
2014
|
+
* @param variant - The name of the current variant in use by the active command.
|
|
2015
|
+
* @remarks
|
|
2016
|
+
* The file path is returned even if PNPM is not configured as the package manager.
|
|
2017
|
+
*/
|
|
2018
|
+
getPnpmfilePath(variant?: string | undefined): string;
|
|
2019
|
+
/**
|
|
2020
|
+
* Looks up a project in the projectsByName map. If the project is not found,
|
|
2021
|
+
* then undefined is returned.
|
|
2022
|
+
*/
|
|
2023
|
+
getProjectByName(projectName: string): RushConfigurationProject | undefined;
|
|
2024
|
+
/**
|
|
2025
|
+
* This is used e.g. by command-line interfaces such as "rush build --to example".
|
|
2026
|
+
* If "example" is not a project name, then it also looks for a scoped name
|
|
2027
|
+
* like `@something/example`. If exactly one project matches this heuristic, it
|
|
2028
|
+
* is returned. Otherwise, undefined is returned.
|
|
2029
|
+
*/
|
|
2030
|
+
findProjectByShorthandName(shorthandProjectName: string): RushConfigurationProject | undefined;
|
|
2031
|
+
/**
|
|
2032
|
+
* Looks up a project by its RushConfigurationProject.tempProjectName field.
|
|
2033
|
+
* @returns The found project, or undefined if no match was found.
|
|
2034
|
+
*/
|
|
2035
|
+
findProjectByTempName(tempProjectName: string): RushConfigurationProject | undefined;
|
|
2036
|
+
/**
|
|
2037
|
+
* @returns An optimized lookup engine to find a project by its path relative to the specified root.
|
|
2038
|
+
* @beta
|
|
2039
|
+
*/
|
|
2040
|
+
getProjectLookupForRoot(rootPath: string): LookupByPath<RushConfigurationProject>;
|
|
2041
|
+
/**
|
|
2042
|
+
* @beta
|
|
2043
|
+
*/
|
|
2044
|
+
get versionPolicyConfiguration(): VersionPolicyConfiguration;
|
|
2045
|
+
/**
|
|
2046
|
+
* @beta
|
|
2047
|
+
*/
|
|
2048
|
+
get versionPolicyConfigurationFilePath(): string;
|
|
2049
|
+
/**
|
|
2050
|
+
* This configuration object contains settings repo maintainers have specified to enable
|
|
2051
|
+
* and disable experimental Rush features.
|
|
2052
|
+
*
|
|
2053
|
+
* @beta
|
|
2054
|
+
*/
|
|
2055
|
+
get experimentsConfiguration(): ExperimentsConfiguration;
|
|
2056
|
+
/**
|
|
2057
|
+
* @internal
|
|
2058
|
+
*/
|
|
2059
|
+
get _rushPluginsConfiguration(): RushPluginsConfiguration;
|
|
2060
|
+
/**
|
|
2061
|
+
* Returns the project for which the specified path is underneath that project's folder.
|
|
2062
|
+
* If the path is not under any project's folder, returns undefined.
|
|
2063
|
+
*/
|
|
2064
|
+
tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
|
|
2065
|
+
private _collectVersionsForDependencies;
|
|
2066
|
+
private _populateDownstreamDependencies;
|
|
2067
|
+
private _getVariantConfigFolderPath;
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* This represents the configuration of a project that is built by Rush, based on
|
|
2072
|
+
* the Rush.json configuration file.
|
|
2073
|
+
* @public
|
|
2074
|
+
*/
|
|
2075
|
+
export declare class RushConfigurationProject {
|
|
2076
|
+
private _packageName;
|
|
2077
|
+
private _projectFolder;
|
|
2078
|
+
private _projectRelativeFolder;
|
|
2079
|
+
private _projectRushConfigFolder;
|
|
2080
|
+
private _projectRushTempFolder;
|
|
2081
|
+
private _reviewCategory;
|
|
2082
|
+
private _packageJson;
|
|
2083
|
+
private _packageJsonEditor;
|
|
2084
|
+
private _tempProjectName;
|
|
2085
|
+
private _unscopedTempProjectName;
|
|
2086
|
+
private _cyclicDependencyProjects;
|
|
2087
|
+
private _versionPolicyName;
|
|
2088
|
+
private _versionPolicy;
|
|
2089
|
+
private _shouldPublish;
|
|
2090
|
+
private _skipRushCheck;
|
|
2091
|
+
private _publishFolder;
|
|
2092
|
+
private _dependencyProjects;
|
|
2093
|
+
private _consumingProjects;
|
|
2094
|
+
private readonly _rushConfiguration;
|
|
2095
|
+
/**
|
|
2096
|
+
* A set of projects within the Rush configuration which directly consume this package.
|
|
2097
|
+
*
|
|
2098
|
+
* @remarks
|
|
2099
|
+
* Writable because it is mutated by RushConfiguration during initialization.
|
|
2100
|
+
* @internal
|
|
2101
|
+
*/
|
|
2102
|
+
readonly _consumingProjectNames: Set<string>;
|
|
2103
|
+
/** @internal */
|
|
2104
|
+
constructor(projectJson: IRushConfigurationProjectJson, rushConfiguration: RushConfiguration, tempProjectName: string);
|
|
2105
|
+
/**
|
|
2106
|
+
* The name of the NPM package. An error is reported if this name is not
|
|
2107
|
+
* identical to packageJson.name.
|
|
2108
|
+
*
|
|
2109
|
+
* Example: `@scope/MyProject`
|
|
2110
|
+
*/
|
|
2111
|
+
get packageName(): string;
|
|
2112
|
+
/**
|
|
2113
|
+
* The full path of the folder that contains the project to be built by Rush.
|
|
2114
|
+
*
|
|
2115
|
+
* Example: `C:\MyRepo\libraries\my-project`
|
|
2116
|
+
*/
|
|
2117
|
+
get projectFolder(): string;
|
|
2118
|
+
/**
|
|
2119
|
+
* The relative path of the folder that contains the project to be built by Rush.
|
|
2120
|
+
*
|
|
2121
|
+
* Example: `libraries/my-project`
|
|
2122
|
+
*/
|
|
2123
|
+
get projectRelativeFolder(): string;
|
|
2124
|
+
/**
|
|
2125
|
+
* The project-specific Rush configuration folder.
|
|
2126
|
+
*
|
|
2127
|
+
* Example: `C:\MyRepo\libraries\my-project\config\rush`
|
|
2128
|
+
*/
|
|
2129
|
+
get projectRushConfigFolder(): string;
|
|
2130
|
+
/**
|
|
2131
|
+
* The project-specific Rush temp folder. This folder is used to store Rush-specific temporary files.
|
|
2132
|
+
*
|
|
2133
|
+
* Example: `C:\MyRepo\libraries\my-project\.rush\temp`
|
|
2134
|
+
*/
|
|
2135
|
+
get projectRushTempFolder(): string;
|
|
2136
|
+
/**
|
|
2137
|
+
* The Rush configuration for the monorepo that the project belongs to.
|
|
2138
|
+
*/
|
|
2139
|
+
get rushConfiguration(): RushConfiguration;
|
|
2140
|
+
/**
|
|
2141
|
+
* The review category name, or undefined if no category was assigned.
|
|
2142
|
+
* This name must be one of the valid choices listed in RushConfiguration.reviewCategories.
|
|
2143
|
+
*/
|
|
2144
|
+
get reviewCategory(): string | undefined;
|
|
2145
|
+
/**
|
|
2146
|
+
* A list of local projects that appear as devDependencies for this project, but cannot be
|
|
2147
|
+
* locally linked because it would create a cyclic dependency; instead, the last published
|
|
2148
|
+
* version will be installed in the Common folder.
|
|
2149
|
+
*
|
|
2150
|
+
* These are package names that would be found by RushConfiguration.getProjectByName().
|
|
2151
|
+
*/
|
|
2152
|
+
get cyclicDependencyProjects(): Set<string>;
|
|
2153
|
+
/**
|
|
2154
|
+
* An array of projects within the Rush configuration which directly depend on this package.
|
|
2155
|
+
* @deprecated Use `consumingProjectNames` instead, as it has Set semantics, which better reflect the nature
|
|
2156
|
+
* of the data.
|
|
2157
|
+
*/
|
|
2158
|
+
get downstreamDependencyProjects(): string[];
|
|
2159
|
+
/**
|
|
2160
|
+
* An array of projects within the Rush configuration which this project declares as dependencies.
|
|
2161
|
+
* @deprecated Use `dependencyProjects` instead, as it has Set semantics, which better reflect the nature
|
|
2162
|
+
* of the data.
|
|
2163
|
+
*/
|
|
2164
|
+
get localDependencyProjects(): ReadonlyArray<RushConfigurationProject>;
|
|
2165
|
+
/**
|
|
2166
|
+
* The set of projects within the Rush configuration which this project declares as dependencies.
|
|
2167
|
+
*
|
|
2168
|
+
* @remarks
|
|
2169
|
+
* Can be used recursively to walk the project dependency graph to find all projects that are directly or indirectly
|
|
2170
|
+
* referenced from this project.
|
|
2171
|
+
*/
|
|
2172
|
+
get dependencyProjects(): ReadonlySet<RushConfigurationProject>;
|
|
2173
|
+
/**
|
|
2174
|
+
* The set of projects within the Rush configuration which declare this project as a dependency.
|
|
2175
|
+
* Excludes those that declare this project as a `cyclicDependencyProject`.
|
|
2176
|
+
*
|
|
2177
|
+
* @remarks
|
|
2178
|
+
* This field is the counterpart to `dependencyProjects`, and can be used recursively to walk the project dependency
|
|
2179
|
+
* graph to find all projects which will be impacted by changes to this project.
|
|
2180
|
+
*/
|
|
2181
|
+
get consumingProjects(): ReadonlySet<RushConfigurationProject>;
|
|
2182
|
+
/**
|
|
2183
|
+
* The parsed NPM "package.json" file from projectFolder.
|
|
2184
|
+
* @deprecated Use packageJsonEditor instead
|
|
2185
|
+
*/
|
|
2186
|
+
get packageJson(): IPackageJson;
|
|
2187
|
+
/**
|
|
2188
|
+
* A useful wrapper around the package.json file for making modifications
|
|
2189
|
+
* @beta
|
|
2190
|
+
*/
|
|
2191
|
+
get packageJsonEditor(): PackageJsonEditor;
|
|
2192
|
+
/**
|
|
2193
|
+
* The unique name for the temporary project that will be generated in the Common folder.
|
|
2194
|
+
* For example, if the project name is `@scope/MyProject`, the temporary project name
|
|
2195
|
+
* might be `@rush-temp/MyProject-2`.
|
|
2196
|
+
*
|
|
2197
|
+
* Example: `@rush-temp/MyProject-2`
|
|
2198
|
+
*/
|
|
2199
|
+
get tempProjectName(): string;
|
|
2200
|
+
/**
|
|
2201
|
+
* The unscoped temporary project name
|
|
2202
|
+
*
|
|
2203
|
+
* Example: `my-project-2`
|
|
2204
|
+
*/
|
|
2205
|
+
get unscopedTempProjectName(): string;
|
|
2206
|
+
/**
|
|
2207
|
+
* A flag which indicates whether changes to this project should be published. This controls
|
|
2208
|
+
* whether or not the project would show up when running `rush change`, and whether or not it
|
|
2209
|
+
* should be published during `rush publish`.
|
|
2210
|
+
*/
|
|
2211
|
+
get shouldPublish(): boolean;
|
|
2212
|
+
/**
|
|
2213
|
+
* If true, then this project will be ignored by the "rush check" command.
|
|
2214
|
+
* The default value is false.
|
|
2215
|
+
*/
|
|
2216
|
+
get skipRushCheck(): boolean;
|
|
2217
|
+
/**
|
|
2218
|
+
* Name of the version policy used by this project.
|
|
2219
|
+
* @beta
|
|
2220
|
+
*/
|
|
2221
|
+
get versionPolicyName(): string | undefined;
|
|
2222
|
+
/**
|
|
2223
|
+
* The full path of the folder that will get published by Rush.
|
|
2224
|
+
*
|
|
2225
|
+
* @remarks
|
|
2226
|
+
* By default this is the same as the project folder, but a custom folder can be specified
|
|
2227
|
+
* using the the "publishFolder" setting in rush.json.
|
|
2228
|
+
*
|
|
2229
|
+
* Example: `C:\MyRepo\libraries\my-project\temp\publish`
|
|
2230
|
+
*/
|
|
2231
|
+
get publishFolder(): string;
|
|
2232
|
+
/**
|
|
2233
|
+
* Version policy of the project
|
|
2234
|
+
* @beta
|
|
2235
|
+
*/
|
|
2236
|
+
get versionPolicy(): VersionPolicy | undefined;
|
|
2237
|
+
/**
|
|
2238
|
+
* Indicate whether this project is the main project for the related version policy.
|
|
2239
|
+
*
|
|
2240
|
+
* False if the project is not for publishing.
|
|
2241
|
+
* True if the project is individually versioned or if its lockstep version policy does not specify main project.
|
|
2242
|
+
* False if the project is lockstepped and is not the main project for its version policy.
|
|
2243
|
+
*
|
|
2244
|
+
* @beta
|
|
2245
|
+
*/
|
|
2246
|
+
get isMainProject(): boolean;
|
|
2247
|
+
/**
|
|
2248
|
+
* Compute the local rush projects that this project immediately depends on,
|
|
2249
|
+
* according to the specific dependency group from package.json
|
|
2250
|
+
*/
|
|
2251
|
+
private _getDependencyProjects;
|
|
2252
|
+
/**
|
|
2253
|
+
* Compute the local rush projects that declare this project as a dependency
|
|
2254
|
+
*/
|
|
2255
|
+
private _getConsumingProjects;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
/**
|
|
2259
|
+
* Constants used by the Rush tool.
|
|
2260
|
+
* @beta
|
|
2261
|
+
*
|
|
2262
|
+
* @remarks
|
|
2263
|
+
*
|
|
2264
|
+
* These are NOT part of the public API surface for rush-lib.
|
|
2265
|
+
* The rationale is that we don't want people implementing custom parsers for
|
|
2266
|
+
* the Rush config files; instead, they should rely on the official APIs from rush-lib.
|
|
2267
|
+
*/
|
|
2268
|
+
export declare class RushConstants {
|
|
2269
|
+
/**
|
|
2270
|
+
* The filename ("browser-approved-packages.json") for an optional policy configuration file
|
|
2271
|
+
* that stores a list of NPM packages that have been approved for usage by Rush projects.
|
|
2272
|
+
* This is part of a pair of config files, one for projects that run in a web browser
|
|
2273
|
+
* (e.g. whose approval criteria mostly focuses on licensing and code size), and one for everywhere else
|
|
2274
|
+
* (e.g. tooling projects whose approval criteria mostly focuses on avoiding node_modules sprawl).
|
|
2275
|
+
*/
|
|
2276
|
+
static readonly browserApprovedPackagesFilename: string;
|
|
2277
|
+
/**
|
|
2278
|
+
* The folder name ("changes") where change files will be stored.
|
|
2279
|
+
*/
|
|
2280
|
+
static readonly changeFilesFolderName: string;
|
|
2281
|
+
/**
|
|
2282
|
+
* The filename ("nonbrowser-approved-packages.json") for an optional policy configuration file
|
|
2283
|
+
* that stores a list of NPM packages that have been approved for usage by Rush projects.
|
|
2284
|
+
* This is part of a pair of config files, one for projects that run in a web browser
|
|
2285
|
+
* (e.g. whose approval criteria mostly focuses on licensing and code size), and one for everywhere else
|
|
2286
|
+
* (e.g. tooling projects whose approval criteria mostly focuses on avoiding node_modules sprawl).
|
|
2287
|
+
*/
|
|
2288
|
+
static readonly nonbrowserApprovedPackagesFilename: string;
|
|
2289
|
+
/**
|
|
2290
|
+
* The folder name ("common") where Rush's common data will be stored.
|
|
2291
|
+
*/
|
|
2292
|
+
static readonly commonFolderName: string;
|
|
2293
|
+
/**
|
|
2294
|
+
* The NPM scope ("\@rush-temp") that is used for Rush's temporary projects.
|
|
2295
|
+
*/
|
|
2296
|
+
static readonly rushTempNpmScope: string;
|
|
2297
|
+
/**
|
|
2298
|
+
* The folder name ("temp") under the common folder, or under the .rush folder in each project's directory where
|
|
2299
|
+
* temporary files will be stored.
|
|
2300
|
+
* Example: `C:\MyRepo\common\temp`
|
|
2301
|
+
*/
|
|
2302
|
+
static readonly rushTempFolderName: string;
|
|
2303
|
+
/**
|
|
2304
|
+
* The folder name ("projects") where temporary projects will be stored.
|
|
2305
|
+
* Example: `C:\MyRepo\common\temp\projects`
|
|
2306
|
+
*/
|
|
2307
|
+
static readonly rushTempProjectsFolderName: string;
|
|
2308
|
+
/**
|
|
2309
|
+
* The folder name ("variants") under which named variant configurations for
|
|
2310
|
+
* alternate dependency sets may be found.
|
|
2311
|
+
* Example: `C:\MyRepo\common\config\rush\variants`
|
|
2312
|
+
*/
|
|
2313
|
+
static readonly rushVariantsFolderName: string;
|
|
2314
|
+
/**
|
|
2315
|
+
* The filename ("npm-shrinkwrap.json") used to store an installation plan for the NPM package manger.
|
|
2316
|
+
*/
|
|
2317
|
+
static readonly npmShrinkwrapFilename: string;
|
|
2318
|
+
/**
|
|
2319
|
+
* Number of installation attempts
|
|
2320
|
+
*/
|
|
2321
|
+
static readonly defaultMaxInstallAttempts: number;
|
|
2322
|
+
/**
|
|
2323
|
+
* The filename ("pnpm-lock.yaml") used to store an installation plan for the PNPM package manger
|
|
2324
|
+
* (PNPM version 3.x and later).
|
|
2325
|
+
*/
|
|
2326
|
+
static readonly pnpmV3ShrinkwrapFilename: string;
|
|
2327
|
+
/**
|
|
2328
|
+
* The filename ("pnpmfile.js") used to add custom configuration to PNPM (PNPM version 1.x and later).
|
|
2329
|
+
*/
|
|
2330
|
+
static readonly pnpmfileV1Filename: string;
|
|
2331
|
+
/**
|
|
2332
|
+
* The filename (".pnpmfile.cjs") used to add custom configuration to PNPM (PNPM version 6.x and later).
|
|
2333
|
+
*/
|
|
2334
|
+
static readonly pnpmfileV6Filename: string;
|
|
2335
|
+
/**
|
|
2336
|
+
* The filename ("shrinkwrap.yaml") used to store state for pnpm
|
|
2337
|
+
*/
|
|
2338
|
+
static readonly yarnShrinkwrapFilename: string;
|
|
2339
|
+
/**
|
|
2340
|
+
* The folder name ("node_modules") where NPM installs its packages.
|
|
2341
|
+
*/
|
|
2342
|
+
static readonly nodeModulesFolderName: string;
|
|
2343
|
+
/**
|
|
2344
|
+
* The filename ("pinned-versions.json") for an old configuration file that
|
|
2345
|
+
* that is no longer supported.
|
|
2346
|
+
*
|
|
2347
|
+
* @deprecated This feature has been superseded by the "preferredVersions" setting
|
|
2348
|
+
* in common-versions.json
|
|
2349
|
+
*/
|
|
2350
|
+
static readonly pinnedVersionsFilename: string;
|
|
2351
|
+
/**
|
|
2352
|
+
* The filename ("common-versions.json") for an optional configuration file
|
|
2353
|
+
* that stores dependency version information that affects all projects in the repo.
|
|
2354
|
+
* This configuration file should go in the "common/config/rush" folder.
|
|
2355
|
+
*/
|
|
2356
|
+
static readonly commonVersionsFilename: string;
|
|
2357
|
+
/**
|
|
2358
|
+
* The filename ("repo-state.json") for a file used by Rush to
|
|
2359
|
+
* store the state of various features as they stand in the repo.
|
|
2360
|
+
*/
|
|
2361
|
+
static readonly repoStateFilename: string;
|
|
2362
|
+
/**
|
|
2363
|
+
* The name of the per-project folder where project-specific Rush files are stored. For example,
|
|
2364
|
+
* the package-deps files, which are used by commands to determine if a particular project needs to be rebuilt.
|
|
2365
|
+
*/
|
|
2366
|
+
static readonly projectRushFolderName: string;
|
|
2367
|
+
/**
|
|
2368
|
+
* Custom command line configuration file, which is used by rush for implementing
|
|
2369
|
+
* custom command and options.
|
|
2370
|
+
*/
|
|
2371
|
+
static readonly commandLineFilename: string;
|
|
2372
|
+
static readonly versionPoliciesFilename: string;
|
|
2373
|
+
/**
|
|
2374
|
+
* Experiments configuration file.
|
|
2375
|
+
*/
|
|
2376
|
+
static readonly experimentsFilename: string;
|
|
2377
|
+
/**
|
|
2378
|
+
* Rush plugins configuration file name.
|
|
2379
|
+
*/
|
|
2380
|
+
static readonly rushPluginsConfigFilename: string;
|
|
2381
|
+
/**
|
|
2382
|
+
* Rush plugin manifest file name.
|
|
2383
|
+
*/
|
|
2384
|
+
static readonly rushPluginManifestFilename: string;
|
|
2385
|
+
/**
|
|
2386
|
+
* The artifactory.json configuration file name.
|
|
2387
|
+
*/
|
|
2388
|
+
static readonly artifactoryFilename: string;
|
|
2389
|
+
/**
|
|
2390
|
+
* Build cache configuration file.
|
|
2391
|
+
*/
|
|
2392
|
+
static readonly buildCacheFilename: string;
|
|
2393
|
+
/**
|
|
2394
|
+
* Per-project configuration filename.
|
|
2395
|
+
*/
|
|
2396
|
+
static readonly rushProjectConfigFilename: string;
|
|
2397
|
+
/**
|
|
2398
|
+
* The URL ("http://rushjs.io") for the Rush web site.
|
|
2399
|
+
*/
|
|
2400
|
+
static readonly rushWebSiteUrl: string;
|
|
2401
|
+
/**
|
|
2402
|
+
* The name of the NPM package for the Rush tool ("\@microsoft/rush").
|
|
2403
|
+
*/
|
|
2404
|
+
static readonly rushPackageName: string;
|
|
2405
|
+
/**
|
|
2406
|
+
* The folder name ("rush-recycler") where Rush moves large folder trees
|
|
2407
|
+
* before asynchronously deleting them.
|
|
2408
|
+
*/
|
|
2409
|
+
static readonly rushRecyclerFolderName: string;
|
|
2410
|
+
/**
|
|
2411
|
+
* The name of the file to drop in project-folder/.rush/temp/ containing a listing of the project's direct
|
|
2412
|
+
* and indirect dependencies. This is used to detect if a project's dependencies have changed since the last build.
|
|
2413
|
+
*/
|
|
2414
|
+
static readonly projectShrinkwrapFilename: string;
|
|
2415
|
+
/**
|
|
2416
|
+
* The value of the "commandKind" property for a bulk command in command-line.json
|
|
2417
|
+
*/
|
|
2418
|
+
static readonly bulkCommandKind: 'bulk';
|
|
2419
|
+
/**
|
|
2420
|
+
* The value of the "commandKind" property for a global command in command-line.json
|
|
2421
|
+
*/
|
|
2422
|
+
static readonly globalCommandKind: 'global';
|
|
2423
|
+
/**
|
|
2424
|
+
* The value of the "commandKind" property for a phased command in command-line.json
|
|
2425
|
+
*/
|
|
2426
|
+
static readonly phasedCommandKind: 'phased';
|
|
2427
|
+
/**
|
|
2428
|
+
* The name of the incremental build command.
|
|
2429
|
+
*/
|
|
2430
|
+
static readonly buildCommandName: string;
|
|
2431
|
+
/**
|
|
2432
|
+
* The name of the non-incremental build command.
|
|
2433
|
+
*/
|
|
2434
|
+
static readonly rebuildCommandName: string;
|
|
2435
|
+
static readonly updateCloudCredentialsCommandName: string;
|
|
2436
|
+
/**
|
|
2437
|
+
* When a hash generated that contains multiple input segments, this character may be used
|
|
2438
|
+
* to separate them to avoid issues like
|
|
2439
|
+
* crypto.createHash('sha1').update('a').update('bc').digest('hex') === crypto.createHash('sha1').update('ab').update('c').digest('hex')
|
|
2440
|
+
*/
|
|
2441
|
+
static readonly hashDelimiter: string;
|
|
2442
|
+
/**
|
|
2443
|
+
* The name of the per-user Rush configuration data folder.
|
|
2444
|
+
*/
|
|
2445
|
+
static readonly rushUserConfigurationFolderName: string;
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
/**
|
|
2449
|
+
* This class provides global folders that are used for rush's internal install locations.
|
|
2450
|
+
*
|
|
2451
|
+
* @internal
|
|
2452
|
+
*/
|
|
2453
|
+
export declare class _RushGlobalFolder {
|
|
2454
|
+
private _rushGlobalFolder;
|
|
2455
|
+
private _rushNodeSpecificUserFolder;
|
|
2456
|
+
/**
|
|
2457
|
+
* The global folder where Rush stores temporary files.
|
|
2458
|
+
*
|
|
2459
|
+
* @remarks
|
|
2460
|
+
*
|
|
2461
|
+
* Most of the temporary files created by Rush are stored separately for each monorepo working folder,
|
|
2462
|
+
* to avoid issues of concurrency and compatibility between tool versions. However, a small set
|
|
2463
|
+
* of files (e.g. installations of the `@microsoft/rush-lib` engine and the package manager) are stored
|
|
2464
|
+
* in a global folder to speed up installations. The default location is `~/.rush` on POSIX-like
|
|
2465
|
+
* operating systems or `C:\Users\YourName` on Windows.
|
|
2466
|
+
*
|
|
2467
|
+
* You can use the {@link EnvironmentVariableNames.RUSH_GLOBAL_FOLDER} environment variable to specify
|
|
2468
|
+
* a different folder path. This is useful for example if a Windows group policy forbids executing scripts
|
|
2469
|
+
* installed in a user's home directory.
|
|
2470
|
+
*
|
|
2471
|
+
* POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc.
|
|
2472
|
+
*/
|
|
2473
|
+
get path(): string;
|
|
2474
|
+
/**
|
|
2475
|
+
* The absolute path to Rush's storage in the home directory for the current user and node version.
|
|
2476
|
+
* On Windows, it would be something like `C:\Users\YourName\.rush\node-v3.4.5`.
|
|
2477
|
+
*/
|
|
2478
|
+
get nodeSpecificPath(): string;
|
|
2479
|
+
constructor();
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
/**
|
|
2483
|
+
* @beta
|
|
2484
|
+
*/
|
|
2485
|
+
export declare class RushLifecycleHooks {
|
|
2486
|
+
/**
|
|
2487
|
+
* The hook to run when all rush plugins is initialized.
|
|
2488
|
+
*/
|
|
2489
|
+
initialize: AsyncSeriesHook<void>;
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
declare class RushPluginsConfiguration {
|
|
2493
|
+
private static _jsonSchema;
|
|
2494
|
+
private _rushPluginsConfigurationJson;
|
|
2495
|
+
private _jsonFilename;
|
|
2496
|
+
constructor(jsonFilename: string);
|
|
2497
|
+
get configuration(): Readonly<IRushPluginsConfigurationJson>;
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
/**
|
|
2501
|
+
* @beta
|
|
2502
|
+
*/
|
|
2503
|
+
export declare class RushSession {
|
|
2504
|
+
private readonly _options;
|
|
2505
|
+
private readonly _cloudBuildCacheProviderFactories;
|
|
2506
|
+
readonly hooks: RushLifecycleHooks;
|
|
2507
|
+
constructor(options: IRushSessionOptions);
|
|
2508
|
+
getLogger(name: string): ILogger;
|
|
2509
|
+
get terminalProvider(): ITerminalProvider;
|
|
2510
|
+
registerCloudBuildCacheProviderFactory(cacheProviderName: string, factory: CloudBuildCacheProviderFactory): void;
|
|
2511
|
+
getCloudBuildCacheProviderFactory(cacheProviderName: string): CloudBuildCacheProviderFactory | undefined;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
/**
|
|
2515
|
+
* Rush per-user configuration data.
|
|
2516
|
+
*
|
|
2517
|
+
* @beta
|
|
2518
|
+
*/
|
|
2519
|
+
export declare class RushUserConfiguration {
|
|
2520
|
+
private static _schema;
|
|
2521
|
+
/**
|
|
2522
|
+
* If provided, store build cache in the specified folder. Must be an absolute path.
|
|
2523
|
+
*/
|
|
2524
|
+
readonly buildCacheFolder: string | undefined;
|
|
2525
|
+
private constructor();
|
|
2526
|
+
static initializeAsync(): Promise<RushUserConfiguration>;
|
|
2527
|
+
static getRushUserFolderPath(): string;
|
|
2528
|
+
}
|
|
2529
|
+
|
|
2530
|
+
declare enum VersionFormatForCommit {
|
|
2531
|
+
wildcard = "wildcard",
|
|
2532
|
+
original = "original"
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
declare enum VersionFormatForPublish {
|
|
2536
|
+
original = "original",
|
|
2537
|
+
exact = "exact"
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
/**
|
|
2541
|
+
* This is the base class for version policy which controls how versions get bumped.
|
|
2542
|
+
* @public
|
|
2543
|
+
*/
|
|
2544
|
+
export declare abstract class VersionPolicy {
|
|
2545
|
+
private _policyName;
|
|
2546
|
+
private _definitionName;
|
|
2547
|
+
private _exemptFromRushChange;
|
|
2548
|
+
private _includeEmailInChangeFile;
|
|
2549
|
+
private _versionFormatForCommit;
|
|
2550
|
+
private _versionFormatForPublish;
|
|
2551
|
+
/**
|
|
2552
|
+
* @internal
|
|
2553
|
+
*/
|
|
2554
|
+
constructor(versionPolicyJson: IVersionPolicyJson);
|
|
2555
|
+
/**
|
|
2556
|
+
* Loads from version policy json
|
|
2557
|
+
*
|
|
2558
|
+
* @param versionPolicyJson - version policy Json
|
|
2559
|
+
*
|
|
2560
|
+
* @internal
|
|
2561
|
+
*/
|
|
2562
|
+
static load(versionPolicyJson: IVersionPolicyJson): VersionPolicy | undefined;
|
|
2563
|
+
/**
|
|
2564
|
+
* Version policy name
|
|
2565
|
+
*/
|
|
2566
|
+
get policyName(): string;
|
|
2567
|
+
/**
|
|
2568
|
+
* Version policy definition name
|
|
2569
|
+
*/
|
|
2570
|
+
get definitionName(): VersionPolicyDefinitionName;
|
|
2571
|
+
/**
|
|
2572
|
+
* Whether it is a lockstepped version policy
|
|
2573
|
+
*/
|
|
2574
|
+
get isLockstepped(): boolean;
|
|
2575
|
+
/**
|
|
2576
|
+
* Determines if a version policy wants to opt out of changelog files.
|
|
2577
|
+
*/
|
|
2578
|
+
get exemptFromRushChange(): boolean;
|
|
2579
|
+
/**
|
|
2580
|
+
* Determines if a version policy wants to opt in to including email.
|
|
2581
|
+
*/
|
|
2582
|
+
get includeEmailInChangeFile(): boolean;
|
|
2583
|
+
/**
|
|
2584
|
+
* Returns an updated package json that satisfies the policy.
|
|
2585
|
+
*
|
|
2586
|
+
* @param project - package json
|
|
2587
|
+
* @param force - force update even when the project version is higher than the policy version.
|
|
2588
|
+
*/
|
|
2589
|
+
abstract ensure(project: IPackageJson, force?: boolean): IPackageJson | undefined;
|
|
2590
|
+
/**
|
|
2591
|
+
* Bumps version based on the policy
|
|
2592
|
+
*
|
|
2593
|
+
* @param bumpType - (optional) override bump type
|
|
2594
|
+
* @param identifier - (optional) override prerelease Id
|
|
2595
|
+
*/
|
|
2596
|
+
abstract bump(bumpType?: BumpType, identifier?: string): void;
|
|
2597
|
+
/**
|
|
2598
|
+
* Serialized json for the policy
|
|
2599
|
+
*
|
|
2600
|
+
* @internal
|
|
2601
|
+
*/
|
|
2602
|
+
abstract get _json(): IVersionPolicyJson;
|
|
2603
|
+
/**
|
|
2604
|
+
* Validates the specified version and throws if the version does not satisfy the policy.
|
|
2605
|
+
*
|
|
2606
|
+
* @param versionString - version string
|
|
2607
|
+
* @param packageName - package name
|
|
2608
|
+
*/
|
|
2609
|
+
abstract validate(versionString: string, packageName: string): void;
|
|
2610
|
+
/**
|
|
2611
|
+
* Tells the version policy to modify any dependencies in the target package
|
|
2612
|
+
* to values used for publishing.
|
|
2613
|
+
*/
|
|
2614
|
+
setDependenciesBeforePublish(packageName: string, configuration: RushConfiguration): void;
|
|
2615
|
+
/**
|
|
2616
|
+
* Tells the version policy to modify any dependencies in the target package
|
|
2617
|
+
* to values used for checked-in source.
|
|
2618
|
+
*/
|
|
2619
|
+
setDependenciesBeforeCommit(packageName: string, configuration: RushConfiguration): void;
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
/**
|
|
2623
|
+
* Use this class to load and save the "common/config/rush/version-policies.json" config file.
|
|
2624
|
+
* This config file configures how different groups of projects will be published by Rush,
|
|
2625
|
+
* and how their version numbers will be determined.
|
|
2626
|
+
* @public
|
|
2627
|
+
*/
|
|
2628
|
+
export declare class VersionPolicyConfiguration {
|
|
2629
|
+
private static _jsonSchema;
|
|
2630
|
+
private _versionPolicies;
|
|
2631
|
+
private _jsonFileName;
|
|
2632
|
+
/**
|
|
2633
|
+
* @internal
|
|
2634
|
+
*/
|
|
2635
|
+
constructor(jsonFileName: string);
|
|
2636
|
+
/**
|
|
2637
|
+
* Validate the version policy configuration against the rush config
|
|
2638
|
+
*/
|
|
2639
|
+
validate(projectsByName: Map<string, RushConfigurationProject>): void;
|
|
2640
|
+
/**
|
|
2641
|
+
* Gets the version policy by its name.
|
|
2642
|
+
* Throws error if the version policy is not found.
|
|
2643
|
+
* @param policyName - Name of the version policy
|
|
2644
|
+
*/
|
|
2645
|
+
getVersionPolicy(policyName: string): VersionPolicy;
|
|
2646
|
+
/**
|
|
2647
|
+
* Gets all the version policies
|
|
2648
|
+
*/
|
|
2649
|
+
get versionPolicies(): Map<string, VersionPolicy>;
|
|
2650
|
+
/**
|
|
2651
|
+
* Bumps up versions for the specified version policy or all version policies
|
|
2652
|
+
*
|
|
2653
|
+
* @param versionPolicyName - version policy name
|
|
2654
|
+
* @param bumpType - bump type to override what policy has defined.
|
|
2655
|
+
* @param identifier - prerelease identifier to override what policy has defined.
|
|
2656
|
+
* @param shouldCommit - should save to disk
|
|
2657
|
+
*/
|
|
2658
|
+
bump(versionPolicyName?: string, bumpType?: BumpType, identifier?: string, shouldCommit?: boolean): void;
|
|
2659
|
+
/**
|
|
2660
|
+
* Updates the version directly for the specified version policy
|
|
2661
|
+
* @param versionPolicyName - version policy name
|
|
2662
|
+
* @param newVersion - new version
|
|
2663
|
+
*/
|
|
2664
|
+
update(versionPolicyName: string, newVersion: string): void;
|
|
2665
|
+
private _loadFile;
|
|
2666
|
+
private _saveFile;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
/**
|
|
2670
|
+
* Version policy base type names
|
|
2671
|
+
* @public
|
|
2672
|
+
*/
|
|
2673
|
+
export declare enum VersionPolicyDefinitionName {
|
|
2674
|
+
'lockStepVersion' = 0,
|
|
2675
|
+
'individualVersion' = 1
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
/**
|
|
2679
|
+
* Options that are only used when the yarn package manager is selected.
|
|
2680
|
+
*
|
|
2681
|
+
* @remarks
|
|
2682
|
+
* It is valid to define these options in rush.json even if the yarn package manager
|
|
2683
|
+
* is not being used.
|
|
2684
|
+
*
|
|
2685
|
+
* @public
|
|
2686
|
+
*/
|
|
2687
|
+
export declare class YarnOptionsConfiguration extends PackageManagerOptionsConfigurationBase {
|
|
2688
|
+
/**
|
|
2689
|
+
* If true, then Rush will add the "--ignore-engines" option when invoking Yarn.
|
|
2690
|
+
* This allows "rush install" to succeed if there are dependencies with engines defined in
|
|
2691
|
+
* package.json which do not match the current environment.
|
|
2692
|
+
*
|
|
2693
|
+
* The default value is false.
|
|
2694
|
+
*/
|
|
2695
|
+
readonly ignoreEngines: boolean;
|
|
2696
|
+
/** @internal */
|
|
2697
|
+
constructor(json: _IYarnOptionsJson);
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
export { }
|