restructure project, add claudemd

This commit is contained in:
2026-07-08 16:36:17 -04:00
parent a7964f9410
commit 2a5fbffaa2
315 changed files with 81075 additions and 0 deletions

17
go/appenv/appenv.go Normal file
View File

@@ -0,0 +1,17 @@
// Package appenv exposes the deployment environment that is baked into the
// binary at compile time. The concrete value of Environment is selected by a
// build tag (see env_development.go / env_staging.go / env_production.go), so it
// can never be misconfigured or missing at startup. The bundler propagates it
// into the JS bundle via the esbuild `__ENV_TYPE__` define.
//
// This is the framework half of what used to live in each app's
// internal/constants: the app keeps its concrete constants (cookie names,
// password rules, ...) and reads the environment from here.
package appenv
// The environment type names. Compared against Environment to branch behaviour.
const (
EnvTypeDevelopment = "development"
EnvTypeStaging = "staging"
EnvTypeProduction = "production"
)

View File

@@ -0,0 +1,8 @@
//go:build !staging && !production
package appenv
// Environment is the deployment environment baked in at compile time.
// Development is the default; build with `-tags staging` or `-tags production`
// to select another environment.
const Environment = EnvTypeDevelopment

View File

@@ -0,0 +1,6 @@
//go:build production
package appenv
// Selected by `-tags production`. See env_development.go for the full rationale.
const Environment = EnvTypeProduction

6
go/appenv/env_staging.go Normal file
View File

@@ -0,0 +1,6 @@
//go:build staging
package appenv
// Selected by `-tags staging`. See env_development.go for the full rationale.
const Environment = EnvTypeStaging