@nimtech/nimpress 2.6.14 → 2.7.0

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.
@@ -145,7 +145,9 @@ Every modules subcommand takes `--system=<name>`; it is required only when sever
145
145
 
146
146
  8.1. `unknown` is never the fix for an opaque member. Neither the source type nor an authored `tsType` is widened to `unknown` to silence the warning; the member gets its real shape, an enum, properties, typed items, or a real interface in the source. A prop that only exists to hold untyped data is removed instead.
147
147
 
148
- 9. `nimpress modules dev [--system=]` runs harness servers. `nimpress dev` starts them all beside the docs.
148
+ 9. `nimpress modules dev [--system=]` runs harness servers. `nimpress dev` starts them all beside the docs. A story file or a component page added while a harness runs registers without a restart and reloads its open tabs.
149
+
150
+ 9.1. `nimpress modules open <Component> [story] [--system=] [--browser=]` opens one story alone in the browser on its harness route and prints the url, the Default story when none is named. The component resolves as in `modules stories`. When no harness answers it starts `nimpress dev` in the background and waits for it. `--browser=` names the browser application, the default browser otherwise. The harness hot reloads, so the tab follows the work on the component live.
149
151
 
150
152
  10. `nimpress modules build [--system=]` emits static harness bundles into `dist/_components/<system>/`; `nimpress build` runs it for every system whose visibility is not `dev-only`.
151
153
 
@@ -18,6 +18,8 @@ Every markdown page declares YAML frontmatter at the top. Parsed with `gray-matt
18
18
 
19
19
  3.1.1. `link: <absolute url>` turns the file into a sidebar entry that opens that url in a new tab instead of routing to a page. The file carries frontmatter and no body, produces no route, no search entry, and nothing in the build, and takes its sidebar position from where the file sits. `title` or `slug` is the label, `order` places it, `sidebar.icon` and `sidebar.style` decorate it. A relative value, or a body, is a lint error. `redirect` remains the internal counterpart.
20
20
 
21
+ 3.1.2. `dropdown` puts the page in sidebar filters: a dropdown id to `value`, the list of choices the page shows under, plus optional `title` and `description` naming the dropdown, which the `dropdowns` config block overrides. A page without a value shows under every choice. A folder of pages each named after its single value, `Button/Vue/` and `Button/Svelte/`, folds into one row when the selection leaves one. The menu sits in the header and moves to the sidebar footer at 1024 pixels and below.
22
+
21
23
  3.2. `sidebar.icon` accepts literal text or ascii art rendered verbatim in the mono font, inline `<svg>` markup rendered as markup, or a path ending in `.svg` resolved against the declaring file, or against `contentDir` when it starts with `/`, read at build time and inlined. An unreadable path warns and drops the icon. The sidebar renders icons only from `sidebar` blocks and story definitions.
22
24
 
23
25
  4. `description` gets used as a meta description and a search excerpt. Add it for any page expected to land via search.
@@ -73,6 +73,7 @@ nimpress modules build --system=nimtech
73
73
  nimpress modules lint --system=nimtech
74
74
  nimpress modules story <Component> --system=nimtech --framework=vue
75
75
  nimpress modules stories <Component> --system=nimtech --json
76
+ nimpress modules open <Component> [story] --system=nimtech --browser=Safari
76
77
  nimpress modules import <file> --system=nimtech --name=Button --source=./src/components --stories=./stories --match='^Btn' --from-stories --select
77
78
  nimpress modules create <Component> --system=nimtech --framework=svelte
78
79
  nimpress modules create --component=<ref> --schema
@@ -89,11 +90,13 @@ nimpress modules update <ref> --component=<ref> --system=nimtech
89
90
 
90
91
  5. `stories <Component>` lists that component's stories in every system that carries it, matched without case, one line per story: system, component, story id, and the harness route `/_components/<system>/<Component>/?story=<id>` that renders that story alone. The story id is the file stem; the harness renders the default export of that file, so one file is one story. With no component it prints every component and its story count per system. `--system=` narrows it, `--json` prints the routes as json. It is the only answer to which stories exist and where each one renders; never read the generated harness entry for it.
91
92
 
92
- 6. `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=`.
93
+ 6. `open <Component> [story]` opens that one story alone in the user's browser, without the docs page around it, and prints the url. The component resolves as in `stories`, the story by id or name without case, and the Default story when none is named; a component carried by several systems needs `--system=`. The url is the story route on the harness port, `http://127.0.0.1:<port>/_components/<system>/<Component>/?story=<id>`. When no harness answers it starts `nimpress dev` in the background, prints its pid and the log `<cache>/modules/dev.log`, and waits for the harness; a harness that answers but does not know the component fails with a restart hint. `--browser=<app>` opens it in that application, `open -a <app>` on macOS, the default browser otherwise. Run it before working on a component so the user watches the work: the harness hot reloads, the tab follows every saved edit to the component and the story, and a story file or a component page added while it runs registers without a restart.
93
94
 
