feat(npm): ship schema.json inside the fallow package (#275)#279
Merged
BartWaardenburg merged 2 commits intofallow-rs:mainfrom May 5, 2026
Merged
Conversation
Today the published `fallow` npm package omits `schema.json`, so the
only stable way to point `$schema` at a matching schema is the
`raw.githubusercontent.com/.../main/schema.json` URL — which:
- drifts from the installed CLI version (URL tracks main, install
is pinned to a tag),
- requires network on every fresh editor open and trips up
corporate proxies that block raw.githubusercontent.com,
- has no clean offline / airgapped story.
Two-line fix:
- Add `schema.json` to `npm/fallow/package.json`'s files array.
- In the release workflow, copy `schema.json` from the repo root
to `npm/fallow/schema.json` immediately before the `npm publish
./npm/fallow` step. We can't rely on a prepublishOnly hook here
because the existing publish call uses `--ignore-scripts`.
After this, consumers can write:
{
"$schema": "./node_modules/fallow/schema.json",
...
}
…and get version-aligned validation with zero network calls. The
remote URL keeps working as a fallback for users without a local
install.
The optional `fallow init` template change suggested in the issue
isn't included here — that lives in the Rust CLI and is best done as
a follow-up once this artifact is actually published.
Collaborator
|
Merged in 547ac02. Thanks for the clean two-line fix, @ChrisJr404. The next |
Collaborator
|
Released in v2.65.0. Thanks @ChrisJr404. |
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.
Closes #275.
Two-line fix to bundle the JSON schema into the published `fallow` npm package so consumers can reference `./node_modules/fallow/schema.json` instead of the `raw.githubusercontent.com` URL. That fixes the three downsides @OmerGronich called out:
What changed
After this, the issue's recommended consumer config works:
```jsonc
// .fallowrc.json
{
"$schema": "./node_modules/fallow/schema.json",
...
}
```
The existing remote URL (`raw.githubusercontent.com/fallow-rs/fallow/main/schema.json`) keeps working as a fallback for users without a local install — nothing about this change breaks the remote-URL path.
What's not in this PR
The optional `fallow init` template polish (emit `./node_modules/fallow/schema.json` by default) lives in the Rust CLI and is a separate change that's only meaningful once this artifact has actually been published. Happy to do that as a follow-up after the next release if you'd like.
Test plan