@rushstack/rush-sdk 5.94.1 → 5.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rush-lib.d.ts +8 -0
- package/lib/api/CommandLineConfiguration.d.ts +4 -0
- package/lib/api/ExperimentsConfiguration.d.ts +4 -0
- package/lib/cli/scriptActions/PhasedScriptAction.d.ts +2 -0
- package/lib/pluginFramework/PhasedCommandHooks.d.ts +4 -0
- package/package.json +2 -2
- package/lib-shim/generate-stubs.d.ts +0 -2
- package/lib-shim/generate-stubs.d.ts.map +0 -1
- package/lib-shim/generate-stubs.js +0 -82
- package/lib-shim/generate-stubs.js.map +0 -1
package/dist/rush-lib.d.ts
CHANGED
|
@@ -770,6 +770,10 @@ export declare interface ICreateOperationsContext {
|
|
|
770
770
|
* If true, the command is running in watch mode.
|
|
771
771
|
*/
|
|
772
772
|
readonly isWatch: boolean;
|
|
773
|
+
/**
|
|
774
|
+
* The set of phases original for the current command execution.
|
|
775
|
+
*/
|
|
776
|
+
readonly phaseOriginal: ReadonlySet<IPhase>;
|
|
773
777
|
/**
|
|
774
778
|
* The set of phases selected for the current command execution.
|
|
775
779
|
*/
|
|
@@ -888,6 +892,10 @@ export declare interface IExperimentsJson {
|
|
|
888
892
|
* `.npmrc` file has changed since the last install.
|
|
889
893
|
*/
|
|
890
894
|
cleanInstallAfterNpmrcChanges?: boolean;
|
|
895
|
+
/**
|
|
896
|
+
* If true, print the outputs of shell commands defined in event hooks to the console.
|
|
897
|
+
*/
|
|
898
|
+
printEventHooksOutputToConsole?: boolean;
|
|
891
899
|
}
|
|
892
900
|
|
|
893
901
|
/**
|
|
@@ -64,6 +64,10 @@ export interface IPhasedCommandConfig extends IPhasedCommandWithoutPhasesJson, I
|
|
|
64
64
|
*/
|
|
65
65
|
isSynthetic: boolean;
|
|
66
66
|
disableBuildCache?: boolean;
|
|
67
|
+
originalPhases: Set<IPhase>;
|
|
68
|
+
/**
|
|
69
|
+
* Include upstream and self phases.
|
|
70
|
+
*/
|
|
67
71
|
phases: Set<IPhase>;
|
|
68
72
|
/**
|
|
69
73
|
* If set to `true`, this phased command will always run in watch mode, regardless of CLI flags.
|
|
@@ -40,6 +40,10 @@ export interface IExperimentsJson {
|
|
|
40
40
|
* `.npmrc` file has changed since the last install.
|
|
41
41
|
*/
|
|
42
42
|
cleanInstallAfterNpmrcChanges?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* If true, print the outputs of shell commands defined in event hooks to the console.
|
|
45
|
+
*/
|
|
46
|
+
printEventHooksOutputToConsole?: boolean;
|
|
43
47
|
}
|
|
44
48
|
/**
|
|
45
49
|
* Use this class to load the "common/config/rush/experiments.json" config file.
|
|
@@ -8,6 +8,7 @@ export interface IPhasedScriptActionOptions extends IBaseScriptActionOptions<IPh
|
|
|
8
8
|
enableParallelism: boolean;
|
|
9
9
|
incremental: boolean;
|
|
10
10
|
disableBuildCache: boolean;
|
|
11
|
+
originalPhases: Set<IPhase>;
|
|
11
12
|
initialPhases: Set<IPhase>;
|
|
12
13
|
watchPhases: Set<IPhase>;
|
|
13
14
|
phases: Map<string, IPhase>;
|
|
@@ -29,6 +30,7 @@ export declare class PhasedScriptAction extends BaseScriptAction<IPhasedCommandC
|
|
|
29
30
|
private readonly _enableParallelism;
|
|
30
31
|
private readonly _isIncrementalBuildAllowed;
|
|
31
32
|
private readonly _disableBuildCache;
|
|
33
|
+
private readonly _originalPhases;
|
|
32
34
|
private readonly _initialPhases;
|
|
33
35
|
private readonly _watchPhases;
|
|
34
36
|
private readonly _watchDebounceMs;
|
|
@@ -45,6 +45,10 @@ export interface ICreateOperationsContext {
|
|
|
45
45
|
* If true, the command is running in watch mode.
|
|
46
46
|
*/
|
|
47
47
|
readonly isWatch: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The set of phases original for the current command execution.
|
|
50
|
+
*/
|
|
51
|
+
readonly phaseOriginal: ReadonlySet<IPhase>;
|
|
48
52
|
/**
|
|
49
53
|
* The set of phases selected for the current command execution.
|
|
50
54
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/rush-sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.96.0",
|
|
4
4
|
"description": "An API for interacting with the Rush engine",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@types/heft-jest": "1.0.1",
|
|
21
21
|
"@types/semver": "7.3.5",
|
|
22
22
|
"@types/webpack-env": "1.18.0",
|
|
23
|
-
"@microsoft/rush-lib": "5.
|
|
23
|
+
"@microsoft/rush-lib": "5.96.0",
|
|
24
24
|
"@rushstack/eslint-config": "3.2.0",
|
|
25
25
|
"@rushstack/heft": "0.50.0",
|
|
26
26
|
"@rushstack/heft-node-rig": "1.12.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-stubs.d.ts","sourceRoot":"","sources":["../src/generate-stubs.ts"],"names":[],"mappings":"AAkDA,wBAAgB,GAAG,IAAI,IAAI,CAe1B"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
|
-
// See LICENSE in the project root for license information.
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
-
}) : function(o, v) {
|
|
18
|
-
o["default"] = v;
|
|
19
|
-
});
|
|
20
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
-
if (mod && mod.__esModule) return mod;
|
|
22
|
-
var result = {};
|
|
23
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
-
__setModuleDefault(result, mod);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.run = void 0;
|
|
29
|
-
const path = __importStar(require("path"));
|
|
30
|
-
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
31
|
-
function generateLibFilesRecursively(options) {
|
|
32
|
-
for (const folderItem of node_core_library_1.FileSystem.readFolderItems(options.parentSourcePath)) {
|
|
33
|
-
const sourcePath = path.join(options.parentSourcePath, folderItem.name);
|
|
34
|
-
const targetPath = path.join(options.parentTargetPath, folderItem.name);
|
|
35
|
-
if (folderItem.isDirectory()) {
|
|
36
|
-
// create destination folder
|
|
37
|
-
node_core_library_1.FileSystem.ensureEmptyFolder(targetPath);
|
|
38
|
-
generateLibFilesRecursively({
|
|
39
|
-
parentSourcePath: sourcePath,
|
|
40
|
-
parentTargetPath: targetPath,
|
|
41
|
-
parentSrcImportPathWithSlash: options.parentSrcImportPathWithSlash + folderItem.name + '/',
|
|
42
|
-
libShimIndexPath: options.libShimIndexPath
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
if (folderItem.name.endsWith('.d.ts')) {
|
|
47
|
-
node_core_library_1.FileSystem.copyFile({
|
|
48
|
-
sourcePath: sourcePath,
|
|
49
|
-
destinationPath: targetPath
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
else if (folderItem.name.endsWith('.js')) {
|
|
53
|
-
const srcImportPath = options.parentSrcImportPathWithSlash + path.parse(folderItem.name).name;
|
|
54
|
-
const shimPath = path.relative(options.parentTargetPath, options.libShimIndexPath);
|
|
55
|
-
const shimPathLiteral = JSON.stringify(node_core_library_1.Path.convertToSlashes(shimPath));
|
|
56
|
-
const srcImportPathLiteral = JSON.stringify(srcImportPath);
|
|
57
|
-
node_core_library_1.FileSystem.writeFile(targetPath,
|
|
58
|
-
// Example:
|
|
59
|
-
// module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/policy/GitEmailPolicy");
|
|
60
|
-
`module.exports = require(${shimPathLiteral})._rushSdk_loadInternalModule(${srcImportPathLiteral});`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// Entry point invoked by "runScript" action from config/heft.json
|
|
66
|
-
function run() {
|
|
67
|
-
const rushLibFolder = node_core_library_1.Import.resolvePackage({
|
|
68
|
-
baseFolderPath: __dirname,
|
|
69
|
-
packageName: '@microsoft/rush-lib'
|
|
70
|
-
});
|
|
71
|
-
const stubsTargetPath = path.resolve(__dirname, '../lib');
|
|
72
|
-
console.log('generate-stubs: Generating stub files under: ' + stubsTargetPath);
|
|
73
|
-
generateLibFilesRecursively({
|
|
74
|
-
parentSourcePath: path.join(rushLibFolder, 'lib'),
|
|
75
|
-
parentTargetPath: stubsTargetPath,
|
|
76
|
-
parentSrcImportPathWithSlash: '',
|
|
77
|
-
libShimIndexPath: path.join(__dirname, '../lib-shim/index')
|
|
78
|
-
});
|
|
79
|
-
console.log('generate-stubs: Completed successfully.');
|
|
80
|
-
}
|
|
81
|
-
exports.run = run;
|
|
82
|
-
//# sourceMappingURL=generate-stubs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-stubs.js","sourceRoot":"","sources":["../src/generate-stubs.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;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AAI,CAAC,SAAS,CAAC,wBAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAChF,MAAM,oBAAoB,GAAW,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;gBAEnE,8BAAU,CAAC,SAAS,CAClB,UAAU;gBACV,WAAW;gBACX,kHAAkH;gBAClH,4BAA4B,eAAe,iCAAiC,oBAAoB,IAAI,CACrG,CAAC;aACH;SACF;KACF;AACH,CAAC;AAED,kEAAkE;AAClE,SAAgB,GAAG;IACjB,MAAM,aAAa,GAAW,0BAAM,CAAC,cAAc,CAAC;QAClD,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,qBAAqB;KACnC,CAAC,CAAC;IAEH,MAAM,eAAe,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,+CAA+C,GAAG,eAAe,CAAC,CAAC;IAC/E,2BAA2B,CAAC;QAC1B,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC;QACjD,gBAAgB,EAAE,eAAe;QACjC,4BAA4B,EAAE,EAAE;QAChC,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC;KAC5D,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;AACzD,CAAC;AAfD,kBAeC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\n\nimport { FileSystem, Import, Path } from '@rushstack/node-core-library';\n\nfunction generateLibFilesRecursively(options: {\n parentSourcePath: string;\n parentTargetPath: string;\n parentSrcImportPathWithSlash: string;\n libShimIndexPath: string;\n}): void {\n for (const folderItem of FileSystem.readFolderItems(options.parentSourcePath)) {\n const sourcePath: string = path.join(options.parentSourcePath, folderItem.name);\n const targetPath: string = path.join(options.parentTargetPath, folderItem.name);\n\n if (folderItem.isDirectory()) {\n // create destination folder\n FileSystem.ensureEmptyFolder(targetPath);\n generateLibFilesRecursively({\n parentSourcePath: sourcePath,\n parentTargetPath: targetPath,\n parentSrcImportPathWithSlash: options.parentSrcImportPathWithSlash + folderItem.name + '/',\n libShimIndexPath: options.libShimIndexPath\n });\n } else {\n if (folderItem.name.endsWith('.d.ts')) {\n FileSystem.copyFile({\n sourcePath: sourcePath,\n destinationPath: targetPath\n });\n } else if (folderItem.name.endsWith('.js')) {\n const srcImportPath: string = options.parentSrcImportPathWithSlash + path.parse(folderItem.name).name;\n const shimPath: string = path.relative(options.parentTargetPath, options.libShimIndexPath);\n const shimPathLiteral: string = JSON.stringify(Path.convertToSlashes(shimPath));\n const srcImportPathLiteral: string = JSON.stringify(srcImportPath);\n\n FileSystem.writeFile(\n targetPath,\n // Example:\n // module.exports = require(\"../../../lib-shim/index\")._rushSdk_loadInternalModule(\"logic/policy/GitEmailPolicy\");\n `module.exports = require(${shimPathLiteral})._rushSdk_loadInternalModule(${srcImportPathLiteral});`\n );\n }\n }\n }\n}\n\n// Entry point invoked by \"runScript\" action from config/heft.json\nexport function run(): void {\n const rushLibFolder: string = Import.resolvePackage({\n baseFolderPath: __dirname,\n packageName: '@microsoft/rush-lib'\n });\n\n const stubsTargetPath: string = path.resolve(__dirname, '../lib');\n console.log('generate-stubs: Generating stub files under: ' + stubsTargetPath);\n generateLibFilesRecursively({\n parentSourcePath: path.join(rushLibFolder, 'lib'),\n parentTargetPath: stubsTargetPath,\n parentSrcImportPathWithSlash: '',\n libShimIndexPath: path.join(__dirname, '../lib-shim/index')\n });\n console.log('generate-stubs: Completed successfully.');\n}\n"]}
|