Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichon-msft committed Feb 17, 2023
1 parent dacf936 commit 1625aa3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Add code path to @rushstack/rush-sdk for using the @microsoft/rush-lib version from a parent process.",
"comment": "Add code path to @rushstack/rush-sdk for inheriting @microsoft/rush-lib location from a parent process via the RUSH_LIB_PATH environment variable.",
"type": "none"
}
],
Expand Down
2 changes: 1 addition & 1 deletion libraries/rush-lib/src/api/EnvironmentConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export enum EnvironmentVariableNames {
RUSH_TAR_BINARY_PATH = 'RUSH_TAR_BINARY_PATH',

/**
* Explicitly specifies the path for the version of `\@microsoft/rush-lib` being executed.
* Explicitly specifies the path for the version of `@microsoft/rush-lib` being executed.
* Will be set upon loading Rush.
*/
RUSH_LIB_PATH = 'RUSH_LIB_PATH',
Expand Down
2 changes: 1 addition & 1 deletion libraries/rush-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The **@rushstack/rush-sdk** package acts as a lightweight proxy for accessing th

2. When authoring unit tests for a Rush plugin, developers should add **@microsoft/rush-lib** to their **package.json** `devDependencies`. In this context, **@rushstack/rush-sdk** will resolve to that instance for testing purposes.

3. For projects within a monorepo that use **@rushstack/rush-sdk** during their build process, child processes will use the version of Rush that invoked them.
3. For projects within a monorepo that use **@rushstack/rush-sdk** during their build process, child processes will inherit the installation of Rush that invoked them. This is communicated using the `RUSH_LIB_PATH` environment variable.

4. For scripts and tools that are designed to be used in a Rush monorepo, in the future **@rushstack/rush-sdk** will automatically invoke **install-run-rush.js** and load the local installation. This ensures that tools load a compatible version of the Rush engine for the given branch. Once this is implemented, **@rushstack/rush-sdk** can replace **@microsoft/rush-lib** entirely as the official API interface, with the latter serving as the underlying implementation.

Expand Down
3 changes: 2 additions & 1 deletion libraries/rush-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ if (rushLibModule === undefined) {
try {
rushLibModule = _require(rushLibPath);
} catch (error) {
terminal.writeVerboseLine(`Filed to load ${RUSH_LIB_NAME} via process.env.${rushLibVariable}`);
// Log this as a warning, since it is unexpected to define an incorrect value of the variable.
terminal.writeWarningLine(`Failed to load ${RUSH_LIB_NAME} via process.env.${rushLibVariable}`);
}

if (rushLibModule !== undefined) {
Expand Down

0 comments on commit 1625aa3

Please sign in to comment.