Files
dpl/scripts/theme-fuc/vendor-interactions.py
T
hellcat 0501711267 feat(fuc-xb): prepare isolated staging theme and VIP auto upgrades
Port the Fuc 0.12.0 frontend and default-off VIP plugin. Include the previously approved password-reset token revocation. Deploy only to an independent FUC-XB test instance; no production cutover.
2026-11-04 13:44:33 +08:00

28 lines
1.5 KiB
Python

#!/usr/bin/env python3
"""Extract unchanged FUC UI libraries; exclude original business code and duplicate Pace."""
from pathlib import Path
import hashlib
import json
source = Path('/Users/hellcat/Documents/GemCodes/fuc-new.loc/public')
out = Path(__file__).resolve().parents[2] / 'theme/Fuc/assets/native'
vendor = (source / 'theme/cool/assets/vendors/js/vendors.min.js').read_text()
widgets = vendor[:vendor.index('/* Unison JS */')]
start = vendor.index('// Waves')
widgets += vendor[start:vendor.index('// Promises - for IE11', start)]
files = {
'widgets.min.js': widgets.encode(),
'sweetalert2.min.js': (source / 'theme/cool/assets/js/scripts/sweetalert2.min.js').read_bytes(),
'smooth-scroll.min.js': (source / 'assets/cool/smooth-scroll.polyfills.min.js').read_bytes(),
'landing-bootstrap5.min.js': (source / 'assets/cool/bootstrap.bundle.min.js').read_bytes(),
}
for name, content in files.items():
(out / name).write_bytes(content)
(out / 'widgets-provenance.json').write_text(json.dumps({
'source': 'fuc-new.loc/public',
'widgets': ['jQuery 3.4.1', 'Popper', 'Bootstrap 4.3.1', 'Bootstrap 5.0.0-beta1 for original landing page', 'PerfectScrollbar 1.4.0', 'Hammer 2.0.8', 'Waves', 'SweetAlert2', 'SmoothScroll'],
'sha256': {name: hashlib.sha256(content).hexdigest() for name, content in files.items()},
'excludes': ['duplicate Pace', 'FUC business scripts', 'remote requests'],
}, indent=2) + '\n')
print('FUC original UI libraries extracted with hashes; no business scripts included')