@walkeros/cli 2.0.1 → 2.1.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,63 @@
1
1
  # @walkeros/cli
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cb2da05: Add data contracts for centralized event validation and documentation
8
+ - fed78f0: Replace deployment polling with SSE streaming for real-time status
9
+ updates
10
+ - 3eb6416: Add unified `env.respond` capability. Any step (transformer,
11
+ destination) can now customize HTTP responses via
12
+ `env.respond({ body, status?, headers? })`. Sources configure the response
13
+ handler — Express source uses createRespond for idempotent first-call-wins
14
+ semantics. CLI serve mode removed (superseded by response-capable flows).
15
+ - 39780b0: Add event usage counters to heartbeat reporting
16
+ - dd53425: Simplify `walkeros run collect` to `walkeros run` — the mode concept
17
+ has been removed
18
+ - 66aaf2d: Runner-owned health server: The runner now provides /health and
19
+ /ready endpoints independently of flow sources. Express source's `status`
20
+ setting and fetch source's `healthPath` setting have been removed — health
21
+ endpoints are no longer source responsibilities.
22
+ - 97df0b2: Simplify validate command: file-first argument, --type defaults to
23
+ flow, deep validation merged into flow, entry validation moved to --path
24
+ - 026c412: Unified simulation API: single simulate() function replaces
25
+ simulateSource/simulateDestination/simulateTransformer/simulateFlow. Built-in
26
+ call tracking for destinations via wrapEnv. No bundling required for
27
+ simulation.
28
+
29
+ ### Patch Changes
30
+
31
+ - fed78f0: Show logo only on bare `walkeros` call, not before every command
32
+ - 7b7e37b: Consolidate flow validation to use core's validateFlowSetup, adding
33
+ $var/$def reference checking and IntelliSense context extraction
34
+ - 5145662: Use os.tmpdir() as default temp directory to fix permission errors in
35
+ containers
36
+ - 02a7958: Add WARN log level (ERROR=0, WARN=1, INFO=2, DEBUG=3). Logger
37
+ instances expose `warn()` method routed to `console.warn` and `json()` method
38
+ for structured output. Config accepts optional `jsonHandler`. MockLogger
39
+ includes both as jest mocks. CLI logger unified with core logger via
40
+ `createCLILogger()` factory.
41
+ - 3bc32de: Surface mapping field in examples_list and ExampleLookupResult
42
+ - 5145662: Add --output URL support, -f shorthand for --flow, and lazy-load
43
+ esbuild in runtime
44
+ - 7fc4cee: Fix server bundle port forwarding from runtime context to source
45
+ configs
46
+ - 1876bb9: Remove unused bundle simulation path, CallTracker, and executor files
47
+ from simulate command. Simulate now only accepts Flow.Setup config JSON files.
48
+ - Updated dependencies [7fc4cee]
49
+ - Updated dependencies [7fc4cee]
50
+ - Updated dependencies [cb2da05]
51
+ - Updated dependencies [2bbe8c8]
52
+ - Updated dependencies [3eb6416]
53
+ - Updated dependencies [02a7958]
54
+ - Updated dependencies [97df0b2]
55
+ - Updated dependencies [97df0b2]
56
+ - Updated dependencies [026c412]
57
+ - Updated dependencies [7d38d9d]
58
+ - @walkeros/core@2.1.0
59
+ - @walkeros/server-core@2.1.0
60
+
3
61
  ## 2.0.1
4
62
 
5
63
  ## 2.0.0
package/README.md CHANGED
@@ -48,14 +48,11 @@ walkeros bundle flow.json
48
48
  # Test with simulated events (no real API calls)
49
49
  walkeros simulate flow.json --event '{"name":"product view"}'
50
50
 
51
- # Or test a pre-built bundle directly
52
- walkeros simulate dist/bundle.mjs --event '{"name":"product view"}'
53
-
54
51
  # Push real events to destinations
55
52
  walkeros push flow.json --event '{"name":"product view"}'
56
53
 
57
54
  # Run a collection server locally
58
- walkeros run collect dist/bundle.mjs --port 3000
55
+ walkeros run dist/bundle.mjs --port 3000
59
56
  ```
60
57
 
61
58
  ## Commands
@@ -100,25 +97,17 @@ walkeros bundle flow.json --dockerfile Dockerfile.custom
100
97
  ```
101
98
 
102
99
  The output path uses convention-based defaults: `./dist/bundle.mjs` for server,
103
- `./dist/walker.js` for web. The `--dockerfile` flag generates a Dockerfile with
104
- the correct `MODE` (collect/serve) based on flow type.
100
+ `./dist/walker.js` for web.
105
101
 
106
102
  ### simulate
107
103
 
108
- Test event processing with simulated events. Accepts either a config JSON (which
109
- gets bundled) or a pre-built bundle (executed directly).
104
+ Test event processing with simulated events. The config JSON gets bundled and
105
+ executed with destination mocking.
110
106
 
111
107
  ```bash
112
- walkeros simulate <input> --event '{"name":"page view"}' [options]
108
+ walkeros simulate <config> --event '{"name":"page view"}' [options]
113
109
  ```
114
110
 
115
- **Input types:**
116
-
117
- - **Config JSON** - Bundled and executed with destination mocking
118
- - **Pre-built bundle** (`.js`/`.mjs`) - Executed directly, no mocking
119
-
120
- The CLI auto-detects the input type by attempting to parse as JSON.
121
-
122
111
  **Options:**
123
112
 
124
113
  - `-e, --event <json>` - Event to simulate (JSON string, file path, or URL)
