Feature/implement v2#25
Open
MaheeGamage wants to merge 5 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes environment-backed application configuration into explicit server/client config facades (with validation + shared boolean parsing), removes the old vocab-saving flag wrapper, and updates documentation/project scaffolding accordingly.
Changes:
- Added
src/config/config facade modules (config.server.ts,config.client.ts) plus env/boolean helpers and unit tests. - Migrated auth + vocab saving gates to use the new config modules and removed
vocabSavingFlag.ts/ theVOCAB_SAVING_ENABLEDoverride. - Updated docs, project templates/tasks, and devcontainer/attributes to align with the new config approach and improve line-ending handling.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/vocab-store/vocabSavingFlag.ts | Removed legacy env-flag wrapper in favor of centralized config. |
| src/modules/vocab-store/saveVocab.ts | Client-side save gate now reads config.VOCAB_SAVING_ENABLED. |
| src/lib/auth.ts | OAuth client ID/secret now sourced from config.server. |
| src/config/env.ts | Introduced server-only env helpers (requireEnv, optionalEnv). |
| src/config/env.test.ts | Added unit tests for env helper behavior. |
| src/config/config.server.ts | Added server-side config facade (required env validation + vocab flag). |
| src/config/config.server.test.ts | Added tests ensuring fail-fast behavior and boolean flag parsing. |
| src/config/config.client.ts | Added client-safe config facade sourced from NEXT_PUBLIC_*. |
| src/config/booleanEnv.ts | Added shared pure boolean env parsing helper. |
| src/config/booleanEnv.test.ts | Added tests for boolean parsing semantics. |
| src/app/api/vocab/route.ts | Server-side save route now gates via config.VOCAB_SAVING_ENABLED. |
| README.md | Updated env var docs to remove server override and reflect unified flag usage. |
| docs/setup-guide.md | Updated setup guidance and references for the new config/flag approach. |
| .project/templates/task.md | Improved guidance for writing skimmable task descriptions. |
| .project/templates/goal.md | Improved guidance for writing skimmable goals/context/success criteria. |
| .project/tasks/task-019_centralized-app-config.md | Added/updated task record describing config-facade approach and migration. |
| .project/tasks/task-018_unified-settings-management.md | Added draft task describing future unified settings registry. |
| .project/tasks/task-006_google-sheets-adapter.md | Added post-done note documenting removal of server-side override flag. |
| .project/README.md | Documented “readable over complete” convention for human-facing sections. |
| .project/overview.md | Updated active-goal task list to include new tasks. |
| .gitattributes | Added line-ending normalization rules (LF for .sh). |
| .env.local.example | Removed VOCAB_SAVING_ENABLED override from example env file. |
| .devcontainer/Dockerfile | Strips CRLF from firewall script before chmod to avoid shebang failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1
to
+2
| import { requireEnv } from './env.ts'; | ||
| import { parseBooleanEnv } from './booleanEnv.ts'; |
| @@ -0,0 +1,14 @@ | |||
| // Server-only raw env access. Only used inside config.server.ts entries that are in fact | |||
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.
No description provided.