chore: replace dotenv-mono with dotenv and try to fix env variables#1261
chore: replace dotenv-mono with dotenv and try to fix env variables#1261Crunchyman-ralph merged 2 commits intonextfrom
Conversation
|
WalkthroughUpdates environment handling and dependencies by removing Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Node as Node.js
participant TSDown as tsdown.config.ts
participant Dotenv as dotenv/config
Note over TSDown,Dotenv: Module initialization time
Node->>TSDown: import tsdown.config.ts
TSDown->>Dotenv: import "dotenv/config"
activate Dotenv
Dotenv-->>Node: load .env into process.env (side-effect)
deactivate Dotenv
TSDown-->>Node: continue config setup
sequenceDiagram
autonumber
participant App as tm-core
participant Store as storage-factory
participant Config as app config
participant Env as process.env
App->>Store: request API base URL
alt config.apiEndpoint present
Store->>Config: read apiEndpoint
Config-->>Store: return value
else
Store->>Env: read TM_PUBLIC_BASE_DOMAIN
Env-->>Store: value or undefined
alt undefined
Store-->>Store: use default URL
end
end
Store-->>App: resolved API base URL
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-09-02T21:51:41.383ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (6)
package.json(1 hunks)packages/build-config/package.json(0 hunks)packages/build-config/src/tsdown.base.ts(1 hunks)packages/tm-core/package.json(0 hunks)packages/tm-core/src/storage/storage-factory.ts(1 hunks)tsdown.config.ts(1 hunks)
💤 Files with no reviewable changes (2)
- packages/build-config/package.json
- packages/tm-core/package.json
🧰 Additional context used
📓 Path-based instructions (1)
package.json
📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)
Add and update test scripts in package.json to include test, test:watch, test:coverage, test:unit, test:integration, test:e2e, and test:ci
Files:
package.json
🧠 Learnings (1)
📚 Learning: 2025-09-02T21:51:41.383Z
Learnt from: Crunchyman-ralph
PR: eyaltoledano/claude-task-master#1178
File: packages/tm-core/src/auth/config.ts:0-0
Timestamp: 2025-09-02T21:51:41.383Z
Learning: In packages/tm-core/src/auth/config.ts, the BASE_DOMAIN configuration intentionally does not include runtime environment variable fallbacks like TM_BASE_DOMAIN or HAMSTER_BASE_URL. The maintainers prefer to keep these capabilities "hush hush" and undocumented, using only the build-time TM_PUBLIC_BASE_DOMAIN and the default value.
Applied to files:
packages/tm-core/src/storage/storage-factory.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test
🔇 Additional comments (3)
package.json (2)
20-28: Test scripts are properly configured.All required test scripts are present:
test,test:watch,test:coverage,test:unit,test:integration,test:e2e, andtest:ci.As per coding guidelines.
84-84: Consider explicitly configuring dotenv quiet behavior.Version 16.6.1 defaults to
quiet: true(suppressing informational logs), but version 17.0.0+ defaults toquiet: false. For consistent behavior across future upgrades, consider explicitly setting thequietoption when callingdotenv.config().In
tsdown.config.ts, update the import to explicitly configure dotenv:-import 'dotenv/config'; +import dotenv from 'dotenv'; +dotenv.config({ quiet: true }); // or false, based on your preferenceBased on learnings.
Likely an incorrect or invalid review comment.
tsdown.config.ts (1)
3-3: Side-effect import pattern is appropriate.Using
import 'dotenv/config'ensures environment variables are loaded at module initialization, beforegetBuildTimeEnvs()reads them. This is the recommended pattern for build-time environment variable injection.
What type of PR is this?
Description
Related Issues
How to Test This
# Example commands or stepsExpected result:
Contributor Checklist
npm run changesetnpm testnpm run format-check(ornpm run formatto fix)Changelog Entry
For Maintainers
Summary by CodeRabbit