Files
SonicForgeStudio/tools/check_gui_fix.js
admin 7c22ae1f02 refactor(bridge): split fx bridge, stabilize VST3 host chain, drop old install engines
- remove diagnostic canaries from audio hot path (crackle fix) and
  stuck C5 note raw-MIDI test (Vst2Instrument::init noteOff)
- split native bridge into daw_vst_bridge (VSTi) + fx_vst_bridge (VST FX)
- VST3: processData prepare before setActive, zero input buses, accept
  both .vstpreset and bridge-state blob in RenderJob presets
- native_render/vst_engine: bridge-exe discovery + render_fx_chain + /fx-gui
- delete old install/ engine binaries (install via sidecar+resources now)
- add BUILD_LAYOUT.md, build_selfcheck, tools/ diagnostics
2026-08-20 09:42:42 +07:00

44 lines
2.2 KiB
JavaScript

// tools/check_gui_fix.js — self-check for the TCP GUI button fix (V9 regression).
// Run: node tools/check_gui_fix.js (exit 0 = OK)
// Verifies: guard exists in source, compiled bundle, and all 6 shipped copies
// are byte-identical to the compiled bundle; bundle is syntactically valid.
const { readFileSync } = require('fs');
const { execFileSync } = require('child_process');
const path = require('path');
const root = path.join(__dirname, '..');
const SRC = path.join(root, 'app/static/js/app.jsx');
const PRECOMPILED = path.join(root, 'app/static/js/app.precompiled.js');
const GUARD_SRC = 'if (!loadOk && !window.__bridgeLoadedChannels[bch]) {';
const GUARD_COMPILED = 'if(!loadOk&&!window.__bridgeLoadedChannels[bch]){';
const COPIES = [
'dist/daw_engine/_internal/app/static/js/app.precompiled.js',
'install/daw_engine/_internal/app/static/js/app.precompiled.js',
'src-tauri/resources/daw_engine/_internal/app/static/js/app.precompiled.js',
'src-tauri/target/debug/daw_engine/_internal/app/static/js/app.precompiled.js',
'src-tauri/target/release/daw_engine/_internal/app/static/js/app.precompiled.js'
];
function assert(cond, msg) {
if (!cond) { console.error('FAIL: ' + msg); process.exit(1); }
}
const src = readFileSync(SRC, 'utf8');
assert(src.includes(GUARD_SRC), 'guard missing in app.jsx');
const compiled = readFileSync(PRECOMPILED, 'utf8');
assert(compiled.includes(GUARD_COMPILED), 'guard missing in app.precompiled.js');
assert(compiled.includes('__bridgePluginPaths[instrumentId]=knownPath') || compiled.includes('window.__bridgePluginPaths[instrumentId]=knownPath'), 'path cache write missing in precompiled');
assert(src.includes('__bridgeLoadedState'), 'V10 loaded-state guard missing in app.jsx');
assert(compiled.includes('__bridgeLoadedState'), 'V10 loaded-state guard missing in precompiled');
// Bundle must parse (Babel output is plain script).
execFileSync(process.execPath, ['--check', PRECOMPILED], { stdio: 'pipe' });
for (const c of COPIES) {
const p = path.join(root, c);
assert(readFileSync(p, 'utf8') === compiled, 'copy out of sync: ' + c);
}
console.log('OK: GUI fix guard present in source + compiled + all ' + (COPIES.length + 1) + ' bundles; bundle parses.');