Skip to content

Commit

Permalink
Automated linting update and features.json sync
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 20, 2023
1 parent 4e0b709 commit 5e8317e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/studio-plugin/src/orchestrators/ParsingOrchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export default class ParsingOrchestrator {
/** This tree contains a root for each Component File. */
private dependencyTreesObject: Record<string, Tree> = {};


/** All paths are assumed to be absolute. */
constructor(
private project: Project,
Expand Down Expand Up @@ -115,7 +114,7 @@ export default class ParsingOrchestrator {
}

if (filepath.startsWith(this.paths.components)) {
const componentDepTreeRoot = this.getComponentDepTreeRoot(filepath)
const componentDepTreeRoot = this.getComponentDepTreeRoot(filepath);
if (componentDepTreeRoot) {
delete this.dependencyTreesObject[componentDepTreeRoot];
}
Expand Down Expand Up @@ -203,7 +202,7 @@ export default class ParsingOrchestrator {

if (absPath.startsWith(this.paths.components)) {
this.updateDependencyTrees(absPath);
const componentDepTreeRoot = this.getComponentDepTreeRoot(absPath)
const componentDepTreeRoot = this.getComponentDepTreeRoot(absPath);
if (!componentDepTreeRoot) {
throw new Error(`Could not find dependency tree for ${absPath}`);
}
Expand Down Expand Up @@ -231,21 +230,23 @@ export default class ParsingOrchestrator {
directory: upath.dirname(absPath),
visited: this.dependencyTreesObject,
});
this.dependencyTreesObject = Object.assign(this.dependencyTreesObject, newDepTree);
this.dependencyTreesObject = Object.assign(
this.dependencyTreesObject,
newDepTree
);
}

/**
* Given a Unix filepath, this function finds the corresponding
* dependency tree root. This is important since the paths within
* Given a Unix filepath, this function finds the corresponding
* dependency tree root. This is important since the paths within
* the dependency tree may be either Unix or Windows.
*/
private getComponentDepTreeRoot(unixFilepath: string){
private getComponentDepTreeRoot(unixFilepath: string) {
return Object.keys(this.dependencyTreesObject).find(
(path) => upath.toUnix(path) === unixFilepath
);
}


private initPageNameToPageFile(): Record<string, PageFile> {
if (!fs.existsSync(this.paths.pages)) {
throw new Error(
Expand Down

0 comments on commit 5e8317e

Please sign in to comment.