Execute in the console in a clean game instance without mods or CCLoader:
(() => {
const fs = require('fs');
let modules = {};
for (let name of Object.keys(ig.modules)) {
modules[name] = Array.from(new Set(ig.modules[name].requires));
}
fs.writeFileSync('modules.json', JSON.stringify(modules, null, 2) + '\n');
})();
This will take some time, nl
is used as a counter. As of 1.4.0 the game has 570 modules.
jq --raw-output 'keys[]' path/to/modules.json | while IFS= read -r module; do
echo "$module"
jq --raw-output --arg id "$module" '.[$id][] | "// requires \(.)"' \
path/to/modules.json > "$module.d.ts"
done | nl
jq --raw-output "keys[] | \"import './\\(.)';\"" path/to/modules.json > __all__.d.ts