@walkeros/cli 0.0.0-next-20251219153324

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 (284) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/README.md +531 -0
  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 +564 -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 +192 -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 +208 -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 +61 -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 +250 -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 +165 -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 +46 -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 +114 -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 +28 -0
  196. package/dist/core/logger.d.ts.map +1 -0
  197. package/dist/core/logger.js +88 -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/examples/README.md +355 -0
  216. package/dist/examples/event.json +53 -0
  217. package/dist/examples/flow-order-complete.json +67 -0
  218. package/dist/examples/flow-simple.json +31 -0
  219. package/dist/examples/flow.json +82 -0
  220. package/dist/examples/server-collect.json +60 -0
  221. package/dist/examples/server-collect.mjs +13540 -0
  222. package/dist/examples/test.html +43 -0
  223. package/dist/examples/web-serve.js +25503 -0
  224. package/dist/examples/web-serve.json +74 -0
  225. package/dist/index.d.ts +427 -0
  226. package/dist/index.d.ts.map +1 -0
  227. package/dist/index.js +2629 -0
  228. package/dist/index.js.map +1 -0
  229. package/dist/runtime/index.d.ts +10 -0
  230. package/dist/runtime/index.d.ts.map +1 -0
  231. package/dist/runtime/index.js +10 -0
  232. package/dist/runtime/index.js.map +1 -0
  233. package/dist/runtime/main.d.ts +2 -0
  234. package/dist/runtime/main.d.ts.map +1 -0
  235. package/dist/runtime/main.js +269 -0
  236. package/dist/runtime/main.js.map +1 -0
  237. package/dist/runtime/runner.d.ts +20 -0
  238. package/dist/runtime/runner.d.ts.map +1 -0
  239. package/dist/runtime/runner.js +72 -0
  240. package/dist/runtime/runner.js.map +1 -0
  241. package/dist/runtime/serve.d.ts +19 -0
  242. package/dist/runtime/serve.d.ts.map +1 -0
  243. package/dist/runtime/serve.js +97 -0
  244. package/dist/runtime/serve.js.map +1 -0
  245. package/dist/schemas/index.d.ts +9 -0
  246. package/dist/schemas/index.d.ts.map +1 -0
  247. package/dist/schemas/index.js +9 -0
  248. package/dist/schemas/index.js.map +1 -0
  249. package/dist/schemas/primitives.d.ts +37 -0
  250. package/dist/schemas/primitives.d.ts.map +1 -0
  251. package/dist/schemas/primitives.js +43 -0
  252. package/dist/schemas/primitives.js.map +1 -0
  253. package/dist/schemas/run.d.ts +23 -0
  254. package/dist/schemas/run.d.ts.map +1 -0
  255. package/dist/schemas/run.js +20 -0
  256. package/dist/schemas/run.js.map +1 -0
  257. package/dist/types/bundle.d.ts +141 -0
  258. package/dist/types/bundle.d.ts.map +1 -0
  259. package/dist/types/bundle.js +10 -0
  260. package/dist/types/bundle.js.map +1 -0
  261. package/dist/types/global.d.ts +38 -0
  262. package/dist/types/global.d.ts.map +1 -0
  263. package/dist/types/global.js +24 -0
  264. package/dist/types/global.js.map +1 -0
  265. package/dist/types/index.d.ts +8 -0
  266. package/dist/types/index.d.ts.map +1 -0
  267. package/dist/types/index.js +8 -0
  268. package/dist/types/index.js.map +1 -0
  269. package/dist/version.d.ts +3 -0
  270. package/dist/version.d.ts.map +1 -0
  271. package/dist/version.js +27 -0
  272. package/dist/version.js.map +1 -0
  273. package/dist/walker.js +1 -0
  274. package/examples/README.md +355 -0
  275. package/examples/event.json +53 -0
  276. package/examples/flow-order-complete.json +67 -0
  277. package/examples/flow-simple.json +31 -0
  278. package/examples/flow.json +82 -0
  279. package/examples/server-collect.json +60 -0
  280. package/examples/server-collect.mjs +13540 -0
  281. package/examples/test.html +43 -0
  282. package/examples/web-serve.js +25503 -0
  283. package/examples/web-serve.json +74 -0
  284. package/package.json +62 -0
