-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: replace environment helpers with std-env #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 files reviewed, 1 comment
d0c6cf0 to
fdb6a1f
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
19b338e to
749a555
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, 1 comment
749a555 to
e2eea4a
Compare

Summary
Testing
Greptile Overview
Greptile Summary
Replaces custom environment detection utilities with std-env library and removes
NODE_ENVpreset management across the monorepo.Key Changes
packages/utils/src/environment.tscontaining customisDevelopment(),isProduction(),isCI()helpersisDevelopment,isProduction,isCI,isTest)node()preset from env configurations (no longer validatesNODE_ENV)createUrlBuilderdefault protocol from environment-based (httpin dev,httpsin prod) to alwayshttpsisDevelopmentoverride parameter to logger configuration for browser/mobile contexts where std-env may not auto-detect correctlyisCI()to direct constant accessisCIthroughout codebaseNODE_ENVfrom turbo.jsonglobalPassThroughEnvMigration Pattern
Apps using bundlers (Vite, Webpack) now use
import.meta.env.DEV/import.meta.env.PRODfor runtime environment checks, while packages use std-env constants. The logger accepts an explicit override to handle edge cases where auto-detection fails.Confidence Score: 4/5
createUrlBuilderdefault protocol behavior (now always defaults to https instead of environment-based). The PR author acknowledged this in testing notes, and previous thread confirms awareness, but requires verification that all call sites handle development http correctly.createUrlBuildercall sites explicitly pass protocol when http is needed in developmentImportant Files Changed
Sequence Diagram
sequenceDiagram participant App as Application Code participant ImportMeta as import.meta.env participant StdEnv as std-env participant Logger as Logger Config participant Monitoring as Monitoring Setup Note over App,Monitoring: Environment Detection Flow App->>ImportMeta: Check import.meta.env.DEV ImportMeta-->>App: Boolean (dev mode) App->>ImportMeta: Check import.meta.env.PROD ImportMeta-->>App: Boolean (prod mode) App->>Logger: configureLogger({ isDevelopment }) Logger->>StdEnv: import { isDevelopment } StdEnv-->>Logger: Boolean constant Logger->>Logger: Use override or std-env default Logger-->>App: Logger configured App->>Monitoring: initializeErrorMonitoring() Monitoring->>StdEnv: import { isProduction } StdEnv-->>Monitoring: Boolean constant Monitoring->>Monitoring: Set sample rate based on env Monitoring-->>App: Monitoring initialized App->>App: createUrlBuilder(url, protocol) Note over App: Protocol defaults to 'https'<br/>Override with import.meta.env.PROD check