@ksp-gonogo/uplink-tools 1.0.0-rc.21 → 1.0.0-rc.27

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.
Files changed (45) hide show
  1. package/README.md +46 -5
  2. package/dist/chunk-26HFEZDB.js +6672 -0
  3. package/dist/chunk-26HFEZDB.js.map +1 -0
  4. package/dist/{chunk-UYSZ2JYT.js → chunk-I7BHNCPV.js} +4 -3
  5. package/dist/chunk-I7BHNCPV.js.map +1 -0
  6. package/dist/chunk-LAUVJZN6.js +161 -0
  7. package/dist/chunk-LAUVJZN6.js.map +1 -0
  8. package/dist/chunk-MO6CT4RI.js +90 -0
  9. package/dist/chunk-MO6CT4RI.js.map +1 -0
  10. package/dist/{chunk-IXYBXOZ5.js → chunk-P3D7UZD2.js} +10 -693
  11. package/dist/chunk-P3D7UZD2.js.map +1 -0
  12. package/dist/chunk-TGWM5OUO.js +677 -0
  13. package/dist/chunk-TGWM5OUO.js.map +1 -0
  14. package/dist/chunk-V5EKSCEU.js +43 -0
  15. package/dist/chunk-V5EKSCEU.js.map +1 -0
  16. package/dist/{cli-3STJLZOV.js → cli-5KXUYFU6.js} +40 -52
  17. package/dist/cli-5KXUYFU6.js.map +1 -0
  18. package/dist/cli.d.ts +1 -1
  19. package/dist/cli.js +3 -1
  20. package/dist/index.d.ts +107 -80
  21. package/dist/index.js +17 -12
  22. package/dist/index.js.map +1 -1
  23. package/dist/minsize-JC6LEM2I.js +217 -0
  24. package/dist/minsize-JC6LEM2I.js.map +1 -0
  25. package/dist/page-check.d.ts +1 -0
  26. package/dist/page-check.js +11 -8
  27. package/dist/page-check.js.map +1 -1
  28. package/dist/render-probe.d.ts +89 -3
  29. package/dist/render-probe.js +22 -2
  30. package/dist/render-probe.js.map +1 -1
  31. package/dist/story-GT2GHB6H.js +513 -0
  32. package/dist/story-GT2GHB6H.js.map +1 -0
  33. package/dist/widget-facts.d.ts +64 -0
  34. package/dist/widget-facts.js +9 -0
  35. package/dist/widget-facts.js.map +1 -0
  36. package/dist/widgetRecord-DTd2xm53.d.ts +82 -0
  37. package/dist/widgets.js +20772 -17907
  38. package/dist/widgets.js.map +1 -1
  39. package/dist/widgets.json +2041 -1836
  40. package/package.json +11 -3
  41. package/dist/chunk-EUTWMXUS.js +0 -3306
  42. package/dist/chunk-EUTWMXUS.js.map +0 -1
  43. package/dist/chunk-IXYBXOZ5.js.map +0 -1
  44. package/dist/chunk-UYSZ2JYT.js.map +0 -1
  45. package/dist/cli-3STJLZOV.js.map +0 -1
package/README.md CHANGED
@@ -8,11 +8,12 @@ It is a **devDependency**. Nothing here ships in an Uplink's bundle.
8
8
 
9
9
  ## The command line
10
10
 
11
- One command, `uplink-tools`, and nothing to install before the first run:
11
+ One command, `uplink-tools`, and nothing to install before the first run. Until the first release, `latest` is a placeholder, so run the release candidate with `@rc`.
12
+
12
13
 
13
14
  ```sh
14
- npx @ksp-gonogo/uplink-tools new myuplink --repo you/myuplink # in an empty directory
15
- npx @ksp-gonogo/uplink-tools --help
15
+ npx @ksp-gonogo/uplink-tools@rc new myuplink --repo acme/myuplink # in an empty directory
16
+ npx @ksp-gonogo/uplink-tools@rc --help
16
17
  ```
17
18
 
18
19
  `new` asks what it was not told: the id, a display name, the author, the
@@ -35,14 +36,54 @@ Once it is in an Uplink's devDependencies the same commands answer to
35
36
  |---|---|
36
37
  | `new <id>` | scaffold an Uplink: contract slice, plugin, tests, one widget and its fixture, then generate its client types, install the client and write its page. In a repo with an `uplinks/` folder it goes to `uplinks/<id>/`; anywhere else the current directory becomes the Uplink |
37
38
  | `codegen` | generate `client/src/__generated__/` from the C# contract slice; `codegen --check` fails on drift |
39
+ | `check` | read the client with TypeScript (an optional peer, installed in every scaffold) and report what is unresolved or stale, with the command that heals each finding. Exits 0 clean, 1 when findings remain, 2 when it could not run; `--fix` writes the files it owns and is refused when `CI` is set; `--json`, `--only` and `--skip` take its groups. A read it cannot name takes a `// gonogo:reads <topic or family>` comment above the call. A frame whose built-in augment does all the reading keeps its `channels` and `fields` with a `// gonogo:augment-reads <augment id> <channel>...` comment above its `registerComponent`; `check` requires every channel named to appear in that augment's own `channels` |
38
40
  | `bundle` | build the client bundle the app loads, and the `gonogo-uplink.json` beside it; `--watch` rebuilds on every change and `--serve <port>` also serves it from this computer |
