Skip to content

Commit ffac747

Browse files
committed
Normalize capitalization of filepath
1 parent 24ceb50 commit ffac747

7 files changed

Lines changed: 28 additions & 28 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/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.

‎core-build/gulp-core-build-sass/src/SassTask.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ export class SassTask extends GulpTask<ISassTaskConfig> {
111111
const checkFilenameForCSSModule: (file: gulpUtil.File) => void = (file: gulpUtil.File) => {
112112
if (!path.basename(file.path).match(/module\.scss$/)) {
113113

114-
const filepath: string = path.relative(this.buildConfig.rootPath, file.path);
115-
this.logWarning(`${filepath}: filename should end with module.scss`);
114+
const filePath: string = path.relative(this.buildConfig.rootPath, file.path);
115+
this.logWarning(`${filePath}: filename should end with module.scss`);
116116
}
117117
};
118118

‎core-build/gulp-core-build-typescript/src/TSLintTask.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class TSLintTask extends GulpTask<ITSLintTaskConfig> {
139139

140140
const lintRulesFile: ITSLintRulesFile = self._loadLintConfiguration();
141141

142-
JsonFile.save(lintRulesFile, this._getTsLintFilepath(), { ensureFolderExists: true });
142+
JsonFile.save(lintRulesFile, this._getTsLintFilePath(), { ensureFolderExists: true });
143143

144144
const cached = require('gulp-cache'); // tslint:disable-line
145145

@@ -243,7 +243,7 @@ export class TSLintTask extends GulpTask<ITSLintTaskConfig> {
243243
}
244244
}
245245

246-
private _getTsLintFilepath(): string {
246+
private _getTsLintFilePath(): string {
247247
return path.join(this.buildConfig.rootPath, this.buildConfig.tempFolder, 'tslint.json');
248248
}
249249

‎core-build/gulp-core-build/src/utilities/FileDeletionUtility.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export class FileDeletionUtility {
1616
}
1717

1818
public static deleteFiles(files: string[]) {
19-
del.sync(this.escapeFilepaths(this.removeChildren(files)));
19+
del.sync(this.escapeFilePaths(this.removeChildren(files)));
2020
}
2121

22-
public static escapeFilepaths(files: string[]): string[] {
22+
public static escapeFilePaths(files: string[]): string[] {
2323
return files.map((file: string) => {
2424
return globEscape(file);
2525
});
@@ -56,13 +56,13 @@ export class FileDeletionUtility {
5656
return filesToDelete;
5757
}
5858

59-
public static isParentDirectory(directory: string | undefined, filepath: string | undefined): boolean {
60-
if (!directory || !filepath) {
59+
public static isParentDirectory(directory: string | undefined, filePath: string | undefined): boolean {
60+
if (!directory || !filePath) {
6161
return false;
6262
}
6363

6464
const directoryParts: string[] = path.resolve(directory).split(path.sep);
65-
const fileParts: string[] = path.resolve(filepath).split(path.sep);
65+
const fileParts: string[] = path.resolve(filePath).split(path.sep);
6666

6767
if (directoryParts[directoryParts.length - 1] === '') {
6868
// this is to fix an issue with windows roots

0 commit comments

Comments
 (0)