Skip to content

Commit

Permalink
Merge pull request #4449 from iclanton/subspace-cleanup
Browse files Browse the repository at this point in the history
[rush] Minor cleanup to SubspaceConfiguration.
  • Loading branch information
iclanton authored Dec 11, 2023
2 parents a1d26d9 + d8c5523 commit 2c3c3b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
11 changes: 11 additions & 0 deletions common/changes/@microsoft/rush/main_2023-12-11-22-19.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "",
"type": "none",
"packageName": "@microsoft/rush"
}
],
"packageName": "@microsoft/rush",
"email": "[email protected]"
}
14 changes: 2 additions & 12 deletions libraries/rush-lib/src/api/SubspaceConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,12 @@ export class SubspaceConfiguration {
*/
public readonly subspaceJsonFilePath: string;

/**
* Gets the JSON data structure for the "subspaces.json" configuration file.
*
* @internal
*/
private readonly _configuration: Readonly<ISubspaceConfigurationJson>;

/**
* A set of the available subspaces
*/
public readonly subspaceNames: Set<string>;

private constructor(configuration: Readonly<ISubspaceConfigurationJson>, subspaceJsonFilePath: string) {
this._configuration = configuration;
this.subspaceJsonFilePath = subspaceJsonFilePath;
this.subspaceNames = new Set();
for (const subspaceName of configuration.subspaceNames) {
Expand Down Expand Up @@ -83,9 +75,7 @@ export class SubspaceConfiguration {
rushConfiguration: RushConfiguration
): SubspaceConfiguration | undefined {
const commonRushConfigFolder: string = rushConfiguration.commonRushConfigFolder;
if (commonRushConfigFolder) {
const subspaceJsonLocation: string = `${commonRushConfigFolder}/${RushConstants.subspacesConfigFilename}`;
return SubspaceConfiguration.tryLoadFromConfigurationFile(subspaceJsonLocation);
}
const subspaceJsonLocation: string = `${commonRushConfigFolder}/${RushConstants.subspacesConfigFilename}`;
return SubspaceConfiguration.tryLoadFromConfigurationFile(subspaceJsonLocation);
}
}

0 comments on commit 2c3c3b2

Please sign in to comment.