@walkeros/cli 4.0.0-next-1777463920154 → 4.0.0-next-1777882869103

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @walkeros/cli
2
2
 
3
- ## 4.0.0-next-1777463920154
3
+ ## 4.0.0-next-1777882869103
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 })`
@@ -154,14 +265,16 @@
154
265
  `deploy` action is unchanged.
155
266
 
156
267
  - Updated dependencies [93ea9c4]
268
+ - Updated dependencies [465775c]
157
269
  - Updated dependencies [942a7fe]
158
270
  - Updated dependencies [cfc7469]
159
271
  - Updated dependencies [8e06b1f]
160
272
  - Updated dependencies [3d50dd6]
161
- - @walkeros/core@4.0.0-next-1777463920154
162
- - @walkeros/collector@4.0.0-next-1777463920154
163
- - @walkeros/server-destination-api@4.0.0-next-1777463920154
164
- - @walkeros/server-core@4.0.0-next-1777463920154
273
+ - Updated dependencies [1ef33d9]
274
+ - @walkeros/core@4.0.0-next-1777882869103
275
+ - @walkeros/collector@4.0.0-next-1777882869103
276
+ - @walkeros/server-destination-api@4.0.0-next-1777882869103
277
+ - @walkeros/server-core@4.0.0-next-1777882869103
165
278
 
166
279
  ## 3.4.2
167
280