@walkeros/cli 0.5.1-next.0 → 0.6.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.
Files changed (264) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +51 -28
  3. package/dist/__tests__/bundle/bundler-helpers.test.d.ts +2 -0
  4. package/dist/__tests__/bundle/bundler-helpers.test.d.ts.map +1 -0
  5. package/dist/__tests__/bundle/bundler-helpers.test.js +151 -0
  6. package/dist/__tests__/bundle/bundler-helpers.test.js.map +1 -0
  7. package/dist/__tests__/bundle/bundler.test.d.ts +2 -0
  8. package/dist/__tests__/bundle/bundler.test.d.ts.map +1 -0
  9. package/dist/__tests__/bundle/bundler.test.js +352 -0
  10. package/dist/__tests__/bundle/bundler.test.js.map +1 -0
  11. package/dist/__tests__/bundle/programmatic.test.d.ts +2 -0
  12. package/dist/__tests__/bundle/programmatic.test.d.ts.map +1 -0
  13. package/dist/__tests__/bundle/programmatic.test.js +148 -0
  14. package/dist/__tests__/bundle/programmatic.test.js.map +1 -0
  15. package/dist/__tests__/cli-e2e.test.d.ts +8 -0
  16. package/dist/__tests__/cli-e2e.test.d.ts.map +1 -0
  17. package/dist/__tests__/cli-e2e.test.js +145 -0
  18. package/dist/__tests__/cli-e2e.test.js.map +1 -0
  19. package/dist/__tests__/cli.test.d.ts +2 -0
  20. package/dist/__tests__/cli.test.d.ts.map +1 -0
  21. package/dist/__tests__/cli.test.js +179 -0
  22. package/dist/__tests__/cli.test.js.map +1 -0
  23. package/dist/__tests__/config-loader.test.d.ts +7 -0
  24. package/dist/__tests__/config-loader.test.d.ts.map +1 -0
  25. package/dist/__tests__/config-loader.test.js +414 -0
  26. package/dist/__tests__/config-loader.test.js.map +1 -0
  27. package/dist/__tests__/core/asset-resolver.test.d.ts +2 -0
  28. package/dist/__tests__/core/asset-resolver.test.d.ts.map +1 -0
  29. package/dist/__tests__/core/asset-resolver.test.js +14 -0
  30. package/dist/__tests__/core/asset-resolver.test.js.map +1 -0
  31. package/dist/__tests__/core/build-cache.test.d.ts +2 -0
  32. package/dist/__tests__/core/build-cache.test.d.ts.map +1 -0
  33. package/dist/__tests__/core/build-cache.test.js +55 -0
  34. package/dist/__tests__/core/build-cache.test.js.map +1 -0
  35. package/dist/__tests__/core/cache-utils.test.d.ts +2 -0
  36. package/dist/__tests__/core/cache-utils.test.d.ts.map +1 -0
  37. package/dist/__tests__/core/cache-utils.test.js +70 -0
  38. package/dist/__tests__/core/cache-utils.test.js.map +1 -0
  39. package/dist/__tests__/core/config.test.d.ts +2 -0
  40. package/dist/__tests__/core/config.test.d.ts.map +1 -0
  41. package/dist/__tests__/core/config.test.js +79 -0
  42. package/dist/__tests__/core/config.test.js.map +1 -0
  43. package/dist/__tests__/core/logger.test.d.ts +2 -0
  44. package/dist/__tests__/core/logger.test.d.ts.map +1 -0
  45. package/dist/__tests__/core/logger.test.js +53 -0
  46. package/dist/__tests__/core/logger.test.js.map +1 -0
  47. package/dist/__tests__/integration/bundle-run.integration.test.d.ts +8 -0
  48. package/dist/__tests__/integration/bundle-run.integration.test.d.ts.map +1 -0
  49. package/dist/__tests__/integration/bundle-run.integration.test.js +54 -0
  50. package/dist/__tests__/integration/bundle-run.integration.test.js.map +1 -0
  51. package/dist/__tests__/push/push.test.d.ts +7 -0
  52. package/dist/__tests__/push/push.test.d.ts.map +1 -0
  53. package/dist/__tests__/push/push.test.js +197 -0
  54. package/dist/__tests__/push/push.test.js.map +1 -0
  55. package/dist/__tests__/simulate/env-loader.test.d.ts +2 -0
  56. package/dist/__tests__/simulate/env-loader.test.d.ts.map +1 -0
  57. package/dist/__tests__/simulate/env-loader.test.js +47 -0
  58. package/dist/__tests__/simulate/env-loader.test.js.map +1 -0
  59. package/dist/__tests__/simulate/node-executor.test.d.ts +5 -0
  60. package/dist/__tests__/simulate/node-executor.test.d.ts.map +1 -0
  61. package/dist/__tests__/simulate/node-executor.test.js +25 -0
  62. package/dist/__tests__/simulate/node-executor.test.js.map +1 -0
  63. package/dist/__tests__/simulate/server-simulate.integration.test.d.ts +5 -0
  64. package/dist/__tests__/simulate/server-simulate.integration.test.d.ts.map +1 -0
  65. package/dist/__tests__/simulate/server-simulate.integration.test.js +58 -0
  66. package/dist/__tests__/simulate/server-simulate.integration.test.js.map +1 -0
  67. package/dist/__tests__/smoke/production.smoke.test.d.ts +8 -0
  68. package/dist/__tests__/smoke/production.smoke.test.d.ts.map +1 -0
  69. package/dist/__tests__/smoke/production.smoke.test.js +65 -0
  70. package/dist/__tests__/smoke/production.smoke.test.js.map +1 -0
  71. package/dist/commands/bundle/bundler.d.ts +32 -0
  72. package/dist/commands/bundle/bundler.d.ts.map +1 -0
  73. package/dist/commands/bundle/bundler.js +569 -0
  74. package/dist/commands/bundle/bundler.js.map +1 -0
  75. package/dist/commands/bundle/index.d.ts +59 -0
  76. package/dist/commands/bundle/index.d.ts.map +1 -0
  77. package/dist/commands/bundle/index.js +184 -0
  78. package/dist/commands/bundle/index.js.map +1 -0
  79. package/dist/commands/bundle/package-manager.d.ts +8 -0
  80. package/dist/commands/bundle/package-manager.d.ts.map +1 -0
  81. package/dist/commands/bundle/package-manager.js +220 -0
  82. package/dist/commands/bundle/package-manager.js.map +1 -0
  83. package/dist/commands/bundle/stats.d.ts +23 -0
  84. package/dist/commands/bundle/stats.d.ts.map +1 -0
  85. package/dist/commands/bundle/stats.js +52 -0
  86. package/dist/commands/bundle/stats.js.map +1 -0
  87. package/dist/commands/cache.d.ts +7 -0
  88. package/dist/commands/cache.d.ts.map +1 -0
  89. package/dist/commands/cache.js +68 -0
  90. package/dist/commands/cache.js.map +1 -0
  91. package/dist/commands/push/index.d.ts +7 -0
  92. package/dist/commands/push/index.d.ts.map +1 -0
  93. package/dist/commands/push/index.js +247 -0
  94. package/dist/commands/push/index.js.map +1 -0
  95. package/dist/commands/push/types.d.ts +22 -0
  96. package/dist/commands/push/types.d.ts.map +1 -0
  97. package/dist/commands/push/types.js +2 -0
  98. package/dist/commands/push/types.js.map +1 -0
  99. package/dist/commands/run/__tests__/run.integration.test.d.ts +7 -0
  100. package/dist/commands/run/__tests__/run.integration.test.d.ts.map +1 -0
  101. package/dist/commands/run/__tests__/run.integration.test.js +51 -0
  102. package/dist/commands/run/__tests__/run.integration.test.js.map +1 -0
  103. package/dist/commands/run/__tests__/validators.test.d.ts +2 -0
  104. package/dist/commands/run/__tests__/validators.test.d.ts.map +1 -0
  105. package/dist/commands/run/__tests__/validators.test.js +80 -0
  106. package/dist/commands/run/__tests__/validators.test.js.map +1 -0
  107. package/dist/commands/run/execution.d.ts +14 -0
  108. package/dist/commands/run/execution.d.ts.map +1 -0
  109. package/dist/commands/run/execution.js +41 -0
  110. package/dist/commands/run/execution.js.map +1 -0
  111. package/dist/commands/run/index.d.ts +38 -0
  112. package/dist/commands/run/index.d.ts.map +1 -0
  113. package/dist/commands/run/index.js +154 -0
  114. package/dist/commands/run/index.js.map +1 -0
  115. package/dist/commands/run/types.d.ts +65 -0
  116. package/dist/commands/run/types.d.ts.map +1 -0
  117. package/dist/commands/run/types.js +7 -0
  118. package/dist/commands/run/types.js.map +1 -0
  119. package/dist/commands/run/utils.d.ts +29 -0
  120. package/dist/commands/run/utils.d.ts.map +1 -0
  121. package/dist/commands/run/utils.js +52 -0
  122. package/dist/commands/run/utils.js.map +1 -0
  123. package/dist/commands/run/validators.d.ts +33 -0
  124. package/dist/commands/run/validators.d.ts.map +1 -0
  125. package/dist/commands/run/validators.js +58 -0
  126. package/dist/commands/run/validators.js.map +1 -0
  127. package/dist/commands/simulate/env-loader.d.ts +19 -0
  128. package/dist/commands/simulate/env-loader.d.ts.map +1 -0
  129. package/dist/commands/simulate/env-loader.js +44 -0
  130. package/dist/commands/simulate/env-loader.js.map +1 -0
  131. package/dist/commands/simulate/index.d.ts +48 -0
  132. package/dist/commands/simulate/index.d.ts.map +1 -0
  133. package/dist/commands/simulate/index.js +113 -0
  134. package/dist/commands/simulate/index.js.map +1 -0
  135. package/dist/commands/simulate/jsdom-executor.d.ts +37 -0
  136. package/dist/commands/simulate/jsdom-executor.d.ts.map +1 -0
  137. package/dist/commands/simulate/jsdom-executor.js +137 -0
  138. package/dist/commands/simulate/jsdom-executor.js.map +1 -0
  139. package/dist/commands/simulate/node-executor.d.ts +28 -0
  140. package/dist/commands/simulate/node-executor.d.ts.map +1 -0
  141. package/dist/commands/simulate/node-executor.js +94 -0
  142. package/dist/commands/simulate/node-executor.js.map +1 -0
  143. package/dist/commands/simulate/simulator.d.ts +14 -0
  144. package/dist/commands/simulate/simulator.d.ts.map +1 -0
  145. package/dist/commands/simulate/simulator.js +163 -0
  146. package/dist/commands/simulate/simulator.js.map +1 -0
  147. package/dist/commands/simulate/tracker.d.ts +30 -0
  148. package/dist/commands/simulate/tracker.d.ts.map +1 -0
  149. package/dist/commands/simulate/tracker.js +96 -0
  150. package/dist/commands/simulate/tracker.js.map +1 -0
  151. package/dist/commands/simulate/types.d.ts +20 -0
  152. package/dist/commands/simulate/types.d.ts.map +1 -0
  153. package/dist/commands/simulate/types.js +2 -0
  154. package/dist/commands/simulate/types.js.map +1 -0
  155. package/dist/config/build-defaults.d.ts +49 -0
  156. package/dist/config/build-defaults.d.ts.map +1 -0
  157. package/dist/config/build-defaults.js +68 -0
  158. package/dist/config/build-defaults.js.map +1 -0
  159. package/dist/config/index.d.ts +13 -0
  160. package/dist/config/index.d.ts.map +1 -0
  161. package/dist/config/index.js +15 -0
  162. package/dist/config/index.js.map +1 -0
  163. package/dist/config/loader.d.ts +81 -0
  164. package/dist/config/loader.d.ts.map +1 -0
  165. package/dist/config/loader.js +153 -0
  166. package/dist/config/loader.js.map +1 -0
  167. package/dist/config/utils.d.ts +101 -0
  168. package/dist/config/utils.d.ts.map +1 -0
  169. package/dist/config/utils.js +235 -0
  170. package/dist/config/utils.js.map +1 -0
  171. package/dist/config/validators.d.ts +52 -0
  172. package/dist/config/validators.d.ts.map +1 -0
  173. package/dist/config/validators.js +85 -0
  174. package/dist/config/validators.js.map +1 -0
  175. package/dist/core/asset-resolver.d.ts +34 -0
  176. package/dist/core/asset-resolver.d.ts.map +1 -0
  177. package/dist/core/asset-resolver.js +70 -0
  178. package/dist/core/asset-resolver.js.map +1 -0
  179. package/dist/core/build-cache.d.ts +23 -0
  180. package/dist/core/build-cache.d.ts.map +1 -0
  181. package/dist/core/build-cache.js +44 -0
  182. package/dist/core/build-cache.js.map +1 -0
  183. package/dist/core/cache-utils.d.ts +27 -0
  184. package/dist/core/cache-utils.d.ts.map +1 -0
  185. package/dist/core/cache-utils.js +60 -0
  186. package/dist/core/cache-utils.js.map +1 -0
  187. package/dist/core/index.d.ts +8 -0
  188. package/dist/core/index.d.ts.map +1 -0
  189. package/dist/core/index.js +8 -0
  190. package/dist/core/index.js.map +1 -0
  191. package/dist/core/local-packages.d.ts +19 -0
  192. package/dist/core/local-packages.d.ts.map +1 -0
  193. package/dist/core/local-packages.js +60 -0
  194. package/dist/core/local-packages.js.map +1 -0
  195. package/dist/core/logger.d.ts +30 -0
  196. package/dist/core/logger.d.ts.map +1 -0
  197. package/dist/core/logger.js +85 -0
  198. package/dist/core/logger.js.map +1 -0
  199. package/dist/core/output.d.ts +30 -0
  200. package/dist/core/output.d.ts.map +1 -0
  201. package/dist/core/output.js +46 -0
  202. package/dist/core/output.js.map +1 -0
  203. package/dist/core/timer.d.ts +14 -0
  204. package/dist/core/timer.d.ts.map +1 -0
  205. package/dist/core/timer.js +29 -0
  206. package/dist/core/timer.js.map +1 -0
  207. package/dist/core/tmp.d.ts +27 -0
  208. package/dist/core/tmp.d.ts.map +1 -0
  209. package/dist/core/tmp.js +36 -0
  210. package/dist/core/tmp.js.map +1 -0
  211. package/dist/core/utils.d.ts +10 -0
  212. package/dist/core/utils.d.ts.map +1 -0
  213. package/dist/core/utils.js +12 -0
  214. package/dist/core/utils.js.map +1 -0
  215. package/dist/index.d.ts +20 -13
  216. package/dist/index.d.ts.map +1 -0
  217. package/dist/index.js +633 -761
  218. package/dist/index.js.map +1 -1
  219. package/dist/runtime/index.d.ts +10 -0
  220. package/dist/runtime/index.d.ts.map +1 -0
  221. package/dist/runtime/index.js +10 -0
  222. package/dist/runtime/index.js.map +1 -0
  223. package/dist/runtime/main.d.ts +2 -0
  224. package/dist/runtime/main.d.ts.map +1 -0
  225. package/dist/runtime/main.js +268 -0
  226. package/dist/runtime/main.js.map +1 -0
  227. package/dist/runtime/runner.d.ts +20 -0
  228. package/dist/runtime/runner.d.ts.map +1 -0
  229. package/dist/runtime/runner.js +72 -0
  230. package/dist/runtime/runner.js.map +1 -0
  231. package/dist/runtime/serve.d.ts +19 -0
  232. package/dist/runtime/serve.d.ts.map +1 -0
  233. package/dist/runtime/serve.js +97 -0
  234. package/dist/runtime/serve.js.map +1 -0
  235. package/dist/schemas/index.d.ts +9 -0
  236. package/dist/schemas/index.d.ts.map +1 -0
  237. package/dist/schemas/index.js +9 -0
  238. package/dist/schemas/index.js.map +1 -0
  239. package/dist/schemas/primitives.d.ts +37 -0
  240. package/dist/schemas/primitives.d.ts.map +1 -0
  241. package/dist/schemas/primitives.js +43 -0
  242. package/dist/schemas/primitives.js.map +1 -0
  243. package/dist/schemas/run.d.ts +23 -0
  244. package/dist/schemas/run.d.ts.map +1 -0
  245. package/dist/schemas/run.js +20 -0
  246. package/dist/schemas/run.js.map +1 -0
  247. package/dist/types/bundle.d.ts +141 -0
  248. package/dist/types/bundle.d.ts.map +1 -0
  249. package/dist/types/bundle.js +10 -0
  250. package/dist/types/bundle.js.map +1 -0
  251. package/dist/types/global.d.ts +38 -0
  252. package/dist/types/global.d.ts.map +1 -0
  253. package/dist/types/global.js +24 -0
  254. package/dist/types/global.js.map +1 -0
  255. package/dist/types/index.d.ts +8 -0
  256. package/dist/types/index.d.ts.map +1 -0
  257. package/dist/types/index.js +8 -0
  258. package/dist/types/index.js.map +1 -0
  259. package/dist/version.d.ts +3 -0
  260. package/dist/version.d.ts.map +1 -0
  261. package/dist/version.js +27 -0
  262. package/dist/version.js.map +1 -0
  263. package/dist/walker.js +1 -0
  264. package/package.json +7 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @walkeros/cli
