feat(phase-8): envFile config loading + smoke-tests moved into prescient-sdk-ts#51
Open
ms280690 wants to merge 2 commits into
Open
feat(phase-8): envFile config loading + smoke-tests moved into prescient-sdk-ts#51ms280690 wants to merge 2 commits into
ms280690 wants to merge 2 commits into
Conversation
…nt-sdk-ts envFile support (all 5 jsii language targets): - src/types.ts: add envFile?: string to PrescientClientOptions; relax endpointUrl/clientId/authUrl to optional (runtime validation unchanged) - src/settings.ts: parseEnvFile() pure-TS KEY=VALUE parser; constructor overlays fileEnv at lowest priority (opts > process.env > file > defaults); resolveAuthProvider/resolvePort accept fromFile fallback; PRESCIENT_GOOGLE_CLIENT_SECRET from file → _googleClientSecret only - src/__tests__/settings.test.ts: 16 new tests (load, override order, Google secret from file, quoted values, comments, missing file error) - README.md: configuration section with examples for all 5 languages - JSII_MIGRATION_PLAN.md: Phase 7 marked done; Phase 8 added Smoke test relocation (smoke-tests/ → prescient-sdk-ts/smoke-tests/): - justfile: compose path updated (/../smoke-tests → /smoke-tests) - docker-compose.yml: host-side volume paths updated (../prescient-sdk-ts/X → ../X) - .gitignore: dotnet build artifact paths updated automatically by git mv - smoke-tests/config.env: fake-value config tracked via .gitignore negation - All 5 containers mount config.env; smoke tests use envFile instead of inline opts - smoke-tests/python/smoke.py: fix import (prescient_sdk); use flat kwarg API All 5 language smoke tests confirmed passing from new location. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a cross-language envFile configuration option to the jsii SDK so consumers in all five target languages can load a config.env file through the shared TypeScript runtime (no per-language dotenv dependency). Relocates the multi-language Docker smoke tests under prescient-sdk-ts/smoke-tests/ and rewrites each one to use the new envFile option.
Changes:
- Add
envFile?: stringtoPrescientClientOptions, relaxendpointUrl/clientId/authUrlto optional at the type level, and implement a pure-TSparseEnvFile()overlay inSettingsat the lowest priority (explicit opts >process.env> file > defaults). Google client secret continues to be sourced only from env/file, never from public options. - Move
smoke-tests/intoprescient-sdk-ts/smoke-tests/, mountconfig.envinto all five containers, rewrite each language smoke test to useenvFile, and updatejustfile/docker-compose.yml/.gitignorepaths accordingly. - Add 16 new Jest tests for envFile behavior and refresh
README.md/JSII_MIGRATION_PLAN.md(Phase 7 marked done, Phase 8 described).
Reviewed changes
Copilot reviewed 15 out of 25 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| prescient-sdk-ts/src/types.ts | Make required URL/client fields optional and add documented envFile field. |
| prescient-sdk-ts/src/settings.ts | Add file parser, overlay file values at lowest priority, extend resolveAuthProvider/resolvePort with fromFile. |
| prescient-sdk-ts/src/tests/settings.test.ts | 16 new tests covering load, precedence, secrets, comments, quotes, missing file, port. |
| prescient-sdk-ts/smoke-tests/{js,python,go,dotnet,java}/* | Rewrite each smoke test to use envFile, plus build files for each language. |
| prescient-sdk-ts/smoke-tests/docker-compose.yml | Update host-side paths after move; mount config.env into each service. |
| prescient-sdk-ts/smoke-tests/docker/Dockerfile.* | Copy Node binary into each non-JS language image. |
| prescient-sdk-ts/smoke-tests/config.env, .gitignore | Tracked fake-value config and gitignore negation. |
| prescient-sdk-ts/justfile | Point compose at the new in-tree location. |
| prescient-sdk-ts/README.md, JSII_MIGRATION_PLAN.md | Document config flow, Phase 7 done, Phase 8 added. |
| .gitignore | Re-anchor smoke-test build artefact ignore paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
envFile?: stringtoPrescientClientOptionsso all 5 jsii language targets can load aconfig.envfile — file is read in the shared Node.js runtime, no per-language dotenv library neededprocess.env> envFile values > built-in defaultsPRESCIENT_GOOGLE_CLIENT_SECRETfrom file flows to_googleClientSecretonly — never surfaces in any public structendpointUrl/clientId/authUrloptional in the interface (required values still enforced at runtime inSettings.validate)smoke-tests/intoprescient-sdk-ts/smoke-tests/; all 5 smoke tests now useenvFileinstead of inline optionsChanges
SDK (
prescient-sdk-ts/src/)types.ts: addenvFilefield; relax required fields to optionalsettings.ts:parseEnvFile()pure-TS KEY=VALUE parser; constructor overlays file values at lowest priority;resolveAuthProvider/resolvePortacceptfromFilefallback__tests__/settings.test.ts: 16 new tests — load, override order, Google secret from file, quoted values, comments, missing file error (80 total, all passing)Docs
README.md: configuration section with file/env/explicit examples for all 5 languagesJSII_MIGRATION_PLAN.md: Phase 7 marked done with real impl details; Phase 8 added; directory structure updatedSmoke tests (moved + updated)
smoke-tests/→prescient-sdk-ts/smoke-tests/justfile: compose path updateddocker-compose.yml: host-side volume paths updated (../prescient-sdk-ts/X→../X);config.envmounted into all 5 containerssmoke-tests/config.env: fake-value config file tracked via.gitignorenegationenvFilepath; Python import fixed (prescient_sdkflat kwargs API)Test plan
pnpm test— 80 tests, all passingpnpm run build— jsii compiles clean, no errorspnpm run package— all 5 language targets generatedjust docker— all 5 language smoke tests pass🤖 Generated with Claude Code