fix(auto-update-checker): resolve unknown version display and improve JSONC parsing
#54
+21
−10
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.
Screenshots
Problem
The startup toast was displaying "unknown" version for local development mode (
file://plugin entries).Root Causes
Incorrect
file://URL handlingMissing JSONC config file check
opencode.json, missedopencode.jsoncfiles.jsoncconfigsUnsafe JSONC comment stripping
Changes
1. Fix
file://URL parsingfileURLToPath()fromnode:urlfor proper cross-platform handling2. Add JSONC file detection
USER_OPENCODE_CONFIG_JSONCconstant.jsonand.jsoncfiles3. Make
stripJsonCommentsstring-aware4. DRY refactor
getConfigPaths(directory)helper to eliminate duplicated config path arraysfile://check infindPluginEntrywas unreachable)Testing
Verified
stripJsonCommentshandles edge cases:Files Changed
checker.tsconstants.tsUSER_OPENCODE_CONFIG_JSONCCommits
2ced728fix: resolve unknown version display in startup toast6c65ac1refactor: improve config handling and cleanup8b1232afix: make stripJsonComments string-awareb57ed42refactor: remove dead file:// check from findPluginEntry1671435chore: restore original log statements