@norskvideo/ctl-dev-kit 0.2.129 → 0.2.131

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.
@@ -74,12 +74,23 @@ export interface GeneratedFile {
74
74
  executable?: boolean;
75
75
  }
76
76
 
77
+ /** `norsk-acme` -> `Norsk Acme`: the install name as screens show it. */
78
+ export function productTitle(name: string): string {
79
+ return name
80
+ .split("-")
81
+ .filter((part) => part.length > 0)
82
+ .map((part) => part[0].toUpperCase() + part.slice(1))
83
+ .join(" ");
84
+ }
85
+
77
86
  export interface ShapeContext {
78
87
  name: string;
79
88
  /** Workspace scope, `@<name>`. */
80
89
  scope: string;
81
90
  /** `product:` value for the shared workflows — `name` minus the `norsk-` prefix. */
82
91
  dashboardKey: string;
92
+ /** Human product title for screens, e.g. `Norsk Acme`. */
93
+ title: string;
83
94
  devPort: number;
84
95
  pins: { mediaImage: string; studioImage: string; studioLib: string; mediaLib: string };
85
96
  canon: Canon;
@@ -210,6 +221,7 @@ export function shapeContext(opts: CreateProductOptions): ShapeContext {
210
221
  name: opts.name,
211
222
  scope: `@${opts.name}`,
212
223
  dashboardKey: opts.name.replace(/^norsk-/, ""),
224
+ title: productTitle(opts.name),
213
225
  devPort: opts.devPort ?? 4323,
214
226
  pins: {
215
227
  mediaImage,
@@ -112,7 +112,7 @@ function indexHtml(ctx: ShapeContext): string {
112
112
  <head>
113
113
  <meta charset="UTF-8" />
114
114
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
115
- <title>${ctx.name} — Operator</title>
115
+ <title>${ctx.title}</title>
116
116
  </head>
117
117
  <body>
118
118
  <div id="root"></div>
@@ -93,7 +93,7 @@ function indexHtml(ctx: ShapeContext): string {
93
93
  <head>
94
94
  <meta charset="UTF-8" />
95
95
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
96
- <title>${ctx.name} — configure</title>
96
+ <title>${ctx.title} — configure</title>
97
97
  </head>
98
98
  <body>
99
99
  <div id="root"></div>
@@ -130,7 +130,7 @@ function appTsx(ctx: ShapeContext): string {
130
130
  export default function App() {
131
131
  return (
132
132
  <main>
133
- <h1>${ctx.name}</h1>
133
+ <h1>${ctx.title}</h1>
134
134
  <p>
135
135
  The starter template needs no configuration. Launch it from norsk-ctl to bring up the Studio + Norsk stack this
136
136
  product composes.
@@ -151,7 +151,7 @@ import App from "./App.tsx";
151
151
 
152
152
  test("names the product", () => {
153
153
  render(<App />);
154
- expect(screen.getByRole("heading", { name: "${ctx.name}" })).toBeInTheDocument();
154
+ expect(screen.getByRole("heading", { name: "${ctx.title}" })).toBeInTheDocument();
155
155
  });
156
156
  `;
157
157
  }
@@ -146,6 +146,40 @@ NORSK_CTL_BINARY=/tmp/norsk-ctl-src NORSK_LICENSE_FILE=/path/to/license.json bun
146
146
  ```
147
147
 
148
148
  The wrapper forwards `serve` / `product add` / everything, so the whole slow tier
149
- runs against `../norsk-ctl`. (`NORSK_CTL_BINARY` resolution lives in
149
+ runs against `../norsk-ctl`.
150
+
151
+ ### Extra config for the dev-loop's daemon
152
+
153
+ `dev-loop up` (`bun run demo -- dev-loop up`, or `bun run dev-loop up`) always
154
+ starts its own private daemon. To give that daemon config the driver has no
155
+ flag for, such as a `storage:` block or `bindAddress`, put the keys in a YAML
156
+ file and pass it with `--daemon-config`:
157
+
158
+ ```sh
159
+ cat > ctl-extra.yaml <<'YAML'
160
+ bindAddress: 127.0.0.1
161
+ storage:
162
+ provider: Minio
163
+ endpoint: http://host.docker.internal:9000
164
+ credentials:
165
+ kind: key-file
166
+ path: /abs/path/to/key
167
+ YAML
168
+ NORSK_CTL_BINARY=/tmp/norsk-ctl-src bun run demo -- dev-loop up --daemon-config ctl-extra.yaml
169
+ ```
170
+
171
+ After `init`, the file's top-level keys are merged into the private store's
172
+ `config.yaml`. A key in the file replaces the key of the same name. Before
173
+ `serve`, the driver runs `norsk-ctl config show` with no daemon, so the ctl
174
+ that will serve parses the file with its own parser. If it refuses the
175
+ config, `up` stops with ctl's message. If it silently drops a key it does not
176
+ know, or a value it does not accept, `up` stops and names the key. The file
177
+ cannot set the keys the driver writes itself: `networkMode`,
178
+ `defaultWorkingDirectory`, the proxy settings (`proxyPort`, `proxyAuth`,
179
+ `httpRedirect`, `httpRedirectPort`, `externalPort`, `certSource`, `certPath`,
180
+ `keyPath`) and `publicHost` (use `--public-host` for that). Pair it with
181
+ `NORSK_CTL_BINARY` when the keys are new in a ctl you are running from source.
182
+ The flag belongs to `dev-loop up` only. Your published test-harness may be
183
+ older than this flag; to use it from a checkout, link the package with layer 1. (`NORSK_CTL_BINARY` resolution lives in
150
184
  `@norskvideo/ctl-test-harness`'s `cli-command.ts`: explicit path → in-workspace
151
185
  source → `norsk-ctl` on PATH.)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.2.129",
3
+ "version": "0.2.131",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",