docs(env): Reconcile .env.example with variables actually read#1159
Open
jeromehardaway wants to merge 1 commit into
Open
docs(env): Reconcile .env.example with variables actually read#1159jeromehardaway wants to merge 1 commit into
jeromehardaway wants to merge 1 commit into
Conversation
Audit of process.env reads across src/, scripts/, prisma/, and root configs. Adds missing variables (Cloudinary server-side cloud name, Mailchimp, Slack form webhook IDs, GA ID, site URL, generator-script keys), annotates each with required/optional, secret/public, and consuming files, and removes advertised-but-unused variables (LMS_DEV_BYPASS, GITHUB_PAT, SHOPIFY_ADMIN_ACCESS_TOKEN, commented Google OAuth pair).
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
.env.examplehad drifted from what the app actually reads: it advertised variables no code consumes, and omitted variables that API routes, configs, and generator scripts require. Nothing indicated which values are required vs optional, secret vs public, or where they are consumed.Solution
Audited every
process.envread (including dynamicprocess.env[name]insrc/pages/api/health.tsandenv("DATABASE_URL")inprisma/schema.prisma) acrosssrc/, repo-rootscripts/,prisma/,next.config.js,next-sitemap.config.js,playwright.config.ts,vitest.config.mts, andpostcss.config.js, then rewrote.env.exampleto match. Each variable is grouped by subsystem and annotated with required/optional, secret/public, and consuming file(s).Added (read by code, previously missing):
CLOUDINARY_CLOUD_NAME—src/pages/api/lms/progress/index.ts,src/pages/api/lms/certificates/generate.ts(read without theNEXT_PUBLIC_prefix)MAILCHIMP_API_KEY,MAILCHIMP_LIST_ID—src/pages/api/newsletter.tsCONTACT_WEBHOOK_ID,APPLY_WEBHOOK_ID,MENTOR_WEBHOOK_ID— Slack webhooks forsrc/pages/api/{contact,apply,mentor,mentee}.tsNEXT_PUBLIC_GOOGLE_ANALYTICS_ID—src/pages/_document.tsxNEXT_PUBLIC_SITE_URL—next-sitemap.config.jsGOOGLE_PRIVATE_KEY— legacy-named fallback Gemini key inscripts/generate-*.tsTECH_PATHWAYS_MODEL—scripts/generate-tech-pathways.tsRemoved (grep across the repo proves no code reads them):
LMS_DEV_BYPASS— only occurrence was.env.exampleitselfGITHUB_PAT— code only readsGITHUB_TOKEN(src/lib/git-api-client.ts)SHOPIFY_ADMIN_ACCESS_TOKEN— referenced in docs only; no code reads itGOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET— no Google OAuth provider is configuredNODE_ENVandCIare read but tooling-set, so they are documented in the header rather than listed as settable values. A zod runtime env validator was considered and skipped as out of scope (possible follow-up).Verification
npm test— 41 files, 384 tests, all passnpm run typecheck— same 4 pre-existing errors in__tests__/pages/api/j0di3/{learning,troops}.test.tson both clean master and this branch; none introducednpm run lint— same 20 pre-existing errors in untouched test files on both clean master and this branch;.env.exampleis not linted.env.exampleFollow-up note:
AGENTS.mdanddocs/SHOPIFY_SETUP.mdstill mentionLMS_DEV_BYPASS,GITHUB_PAT, andSHOPIFY_ADMIN_ACCESS_TOKEN; updating those docs is outside this issue's scope.Closes #1063