Skip to content

Commit

Permalink
Bug fixes and update CommandLineHelp snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
william2958 committed Dec 19, 2023
1 parent 563d02c commit 82196b3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 49 deletions.
6 changes: 3 additions & 3 deletions common/reviews/api/rush-lib.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,14 @@ export interface _ILastInstallFlagJson {
// (undocumented)
[key: string]: unknown;
ignoreScripts?: true;
node: string;
nodeVersion: string;
packageJson?: IPackageJson;
packageManager: PackageManagerName;
packageManagerVersion: string;
rushJsonFolder: string;
selectedProjectNames?: string[];
storePath?: string;
workspaces?: true;
useWorkspaces?: true;
}

// @public
Expand Down Expand Up @@ -1104,7 +1104,7 @@ export class RushConfiguration {
getRepoState(variant?: string | undefined): RepoStateFile;
getRepoStateFilePath(variant?: string | undefined): string;
// @beta
getSubspaceTempFolder(subspaceName: string): string;
getSubspaceTempFolderPath(subspaceName: string): string;
// @beta
getTempSubspaceShrinkwrapFileName(subspaceName: string): string;
readonly gitAllowedEmailRegExps: string[];
Expand Down
2 changes: 1 addition & 1 deletion libraries/rush-lib/src/api/LastInstallFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,6 @@ export class LastInstallFlagFactory {
}
}

return new LastInstallFlag(rushConfiguration.getSubspaceTempFolder(subspace), currentState);
return new LastInstallFlag(rushConfiguration.getSubspaceTempFolderPath(subspace), currentState);
}
}
1 change: 0 additions & 1 deletion libraries/rush-lib/src/api/base/BaseFlag.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

import * as path from 'path';
import { FileSystem, JsonFile, type JsonObject } from '@rushstack/node-core-library';

import { isMatch, merge } from '../../utilities/objectUtilities';
Expand Down
12 changes: 0 additions & 12 deletions libraries/rush-lib/src/cli/actions/InstallAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { SelectionParameterSet } from '../parsing/SelectionParameterSet';