94
- 7. `create <Component>` creates the component page folder. `create --component=<ref> --schema` upserts a single schema instead, and `--schema` is required in that form.
95
+ 7. `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=`.
95
96
 
96
- 8. `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.
97
+ 8. `create <Component>` creates the component page folder. `create --component=<ref> --schema` upserts a single schema instead, and `--schema` is required in that form.
98
+
99
+ 9. `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.
97
100
 
98
101
  ### export
99
102
 
@@ -271,7 +274,16 @@ nimon click <ref>
271
274
  nimon shot
272
275
  ```
273
276
 
274
- Through the mcp servers of both plugins that is `service_up`, `modules_stories`, `open`, `look`, `click`, `shot`. A new story file is picked up only after the workshop restarts: `nimon service down workshop`, then up.
277
+ Through the mcp servers of both plugins that is `service_up`, `modules_stories`, `open`, `look`, `click`, `shot`. A story file or a component page added while the workshop runs registers without a restart and reloads the open harness tabs.
278
+
279
+ Let the user watch a component while an agent works on it. Open the story first, then edit the component or the story file; every save reloads the tab:
280
+
281
+ ```sh
282
+ nimpress modules stories MarButton
283
+ nimpress modules open MarButton with_icon
284
+ ```
285
+
286
+ Through the mcp server that is `modules_stories`, then `modules_open` with `args: ["MarButton", "with_icon"]` and `flags: { "system": "nimtech", "browser": "Safari" }`. It returns once the tab is open; the dev server it may start keeps running outside the session, so `stop` does not end it and its printed pid does.
275
287
 
276
288
  Install the command, the skill and completion on a fresh machine:
277
289
 
@@ -628,6 +628,42 @@
628
628
  }
629
629
  }
630
630
  }
631
+ },
632
+ "dropdowns": {
633
+ "description": "Sidebar filters a reader picks from the header, a dropdown id to its title, description, and value order. Pages join one through the dropdown frontmatter block.",
634
+ "type": "object",
635
+ "additionalProperties": {
636
+ "type": "object",
637
+ "properties": {
638
+ "title": {
639
+ "type": "string",
640
+ "description": "Label on the trigger and above the choices."
641
+ },
642
+ "description": {
643
+ "type": "string",
644
+ "description": "Line under the title in the open panel."
645
+ },
646
+ "values": {
647
+ "type": "array",
648
+ "items": {
649
+ "type": "string"
650
+ },
651
+ "description": "Value order in the panel; values pages declare beyond it follow in the order they appear."
652
+ }
653
+ },
654
+ "additionalProperties": false
655
+ },
656
+ "examples": [
657
+ {
658
+ "language": {
659
+ "title": "Language",
660
+ "values": [
661
+ "Vue",
662
+ "Svelte"
663
+ ]
664
+ }
665
+ }
666
+ ]
631
667
  }
632
668
  }
633
669
  }