Repository navigation
fix(theme): validate what lich's install accepts on three edge cases - #52
Merged
Merged
Conversation
validate.mjs disagreed with readPackTheme and Import in lich's
internal/themes:
- formatVersion 0 was rejected; lich decodes an omitted one to 0 and
reads it as format 1.
- a source that does not decode into {url, version} passed; lich fails
to parse the file. Its contents stay unchecked, since both install
paths replace a written source before validating.
- a directory named *.json counted toward the repository's themes, so
a pack holding only one passed; lich skips it.
This was referenced Oct 8, 2026
Merged
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.
Aligns validate.mjs with readPackTheme/Import in lich's internal/themes, one test each (failing before, passing after):
formatVersion: 0passes: lich decodes an omitted one to 0. (lich's own schema saysminimum: 1, which the Go accepts below; not touched here.)sourcethat does not decode into{url, version}fails as a parse error. Its contents are not run through validateRemote: Import drops a written source and readPackTheme replaces it, so lich never rejects a theme for one. A test pins that a decodablesourcewith a bad URL passes.*.jsonis skipped in a repository, not counted (a pack of only that now reports no theme JSON).node --test tests/*.test.mjs: 335 pass. Real packs (rose-pine, lotus, catppuccin, eldritch, moonfly, oceanic-next) still pass.