refactor: Overhaul Plugin Architecture & Playground UI (#1846)

* refactor: Move Plugins Out and Consolidate with Multisrc

* feat: Overhaul Playground UI

* feat: Add Filters to New UI

* feat: Persist Selected Plugin

* feat: Add Direct Parse Novel/Chapter Options and Feedback Toasts

[skip ci]

* feat: UX Improvements

* chore: Update Plugin Path in Publish Workflow

* fix: Add Backward Compatibility

* chore: Update Plugin Publishing Script
This commit is contained in:
Rajarshee Chatterjee
2025-10-20 22:54:08 +05:30
committed by GitHub
parent 252beff0bf
commit 20c2b75b01
363 changed files with 6848 additions and 3007 deletions
+5 -5
View File
@@ -1,18 +1,18 @@
import fs from 'fs';
import { execSync } from 'child_process';
let content = `import { Plugin } from '@typings/plugin';\n`;
let content = `import { Plugin } from '@/types/plugin';\n`;
let pluginCounter = 0;
const PLUGIN_DIR = 'src/plugins';
const PLUGIN_DIR = 'plugins';
fs.readdirSync(PLUGIN_DIR)
.filter(f => !f.includes('index'))
.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 './${langName}/${pluginName.replace(/\.ts$/, '')}';\n`;
content += `import p_${pluginCounter} from '@plugins/${langName}/${pluginName.replace(/\.ts$/, '')}';\n`;
pluginCounter += 1;
});
});
@@ -22,7 +22,7 @@ content += `\nconst PLUGINS: Plugin.PluginBase[] = [${Array(pluginCounter)
.map((v, index) => 'p_' + index.toString())
.join(', ')}];\nexport default PLUGINS`;
const outputPath = './src/plugins/index.ts';
const outputPath = './plugins/index.ts';
fs.writeFileSync(outputPath, content, { encoding: 'utf-8' });
execSync(`npx prettier --write ${outputPath}`, { stdio: 'inherit' });