39
41
  | `bake` | write what the plugin tells the app about its client into C#: where the bundle lives, who wrote it, and the hash the mod vouches for |
40
42
  | `package` | lay the built plugin out as `GameData/<name>/` and zip it with that as the zip's one root, which is what a hand install and CKAN both expect; it refuses a netkan whose install stanza names a path the zip does not hold |
41
43
  | `release` | `bundle`, `bake`, compile the plugin, check the DLL carries what was baked, and `package`, in that order. It refuses when the Uplink's version is not the same in `client/package.json`, in `defineUplinkClient` and in the version folder of `client.url` |
42
44
  | `page` | write `README.md`, `gonogo-uplink.json` and `docs/widgets.json` from what the client registers, with no browser |
43
45
  | `render` | render every scene to `renders/` |
46
+ | `story <id>` | render one Storybook story to a PNG, or to a GIF when the story is tagged `playback`; see below |
44
47
  | `docs` | write `README.md`, `gonogo-uplink.json`, `docs/widgets.json` and `docs/assets/`; `docs --check` fails on drift |
45
48
 
49
+ ### Seeing a build in the app
50
+
51
+ With a checkout of the gonogo app, run `uplink-tools bundle --watch` in the
52
+ Uplink's `client/` and, from the app checkout, `pnpm dev --uplink <path>`, where
53
+ `<path>` is the directory holding `uplink.json`. Repeat the flag for several
54
+ Uplinks. The dev app loads each one's build output with no mod report, hash or
55
+ consent prompt, still checks its contract and the bytes it fetched, lists it in
56
+ Settings under Local builds, and reloads the page on every rebuild. An Uplink
57
+ without an `uplink.json` is refused. Without a checkout, `bundle --serve <port>`
58
+ with `bake --dev-path` serves a client to an app that is already running.
59
+
60
+ ### Rendering a Storybook story
61
+
62
+ `story` draws one story of any built Storybook, or a running one, and needs
63
+ nothing of the Uplink around it:
64
+
65
+ ```
66
+ uplink-tools story widgets-landing-status-descent-playback--crash-landing
67
+ uplink-tools story --list landing # the ids that contain "landing"
68
+ uplink-tools story <id> --png # the first settled frame of a playback story
69
+ uplink-tools story <id> --chrome # the whole story frame, controls and captions included
70
+ uplink-tools story <id> --seconds 8 --fps 15 --size 900x700 --out clip.gif
71
+ ```
72
+
73
+ It reads the build from `./storybook-static` (`--storybook <dir|url>` points
74
+ elsewhere) and writes `renders/<id>.png`. The picture is the widget alone, cropped to the element
75
+ the story marks `data-story-widget` (every marked element, when a story has
76
+ several); `--chrome` draws the whole story frame instead, and a story with no
77
+ marker is drawn whole. A story whose meta carries the tag
78
+ `playback` renders as a GIF instead: it clicks the story's Replay or Play
79
+ button, the one marked `data-story-start` or else named Replay or Play, once the
80
+ story has rendered even when it is outside the crop (`--start <name>` names another), records
81
+ for `--seconds` (default 6) at `--fps` (default 10), and is saved as
82
+ `renders/<id>.gif`. A story that starts on its own needs no button. A GIF
83
+ carries no sound, and Chromium is launched muted, so a Play control can be
84
+ pressed without noise. In the gonogo repository `pnpm render-story <id>`
85
+ does the same and builds the Storybook first when there is no build.
86
+
46
87
  The order inside `release` is the point of it. The app loads an installed
47
88
  Uplink's client only when the plugin says where the bundle lives and vouches for
48
89
  its hash, so the bundle has to be built and hashed before the plugin is
@@ -150,7 +191,7 @@ need the widget around it:
150
191
  A fixture can then name the widget it extends:
151
192
 
152
193
  ```json
153
- { "_scene": { "hostWidget": "strategies" } }
194
+ { "_scene": { "hostWidget": "admin-building" } }
154
195
  ```
155
196
 
156
197
  There is nothing to `import` from `/widgets`. It exports no symbols: importing it
@@ -170,7 +211,7 @@ and `Panel` draws every widget's `<id>.badges` itself, so a badge contribution
170
211
  lands there exactly as it lands in the real widget.
171
212
 
172
213
  Every **other** contribution slot is drawn by the host widget's own body, and a
173
- stand-in's body draws nothing. `strategies.screens`,
214
+ stand-in's body draws nothing. `admin-building.screens`,
174
215
  `space-center-status.facilities` and `astronaut-complex.readouts` are each read
175
216
  by a `useContributions(...)` inside the widget. Standing in for those produces a
176
217
  blank frame that reports success. A real widget's own body is the only thing that draws