@walkeros/cli 4.0.0-next-1777463920154 → 4.0.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 +143 -5
- package/dist/cli.js +502 -368
- package/dist/examples/flow-complete.json +1 -1
- package/dist/examples/index.d.ts +42 -0
- package/dist/examples/index.js +1020 -0
- package/dist/examples/index.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +228 -116
- package/dist/index.js.map +1 -1
- package/examples/flow-complete.json +1 -1
- package/package.json +11 -7
- package/src/telemetry/flow.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @walkeros/cli
|
|
2
2
|
|
|
3
|
-
## 4.0.0
|
|
3
|
+
## 4.0.0
|
|
4
4
|
|
|
5
5
|
### Major Changes
|
|
6
6
|
|
|
@@ -74,6 +74,117 @@
|
|
|
74
74
|
- See `docs/migrating/v3-to-v4.mdx` on the website for the manual migration
|
|
75
75
|
steps. No automated codemod is shipped.
|
|
76
76
|
|
|
77
|
+
- 1ef33d9: **BREAKING:** Unified callback signatures across mapping and on.\*
|
|
78
|
+
subscriptions.
|
|
79
|
+
|
|
80
|
+
Every callback in walkerOS now reads `(data, context) => result`. Sources,
|
|
81
|
+
transformers, destinations, and stores already conformed; mapping and on.\*
|
|
82
|
+
join the family in v4.1.
|
|
83
|
+
|
|
84
|
+
### Mapping callbacks
|
|
85
|
+
|
|
86
|
+
`fn`, `condition`, and `validate` now share a single shape:
|
|
87
|
+
|
|
88
|
+
`(value, context: Mapping.Context) => result`
|
|
89
|
+
|
|
90
|
+
`Mapping.Options` is removed. Replaced by `Mapping.Context`:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
interface Context {
|
|
94
|
+
event: WalkerOS.DeepPartialEvent;
|
|
95
|
+
mapping: Value | Rule;
|
|
96
|
+
collector: Collector.Instance; // required
|
|
97
|
+
logger: Logger.Instance; // required
|
|
98
|
+
consent?: WalkerOS.Consent; // resolved consent
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Rule-level `condition` is now `(event, context) => boolean`.
|
|
103
|
+
`Mapping.Options.props` is removed (no production callers).
|
|
104
|
+
|
|
105
|
+
#### Mapping upgrade
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
// before
|
|
109
|
+
const fn: Mapping.Fn = (value, mapping, options) => /* … */;
|
|
110
|
+
const cond: Mapping.Condition = (value, mapping, collector) => /* … */;
|
|
111
|
+
const val: Mapping.Validate = (value) => /* … */;
|
|
112
|
+
|
|
113
|
+
// after
|
|
114
|
+
const fn: Mapping.Fn = (value, context) => /* … */;
|
|
115
|
+
const cond: Mapping.Condition = (value, context) => /* … */;
|
|
116
|
+
const val: Mapping.Validate = (value, context) => /* … */;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
In `$code:` strings (flow.json):
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
// before
|
|
123
|
+
"fn": "$code:(value, mapping, options) => …"
|
|
124
|
+
"condition": "$code:(value, mapping, collector) => …"
|
|
125
|
+
|
|
126
|
+
// after
|
|
127
|
+
"fn": "$code:(value, context) => …"
|
|
128
|
+
"condition": "$code:(value, context) => …"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
`context.mapping` replaces the second positional arg; `context.collector`,
|
|
132
|
+
`context.logger`, and `context.consent` are all available.
|
|
133
|
+
|
|
134
|
+
One-arg callbacks like `(value) => value.toUpperCase()` continue to work
|
|
135
|
+
unchanged.
|
|
136
|
+
|
|
137
|
+
### On.\* subscription callbacks
|
|
138
|
+
|
|
139
|
+
`walker.on('consent', …)`, `walker.on('ready', …)`, etc. now receive
|
|
140
|
+
`(data, context: On.Context) => void | Promise<void>`. The legacy `Context`
|
|
141
|
+
interface, `*Config` aliases, and `Options` discriminated union are removed.
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
interface Context {
|
|
145
|
+
collector: Collector.Instance; // required
|
|
146
|
+
logger: Logger.Instance; // required
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
type Fn<TData = unknown> = (
|
|
150
|
+
data: TData,
|
|
151
|
+
context: Context,
|
|
152
|
+
) => void | Promise<void>;
|
|
153
|
+
|
|
154
|
+
type ConsentFn = Fn<WalkerOS.Consent>;
|
|
155
|
+
type SessionFn = Fn<Collector.SessionData | undefined>;
|
|
156
|
+
type UserFn = Fn<WalkerOS.User>;
|
|
157
|
+
type ReadyFn = Fn<void>;
|
|
158
|
+
type RunFn = Fn<void>;
|
|
159
|
+
type GenericFn = Fn<unknown>;
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The new `On.Subscription` alias is the registerable union for
|
|
163
|
+
`walker.on(action, X)`.
|
|
164
|
+
|
|
165
|
+
#### On.\* upgrade
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
// before
|
|
169
|
+
walker.on('consent', { marketing: (collector, consent) => /* … */ });
|
|
170
|
+
walker.on('ready', (collector) => /* … */);
|
|
171
|
+
walker.on('session', (collector, session) => /* … */);
|
|
172
|
+
|
|
173
|
+
// after
|
|
174
|
+
walker.on('consent', { marketing: (consent, ctx) => /* … */ });
|
|
175
|
+
walker.on('ready', (_, ctx) => /* … */);
|
|
176
|
+
walker.on('session', (session, ctx) => /* … */);
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`ctx.collector` replaces the positional first arg; `ctx.logger` is also
|
|
180
|
+
available.
|
|
181
|
+
|
|
182
|
+
### Why both at once
|
|
183
|
+
|
|
184
|
+
Both refactors follow the same `(data, context)` pattern. Shipping them in one
|
|
185
|
+
release means consumers do one search-and-replace pass instead of two, and the
|
|
186
|
+
codebase reaches full callback-signature consistency in v4.1.
|
|
187
|
+
|
|
77
188
|
### Minor Changes
|
|
78
189
|
|
|
79
190
|
- cfc7469: **Breaking — `@walkeros/core`:** `fetchPackage(name, { baseUrl })`
|
|
@@ -121,6 +232,31 @@
|
|
|
121
232
|
|
|
122
233
|
### Patch Changes
|
|
123
234
|
|
|
235
|
+
- ca237ef: Fix `walkeros push` deadlock for web flows whose destinations await
|
|
236
|
+
real timers during init.
|
|
237
|
+
|
|
238
|
+
Previously, async-drain timer interception captured every `setTimeout` into a
|
|
239
|
+
pending map and only fired them via a post-`fn` flush. If a destination's init
|
|
240
|
+
awaited one of those captured timers (e.g.,
|
|
241
|
+
`@walkeros/web-destination-amplitude`'s engagement plugin awaits a 10s
|
|
242
|
+
setTimeout to give up on a CDN script load), `init` never resolved,
|
|
243
|
+
`await collector.push` deadlocked, and Node exited with
|
|
244
|
+
`Detected unsettled top-level await` (exit 13).
|
|
245
|
+
|
|
246
|
+
A drain pump now runs alongside `fn(flowModule)` for non-`--simulate` runs:
|
|
247
|
+
each tick fires every captured non-cleared timer using a real `setImmediate`
|
|
248
|
+
reference. Timers fire in delay-ascending order, intervals re-register,
|
|
249
|
+
callback errors are reported via `console.warn`. Bounded by max-iterations
|
|
250
|
+
(1000) and wall-clock (30s) caps.
|
|
251
|
+
|
|
252
|
+
`--simulate <step>` continues to use the post-`fn` flush path so snapshot
|
|
253
|
+
ordering remains stable.
|
|
254
|
+
|
|
255
|
+
Behavior change (edge case): a destination using `setTimeout` for retry
|
|
256
|
+
backoff under `walkeros push` (real, non-simulate) now sees its timer fire
|
|
257
|
+
instantly. This was already the documented contract for `--simulate <step>`
|
|
258
|
+
snapshots; it now extends to real `push` for consistency.
|
|
259
|
+
|
|
124
260
|
- 6422b9b: Validate device-code and token responses from the auth server with
|
|
125
261
|
Zod schemas at the trust boundary in `login/index.ts`. Malformed responses now
|
|
126
262
|
surface as structured errors instead of being trusted into config writes or
|
|
@@ -154,14 +290,16 @@
|
|
|
154
290
|
`deploy` action is unchanged.
|
|
155
291
|
|
|
156
292
|
- Updated dependencies [93ea9c4]
|
|
293
|
+
- Updated dependencies [465775c]
|
|
157
294
|
- Updated dependencies [942a7fe]
|
|
158
295
|
- Updated dependencies [cfc7469]
|
|
159
296
|
- Updated dependencies [8e06b1f]
|
|
160
297
|
- Updated dependencies [3d50dd6]
|
|
161
|
-
|
|
162
|
-
- @walkeros/
|
|
163
|
-
- @walkeros/
|
|
164
|
-
- @walkeros/server-
|
|
298
|
+
- Updated dependencies [1ef33d9]
|
|
299
|
+
- @walkeros/core@4.0.0
|
|
300
|
+
- @walkeros/collector@4.0.0
|
|
301
|
+
- @walkeros/server-destination-api@4.0.0
|
|
302
|
+
- @walkeros/server-core@4.0.0
|
|
165
303
|
|
|
166
304
|
## 3.4.2
|
|
167
305
|
|