frontend/wailsjs/ is deleted and frontend/bindings/ takes its place — a real TypeScript module tree nested by Go import path, generated by wails3's static analyser rather than by building the app and running it. The @go alias absorbs the constant prefix, so a call site imports '@go/library/library.js' and the codemod over all 93 sites was a specifier rewrite plus splitting @go/models' namespaces into one import per package. The 12 SetContext bindings and the fake `context` model are gone, as Phase 2's ServiceStartup port promised: 272 methods across 12 services, none of them plumbing. @runtime/runtime is now a local shim (src/wails/runtime.ts) over @wailsio/runtime, so the 22 EventsOn imports are untouched. It unwraps v3's WailsEvent into v2's callback shape, which is exact here: nothing in backend/events passes more than one data argument, and v3 only packs arguments into a slice when there is more than one. v3 tells the truth about two things v2 lied about, and that is most of the diff. A Go nil slice really does arrive as JSON null, and a Go named string type really is an enum; v2 typed them as T[] and string. utils/binding.ts states the app's actual contract — an absent list is an empty list — once, at the boundary where it is true, and also drops the CancellablePromise the app never cancels. Four test fixtures widen an enum field back to its value union. Not done, and Phase 5's to fix: frontend/test/support/wails-fake.ts still fakes window.go, which v3 does not have, so `make ui-test` is broken and harness.test.ts fails to compile on EventsEmit. That test also asserts v2 ordering that no longer holds — v3's Events.Emit calls the backend and does not notify in-page listeners at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UDCbcCZQepnpSQYJ6SxxZm
42 lines
1.6 KiB
TypeScript
42 lines
1.6 KiB
TypeScript
import path from "path";
|
|
import { defineConfig } from "vite";
|
|
|
|
export default defineConfig({
|
|
resolve: {
|
|
alias: {
|
|
// v3 generates bindings nested by Go import path. The
|
|
// alias absorbs the constant prefix, so a site imports
|
|
// "@go/library/library" rather than the full
|
|
// "bindings/yellowjacket/backend/library/library".
|
|
"@go": path.resolve(__dirname, "bindings/yellowjacket/backend"),
|
|
"@components": path.resolve(__dirname, "src/components"),
|
|
"@assets": path.resolve(__dirname, "src/assets"),
|
|
"@pages": path.resolve(__dirname, "src/pages"),
|
|
"@runtime": path.resolve(__dirname, "src/wails"),
|
|
"@utils": path.resolve(__dirname, "src/utils"),
|
|
"@store": path.resolve(__dirname, "src/store"),
|
|
},
|
|
},
|
|
build: {
|
|
// The bundled icons must be emitted as files, not inlined.
|
|
// Vite inlines any asset under 4 kB, and 63 of the 64 icons are
|
|
// under 4 kB, so the default put ~96 kB of base64 into the main
|
|
// chunk — parsed at startup, for icons most views never render.
|
|
// As files they are served same-origin (so still offline) and
|
|
// fetched on first use.
|
|
assetsInlineLimit: (filePath: string) =>
|
|
filePath.includes('/assets/icons/fa/') ? false : undefined,
|
|
rollupOptions: {
|
|
input: {
|
|
main: "index.html",
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
hmr: {
|
|
host: 'localhost',
|
|
protocol: 'ws',
|
|
},
|
|
},
|
|
});
|