Repository navigation
fix(types): keep command environments compatible with mobile compilation - #23073
Merged
Merged
Conversation
Jinwoo-H
added a commit
that referenced
this pull request
Sep 26, 2026
Picks up #23073 (mobile typecheck fix on main) so CI runs on a current merge ref. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Command environment types —
mergeCommandEnvironmentnow declaresbaseand its return asRecord<string, string | undefined>instead ofNodeJS.ProcessEnv, avoiding Expo's requiredNODE_ENVaugmentation while keeping desktop behavior identical.
The change is type-only, correctly matches the implementation (which returns base or an Object.fromEntries map), and loosens rather than asserts. Verified pnpm tc:node passes and src/shared/command-environment.test.ts passes all 5 tests, including Windows key folding and the unchanged-base case.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
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.

ELI5
Mobile builds were blocked by a shared command helper claiming its environment map always contained Expo's required NODE_ENV field. The helper now declares the map it actually accepts and returns.
What Changed
Change the input and return annotations of mergeCommandEnvironment from NodeJS.ProcessEnv to Record<string, string | undefined>. There is no executable-code change. Desktop keeps its existing environment merge behavior, including case-insensitive Windows keys, and the mobile typecheck succeeds.
Why
Expo augments NodeJS.ProcessEnv with a required NODE_ENV field. A command-specific environment is an arbitrary map and does not promise that field. Using the map's real type avoids a cast or fabricating NODE_ENV, either of which would obscure the contract or change command behavior.
Linked Issue
Follow-up to #22427, exposed by the refreshed #22279 mobile check.
Visual Proof
N/A — type annotations only.
Testing
Review
One file, two type annotations. No casts, new dependency, environment value or runtime behavior.
Agent skill upstream boundary
Notes
Cross-platform, SSH and folder-workspace runtime behavior is unchanged. No wire change.
Checklist