CLI
The @blotch/dolan CLI copies UI components into your app. Later, it tells you when they change and merges the updates for you.
- Run every command from your project folder.
npxruns your installed copy once@blotch/dolanis a dependency (see installation). The shorternpx dolan <command>works too.npx @blotch/dolan --helplists the commands, and<command> --helplists a command's options.--versionprints the version.- Every command except
initandinfoneeds adolan.config.json. Runinitfirst: it writes the file. - In CI, a script or an AI agent, the commands ask nothing. See Without a terminal.
Where updates come from
The CLI package contains the component source. It doesn't download anything. So "upstream" in every command means the source bundled with the @blotch/dolan version you have installed.
To get newer components, upgrade the CLI and then update:
The CLI keeps two files at the project root. Commit both.
dolan.config.json: where components and theme files go. Paths are relative to the project folder.dolan.lock.json: a hash of every copied file, as it was when dolan wrote it. dolan compares it with your file and the bundled source to tell who changed what.
If your project has an .oxfmtrc.json and oxfmt installed, dolan formats the .ts files it writes with your settings.
Without a terminal
In CI, a script or an AI agent, a command's input isn't a terminal, so nobody can answer its questions.
- The commands ask nothing. Each question takes its default answer.
- Some stop instead. Where a question has no default, or its default would cancel the run, the command exits with code 1. It does so before changing anything, and says what to pass instead.
To get the same in a terminal, redirect the input, as in npx @blotch/dolan update < /dev/null. init also takes --yes.
init
Sets up dolan in your project and copies the theme files.
It asks where to install components and theme files, then sets up the project:
- Writes
dolan.config.json. If one exists, it asks before overwriting (default No). - Copies the theme files into the theme folder:
default.css,dark.cssandtailwind.css.- On Tailwind 3, it copies
tailwind-plugin.tsin place oftailwind.css. That's an app with atailwind.config.*, or without Tailwind 4 installed. - With the testing library, it also copies the plugin's test,
tailwind-plugin.test.ts. That's when yourpackage.jsonlists@blotch/angular-lynx-testing-library(see add). - If a theme file is already there and differs, it asks before overwriting (default No), and keeps yours otherwise.
- On Tailwind 3, it copies
- Records the theme files' hashes in
dolan.lock.json, soupdatecan tell whether you've edited them. - Installs
@blotch/dolanas a dependency ifpackage.jsondoesn't list it, with your package manager. The copied components import its utilities. If the install fails, the next steps say how to run it. - Creates the components folder and prints the next steps.
- The
@importlines for the theme files, and on Tailwind 3, the Tailwind plugin for your config. - They're written relative to your global stylesheet: the first
stylesentry inangular.json,src/styles.cssby default.
- The
Without a terminal, or with --yes, init asks nothing:
- The folders come from
--componentsand--theme, or are the defaults. - Theme files that differ are kept, and
initlists them. Add--forceto replace them. - An existing
dolan.config.jsonstopsinitwith exit code 1, before it changes anything. Add--forceto overwrite it.
theme
Lists your theme files, or starts a new theme.
- Without a name, it lists the
.cssfiles in your theme folder. - With a name, it copies
default.cssto<theme folder>/<name>.cssfor you to edit. It stops if that file exists.
Import the new file in place of default.css. See Theming.
doctor
Checks your setup, and exits with code 1 if any check fails.
Options: none. It runs these checks in order:
What the checks look for
- Font size: the components are sized in
remfor a 16px root, where Lynx's own is 14px. - Tailwind set up for its version: no
tailwind.config.*on Tailwind 4, and atailwind.config.*on Tailwind 3. - The other version's theme files:
tailwind-plugin.tsand its test on Tailwind 4, ortailwind.csson Tailwind 3. -rgbtwins are what opacity modifiers such asbg-primary/50read. The check suggests the line to add for a missing one.- Components' colors are missing from a theme copied before the component existed. The check quotes dolan's lines for them.
- Ejected components: their files aren't checked.
- A
utilspath in an older config is allowed but not needed.
Finding Tailwind
doctor looks for tailwindcss the way the build does, from your app's folder, and reports its version:
- It finds Tailwind that your workspace root installs. It also finds the one
@tailwindcss/postcssbrings, when yourpackage.jsonlists only that. - A
tailwind.config.*with Tailwind 4 installed gets a warning. dolan sets the theme up for Tailwind 3 while the config is there (see Move to Tailwind 4). - So does Tailwind 3 without a config, which the build needs to run it.
Related
- Add and remove components:
add,info,removeandeject - Check and update components:
list,diff,outdatedandupdate - UI Components: install dolan and add your first component
- Theming: the theme files
initcopies - Tailwind CSS: required by every component
