Add browser support with Socket.io transport, authentication, performance-optimized IPC, and CI/CD (#925)
This commit is contained in:
6
.github/copilot-instructions.md
vendored
6
.github/copilot-instructions.md
vendored
@@ -25,6 +25,10 @@ yarn install
|
||||
# Build the project
|
||||
yarn build
|
||||
|
||||
# Set password for browser testing
|
||||
export MQTT_EXPLORER_USERNAME=admin
|
||||
export MQTT_EXPLORER_PASSWORD=secretpassword
|
||||
|
||||
# Start the application
|
||||
yarn start
|
||||
|
||||
@@ -322,5 +326,5 @@ yarn package-with-docker
|
||||
- The app uses Electron (see `package.json` for version)
|
||||
- MQTT communication is handled via [mqttjs](https://github.com/mqttjs/MQTT.js)
|
||||
- All code changes should pass linting (`yarn lint`)
|
||||
- Node.js version requirement: >= 18
|
||||
- Node.js version requirement: >= 20
|
||||
- The project uses workspace-like structure with separate package.json files for app and backend
|
||||
|
||||
2
.github/workflows/copilot-setup.yml
vendored
2
.github/workflows/copilot-setup.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
node-version: '20'
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
|
||||
50
.github/workflows/tests.yml
vendored
50
.github/workflows/tests.yml
vendored
@@ -74,3 +74,53 @@ jobs:
|
||||
run: echo '${{ steps.upload.outputs.file-url }}'
|
||||
id: artifact-upload-step
|
||||
- run: echo '<picture><img src="${{ steps.upload.outputs.file-url }}"></picture>' >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
test-browser:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mosquitto:
|
||||
image: eclipse-mosquitto:2
|
||||
ports:
|
||||
- 1883:1883
|
||||
options: >-
|
||||
--health-cmd "mosquitto_sub -t '$SYS/#' -C 1"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: Install Dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Build Browser Mode
|
||||
run: yarn build:server
|
||||
- name: Test App
|
||||
run: yarn test:app
|
||||
- name: Test Backend
|
||||
run: yarn test:backend
|
||||
- name: Start Server in Background
|
||||
run: |
|
||||
yarn start:server &
|
||||
echo $! > server.pid
|
||||
env:
|
||||
MQTT_EXPLORER_USERNAME: test
|
||||
MQTT_EXPLORER_PASSWORD: test123
|
||||
PORT: 3000
|
||||
- name: Wait for Server
|
||||
run: |
|
||||
timeout 30 bash -c 'until curl -f http://localhost:3000; do sleep 1; done'
|
||||
- name: Browser Smoke Test
|
||||
run: |
|
||||
# Test server is running
|
||||
curl -f http://localhost:3000 || exit 1
|
||||
echo "Browser mode server is running successfully"
|
||||
- name: Stop Server
|
||||
if: always()
|
||||
run: |
|
||||
if [ -f server.pid ]; then
|
||||
kill $(cat server.pid) || true
|
||||
rm server.pid
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user