refactor: remove .deps-installed.json marker file to match upstream #253
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
Removes the
.deps-installed.jsonmarker file mechanism that was dropping files in user project directories, causing confusion for users developing against the opencode repo.Changes
Refactoring
installDependencies()inconfig.tsto match upstream behaviorInstallation.isLocal()check).deps-installed.jsonin project directories.deps-installed.jsonfrom the.gitignoretemplateBreaking Changes
None
Testing
Existing tests cover changes. The removed test was specific to the marker file caching mechanism which is no longer used.
Greptile Summary
Reverted the
installDependencies()function to match upstream behavior by removing the.deps-installed.jsonmarker file caching mechanism that was creating files in user project directories.Key Changes:
Installation.isLocal()check.deps-installed.jsonfrom.gitignoretemplateIssues Found:
config.ts:183- the ternary check forInstallation.isLocal()is unnecessary since the function returns early when this condition is trueConfidence Score: 4/5
packages/opencode/src/config/config.ts- fix the unreachable ternary on line 183Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant Config participant Installation participant BunProc participant FileSystem User->>Config: get() Config->>Config: installDependencies(dir) alt Installation.isLocal() == true Config->>Installation: isLocal() Installation-->>Config: true Config-->>User: return (skip install) else Installation.isLocal() == false Config->>Installation: isLocal() Installation-->>Config: false Config->>FileSystem: check package.json exists alt package.json missing Config->>FileSystem: write empty package.json end Config->>FileSystem: check .gitignore exists alt .gitignore missing Config->>FileSystem: write .gitignore with patterns end Config->>Installation: BASE_VERSION Config->>BunProc: add @opencode-ai/plugin@VERSION BunProc-->>Config: success/failure Config->>BunProc: install (additional deps) BunProc-->>Config: success/failure Config-->>User: return end