2
2
 
3
+ ## 0.0.0-next-20251219153324
4
+
5
+ ### Minor Changes
6
+
7
+ - 42d06c8: CLI simplification - removed Docker mode for build commands, merged
8
+ runtime from @walkeros/docker into CLI, single walkeros/flow image for
9
+ production
10
+
11
+ ### Patch Changes
12
+
13
+ - 71b615f: Fix URL handling in resolveAsset - URLs are now passed through
14
+ unchanged instead of being mangled into invalid filesystem paths
15
+ - Updated dependencies [5163b01]
16
+ - @walkeros/core@0.0.0-next-20251219153324
17
+ - @walkeros/server-core@0.0.0-next-20251219153324
18
+
19
+ ## 0.7.0-next.0
20
+
21
+ ### Minor Changes
22
+
23
+ - 42d06c8: Fix Docker runtime version display - versions now read reliably from
24
+ package.json at runtime instead of fragile build-time injection
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [42d06c8]
29
+ - @walkeros/docker@0.7.0-next.0
30
+
31
+ ## 0.5.1-next.1
32
+
33
+ ### Patch Changes
34
+
35
+ - 71b615f: Fix URL handling in resolveAsset - URLs are now passed through
36
+ unchanged instead of being mangled into invalid filesystem paths
37
+
3
38
  ## 0.5.1-next.0
