@nimtech/nimpress 2.3.8 → 2.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/nimpress/SKILL.md +220 -0
- package/dist/cli.es.js +1018 -679
- package/dist/src/cli/completion.d.ts +5 -0
- package/dist/src/cli/completion.d.ts.map +1 -0
- package/dist/src/cli/skill.d.ts +4 -0
- package/dist/src/cli/skill.d.ts.map +1 -0
- package/dist/src/cli.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nimpress
|
|
3
|
+
description: Drive the nimpress documentation site cli from the terminal. Use when scaffolding a docs site, running or building it, linting content and frontmatter, managing the component workshop with schemas stories and harnesses, exporting pages for the docs sync pipeline, wiring gated pages to the auth provider, or installing this skill and shell completion.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# nimpress
|
|
7
|
+
|
|
8
|
+
`nimpress` is the cli of `@nimtech/nimpress`, a Svelte 5 documentation site framework. It scaffolds a site, serves it, builds it, lints the content, drives the component workshop, collects pages for the central docs site, and wires gated pages to the auth provider. Every command runs from the repo root of the site it acts on.
|
|
9
|
+
|
|
10
|
+
## Boundaries
|
|
11
|
+
|
|
12
|
+
1. The cli acts on the current working directory. There is no target flag and no remote mode. Change directory into the site before running anything.
|
|
13
|
+
|
|
14
|
+
2. Every command except `init`, `skill`, and `completion` loads the site config first. A missing or broken `nimpress.config.ts` or `nimpress.config.json` fails the command before it starts, so `nimpress init` is what a bare folder runs first.
|
|
15
|
+
|
|
16
|
+
3. `nimpress` writes only into the folders the `paths` config block declares. It never writes into the repo root beyond the config, the content folder, `CLAUDE.md`, `AGENTS.md`, and a temporary `index.html` that the build removes.
|
|
17
|
+
|
|
18
|
+
4. The authoritative authoring rules ship inside the package at `node_modules/@nimtech/nimpress/.claude/rules/`. Read the rule before writing content, never guess the frontmatter contract from a rendered page.
|
|
19
|
+
|
|
20
|
+
## Shape of every command
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
nimpress <command> [subcommand] [positional] [--flag] [--flag=value]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
With no arguments the cli runs `dev`. An unrecognised command fails with `[nimpress] unknown command: <name>`. Boolean flags are the bare `--name`. Value flags are always `--name=value`, never `--name value`. Positional arguments are the words that do not start with `--`.
|
|
27
|
+
|
|
28
|
+
## Commands
|
|
29
|
+
|
|
30
|
+
### init
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
nimpress init
|
|
34
|
+
nimpress init --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Writes `nimpress.config.ts` with every field documented and commented out, or `nimpress.config.json` with `--json`, and only when neither file already exists. Creates the content folder with an `index.md` when the folder is missing or empty. Writes `CLAUDE.md` and `AGENTS.md` when they are missing, each pointing at the packaged rules.
|
|
38
|
+
|
|
39
|
+
### dev
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
nimpress dev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Serves the site and starts one harness server for every configured component system. It stays running and binds the vite cli shortcuts.
|
|
46
|
+
|
|
47
|
+
### build
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
nimpress build
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Builds the static site into `paths.out`, then builds the harness bundle of every system whose `visibility` is not `dev-only`.
|
|
54
|
+
|
|
55
|
+
### lint
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
nimpress lint
|
|
59
|
+
nimpress lint --no-build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Runs the structure check, the frontmatter check, the import check, and the modules check, then builds into `<cache>/lint` to prove the output compiles and removes that folder afterwards. `--no-build` stops after the checks. A clean run prints `nimpress lint: structure, frontmatter, imports, and modules ok` and then `nimpress lint: build ok, everything passes`. Any problem prints one line per problem and exits 1.
|
|
63
|
+
|
|
64
|
+
### modules
|
|
65
|
+
|
|
66
|
+
The component workshop. `--system=<name>` names the system when several are configured, and is optional when exactly one is.
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
nimpress modules init
|
|
70
|
+
nimpress modules dev --system=nimtech
|
|
71
|
+
nimpress modules build --system=nimtech
|
|
72
|
+
nimpress modules lint --system=nimtech
|
|
73
|
+
nimpress modules story <Component> --system=nimtech --framework=vue
|
|
74
|
+
nimpress modules import <file> --system=nimtech --name=Button --source=./src/components --stories=./stories --match='^Btn' --from-stories --select
|
|
75
|
+
nimpress modules create <Component> --system=nimtech --framework=svelte
|
|
76
|
+
nimpress modules create --component=<ref> --schema
|
|
77
|
+
nimpress modules update <ref> --component=<ref> --system=nimtech
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
1. `init` creates the modules folder and adds a `modules` block to `nimpress.config.json` when that file exists.
|
|
81
|
+
|
|
82
|
+
2. `dev` serves the harnesses and never returns. `build` builds the deployable harness bundles.
|
|
83
|
+
|
|
84
|
+
3. `lint` checks the systems, the schemas, and the stories, and is the check to run after touching a component page.
|
|
85
|
+
|
|
86
|
+
4. `story` with a component name writes one auto story, and with no name writes an auto story for every component of the system. `--framework=vue` or `--framework=svelte` overrides the framework the system declares.
|
|
87
|
+
|
|
88
|
+
5. `import` with a positional file imports that one component, and `--name=` sets the page name. With no file it walks `--source=` or the system source, picks up `.stories.ts` files there and under `--stories=`, filters names with the `--match=` regular expression, and asks which components to take with `--select`. `--from-stories` takes the component list from the csf files and requires `--stories=`.
|
|
89
|
+
|
|
90
|
+
6. `create <Component>` creates the component page folder. `create --component=<ref> --schema` upserts a single schema instead, and `--schema` is required in that form.
|
|
91
|
+
|
|
92
|
+
7. `update` upserts every component schema from the component types, adding new members without touching authored defaults, enums, or descriptions. A positional reference or `--component=<ref>` limits it to one component.
|
|
93
|
+
|
|
94
|
+
### export
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
nimpress export --target=<name>
|
|
98
|
+
nimpress export --target=<name> --out=.nimpress
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Copies every page carrying `export: <name>` in its frontmatter, together with the whole folder that page sits in, into `paths.export`. A page with `export: true` is taken by every target. The `export:` and `file:` frontmatter lines are stripped and a `version:` line is written from the `version` field of `package.json` when the page carries a `package:` field. `--out=` overrides the destination.
|
|
102
|
+
|
|
103
|
+
### guard
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
nimpress guard map --dist=dist --out=guard.map.json
|
|
107
|
+
nimpress guard apply --dist=dist --map=uploaded.json
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Both read `access.json` from the build folder and fail with `[nimpress] guard: <path>/access.json not found, run a build first` when there is none. `--dist=` overrides `paths.out`.
|
|
111
|
+
|
|
112
|
+
1. `map` walks the guarded folder, records the path, the sha256, the size, the mime type, and the gates of every file, and writes the mapping. `--out=` names the file instead of `<dist>/guard.map.json`.
|
|
113
|
+
|
|
114
|
+
2. `apply` reads the mapping the asset host returned, requires `--map=`, writes the base url and the published asset list back into `access.json`, and removes both the guarded folder and `guard.map.json` from the build.
|
|
115
|
+
|
|
116
|
+
### skill
|
|
117
|
+
|
|
118
|
+
```sh
|
|
119
|
+
nimpress skill get
|
|
120
|
+
nimpress skill put
|
|
121
|
+
nimpress skill put --project
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`get` prints this document. `put` writes it to `~/.claude/skills/nimpress/SKILL.md`, or to `.claude/skills/nimpress/SKILL.md` under the current directory with `--project`, and prints the path it wrote.
|
|
125
|
+
|
|
126
|
+
### completion
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
nimpress completion zsh
|
|
130
|
+
nimpress completion --auto
|
|
131
|
+
nimpress completion --auto --skill
|
|
132
|
+
nimpress completion bash --auto
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
With a shell name and no `--auto` it prints the script for `bash`, `zsh`, `fish`, or `powershell` to stdout. `--auto` detects the shell from `$SHELL` when none is named, writes a nimpress owned file under `~/.config/nimpress/completions`, and points the rc file at it inside a block delimited by `# >>> nimpress completion >>>` and `# <<< nimpress completion <<<`. Rerunning `--auto` rewrites the block in place. fish is written to `~/.config/fish/completions/nimpress.fish` and needs no rc change. `--skill` installs this skill globally in the same step and only works alongside `--auto`.
|
|
136
|
+
|
|
137
|
+
## Where files land
|
|
138
|
+
|
|
139
|
+
The `paths` config block declares every folder nimpress writes, each with a default.
|
|
140
|
+
|
|
141
|
+
| Field | Default | What it holds |
|
|
142
|
+
| --- | --- | --- |
|
|
143
|
+
| `paths.out` | `dist` | the build root, build artifacts only |
|
|
144
|
+
| `paths.cache` | `node_modules/.nimpress` | the one cache root, layered per feature |
|
|
145
|
+
| `paths.export` | `.nimpress` | the handoff folder `export` fills |
|
|
146
|
+
| `paths.modules` | `_components` | the harness bundles under `out` and their url segment |
|
|
147
|
+
| `paths.guarded` | `_guarded` | the guarded pages under `out` and their url segment |
|
|
148
|
+
|
|
149
|
+
The cache is layered: `<cache>/site` for the docs vite cache, `<cache>/modules/<system>` for each harness, `<cache>/lint` for the lint verification build which is removed when lint finishes, and `<cache>/verify` as the one sanctioned scratch layer for throwaway verification pages. Never write ephemeral files anywhere else, and never commit anything from the cache root.
|
|
150
|
+
|
|
151
|
+
## The packaged rules
|
|
152
|
+
|
|
153
|
+
Read the rule before writing content. They live at `node_modules/@nimtech/nimpress/.claude/rules/`.
|
|
154
|
+
|
|
155
|
+
1. `frontmatter.md` and `page-types.md` before creating or editing any page.
|
|
156
|
+
|
|
157
|
+
2. `docs-authoring.md` and `style.md` for prose, structure, and markdown surface.
|
|
158
|
+
|
|
159
|
+
3. `component-modules.md` before touching component pages, stories, controls, or the modules commands.
|
|
160
|
+
|
|
161
|
+
4. `changelog-entries.md`, `roadmap-entries.md`, and `dbml-pages.md` for those page types.
|
|
162
|
+
|
|
163
|
+
5. `docs-sync.md` and `deploy.md` for the publishing flows and the export header.
|
|
164
|
+
|
|
165
|
+
6. `file-layout.md` and `doc-pages.md` for where files go, and `paths.md` for every folder nimpress writes.
|
|
166
|
+
|
|
167
|
+
7. `chunk-cycles.md` when a build fails on the `nimpress:chunk-cycle-guard` plugin, which every build and therefore `nimpress lint` runs over the emitted bundle.
|
|
168
|
+
|
|
169
|
+
## Recipes
|
|
170
|
+
|
|
171
|
+
Stand a new site up and prove it builds:
|
|
172
|
+
|
|
173
|
+
```sh
|
|
174
|
+
nimpress init
|
|
175
|
+
nimpress lint
|
|
176
|
+
nimpress build
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Take a component library into the workshop and keep the schemas current:
|
|
180
|
+
|
|
181
|
+
```sh
|
|
182
|
+
nimpress modules init
|
|
183
|
+
nimpress modules import --system=nimtech --source=./src/components
|
|
184
|
+
nimpress modules update --system=nimtech
|
|
185
|
+
nimpress modules lint --system=nimtech
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Publish a repo's pages into the central docs site:
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
nimpress export --target=nimployer
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Ship a gated build:
|
|
195
|
+
|
|
196
|
+
```sh
|
|
197
|
+
nimpress build
|
|
198
|
+
nimpress guard map
|
|
199
|
+
nimpress guard apply --map=uploaded.json
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Install the skill and completion on a fresh machine:
|
|
203
|
+
|
|
204
|
+
```sh
|
|
205
|
+
nimpress completion --auto --skill
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Failure reading
|
|
209
|
+
|
|
210
|
+
1. `[nimpress] unknown command: <name>` means the first word is not one of `init`, `lint`, `dev`, `build`, `guard`, `modules`, `export`, `skill`, `completion`.
|
|
211
|
+
|
|
212
|
+
2. `[nimpress] modules <sub>: several systems configured` means the config declares more than one system and the command needs `--system=<name>`.
|
|
213
|
+
|
|
214
|
+
3. `[nimpress] modules import --from-stories requires --stories=<csf dir>` and `[nimpress] modules create --component expects --schema to upsert the schema` both name the flag that was missing. The message states the required flag by name.
|
|
215
|
+
|
|
216
|
+
4. `[nimpress] guard: <path>/access.json not found, run a build first` means the guard commands ran before `nimpress build`, or against the wrong `--dist=`.
|
|
217
|
+
|
|
218
|
+
5. A lint failure prints `nimpress lint failed with <n> problems` and then one line per problem, each naming the file relative to the content folder and what to change. Fix the file the line names, never the checker.
|
|
219
|
+
|
|
220
|
+
6. A build problem inside `nimpress lint` is reported one line per message prefixed with `build:`. It is the same failure `nimpress build` gives, caught before the real output folder is touched.
|