numux 1.4.0 → 1.5.1

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 CHANGED
@@ -22,7 +22,7 @@ This creates a starter `numux.config.ts` with commented-out examples. Edit it, t
22
22
 
23
23
  ### Config file
24
24
 
25
- Create `numux.config.ts` (or `.js`, `.yaml`, `.yml`, `.json`, or a `"numux"` key in `package.json`):
25
+ Create `numux.config.ts` (or `.js`):
26
26
 
27
27
  ```ts
28
28
  import { defineConfig } from 'numux'
@@ -209,12 +209,17 @@ A watched process is only restarted if it's currently running, ready, or failed
209
209
 
210
210
  Config values support `${VAR}` syntax for environment variable substitution:
211
211
 
212
- ```yaml
213
- processes:
214
- api:
215
- command: node server.js --port ${PORT:-3000}
216
- env:
217
- DATABASE_URL: ${DATABASE_URL:?DATABASE_URL must be set}
212
+ ```ts
213
+ export default defineConfig({
214
+ processes: {
215
+ api: {
216
+ command: 'node server.js --port ${PORT:-3000}',
217
+ env: {
218
+ DATABASE_URL: '${DATABASE_URL:?DATABASE_URL must be set}',
219
+ },
220
+ },
221
+ },
222
+ })
218
223
  ```
219
224
 
220
225
  | Syntax | Behavior |
@@ -229,15 +234,20 @@ Interpolation applies to all string values in the config (command, cwd, env, env
229
234
 
230
235
  Use `condition` to run a process only when an environment variable is set:
231
236
 
232
- ```yaml
233
- processes:
234
- seed:
235
- command: bun run seed
236
- persistent: false
237
- condition: SEED_DB # only runs when SEED_DB is set and truthy
238
- storybook:
239
- command: bun run storybook
240
- condition: "!CI" # skipped in CI environments
237
+ ```ts
238
+ export default defineConfig({
239
+ processes: {
240
+ seed: {
241
+ command: 'bun run seed',
242
+ persistent: false,
243
+ condition: 'SEED_DB', // only runs when SEED_DB is set and truthy
244
+ },
245
+ storybook: {
246
+ command: 'bun run storybook',
247
+ condition: '!CI', // skipped in CI environments
248
+ },
249
+ },
250
+ })
241
251
  ```
242
252
 
243
253
  Falsy values: unset, empty string, `"0"`, `"false"`, `"no"`, `"off"` (case-insensitive). If a conditional process is skipped, its dependents are also skipped.
@@ -264,7 +274,7 @@ Persistent processes that crash are auto-restarted with exponential backoff (1s
264
274
  | `Alt+L` | Clear active pane output |
265
275
  | `Alt+1`–`Alt+9` | Jump to tab |
266
276
  | `Alt+Left/Right` | Cycle tabs |
267
- | `Up/Down` | Scroll output 1 line (non-interactive panes) |
277
+ | `Up/Down` | Navigate between tabs |
268
278
  | `PageUp/PageDown` | Scroll output by page (non-interactive panes) |
269
279
  | `Home/End` | Scroll to top/bottom (non-interactive panes) |
270
280
  | `Alt+PageUp/PageDown` | Scroll output up/down |