4
39
 
5
40
  ### Patch Changes
package/README.md CHANGED
@@ -31,13 +31,13 @@ npm install @walkeros/cli
31
31
  walkeros bundle flow.json
32
32
 
33
33
  # Test with simulated events (no real API calls)
34
- walkeros simulate flow.json --event '{"name":"page view"}'
34
+ walkeros simulate flow.json --event '{"name":"product view"}'
35
35
 
36
36
  # Push real events to destinations
37
- walkeros push flow.json --event '{"name":"page view"}'
37
+ walkeros push flow.json --event '{"name":"product view"}'
38
38
 
39
39
  # Run a collection server locally
40
- walkeros run collect flow.json --port 3000
40
+ walkeros run collect dist/bundle.mjs --port 3000
41
41
  ```
42
42
 
43
43
  ## Commands
@@ -64,7 +64,6 @@ walkeros bundle https://example.com/config.json # Remote URL
64
64
  - `-s, --stats` - Show bundle statistics
65
65
  - `--json` - Output stats as JSON
66
66
  - `--no-cache` - Disable package caching
67
- - `--local` - Run locally without Docker
68
67
  - `-v, --verbose` - Verbose output
69
68
 
70
69
  **Example:**
@@ -89,7 +88,6 @@ walkeros simulate <config-file> --event '{"name":"page view"}' [options]
89
88
 
90
89
  - `-e, --event <json>` - Event JSON string (required)
91
90
  - `--json` - Output results as JSON
92
- - `--local` - Run locally without Docker
93
91
  - `-v, --verbose` - Verbose output
94
92
 
95
93
  **Example:**
@@ -119,7 +117,6 @@ walkeros push <config-file> --event '<json>' [options]
119
117
  - `--json` - Output results as JSON
120
118
  - `-v, --verbose` - Verbose output
121
119
  - `-s, --silent` - Suppress output (for CI/CD)
122
- - `--local` - Execute locally without Docker
123
120
 
124
121
  **Event input formats:**
125
122
 
@@ -147,8 +144,7 @@ real integrations.
147
144
 
148
145
  ### run
149
146
 
150
- Run flows locally using @walkeros/docker as a library (no Docker daemon
151
- required).
147
+ Run flows locally (no Docker daemon required).
152
148
 
153
149
  ```bash
