refactor: share frontend module manifest

This commit is contained in:
mARTin-B78 2026-09-04 09:15:41 +02:00
parent dcd6bc9aea
commit cc8fcdbd69
6 changed files with 23 additions and 36 deletions

View File

@ -80,6 +80,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
missing, stale, changed after profile edits, or explicitly marked inconsistent—even when the prompt version is current. missing, stale, changed after profile edits, or explicitly marked inconsistent—even when the prompt version is current.
- **Visual Pair Audit.** Added a read-only character-library review endpoint that detects incomplete pairs, reused or - **Visual Pair Audit.** Added a read-only character-library review endpoint that detects incomplete pairs, reused or
identical profile/reference assets, legacy metadata, changed appearance fields, and explicitly inconsistent pairs. identical profile/reference assets, legacy metadata, changed appearance fields, and explicitly inconsistent pairs.
- **Shared Frontend Module Manifest.** The fallback loader and production bundler now consume the same module manifest,
preventing the two loading paths from drifting as the frontend is split further.
- **Preview Blob Lifecycle.** Character-library and Rehearser local voice previews now revoke replaced or completed - **Preview Blob Lifecycle.** Character-library and Rehearser local voice previews now revoke replaced or completed
object URLs, reducing retained browser memory during repeated auditioning. object URLs, reducing retained browser memory during repeated auditioning.
- **Character Library Smoke Coverage.** Added deterministic browser coverage for opening Characters / Cast, profile - **Character Library Smoke Coverage.** Added deterministic browser coverage for opening Characters / Cast, profile

View File

@ -100,7 +100,8 @@ the first block before investing in architecture or polish.
- [ ] Split `audiobook.js`, `rehearser.js`, and `style.css` by responsibility. - [ ] Split `audiobook.js`, `rehearser.js`, and `style.css` by responsibility.
- [ ] Replace broad globals with namespaces such as `window.TTVC.audiobook`. - [ ] Replace broad globals with namespaces such as `window.TTVC.audiobook`.
- [ ] Generate `loader.js` and `scripts/minify.mjs` from one module manifest. - [x] Generate the feature-module list for `loader.js` and `scripts/minify.mjs` from one shared manifest;
larger responsibility splits remain.
- [ ] Add linting and duplicate-function checks. - [ ] Add linting and duplicate-function checks.
- [ ] Extract Rehearser voice matching and voice design. - [ ] Extract Rehearser voice matching and voice design.
- [ ] Extract Audiobook parsing and casting. - [ ] Extract Audiobook parsing and casting.

View File

@ -1 +1 @@
1.22.4 1.22.5

View File

@ -19,12 +19,8 @@ const outDir = join(root, 'static', 'dist');
mkdirSync(outDir, { recursive: true }); mkdirSync(outDir, { recursive: true });
// Must match loader.js batch C order exactly. // Must match loader.js batch C order exactly.
const MAIN = [ const MODULES = JSON.parse(readFileSync(join(root, 'static', 'module-manifest.json'), 'utf8'));
'voice-picker', 'benchmark-voice-picker', 'voice-inspector', 'seed-finder', 'voice-sources', 'fishaudio-browser', const MAIN = MODULES.map(n => join(jsDir, n + '.js'));
'integrations', 'routing', 'voice-clone', 'voice-library', 'tts-preview',
'generation', 'benchmark', 'stt', 'rehearser-parse', 'rehearser', 'reader', 'audiobook', 'audiobook/network', 'character-sheets',
'characters-library', 'sillytavern', 'library', 'character-columns', 'library-characters', 'studio',
].map(n => join(jsDir, n + '.js'));
const source = MAIN.map(f => `\n/* ==== ${f.split('/').pop()} ==== */\n` + readFileSync(f, 'utf8')).join('\n'); const source = MAIN.map(f => `\n/* ==== ${f.split('/').pop()} ==== */\n` + readFileSync(f, 'utf8')).join('\n');

View File

@ -126,34 +126,16 @@
// C — feature modules: always try the bundle first (one request instead of 23). // C — feature modules: always try the bundle first (one request instead of 23).
// Falls back to individual files if the bundle is missing or fails to load. // Falls back to individual files if the bundle is missing or fails to load.
var _featureFiles = [ var _featureFiles = [];
'/static/js/voice-picker.js', try {
'/static/js/benchmark-voice-picker.js', var _manifestResponse = await fetch('/static/module-manifest.json?v=' + _appVersion, { cache: 'no-store' });
'/static/js/voice-inspector.js', if (!_manifestResponse.ok) throw new Error('module manifest ' + _manifestResponse.status);
'/static/js/seed-finder.js', var _manifest = await _manifestResponse.json();
'/static/js/voice-sources.js', if (!Array.isArray(_manifest) || !_manifest.length) throw new Error('empty module manifest');
'/static/js/fishaudio-browser.js', _featureFiles = _manifest.map(function (name) { return '/static/js/' + name + '.js'; });
'/static/js/integrations.js', } catch (_) {
'/static/js/routing.js', console.error('Unable to load the feature module manifest');
'/static/js/voice-clone.js', }
'/static/js/voice-library.js',
'/static/js/tts-preview.js',
'/static/js/generation.js',
'/static/js/benchmark.js',
'/static/js/stt.js',
'/static/js/rehearser-parse.js',
'/static/js/rehearser.js',
'/static/js/reader.js',
'/static/js/audiobook.js',
'/static/js/audiobook/network.js',
'/static/js/character-sheets.js',
'/static/js/characters-library.js',
'/static/js/sillytavern.js',
'/static/js/library.js',
'/static/js/character-columns.js',
'/static/js/library-characters.js',
'/static/js/studio.js',
];
var _bundleOk = false; var _bundleOk = false;
try { await _load('/static/dist/main.min.js'); _bundleOk = true; } try { await _load('/static/dist/main.min.js'); _bundleOk = true; }
catch (_) { _bundleOk = false; } catch (_) { _bundleOk = false; }

View File

@ -0,0 +1,6 @@
[
"voice-picker", "benchmark-voice-picker", "voice-inspector", "seed-finder", "voice-sources", "fishaudio-browser",
"integrations", "routing", "voice-clone", "voice-library", "tts-preview", "generation", "benchmark", "stt",
"rehearser-parse", "rehearser", "reader", "audiobook", "audiobook/network", "character-sheets",
"characters-library", "sillytavern", "library", "character-columns", "library-characters", "studio"
]