-
Notifications
You must be signed in to change notification settings - Fork 220
Thunderstore ecosystem integration #1724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
||
export const ALL_MODLOADER_MAPPINGS = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to drop these exports already?
This commit and PR largely aim to replace previously hard-coded game and mod definitions within R2MM with data read directly from the ecosystem schema (thunderstore-io/ecosystem-schema). Validation is accomplished through ajv, which allows us to validate the provided ecosystem-schema document with its cooresponding JSON schema (ecosystem.json and ecosystemJsonSchema.json).
Null can be used as an empty value. The change is done to be consistent with how Thunderstore ecosystem defines the value to avoid unnecessary casting. Game specific install rules can be removed later when the mod manager uses the information provided by the ecosystem.
- As the Thunderstore API endpoint now contains more data, the file it's stored in was renamed from games.json to ecosystem.json - Thunderstore API now provides an endpoint for JSON Schema file that can be used to validate the data - quicktype is used to generate TypeScript type definitions based on the JSON Schema file
Drop the hardcoded ecosystem data and schema files used in prototyping phase. Instead, use the files that can be refreshed with the sync script included in the repo. Use the TypeScript types generated based on the JSON Schema to make the typing more exact and e.g. allows dropping some type casting elsewhere on the codebase. This also improves the perceived performance in IDE since the types inferred based on the data could contain thousands of alternative types for some objects. The quicktype library that's used to generate the types could in theory be used to also validate the data via the Convert class available in the type file. However, the error messages it provides are completely useless in debugging the problem, so ajv library is still used even though it adds another dependency.
- Map tracking method strings from ecosystem data to the types used in the mod manager - Include relativeFileExclusions in the code now that they are available in the ecosystem data Mediate differences between ecosystem data
Since the ecosystem data is now more complete and the typing more exact, it's also possible to simplify the implementation.
Since the typing is now more exact, it's possible to also simplify the implementation.
Each game can now have an array of R2Modman items instead of just one. Each R2Modman item is now self-sufficient, i.e. thay contain the meta and distribution information of the game. This allows supporting different editions of a game (Outward vs Outward Definitive Edition) and dedicated servers without changing the ecosystem data structure too much.
2fe840b
to
033b802
Compare
const ECOSYSTEM_JSON_SCHEMA_URL = "https://thunderstore.io/api/experimental/schema/ecosystem-json-schema/latest/"; | ||
const ECOSYSTEM_DATA_PATH = "./src/assets/data/ecosystem.json"; | ||
const ECOSYSTEM_JSON_SCHEMA_PATH = "./src/assets/data/ecosystemJsonSchema.json"; | ||
const ECOSYSTEM_DATA_TYPES_PATH = "./src/assets/data/ecosystem.d.ts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm considering changing this from ecosystem.d.tsto something like
ecosystemTypes.ts` so Enums can be imported instead of having to be redefined in the mod manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now done in #1751
Use Thunderstore ecosystem as the source of truth for game definitions.
PR contents:
Mod manager TODO:
Required: Fix unit tests so the CI pipelines passRefactor and fix unit tests for InstallRuleInstaller #1744Required: Testing. So far testing has mostly consisted of seeing that r2mm dev build process passes. No testing at all has been done with TSMM.Adding a game.md
Optional: There's still clean up to do and possibly typing to improve, but I didn't want to bloat this PR any furtherRefactor and fix unit tests for InstallRuleInstaller #1744 Remove InstallRule definition files #1745 Merge InstallationRuleApplicator to InstallationRules #1746Ecosystem TODO:
Required: Ecosystem data contains outdated iconUrl for R.E.P.O.Optional: Provide information for dedicated servers