chore: Remove Generated Plugin Index

This commit is contained in:
Rajarshee Chatterjee
2026-07-15 01:45:39 +05:30
parent 56757e96d2
commit aca30e22bb
9 changed files with 6554 additions and 545 deletions
-28
View File
@@ -1,28 +0,0 @@
import fs from 'fs';
import { execSync } from 'child_process';
let content = `import { Plugin } from '@/types/plugin';\n`;
let pluginCounter = 0;
const PLUGIN_DIR = 'plugins';
fs.readdirSync(PLUGIN_DIR)
.filter(f => !f.includes('index') && f !== 'multisrc')
.forEach(langName => {
const LANG_DIR = PLUGIN_DIR + '/' + langName;
fs.readdirSync(LANG_DIR)
.filter(f => !f.includes('broken') && !f.startsWith('.'))
.forEach(pluginName => {
content += `import p_${pluginCounter} from '@plugins/${langName}/${pluginName.replace(/\.ts$/, '')}';\n`;
pluginCounter += 1;
});
});
content += `\nconst PLUGINS: Plugin.PluginBase[] = [${Array(pluginCounter)
.fill()
.map((v, index) => 'p_' + index.toString())
.join(', ')}];\nexport default PLUGINS`;
const outputPath = './plugins/index.ts';
fs.writeFileSync(outputPath, content, { encoding: 'utf-8' });
execSync(`npx prettier --write ${outputPath}`, { stdio: 'inherit' });