export class InstallAction extends BaseInstallAction {
private readonly _checkOnlyParameter!: CommandLineFlagParameter;
private _ignoreScriptsParameter!: CommandLineFlagParameter;

public constructor(parser: RushCommandLineParser) {
super({
Expand Down Expand Up @@ -43,17 +42,6 @@ export class InstallAction extends BaseInstallAction {
parameterLongName: '--check-only',
description: `Only check the validity of the shrinkwrap file without performing an install.`
});

this._ignoreScriptsParameter = this.defineFlagParameter({
parameterLongName: '--ignore-scripts',
description:
'Do not execute any install lifecycle scripts specified in package.json files and its' +
' dependencies when "rush install". Running with this flag may leave your installation in an incomplete' +
' state, you need to run without this flag again to complete a full installation. Meanwhile, it makes' +
' your installing faster. Later, you can run "rush install" to run all ignored scripts. Moreover, you' +
' can partial install such as "rush install --to <package>" to run ignored scripts of the dependencies' +
' of the selected projects.'
});
}

protected async buildInstallOptionsAsync(): Promise<IInstallManagerOptions> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,11 @@ exports[`CommandLineHelp prints the help for each action: install 1`] = `
"usage: rush install [-h] [-p] [--bypass-policy] [--no-link]
[--network-concurrency COUNT] [--debug-package-manager]
[--max-install-attempts NUMBER] [--ignore-hooks]
[--offline] [--variant VARIANT] [-t PROJECT] [-T PROJECT]
[-f PROJECT] [-o PROJECT] [-i PROJECT] [-I PROJECT]
[--offline] [--ignore-scripts] [--variant VARIANT]
[-t PROJECT] [-T PROJECT] [-f PROJECT] [-o PROJECT]
[-i PROJECT] [-I PROJECT]
[--to-version-policy VERSION_POLICY_NAME]
[--from-version-policy VERSION_POLICY_NAME] [--check-only]
[--ignore-scripts]
The \\"rush install\\" command installs package dependencies for all your
Expand Down Expand Up @@ -626,6 +626,16 @@ Optional arguments:
necessary NPM packages cannot be obtained from the
local cache. For details, see the documentation for
PNPM's \\"--offline\\" parameter.
--ignore-scripts Do not execute any install lifecycle scripts
specified in package.json files and its dependencies
when \\"rush update\\". Running with this flag leaves
your installation in a uncompleted state, you need to
run this command without this flag again or run \\"rush
install\\" to complete a full installation. Meanwhile,
it makes faster retries on running install lifecycle
scripts. You can partial install such as \\"rush
install --to <package>\\" to run the ignored scripts of
the dependencies of the selected projects.
--variant VARIANT Run command using a variant installation
configuration. This parameter may alternatively be
specified via the RUSH_VARIANT environment variable.
Expand Down Expand Up @@ -708,16 +718,6 @@ Optional arguments:
subsets of projects\\".
--check-only Only check the validity of the shrinkwrap file
without performing an install.
--ignore-scripts Do not execute any install lifecycle scripts
specified in package.json files and its dependencies
when \\"rush install\\". Running with this flag leaves
your installation in a uncompleted state, you need to
run without this flag again to complete a full
installation. Meanwhile, it makes your installing
faster. Later, you can run \\"rush install\\" to run all
ignored scripts. Moreover, you can partial install
such as \\"rush install --to <package>\\" to run ignored
scripts of the dependencies of the selected projects.
"
`;
Expand Down Expand Up @@ -1161,8 +1161,8 @@ exports[`CommandLineHelp prints the help for each action: update 1`] = `
"usage: rush update [-h] [-p] [--bypass-policy] [--no-link]
[--network-concurrency COUNT] [--debug-package-manager]
[--max-install-attempts NUMBER] [--ignore-hooks]
[--offline] [--variant VARIANT] [--full] [--recheck]
[--ignore-scripts]
[--offline] [--ignore-scripts] [--variant VARIANT] [--full]
[--recheck]
The \\"rush update\\" command installs the dependencies described in your package.
Expand Down Expand Up @@ -1207,6 +1207,16 @@ Optional arguments:
necessary NPM packages cannot be obtained from the
local cache. For details, see the documentation for
PNPM's \\"--offline\\" parameter.
--ignore-scripts Do not execute any install lifecycle scripts
specified in package.json files and its dependencies
when \\"rush update\\". Running with this flag leaves
your installation in a uncompleted state, you need to
run this command without this flag again or run \\"rush
install\\" to complete a full installation. Meanwhile,
it makes faster retries on running install lifecycle
scripts. You can partial install such as \\"rush
install --to <package>\\" to run the ignored scripts of
the dependencies of the selected projects.
--variant VARIANT Run command using a variant installation
configuration. This parameter may alternatively be
specified via the RUSH_VARIANT environment variable.
Expand All @@ -1229,16 +1239,6 @@ Optional arguments:
your shrinkwrap file with Rush's fixups. (To minimize
shrinkwrap churn, these fixups are normally performed
only in the temporary folder.)
--ignore-scripts Do not execute any install lifecycle scripts
specified in package.json files and its dependencies
when \\"rush update\\". Running with this flag leaves
your installation in a uncompleted state, you need to
run this command without this flag again or run \\"rush
install\\" to complete a full installation. Meanwhile,
it makes faster retries on running install lifecycle
scripts. You can partial install such as \\"rush
install --to <package>\\" to run the ignored scripts of
the dependencies of the selected projects.
"
`;
Expand Down
10 changes: 3 additions & 7 deletions libraries/rush-lib/src/utilities/objectUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,10 @@ function cloneDeepInner<TObject>(obj: TObject, seenObjects: Set<unknown>): TObje
* determine if `obj` contains equivalent property values.
*/
export function isMatch<TObject>(obj: TObject, source: TObject): boolean {
if (obj === source) {
return true;
}

if (typeof obj !== typeof source) {
return false;
}
return obj === source || (typeof obj === typeof source && isMatchInner(obj, source));
}

function isMatchInner<TObject>(obj: TObject, source: TObject): boolean {
let sourceKeys: (string | number)[] | undefined;
if (typeof source === 'object' && source !== null && !Array.isArray(source)) {
sourceKeys = Object.keys(source);
Expand Down

0 comments on commit 82196b3

Please sign in to comment.