-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(graph-utl): converts to esm (#788)
- Loading branch information
Showing
38 changed files
with
149 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
src/graph-utl/consolidate-to-folder.js → src/graph-utl/consolidate-to-folder.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
const path = require("node:path"); | ||
const consolidateModules = require("./consolidate-modules"); | ||
const consolidateModuleDependencies = require("./consolidate-module-dependencies"); | ||
import { dirname } from "node:path"; | ||
import consolidateModules from "./consolidate-modules.mjs"; | ||
import consolidateModuleDependencies from "./consolidate-module-dependencies.mjs"; | ||
|
||
function squashDependencyToDirectory(pDependency) { | ||
return { | ||
...pDependency, | ||
resolved: path.dirname(pDependency.resolved), | ||
resolved: dirname(pDependency.resolved), | ||
}; | ||
} | ||
function squashModuleToDirectory(pModule) { | ||
return { | ||
...pModule, | ||
source: path.dirname(pModule.source), | ||
source: dirname(pModule.source), | ||
consolidated: true, | ||
dependencies: pModule.dependencies.map(squashDependencyToDirectory), | ||
}; | ||
} | ||
|
||
module.exports = function consolidateToFolder(pModules) { | ||
export default function consolidateToFolder(pModules) { | ||
return consolidateModules(pModules.map(squashModuleToDirectory)).map( | ||
consolidateModuleDependencies | ||
); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export function filenameMatchesPattern(pFullPathToFile, pPattern) { | ||
return RegExp(pPattern, "g").test(pFullPathToFile); | ||
} | ||
|
||
export function moduleMatchesFilter(pModule, pFilter) { | ||
return filenameMatchesPattern(pModule.source, pFilter.path); | ||
} | ||
|
||
export function dependencyMatchesFilter(pDependency, pFilter) { | ||
return filenameMatchesPattern(pDependency.resolved, pFilter.path); | ||
} |
Oops, something went wrong.