Repository navigation
CLI
Run the commands with npx srl <command> in the project root, or through the npm scripts of the project. npx srl --help and npx srl <command> --help show the built-in help, and npx srl --version shows the installed version.
| Command | Short description |
|---|---|
srl init |
Create a new project |
srl prepare |
Copy the srl/ folder into the project |
srl create |
Create a new component or group |
srl add |
Add components or groups from the library |
srl remove |
Remove components or groups |
srl build |
Production build |
srl map |
Regenerate SCSS imports and the Livingdocs design |
srl beaver |
Regenerate the SCSS modules from srl.config.json
|
srl ddev |
Build the app for a local DDEV environment |
npx @simple-reporting/base@latest init <folder>| Argument | Required | Description |
|---|---|---|
<folder> |
yes | Folder to create the project in (relative to the current directory). Must not exist yet. |
You are asked for the project name, which defaults to <folder> and is written to package.json. Then the command:
- copies the project skeleton,
- installs the base components (marked ✅ in Component Library),
- sets the DDEV project name,
- writes
.gitignore.
Run npm install afterwards.
npx srl prepareNo arguments. Replaces the project's srl/ folder with the version from the installed package and writes srl/.gitignore. Runs automatically on npm install (postinstall), so you normally never call it yourself.
npx srl create component [group/name]
npx srl create group [name]| Argument | Description |
|---|---|
component | group
|
What to create |
[name] |
Optional. For components: <group>/<name>, e.g. 020.Text/090.info-box. If omitted, you are asked for it. |
For components:
- If only the name is given, you pick the group from a list of the existing groups.
- If the group folder does not exist yet, it is created.
- The component gets an
.html, anld-conf.jsonand anscss/folder.
Remember the numeric prefixes. They define the order in the editor and are not part of the name (see Components).
npx srl create component 020.Text/090.info-box
npx srl create group 140.Key_Figuresnpx srl add components
npx srl add groups| Argument | Description |
|---|---|
components |
Pick single components from the library (interactive multi-select) |
groups |
Pick whole groups; all of their components are added |
Already existing components are skipped and never overwritten. The SCSS imports and the design are regenerated afterwards. The available components are listed in Component Library.
npx srl remove components
npx srl remove groups| Argument | Description |
|---|---|
components |
Pick components of the project to delete (interactive) |
groups |
Pick groups of the project to delete, including all their components |
You are asked for confirmation before anything is deleted.
npx srl build [version] [-t <targets>] [-c <customer>] [--no-clean]| Argument / option | Default | Description |
|---|---|---|
[version] |
prompted | Version of the Livingdocs design, e.g. 1.4.0. Written to package.json. Only used when ldd is built; if missing, you are asked (default: current package.json version). |
-t, --target <targets> |
all | Comma-separated list of targets to build (see below) |
-c, --customer <customer> |
– | Additionally builds the customer-specific PDF/XBRL files from pdf/customers/<customer>/. all builds every customer folder. Only works together with the pdf target. |
--no-clean |
clean | Keeps the existing .output/ folder. Without this option, .output/ is deleted first. |
| Target | Builds | Output |
|---|---|---|
app |
Web app |
.output/app/, .output/app.zip
|
pdf |
CSS + JS for PDFreactor |
.output/pdf/ (also copied to .output/) |
word |
Word CSS |
.output/word/ (also copied to .output/) |
xbrl (or xhtml) |
XBRL/XHTML CSS |
.output/xbrl/ (also copied to .output/) |
ldd |
Livingdocs design incl. validation |
.output/ldd/, .output/design.zip
|
Fonts are built automatically if pdf or ldd is part of the build. The order of the targets in the list does not matter. The build always runs in the fixed order shown in Build.
# Everything; asks for the design version
npx srl build
# Everything with a version, no prompt (e.g. in CI)
npx srl build 1.4.0
# Only the PDF files
npx srl build -t pdf
# PDF and Word, keep the rest of .output/
npx srl build -t pdf,word --no-clean
# Design for the editor with version
npx srl build 1.4.0 -t ldd
# PDF with the files of one customer, or of all customers
npx srl build -t pdf -c acme
npx srl build -t pdf -c allArguments are passed through the npm scripts, so this also works:
npm run build -- 1.4.0 -t pdf,word
npm run build-pdf -- --no-clean--no-clean is useful to rebuild single targets without losing the output of earlier builds, e.g. first -t ldd and then -t pdf --no-clean.
Each folder in pdf/customers/ is one customer. The customer build:
- builds
custom.tsandcustom.scssof the customer on top of the regular PDF (and XBRL) output, - writes the result to
.output/ldd/pdf/<name>/(and.output/ldd/xbrl/<name>/), - generates a
pdf-configuration.xml/pdf-configuration-debug.xmlfor PDFreactor.
<name> is the folder name up to the first -, e.g. acme-2025 → acme.
The configuration points to the design URL from INTERNAL_LDD_URL, or to the default nswow design URL if that is not set.
npx srl mapNo arguments. Regenerates the SCSS imports per target (.srl/imports/*.scss), the Livingdocs design and the registration of the component Vue files (.srl/plugins/asyncLdComponent.ts). It does not run beaver. srl add and npm run dev do this automatically. Run it by hand after adding or removing component files while the dev server is not running.
npx srl beaverNo arguments. Regenerates only the SCSS modules from srl.config.json (srl/config.scss, srl/colors.scss, srl/typography.scss) and lists the written files. See Design Tokens.
npx srl ddevNo arguments. Builds the web app in production mode to .output/ddev/ for the project's local DDEV environment.
| Script | Runs |
|---|---|
npm run dev |
vite (dev server) |
npm run build |
srl build |
npm run build-app |
srl build --target app |
npm run build-ldd |
srl build --target ldd |
npm run build-pdf |
srl build --target pdf |
npm run build-word |
srl build --target word |
npm run build-xbrl |
srl build --target xbrl |
npm run preview |
vite preview (serves the built app) |
npm run type-check |
vue-tsc --build |
npm run test:unit |
vitest |
npm run lint / npm run format
|
ESLint / Prettier |