forked from kojibai/verify.kai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
70 lines (60 loc) · 2.31 KB
/
vite.config.ts
File metadata and controls
70 lines (60 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { BASE_APP_VERSION } from "./src/version";
/**
* Sovereign build constants (NO .env required)
* - Anything BigInt is injected as a STRING (so it’s JSON-safe and bundler-safe).
* - Client can read via import.meta.env.* exactly like Vite vars, but fully sealed here.
*/
import {
GENESIS_TS,
SOLAR_GENESIS_UTC_TS,
PULSE_MS,
N_DAY_MICRO,
PULSES_STEP,
STEPS_BEAT,
BEATS_DAY,
} from "./src/utils/kai_pulse";
const SOVEREIGN_BUILD = {
appVersion: BASE_APP_VERSION,
// Kai-Klok anchors (UTC ms; numbers)
genesisTsMsUtc: GENESIS_TS,
solarGenesisTsMsUtc: SOLAR_GENESIS_UTC_TS,
// Display-only (number)
pulseMs: PULSE_MS,
// Lattice (numbers + BigInt-as-string)
pulsesPerStep: PULSES_STEP,
stepsPerBeat: STEPS_BEAT,
beatsPerDay: BEATS_DAY,
nDayMicro: N_DAY_MICRO.toString(),
/**
* Optional “built-in” μpulse seed (string) — leave null unless you *intentionally*
* hard-code a sovereign anchor. Your runtime should still prefer:
* checkpoint > signed anchor > localStorage anchor > RTC fallback
*/
kaiAnchorMicro: null as string | null,
} as const;
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
dedupe: ["react", "react-dom", "react/jsx-runtime"],
},
define: {
// Existing
"import.meta.env.VITE_APP_VERSION": JSON.stringify(BASE_APP_VERSION),
// Sovereign Kai constants (no env file)
"import.meta.env.VITE_KAI_GENESIS_TS_MS_UTC": JSON.stringify(GENESIS_TS),
"import.meta.env.VITE_KAI_SOLAR_GENESIS_TS_MS_UTC": JSON.stringify(SOLAR_GENESIS_UTC_TS),
"import.meta.env.VITE_KAI_PULSE_MS": JSON.stringify(PULSE_MS),
"import.meta.env.VITE_KAI_N_DAY_MICRO": JSON.stringify(N_DAY_MICRO.toString()),
"import.meta.env.VITE_KAI_PULSES_STEP": JSON.stringify(PULSES_STEP),
"import.meta.env.VITE_KAI_STEPS_BEAT": JSON.stringify(STEPS_BEAT),
"import.meta.env.VITE_KAI_BEATS_DAY": JSON.stringify(BEATS_DAY),
// Optional built-in μpulse seed (string | null)
"import.meta.env.VITE_KAI_ANCHOR_MICRO": JSON.stringify(SOVEREIGN_BUILD.kaiAnchorMicro),
// One sealed JSON blob for convenience (string)
"import.meta.env.VITE_SOVEREIGN_BUILD_JSON": JSON.stringify(JSON.stringify(SOVEREIGN_BUILD)),
},
});