@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.
- package/CHANGELOG.md +175 -0
- package/README.md +531 -0
- package/dist/__tests__/bundle/bundler-helpers.test.d.ts +2 -0
- package/dist/__tests__/bundle/bundler-helpers.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/bundler-helpers.test.js +151 -0
- package/dist/__tests__/bundle/bundler-helpers.test.js.map +1 -0
- package/dist/__tests__/bundle/bundler.test.d.ts +2 -0
- package/dist/__tests__/bundle/bundler.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/bundler.test.js +352 -0
- package/dist/__tests__/bundle/bundler.test.js.map +1 -0
- package/dist/__tests__/bundle/programmatic.test.d.ts +2 -0
- package/dist/__tests__/bundle/programmatic.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/programmatic.test.js +148 -0
- package/dist/__tests__/bundle/programmatic.test.js.map +1 -0
- package/dist/__tests__/cli-e2e.test.d.ts +8 -0
- package/dist/__tests__/cli-e2e.test.d.ts.map +1 -0
- package/dist/__tests__/cli-e2e.test.js +145 -0
- package/dist/__tests__/cli-e2e.test.js.map +1 -0
- package/dist/__tests__/cli.test.d.ts +2 -0
- package/dist/__tests__/cli.test.d.ts.map +1 -0
- package/dist/__tests__/cli.test.js +179 -0
- package/dist/__tests__/cli.test.js.map +1 -0
- package/dist/__tests__/config-loader.test.d.ts +7 -0
- package/dist/__tests__/config-loader.test.d.ts.map +1 -0
- package/dist/__tests__/config-loader.test.js +414 -0
- package/dist/__tests__/config-loader.test.js.map +1 -0
- package/dist/__tests__/core/asset-resolver.test.d.ts +2 -0
- package/dist/__tests__/core/asset-resolver.test.d.ts.map +1 -0
- package/dist/__tests__/core/asset-resolver.test.js +14 -0
- package/dist/__tests__/core/asset-resolver.test.js.map +1 -0
- package/dist/__tests__/core/build-cache.test.d.ts +2 -0
- package/dist/__tests__/core/build-cache.test.d.ts.map +1 -0
- package/dist/__tests__/core/build-cache.test.js +55 -0
- package/dist/__tests__/core/build-cache.test.js.map +1 -0
- package/dist/__tests__/core/cache-utils.test.d.ts +2 -0
- package/dist/__tests__/core/cache-utils.test.d.ts.map +1 -0
- package/dist/__tests__/core/cache-utils.test.js +70 -0
- package/dist/__tests__/core/cache-utils.test.js.map +1 -0
- package/dist/__tests__/core/config.test.d.ts +2 -0
- package/dist/__tests__/core/config.test.d.ts.map +1 -0
- package/dist/__tests__/core/config.test.js +79 -0
- package/dist/__tests__/core/config.test.js.map +1 -0
- package/dist/__tests__/core/logger.test.d.ts +2 -0
- package/dist/__tests__/core/logger.test.d.ts.map +1 -0
- package/dist/__tests__/core/logger.test.js +53 -0
- package/dist/__tests__/core/logger.test.js.map +1 -0
- package/dist/__tests__/integration/bundle-run.integration.test.d.ts +8 -0
- package/dist/__tests__/integration/bundle-run.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/bundle-run.integration.test.js +54 -0
- package/dist/__tests__/integration/bundle-run.integration.test.js.map +1 -0
- package/dist/__tests__/push/push.test.d.ts +7 -0
- package/dist/__tests__/push/push.test.d.ts.map +1 -0
- package/dist/__tests__/push/push.test.js +197 -0
- package/dist/__tests__/push/push.test.js.map +1 -0
- package/dist/__tests__/simulate/env-loader.test.d.ts +2 -0
- package/dist/__tests__/simulate/env-loader.test.d.ts.map +1 -0
- package/dist/__tests__/simulate/env-loader.test.js +47 -0
- package/dist/__tests__/simulate/env-loader.test.js.map +1 -0
- package/dist/__tests__/simulate/node-executor.test.d.ts +5 -0
- package/dist/__tests__/simulate/node-executor.test.d.ts.map +1 -0
- package/dist/__tests__/simulate/node-executor.test.js +25 -0
- package/dist/__tests__/simulate/node-executor.test.js.map +1 -0
- package/dist/__tests__/simulate/server-simulate.integration.test.d.ts +5 -0
- package/dist/__tests__/simulate/server-simulate.integration.test.d.ts.map +1 -0
- package/dist/__tests__/simulate/server-simulate.integration.test.js +58 -0
- package/dist/__tests__/simulate/server-simulate.integration.test.js.map +1 -0
- package/dist/__tests__/smoke/production.smoke.test.d.ts +8 -0
- package/dist/__tests__/smoke/production.smoke.test.d.ts.map +1 -0
- package/dist/__tests__/smoke/production.smoke.test.js +65 -0
- package/dist/__tests__/smoke/production.smoke.test.js.map +1 -0
- package/dist/commands/bundle/bundler.d.ts +32 -0
- package/dist/commands/bundle/bundler.d.ts.map +1 -0
- package/dist/commands/bundle/bundler.js +564 -0
- package/dist/commands/bundle/bundler.js.map +1 -0
- package/dist/commands/bundle/index.d.ts +59 -0
- package/dist/commands/bundle/index.d.ts.map +1 -0
- package/dist/commands/bundle/index.js +192 -0
- package/dist/commands/bundle/index.js.map +1 -0
- package/dist/commands/bundle/package-manager.d.ts +8 -0
- package/dist/commands/bundle/package-manager.d.ts.map +1 -0
- package/dist/commands/bundle/package-manager.js +208 -0
- package/dist/commands/bundle/package-manager.js.map +1 -0
- package/dist/commands/bundle/stats.d.ts +23 -0
- package/dist/commands/bundle/stats.d.ts.map +1 -0
- package/dist/commands/bundle/stats.js +52 -0
- package/dist/commands/bundle/stats.js.map +1 -0
- package/dist/commands/cache.d.ts +7 -0
- package/dist/commands/cache.d.ts.map +1 -0
- package/dist/commands/cache.js +61 -0
- package/dist/commands/cache.js.map +1 -0
- package/dist/commands/push/index.d.ts +7 -0
- package/dist/commands/push/index.d.ts.map +1 -0
- package/dist/commands/push/index.js +250 -0
- package/dist/commands/push/index.js.map +1 -0
- package/dist/commands/push/types.d.ts +22 -0
- package/dist/commands/push/types.d.ts.map +1 -0
- package/dist/commands/push/types.js +2 -0
- package/dist/commands/push/types.js.map +1 -0
- package/dist/commands/run/__tests__/run.integration.test.d.ts +7 -0
- package/dist/commands/run/__tests__/run.integration.test.d.ts.map +1 -0
- package/dist/commands/run/__tests__/run.integration.test.js +51 -0
- package/dist/commands/run/__tests__/run.integration.test.js.map +1 -0
- package/dist/commands/run/__tests__/validators.test.d.ts +2 -0
- package/dist/commands/run/__tests__/validators.test.d.ts.map +1 -0
- package/dist/commands/run/__tests__/validators.test.js +80 -0
- package/dist/commands/run/__tests__/validators.test.js.map +1 -0
- package/dist/commands/run/execution.d.ts +14 -0
- package/dist/commands/run/execution.d.ts.map +1 -0
- package/dist/commands/run/execution.js +41 -0
- package/dist/commands/run/execution.js.map +1 -0
- package/dist/commands/run/index.d.ts +38 -0
- package/dist/commands/run/index.d.ts.map +1 -0
- package/dist/commands/run/index.js +165 -0
- package/dist/commands/run/index.js.map +1 -0
- package/dist/commands/run/types.d.ts +65 -0
- package/dist/commands/run/types.d.ts.map +1 -0
- package/dist/commands/run/types.js +7 -0
- package/dist/commands/run/types.js.map +1 -0
- package/dist/commands/run/utils.d.ts +29 -0
- package/dist/commands/run/utils.d.ts.map +1 -0
- package/dist/commands/run/utils.js +52 -0
- package/dist/commands/run/utils.js.map +1 -0
- package/dist/commands/run/validators.d.ts +33 -0
- package/dist/commands/run/validators.d.ts.map +1 -0
- package/dist/commands/run/validators.js +58 -0
- package/dist/commands/run/validators.js.map +1 -0
- package/dist/commands/simulate/env-loader.d.ts +19 -0
- package/dist/commands/simulate/env-loader.d.ts.map +1 -0
- package/dist/commands/simulate/env-loader.js +46 -0
- package/dist/commands/simulate/env-loader.js.map +1 -0
- package/dist/commands/simulate/index.d.ts +48 -0
- package/dist/commands/simulate/index.d.ts.map +1 -0
- package/dist/commands/simulate/index.js +114 -0
- package/dist/commands/simulate/index.js.map +1 -0
- package/dist/commands/simulate/jsdom-executor.d.ts +37 -0
- package/dist/commands/simulate/jsdom-executor.d.ts.map +1 -0
- package/dist/commands/simulate/jsdom-executor.js +137 -0
- package/dist/commands/simulate/jsdom-executor.js.map +1 -0
- package/dist/commands/simulate/node-executor.d.ts +28 -0
- package/dist/commands/simulate/node-executor.d.ts.map +1 -0
- package/dist/commands/simulate/node-executor.js +94 -0
- package/dist/commands/simulate/node-executor.js.map +1 -0
- package/dist/commands/simulate/simulator.d.ts +14 -0
- package/dist/commands/simulate/simulator.d.ts.map +1 -0
- package/dist/commands/simulate/simulator.js +163 -0
- package/dist/commands/simulate/simulator.js.map +1 -0
- package/dist/commands/simulate/tracker.d.ts +30 -0
- package/dist/commands/simulate/tracker.d.ts.map +1 -0
- package/dist/commands/simulate/tracker.js +96 -0
- package/dist/commands/simulate/tracker.js.map +1 -0
- package/dist/commands/simulate/types.d.ts +20 -0
- package/dist/commands/simulate/types.d.ts.map +1 -0
- package/dist/commands/simulate/types.js +2 -0
- package/dist/commands/simulate/types.js.map +1 -0
- package/dist/config/build-defaults.d.ts +49 -0
- package/dist/config/build-defaults.d.ts.map +1 -0
- package/dist/config/build-defaults.js +68 -0
- package/dist/config/build-defaults.js.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +15 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +81 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +153 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/utils.d.ts +101 -0
- package/dist/config/utils.d.ts.map +1 -0
- package/dist/config/utils.js +235 -0
- package/dist/config/utils.js.map +1 -0
- package/dist/config/validators.d.ts +52 -0
- package/dist/config/validators.d.ts.map +1 -0
- package/dist/config/validators.js +85 -0
- package/dist/config/validators.js.map +1 -0
- package/dist/core/asset-resolver.d.ts +34 -0
- package/dist/core/asset-resolver.d.ts.map +1 -0
- package/dist/core/asset-resolver.js +70 -0
- package/dist/core/asset-resolver.js.map +1 -0
- package/dist/core/build-cache.d.ts +23 -0
- package/dist/core/build-cache.d.ts.map +1 -0
- package/dist/core/build-cache.js +44 -0
- package/dist/core/build-cache.js.map +1 -0
- package/dist/core/cache-utils.d.ts +27 -0
- package/dist/core/cache-utils.d.ts.map +1 -0
- package/dist/core/cache-utils.js +60 -0
- package/dist/core/cache-utils.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +8 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/local-packages.d.ts +19 -0
- package/dist/core/local-packages.d.ts.map +1 -0
- package/dist/core/local-packages.js +60 -0
- package/dist/core/local-packages.js.map +1 -0
- package/dist/core/logger.d.ts +28 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +88 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/output.d.ts +30 -0
- package/dist/core/output.d.ts.map +1 -0
- package/dist/core/output.js +46 -0
- package/dist/core/output.js.map +1 -0
- package/dist/core/timer.d.ts +14 -0
- package/dist/core/timer.d.ts.map +1 -0
- package/dist/core/timer.js +29 -0
- package/dist/core/timer.js.map +1 -0
- package/dist/core/tmp.d.ts +27 -0
- package/dist/core/tmp.d.ts.map +1 -0
- package/dist/core/tmp.js +36 -0
- package/dist/core/tmp.js.map +1 -0
- package/dist/core/utils.d.ts +10 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +12 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/examples/README.md +355 -0
- package/dist/examples/event.json +53 -0
- package/dist/examples/flow-order-complete.json +67 -0
- package/dist/examples/flow-simple.json +31 -0
- package/dist/examples/flow.json +82 -0
- package/dist/examples/server-collect.json +60 -0
- package/dist/examples/server-collect.mjs +13540 -0
- package/dist/examples/test.html +43 -0
- package/dist/examples/web-serve.js +25503 -0
- package/dist/examples/web-serve.json +74 -0
- package/dist/index.d.ts +427 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2629 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +10 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/main.d.ts +2 -0
- package/dist/runtime/main.d.ts.map +1 -0
- package/dist/runtime/main.js +269 -0
- package/dist/runtime/main.js.map +1 -0
- package/dist/runtime/runner.d.ts +20 -0
- package/dist/runtime/runner.d.ts.map +1 -0
- package/dist/runtime/runner.js +72 -0
- package/dist/runtime/runner.js.map +1 -0
- package/dist/runtime/serve.d.ts +19 -0
- package/dist/runtime/serve.d.ts.map +1 -0
- package/dist/runtime/serve.js +97 -0
- package/dist/runtime/serve.js.map +1 -0
- package/dist/schemas/index.d.ts +9 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +9 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/primitives.d.ts +37 -0
- package/dist/schemas/primitives.d.ts.map +1 -0
- package/dist/schemas/primitives.js +43 -0
- package/dist/schemas/primitives.js.map +1 -0
- package/dist/schemas/run.d.ts +23 -0
- package/dist/schemas/run.d.ts.map +1 -0
- package/dist/schemas/run.js +20 -0
- package/dist/schemas/run.js.map +1 -0
- package/dist/types/bundle.d.ts +141 -0
- package/dist/types/bundle.d.ts.map +1 -0
- package/dist/types/bundle.js +10 -0
- package/dist/types/bundle.js.map +1 -0
- package/dist/types/global.d.ts +38 -0
- package/dist/types/global.d.ts.map +1 -0
- package/dist/types/global.js +24 -0
- package/dist/types/global.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +27 -0
- package/dist/version.js.map +1 -0
- package/dist/walker.js +1 -0
- package/examples/README.md +355 -0
- package/examples/event.json +53 -0
- package/examples/flow-order-complete.json +67 -0
- package/examples/flow-simple.json +31 -0
- package/examples/flow.json +82 -0
- package/examples/server-collect.json +60 -0
- package/examples/server-collect.mjs +13540 -0
- package/examples/test.html +43 -0
- package/examples/web-serve.js +25503 -0
- package/examples/web-serve.json +74 -0
- package/package.json +62 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
# walkerOS Flow Examples
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
These are example configurations - see the main [CLI README](../README.md) for
|
|
6
|
+
installation.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
Use `walkeros bundle <example>.json` to build any example, then `walkeros run`
|
|
11
|
+
to execute.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
This directory contains example flow configurations demonstrating various
|
|
16
|
+
walkerOS use cases.
|
|
17
|
+
|
|
18
|
+
## Rebuilding Example Bundles
|
|
19
|
+
|
|
20
|
+
The `.mjs` bundle files in this directory are pre-built from their corresponding
|
|
21
|
+
`.json` config files. If you update the configs or core packages, rebuild them:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cd /workspaces/walkerOS/packages/cli
|
|
25
|
+
|
|
26
|
+
# Rebuild server-collect
|
|
27
|
+
walkeros bundle examples/server-collect.json --local
|
|
28
|
+
mv server-collect.mjs examples/
|
|
29
|
+
|
|
30
|
+
# Rebuild web-serve
|
|
31
|
+
walkeros bundle examples/web-serve.json --local
|
|
32
|
+
mv web-serve.js examples/
|
|
33
|
+
|
|
34
|
+
# Update Docker demos
|
|
35
|
+
cp examples/server-collect.mjs ../docker/demos/demo-collect.mjs
|
|
36
|
+
cp examples/web-serve.js ../docker/demos/demo-serve.mjs
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Important**: Always use `--local` flag when rebuilding examples in the
|
|
40
|
+
devcontainer.
|
|
41
|
+
|
|
42
|
+
## Web Examples
|
|
43
|
+
|
|
44
|
+
### web-serve.json
|
|
45
|
+
|
|
46
|
+
**Purpose**: Browser bundle that sends events to collector
|
|
47
|
+
|
|
48
|
+
**Features**:
|
|
49
|
+
|
|
50
|
+
- sourceDemo (generates test events automatically)
|
|
51
|
+
- destinationDemo (console output for debugging)
|
|
52
|
+
- destinationAPI (sends events to http://localhost:8080/collect)
|
|
53
|
+
- Simulates page views and product views
|
|
54
|
+
|
|
55
|
+
**Use case**: Demo web tracking that connects to server-collect.json for full
|
|
56
|
+
event flow testing
|
|
57
|
+
|
|
58
|
+
**Try it**:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
walkeros bundle examples/web-serve.json
|
|
62
|
+
walkeros run serve examples/web-serve.js -p 3000
|
|
63
|
+
# Open http://localhost:3000 in browser
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### web-tracking.json
|
|
67
|
+
|
|
68
|
+
**Purpose**: Comprehensive browser tracking with multiple analytics platforms
|
|
69
|
+
|
|
70
|
+
**Features**:
|
|
71
|
+
|
|
72
|
+
- sourceBrowser (DOM event tracking)
|
|
73
|
+
- destinationAPI → localhost:8080/collect (send to collection server)
|
|
74
|
+
- destinationGtag → Google Analytics 4
|
|
75
|
+
- destinationMeta → Meta Pixel (Facebook)
|
|
76
|
+
- destinationDemo → Console logging
|
|
77
|
+
|
|
78
|
+
**Event mappings**:
|
|
79
|
+
|
|
80
|
+
- Page views → GA4 `page_view`, Meta `PageView`
|
|
81
|
+
- Product views → GA4 `view_item`, Meta `ViewContent`
|
|
82
|
+
- Add to cart → GA4 `add_to_cart`, Meta `AddToCart`
|
|
83
|
+
- Purchases → GA4 `purchase`, Meta `Purchase`
|
|
84
|
+
|
|
85
|
+
**Use case**: Production web tracking with multiple destinations
|
|
86
|
+
|
|
87
|
+
**Environment variables**:
|
|
88
|
+
|
|
89
|
+
- `GA4_MEASUREMENT_ID` - Google Analytics 4 measurement ID (default:
|
|
90
|
+
G-XXXXXXXXXX)
|
|
91
|
+
- `META_PIXEL_ID` - Meta Pixel ID (default: 123456789)
|
|
92
|
+
- `META_TEST_CODE` - Meta test event code (optional)
|
|
93
|
+
|
|
94
|
+
**Try it**:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Set environment variables
|
|
98
|
+
export GA4_MEASUREMENT_ID="G-YOUR-ID"
|
|
99
|
+
export META_PIXEL_ID="123456789"
|
|
100
|
+
|
|
101
|
+
# Bundle for browser
|
|
102
|
+
walkeros bundle examples/web-tracking.json --stats
|
|
103
|
+
|
|
104
|
+
# Simulate events
|
|
105
|
+
walkeros simulate examples/web-tracking.json \
|
|
106
|
+
--event '{"name":"product view","data":{"id":"P123","name":"Laptop","price":999}}'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Server Examples
|
|
110
|
+
|
|
111
|
+
### server-collect.json
|
|
112
|
+
|
|
113
|
+
**Purpose**: Minimal server-side event collection endpoint
|
|
114
|
+
|
|
115
|
+
**Features**:
|
|
116
|
+
|
|
117
|
+
- sourceExpress (HTTP endpoint at /collect)
|
|
118
|
+
- destinationDemo (console logging)
|
|
119
|
+
- CORS enabled for browser requests
|
|
120
|
+
- Health check endpoint
|
|
121
|
+
|
|
122
|
+
**Use case**: Simple event collector for demo and testing, receives events from
|
|
123
|
+
web-serve.json
|
|
124
|
+
|
|
125
|
+
**Try it**:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
walkeros bundle examples/server-collect.json
|
|
129
|
+
walkeros run collect examples/server-collect.mjs -p 8080
|
|
130
|
+
|
|
131
|
+
# In another terminal, send test event:
|
|
132
|
+
curl -X POST http://localhost:8080/collect \
|
|
133
|
+
-H "Content-Type: application/json" \
|
|
134
|
+
-d '{"name":"page view","data":{"title":"Test"}}'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### server-collection.json
|
|
138
|
+
|
|
139
|
+
**Purpose**: Server-side event collection and forwarding to data platforms
|
|
140
|
+
|
|
141
|
+
**Features**:
|
|
142
|
+
|
|
143
|
+
- sourceExpress (HTTP endpoint at /collect)
|
|
144
|
+
- destinationDataManager → Google Tag Manager Server-Side
|
|
145
|
+
- destinationDemo → Console logging
|
|
146
|
+
|
|
147
|
+
**Event mappings**:
|
|
148
|
+
|
|
149
|
+
- Page views → GTM `page_view`
|
|
150
|
+
- Product views → GTM `view_item`
|
|
151
|
+
- Add to cart → GTM `add_to_cart`
|
|
152
|
+
- Purchases → GTM `purchase`
|
|
153
|
+
|
|
154
|
+
**Use case**: Server-side tracking for privacy-compliant data collection
|
|
155
|
+
|
|
156
|
+
**Environment variables**:
|
|
157
|
+
|
|
158
|
+
- `GTM_CONTAINER_ID` - GTM Server Container ID (default: GTM-XXXXXXX)
|
|
159
|
+
- `GTM_SERVER_URL` - GTM Server URL (default: https://gtm.example.com)
|
|
160
|
+
|
|
161
|
+
**Try it**:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Set environment variables
|
|
165
|
+
export GTM_CONTAINER_ID="GTM-XXXXX"
|
|
166
|
+
export GTM_SERVER_URL="https://your-gtm-server.com"
|
|
167
|
+
|
|
168
|
+
# Run in Docker
|
|
169
|
+
walkeros run collect examples/server-collection.json -p 8080
|
|
170
|
+
|
|
171
|
+
# Send test event (in another terminal)
|
|
172
|
+
curl -X POST http://localhost:8080/collect \
|
|
173
|
+
-H "Content-Type: application/json" \
|
|
174
|
+
-d '{
|
|
175
|
+
"name": "product view",
|
|
176
|
+
"data": {
|
|
177
|
+
"id": "P123",
|
|
178
|
+
"name": "Laptop",
|
|
179
|
+
"price": 999
|
|
180
|
+
},
|
|
181
|
+
"user": {
|
|
182
|
+
"id": "user_123",
|
|
183
|
+
"session": "session_456"
|
|
184
|
+
}
|
|
185
|
+
}'
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Workflow: Web → Server
|
|
189
|
+
|
|
190
|
+
### Quick Demo Loop (web-serve → server-collect)
|
|
191
|
+
|
|
192
|
+
The simplest way to see the complete event flow:
|
|
193
|
+
|
|
194
|
+
**Terminal 1 - Start collector**:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
walkeros bundle examples/server-collect.json
|
|
198
|
+
walkeros run collect examples/server-collect.mjs -p 8080
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Terminal 2 - Start web server**:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
walkeros bundle examples/web-serve.json
|
|
205
|
+
walkeros run serve examples/web-serve.js -p 3000
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Browser**: Open http://localhost:3000
|
|
209
|
+
|
|
210
|
+
**Events flow**:
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
Browser (demo source) → destinationAPI → POST /collect → sourceExpress → destinationDemo (console)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Production Pattern (web-tracking → server-collection)
|
|
217
|
+
|
|
218
|
+
For production with real analytics platforms:
|
|
219
|
+
|
|
220
|
+
**1. Start collection server**:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
walkeros run collect examples/server-collection.json -p 8080
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**2. Bundle web tracking** (configured to send to localhost:8080):
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
walkeros bundle examples/web-tracking.json
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**3. Deploy** bundle to your website
|
|
233
|
+
|
|
234
|
+
**4. Events flow**:
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
Browser → destinationAPI (POST /collect) → sourceExpress → destinationDataManager → GTM Server
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Creating Custom Examples
|
|
241
|
+
|
|
242
|
+
### Flow Configuration Structure
|
|
243
|
+
|
|
244
|
+
Flow configs use the `Flow.Setup` format:
|
|
245
|
+
|
|
246
|
+
```json
|
|
247
|
+
{
|
|
248
|
+
"version": 1,
|
|
249
|
+
"flows": {
|
|
250
|
+
"default": {
|
|
251
|
+
"web": {},
|
|
252
|
+
"packages": {
|
|
253
|
+
"<package_name>": { "imports": ["<function_name>"] }
|
|
254
|
+
},
|
|
255
|
+
"sources": {
|
|
256
|
+
"<source_name>": {
|
|
257
|
+
"code": "<imported_function_name>",
|
|
258
|
+
"config": {
|
|
259
|
+
"settings": {
|
|
260
|
+
/* source config */
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"destinations": {
|
|
266
|
+
"<destination_name>": {
|
|
267
|
+
"code": "<imported_function_name>",
|
|
268
|
+
"config": {
|
|
269
|
+
"settings": {
|
|
270
|
+
/* destination config */
|
|
271
|
+
},
|
|
272
|
+
"mapping": {
|
|
273
|
+
/* event mappings */
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"collector": {
|
|
279
|
+
"run": true,
|
|
280
|
+
"globals": {
|
|
281
|
+
/* global properties */
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
**Key points:**
|
|
290
|
+
|
|
291
|
+
- Platform via `web: {}` or `server: {}` key (not `platform: "web"`)
|
|
292
|
+
- Output path is convention-based: `./dist/walker.js` (web) or
|
|
293
|
+
`./dist/bundle.mjs` (server)
|
|
294
|
+
|
|
295
|
+
### Available Sources
|
|
296
|
+
|
|
297
|
+
**Web**:
|
|
298
|
+
|
|
299
|
+
- `@walkeros/web-source-browser` → `sourceBrowser` (DOM tracking)
|
|
300
|
+
- `@walkeros/web-source-datalayer` → `sourceDataLayer` (data layer integration)
|
|
301
|
+
- `@walkeros/source-demo` → `sourceDemo` (test events)
|
|
302
|
+
|
|
303
|
+
**Server**:
|
|
304
|
+
|
|
305
|
+
- `@walkeros/server-source-express` → `sourceExpress` (HTTP endpoint)
|
|
306
|
+
- `@walkeros/server-source-gcp` → `sourceGCP` (Google Cloud Functions)
|
|
307
|
+
|
|
308
|
+
### Available Destinations
|
|
309
|
+
|
|
310
|
+
**Web**:
|
|
311
|
+
|
|
312
|
+
- `@walkeros/web-destination-api` → `destinationAPI` (HTTP API)
|
|
313
|
+
- `@walkeros/web-destination-gtag` → `destinationGtag` (GA4, GTM, Ads)
|
|
314
|
+
- `@walkeros/web-destination-meta` → `destinationMeta` (Meta Pixel)
|
|
315
|
+
- `@walkeros/web-destination-piwikpro` → `destinationPiwikPro`
|
|
316
|
+
- `@walkeros/web-destination-plausible` → `destinationPlausible`
|
|
317
|
+
|
|
318
|
+
**Server**:
|
|
319
|
+
|
|
320
|
+
- `@walkeros/server-destination-datamanager` → `destinationDataManager` (GTM
|
|
321
|
+
Server-Side)
|
|
322
|
+
- `@walkeros/server-destination-meta` → `destinationMeta` (Meta CAPI)
|
|
323
|
+
- `@walkeros/server-destination-aws` → `destinationAWS`
|
|
324
|
+
- `@walkeros/server-destination-gcp` → `destinationGCP`
|
|
325
|
+
|
|
326
|
+
**Universal**:
|
|
327
|
+
|
|
328
|
+
- `@walkeros/destination-demo` → `destinationDemo` (console logging)
|
|
329
|
+
|
|
330
|
+
## Event Naming Convention
|
|
331
|
+
|
|
332
|
+
**CRITICAL**: Events must follow the "ENTITY ACTION" format with space
|
|
333
|
+
separation:
|
|
334
|
+
|
|
335
|
+
✅ Correct:
|
|
336
|
+
|
|
337
|
+
- `"page view"`
|
|
338
|
+
- `"product add"`
|
|
339
|
+
- `"order complete"`
|
|
340
|
+
- `"button click"`
|
|
341
|
+
|
|
342
|
+
❌ Wrong:
|
|
343
|
+
|
|
344
|
+
- `"page_view"` (underscore)
|
|
345
|
+
- `"purchase"` (missing entity)
|
|
346
|
+
- `"add_to_cart"` (underscore)
|
|
347
|
+
|
|
348
|
+
The event name is parsed as: `const [entity, action] = event.split(' ')`
|
|
349
|
+
|
|
350
|
+
## Next Steps
|
|
351
|
+
|
|
352
|
+
1. Try each example with `walkeros bundle` and `walkeros simulate`
|
|
353
|
+
2. Modify examples to match your tracking requirements
|
|
354
|
+
3. Create custom flow files for your use case
|
|
355
|
+
4. Deploy to production
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "order complete",
|
|
3
|
+
"data": {
|
|
4
|
+
"id": "ORD-2024-12345",
|
|
5
|
+
"total": 299.99,
|
|
6
|
+
"currency": "USD",
|
|
7
|
+
"tax": 24.99,
|
|
8
|
+
"shipping": 15.0
|
|
9
|
+
},
|
|
10
|
+
"user": {
|
|
11
|
+
"id": "user_abc123",
|
|
12
|
+
"email": "customer@example.com",
|
|
13
|
+
"gclid": "CjwKCAiA_xyz123ABC"
|
|
14
|
+
},
|
|
15
|
+
"source": {
|
|
16
|
+
"id": "https://example.com/thankyou.html?email=customer@example.com&order=ORD-2024-12345&gclid=CjwKCAiA_xyz123ABC",
|
|
17
|
+
"type": "web"
|
|
18
|
+
},
|
|
19
|
+
"nested": [
|
|
20
|
+
{
|
|
21
|
+
"type": "product",
|
|
22
|
+
"data": {
|
|
23
|
+
"id": "PROD-001",
|
|
24
|
+
"name": "Wireless Headphones",
|
|
25
|
+
"price": 149.99,
|
|
26
|
+
"quantity": 1,
|
|
27
|
+
"category": "Electronics"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "product",
|
|
32
|
+
"data": {
|
|
33
|
+
"id": "PROD-002",
|
|
34
|
+
"name": "Phone Case",
|
|
35
|
+
"price": 29.99,
|
|
36
|
+
"quantity": 2,
|
|
37
|
+
"category": "Accessories"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"consent": {
|
|
42
|
+
"functional": true,
|
|
43
|
+
"marketing": true
|
|
44
|
+
},
|
|
45
|
+
"globals": {
|
|
46
|
+
"language": "en",
|
|
47
|
+
"country": "US"
|
|
48
|
+
},
|
|
49
|
+
"context": {
|
|
50
|
+
"session": ["sess_xyz789", 1],
|
|
51
|
+
"page": ["/thankyou", 0]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"flows": {
|
|
4
|
+
"default": {
|
|
5
|
+
"web": {},
|
|
6
|
+
"packages": {
|
|
7
|
+
"@walkeros/collector": {
|
|
8
|
+
"version": "latest",
|
|
9
|
+
"imports": ["startFlow"]
|
|
10
|
+
},
|
|
11
|
+
"@walkeros/destination-demo": {
|
|
12
|
+
"version": "latest"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"destinations": {
|
|
16
|
+
"demo": {
|
|
17
|
+
"code": "destinationDemo",
|
|
18
|
+
"config": {
|
|
19
|
+
"consent": {
|
|
20
|
+
"marketing": true
|
|
21
|
+
},
|
|
22
|
+
"settings": {
|
|
23
|
+
"name": "Order Complete with Consent Demo",
|
|
24
|
+
"values": ["name", "data", "user", "source", "consent"]
|
|
25
|
+
},
|
|
26
|
+
"mapping": {
|
|
27
|
+
"order": {
|
|
28
|
+
"complete": {
|
|
29
|
+
"name": "purchase",
|
|
30
|
+
"data": {
|
|
31
|
+
"map": {
|
|
32
|
+
"transaction_id": "data.id",
|
|
33
|
+
"value": "data.total",
|
|
34
|
+
"currency": "data.currency",
|
|
35
|
+
"tax": "data.tax",
|
|
36
|
+
"shipping": "data.shipping",
|
|
37
|
+
"email": {
|
|
38
|
+
"key": "user.email",
|
|
39
|
+
"consent": {
|
|
40
|
+
"marketing": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"gclid": {
|
|
44
|
+
"key": "user.gclid",
|
|
45
|
+
"consent": {
|
|
46
|
+
"marketing": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"source_url": "source.id"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"collector": {
|
|
59
|
+
"run": true,
|
|
60
|
+
"globals": {
|
|
61
|
+
"environment": "production",
|
|
62
|
+
"version": "1.0.0"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"flows": {
|
|
4
|
+
"default": {
|
|
5
|
+
"web": {},
|
|
6
|
+
"packages": {
|
|
7
|
+
"@walkeros/collector": {
|
|
8
|
+
"version": "latest",
|
|
9
|
+
"imports": ["startFlow"]
|
|
10
|
+
},
|
|
11
|
+
"@walkeros/destination-demo": {
|
|
12
|
+
"version": "latest"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"destinations": {
|
|
16
|
+
"demo": {
|
|
17
|
+
"code": "destinationDemo",
|
|
18
|
+
"config": {
|
|
19
|
+
"settings": {
|
|
20
|
+
"name": "Simple Demo",
|
|
21
|
+
"values": ["name", "data", "user", "consent"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"collector": {
|
|
27
|
+
"run": true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"flows": {
|
|
4
|
+
"default": {
|
|
5
|
+
"web": {},
|
|
6
|
+
"packages": {
|
|
7
|
+
"@walkeros/collector": {
|
|
8
|
+
"version": "latest",
|
|
9
|
+
"imports": ["startFlow"]
|
|
10
|
+
},
|
|
11
|
+
"@walkeros/web-destination-gtag": {
|
|
12
|
+
"version": "latest",
|
|
13
|
+
"imports": ["destinationGtag"]
|
|
14
|
+
},
|
|
15
|
+
"@walkeros/destination-demo": {
|
|
16
|
+
"version": "latest",
|
|
17
|
+
"imports": ["destinationDemo"]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"destinations": {
|
|
21
|
+
"ga4": {
|
|
22
|
+
"package": "@walkeros/web-destination-gtag",
|
|
23
|
+
"config": {
|
|
24
|
+
"consent": {
|
|
25
|
+
"marketing": true
|
|
26
|
+
},
|
|
27
|
+
"settings": {
|
|
28
|
+
"ga4": {
|
|
29
|
+
"measurementId": "G-XXXXXXXXXX"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"mapping": {
|
|
33
|
+
"order": {
|
|
34
|
+
"complete": {
|
|
35
|
+
"name": "purchase",
|
|
36
|
+
"data": {
|
|
37
|
+
"map": {
|
|
38
|
+
"transaction_id": "data.id",
|
|
39
|
+
"value": "data.total",
|
|
40
|
+
"currency": "data.currency",
|
|
41
|
+
"tax": "data.tax",
|
|
42
|
+
"shipping": "data.shipping",
|
|
43
|
+
"email": {
|
|
44
|
+
"key": "user.email",
|
|
45
|
+
"consent": {
|
|
46
|
+
"marketing": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"gclid": {
|
|
50
|
+
"key": "user.gclid",
|
|
51
|
+
"consent": {
|
|
52
|
+
"marketing": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"source_url": "source.id"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"demo": {
|
|
64
|
+
"package": "@walkeros/destination-demo",
|
|
65
|
+
"config": {
|
|
66
|
+
"settings": {
|
|
67
|
+
"name": "Order Complete Demo",
|
|
68
|
+
"values": ["name", "data", "user", "source", "consent"]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"collector": {
|
|
74
|
+
"run": true,
|
|
75
|
+
"globals": {
|
|
76
|
+
"environment": "production",
|
|
77
|
+
"version": "1.0.0"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"flows": {
|
|
4
|
+
"default": {
|
|
5
|
+
"server": {},
|
|
6
|
+
"packages": {
|
|
7
|
+
"@walkeros/collector": {
|
|
8
|
+
"version": "latest",
|
|
9
|
+
"imports": ["startFlow"]
|
|
10
|
+
},
|
|
11
|
+
"@walkeros/server-source-express": {
|
|
12
|
+
"version": "latest"
|
|
13
|
+
},
|
|
14
|
+
"@walkeros/destination-demo": {
|
|
15
|
+
"version": "latest"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sources": {
|
|
19
|
+
"http": {
|
|
20
|
+
"package": "@walkeros/server-source-express",
|
|
21
|
+
"code": "sourceExpress",
|
|
22
|
+
"config": {
|
|
23
|
+
"settings": {
|
|
24
|
+
"path": "/collect",
|
|
25
|
+
"port": 8080,
|
|
26
|
+
"cors": true,
|
|
27
|
+
"healthCheck": true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"destinations": {
|
|
33
|
+
"demo": {
|
|
34
|
+
"package": "@walkeros/destination-demo",
|
|
35
|
+
"code": "destinationDemo",
|
|
36
|
+
"config": {
|
|
37
|
+
"settings": {
|
|
38
|
+
"name": "Server Collection Demo",
|
|
39
|
+
"values": [
|
|
40
|
+
"name",
|
|
41
|
+
"data",
|
|
42
|
+
"context",
|
|
43
|
+
"user",
|
|
44
|
+
"nested",
|
|
45
|
+
"timestamp"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"collector": {
|
|
52
|
+
"run": true,
|
|
53
|
+
"globals": {
|
|
54
|
+
"environment": "test",
|
|
55
|
+
"version": "1.0.0"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|