From 1dae8539f5091fc8c8188fbb59ae0a0bacb09004 Mon Sep 17 00:00:00 2001 From: MacBook Date: Wed, 22 Apr 2026 17:01:00 +0200 Subject: [PATCH] fix: integrate protocol sync into CI/CD and update documentation --- .github/workflows/release.yml | 5 +++++ README.md | 12 ++++++++---- SYNC_GUIDE.md | 9 +++++---- extension/README.md | 7 ++++--- shared/constants.js | 2 +- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 270ce24..7af3840 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Sync Protocol Constants + run: | + chmod +x ./scripts/sync-constants.sh + ./scripts/sync-constants.sh + - name: Create Extension Zip run: | zip -r koala-sync-extension.zip extension/ -x "*.DS_Store*" diff --git a/README.md b/README.md index 5ade226..a717581 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,14 @@ docker-compose up -d --build The server will be available at `ws://localhost:3000`. ### 2. Chrome Extension -1. Open Chrome and go to `chrome://extensions/`. -2. Enable **Developer mode** (top right). -3. Click **Load unpacked**. -4. Select the `extension/` folder. +1. **Synchronize Protocol**: From the root directory, run the sync script to copy the master constants to the extension folder: + ```bash + ./scripts/sync-constants.sh + ``` +2. Open Chrome and go to `chrome://extensions/`. +3. Enable **Developer mode** (top right). +4. Click **Load unpacked**. +5. Select the `extension/` folder. ## Usage 1. Open the extension and go to the **Settings** tab to set your **Username**. diff --git a/SYNC_GUIDE.md b/SYNC_GUIDE.md index 1cb42fa..4247e18 100644 --- a/SYNC_GUIDE.md +++ b/SYNC_GUIDE.md @@ -7,10 +7,11 @@ To ensure that the extension and the relay server are always using the exact sam ## When should you run the sync script? You MUST run the synchronization script in any of the following scenarios: -1. **After modifying** `shared/constants.js`. -2. **After modifying** `shared/blacklist.js`. -3. **Before committing** changes to the repository if any protocol-related files were touched. -4. **Before deploying** the server or releasing the extension. +1. **After a fresh `git clone` or `git pull`** (as the synced files are ignored by git). +2. **After modifying** `shared/constants.js`. +3. **After modifying** `shared/blacklist.js`. +4. **Before committing** changes to the repository if any protocol-related files were touched. +5. **Before deploying** the server or releasing the extension. ## How to sync diff --git a/extension/README.md b/extension/README.md index 3f5750c..43e59ce 100644 --- a/extension/README.md +++ b/extension/README.md @@ -22,9 +22,10 @@ KoalaSync requires `` permission to detect and interact with video ele - **Zero Telemetry**: No analytics or external tracking scripts. ## Installation -1. Open Chrome and go to `chrome://extensions/`. -2. Enable **Developer mode** (top right). -3. Click **Load unpacked** and select the `extension` folder from this repository. +1. **Sync Protocol**: Run `./scripts/sync-constants.sh` (macOS/Linux) or `scripts\sync-constants.bat` (Windows) from the root. +2. Open Chrome and go to `chrome://extensions/`. +3. Enable **Developer mode** (top right). +4. Click **Load unpacked** and select the `extension` folder. ## Development If you modify `shared/constants.js`, you must synchronize the changes across the extension and server: diff --git a/shared/constants.js b/shared/constants.js index 790ed3a..38634e4 100644 --- a/shared/constants.js +++ b/shared/constants.js @@ -3,7 +3,7 @@ */ export const PROTOCOL_VERSION = "1.0.0"; -export const APP_VERSION = "1.0.0"; +export const APP_VERSION = "1.0.3"; export const OFFICIAL_SERVER_URL = 'wss://sync.shik3i.net'; export const OFFICIAL_LANDING_PAGE_URL = 'https://koalasync.shik3i.net';