mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[Update Module] Controlfreak707/GM-Comfy-Theme
This commit is contained in:
parent
8844dd2c18
commit
54f6e8e61a
2 changed files with 44 additions and 1 deletions
|
@ -7,7 +7,7 @@ export default
|
|||
['Controlfreak707/GM-Send-Button', '0c326a4c0968a527fbbc776682b730a83b27e628'],
|
||||
['Controlfreak707/GM-Relaunch', '75c838c352743becdef0d68a954cb5d4f43bce5b'],
|
||||
|
||||
['Controlfreak707/GM-Comfy-Theme', 'd65acddb1a9c59a7f1942883261f3966c73e1f6f'],
|
||||
['Controlfreak707/GM-Comfy-Theme', '27102741d21f94896a9c7ce42614a68612132b8b'],
|
||||
|
||||
['TechnoJo4/GM-MessageClickActions', '9af8d898c23b9b762b87e0fc612a6af0021e383c'],
|
||||
|
||||
|
|
43
src/preprocessors/pcTheme.js
Normal file
43
src/preprocessors/pcTheme.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
import { readFileSync, writeFileSync, mkdirSync, rmSync } from 'fs';
|
||||
|
||||
export default (manifestPath, repo) => {
|
||||
const pcManifest = JSON.parse(readFileSync(manifestPath));
|
||||
|
||||
const manifest = {
|
||||
main: 'index.js',
|
||||
tags: ['theme', 'port'],
|
||||
|
||||
name: pcManifest.name,
|
||||
description: pcManifest.description,
|
||||
|
||||
version: pcManifest.version,
|
||||
authors: [ pcManifest.author ]
|
||||
};
|
||||
|
||||
rmSync(themePath);
|
||||
mkdirSync(themePath);
|
||||
|
||||
const jsCode = `// Generated by MS2Builder - pcTheme preprocessor / porter
|
||||
let style;
|
||||
|
||||
export default {
|
||||
goosemodHandlers: {
|
||||
onImport: async () => {
|
||||
style = document.createElement("style");
|
||||
document.head.appendChild(style);
|
||||
style.appendChild(
|
||||
document.createTextNode(
|
||||
\`${content}\`
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
onRemove: async () => {
|
||||
style.remove();
|
||||
},
|
||||
}
|
||||
};`;
|
||||
|
||||
writeFileSync(`${themePath}/goosemodModule.json`, JSON.stringify(manifest));
|
||||
writeFileSync(`${themePath}/index.js`, jsCode);
|
||||
};
|
Loading…
Reference in a new issue