@@ -0,0 +1,74 @@
1
+ {
2
+ "version": 1,
3
+ "flows": {
4
+ "default": {
5
+ "web": {
6
+ "windowCollector": "collector",
7
+ "windowElb": "elb"
8
+ },
9
+ "packages": {
10
+ "@walkeros/collector": {
11
+ "imports": ["startFlow"]
12
+ },
13
+ "@walkeros/source-demo": {
14
+ "imports": ["sourceDemo"]
15
+ },
16
+ "@walkeros/destination-demo": {
17
+ "imports": ["destinationDemo"]
18
+ },
19
+ "@walkeros/web-destination-api": {
20
+ "imports": ["destinationAPI"]
21
+ }
22
+ },
23
+ "sources": {
24
+ "demo": {
25
+ "package": "@walkeros/source-demo",
26
+ "config": {
27
+ "settings": {
28
+ "events": [
29
+ {
30
+ "name": "page view",
31
+ "data": { "title": "Home", "path": "/" },
32
+ "delay": 0
33
+ },
34
+ {
35
+ "name": "product view",
36
+ "data": {
37
+ "id": "P123",
38
+ "name": "Test Product",
39
+ "price": 99.99
40
+ },
41
+ "delay": 100
42
+ }
43
+ ]
44
+ }
45
+ }
46
+ }
47
+ },
48
+ "destinations": {
49
+ "demo": {
50
+ "package": "@walkeros/destination-demo",
51
+ "config": {
52
+ "settings": {
53
+ "name": "demo"
54
+ }
55
+ }
56
+ },
57
+ "api": {
58
+ "package": "@walkeros/web-destination-api",
59
+ "config": {
60
+ "settings": {
61
+ "url": "http://localhost:8080/collect"
62
+ }
63
+ }
64
+ }
65
+ },
66
+ "collector": {
67
+ "run": true,
68
+ "globals": {
69
+ "language": "en"
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,427 @@
1
+ import { Flow, Elb } from '@walkeros/core';
2
+ export { Flow } from '@walkeros/core';
3
+ import { BuildOptions as BuildOptions$1 } from 'esbuild';
4
+
5
+ /**
6
+ * CLI Build Configuration
7
+ *
8
+ * CLI-specific build options for walkerOS bundle generation.
9
+ * Uses Flow.Setup and Flow.Config from @walkeros/core for config structure.
10
+ *
11
+ * @packageDocumentation
12
+ */
13
+
14
+ /**
15
+ * CLI-specific build options (public API).
16
+ *
17
+ * @remarks
18
+ * These are CLI-only options not part of the config file.
19
+ * The config file uses Flow.Setup from @walkeros/core.
20
+ *
21
+ * Platform-derived defaults:
22
+ * - web: format=iife, target=es2020, platform=browser
23
+ * - server: format=esm, target=node18, platform=node
24
+ */
25
+ interface CLIBuildOptions extends Pick<BuildOptions$1, 'external'> {
26
+ /**
27
+ * Output file path (CLI argument, not in config).
28
+ * @default "./dist/walker.js" (web) or "./dist/bundle.mjs" (server)
29
+ */
30
+ output?: string;
31
+ /**
32
+ * Temporary directory for build artifacts.
33
+ * @default ".tmp"
34
+ */
35
+ tempDir?: string;
36
+ /**
37
+ * Enable package caching.
38
+ * @default true
39
+ */
40
+ cache?: boolean;
41
+ /**
42
+ * User code to include in bundle.
43
+ */
44
+ code?: string;
45
+ }
46
+ /**
47
+ * Internal build options used by the bundler.
48
+ *
49
+ * @remarks
50
+ * Combines CLI options with resolved esbuild settings.
51
+ * This is populated after processing config and CLI arguments.
52
+ */
53
+ interface BuildOptions extends CLIBuildOptions {
54
+ /**
55
+ * Output file path (required for bundler).
56
+ */
57
+ output: string;
58
+ /**
59
+ * Packages to include in the bundle.
60
+ */
61
+ packages: Flow.Packages;
62
+ /**
63
+ * Output format.
64
+ */
65
+ format: 'esm' | 'iife' | 'cjs';
66
+ /**
67
+ * Target platform.
68
+ */
69
+ platform: 'browser' | 'node';
70
+ /**
71
+ * Enable minification.
72
+ * @default true
73
+ */
74
+ minify?: boolean;
75
+ /**
76
+ * Enable source maps.
77
+ * @default false
78
+ */
79
+ sourcemap?: boolean;
80
+ /**
81
+ * ECMAScript target version.
82
+ */
83
+ target?: string;
84
+ /**
85
+ * Minification options.
86
+ */
87
+ minifyOptions?: MinifyOptions;
88
+ /**
89
+ * Window property name for collector (web platform only).
90
+ * @default "collector"
91
+ */
92
+ windowCollector?: string;
93
+ /**
94
+ * Window property name for elb function (web platform only).
95
+ * @default "elb"
96
+ */
97
+ windowElb?: string;
98
+ /**
99
+ * Folders to include in the output directory.
100
+ * These folders are copied alongside the bundle for runtime access.
101
+ * @default ["./shared"] if folder exists
102
+ */
103
+ include?: string[];
104
+ /**
105
+ * Base directory for resolving include paths.
106
+ * Typically the directory containing the config file.
107
+ */
108
+ configDir?: string;
109
+ }
110
+ /**
111
+ * Minification options.
112
+ *
113
+ * @remarks
114
+ * Controls esbuild's minification behavior.
115
+ */
116
+ interface MinifyOptions {
117
+ /**
118
+ * Minify identifiers (variable names).
119
+ * @default true
120
+ */
121
+ identifiers?: boolean;
122
+ /**
123
+ * Minify syntax (shorten code).
124
+ * @default true
125
+ */
126
+ syntax?: boolean;
127
+ /**
128
+ * Minify whitespace.
129
+ * @default true
130
+ */
131
+ whitespace?: boolean;
132
+ /**
133
+ * Keep original function/class names.
134
+ * @default false
135
+ */
136
+ keepNames?: boolean;
137
+ /**
138
+ * How to handle legal comments.
139
+ * @default "none"
140
+ */
141
+ legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
142
+ }
143
+
144
+ /**
145
+ * Global CLI Options
146
+ *
147
+ * Options that apply to all commands.
148
+ */
149
+ /**
150
+ * Global options available across all CLI commands
151
+ */
152
+ interface GlobalOptions {
153
+ /**
154
+ * Show detailed execution logs
155
+ * @default false
156
+ */
157
+ verbose?: boolean;
158
+ /**
159
+ * Suppress all output except errors
160
+ * @default false
161
+ */
162
+ silent?: boolean;
163
+ /**
164
+ * Preview command without executing
165
+ * @default false
166
+ */
167
+ dryRun?: boolean;
168
+ }
169
+
170
+ interface BundleStats {
171
+ totalSize: number;
172
+ packages: {
173
+ name: string;
174
+ size: number;
175
+ }[];
176
+ buildTime: number;
177
+ treeshakingEffective: boolean;
178
+ }
179
+
180
+ interface BundleCommandOptions {
181
+ config: string;
182
+ flow?: string;
183
+ all?: boolean;
184
+ stats?: boolean;
185
+ json?: boolean;
186
+ cache?: boolean;
187
+ verbose?: boolean;
188
+ dryRun?: boolean;
189
+ silent?: boolean;
190
+ }
191
+ declare function bundleCommand(options: BundleCommandOptions): Promise<void>;
192
+ /**
193
+ * High-level bundle function for programmatic usage.
194
+ *
195
+ * Handles configuration loading, parsing, and logger creation internally.
196
+ *
197
+ * @param configOrPath - Bundle configuration (Flow.Setup) or path to config file
198
+ * @param options - Bundle options
199
+ * @param options.silent - Suppress all output (default: false)
200
+ * @param options.verbose - Enable verbose logging (default: false)
201
+ * @param options.stats - Collect and return bundle statistics (default: false)
202
+ * @param options.cache - Enable package caching (default: true)
203
+ * @param options.flowName - Flow to use (required for multi-flow configs)
204
+ * @returns Bundle statistics if stats option is true, otherwise void
205
+ *
206
+ * @example
207
+ * ```typescript
208
+ * // With Flow.Setup config object
209
+ * await bundle({
210
+ * version: 1,
211
+ * flows: {
212
+ * default: {
213
+ * web: {},
214
+ * packages: { '@walkeros/collector': { imports: ['startFlow'] } },
215
+ * destinations: { api: { code: 'destinationApi' } },
216
+ * }
217
+ * }
218
+ * });
219
+ *
220
+ * // With config file
221
+ * await bundle('./walker.config.json', { stats: true });
222
+ * ```
223
+ */
224
+ declare function bundle(configOrPath: unknown, options?: {
225
+ silent?: boolean;
226
+ verbose?: boolean;
227
+ stats?: boolean;
228
+ cache?: boolean;
229
+ flowName?: string;
230
+ buildOverrides?: Partial<BuildOptions>;
231
+ }): Promise<BundleStats | void>;
232
+
233
+ /**
234
+ * Call Tracker for Simulation
235
+ *
236
+ * Wraps mock environment functions to track API calls.
237
+ * Used with destination-provided examples/env.ts mocks.
238
+ */
239
+ interface ApiCall {
240
+ type: 'call';
241
+ path: string;
242
+ args: unknown[];
243
+ timestamp: number;
244
+ }
245
+
246
+ interface SimulateCommandOptions {
247
+ config: string;
248
+ event?: string;
249
+ json?: boolean;
250
+ verbose?: boolean;
251
+ dryRun?: boolean;
252
+ silent?: boolean;
253
+ }
254
+ interface SimulationResult {
255
+ success: boolean;
256
+ error?: string;
257
+ collector?: unknown;
258
+ elbResult?: Elb.PushResult;
259
+ logs?: unknown[];
260
+ usage?: Record<string, ApiCall[]>;
261
+ duration?: number;
262
+ }
263
+
264
+ /**
265
+ * CLI command handler for simulate command
266
+ */
267
+ declare function simulateCommand(options: SimulateCommandOptions): Promise<void>;
268
+ /**
269
+ * High-level simulate function for programmatic usage.
270
+ *
271
+ * Handles configuration loading internally and returns structured results.
272
+ *
273
+ * @param configOrPath - Bundle configuration object or path to config file
274
+ * @param event - Event object to simulate
275
+ * @param options - Simulation options
276
+ * @param options.silent - Suppress all output (default: false)
277
+ * @param options.verbose - Enable verbose logging (default: false)
278
+ * @param options.json - Format output as JSON (default: false)
279
+ * @returns Simulation result with success status, elb result, and usage data
280
+ *
281
+ * @example
282
+ * ```typescript
283
+ * // With config file
284
+ * const result = await simulate('./walker.config.json', {
285
+ * name: 'page view',
286
+ * data: { title: 'Home Page', path: '/', url: 'https://example.com' }
287
+ * });
288
+ *
289
+ * // With config object
290
+ * const result = await simulate(
291
+ * {
292
+ * platform: 'web',
293
+ * packages: { '@walkeros/collector': { imports: ['startFlow'] } },
294
+ * code: '...',
295
+ * output: './bundle.js'
296
+ * },
297
+ * { name: 'page view' },
298
+ * { silent: true }
299
+ * );
300
+ * ```
301
+ */
302
+ declare function simulate(configOrPath: string | unknown, event: unknown, options?: {
303
+ silent?: boolean;
304
+ verbose?: boolean;
305
+ json?: boolean;
306
+ }): Promise<SimulationResult>;
307
+
308
+ /**
309
+ * Push command options
310
+ */
311
+ interface PushCommandOptions {
312
+ config: string;
313
+ event: string;
314
+ flow?: string;
315
+ json?: boolean;
316
+ verbose?: boolean;
317
+ silent?: boolean;
318
+ }
319
+
320
+ /**
321
+ * CLI command handler for push command
322
+ */
323
+ declare function pushCommand(options: PushCommandOptions): Promise<void>;
324
+
325
+ /**
326
+ * Run Command Types
327
+ *
328
+ * Types for running walkerOS flows via CLI using local runtime
329
+ */
330
+ /**
331
+ * Run mode - determines which execution mode to use
332
+ */
333
+ type RunMode = 'collect' | 'serve';
334
+ /**
335
+ * CLI command options for `walkeros run`
336
+ */
337
+ interface RunCommandOptions {
338
+ /** Flow configuration file path (.json or pre-built .mjs) */
339
+ config: string;
340
+ /** Server port (overrides flow config) */
341
+ port?: number;
342
+ /** Server host (default: 0.0.0.0) */
343
+ host?: string;
344
+ /** Serve path (URL directory path, e.g., 'libs/v1') */
345
+ servePath?: string;
346
+ /** Serve name (filename in URL, default: walker.js) */
347
+ serveName?: string;
348
+ /** Enable JSON output */
349
+ json?: boolean;
350
+ /** Verbose logging */
351
+ verbose?: boolean;
352
+ /** Dry-run mode */
353
+ dryRun?: boolean;
354
+ /** Suppress output */
355
+ silent?: boolean;
356
+ }
357
+ /**
358
+ * Programmatic run options (subset of CLI options)
359
+ */
360
+ interface RunOptions {
361
+ /** Flow configuration file path (.json or pre-built .mjs) */
362
+ config: string | unknown;
363
+ /** Server port */
364
+ port?: number;
365
+ /** Server host */
366
+ host?: string;
367
+ /** Serve path (URL directory path, e.g., 'libs/v1') */
368
+ servePath?: string;
369
+ /** Serve name (filename in URL, default: walker.js) */
370
+ serveName?: string;
371
+ /** Suppress output */
372
+ silent?: boolean;
373
+ /** Verbose logging */
374
+ verbose?: boolean;
375
+ }
376
+ /**
377
+ * Result from running a flow
378
+ */
379
+ interface RunResult {
380
+ /** Whether the flow ran successfully */
381
+ success: boolean;
382
+ /** Exit code */
383
+ exitCode: number;
384
+ /** Error message if failed */
385
+ error?: string;
386
+ /** Execution duration in milliseconds */
387
+ duration: number;
388
+ }
389
+
390
+ /**
391
+ * Run Command
392
+ *
393
+ * Runs walkerOS flows using local runtime
394
+ */
395
+
396
+ /**
397
+ * CLI command function for `walkeros run`
398
+ *
399
+ * @param mode - Run mode (collect | serve)
400
+ * @param options - Command options
401
+ */
402
+ declare function runCommand(mode: string, options: RunCommandOptions): Promise<void>;
403
+ /**
404
+ * Programmatic run function
405
+ *
406
+ * @param mode - Run mode (collect | serve)
407
+ * @param options - Run options
408
+ * @returns Run result
409
+ *
410
+ * @example
411
+ * ```typescript
412
+ * // Run with JSON config (bundles automatically)
413
+ * await run('collect', {
414
+ * config: './flow.json',
415
+ * port: 8080
416
+ * });
417
+ *
418
+ * // Run with pre-built bundle
419
+ * await run('collect', {
420
+ * config: './flow.mjs',
421
+ * port: 8080
422
+ * });
423
+ * ```
424
+ */
425
+ declare function run(mode: RunMode, options: RunOptions): Promise<RunResult>;
426
+
427
+ export { type BuildOptions, type BundleStats, type CLIBuildOptions, type GlobalOptions, type MinifyOptions, type RunCommandOptions, type RunMode, type RunOptions, type RunResult, type SimulationResult, bundle, bundleCommand, pushCommand, run, runCommand, simulate, simulateCommand };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAQrD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;AAInE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAK9C,YAAY,EACV,IAAI,EACJ,eAAe,EACf,YAAY,EACZ,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EACV,OAAO,EACP,iBAAiB,EACjB,UAAU,EACV,SAAS,GACV,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}