Skip to content

Commit dcd5c27

Browse files
authored
Merge pull request microsoft#731 from Microsoft/ianc/last-minute-fixes
[rush] Some final fixes before the release of rush 5.
2 parents 7b1d4b5 + 27f22e5 commit dcd5c27

7 files changed

Lines changed: 37 additions & 12 deletions

File tree

‎apps/rush-lib/src/api/RushConfiguration.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,11 @@ export class RushConfiguration {
208208

209209
public static loadFromDefaultLocation(): RushConfiguration {
210210
const rushJsonLocation: string | undefined = RushConfiguration.tryFindRushJsonLocation();
211+
211212
if (rushJsonLocation) {
212213
return RushConfiguration.loadFromConfigurationFile(rushJsonLocation);
213214
} else {
214-
throw new Error('Unable to find rush.json configuration file');
215+
throw Utilities.getRushConfigNotFoundError();
215216
}
216217
}
217218

‎apps/rush-lib/src/cli/actions/BaseRushAction.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { LockFile } from '@microsoft/node-core-library';
1515
import { RushConfiguration } from '../../api/RushConfiguration';
1616
import { EventHooksManager } from '../../logic/EventHooksManager';
1717
import { RushCommandLineParser } from './../RushCommandLineParser';
18+
import { Utilities } from '../../utilities/Utilities';
1819

1920
export interface IBaseRushActionOptions extends ICommandLineActionOptions {
2021
/**
@@ -61,6 +62,10 @@ export abstract class BaseRushAction extends CommandLineAction {
6162
// -- if it falsely appears to succeed, we could merge bad PRs, publish empty packages, etc.
6263
process.exitCode = 1;
6364

65+
if (!this.rushConfiguration) {
66+
throw Utilities.getRushConfigNotFoundError();
67+
}
68+
6469
this._ensureEnvironment();
6570

6671
if (!this._safeForSimultaneousRushProcesses) {

‎apps/rush-lib/src/logic/SetupChecks.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const MINIMUM_SUPPORTED_NPM_VERSION: string = '4.5.0';
1616

1717
// Refuses to run at all if the PNPM version is older than this, because there
1818
// are known bugs or missing features in earlier releases.
19-
const MINIMUM_SUPPORTED_PNPM_VERSION: string = '2.1.0';
19+
const MINIMUM_SUPPORTED_PNPM_VERSION: string = '2.6.2';
2020

2121
/**
2222
* Validate that the developer's setup is good.

‎apps/rush-lib/src/scripts/install-run-rush.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2-
// See LICENSE in the project root for license information.
2+
// See the @microsoft/rush package's LICENSE file for license information.
33

4-
// THIS FILE WAS GENERATED BY A TOOL. MODIFYING THIS FILE WILL PRODUCE UNEXPECTED BEHAVIOR.
4+
// THIS FILE WAS GENERATED BY A TOOL. ANY MANUAL MODIFICATIONS WILL GET OVERWRITTEN WHENEVER RUSH IS UPGRADED.
55
//
66
// This script is intended for usage in an automated build environment where the Rush command may not have
77
// been preinstalled, or may have an unpredictable version. This script will automatically install the version of Rush
88
// specified in the rush.json configuration file (if not already installed), and then pass a command-line to it.
9-
// An example usage would be: "node common/scripts/install-run-rush.js install"
10-
// For more information, see:
11-
// [https://rushjs.io/pages/maintainer/setup_new_repo/](https://rushjs.io/pages/maintainer/setup_new_repo/)
9+
// An example usage would be:
10+
//
11+
// node common/scripts/install-run-rush.js install
12+
//
13+
// For more information, see: https://rushjs.io/pages/maintainer/setup_new_repo/
1214

1315
import * as path from 'path';
1416
import * as fs from 'fs';

‎apps/rush-lib/src/scripts/install-run.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2-
// See LICENSE in the project root for license information.
2+
// See the @microsoft/rush package's LICENSE file for license information.
33

4-
// THIS FILE WAS GENERATED BY A TOOL. MODIFYING THIS FILE WILL PRODUCE UNEXPECTED BEHAVIOR.
4+
// THIS FILE WAS GENERATED BY A TOOL. ANY MANUAL MODIFICATIONS WILL GET OVERWRITTEN WHENEVER RUSH IS UPGRADED.
55
//
66
// This script is intended for usage in an automated build environment where a Node tool may not have
77
// been preinstalled, or may have an unpredictable version. This script will automatically install the specified
88
// version of the specified tool (if not already installed), and then pass a command-line to it.
9-
// An example usage would be: "node common/scripts/install-run.js rimraf@2.6.2 rimraf -f project1/lib"
10-
// For more information, see:
11-
// [https://rushjs.io/pages/maintainer/setup_new_repo/](https://rushjs.io/pages/maintainer/setup_new_repo/)
9+
// An example usage would be:
10+
//
11+
// node common/scripts/install-run.js rimraf@2.6.2 rimraf -f project1/lib
12+
//
13+
// For more information, see: https://rushjs.io/pages/maintainer/setup_new_repo/
1214

1315
import * as childProcess from 'child_process';
1416
import * as fs from 'fs';

‎apps/rush-lib/src/utilities/Utilities.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ export class Utilities {
513513
}
514514
}
515515

516+
public static getRushConfigNotFoundError(): Error {
517+
return new Error('Unable to find rush.json configuration file');
518+
}
519+
516520
/**
517521
* Returns a process.env environment suitable for executing lifecycle scripts.
518522
* @param initCwd - The INIT_CWD environment variable
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "Update install-run and install-run-rush documentation, bump minimum supported PNPM version, and fix an issue where rush would throw an exception any time it was invoked outside of a rush repo.",
5+
"packageName": "@microsoft/rush",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush",
10+
"email": "iclanton@users.noreply.github.com"
11+
}

0 commit comments

Comments
 (0)