Add js web stuff to landing page + documentation

This commit is contained in:
2026-07-14 10:33:12 -04:00
parent fec8ef4a3e
commit 02a6dc6c48
435 changed files with 69567 additions and 1522 deletions

16
go/jsruntime/env.ts Normal file
View File

@@ -0,0 +1,16 @@
// Compile-time deployment environment: "development" | "staging" | "production".
//
// `__ENV_TYPE__` is substituted at bundle time by esbuild's `define`, fed the Go
// compile-time constant `internal/constants.AppEnvironment` (see the
// `esbuildDefine` helper in internal/bundler). The production bundles and the dev
// HMR per-module transform both define it. The build-time SSR render of the
// public pages does NOT, so the `typeof` guard yields "" there — the env badge
// renders only after the client takeover, matching the prior runtime behavior.
declare const __ENV_TYPE__: string;
export const ENV_TYPE: string = typeof __ENV_TYPE__ !== "undefined" ? __ENV_TYPE__ : "";
// True in every environment except production (and the badge-less SSR render).
export function isNonProdEnv(): boolean {
return ENV_TYPE !== "" && ENV_TYPE !== "production";
}