[Feat] Separate repos
This commit is contained in:
parent
dfe62bdc22
commit
a71da298d5
20
src/index.js
20
src/index.js
|
@ -53,8 +53,6 @@ const parcelOptions = {
|
||||||
logLevel: 0
|
logLevel: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
let moduleJson = [];
|
|
||||||
|
|
||||||
const githubCache = {};
|
const githubCache = {};
|
||||||
|
|
||||||
const getGithubInfo = async (repo) => {
|
const getGithubInfo = async (repo) => {
|
||||||
|
@ -70,7 +68,13 @@ const getGithubInfo = async (repo) => {
|
||||||
return info;
|
return info;
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const repo of ModuleRepos) {
|
for (const parentRepo of ModuleRepos) {
|
||||||
|
let moduleJson = {
|
||||||
|
modules: [],
|
||||||
|
meta: parentRepo.meta
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const repo of parentRepo.modules) {
|
||||||
console.time(repo.slice(0, 2).join(' @ ')+`${repo[2] ? ` ${repo[2]}` : ''}`);
|
console.time(repo.slice(0, 2).join(' @ ')+`${repo[2] ? ` ${repo[2]}` : ''}`);
|
||||||
|
|
||||||
const githubInfo = await getGithubInfo(repo[0]);
|
const githubInfo = await getGithubInfo(repo[0]);
|
||||||
|
@ -113,8 +117,8 @@ for (const repo of ModuleRepos) {
|
||||||
|
|
||||||
const preprocessor = repo[3];
|
const preprocessor = repo[3];
|
||||||
|
|
||||||
// resetDir(cloneDir);
|
// resetDir(cloneDir);
|
||||||
// rmSync(cloneDir, { recursive: true, force: true });
|
// rmSync(cloneDir, { recursive: true, force: true });
|
||||||
|
|
||||||
await new Promise((res) => exec(`git clone ${url} ${cloneDir}`, res));
|
await new Promise((res) => exec(`git clone ${url} ${cloneDir}`, res));
|
||||||
|
|
||||||
|
@ -172,7 +176,7 @@ for (const repo of ModuleRepos) {
|
||||||
if (manifest.images) manifestJson.images = manifest.images;
|
if (manifest.images) manifestJson.images = manifest.images;
|
||||||
if (manifest.dependencies) manifestJson.dependencies = manifest.dependencies;
|
if (manifest.dependencies) manifestJson.dependencies = manifest.dependencies;
|
||||||
|
|
||||||
moduleJson.push(manifestJson);
|
moduleJson.modules.push(manifestJson);
|
||||||
|
|
||||||
console.timeEnd(repo.slice(0, 2).join(' @ ')+`${repo[2] ? ` ${repo[2]}` : ''}`);
|
console.timeEnd(repo.slice(0, 2).join(' @ ')+`${repo[2] ? ` ${repo[2]}` : ''}`);
|
||||||
|
|
||||||
|
@ -181,7 +185,9 @@ for (const repo of ModuleRepos) {
|
||||||
if (lastHash !== commitHash) {
|
if (lastHash !== commitHash) {
|
||||||
console.log('[Warning] Commit hash in modules does not match latest commit in repo');
|
console.log('[Warning] Commit hash in modules does not match latest commit in repo');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
writeFileSync(`${distDir}/${parentRepo.filename}.json`, JSON.stringify(moduleJson));
|
||||||
}
|
}
|
||||||
|
|
||||||
writeFileSync(`${distDir}/modules.json`, JSON.stringify(moduleJson));
|
|
||||||
copyFileSync(`${__dirname.replace('/src', '')}/_headers`, `${distDir}/_headers`);
|
copyFileSync(`${__dirname.replace('/src', '')}/_headers`, `${distDir}/_headers`);
|
|
@ -2,5 +2,31 @@ import goosemod from './goosemod.js';
|
||||||
import ms2porter from './ms2porter.js';
|
import ms2porter from './ms2porter.js';
|
||||||
import bdThemes from './ports/bdThemes.js';
|
import bdThemes from './ports/bdThemes.js';
|
||||||
|
|
||||||
// export default bdThemes;
|
export default [
|
||||||
export default goosemod.concat(ms2porter).concat(bdThemes);
|
{
|
||||||
|
meta: {
|
||||||
|
name: 'Store Core - GooseMod Modules',
|
||||||
|
description: 'Officially published GooseMod modules.',
|
||||||
|
},
|
||||||
|
filename: 'goosemod',
|
||||||
|
modules: goosemod
|
||||||
|
},
|
||||||
|
{
|
||||||
|
meta: {
|
||||||
|
name: 'Store Core - MS2Porter',
|
||||||
|
description: 'Auto-ported MS1 (older) GooseMod modules.'
|
||||||
|
},
|
||||||
|
filename: 'ms2porter',
|
||||||
|
modules: ms2porter
|
||||||
|
},
|
||||||
|
{
|
||||||
|
meta: {
|
||||||
|
name: 'Store Core - BD Themes',
|
||||||
|
description: 'Auto-ported BD themes.'
|
||||||
|
},
|
||||||
|
filename: 'bdthemes',
|
||||||
|
modules: bdThemes
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// export default goosemod.concat(ms2porter).concat(bdThemes);
|
Loading…
Reference in New Issue