mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
Resolves the parallel Phase B/C work that landed on the sister branch
while this branch was in review. Both branches independently implemented
real OTel + Wazero runtimes; this merge keeps the best of each.
Conflict resolution
- Server/plugin/sandbox_wazero.go: rewritten as a hybrid. Keeps the
HEAD lifecycle (eager `platformInit` with WASI preview-1, explicit
`platformDeactivate` per-instance, runtime closed via Registry.Close)
AND adopts the sister branch's richer artefacts:
* `WithMemoryLimitPages` actually enforces `cfg.MaxMemoryMB`,
* the JSON-over-linear-memory ABI
(`allocate` / `command_dispatch(ptr,len) → (ptr,len)` /
`deallocate`),
* `listExportedCommands` auto-binds commands the plugin exports
via `list_commands` at activation time (capability-gated).
- Server/plugin/registry.go: kept the HEAD `activate()` snapshot
pattern (read `runtimePlatform` under RLock, pass into
`activateWithRuntime` as a parameter) so a concurrent Close can't
race the wazero call. Sister branch's LoadAll stale-staging cleanup
and UninstallPlugin on-disk dir removal came in via auto-merge.
- Server/telemetry/telemetry_otel.go: kept the HEAD implementation
(race-fixed AppMetrics rebind, uint64 overflow guard, idempotent
shutdown, trace-provider cleanup on prom failure) and wired in the
sister branch's `OTLPInsecure` config field for plaintext gRPC opt-in.
- Server/go.mod: accepted sister branch's `BurntSushi/toml v1.6.0`
for the new TOML manifest support.
- Client/tauri-client/vitest.config.ts: union of both globs
(`tests/**/*.test.ts`, `src/**/*.test.ts`, `src/**/*.test.tsx`).
- PHASE_BC_LOCAL_TODO.md: combined the two checkbox histories;
TOML manifest, hello.wasm fixture, and OTLPInsecure are all marked
done now.
Sister branch additions accepted via auto-merge
- Server/plugin/examples/hello/{hello.wasm,main.go}: precompiled 925
KiB TinyGo plugin with the full ABI (allocate, deallocate,
list_commands, command_dispatch, on_event).
- Server/plugin/manifest_{toml,nottoml}.go: TOML manifest parser
behind the wazero build tag, JSON fallback elsewhere.
- Server/plugin/loader.go: prefers `plugin.toml`, falls back to
`plugin.json`.
- Server/api/plugins_handler.go: structured error responses + slog.
- Server/main.go, Server/config/config.go: OTLPInsecure plumbing,
defaults polish.
- docs/{contributing.md,server-configuration.md}: documentation
updates.
Test status
- `go build` passes on default, -tags otel, -tags wazero, and
-tags otel,wazero.
- `go vet` passes on every tag combination.
- `go test ./...` passes on default and on -tags otel,wazero.
- Client: `npx tsc --noEmit` clean; vitest 3188/3188 across 112 files.
https://claude.ai/code/session_01AZni6CDSQeu67WSWY1YCDX
57 lines
1.7 KiB
TypeScript
57 lines
1.7 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
import { resolve } from "path";
|
|
import solidPlugin from "vite-plugin-solid";
|
|
|
|
export default defineConfig({
|
|
// The Solid plugin must be applied here in addition to vite.config.ts so
|
|
// Vitest can transform `.tsx` test files under src/components/solid/.
|
|
// Without it, JSX in component tests is parsed as TypeScript and fails on
|
|
// the angle brackets.
|
|
plugins: [
|
|
solidPlugin({
|
|
include: ["src/components/solid/**/*.{ts,tsx,js,jsx}"],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@lib": resolve(__dirname, "src/lib"),
|
|
"@stores": resolve(__dirname, "src/stores"),
|
|
"@components": resolve(__dirname, "src/components"),
|
|
"@pages": resolve(__dirname, "src/pages"),
|
|
"@styles": resolve(__dirname, "src/styles"),
|
|
},
|
|
},
|
|
test: {
|
|
environment: "jsdom",
|
|
// Both the legacy `tests/**/*.test.ts` suite and component-local
|
|
// `src/**/*.test.{ts,tsx}` files are picked up. The latter is required
|
|
// for Phase B Step 6 Solid components, whose tests live alongside the
|
|
// component file (see src/components/solid/README.md).
|
|
include: [
|
|
"tests/**/*.test.ts",
|
|
"src/**/*.test.ts",
|
|
"src/**/*.test.tsx",
|
|
],
|
|
coverage: {
|
|
provider: "v8",
|
|
include: ["src/**/*.ts"],
|
|
exclude: [
|
|
"src/main.ts",
|
|
"src/**/*.d.ts",
|
|
"src/lib/window-state.ts",
|
|
"src/lib/credentials.ts",
|
|
"src/lib/noise-suppression.ts",
|
|
"src/lib/updater.ts",
|
|
"src/pages/MainPage.ts",
|
|
"src/components/UpdateNotifier.ts",
|
|
],
|
|
thresholds: {
|
|
statements: 70,
|
|
branches: 70,
|
|
functions: 70,
|
|
lines: 70,
|
|
},
|
|
},
|
|
},
|
|
});
|