Skip to content

refactor(env): collapse 7 shallow env modules into env/server.ts (#20 sub-#1)#25

Merged
cosimochellini merged 2 commits into
mainfrom
refactor/env-server-consolidation
May 24, 2026
Merged

refactor(env): collapse 7 shallow env modules into env/server.ts (#20 sub-#1)#25
cosimochellini merged 2 commits into
mainfrom
refactor/env-server-consolidation

Conversation

@cosimochellini
Copy link
Copy Markdown
Owner

Summary

  • Single env/server.ts with lazy getters — Workers-safe (no process.env reads at module load).
  • Deletes 7 per-category env modules: openai, secret, db, telegram, cloudflare, required, package.
  • Keeps env/public.ts (separate browser-facing concern).
  • Migrates every importer to serverEnv.X / bucket.X.
  • Updates CLAUDE.md architecture block.
  • Adds CONTEXT.md glossary (imagePipeline / imageStore / escalator).

Refs #20 sub-#1. Closes #20 (last of three sub-PRs).

Test plan

  • pnpm lint clean
  • pnpm typecheck clean
  • pnpm build green
  • pnpm test green
  • Manual smoke: pnpm dev -> home + explore + new + edit + image upload all render.

🤖 Generated with Claude Code

…sub-#1)

- Single env/server.ts with lazy getters; reads only on access (Workers-safe).
- Delete env/{openai,secret,db,telegram,cloudflare,required,package}.ts.
- Keep env/public.ts (separate browser-facing concern).
- Migrate all importers to serverEnv.X / bucket.X.
- Update CLAUDE.md architecture block; add CONTEXT.md glossary
  (imagePipeline / imageStore / escalator).

Refs #20 sub-#1. Closes #20.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 24, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
purranormal-activity 6127f19 Commit Preview URL

Branch Preview URL
May 24 2026, 02:58 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 24, 2026

Deploying purranormal-cativity with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6127f19
Status:🚫  Build failed.

View logs

- drizzle: wrap client in lazy Proxy singleton so connection config is
  not read until first db.select() call. Module import no longer touches
  process.env.TURSO_*.
- telegram: drop URL memoisation (or document if kept); per-call template
  eval is trivially cheap and matches the rest of the lazy-env stance.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cosimochellini cosimochellini marked this pull request as ready for review May 24, 2026 15:01
@cosimochellini cosimochellini merged commit f9318eb into main May 24, 2026
4 of 5 checks passed
@cosimochellini cosimochellini deleted the refactor/env-server-consolidation branch May 24, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Architecture: 3 deepening refactors — env consolidation, pipeline outcome, imageStore

1 participant