Extract website to SREBOT-web repo: remove web/, move seasons/locales/constants to repo root, fix imports

This commit is contained in:
clxud
2026-07-02 02:45:22 +00:00
parent c0214eaaae
commit 246a29f695
149 changed files with 4 additions and 137956 deletions
-41
View File
@@ -145,47 +145,6 @@ def pull_and_restart(changed_files: list[str], before: str = '', after: str = ''
processes_to_restart.append('tssbot-api')
logger.info("TSSBOT API files changed, will restart tssbot-api")
# Web frontend: restart if SREBOT/web/ files changed
web_changed = any(f.startswith('SREBOT/web/') for f in changed_files)
if web_changed:
# Rebuild CSS if tailwind source or config changed
css_changed = any(
f in ('SREBOT/web/public/css/tailwind.css', 'SREBOT/web/tailwind.config.js')
for f in changed_files
)
if css_changed:
logger.info("Tailwind source changed, rebuilding CSS...")
build_result = subprocess.run(
['npm', 'run', 'build:css'],
capture_output=True, text=True, timeout=60,
cwd=os.path.join(REPO_PATH, 'SREBOT', 'web')
)
if build_result.returncode != 0:
logger.error(f"CSS build failed: {build_result.stderr}")
return False, f"CSS build failed: {build_result.stderr}"
logger.info("CSS build successful")
# Rebuild obfuscated JS if any JS source files changed
js_changed = any(
f.startswith('SREBOT/web/public/js/') and f.endswith('.js') and '/dist/' not in f
for f in changed_files
)
if js_changed:
logger.info("JS source files changed, rebuilding obfuscated JS...")
build_result = subprocess.run(
['node', 'build.js'],
capture_output=True, text=True, timeout=120,
cwd=os.path.join(REPO_PATH, 'SREBOT', 'web')
)
if build_result.returncode != 0:
logger.warning(f"JS build failed (non-fatal): {build_result.stderr}")
logger.warning("Continuing deploy — unobfuscated JS will be served as fallback")
else:
logger.info("JS build successful")
processes_to_restart.append('srebot-web')
logger.info("Web files changed, will restart srebot-web")
# Webhook: restart if this file changed
webhook_changed = any(WEBHOOK_FILENAME in f for f in changed_files)
if webhook_changed: