shadwire.json
The manifest the CLI writes at your app's root. diff, update and remove read it to know what you have installed.
shadwire init writes this file once. After that, every
add, update and remove
updates the installed section. Commit it along with the rest of your code.
Fields
| Field | What it is |
|---|---|
registry |
The base URL the CLI installs from. init --registry sets it. Accepts https:// and file://. |
tailwind.css |
The app's Tailwind entrypoint, where init adds the @import of shadwire.css. |
aliases |
Where each kind of file goes. Change these if your app does not follow the standard Rails tree. |
installed |
One entry per component: the registry version and the files it owns. diff, update and remove work from this list. |
Aliases
Each file in the registry has a kind (component, helper, Stimulus controller, CSS), and the alias for that kind sets the directory it is written to.
| Alias | Default | Receives |
|---|---|---|
components |
app/components |
The shared UiComponent superclass. |
ui |
app/components/ui |
The component classes and their templates. |
helpers |
app/helpers |
The Ui::*Helper modules holding the ui_* wrappers. |
controllers |
app/javascript/controllers |
The Stimulus controllers of the interactive components. |
vendorCss |
vendor/shadwire |
shadwire.css, which holds the tokens. |
If your app has a different layout, an engine for example, point the aliases at the right
directories before the first add:
Changing an alias after installing moves nothing
installed[].files still point to where the files were first
written. To change an alias after installing components, remove them, change the alias,
and install them again.
The Tailwind @import
init adds this import to the file tailwind.css
points to. It is what brings the tokens into the Tailwind build:
bin/shadwire status --json includes
tailwind.importPresent. If it is false, the
import has been removed and the components will render without colours.
How the registry is resolved
Every command picks the registry URL in this order:
- the
--registryflag, if passed; - the
registryfield of the app'sshadwire.json; - the built-in default,
https://shadwire.edumoraes.dev.br/r.
Passed to init, --registry is saved in the file.
Passed to any other command, it only applies to that run. The
Registry
page describes the format.