mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[autoTag] Fixed age-old bug
This commit is contained in:
parent
bd4c9d266a
commit
80d9974c05
2 changed files with 10 additions and 6 deletions
|
@ -1,15 +1,19 @@
|
|||
const basicIncludes = (bundleCode, code, display = (code[0].toUpperCase() + code.substring(1))) => {
|
||||
const basicIncludes = (bundleCode, code, display = code[0].toUpperCase() + code.substring(1)) => {
|
||||
if (bundleCode.includes(code)) return display;
|
||||
};
|
||||
|
||||
export default (bundleCode) => { // Scans final bundle JS to try and auto-detect things, then adding tags
|
||||
export default (bundleCode, currentTags) => {
|
||||
// Scans final bundle JS to try and auto-detect things, then adding tags
|
||||
const tags = [
|
||||
basicIncludes(bundleCode, 'react'),
|
||||
basicIncludes(bundleCode, 'document', 'DOM'),
|
||||
|
||||
(bundleCode.includes('document.createTextNode') && /document\.createElement\(['"`]style['"`]\)/.test(bundleCode)) ? 'CSS' : undefined,
|
||||
/document\.createElement\(['"`]style['"`]\)/.test(bundleCode) ? 'CSS' : undefined,
|
||||
|
||||
].filter((x) => x !== undefined);
|
||||
currentTags.includes('themes') ? 'theme' : undefined,
|
||||
]
|
||||
.filter((x) => x !== undefined)
|
||||
.concat(currentTags.filter((x) => x !== 'themes'));
|
||||
|
||||
return tags;
|
||||
};
|
|
@ -79,7 +79,7 @@ export default () => {
|
|||
let cards = [];
|
||||
let metas = [];
|
||||
|
||||
let name = 'GooseMod Store';
|
||||
let name = 'NovaGM Store';
|
||||
let description = '';
|
||||
|
||||
for (const repo of repos) {
|
||||
|
|
Loading…
Reference in a new issue