@rushstack/rush-sdk 5.107.3 → 5.107.4
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/tsdoc-metadata.json +1 -1
- package/lib/api/ApprovedPackagesPolicy.d.ts +1 -1
- package/lib/api/BuildCacheConfiguration.d.ts +4 -4
- package/lib/api/ChangeFile.d.ts +2 -2
- package/lib/api/ChangeManager.d.ts +1 -1
- package/lib/api/CobuildConfiguration.d.ts +2 -2
- package/lib/api/CustomTipsConfiguration.d.ts +1 -1
- package/lib/api/EnvironmentConfiguration.d.ts +1 -1
- package/lib/api/EventHooks.d.ts +1 -1
- package/lib/api/LastInstallFlag.d.ts +2 -2
- package/lib/api/LastLinkFlag.d.ts +1 -1
- package/lib/api/PackageJsonEditor.d.ts +1 -1
- package/lib/api/Rush.d.ts +2 -2
- package/lib/api/RushConfiguration.d.ts +7 -7
- package/lib/api/RushConfigurationProject.d.ts +3 -3
- package/lib/api/RushProjectConfiguration.d.ts +1 -1
- package/lib/api/SaveCallbackPackageJsonEditor.d.ts +1 -1
- package/lib/api/Variants.d.ts +1 -1
- package/lib/api/VersionPolicy.d.ts +3 -3
- package/lib/api/VersionPolicyConfiguration.d.ts +2 -2
- package/lib/cli/RushCommandLineParser.d.ts +1 -1
- package/lib/cli/RushPnpmCommandLine.d.ts +1 -1
- package/lib/cli/RushPnpmCommandLineParser.d.ts +1 -1
- package/lib/cli/actions/AddAction.d.ts +1 -1
- package/lib/cli/actions/BaseAddAndRemoveAction.d.ts +1 -1
- package/lib/cli/actions/BaseInstallAction.d.ts +3 -3
- package/lib/cli/actions/BaseRushAction.d.ts +4 -4
- package/lib/cli/actions/ChangeAction.d.ts +1 -1
- package/lib/cli/actions/CheckAction.d.ts +1 -1
- package/lib/cli/actions/InitAction.d.ts +1 -1
- package/lib/cli/actions/InitAutoinstallerAction.d.ts +1 -1
- package/lib/cli/actions/InitDeployAction.d.ts +1 -1
- package/lib/cli/actions/InstallAction.d.ts +1 -1
- package/lib/cli/actions/LinkAction.d.ts +1 -1
- package/lib/cli/actions/ListAction.d.ts +1 -1
- package/lib/cli/actions/PublishAction.d.ts +1 -1
- package/lib/cli/actions/PurgeAction.d.ts +1 -1
- package/lib/cli/actions/RemoveAction.d.ts +1 -1
- package/lib/cli/actions/ScanAction.d.ts +1 -1
- package/lib/cli/actions/SetupAction.d.ts +1 -1
- package/lib/cli/actions/UnlinkAction.d.ts +1 -1
- package/lib/cli/actions/UpdateAction.d.ts +1 -1
- package/lib/cli/actions/UpdateAutoinstallerAction.d.ts +1 -1
- package/lib/cli/actions/UpdateCloudCredentialsAction.d.ts +1 -1
- package/lib/cli/actions/UpgradeInteractiveAction.d.ts +1 -1
- package/lib/cli/actions/VersionAction.d.ts +1 -1
- package/lib/cli/parsing/SelectionParameterSet.d.ts +5 -5
- package/lib/cli/scriptActions/BaseScriptAction.d.ts +3 -3
- package/lib/cli/scriptActions/GlobalScriptAction.d.ts +1 -1
- package/lib/cli/scriptActions/PhasedScriptAction.d.ts +1 -1
- package/lib/logic/Autoinstaller.d.ts +1 -1
- package/lib/logic/ChangeFiles.d.ts +2 -2
- package/lib/logic/ChangeManager.d.ts +5 -5
- package/lib/logic/ChangelogGenerator.d.ts +5 -5
- package/lib/logic/DependencyAnalyzer.d.ts +2 -2
- package/lib/logic/EventHooksManager.d.ts +1 -1
- package/lib/logic/Git.d.ts +3 -3
- package/lib/logic/ProjectChangeAnalyzer.d.ts +3 -3
- package/lib/logic/ProjectCommandSet.d.ts +1 -1
- package/lib/logic/PublishGit.d.ts +2 -2
- package/lib/logic/PurgeManager.d.ts +2 -2
- package/lib/logic/RepoStateFile.d.ts +1 -1
- package/lib/logic/SetupChecks.d.ts +1 -1
- package/lib/logic/ShrinkwrapFileFactory.d.ts +3 -3
- package/lib/logic/StandardScriptUpdater.d.ts +1 -1
- package/lib/logic/Telemetry.d.ts +2 -2
- package/lib/logic/UnlinkManager.d.ts +1 -1
- package/lib/logic/base/BaseProjectShrinkwrapFile.d.ts +2 -2
- package/lib/logic/base/BaseShrinkwrapFile.d.ts +7 -7
- package/lib/logic/buildCache/FileSystemBuildCacheProvider.d.ts +3 -3
- package/lib/logic/buildCache/ICloudBuildCacheProvider.d.ts +1 -1
- package/lib/logic/buildCache/ProjectBuildCache.d.ts +4 -4
- package/lib/logic/installManager/InstallHelpers.d.ts +2 -2
- package/lib/logic/npm/NpmOptionsConfiguration.d.ts +1 -1
- package/lib/logic/npm/NpmShrinkwrapFile.d.ts +2 -2
- package/lib/logic/operations/AsyncOperationQueue.d.ts +1 -1
- package/lib/logic/operations/CacheableOperationPlugin.d.ts +3 -3
- package/lib/logic/operations/Operation.d.ts +3 -3
- package/lib/logic/operations/OperationExecutionManager.d.ts +3 -3
- package/lib/logic/operations/OperationExecutionRecord.d.ts +3 -3
- package/lib/logic/operations/OperationMetadataManager.d.ts +1 -1
- package/lib/logic/operations/OperationResultSummarizerPlugin.d.ts +3 -3
- package/lib/logic/operations/ProjectLogWritable.d.ts +3 -3
- package/lib/logic/operations/ShellOperationRunner.d.ts +1 -1
- package/lib/logic/pnpm/PnpmOptionsConfiguration.d.ts +1 -1
- package/lib/logic/pnpm/PnpmProjectShrinkwrapFile.d.ts +1 -1
- package/lib/logic/pnpm/PnpmShrinkwrapFile.d.ts +5 -5
- package/lib/logic/pnpm/PnpmfileConfiguration.d.ts +2 -2
- package/lib/logic/selectors/GitChangedProjectSelectorParser.d.ts +1 -1
- package/lib/logic/setup/SetupPackageRegistry.d.ts +1 -1
- package/lib/logic/versionMismatch/VersionMismatchFinder.d.ts +3 -3
- package/lib/logic/versionMismatch/VersionMismatchFinderCommonVersions.d.ts +1 -1
- package/lib/logic/versionMismatch/VersionMismatchFinderEntity.d.ts +1 -1
- package/lib/logic/versionMismatch/VersionMismatchFinderProject.d.ts +2 -2
- package/lib/logic/yarn/YarnOptionsConfiguration.d.ts +1 -1
- package/lib/logic/yarn/YarnShrinkwrapFile.d.ts +3 -3
- package/lib/pluginFramework/PhasedCommandHooks.d.ts +1 -1
- package/lib/pluginFramework/PluginLoader/AutoinstallerPluginLoader.d.ts +3 -3
- package/lib/pluginFramework/PluginLoader/BuiltInPluginLoader.d.ts +2 -2
- package/lib/pluginFramework/PluginLoader/PluginLoaderBase.d.ts +4 -4
- package/lib/pluginFramework/PluginManager.d.ts +6 -6
- package/lib/pluginFramework/RushSession.d.ts +2 -2
- package/lib/pluginFramework/logging/Logger.d.ts +1 -1
- package/lib/utilities/CollatedTerminalProvider.d.ts +2 -2
- package/lib/utilities/TarExecutable.d.ts +2 -2
- package/lib/utilities/Utilities.d.ts +1 -1
- package/lib-shim/index.d.ts.map +1 -1
- package/lib-shim/index.js +4 -2
- package/lib-shim/index.js.map +1 -1
- package/lib-shim/loader.d.ts.map +1 -1
- package/lib-shim/loader.js +3 -2
- package/lib-shim/loader.js.map +1 -1
- package/package.json +7 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PackageManagerName } from '../api/packageManager/PackageManager';
|
|
2
|
-
import { PackageManagerOptionsConfigurationBase } from './base/BasePackageManagerOptionsConfiguration';
|
|
3
|
-
import { BaseShrinkwrapFile } from './base/BaseShrinkwrapFile';
|
|
1
|
+
import type { PackageManagerName } from '../api/packageManager/PackageManager';
|
|
2
|
+
import type { PackageManagerOptionsConfigurationBase } from './base/BasePackageManagerOptionsConfiguration';
|
|
3
|
+
import type { BaseShrinkwrapFile } from './base/BaseShrinkwrapFile';
|
|
4
4
|
export declare class ShrinkwrapFileFactory {
|
|
5
5
|
static getShrinkwrapFile(packageManager: PackageManagerName, packageManagerOptions: PackageManagerOptionsConfigurationBase, shrinkwrapFilename: string): BaseShrinkwrapFile | undefined;
|
|
6
6
|
static parseShrinkwrapFile(packageManager: PackageManagerName, packageManagerOptions: PackageManagerOptionsConfigurationBase, shrinkwrapContent: string): BaseShrinkwrapFile | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RushConfiguration } from '../api/RushConfiguration';
|
|
1
|
+
import type { RushConfiguration } from '../api/RushConfiguration';
|
|
2
2
|
/**
|
|
3
3
|
* Checks whether the common/scripts files are up to date, and recopies them if needed.
|
|
4
4
|
* This is used by the "rush install" and "rush update" commands.
|
package/lib/logic/Telemetry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RushConfiguration } from '../api/RushConfiguration';
|
|
2
|
-
import { RushSession } from '../pluginFramework/RushSession';
|
|
1
|
+
import type { RushConfiguration } from '../api/RushConfiguration';
|
|
2
|
+
import type { RushSession } from '../pluginFramework/RushSession';
|
|
3
3
|
/**
|
|
4
4
|
* @beta
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
2
|
-
import { BaseShrinkwrapFile } from './BaseShrinkwrapFile';
|
|
1
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
2
|
+
import type { BaseShrinkwrapFile } from './BaseShrinkwrapFile';
|
|
3
3
|
/**
|
|
4
4
|
* This class handles creating the project/.rush/temp/shrinkwrap-deps.json file
|
|
5
5
|
* which tracks the direct and indirect dependencies that a project consumes. This is used
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { DependencySpecifier } from '../DependencySpecifier';
|
|
2
|
-
import { IShrinkwrapFilePolicyValidatorOptions } from '../policy/ShrinkwrapFilePolicy';
|
|
3
|
-
import { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
|
-
import { IExperimentsJson } from '../../api/ExperimentsConfiguration';
|
|
5
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
6
|
-
import { BaseProjectShrinkwrapFile } from './BaseProjectShrinkwrapFile';
|
|
7
|
-
import { PackageManagerOptionsConfigurationBase } from './BasePackageManagerOptionsConfiguration';
|
|
1
|
+
import { type DependencySpecifier } from '../DependencySpecifier';
|
|
2
|
+
import type { IShrinkwrapFilePolicyValidatorOptions } from '../policy/ShrinkwrapFilePolicy';
|
|
3
|
+
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
|
+
import type { IExperimentsJson } from '../../api/ExperimentsConfiguration';
|
|
5
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
6
|
+
import type { BaseProjectShrinkwrapFile } from './BaseProjectShrinkwrapFile';
|
|
7
|
+
import type { PackageManagerOptionsConfigurationBase } from './BasePackageManagerOptionsConfiguration';
|
|
8
8
|
/**
|
|
9
9
|
* This class is a parser for both npm's npm-shrinkwrap.json and pnpm's pnpm-lock.yaml file formats.
|
|
10
10
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { ITerminal } from '@rushstack/node-core-library';
|
|
3
|
-
import { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
|
-
import { RushUserConfiguration } from '../../api/RushUserConfiguration';
|
|
2
|
+
import { type ITerminal } from '@rushstack/node-core-library';
|
|
3
|
+
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
|
+
import type { RushUserConfiguration } from '../../api/RushUserConfiguration';
|
|
5
5
|
/**
|
|
6
6
|
* Options for creating a file system build cache provider.
|
|
7
7
|
* @beta
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
3
|
-
import { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer';
|
|
4
|
-
import { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration';
|
|
1
|
+
import { type ITerminal } from '@rushstack/node-core-library';
|
|
2
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
3
|
+
import type { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer';
|
|
4
|
+
import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration';
|
|
5
5
|
export interface IProjectBuildCacheOptions {
|
|
6
6
|
buildCacheConfiguration: BuildCacheConfiguration;
|
|
7
7
|
project: RushConfigurationProject;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { RushConfiguration } from '../../api/RushConfiguration';
|
|
3
|
-
import { RushGlobalFolder } from '../../api/RushGlobalFolder';
|
|
2
|
+
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
3
|
+
import type { RushGlobalFolder } from '../../api/RushGlobalFolder';
|
|
4
4
|
export declare class InstallHelpers {
|
|
5
5
|
static generateCommonPackageJson(rushConfiguration: RushConfiguration, dependencies?: Map<string, string>): void;
|
|
6
6
|
static getPackageManagerEnvironment(rushConfiguration: RushConfiguration, options?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPackageManagerOptionsJsonBase, PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
|
|
1
|
+
import { type IPackageManagerOptionsJsonBase, PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
|
|
2
2
|
/**
|
|
3
3
|
* Part of IRushConfigurationJson.
|
|
4
4
|
* @internal
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseShrinkwrapFile } from '../base/BaseShrinkwrapFile';
|
|
2
2
|
import { DependencySpecifier } from '../DependencySpecifier';
|
|
3
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
4
|
-
import { BaseProjectShrinkwrapFile } from '../base/BaseProjectShrinkwrapFile';
|
|
3
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
4
|
+
import type { BaseProjectShrinkwrapFile } from '../base/BaseProjectShrinkwrapFile';
|
|
5
5
|
export declare class NpmShrinkwrapFile extends BaseShrinkwrapFile {
|
|
6
6
|
readonly isWorkspaceCompatible: boolean;
|
|
7
7
|
private _shrinkwrapJson;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OperationExecutionRecord } from './OperationExecutionRecord';
|
|
1
|
+
import type { OperationExecutionRecord } from './OperationExecutionRecord';
|
|
2
2
|
/**
|
|
3
3
|
* When the queue returns an unassigned operation, it means there is at least one remote executing operation,
|
|
4
4
|
* at this time, the caller has a chance to make a decision:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ITerminal } from '@rushstack/node-core-library';
|
|
1
|
+
import { type ITerminal } from '@rushstack/node-core-library';
|
|
2
2
|
import { CobuildLock } from '../cobuild/CobuildLock';
|
|
3
3
|
import { ProjectBuildCache } from '../buildCache/ProjectBuildCache';
|
|
4
|
-
import { IOperationSettings } from '../../api/RushProjectConfiguration';
|
|
4
|
+
import type { IOperationSettings } from '../../api/RushProjectConfiguration';
|
|
5
5
|
import { ProjectLogWritable } from './ProjectLogWritable';
|
|
6
|
-
import { CobuildConfiguration } from '../../api/CobuildConfiguration';
|
|
6
|
+
import type { CobuildConfiguration } from '../../api/CobuildConfiguration';
|
|
7
7
|
import { PeriodicCallback } from './PeriodicCallback';
|
|
8
8
|
import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
|
|
9
9
|
import type { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
2
|
-
import { IPhase } from '../../api/CommandLineConfiguration';
|
|
3
|
-
import { IOperationRunner } from './IOperationRunner';
|
|
1
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
2
|
+
import type { IPhase } from '../../api/CommandLineConfiguration';
|
|
3
|
+
import type { IOperationRunner } from './IOperationRunner';
|
|
4
4
|
/**
|
|
5
5
|
* Options for constructing a new Operation.
|
|
6
6
|
* @alpha
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TerminalWritable } from '@rushstack/terminal';
|
|
2
|
-
import { Operation } from './Operation';
|
|
1
|
+
import { type TerminalWritable } from '@rushstack/terminal';
|
|
2
|
+
import type { Operation } from './Operation';
|
|
3
3
|
import { OperationStatus } from './OperationStatus';
|
|
4
4
|
import { OperationExecutionRecord } from './OperationExecutionRecord';
|
|
5
|
-
import { IExecutionResult } from './IOperationExecutionResult';
|
|
5
|
+
import type { IExecutionResult } from './IOperationExecutionResult';
|
|
6
6
|
export interface IOperationExecutionManagerOptions {
|
|
7
7
|
quietMode: boolean;
|
|
8
8
|
debugMode: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StdioSummarizer } from '@rushstack/terminal';
|
|
2
|
-
import { CollatedWriter, StreamCollator } from '@rushstack/stream-collator';
|
|
2
|
+
import type { CollatedWriter, StreamCollator } from '@rushstack/stream-collator';
|
|
3
3
|
import { OperationStatus } from './OperationStatus';
|
|
4
|
-
import { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
|
|
5
|
-
import { Operation } from './Operation';
|
|
4
|
+
import type { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
|
|
5
|
+
import type { Operation } from './Operation';
|
|
6
6
|
import { Stopwatch } from '../../utilities/Stopwatch';
|
|
7
7
|
import { OperationMetadataManager } from './OperationMetadataManager';
|
|
8
8
|
import type { IPhase } from '../../api/CommandLineConfiguration';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITerminal } from '@rushstack/node-core-library';
|
|
1
|
+
import { type ITerminal } from '@rushstack/node-core-library';
|
|
2
2
|
import { OperationStateFile } from './OperationStateFile';
|
|
3
3
|
import type { IPhase } from '../../api/CommandLineConfiguration';
|
|
4
4
|
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
|
-
import { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
|
|
3
|
-
import { IExecutionResult } from './IOperationExecutionResult';
|
|
1
|
+
import { type ITerminal } from '@rushstack/node-core-library';
|
|
2
|
+
import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
|
|
3
|
+
import type { IExecutionResult } from './IOperationExecutionResult';
|
|
4
4
|
/**
|
|
5
5
|
* Phased command plugin that emits a summary of build results to the console.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TerminalWritable, ITerminalChunk } from '@rushstack/terminal';
|
|
2
|
-
import { CollatedTerminal } from '@rushstack/stream-collator';
|
|
3
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
1
|
+
import { TerminalWritable, type ITerminalChunk } from '@rushstack/terminal';
|
|
2
|
+
import type { CollatedTerminal } from '@rushstack/stream-collator';
|
|
3
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
4
4
|
export declare class ProjectLogWritable extends TerminalWritable {
|
|
5
5
|
private readonly _project;
|
|
6
6
|
private readonly _terminal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OperationStatus } from './OperationStatus';
|
|
2
|
-
import { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
|
|
2
|
+
import type { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
|
|
3
3
|
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
4
|
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
5
5
|
import type { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPackageManagerOptionsJsonBase, PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
|
|
1
|
+
import { type IPackageManagerOptionsJsonBase, PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
|
|
2
2
|
/**
|
|
3
3
|
* This represents the available PNPM store options
|
|
4
4
|
* @public
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BaseShrinkwrapFile } from '../base/BaseShrinkwrapFile';
|
|
2
2
|
import { DependencySpecifier } from '../DependencySpecifier';
|
|
3
|
-
import { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
|
-
import { IShrinkwrapFilePolicyValidatorOptions } from '../policy/ShrinkwrapFilePolicy';
|
|
5
|
-
import { IExperimentsJson } from '../../api/ExperimentsConfiguration';
|
|
6
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
3
|
+
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
|
+
import type { IShrinkwrapFilePolicyValidatorOptions } from '../policy/ShrinkwrapFilePolicy';
|
|
5
|
+
import type { IExperimentsJson } from '../../api/ExperimentsConfiguration';
|
|
6
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
7
7
|
import { PnpmProjectShrinkwrapFile } from './PnpmProjectShrinkwrapFile';
|
|
8
|
-
import { PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
|
|
8
|
+
import type { PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
|
|
9
9
|
export interface IPeerDependenciesMetaYaml {
|
|
10
10
|
optional?: boolean;
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IPackageJson } from '@rushstack/node-core-library';
|
|
2
|
-
import { RushConfiguration } from '../../api/RushConfiguration';
|
|
1
|
+
import { type IPackageJson } from '@rushstack/node-core-library';
|
|
2
|
+
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
3
3
|
/**
|
|
4
4
|
* Options used when generating the pnpmfile shim settings file.
|
|
5
5
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
2
2
|
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
3
|
-
import { IEvaluateSelectorOptions, ISelectorParser } from './ISelectorParser';
|
|
3
|
+
import type { IEvaluateSelectorOptions, ISelectorParser } from './ISelectorParser';
|
|
4
4
|
export interface IGitSelectorParserOptions {
|
|
5
5
|
/**
|
|
6
6
|
* If set to `true`, consider a project's external dependency installation layout as defined in the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
|
-
import { RushConfiguration } from '../../api/RushConfiguration';
|
|
3
|
-
import { VersionMismatchFinderEntity } from './VersionMismatchFinderEntity';
|
|
1
|
+
import { type ITerminal } from '@rushstack/node-core-library';
|
|
2
|
+
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
3
|
+
import type { VersionMismatchFinderEntity } from './VersionMismatchFinderEntity';
|
|
4
4
|
export interface IVersionMismatchFinderOptions {
|
|
5
5
|
variant?: string | undefined;
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PackageJsonDependency, DependencyType } from '../../api/PackageJsonEditor';
|
|
2
|
-
import { CommonVersionsConfiguration } from '../../api/CommonVersionsConfiguration';
|
|
2
|
+
import type { CommonVersionsConfiguration } from '../../api/CommonVersionsConfiguration';
|
|
3
3
|
import { VersionMismatchFinderEntity } from './VersionMismatchFinderEntity';
|
|
4
4
|
export declare class VersionMismatchFinderCommonVersions extends VersionMismatchFinderEntity {
|
|
5
5
|
private _fileManager;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PackageJsonDependency, DependencyType } from '../../api/PackageJsonEditor';
|
|
1
|
+
import type { PackageJsonDependency, DependencyType } from '../../api/PackageJsonEditor';
|
|
2
2
|
export interface IVersionMismatchFinderEntityOptions {
|
|
3
3
|
friendlyName: string;
|
|
4
4
|
decoupledLocalDependencies: Set<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VersionMismatchFinderEntity } from './VersionMismatchFinderEntity';
|
|
2
|
-
import { PackageJsonDependency, DependencyType } from '../../api/PackageJsonEditor';
|
|
3
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
2
|
+
import type { PackageJsonDependency, DependencyType } from '../../api/PackageJsonEditor';
|
|
3
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
4
4
|
export declare class VersionMismatchFinderProject extends VersionMismatchFinderEntity {
|
|
5
5
|
packageName: string;
|
|
6
6
|
private _fileManager;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPackageManagerOptionsJsonBase, PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
|
|
1
|
+
import { type IPackageManagerOptionsJsonBase, PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
|
|
2
2
|
/**
|
|
3
3
|
* Part of IRushConfigurationJson.
|
|
4
4
|
* @internal
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseShrinkwrapFile } from '../base/BaseShrinkwrapFile';
|
|
2
|
-
import { DependencySpecifier } from '../DependencySpecifier';
|
|
3
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
4
|
-
import { BaseProjectShrinkwrapFile } from '../base/BaseProjectShrinkwrapFile';
|
|
2
|
+
import type { DependencySpecifier } from '../DependencySpecifier';
|
|
3
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
4
|
+
import type { BaseProjectShrinkwrapFile } from '../base/BaseProjectShrinkwrapFile';
|
|
5
5
|
/**
|
|
6
6
|
* Support for consuming the "yarn.lock" file.
|
|
7
7
|
*
|
|
@@ -8,7 +8,7 @@ import type { Operation } from '../logic/operations/Operation';
|
|
|
8
8
|
import type { ProjectChangeAnalyzer } from '../logic/ProjectChangeAnalyzer';
|
|
9
9
|
import type { IExecutionResult, IOperationExecutionResult } from '../logic/operations/IOperationExecutionResult';
|
|
10
10
|
import type { CobuildConfiguration } from '../api/CobuildConfiguration';
|
|
11
|
-
import { RushProjectConfiguration } from '../api/RushProjectConfiguration';
|
|
11
|
+
import type { RushProjectConfiguration } from '../api/RushProjectConfiguration';
|
|
12
12
|
import type { IOperationRunnerContext } from '../logic/operations/IOperationRunner';
|
|
13
13
|
import type { ITelemetryData } from '../logic/Telemetry';
|
|
14
14
|
import type { OperationStatus } from '../logic/operations/OperationStatus';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { JsonObject } from '@rushstack/node-core-library';
|
|
2
|
-
import { IRushPluginConfiguration } from '../../api/RushPluginsConfiguration';
|
|
1
|
+
import { type JsonObject } from '@rushstack/node-core-library';
|
|
2
|
+
import type { IRushPluginConfiguration } from '../../api/RushPluginsConfiguration';
|
|
3
3
|
import { Autoinstaller } from '../../logic/Autoinstaller';
|
|
4
|
-
import { IPluginLoaderOptions, PluginLoaderBase } from './PluginLoaderBase';
|
|
4
|
+
import { type IPluginLoaderOptions, PluginLoaderBase } from './PluginLoaderBase';
|
|
5
5
|
import type { RushGlobalFolder } from '../../api/RushGlobalFolder';
|
|
6
6
|
interface IAutoinstallerPluginLoaderOptions extends IPluginLoaderOptions<IRushPluginConfiguration> {
|
|
7
7
|
restrictConsoleOutput: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IRushPluginConfigurationBase } from '../../api/RushPluginsConfiguration';
|
|
2
|
-
import { IPluginLoaderOptions, PluginLoaderBase } from './PluginLoaderBase';
|
|
1
|
+
import type { IRushPluginConfigurationBase } from '../../api/RushPluginsConfiguration';
|
|
2
|
+
import { type IPluginLoaderOptions, PluginLoaderBase } from './PluginLoaderBase';
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ITerminal, JsonObject, JsonSchema } from '@rushstack/node-core-library';
|
|
1
|
+
import { type ITerminal, type JsonObject, JsonSchema } from '@rushstack/node-core-library';
|
|
2
2
|
import { CommandLineConfiguration } from '../../api/CommandLineConfiguration';
|
|
3
|
-
import { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
|
-
import { IRushPluginConfigurationBase } from '../../api/RushPluginsConfiguration';
|
|
5
|
-
import { IRushPlugin } from '../IRushPlugin';
|
|
3
|
+
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
|
+
import type { IRushPluginConfigurationBase } from '../../api/RushPluginsConfiguration';
|
|
5
|
+
import type { IRushPlugin } from '../IRushPlugin';
|
|
6
6
|
export interface IRushPluginManifest {
|
|
7
7
|
pluginName: string;
|
|
8
8
|
description: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
|
-
import { CommandLineConfiguration } from '../api/CommandLineConfiguration';
|
|
3
|
-
import { RushConfiguration } from '../api/RushConfiguration';
|
|
4
|
-
import { IBuiltInPluginConfiguration } from './PluginLoader/BuiltInPluginLoader';
|
|
1
|
+
import { type ITerminal } from '@rushstack/node-core-library';
|
|
2
|
+
import type { CommandLineConfiguration } from '../api/CommandLineConfiguration';
|
|
3
|
+
import type { RushConfiguration } from '../api/RushConfiguration';
|
|
4
|
+
import { type IBuiltInPluginConfiguration } from './PluginLoader/BuiltInPluginLoader';
|
|
5
5
|
import { AutoinstallerPluginLoader } from './PluginLoader/AutoinstallerPluginLoader';
|
|
6
|
-
import { RushSession } from './RushSession';
|
|
7
|
-
import { PluginLoaderBase } from './PluginLoader/PluginLoaderBase';
|
|
6
|
+
import type { RushSession } from './RushSession';
|
|
7
|
+
import type { PluginLoaderBase } from './PluginLoader/PluginLoaderBase';
|
|
8
8
|
import type { RushGlobalFolder } from '../api/RushGlobalFolder';
|
|
9
9
|
export interface IPluginManagerOptions {
|
|
10
10
|
terminal: ITerminal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ITerminalProvider } from '@rushstack/node-core-library';
|
|
2
|
-
import { ILogger } from './logging/Logger';
|
|
1
|
+
import { type ITerminalProvider } from '@rushstack/node-core-library';
|
|
2
|
+
import { type ILogger } from './logging/Logger';
|
|
3
3
|
import { RushLifecycleHooks } from './RushLifeCycle';
|
|
4
4
|
import type { IBuildCacheJson } from '../api/BuildCacheConfiguration';
|
|
5
5
|
import type { ICloudBuildCacheProvider } from '../logic/buildCache/ICloudBuildCacheProvider';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ITerminalProvider, TerminalProviderSeverity } from '@rushstack/node-core-library';
|
|
2
|
-
import { CollatedTerminal } from '@rushstack/stream-collator';
|
|
1
|
+
import { type ITerminalProvider, TerminalProviderSeverity } from '@rushstack/node-core-library';
|
|
2
|
+
import type { CollatedTerminal } from '@rushstack/stream-collator';
|
|
3
3
|
export interface ICollatedTerminalProviderOptions {
|
|
4
4
|
debugEnabled: boolean;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
|
-
import { RushConfigurationProject } from '../api/RushConfigurationProject';
|
|
1
|
+
import { type ITerminal } from '@rushstack/node-core-library';
|
|
2
|
+
import type { RushConfigurationProject } from '../api/RushConfigurationProject';
|
|
3
3
|
export interface ITarOptionsBase {
|
|
4
4
|
logFilePath: string;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import * as child_process from 'child_process';
|
|
3
|
-
import { RushConfiguration } from '../api/RushConfiguration';
|
|
3
|
+
import type { RushConfiguration } from '../api/RushConfiguration';
|
|
4
4
|
import { syncNpmrc } from './npmrcUtilities';
|
|
5
5
|
export type UNINITIALIZED = 'UNINITIALIZED';
|
|
6
6
|
export declare const UNINITIALIZED: UNINITIALIZED;
|
package/lib-shim/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA+MA;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAO1E"}
|
package/lib-shim/index.js
CHANGED
|
@@ -115,7 +115,7 @@ if (helpers_1.sdkContext.rushLibModule === undefined) {
|
|
|
115
115
|
terminal.writeVerboseLine(`Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush`);
|
|
116
116
|
helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);
|
|
117
117
|
}
|
|
118
|
-
catch (
|
|
118
|
+
catch (e1) {
|
|
119
119
|
let installAndRunRushStderrContent = '';
|
|
120
120
|
try {
|
|
121
121
|
const installAndRunRushJSPath = path.join(monorepoRoot, 'common/scripts/install-run-rush.js');
|
|
@@ -131,7 +131,8 @@ if (helpers_1.sdkContext.rushLibModule === undefined) {
|
|
|
131
131
|
terminal.writeVerboseLine(`Trying to load ${helpers_1.RUSH_LIB_NAME} installed by install-run-rush a second time`);
|
|
132
132
|
helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);
|
|
133
133
|
}
|
|
134
|
-
catch (
|
|
134
|
+
catch (e2) {
|
|
135
|
+
// eslint-disable-next-line no-console
|
|
135
136
|
console.error(`${installAndRunRushStderrContent}`);
|
|
136
137
|
throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to load`);
|
|
137
138
|
}
|
|
@@ -151,6 +152,7 @@ if (helpers_1.sdkContext.rushLibModule === undefined) {
|
|
|
151
152
|
// This error indicates that a project is trying to import "@rushstack/rush-sdk", but the Rush engine
|
|
152
153
|
// instance cannot be found. If you are writing Jest tests for a Rush plugin, add "@microsoft/rush-lib"
|
|
153
154
|
// to the devDependencies for your project.
|
|
155
|
+
// eslint-disable-next-line no-console
|
|
154
156
|
console.error(`Error: The @rushstack/rush-sdk package was not able to load the Rush engine:
|
|
155
157
|
${errorMessage}
|
|
156
158
|
`);
|
package/lib-shim/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,oEAQsC;AAEtC,uCAQmB;AAEnB,MA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EG;AACH,SAAgB,2BAA2B,CAAC,aAAqB;IAC/D,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,gBAAgB,OAAO,CAAC,IAAI,CAAC,OAAO,qDAAqD,CAC1F,CAAC;KACH;IACD,OAAO,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAC1D,CAAC;AAPD,kEAOC","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';\nimport {\n JsonFile,\n JsonObject,\n IPackageJson,\n PackageJsonLookup,\n Executable,\n Terminal,\n ConsoleTerminalProvider\n} from '@rushstack/node-core-library';\nimport type { SpawnSyncReturns } from 'child_process';\nimport {\n RUSH_LIB_NAME,\n RUSH_LIB_PATH_ENV_VAR_NAME,\n RushLibModuleType,\n _require,\n requireRushLibUnderFolderPath,\n tryFindRushJsonLocation,\n sdkContext\n} from './helpers';\n\nconst verboseEnabled: boolean = typeof process !== 'undefined' && process.env.RUSH_SDK_DEBUG === '1';\nconst terminal: Terminal = new Terminal(\n new ConsoleTerminalProvider({\n verboseEnabled\n })\n);\n\ndeclare const global: typeof globalThis & {\n ___rush___rushLibModule?: RushLibModuleType;\n ___rush___rushLibModuleFromEnvironment?: RushLibModuleType;\n ___rush___rushLibModuleFromInstallAndRunRush?: RushLibModuleType;\n};\n\nlet errorMessage: string = '';\n\n// SCENARIO 1: Rush's PluginManager has initialized \"rush-sdk\" with Rush's own instance of rush-lib.\n// The Rush host process will assign \"global.___rush___rushLibModule\" before loading the plugin.\nif (sdkContext.rushLibModule === undefined) {\n sdkContext.rushLibModule =\n global.___rush___rushLibModule ||\n global.___rush___rushLibModuleFromEnvironment ||\n global.___rush___rushLibModuleFromInstallAndRunRush;\n}\n\n// SCENARIO 2: The project importing \"rush-sdk\" has installed its own instance of \"rush-lib\"\n// as a package.json dependency. For example, this is used by the Jest tests for Rush plugins.\nif (sdkContext.rushLibModule === undefined) {\n const importingPath: string | null | undefined = module?.parent?.filename;\n if (importingPath) {\n const callerPackageFolder: string | undefined =\n PackageJsonLookup.instance.tryGetPackageFolderFor(importingPath);\n\n if (callerPackageFolder !== undefined) {\n const callerPackageJson: IPackageJson = _require(path.join(callerPackageFolder, 'package.json'));\n\n // Does the caller properly declare a dependency on rush-lib?\n if (\n (callerPackageJson.dependencies && callerPackageJson.dependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.devDependencies &&\n callerPackageJson.devDependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.peerDependencies &&\n callerPackageJson.peerDependencies[RUSH_LIB_NAME] !== undefined)\n ) {\n // Try to resolve rush-lib from the caller's folder\n terminal.writeVerboseLine(`Try to load ${RUSH_LIB_NAME} from caller package`);\n try {\n sdkContext.rushLibModule = requireRushLibUnderFolderPath(callerPackageFolder);\n } catch (error) {\n // If we fail to resolve it, ignore the error\n terminal.writeVerboseLine(`Failed to load ${RUSH_LIB_NAME} from caller package`);\n }\n\n // If two different libraries invoke `rush-sdk`, and one of them provides \"rush-lib\"\n // then the first version to be loaded wins. We do not support side-by-side instances of \"rush-lib\".\n if (sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModule = sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from caller`);\n }\n }\n }\n }\n}\n\n// SCENARIO 3: A tool or script has been invoked as a child process by an instance of \"rush-lib\" and can use the\n// version that invoked it. In this case, use process.env._RUSH_LIB_PATH to find \"rush-lib\".\nif (sdkContext.rushLibModule === undefined) {\n const rushLibPath: string | undefined = process.env[RUSH_LIB_PATH_ENV_VAR_NAME];\n if (rushLibPath) {\n terminal.writeVerboseLine(\n `Try to load ${RUSH_LIB_NAME} from process.env.${RUSH_LIB_PATH_ENV_VAR_NAME} from caller package`\n );\n try {\n sdkContext.rushLibModule = _require(rushLibPath);\n } catch (error) {\n // Log this as a warning, since it is unexpected to define an incorrect value of the variable.\n terminal.writeWarningLine(\n `Failed to load ${RUSH_LIB_NAME} via process.env.${RUSH_LIB_PATH_ENV_VAR_NAME}`\n );\n }\n\n if (sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromEnvironment = sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from process.env.${RUSH_LIB_PATH_ENV_VAR_NAME}`);\n }\n }\n}\n\n// SCENARIO 4: A standalone tool or script depends on \"rush-sdk\", and is meant to be used inside a monorepo folder.\n// In this case, we can use install-run-rush.js to obtain the appropriate rush-lib version for the monorepo.\nif (sdkContext.rushLibModule === undefined) {\n try {\n const rushJsonPath: string | undefined = tryFindRushJsonLocation(process.cwd());\n if (!rushJsonPath) {\n throw new Error(\n 'Unable to find rush.json in the current folder or its parent folders.\\n' +\n 'This tool is meant to be invoked from a working directory inside a Rush repository.'\n );\n }\n const monorepoRoot: string = path.dirname(rushJsonPath);\n\n const rushJson: JsonObject = JsonFile.load(rushJsonPath);\n const { rushVersion } = rushJson;\n\n const installRunNodeModuleFolder: string = path.join(\n monorepoRoot,\n `common/temp/install-run/@microsoft+rush@${rushVersion}`\n );\n\n try {\n // First, try to load the version of \"rush-lib\" that was installed by install-run-rush.js\n terminal.writeVerboseLine(`Trying to load ${RUSH_LIB_NAME} installed by install-run-rush`);\n sdkContext.rushLibModule = requireRushLibUnderFolderPath(installRunNodeModuleFolder);\n } catch (e) {\n let installAndRunRushStderrContent: string = '';\n try {\n const installAndRunRushJSPath: string = path.join(monorepoRoot, 'common/scripts/install-run-rush.js');\n\n terminal.writeLine('The Rush engine has not been installed yet. Invoking install-run-rush.js...');\n\n const installAndRunRushProcess: SpawnSyncReturns<string> = Executable.spawnSync(\n 'node',\n [installAndRunRushJSPath, '--help'],\n {\n stdio: 'pipe'\n }\n );\n\n installAndRunRushStderrContent = installAndRunRushProcess.stderr;\n if (installAndRunRushProcess.status !== 0) {\n throw new Error(`The ${RUSH_LIB_NAME} package failed to install`);\n }\n\n // Retry to load \"rush-lib\" after install-run-rush run\n terminal.writeVerboseLine(\n `Trying to load ${RUSH_LIB_NAME} installed by install-run-rush a second time`\n );\n sdkContext.rushLibModule = requireRushLibUnderFolderPath(installRunNodeModuleFolder);\n } catch (e) {\n console.error(`${installAndRunRushStderrContent}`);\n throw new Error(`The ${RUSH_LIB_NAME} package failed to load`);\n }\n }\n\n if (sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromInstallAndRunRush = sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} installed by install-run-rush`);\n }\n } catch (e) {\n // no-catch\n errorMessage = (e as Error).message;\n }\n}\n\nif (sdkContext.rushLibModule === undefined) {\n // This error indicates that a project is trying to import \"@rushstack/rush-sdk\", but the Rush engine\n // instance cannot be found. If you are writing Jest tests for a Rush plugin, add \"@microsoft/rush-lib\"\n // to the devDependencies for your project.\n console.error(`Error: The @rushstack/rush-sdk package was not able to load the Rush engine:\n${errorMessage}\n`);\n process.exit(1);\n}\n\n// Based on TypeScript's __exportStar()\nfor (const property in sdkContext.rushLibModule) {\n if (property !== 'default' && !exports.hasOwnProperty(property)) {\n const rushLibModuleForClosure: RushLibModuleType = sdkContext.rushLibModule;\n\n // Based on TypeScript's __createBinding()\n Object.defineProperty(exports, property, {\n enumerable: true,\n get: function () {\n return rushLibModuleForClosure[property];\n }\n });\n }\n}\n\n/**\n * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs.\n */\nexport function _rushSdk_loadInternalModule(srcImportPath: string): unknown {\n if (!exports._RushInternals) {\n throw new Error(\n `Rush version ${exports.Rush.version} does not support internal API imports via rush-sdk`\n );\n }\n return exports._RushInternals.loadModule(srcImportPath);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4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AE;YACvC,UAAU,EAAE,IAAI;YAChB,GAAG,EAAE;gBACH,OAAO,uBAAuB,CAAC,QAAQ,CAAC,CAAC;YAC3C,CAAC;SACF,CAAC,CAAC;KACJ;CACF;AAED;;GAEG;AACH,SAAgB,2BAA2B,CAAC,aAAqB;IAC/D,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,gBAAgB,OAAO,CAAC,IAAI,CAAC,OAAO,qDAAqD,CAC1F,CAAC;KACH;IACD,OAAO,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAC1D,CAAC;AAPD,kEAOC","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';\nimport {\n JsonFile,\n type JsonObject,\n type IPackageJson,\n PackageJsonLookup,\n Executable,\n Terminal,\n ConsoleTerminalProvider\n} from '@rushstack/node-core-library';\nimport type { SpawnSyncReturns } from 'child_process';\nimport {\n RUSH_LIB_NAME,\n RUSH_LIB_PATH_ENV_VAR_NAME,\n type RushLibModuleType,\n _require,\n requireRushLibUnderFolderPath,\n tryFindRushJsonLocation,\n sdkContext\n} from './helpers';\n\nconst verboseEnabled: boolean = typeof process !== 'undefined' && process.env.RUSH_SDK_DEBUG === '1';\nconst terminal: Terminal = new Terminal(\n new ConsoleTerminalProvider({\n verboseEnabled\n })\n);\n\ndeclare const global: typeof globalThis & {\n ___rush___rushLibModule?: RushLibModuleType;\n ___rush___rushLibModuleFromEnvironment?: RushLibModuleType;\n ___rush___rushLibModuleFromInstallAndRunRush?: RushLibModuleType;\n};\n\nlet errorMessage: string = '';\n\n// SCENARIO 1: Rush's PluginManager has initialized \"rush-sdk\" with Rush's own instance of rush-lib.\n// The Rush host process will assign \"global.___rush___rushLibModule\" before loading the plugin.\nif (sdkContext.rushLibModule === undefined) {\n sdkContext.rushLibModule =\n global.___rush___rushLibModule ||\n global.___rush___rushLibModuleFromEnvironment ||\n global.___rush___rushLibModuleFromInstallAndRunRush;\n}\n\n// SCENARIO 2: The project importing \"rush-sdk\" has installed its own instance of \"rush-lib\"\n// as a package.json dependency. For example, this is used by the Jest tests for Rush plugins.\nif (sdkContext.rushLibModule === undefined) {\n const importingPath: string | null | undefined = module?.parent?.filename;\n if (importingPath) {\n const callerPackageFolder: string | undefined =\n PackageJsonLookup.instance.tryGetPackageFolderFor(importingPath);\n\n if (callerPackageFolder !== undefined) {\n const callerPackageJson: IPackageJson = _require(path.join(callerPackageFolder, 'package.json'));\n\n // Does the caller properly declare a dependency on rush-lib?\n if (\n (callerPackageJson.dependencies && callerPackageJson.dependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.devDependencies &&\n callerPackageJson.devDependencies[RUSH_LIB_NAME] !== undefined) ||\n (callerPackageJson.peerDependencies &&\n callerPackageJson.peerDependencies[RUSH_LIB_NAME] !== undefined)\n ) {\n // Try to resolve rush-lib from the caller's folder\n terminal.writeVerboseLine(`Try to load ${RUSH_LIB_NAME} from caller package`);\n try {\n sdkContext.rushLibModule = requireRushLibUnderFolderPath(callerPackageFolder);\n } catch (error) {\n // If we fail to resolve it, ignore the error\n terminal.writeVerboseLine(`Failed to load ${RUSH_LIB_NAME} from caller package`);\n }\n\n // If two different libraries invoke `rush-sdk`, and one of them provides \"rush-lib\"\n // then the first version to be loaded wins. We do not support side-by-side instances of \"rush-lib\".\n if (sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModule = sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from caller`);\n }\n }\n }\n }\n}\n\n// SCENARIO 3: A tool or script has been invoked as a child process by an instance of \"rush-lib\" and can use the\n// version that invoked it. In this case, use process.env._RUSH_LIB_PATH to find \"rush-lib\".\nif (sdkContext.rushLibModule === undefined) {\n const rushLibPath: string | undefined = process.env[RUSH_LIB_PATH_ENV_VAR_NAME];\n if (rushLibPath) {\n terminal.writeVerboseLine(\n `Try to load ${RUSH_LIB_NAME} from process.env.${RUSH_LIB_PATH_ENV_VAR_NAME} from caller package`\n );\n try {\n sdkContext.rushLibModule = _require(rushLibPath);\n } catch (error) {\n // Log this as a warning, since it is unexpected to define an incorrect value of the variable.\n terminal.writeWarningLine(\n `Failed to load ${RUSH_LIB_NAME} via process.env.${RUSH_LIB_PATH_ENV_VAR_NAME}`\n );\n }\n\n if (sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromEnvironment = sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} from process.env.${RUSH_LIB_PATH_ENV_VAR_NAME}`);\n }\n }\n}\n\n// SCENARIO 4: A standalone tool or script depends on \"rush-sdk\", and is meant to be used inside a monorepo folder.\n// In this case, we can use install-run-rush.js to obtain the appropriate rush-lib version for the monorepo.\nif (sdkContext.rushLibModule === undefined) {\n try {\n const rushJsonPath: string | undefined = tryFindRushJsonLocation(process.cwd());\n if (!rushJsonPath) {\n throw new Error(\n 'Unable to find rush.json in the current folder or its parent folders.\\n' +\n 'This tool is meant to be invoked from a working directory inside a Rush repository.'\n );\n }\n const monorepoRoot: string = path.dirname(rushJsonPath);\n\n const rushJson: JsonObject = JsonFile.load(rushJsonPath);\n const { rushVersion } = rushJson;\n\n const installRunNodeModuleFolder: string = path.join(\n monorepoRoot,\n `common/temp/install-run/@microsoft+rush@${rushVersion}`\n );\n\n try {\n // First, try to load the version of \"rush-lib\" that was installed by install-run-rush.js\n terminal.writeVerboseLine(`Trying to load ${RUSH_LIB_NAME} installed by install-run-rush`);\n sdkContext.rushLibModule = requireRushLibUnderFolderPath(installRunNodeModuleFolder);\n } catch (e1) {\n let installAndRunRushStderrContent: string = '';\n try {\n const installAndRunRushJSPath: string = path.join(monorepoRoot, 'common/scripts/install-run-rush.js');\n\n terminal.writeLine('The Rush engine has not been installed yet. Invoking install-run-rush.js...');\n\n const installAndRunRushProcess: SpawnSyncReturns<string> = Executable.spawnSync(\n 'node',\n [installAndRunRushJSPath, '--help'],\n {\n stdio: 'pipe'\n }\n );\n\n installAndRunRushStderrContent = installAndRunRushProcess.stderr;\n if (installAndRunRushProcess.status !== 0) {\n throw new Error(`The ${RUSH_LIB_NAME} package failed to install`);\n }\n\n // Retry to load \"rush-lib\" after install-run-rush run\n terminal.writeVerboseLine(\n `Trying to load ${RUSH_LIB_NAME} installed by install-run-rush a second time`\n );\n sdkContext.rushLibModule = requireRushLibUnderFolderPath(installRunNodeModuleFolder);\n } catch (e2) {\n // eslint-disable-next-line no-console\n console.error(`${installAndRunRushStderrContent}`);\n throw new Error(`The ${RUSH_LIB_NAME} package failed to load`);\n }\n }\n\n if (sdkContext.rushLibModule !== undefined) {\n // to track which scenario is active and how it got initialized.\n global.___rush___rushLibModuleFromInstallAndRunRush = sdkContext.rushLibModule;\n terminal.writeVerboseLine(`Loaded ${RUSH_LIB_NAME} installed by install-run-rush`);\n }\n } catch (e) {\n // no-catch\n errorMessage = (e as Error).message;\n }\n}\n\nif (sdkContext.rushLibModule === undefined) {\n // This error indicates that a project is trying to import \"@rushstack/rush-sdk\", but the Rush engine\n // instance cannot be found. If you are writing Jest tests for a Rush plugin, add \"@microsoft/rush-lib\"\n // to the devDependencies for your project.\n // eslint-disable-next-line no-console\n console.error(`Error: The @rushstack/rush-sdk package was not able to load the Rush engine:\n${errorMessage}\n`);\n process.exit(1);\n}\n\n// Based on TypeScript's __exportStar()\nfor (const property in sdkContext.rushLibModule) {\n if (property !== 'default' && !exports.hasOwnProperty(property)) {\n const rushLibModuleForClosure: RushLibModuleType = sdkContext.rushLibModule;\n\n // Based on TypeScript's __createBinding()\n Object.defineProperty(exports, property, {\n enumerable: true,\n get: function () {\n return rushLibModuleForClosure[property];\n }\n });\n }\n}\n\n/**\n * Used by the .js stubs for path-based imports of `@microsoft/rush-lib` internal APIs.\n */\nexport function _rushSdk_loadInternalModule(srcImportPath: string): unknown {\n if (!exports._RushInternals) {\n throw new Error(\n `Rush version ${exports.Rush.version} does not support internal API imports via rush-sdk`\n );\n }\n return exports._RushInternals.loadModule(srcImportPath);\n}\n"]}
|
package/lib-shim/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAqBA;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,UAAU,EAAE,8BAA8B,GAAG,SAAS,CAAC;IAEvD;;;;;;;;OAQG;IACH,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;CACxC;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAwB9B;;OAEG;IACH,WAAkB,QAAQ,IAAI,OAAO,CAEpC;IAED;;;;;;;OAOG;WACiB,SAAS,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";AAqBA;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,UAAU,EAAE,8BAA8B,GAAG,SAAS,CAAC;IAEvD;;;;;;;;OAQG;IACH,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;CACxC;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAwB9B;;OAEG;IACH,WAAkB,QAAQ,IAAI,OAAO,CAEpC;IAED;;;;;;;OAOG;WACiB,SAAS,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAkJ7E"}
|
package/lib-shim/loader.js
CHANGED
|
@@ -114,7 +114,7 @@ class RushSdkLoader {
|
|
|
114
114
|
}
|
|
115
115
|
helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);
|
|
116
116
|
}
|
|
117
|
-
catch (
|
|
117
|
+
catch (e1) {
|
|
118
118
|
let installAndRunRushStderrContent = '';
|
|
119
119
|
try {
|
|
120
120
|
const installAndRunRushJSPath = path.join(monorepoRoot, 'common/scripts/install-run-rush.js');
|
|
@@ -154,7 +154,8 @@ class RushSdkLoader {
|
|
|
154
154
|
helpers_1.sdkContext.rushLibModule = (0, helpers_1.requireRushLibUnderFolderPath)(installRunNodeModuleFolder);
|
|
155
155
|
progressPercent = 100;
|
|
156
156
|
}
|
|
157
|
-
catch (
|
|
157
|
+
catch (e2) {
|
|
158
|
+
// eslint-disable-next-line no-console
|
|
158
159
|
console.error(`${installAndRunRushStderrContent}`);
|
|
159
160
|
throw new Error(`The ${helpers_1.RUSH_LIB_NAME} package failed to load`);
|
|
160
161
|
}
|