Skip to content

Commit d91d5d8

Browse files
authored
Merge pull request microsoft#780 from Microsoft/pgonzal/filepath
[rush] Fix capitalization of CommonVersionsConfiguration.filePath
2 parents 24ceb50 + c25e181 commit d91d5d8

13 files changed

Lines changed: 75 additions & 31 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class ChangeFile {
6363

6464
/**
6565
* Writes the change file to disk in sync mode.
66-
* Returns the filepath.
66+
* Returns the file path.
6767
* @returns the path to the file that was written (based on generatePath())
6868
*/
6969
public writeSync(): string {

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class CommonVersionsConfiguration {
5656
private static _jsonSchema: JsonSchema = JsonSchema.fromFile(
5757
path.join(__dirname, '../schemas/common-versions.schema.json'));
5858

59-
private _filename: string;
59+
private _filePath: string;
6060
private _preferredVersions: ProtectableMap<string, string>;
6161
private _xstitchPreferredVersions: ProtectableMap<string, string>;
6262
private _allowedAlternativeVersions: ProtectableMap<string, string[]>;
@@ -99,15 +99,15 @@ export class CommonVersionsConfiguration {
9999
/**
100100
* Get the absolute file path of the common-versions.json file.
101101
*/
102-
public get filepath(): string {
103-
return this._filename;
102+
public get filePath(): string {
103+
return this._filePath;
104104
}
105105

106106
/**
107107
* Writes the "common-versions.json" file to disk, using the filename that was passed to loadFromFile().
108108
*/
109109
public save(): void {
110-
JsonFile.save(this._serialize(), this._filename, { updateExistingFile: true });
110+
JsonFile.save(this._serialize(), this._filePath, { updateExistingFile: true });
111111
}
112112

113113
/**
@@ -173,7 +173,7 @@ export class CommonVersionsConfiguration {
173173
return allPreferredVersions;
174174
}
175175

176-
private constructor(commonVersionsJson: ICommonVersionsJson | undefined, filename: string) {
176+
private constructor(commonVersionsJson: ICommonVersionsJson | undefined, filePath: string) {
177177
this._preferredVersions = new ProtectableMap<string, string>(
178178
{ onSet: this._onSetPreferredVersions.bind(this) });
179179

@@ -192,10 +192,10 @@ export class CommonVersionsConfiguration {
192192
CommonVersionsConfiguration._deserializeTable(this.allowedAlternativeVersions,
193193
commonVersionsJson.allowedAlternativeVersions);
194194
} catch (e) {
195-
throw new Error(`Error loading "${path.basename(filename)}": ${e.message}`);
195+
throw new Error(`Error loading "${path.basename(filePath)}": ${e.message}`);
196196
}
197197
}
198-
this._filename = filename;
198+
this._filePath = filePath;
199199
}
200200

201201
private _onSetPreferredVersions(source: ProtectableMap<string, string>, key: string, value: string): string {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const knownRushConfigFilenames: string[] = [
2828
RushConstants.commonVersionsFilename,
2929
RushConstants.browserApprovedPackagesFilename,
3030
RushConstants.nonbrowserApprovedPackagesFilename,
31-
RushConstants.versionPoliciesFileName,
31+
RushConstants.versionPoliciesFilename,
3232
RushConstants.commandLineFilename
3333
];
3434

@@ -772,7 +772,7 @@ export class RushConfiguration {
772772
}
773773

774774
const versionPolicyConfigFile: string =
775-
path.join(this._commonRushConfigFolder, RushConstants.versionPoliciesFileName);
775+
path.join(this._commonRushConfigFolder, RushConstants.versionPoliciesFilename);
776776
this._versionPolicyConfiguration = new VersionPolicyConfiguration(versionPolicyConfigFile);
777777

778778
this._projects = [];

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ export class PackageChangeAnalyzer {
7575
}
7676

7777
// Sort each project folder into its own package deps hash
78-
Object.keys(repoDeps.files).forEach((filepath: string) => {
79-
const fileHash: string = repoDeps.files[filepath];
78+
Object.keys(repoDeps.files).forEach((filePath: string) => {
79+
const fileHash: string = repoDeps.files[filePath];
8080

81-
const projectName: string | undefined = this._getProjectForFile(filepath);
81+
const projectName: string | undefined = this._getProjectForFile(filePath);
8282

8383
// If we found a project for the file, go ahead and store this file's hash
8484
if (projectName) {
85-
projectHashDeps.get(projectName)!.files[filepath] = fileHash;
85+
projectHashDeps.get(projectName)!.files[filePath] = fileHash;
8686
} else {
87-
noProjectHashes[filepath] = fileHash;
87+
noProjectHashes[filePath] = fileHash;
8888
}
8989
});
9090

@@ -123,9 +123,9 @@ export class PackageChangeAnalyzer {
123123

124124
// Add the "NO_PROJECT" files to every project's dependencies
125125
// for (const project of PackageChangeAnalyzer.rushConfig.projects) {
126-
// Object.keys(noProjectHashes).forEach((filepath: string) => {
127-
// const fileHash: string = noProjectHashes[filepath];
128-
// projectHashDeps.get(project.packageName).files[filepath] = fileHash;
126+
// Object.keys(noProjectHashes).forEach((filePath: string) => {
127+
// const fileHash: string = noProjectHashes[filePath];
128+
// projectHashDeps.get(project.packageName).files[filePath] = fileHash;
129129
// });
130130
// }
131131

@@ -145,9 +145,9 @@ export class PackageChangeAnalyzer {
145145
return projectHashDeps;
146146
}
147147

148-
private _getProjectForFile(filepath: string): string | undefined {
148+
private _getProjectForFile(filePath: string): string | undefined {
149149
for (const project of this._rushConfiguration.projects) {
150-
if (this._fileExistsInFolder(filepath, project.projectRelativeFolder)) {
150+
if (this._fileExistsInFolder(filePath, project.projectRelativeFolder)) {
151151
return project.packageName;
152152
}
153153
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export namespace RushConstants {
110110
/**
111111
* @beta
112112
*/
113-
export const versionPoliciesFileName: string = 'version-policies.json';
113+
export const versionPoliciesFilename: string = 'version-policies.json';
114114

115115
/**
116116
* The URL ("http://rushjs.io") for the Rush web site.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"packageName": "@microsoft/gulp-core-build-sass",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build-sass",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"packageName": "@microsoft/gulp-core-build-typescript",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build-typescript",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"packageName": "@microsoft/gulp-core-build",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "Fix capitalization of new \"filePath\" API property",
5+
"packageName": "@microsoft/rush",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}

‎common/reviews/api/rush-lib.api.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ChangeManager {
6464
// @public
6565
class CommonVersionsConfiguration {
6666
readonly allowedAlternativeVersions: Map<string, ReadonlyArray<string>>;
67-
readonly filepath: string;
67+
readonly filePath: string;
6868
getAllPreferredVersions(): Map<string, string>;
6969
static loadFromFile(jsonFilename: string): CommonVersionsConfiguration;
7070
readonly preferredVersions: Map<string, string>;

0 commit comments

Comments
 (0)