154
150
  walkeros run <mode> <config-file> [options]
@@ -164,7 +160,6 @@ walkeros run <mode> <config-file> [options]
164
160
  - `-p, --port <number>` - Server port
165
161
  - `-h, --host <host>` - Server host
166
162
  - `--static-dir <dir>` - Static directory (serve mode)
167
- - `--local` - Run locally without Docker
168
163
  - `--json` - JSON output
169
164
  - `-v, --verbose` - Verbose output
170
165
 
@@ -183,9 +178,9 @@ walkeros run serve flow.json --port 8080 --static-dir ./dist
183
178
 
184
179
  **How it works:**
185
180
 
186
- 1. JSON configs are bundled to temp `.mjs` automatically
181
+ 1. JSON configs are auto-bundled to temp `.mjs`
187
182
  2. `.mjs` bundles are used directly
188
- 3. Runs in current Node.js process (no containers)
183
+ 3. Runs in current Node.js process
189
184
  4. Press Ctrl+C for graceful shutdown
190
185
 
191
186
  ## Caching
@@ -444,17 +439,17 @@ Typical development cycle:
444
439
  # 1. Create/edit config
445
440
  vim my-flow.json
446
441
 
447
- # 2. Bundle and check stats
448
- walkeros bundle my-flow.json --stats
449
-
450
- # 3. Test with simulation
442
+ # 2. Test with simulation (no real API calls)
451
443
  walkeros simulate \
