@kosdev-code/kos-ddk-cli 0.0.0-stage → 0.1.0-dev.50
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/README.md +129 -2
- package/agent-plugin/.claude-plugin/marketplace.json +13 -0
- package/agent-plugin/kos-ddk-tools/.claude-plugin/plugin.json +8 -0
- package/agent-plugin/kos-ddk-tools/.mcp.json +11 -0
- package/agent-plugin/kos-ddk-tools/agents/kos-ddk-plugin-planner.md +40 -0
- package/agent-plugin/kos-ddk-tools/agents/kos-ddk-plugin-reviewer.md +33 -0
- package/agent-plugin/kos-ddk-tools/catalog/contributions.json +888 -0
- package/agent-plugin/kos-ddk-tools/mcp.json +12 -0
- package/agent-plugin/kos-ddk-tools/plugin.json +7 -0
- package/agent-plugin/kos-ddk-tools/reference/reference.json +19288 -0
- package/agent-plugin/kos-ddk-tools/servers/kos-ddk.mjs +48632 -0
- package/agent-plugin/kos-ddk-tools/skills/build-ddk-plugin/SKILL.md +71 -0
- package/agent-plugin/kos-ddk-tools/skills/ddk-content-component/SKILL.md +49 -0
- package/agent-plugin/kos-ddk-tools/skills/ddk-storybook/SKILL.md +39 -0
- package/agent-plugin/kos-ddk-tools/templates/cui/__nameDashCase__.stories.tsx__template__ +30 -0
- package/agent-plugin/kos-ddk-tools/templates/cui/__nameDashCase__.tsx__template__ +35 -0
- package/agent-plugin/kos-ddk-tools/templates/cui/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/dashboard-detail/detail/__nameDashCase__.stories.tsx__template__ +32 -0
- package/agent-plugin/kos-ddk-tools/templates/dashboard-detail/detail/__nameDashCase__.tsx__template__ +52 -0
- package/agent-plugin/kos-ddk-tools/templates/dashboard-detail/detail/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/dashboard-summary/summary/__nameDashCase__.stories.tsx__template__ +32 -0
- package/agent-plugin/kos-ddk-tools/templates/dashboard-summary/summary/__nameDashCase__.tsx__template__ +41 -0
- package/agent-plugin/kos-ddk-tools/templates/dashboard-summary/summary/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/macro-summary/__nameDashCase__.stories.tsx__template__ +32 -0
- package/agent-plugin/kos-ddk-tools/templates/macro-summary/__nameDashCase__.tsx__template__ +24 -0
- package/agent-plugin/kos-ddk-tools/templates/macro-summary/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/nav/__nameDashCase__.stories.tsx__template__ +30 -0
- package/agent-plugin/kos-ddk-tools/templates/nav/__nameDashCase__.tsx__template__ +27 -0
- package/agent-plugin/kos-ddk-tools/templates/nav/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/plugin-project/.storybook/preview.tsx.template +80 -0
- package/agent-plugin/kos-ddk-tools/templates/plugin-project/.storybook/registration.ts.template +6 -0
- package/agent-plugin/kos-ddk-tools/templates/pump-detail/__nameDashCase__.stories.tsx__template__ +32 -0
- package/agent-plugin/kos-ddk-tools/templates/pump-detail/__nameDashCase__.tsx__template__ +38 -0
- package/agent-plugin/kos-ddk-tools/templates/pump-detail/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/pump-summary/__nameDashCase__.stories.tsx__template__ +32 -0
- package/agent-plugin/kos-ddk-tools/templates/pump-summary/__nameDashCase__.tsx__template__ +25 -0
- package/agent-plugin/kos-ddk-tools/templates/pump-summary/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/setting/__nameDashCase__.stories.tsx__template__ +30 -0
- package/agent-plugin/kos-ddk-tools/templates/setting/__nameDashCase__.tsx__template__ +27 -0
- package/agent-plugin/kos-ddk-tools/templates/setting/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/setup/__nameDashCase__.stories.tsx__template__ +30 -0
- package/agent-plugin/kos-ddk-tools/templates/setup/__nameDashCase__.tsx__template__ +33 -0
- package/agent-plugin/kos-ddk-tools/templates/setup/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/theme-project/theme/assets/component.css.template +2 -0
- package/agent-plugin/kos-ddk-tools/templates/theme-project/theme/assets/generic.css.template +2 -0
- package/agent-plugin/kos-ddk-tools/templates/theme-project/theme/assets/semantic.css.template +2 -0
- package/agent-plugin/kos-ddk-tools/templates/theme-project/theme/assets/theme-overlay.css.template +7 -0
- package/agent-plugin/kos-ddk-tools/templates/trouble-action/__nameDashCase__.stories.tsx__template__ +29 -0
- package/agent-plugin/kos-ddk-tools/templates/trouble-action/__nameDashCase__.tsx__template__ +57 -0
- package/agent-plugin/kos-ddk-tools/templates/trouble-action/index.ts__template__ +1 -0
- package/agent-plugin/kos-ddk-tools/templates/utility/__nameDashCase__.stories.tsx__template__ +30 -0
- package/agent-plugin/kos-ddk-tools/templates/utility/__nameDashCase__.tsx__template__ +47 -0
- package/agent-plugin/kos-ddk-tools/templates/utility/index.ts__template__ +1 -0
- package/catalog/contributions.json +888 -0
- package/guides/ddk-dev.md +46 -0
- package/guides/storybook.md +69 -0
- package/package.json +33 -3
- package/reference/reference.json +19288 -0
- package/src/build-paths.mjs +20 -0
- package/src/codegen/contribution.mjs +255 -0
- package/src/codegen/overrides.mjs +179 -0
- package/src/codegen/project.mjs +144 -0
- package/src/extension.mjs +22 -0
- package/src/generators/agent-install.mjs +79 -0
- package/src/generators/catalog.mjs +70 -0
- package/src/generators/contributions.mjs +116 -0
- package/src/generators/dashboard.mjs +238 -0
- package/src/generators/dev.mjs +221 -0
- package/src/generators/override-prompts.mjs +27 -0
- package/src/generators/plugin-project.mjs +34 -0
- package/src/generators/theme-project.mjs +34 -0
- package/src/handlers.mjs +325 -0
- package/src/mcp/pkg-info.mjs +7 -0
- package/src/mcp/plugin-inspect.mjs +257 -0
- package/src/mcp/reference.mjs +248 -0
- package/src/mcp/server.mjs +12 -0
- package/src/mcp/tools.mjs +478 -0
- package/templates/cui/__nameDashCase__.stories.tsx__template__ +30 -0
- package/templates/cui/__nameDashCase__.tsx__template__ +35 -0
- package/templates/cui/index.ts__template__ +1 -0
- package/templates/dashboard-detail/detail/__nameDashCase__.stories.tsx__template__ +32 -0
- package/templates/dashboard-detail/detail/__nameDashCase__.tsx__template__ +52 -0
- package/templates/dashboard-detail/detail/index.ts__template__ +1 -0
- package/templates/dashboard-summary/summary/__nameDashCase__.stories.tsx__template__ +32 -0
- package/templates/dashboard-summary/summary/__nameDashCase__.tsx__template__ +41 -0
- package/templates/dashboard-summary/summary/index.ts__template__ +1 -0
- package/templates/macro-summary/__nameDashCase__.stories.tsx__template__ +32 -0
- package/templates/macro-summary/__nameDashCase__.tsx__template__ +24 -0
- package/templates/macro-summary/index.ts__template__ +1 -0
- package/templates/nav/__nameDashCase__.stories.tsx__template__ +30 -0
- package/templates/nav/__nameDashCase__.tsx__template__ +27 -0
- package/templates/nav/index.ts__template__ +1 -0
- package/templates/plugin-project/.storybook/preview.tsx.template +80 -0
- package/templates/plugin-project/.storybook/registration.ts.template +6 -0
- package/templates/pump-detail/__nameDashCase__.stories.tsx__template__ +32 -0
- package/templates/pump-detail/__nameDashCase__.tsx__template__ +38 -0
- package/templates/pump-detail/index.ts__template__ +1 -0
- package/templates/pump-summary/__nameDashCase__.stories.tsx__template__ +32 -0
- package/templates/pump-summary/__nameDashCase__.tsx__template__ +25 -0
- package/templates/pump-summary/index.ts__template__ +1 -0
- package/templates/setting/__nameDashCase__.stories.tsx__template__ +30 -0
- package/templates/setting/__nameDashCase__.tsx__template__ +27 -0
- package/templates/setting/index.ts__template__ +1 -0
- package/templates/setup/__nameDashCase__.stories.tsx__template__ +30 -0
- package/templates/setup/__nameDashCase__.tsx__template__ +33 -0
- package/templates/setup/index.ts__template__ +1 -0
- package/templates/theme-project/theme/assets/component.css.template +2 -0
- package/templates/theme-project/theme/assets/generic.css.template +2 -0
- package/templates/theme-project/theme/assets/semantic.css.template +2 -0
- package/templates/theme-project/theme/assets/theme-overlay.css.template +7 -0
- package/templates/trouble-action/__nameDashCase__.stories.tsx__template__ +29 -0
- package/templates/trouble-action/__nameDashCase__.tsx__template__ +57 -0
- package/templates/trouble-action/index.ts__template__ +1 -0
- package/templates/utility/__nameDashCase__.stories.tsx__template__ +30 -0
- package/templates/utility/__nameDashCase__.tsx__template__ +47 -0
- package/templates/utility/index.ts__template__ +1 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
uri: ddk://guide/ddk-dev
|
|
3
|
+
name: ddk-guide-ddk-dev
|
|
4
|
+
title: Testing plugins against a running DDK
|
|
5
|
+
description: Serving DDK plugin projects with kosui ddk:dev for a running device or simulator to load with ?pluginDevServers=, choosing plugins and scenarios.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Testing plugins against a running DDK
|
|
9
|
+
|
|
10
|
+
`ddk:dev` starts the dev server of each DDK plugin project and prints the URL that loads
|
|
11
|
+
them into a running DDK, without access to the DDK host source.
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
kosui ddk:dev --device http://192.168.1.50:8081
|
|
15
|
+
kosui ddk:dev --plugins my-plugin --device http://192.168.1.50:8081
|
|
16
|
+
kosui ddk:dev --scenario compact --device http://192.168.1.50:8081
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Without `--plugins` or `--scenario` it starts every DDK plugin project. `--plugins`
|
|
20
|
+
takes project names or aliases; `--scenario` names a set in the workspace `.kos.json`:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"development": {
|
|
25
|
+
"ddkScenarios": {
|
|
26
|
+
"standard": ["kos-ddk-standard-plugin", "beverage-pour"],
|
|
27
|
+
"compact": ["kos-ddk-compact-plugin", "beverage-pour"]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The device loads the plugins with `?pluginDevServers=`; an override wins over the
|
|
34
|
+
standard contribution only when the device's DDK resolves its slots by rank.
|
|
35
|
+
|
|
36
|
+
## The URL it prints
|
|
37
|
+
|
|
38
|
+
`--device` is the URL of the DDK UI on the device or simulator, either its origin or the
|
|
39
|
+
page itself (on a device, `http://localhost:8081/app/kosdev.ddk/ncui/index.html`). The
|
|
40
|
+
printed URL adds `?pluginDevServers=` with one `http://<address>:<port>` per plugin, from
|
|
41
|
+
the `port` of its `serve` target. The address is `localhost` when the device is local and
|
|
42
|
+
the machine's LAN IPv4 address otherwise, so a device on the network can reach the dev
|
|
43
|
+
servers. Without `--device` it prints a `<device-url>` template.
|
|
44
|
+
|
|
45
|
+
Every plugin needs `options.port` on its `serve` target; `ddk:dev` refuses a plugin
|
|
46
|
+
without one.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
uri: ddk://guide/storybook
|
|
3
|
+
name: ddk-guide-storybook
|
|
4
|
+
title: Developing DDK contributions in Storybook
|
|
5
|
+
description: Running a plugin's Storybook against a simulator, where model data comes from, the story container per contribution command, render modes and overrides.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Developing DDK contributions in Storybook
|
|
9
|
+
|
|
10
|
+
Every `ddk:*` contribution command writes a story next to the component, so a contribution
|
|
11
|
+
can be developed in isolation before the plugin is loaded into a running DDK. Stories render
|
|
12
|
+
against live models from a running simulator.
|
|
13
|
+
|
|
14
|
+
## Run it
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npx nx run <plugin>:storybook
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Storybook serves on port 4400. The plugin's `serve` target is the module federation dev
|
|
21
|
+
server used by `kosui ddk:dev`; Storybook has its own `storybook` target.
|
|
22
|
+
|
|
23
|
+
## Where model data comes from
|
|
24
|
+
|
|
25
|
+
The preview (`.storybook/preview.tsx`) wraps every story in the providers the DDK hosts use:
|
|
26
|
+
KosCore, translations (`app/system`, `app/kosdev.ddk`), `AssemblyProvider`,
|
|
27
|
+
`ApplicationProvider` and `ApplicationComponentConfigurationProvider`. KosCore connects to the
|
|
28
|
+
first of:
|
|
29
|
+
|
|
30
|
+
1. the `?host=` query parameter on the Storybook URL;
|
|
31
|
+
2. `KOS_HOST` and `KOS_PORT` in the plugin's `.env` (the generated `.env` sets
|
|
32
|
+
`KOS_PORT=8081`, the simulator's default);
|
|
33
|
+
3. the page's own origin.
|
|
34
|
+
|
|
35
|
+
Start the simulator before Storybook. A story shows what the simulator has: a dashboard card
|
|
36
|
+
needs an active model at its `dashboardKey`, a trouble action needs an active trouble of its
|
|
37
|
+
`troubleType`.
|
|
38
|
+
|
|
39
|
+
## Story containers
|
|
40
|
+
|
|
41
|
+
Each story renders the component inside the container for its extension point, from
|
|
42
|
+
`@kosdev-code/kos-ddk-story-containers`:
|
|
43
|
+
|
|
44
|
+
| Command | Container | Gives the component |
|
|
45
|
+
| -------------------- | ----------------------------------------------------------------- | ----------------------------------------------------- |
|
|
46
|
+
| `ddk:utility` | `UtilityStoryContainer` | the utility frame |
|
|
47
|
+
| `ddk:setup` | `SetupStepStoryContainer` | the setup step frame |
|
|
48
|
+
| `ddk:nav` | `NavStoryContainer` | the navigation view frame |
|
|
49
|
+
| `ddk:setting` | `SettingStoryContainer` | the setting frame |
|
|
50
|
+
| `ddk:cui` | `CUIStoryContainer` | the CUI frame |
|
|
51
|
+
| `ddk:dashboard-card` | `DashboardSummaryStoryContainer`, `DashboardDetailStoryContainer` | `dashboardKey`, `assembly`, `cardModel`, `onComplete` |
|
|
52
|
+
| `ddk:pump-detail` | `PumpDetailStoryContainer` | the first `holder` with the `dashboardKey` |
|
|
53
|
+
| `ddk:pump-card` | `PumpSummaryStoryContainer`, `PumpDetailStoryContainer` | the first `holder` with the `dashboardKey` |
|
|
54
|
+
| `ddk:macro-summary` | `MacroSummaryStoryContainer` | the first `holder` with the `dashboardKey` |
|
|
55
|
+
| `ddk:trouble-action` | `TroubleActionStoryContainer` | the active `trouble` of the `troubleType` |
|
|
56
|
+
|
|
57
|
+
When the simulator has no matching model, holder or trouble, the container says so in place
|
|
58
|
+
of the story.
|
|
59
|
+
|
|
60
|
+
## Standard and compact modes
|
|
61
|
+
|
|
62
|
+
The **Render Mode** toolbar switches between `standard` and `compact`. It changes the DDK
|
|
63
|
+
styles and the component mode; in `compact`, modals render full screen.
|
|
64
|
+
|
|
65
|
+
## Overrides
|
|
66
|
+
|
|
67
|
+
A story renders the override on its own, so an override of a standard contribution can be
|
|
68
|
+
developed here first. To see it replace the standard contribution, load the plugin into a
|
|
69
|
+
running DDK with `kosui ddk:dev` (see the package README).
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ddk-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0-dev.50",
|
|
4
|
+
"description": "DDK commands for kosui: plugin projects and DDK extension-point contributions.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"kosui": {
|
|
7
|
+
"extension": "./src/extension.mjs",
|
|
8
|
+
"apiVersion": 1
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/extension.mjs",
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"src",
|
|
16
|
+
"templates",
|
|
17
|
+
"guides",
|
|
18
|
+
"catalog",
|
|
19
|
+
"reference",
|
|
20
|
+
"agent-plugin"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@kosdev-code/kos-codegen-core": "~3.0.0"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@kosdev-code/kos-ui-cli": "~3.0.0"
|
|
27
|
+
},
|
|
28
|
+
"kos": {
|
|
29
|
+
"build": {
|
|
30
|
+
"gitHash": "5c0550a81c2146c1101f8fec1c166f945a4a8202"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"registry": "https://registry.npmjs.org/"
|
|
35
|
+
}
|
|
6
36
|
}
|