First pass at Claritas implementation.

The resolution logic was reworked so that Claritas only needs to be invoked once per supported type, ie only once for ForgeMod and LiteMod resolutions per server. The resolver now uses identifies module candidates and collects them. Claritas is invoked and the resulting metadata is stored. The module resolution then proceeds with all of this data available.
Toggleable module logic was also reworked to first accumulate all candidates and then process. This required the resolution function to optionally take a preprocess and postprocess callback to perform the necessary cleanup and transformations.
The minor rework was necessary because spawning child process is expensive, and we should only do it as often as we must to keep the application performant.
Claritas resolution also supports exceptions defined by the structure class. This is to facilitate handling of special cases (ex. Optifine).
This commit is contained in:
Daniel Scalzi
2020-07-14 23:12:59 -04:00
parent 7620971c99
commit bda96eb24e
26 changed files with 447 additions and 203 deletions

View File

@@ -27,11 +27,11 @@
"homepage": "https://github.com/dscalzi/Nebula#readme",
"devDependencies": {
"@types/fs-extra": "^9.0.1",
"@types/node": "^12.12.47",
"@types/node": "^12.12.50",
"@types/triple-beam": "^1.3.1",
"@types/yargs": "^15.0.5",
"@typescript-eslint/eslint-plugin": "^3.5.0",
"@typescript-eslint/parser": "^3.5.0",
"@typescript-eslint/eslint-plugin": "^3.6.1",
"@typescript-eslint/parser": "^3.6.1",
"eslint": "^7.4.0",
"rimraf": "^3.0.2",
"typescript": "^3.9.6"
@@ -46,6 +46,6 @@
"toml": "^3.0.0",
"triple-beam": "^1.3.0",
"winston": "^3.3.3",
"yargs": "^15.4.0"
"yargs": "^15.4.1"
}
}