452
444
  my-flow.json \
453
- --event '{"name":"test event"}' \
445
+ --event '{"name":"product view"}' \
454
446
  --verbose
455
447
 
448
+ # 3. Bundle and check stats
449
+ walkeros bundle my-flow.json --stats
450
+
456
451
  # 4. Run locally
457
- walkeros run collect my-flow.json --port 3000
452
+ walkeros run collect dist/bundle.mjs --port 3000
458
453
 
459
454
  # 5. In another terminal, test it
460
455
  curl -X POST http://localhost:3000/collect \
@@ -468,26 +463,55 @@ curl -X POST http://localhost:3000/collect \
468
463
  CLI (downloads packages + bundles with esbuild)
469
464
  ├─ Bundle → optimized .mjs file
470
465
  ├─ Simulate → test bundle with events
471
- └─ Run → import @walkeros/docker + execute bundle
466
+ └─ Run → execute bundle with built-in runtime
472
467
  ```
473
468
 
474
- **Key principle**: CLI handles build-time, Docker handles runtime.
469
+ **Key principle**: CLI handles both build-time and runtime operations.
475
470
 
476
- ## Docker Images
471
+ ## Production Deployment
477
472
 
478
- By default, CLI uses **explicit version tags** (not `:latest`):
473
+ Deploy your flows using Docker or Node.js.
479
474
 
480
- - `walkeros/cli:0.3.5` - Build tools (bundle, simulate)
481
- - `walkeros/docker:0.1.4` - Production runtime
475
+ ### Using Docker
482
476
 
483
- Override with environment variables:
477
+ The `walkeros/flow` image runs pre-built bundles in production:
484
478
 
485
479
  ```bash