@@ -138,23 +127,8 @@ walkeros simulate examples/web-serve.json \
138
127
 
139
128
  # Simulate specific flow from multi-flow config
140
129
  walkeros simulate flow.json --flow server --event '{"name":"test"}'
141
-
142
- # Simulate with pre-built bundle
143
- walkeros simulate dist/bundle.mjs --event '{"name":"page view"}'
144
-
145
- # Override platform detection
146
- walkeros simulate dist/bundle.js --platform server --event '{"name":"page view"}'
147
130
  ```
148
131
 
149
- **Platform detection:**
150
-
151
- When using pre-built bundles, platform is detected from file extension:
152
-
153
- - `.mjs` → server (ESM, Node.js)
154
- - `.js` → web (IIFE, JSDOM)
155
-
156
- Use `--platform` to override if extension doesn't match intended runtime.
157
-
158
132
  ### push
159
133
 
160
134
  Execute your flow with real API calls to configured destinations. Unlike
@@ -221,14 +195,9 @@ real integrations.
221
195
  Run flows locally (no Docker daemon required).
222
196
 
223
197
  ```bash
224
- walkeros run <mode> <config-file> [options]
198
+ walkeros run <config-file> [options]
225
199
  ```
226
200
 
227
- **Modes:**
228
-
229
- - `collect` - HTTP event collection server
230
- - `serve` - Static file server
231
-
232
201
  **Options:**
233
202
 
234
203
  - `-p, --port <number>` - Server port
@@ -241,13 +210,10 @@ walkeros run <mode> <config-file> [options]
241
210
 
242
211
  ```bash
243
212
  # Run collection server (auto-bundles JSON)
244
- walkeros run collect examples/server-collect.json --port 3000
213
+ walkeros run examples/server-collect.json --port 3000
245
214
 
246
215
  # Run with pre-built bundle
247
- walkeros run collect examples/server-collect.mjs --port 3000
248
-
249
- # Serve static files
250
- walkeros run serve flow.json --port 8080 --static-dir ./dist
216
+ walkeros run examples/server-collect.mjs --port 3000
251
217
  ```
252
218
 
253
219
  **How it works:**
@@ -257,6 +223,51 @@ walkeros run serve flow.json --port 8080 --static-dir ./dist
257
223
  3. Runs in current Node.js process
258
224
  4. Press Ctrl+C for graceful shutdown
259
225
 
226
+ ### validate
227
+
228
+ Validate flow configurations, events, mappings, or contracts.
229
+
230
+ ```bash
231
+ walkeros validate <config-file> [options]
232
+ ```
233
+
234
+ By default, validates a Flow.Setup file — checking schema, references, and
235
+ cross-step example compatibility.
236
+
237
+ **Options:**
238
+
239
+ - `--type <type>` - Validation type (default: `flow`). Also accepts: `event`,
240
+ `mapping`, `contract`
241
+ - `--path <path>` - Validate a specific entry against its package schema (e.g.,
242
+ `destinations.snowplow`, `sources.browser`)
243
+ - `--flow <name>` - Flow name for multi-flow configs
244
+ - `--strict` - Treat warnings as errors
245
+ - `--json` - Output as JSON
246
+ - `-v, --verbose` - Verbose output
247
+ - `-s, --silent` - Suppress output
248
+
249
+ **Exit codes:** `0` = valid, `1` = errors, `2` = warnings (with --strict), `3` =
250
+ input error
251
+
252
+ **Examples:**
253
+
254
+ ```bash
255
+ # Validate flow config (schema + examples)
256
+ walkeros validate flow.json
257
+
258
+ # Validate specific flow
259
+ walkeros validate flow.json --flow analytics
260
+
261
+ # Validate a single event
262
+ walkeros validate event.json --type event
263
+
264
+ # Validate in CI
265
+ walkeros validate flow.json --json --strict || exit 1
266
+
267
+ # Validate entry against package schema
268
+ walkeros validate flow.json --path destinations.snowplow
269
+ ```
270
+
260
271
  ### deploy
261
272
 
262
273
  Deploy flows to walkerOS cloud.
@@ -508,7 +519,7 @@ const result = await simulate(
508
519
  );
509
520
 
510
521
  // Run
511
- await runCommand('collect', {
522
+ await runCommand({
512
523
  config: './flow.json',
513
524
  port: 3000,
514
525
  verbose: true,
@@ -536,7 +547,7 @@ walkeros simulate \
536
547
  --event '{"name":"product view","data":{"id":"P123"}}'
537
548
 
538
549
  # Run server
539
- walkeros run collect examples/server-collect.json --port 3000
550
+ walkeros run examples/server-collect.json --port 3000
540
551
  ```
541
552
 
542
553
  ## Development Workflow
@@ -557,7 +568,7 @@ walkeros simulate \
557
568
  walkeros bundle my-flow.json --stats
558
569
 
559
570
  # 4. Run locally
560
- walkeros run collect dist/bundle.mjs --port 3000
571
+ walkeros run dist/bundle.mjs --port 3000
561
572
 
562
573
  # 5. In another terminal, test it
563
574
  curl -X POST http://localhost:3000/collect \
@@ -616,7 +627,7 @@ Run the bundle directly with the CLI:
616
627
  walkeros bundle flow.json
617
628
 
618
629
  # Run in production
619
- walkeros run collect dist/bundle.mjs --port 8080
630
+ walkeros run dist/bundle.mjs --port 8080
620
631
  ```
621
632
 
622
633
  This runs the flow in the current Node.js process, suitable for deployment on