@walkeros/cli 4.7.0-next-1790245733116 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +136 -48
- package/README.md +11 -5
- package/dist/cli.js +9186 -6548
- package/dist/dev.d.ts +7 -0
- package/dist/dev.js +17 -2
- package/dist/dev.js.map +1 -1
- package/dist/examples/README.md +47 -213
- package/dist/examples/customers/README.md +18 -0
- package/dist/examples/customers/cust-1001 +1 -0
- package/dist/examples/customers/cust-42 +1 -0
- package/dist/examples/flow-complete.json +4760 -592
- package/dist/examples/flow-complete.md +884 -225
- package/dist/examples/index.d.ts +2681 -1
- package/dist/examples/index.js +6882 -659
- package/dist/examples/index.js.map +1 -1
- package/dist/examples/shared/README.md +22 -0
- package/dist/index.d.ts +297 -24
- package/dist/index.js +2767 -884
- package/dist/index.js.map +1 -1
- package/examples/README.md +47 -213
- package/examples/customers/README.md +18 -0
- package/examples/customers/cust-1001 +1 -0
- package/examples/customers/cust-42 +1 -0
- package/examples/flow-complete.json +4760 -592
- package/examples/flow-complete.md +884 -225
- package/examples/shared/README.md +22 -0
- package/package.json +31 -8
- package/dist/examples/docker-compose.runner.yml +0 -44
- package/examples/docker-compose.runner.yml +0 -44
package/examples/README.md
CHANGED
|
@@ -7,37 +7,24 @@ installation.
|
|
|
7
7
|
|
|
8
8
|
## Usage
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
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:
|
|
10
|
+
Build any example with `walkeros bundle`, then start a built server flow with
|
|
11
|
+
`runneros` from
|
|
12
|
+
[`@walkeros/runner`](https://www.npmjs.com/package/@walkeros/runner). The CLI
|
|
13
|
+
builds flows; it does not run them.
|
|
22
14
|
|
|
23
15
|
```bash
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
walkeros bundle examples/server-collect.json --local
|
|
28
|
-
mv server-collect.mjs examples/
|
|
16
|
+
walkeros bundle examples/server-collect.json -o dist/
|
|
17
|
+
npx --package=@walkeros/runner runneros start dist/flow.mjs
|
|
18
|
+
```
|
|
29
19
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
A server flow builds to a directory (`flow.mjs`, `package.json` and
|
|
21
|
+
`node_modules/`); a web flow builds to a single `walker.js` for any static host.
|
|
22
|
+
Without `-o`, the bundle is written to stdout.
|
|
33
23
|
|
|
34
|
-
|
|
35
|
-
cp examples/server-collect.mjs ../docker/demos/demo-collect.mjs
|
|
36
|
-
cp examples/web-serve.js ../docker/demos/demo-serve.mjs
|
|
37
|
-
```
|
|
24
|
+
---
|
|
38
25
|
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
This directory contains example flow configurations demonstrating various
|
|
27
|
+
walkerOS use cases.
|
|
41
28
|
|
|
42
29
|
## Comprehensive Example
|
|
43
30
|
|
|
@@ -46,10 +33,6 @@ devcontainer.
|
|
|
46
33
|
**Purpose**: Complete reference demonstrating ALL JSON-compatible walkerOS
|
|
47
34
|
features
|
|
48
35
|
|
|
49
|
-
**Features**: 51 features including variables, mapping (key, map, loop, set),
|
|
50
|
-
transformers (enricher, fingerprint), consent gating, wildcards, ingest
|
|
51
|
-
metadata, and more.
|
|
52
|
-
|
|
53
36
|
**Architecture**: Two named flows (`web` and `server`) showing full event
|
|
54
37
|
pipeline from browser to server-side forwarding.
|
|
55
38
|
|
|
@@ -59,15 +42,17 @@ Feature Inventory and usage examples.
|
|
|
59
42
|
**Try it**:
|
|
60
43
|
|
|
61
44
|
```bash
|
|
62
|
-
# Web flow (opens browser with demo events)
|
|
63
|
-
walkeros run examples/flow-complete.json --flow web
|
|
64
|
-
|
|
65
45
|
# Server flow (HTTP collection endpoint)
|
|
66
|
-
walkeros
|
|
46
|
+
walkeros bundle examples/flow-complete.json --flow server -o dist/server/
|
|
47
|
+
npx --package=@walkeros/runner runneros start dist/server/flow.mjs
|
|
48
|
+
|
|
49
|
+
# Web flow: build walker.js, then serve dist/web/ with any static server
|
|
50
|
+
walkeros bundle examples/flow-complete.json --flow web -o dist/web/
|
|
67
51
|
|
|
68
|
-
#
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
# Test either flow offline, destinations mocked
|
|
53
|
+
walkeros push examples/flow-complete.json --flow server \
|
|
54
|
+
--event '{"name":"page view","data":{"title":"Home"}}' \
|
|
55
|
+
--simulate destination.pubsub
|
|
71
56
|
```
|
|
72
57
|
|
|
73
58
|
---
|
|
@@ -76,14 +61,13 @@ walkeros run examples/flow-complete.json --flow server
|
|
|
76
61
|
|
|
77
62
|
### web-serve.json
|
|
78
63
|
|
|
79
|
-
**Purpose**: Browser bundle that sends events to collector
|
|
64
|
+
**Purpose**: Browser bundle that sends events to a collector
|
|
80
65
|
|
|
81
66
|
**Features**:
|
|
82
67
|
|
|
83
68
|
- sourceDemo (generates test events automatically)
|
|
84
69
|
- destinationDemo (console output for debugging)
|
|
85
70
|
- destinationAPI (sends events to http://localhost:8080/collect)
|
|
86
|
-
- Simulates page views and product views
|
|
87
71
|
|
|
88
72
|
**Use case**: Demo web tracking that connects to server-collect.json for full
|
|
89
73
|
event flow testing
|
|
@@ -91,53 +75,9 @@ event flow testing
|
|
|
91
75
|
**Try it**:
|
|
92
76
|
|
|
93
77
|
```bash
|
|
94
|
-
walkeros bundle examples/web-serve.json
|
|
95
|
-
|
|
96
|
-
#
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### web-tracking.json
|
|
100
|
-
|
|
101
|
-
**Purpose**: Comprehensive browser tracking with multiple analytics platforms
|
|
102
|
-
|
|
103
|
-
**Features**:
|
|
104
|
-
|
|
105
|
-
- sourceBrowser (DOM event tracking)
|
|
106
|
-
- destinationAPI → localhost:8080/collect (send to collection server)
|
|
107
|
-
- destinationGtag → Google Analytics 4
|
|
108
|
-
- destinationMeta → Meta Pixel (Facebook)
|
|
109
|
-
- destinationDemo → Console logging
|
|
110
|
-
|
|
111
|
-
**Event mappings**:
|
|
112
|
-
|
|
113
|
-
- Page views → GA4 `page_view`, Meta `PageView`
|
|
114
|
-
- Product views → GA4 `view_item`, Meta `ViewContent`
|
|
115
|
-
- Add to cart → GA4 `add_to_cart`, Meta `AddToCart`
|
|
116
|
-
- Purchases → GA4 `purchase`, Meta `Purchase`
|
|
117
|
-
|
|
118
|
-
**Use case**: Production web tracking with multiple destinations
|
|
119
|
-
|
|
120
|
-
**Environment variables**:
|
|
121
|
-
|
|
122
|
-
- `GA4_MEASUREMENT_ID` - Google Analytics 4 measurement ID (default:
|
|
123
|
-
G-XXXXXXXXXX)
|
|
124
|
-
- `META_PIXEL_ID` - Meta Pixel ID (default: 123456789)
|
|
125
|
-
- `META_TEST_CODE` - Meta test event code (optional)
|
|
126
|
-
|
|
127
|
-
**Try it**:
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
# Set environment variables
|
|
131
|
-
export GA4_MEASUREMENT_ID="G-YOUR-ID"
|
|
132
|
-
export META_PIXEL_ID="123456789"
|
|
133
|
-
|
|
134
|
-
# Bundle for browser
|
|
135
|
-
walkeros bundle examples/web-tracking.json --stats
|
|
136
|
-
|
|
137
|
-
# Simulate events
|
|
138
|
-
walkeros push examples/web-tracking.json \
|
|
139
|
-
--event '{"name":"product view","data":{"id":"P123","name":"Laptop","price":999}}' \
|
|
140
|
-
--simulate destination.demo
|
|
78
|
+
walkeros bundle examples/web-serve.json -o dist/web/
|
|
79
|
+
npx serve dist/web -l 3000
|
|
80
|
+
# Load http://localhost:3000/walker.js from a page
|
|
141
81
|
```
|
|
142
82
|
|
|
143
83
|
## Server Examples
|
|
@@ -151,7 +91,6 @@ walkeros push examples/web-tracking.json \
|
|
|
151
91
|
- sourceExpress (HTTP endpoint at /collect)
|
|
152
92
|
- destinationDemo (console logging)
|
|
153
93
|
- CORS enabled for browser requests
|
|
154
|
-
- Health check endpoint
|
|
155
94
|
|
|
156
95
|
**Use case**: Simple event collector for demo and testing, receives events from
|
|
157
96
|
web-serve.json
|
|
@@ -159,123 +98,54 @@ web-serve.json
|
|
|
159
98
|
**Try it**:
|
|
160
99
|
|
|
161
100
|
```bash
|
|
162
|
-
walkeros bundle examples/server-collect.json
|
|
163
|
-
walkeros
|
|
101
|
+
walkeros bundle examples/server-collect.json -o dist/server/
|
|
102
|
+
npx --package=@walkeros/runner runneros start dist/server/flow.mjs --port 8080
|
|
164
103
|
|
|
165
|
-
# In another terminal, send test event:
|
|
104
|
+
# In another terminal, send a test event:
|
|
166
105
|
curl -X POST http://localhost:8080/collect \
|
|
167
106
|
-H "Content-Type: application/json" \
|
|
168
107
|
-d '{"name":"page view","data":{"title":"Test"}}'
|
|
169
108
|
```
|
|
170
109
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
**Purpose**: Server-side event collection and forwarding to data platforms
|
|
174
|
-
|
|
175
|
-
**Features**:
|
|
176
|
-
|
|
177
|
-
- sourceExpress (HTTP endpoint at /collect)
|
|
178
|
-
- destinationDataManager → Google Tag Manager Server-Side
|
|
179
|
-
- destinationDemo → Console logging
|
|
180
|
-
|
|
181
|
-
**Event mappings**:
|
|
182
|
-
|
|
183
|
-
- Page views → GTM `page_view`
|
|
184
|
-
- Product views → GTM `view_item`
|
|
185
|
-
- Add to cart → GTM `add_to_cart`
|
|
186
|
-
- Purchases → GTM `purchase`
|
|
187
|
-
|
|
188
|
-
**Use case**: Server-side tracking for privacy-compliant data collection
|
|
189
|
-
|
|
190
|
-
**Environment variables**:
|
|
191
|
-
|
|
192
|
-
- `GTM_CONTAINER_ID` - GTM Server Container ID (default: GTM-XXXXXXX)
|
|
193
|
-
- `GTM_SERVER_URL` - GTM Server URL (default: https://gtm.example.com)
|
|
194
|
-
|
|
195
|
-
**Try it**:
|
|
110
|
+
To run the same artifact in Docker, mount the whole directory where the
|
|
111
|
+
`walkeros/flow` image expects it:
|
|
196
112
|
|
|
197
113
|
```bash
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
# Run in Docker
|
|
203
|
-
walkeros run examples/server-collection.json -p 8080
|
|
204
|
-
|
|
205
|
-
# Send test event (in another terminal)
|
|
206
|
-
curl -X POST http://localhost:8080/collect \
|
|
207
|
-
-H "Content-Type: application/json" \
|
|
208
|
-
-d '{
|
|
209
|
-
"name": "product view",
|
|
210
|
-
"data": {
|
|
211
|
-
"id": "P123",
|
|
212
|
-
"name": "Laptop",
|
|
213
|
-
"price": 999
|
|
214
|
-
},
|
|
215
|
-
"user": {
|
|
216
|
-
"id": "user_123",
|
|
217
|
-
"session": "session_456"
|
|
218
|
-
}
|
|
219
|
-
}'
|
|
114
|
+
docker run --rm -p 8080:8080 \
|
|
115
|
+
-v "$PWD/dist/server:/app/flow:ro" \
|
|
116
|
+
walkeros/flow:<version>
|
|
220
117
|
```
|
|
221
118
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
### Quick Demo Loop (web-serve → server-collect)
|
|
119
|
+
Use a `walkeros/flow` version that ships `runneros`, ideally the same version as
|
|
120
|
+
this CLI. See the [runtime docs](https://www.walkeros.io/docs/apps/runtime).
|
|
225
121
|
|
|
226
|
-
|
|
122
|
+
## Workflow: Web → Server
|
|
227
123
|
|
|
228
124
|
**Terminal 1 - Start collector**:
|
|
229
125
|
|
|
230
126
|
```bash
|
|
231
|
-
walkeros bundle examples/server-collect.json
|
|
232
|
-
walkeros
|
|
127
|
+
walkeros bundle examples/server-collect.json -o dist/server/
|
|
128
|
+
npx --package=@walkeros/runner runneros start dist/server/flow.mjs --port 8080
|
|
233
129
|
```
|
|
234
130
|
|
|
235
|
-
**Terminal 2 -
|
|
131
|
+
**Terminal 2 - Serve the web bundle**:
|
|
236
132
|
|
|
237
133
|
```bash
|
|
238
|
-
walkeros bundle examples/web-serve.json
|
|
239
|
-
|
|
134
|
+
walkeros bundle examples/web-serve.json -o dist/web/
|
|
135
|
+
npx serve dist/web -l 3000
|
|
240
136
|
```
|
|
241
137
|
|
|
242
|
-
**Browser**: Open http://localhost:3000
|
|
243
|
-
|
|
244
138
|
**Events flow**:
|
|
245
139
|
|
|
246
140
|
```
|
|
247
141
|
Browser (demo source) → destinationAPI → POST /collect → sourceExpress → destinationDemo (console)
|
|
248
142
|
```
|
|
249
143
|
|
|
250
|
-
### Production Pattern (web-tracking → server-collection)
|
|
251
|
-
|
|
252
|
-
For production with real analytics platforms:
|
|
253
|
-
|
|
254
|
-
**1. Start collection server**:
|
|
255
|
-
|
|
256
|
-
```bash
|
|
257
|
-
walkeros run examples/server-collection.json -p 8080
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
**2. Bundle web tracking** (configured to send to localhost:8080):
|
|
261
|
-
|
|
262
|
-
```bash
|
|
263
|
-
walkeros bundle examples/web-tracking.json
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
**3. Deploy** bundle to your website
|
|
267
|
-
|
|
268
|
-
**4. Events flow**:
|
|
269
|
-
|
|
270
|
-
```
|
|
271
|
-
Browser → destinationAPI (POST /collect) → sourceExpress → destinationDataManager → GTM Server
|
|
272
|
-
```
|
|
273
|
-
|
|
274
144
|
## Creating Custom Examples
|
|
275
145
|
|
|
276
146
|
### Flow Configuration Structure
|
|
277
147
|
|
|
278
|
-
Flow configs use the `Flow.
|
|
148
|
+
Flow configs use the `Flow.Json` format:
|
|
279
149
|
|
|
280
150
|
```json
|
|
281
151
|
{
|
|
@@ -321,44 +191,8 @@ Flow configs use the `Flow.Config` format:
|
|
|
321
191
|
|
|
322
192
|
- Platform is set via `config: { "platform": "web" }` (or `"server"`)
|
|
323
193
|
- Each step references its npm package directly via `package`
|
|
324
|
-
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
### Available Sources
|
|
328
|
-
|
|
329
|
-
**Web**:
|
|
330
|
-
|
|
331
|
-
- `@walkeros/web-source-browser` → `sourceBrowser` (DOM tracking)
|
|
332
|
-
- `@walkeros/web-source-datalayer` → `sourceDataLayer` (data layer integration)
|
|
333
|
-
- `@walkeros/source-demo` → `sourceDemo` (test events)
|
|
334
|
-
|
|
335
|
-
**Server**:
|
|
336
|
-
|
|
337
|
-
- `@walkeros/server-source-express` → `sourceExpress` (HTTP endpoint)
|
|
338
|
-
- `@walkeros/server-source-gcp` → `sourceGCP` (Google Cloud Functions)
|
|
339
|
-
|
|
340
|
-
### Available Destinations
|
|
341
|
-
|
|
342
|
-
**Web**:
|
|
343
|
-
|
|
344
|
-
- `@walkeros/web-destination-api` → `destinationAPI` (HTTP API)
|
|
345
|
-
- `@walkeros/web-destination-gtag` → `destinationGtag` (GA4, GTM, Ads)
|
|
346
|
-
- `@walkeros/web-destination-meta` → `destinationMeta` (Meta Pixel)
|
|
347
|
-
- `@walkeros/web-destination-piwikpro` → `destinationPiwikPro`
|
|
348
|
-
- `@walkeros/web-destination-plausible` → `destinationPlausible`
|
|
349
|
-
|
|
350
|
-
**Server**:
|
|
351
|
-
|
|
352
|
-
- `@walkeros/server-destination-datamanager` → `destinationDataManager` (GTM
|
|
353
|
-
Server-Side)
|
|
354
|
-
- `@walkeros/server-destination-meta` → `destinationMeta` (Meta CAPI)
|
|
355
|
-
- `@walkeros/server-destination-aws` → `destinationAWS`
|
|
356
|
-
- `@walkeros/server-destination-gcp` → `destinationGCP`
|
|
357
|
-
- `@walkeros/server-destination-piwikpro` → `destinationPiwikPro`
|
|
358
|
-
|
|
359
|
-
**Universal**:
|
|
360
|
-
|
|
361
|
-
- `@walkeros/destination-demo` → `destinationDemo` (console logging)
|
|
194
|
+
- With `-o dist/`, output is `dist/walker.js` (web) or `dist/flow.mjs` plus
|
|
195
|
+
`package.json` and `node_modules/` (server)
|
|
362
196
|
|
|
363
197
|
## Event Naming Convention
|
|
364
198
|
|
|
@@ -382,7 +216,7 @@ The event name is parsed as: `const [entity, action] = event.split(' ')`
|
|
|
382
216
|
|
|
383
217
|
## Next Steps
|
|
384
218
|
|
|
385
|
-
1. Try each example with `walkeros
|
|
219
|
+
1. Try each example with `walkeros push --simulate`, then `walkeros bundle`
|
|
386
220
|
2. Modify examples to match your tracking requirements
|
|
387
221
|
3. Create custom flow files for your use case
|
|
388
|
-
4. Deploy
|
|
222
|
+
4. Deploy: `walkeros bundle`, then `runneros start` or the `walkeros/flow` image
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# customers
|
|
2
|
+
|
|
3
|
+
Fake demo customers for the `customers` store of `flow-complete.json`
|
|
4
|
+
(`@walkeros/server-store-fs`, structured mode). One file per customer id; the
|
|
5
|
+
content is the customer's record as JSON: lifetime value and segment.
|
|
6
|
+
|
|
7
|
+
- `cust-42`: `{"ltv":420,"segment":"loyal"}`
|
|
8
|
+
- `cust-1001`: `{"ltv":75.5,"segment":"new"}`
|
|
9
|
+
|
|
10
|
+
Not covered by root `include`, so no customer data ships in a bundle. `basePath`
|
|
11
|
+
defaults to `./customers`, relative to the working directory: run
|
|
12
|
+
`walkeros push` from `packages/cli/examples`, or set `CUSTOMERS_DIR` to this
|
|
13
|
+
folder's absolute path (always for `runneros start`, which runs inside the
|
|
14
|
+
artifact folder).
|
|
15
|
+
|
|
16
|
+
In production the store is swapped for a real one, e.g.
|
|
17
|
+
`@walkeros/server-store-sheets` or a GCS store; the `loadUser` step does not
|
|
18
|
+
change.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ltv":75.5,"segment":"new"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ltv":420,"segment":"loyal"}
|