@norskvideo/ctl-dev-kit 0.1.2 → 0.1.3

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.
@@ -54,8 +54,9 @@ HARDWARE=none NORSK_LICENSE_FILE=... bun run iterate # no GPU reservat
54
54
  # Advanced overrides
55
55
 
56
56
  To develop a product against **un-published** ctl code or a **locally-built**
57
- media server, there are two independent override layers. Each is opt-in and
58
- leaves the default (registry/pinned) path untouched when unset.
57
+ media server, there are three independent override layers. Each is opt-in and
58
+ leaves the default (registry/pinned) path untouched when unset. They compose:
59
+ changing the daemon *and* a ctl library it exposes means layers 1 + 3 together.
59
60
 
60
61
  ## 1. The npm layer — local `@norskvideo/ctl-*` checkouts
61
62
 
@@ -95,3 +96,45 @@ bun run --cwd . iterate # or the product's launch/iterate entry
95
96
  ```
96
97
 
97
98
  Leave the hooks unset to launch the pinned tags the product declares.
99
+
100
+ ## 3. The daemon layer — run ctl from a source checkout (`../norsk-ctl`)
101
+
102
+ Use this when you are changing the **daemon itself** (packages/norsk-ctl) and
103
+ want the product to launch through your build instead of the pinned binary. The
104
+ daemon is a single process on `:8333` — where you start it from is irrelevant, so
105
+ just run it out of your checkout and drive it with the same checkout's CLI. Skip
106
+ `nix develop .#dev` (its pinned `norsk-ctl` would shadow yours); the plain
107
+ `nix develop` shell is enough on the product side.
108
+
109
+ ```sh
110
+ # 1. daemon, from your ctl checkout (root `cli` script -> packages/norsk-ctl cli)
111
+ ( cd ../norsk-ctl && bun run cli serve )
112
+
113
+ # 2. product backend, from the product repo
114
+ bun run dev
115
+
116
+ # 3. register + launch, using the SOURCE cli against the SOURCE daemon
117
+ bun run --cwd ../norsk-ctl cli product add --dev-url http://localhost:<backendPort>
118
+ bun run --cwd ../norsk-ctl cli instance launch-template demo --template <t> --hardware none
119
+ ```
120
+
121
+ No linking is needed for this — you are running the daemon *code* directly. Pair
122
+ with layer 1 (`dev-link.sh`) only if you also changed a `@norskvideo/ctl-*`
123
+ library the product *compiles* against.
124
+
125
+ ### Integration tests against source ctl
126
+
127
+ The harness spawns the daemon from `NORSK_CTL_BINARY` as `<that> serve …`. A split
128
+ repo has no in-workspace ctl source for it to auto-discover, so point that env at
129
+ a one-line wrapper that forwards to your checkout's CLI:
130
+
131
+ ```sh
132
+ printf '#!/usr/bin/env bash\nexec bun run --cwd %s cli "$@"\n' "$(cd ../norsk-ctl && pwd)" > /tmp/norsk-ctl-src
133
+ chmod +x /tmp/norsk-ctl-src
134
+ NORSK_CTL_BINARY=/tmp/norsk-ctl-src NORSK_LICENSE_FILE=/path/to/license.json bun run test:integration
135
+ ```
136
+
137
+ The wrapper forwards `serve` / `product add` / everything, so the whole slow tier
138
+ runs against `../norsk-ctl`. (`NORSK_CTL_BINARY` resolution lives in
139
+ `@norskvideo/ctl-test-harness`'s `cli-command.ts`: explicit path → in-workspace
140
+ 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.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json"