[codex] Wire Sun context runtime deps#894
Conversation
Greptile SummaryThis PR replaces direct
Confidence Score: 5/5Safe to merge — the window.* → dependency-injection migration is complete and the fallback values for all 14 deps match the prior code's behavior. All production code paths in sun-context.js are correctly wired to sunContextDeps, defaults match the old window.* fallbacks, the startup hook covers every registered dep key, and the service worker cache and verify-modules assertions keep coverage honest. The two observations in test-sun-context.js are about test teardown patterns; neither affects production behavior or test correctness under current conditions. tests/test-sun-context.js — sections 6 and 9 set deps without try/finally protection, and the unknown-dep test sets isDebugMode outside the try block. All three are minor test hygiene concerns, not bugs. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[app-light-sun-modules.js] -->|imports| B[sun-context-hooks.js]
B -->|imports canonical deps from| C[sun.js / sun-spectrum.js / sun-uvdata.js / light-env.js / utils.js]
B -->|calls at module eval time| D[configureSunContext]
D --> E{key in sunContextDeps?}
E -->|yes| F[update sunContextDeps key]
E -->|no| G[_debugWarn unknown key]
G --> H{isDebugMode returns true?}
H -->|yes| I[console.warn]
H -->|no| J[silent skip]
D --> K[return previous snapshot]
L[sun-context.js] -->|exports configureSunContext| D
L -->|exports buildSunContext| M[reads from sunContextDeps]
O[Tests] -->|configureSunContext with mock deps| D
O -->|configureSunContext with returned snapshot| K
Reviews (2): Last reviewed commit: "Wire Sun context runtime deps" | Re-trigger Greptile |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
b39a1d5 to
e0f30f6
Compare
|
Deployment failed with the following error: Learn More: https://vercel.com/elkimeks-projects?upgradeToPro=build-rate-limit |
Summary
configureSunContextand a startup hook so Sun AI context helpers are wired from canonical modules instead of directwindow.*reads.verify-modules.windowReferencesfrom 1164 to 1119.Validation
npm run typechecknpm run qualitynode tests/test-sun-context.jsnpm run test:playwright -- tests/playwright/sun-context-browser-coverage.spec.js./run-tests.sh