2026-03-03 10:20:49 +07:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
|
|
|
|
|
|
// https://vite.dev/config/
|
fix(install): unblock self-hosting + drop forced wokwi clones
Resolves several install pain points reported by users (#108, #120) and
removes the obligatory upstream-clone step that confused contributors and
slowed down every Docker build.
Install fixes:
- nginx: server_name → catch-all default_server, drop Debian's stock site
so reverse-proxied users no longer get the "Welcome to nginx" page.
- entrypoint: auto-generate SECRET_KEY at first boot, persisted under
data/.secret_key. backend/.env is now optional in docker-compose.yml.
- backend: add greenlet>=3.0.0 (SQLAlchemy async dep that was missing on
some Python builds — caused uvicorn startup failures on WSL).
Wokwi libs come from npm:
- @wokwi/elements 1.9.2, avr8js 0.21.0, rp2040js 1.3.2 are pinned in
frontend/package.json. Vite aliases removed.
- Dockerfile.standalone no longer clones avr8js / rp2040js / wokwi-elements
/ wokwi-boards. Frontend stage is just COPY + npm install + build:docker.
- Board SVGs vendored under frontend/public/boards/ (10 deduped against
existing files, 2 truly new). third-party/wokwi-* clones become reference-
only credits — generate-component-metadata.ts skips gracefully when absent.
Production config split out:
- docker-compose.prod.yml, deploy/nginx.prod.conf, nginx-host-velxio*.conf,
update-third-party.bat removed. Production deployment lives in its own
repo: https://github.com/velxio/velxio-prod (host nginx + HTTPS + backups
+ pinned upstream commit).
Verified locally: 1161 frontend tests pass, build:docker completes clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 10:04:11 +07:00
|
|
|
// avr8js / rp2040js / @wokwi/elements are resolved from npm via package.json.
|
|
|
|
|
// (The third-party/ clones are reference-only — keep them updated for credits.)
|
2026-03-03 10:20:49 +07:00
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react()],
|
2026-03-07 23:55:11 +07:00
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
'/api': {
|
2026-04-17 09:13:16 +07:00
|
|
|
target: 'http://127.0.0.1:8001',
|
2026-03-07 23:55:11 +07:00
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-04-13 21:06:03 +07:00
|
|
|
assetsInclude: ['**/*.wasm'],
|
2026-03-03 10:20:49 +07:00
|
|
|
optimizeDeps: {
|
2026-03-30 07:27:41 +07:00
|
|
|
include: ['avr8js', 'rp2040js', '@wokwi/elements', 'littlefs'],
|
2026-03-03 10:20:49 +07:00
|
|
|
},
|
2026-03-05 08:05:23 +07:00
|
|
|
test: {
|
|
|
|
|
globals: true,
|
|
|
|
|
environment: 'node',
|
|
|
|
|
include: ['src/__tests__/**/*.test.ts'],
|
|
|
|
|
coverage: {
|
|
|
|
|
provider: 'v8',
|
|
|
|
|
include: ['src/simulation/**/*.ts'],
|
|
|
|
|
reporter: ['text', 'html'],
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-03-03 10:20:49 +07:00
|
|
|
})
|