486
- export WALKEROS_CLI_DOCKER_IMAGE=walkeros/cli:0.3.4
487
- export WALKEROS_RUNTIME_DOCKER_IMAGE=walkeros/docker:latest
488
- walkeros bundle config.json
480
+ # Build your flow
481
+ walkeros bundle flow.json
482
+
483
+ # Run with Docker
484
+ docker run -v ./dist:/flow -p 8080:8080 walkeros/flow
489
485
  ```
490
486
 
487
+ **Custom image:**
488
+
489
+ ```dockerfile
490
+ FROM walkeros/flow
491
+ COPY dist/bundle.mjs /flow/
492
+ ```
493
+
494
+ **Environment variables:**
495
+
496
+ - `MODE` - `collect` or `serve` (default: `collect`)
497
+ - `PORT` - Server port (default: `8080`)
498
+ - `FILE` - Bundle path (default: `/flow/bundle.mjs`)
499
+
500
+ ### Using Node.js
501
+
502
+ Run the bundle directly with the CLI:
503
+
504
+ ```bash
505
+ # Build your flow
506
+ walkeros bundle flow.json
507
+
508
+ # Run in production
509
+ walkeros run collect dist/bundle.mjs --port 8080
510
+ ```
511
+
512
+ This runs the flow in the current Node.js process, suitable for deployment on
513
+ platforms like AWS Lambda, Google Cloud Run, or any Node.js hosting.
514
+
491
515
  ## Requirements
492
516
 
493
517
  - **Node.js**: 18+ or 22+
@@ -501,7 +525,6 @@ See [src/types.ts](./src/types.ts) for TypeScript interfaces.
501
525
 
502
526
  - [Website Documentation](https://www.walkeros.io/docs/cli/)
503
527
  - [Flow Configuration](https://www.walkeros.io/docs/getting-started/flow/)
504
- - [Docker Package](../docker/) - Production runtime
505
528
 
506
529
  ## License
507
530
 
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bundler-helpers.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler-helpers.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/bundle/bundler-helpers.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,151 @@
1
+ // Import helper functions - we need to access them for testing
2
+ // Since they're not exported, we'll test through createEntryPoint's behavior
3
+ // Or we can temporarily export them for testing
4
+ // For now, let's create focused unit tests for each logical section
5
+ describe('Bundler Helper Functions', () => {
6
+ describe('detectDestinationPackages', () => {
7
+ it('should detect destination packages with explicit package field', () => {
8
+ const flowConfig = {
9
+ destinations: {
10
+ gtag: {
11
+ package: '@walkeros/web-destination-gtag',
12
+ config: {},
13
+ },
14
+ api: {
15
+ package: '@walkeros/web-destination-api',
16
+ config: {},
17
+ },
18
+ },
19
+ };
20
+ // We'll need to export the helper or test indirectly
21
+ // For this test file, we're documenting expected behavior
22
+ expect(flowConfig.destinations).toBeDefined();
23
+ });
24
+ it('should skip destinations without package field', () => {
25
+ const flowConfig = {
26
+ destinations: {
27
+ custom: {
28
+ // No package field
29
+ config: {},
30
+ },
31
+ },
32
+ };
33
+ expect(flowConfig.destinations).toBeDefined();
34
+ });
35
+ it('should handle empty destinations', () => {
36
+ const flowConfig = {};
37
+ expect(flowConfig.destinations).toBeUndefined();
38
+ });
39
+ });
40
+ describe('generateImportStatements', () => {
41
+ it('should generate default imports', () => {
42
+ const packages = {
43
+ '@walkeros/core': {
44
+ imports: ['default as walkerCore'],
45
+ },
46
+ };
47
+ // Expected output:
48
+ // import walkerCore from '@walkeros/core';
49
+ expect(packages).toBeDefined();
50
+ });
51
+ it('should generate named imports', () => {
52
+ const packages = {
53
+ '@walkeros/core': {
54
+ imports: ['getId', 'trim'],
55
+ },
56
+ };
57
+ // Expected output:
58
+ // import { getId, trim } from '@walkeros/core';
59
+ expect(packages).toBeDefined();
60
+ });
61
+ it('should generate namespace import when no imports specified', () => {
62
+ const packages = {
63
+ '@walkeros/core': {},
64
+ };
65
+ // Expected output:
66
+ // import * as _walkerosCore from '@walkeros/core'; // Consider specifying explicit imports
67
+ expect(packages).toBeDefined();
68
+ });
69
+ it('should handle examples imports', () => {
70
+ const packages = {
71
+ '@walkeros/web-destination-gtag': {
72
+ imports: ['examples as gtagExamples', 'destinationGtag'],
73
+ },
74
+ };
75
+ // Expected output:
76
+ // import { destinationGtag } from '@walkeros/web-destination-gtag';
77
+ // Example mapping: gtag: typeof gtagExamples !== 'undefined' ? gtagExamples : undefined
78
+ expect(packages).toBeDefined();
79
+ });
80
+ it('should auto-import examples for destination packages', () => {
81
+ const packages = {
82
+ '@walkeros/web-destination-gtag': {
83
+ imports: ['destinationGtag'],
84
+ },
85
+ };
86
+ const destinationPackages = new Set(['@walkeros/web-destination-gtag']);
87
+ // Expected output:
88
+ // import { examples as gtag_examples } from '@walkeros/web-destination-gtag/dev';
89
+ // Example mapping: gtag: gtag_examples
90
+ expect(destinationPackages.has('@walkeros/web-destination-gtag')).toBe(true);
91
+ });
92
+ it('should handle demo packages differently for examples', () => {
93
+ const packages = {
94
+ '@walkeros/web-destination-gtag-demo': {
95
+ imports: [],
96
+ },
97
+ };
98
+ // Expected output for demo packages:
99
+ // import { examples as gtag_demo_examples } from '@walkeros/web-destination-gtag-demo';
100
+ // (not from /dev subpath)
101
+ expect(packages).toBeDefined();
102
+ });
103
+ it('should remove duplicate imports', () => {
104
+ const packages = {
105
+ '@walkeros/core': {
106
+ imports: ['getId', 'getId', 'trim'],
107
+ },
108
+ };
109
+ // Should deduplicate to: import { getId, trim } from '@walkeros/core';
110
+ expect(packages).toBeDefined();
111
+ });
112
+ });
113
+ describe('Integration: createEntryPoint refactored behavior', () => {
114
+ it('should maintain backward compatibility with original implementation', () => {
115
+ // This test documents that the refactored version should produce
116
+ // identical output to the original 189-line implementation
117
+ // The helper extraction is purely for maintainability and testability
118
+ const flowConfig = {
119
+ destinations: {
120
+ gtag: {
121
+ package: '@walkeros/web-destination-gtag',
122
+ },
123
+ },
124
+ };
125
+ const buildOptions = {
126
+ packages: {
127
+ '@walkeros/core': {
128
+ imports: ['getId'],
129
+ },
130
+ '@walkeros/web-destination-gtag': {
131
+ imports: ['destinationGtag', 'examples as gtagExamples'],
132
+ },
133
+ },
134
+ code: 'export const flow = startFlow();',
135
+ format: 'esm',
136
+ platform: 'browser',
137
+ };
138
+ // The refactored createEntryPoint should:
139
+ // 1. Detect @walkeros/web-destination-gtag as a destination package
140
+ // 2. Generate imports for @walkeros/core and gtag destination
141
+ // 3. Create examples object with gtag mapping
142
+ // 4. Process code (no template, so return as-is)
143
+ // 5. Wrap code (ESM, already has export, so no wrapping)
144
+ // 6. Assemble: imports + examples + code + export { examples }
145
+ expect(buildOptions.format).toBe('esm');
146
+ expect(flowConfig.destinations).toBeDefined();
147
+ });
148
+ });
149
+ });
150
+ export {};
151
+ //# sourceMappingURL=bundler-helpers.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler-helpers.test.js","sourceRoot":"","sources":["../../../src/__tests__/b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;YACzD,+DAA+D;YAE/D,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bundler.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundler.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/bundle/bundler.test.ts"],"names":[],"mappings":""}