@walkeros/cli 3.2.0 → 3.3.0-next-1776113011459

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.
@@ -6,20 +6,6 @@
6
6
  "windowCollector": "collector",
7
7
  "windowElb": "elb"
8
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
9
  "sources": {
24
10
  "demo": {
25
11
  "package": "@walkeros/source-demo",
@@ -28,7 +14,10 @@
28
14
  "events": [
29
15
  {
30
16
  "name": "page view",
31
- "data": { "title": "Home", "path": "/" },
17
+ "data": {
18
+ "title": "Home",
19
+ "path": "/"
20
+ },
32
21
  "delay": 0
33
22
  },
34
23
  {
@@ -68,6 +57,22 @@
68
57
  "globals": {
69
58
  "language": "en"
70
59
  }
60
+ },
61
+ "bundle": {
62
+ "packages": {
63
+ "@walkeros/collector": {
64
+ "imports": ["startFlow"]
65
+ },
66
+ "@walkeros/source-demo": {
67
+ "imports": ["sourceDemo"]
68
+ },
69
+ "@walkeros/destination-demo": {
70
+ "imports": ["destinationDemo"]
71
+ },
72
+ "@walkeros/web-destination-api": {
73
+ "imports": ["destinationAPI"]
74
+ }
75
+ }
71
76
  }
72
77
  }
73
78
  }
package/dist/index.d.ts CHANGED
@@ -61,6 +61,12 @@ interface BuildOptions extends CLIBuildOptions {
61
61
  * Packages to include in the bundle.
62
62
  */
63
63
  packages: Flow.Packages;
64
+ /**
65
+ * Transitive dependency version overrides.
66
+ * Flat `Record<string, string>` matching npm's `overrides` semantics.
67
+ * Only substitutes transitive specs; direct package specs always win.
68
+ */
69
+ overrides?: Flow.Overrides;
64
70
  /**
65
71
  * Output format.
66
72
  */
@@ -367,6 +373,7 @@ declare function push(configOrPath: string | unknown, event: unknown, options?:
367
373
  }): Promise<PushResult>;
368
374
  interface SimulateSourceOptions {
369
375
  sourceId: string;
376
+ bundlePath?: string;
370
377
  flow?: string;
371
378
  silent?: boolean;
372
379
  verbose?: boolean;
@@ -382,9 +389,10 @@ interface SimulateSourceOptions {
382
389
  * The `input` parameter is `unknown` — the CLI is agnostic to source-specific
383
390
  * content shapes. The source's createTrigger defines what it expects.
384
391
  */
385
- declare function simulateSource(configPath: string, input: unknown, options: SimulateSourceOptions): Promise<PushResult>;
392
+ declare function simulateSource(configOrPath: string | Flow.Config, input: unknown, options: SimulateSourceOptions): Promise<PushResult>;
386
393
  interface SimulateTransformerOptions {
387
394
  transformerId: string;
395
+ bundlePath?: string;
388
396
  flow?: string;
389
397
  mock?: string[];
390
398
  silent?: boolean;
@@ -401,9 +409,10 @@ interface SimulateTransformerOptions {
401
409
  * Captured array: first entry = input event, subsequent entries = output event(s).
402
410
  * If the transformer drops the event (returns false), output event is null.
403
411
  */
404
- declare function simulateTransformer(configPath: string, event: WalkerOS.DeepPartialEvent, options: SimulateTransformerOptions): Promise<PushResult>;
412
+ declare function simulateTransformer(configOrPath: string | Flow.Config, event: WalkerOS.DeepPartialEvent, options: SimulateTransformerOptions): Promise<PushResult>;
405
413
  interface SimulateDestinationOptions {
406
414
  destinationId: string;
415
+ bundlePath?: string;
407
416
  flow?: string;
408
417
  mock?: string[];
409
418
  silent?: boolean;
@@ -419,7 +428,7 @@ interface SimulateDestinationOptions {
419
428
  * pipeline support — consent checks, event mapping, createEvent enrichment,
420
429
  * before chains — without manual wiring.
421
430
  */
422
- declare function simulateDestination(configPath: string, event: WalkerOS.DeepPartialEvent, options: SimulateDestinationOptions): Promise<PushResult>;
431
+ declare function simulateDestination(configOrPath: string | Flow.Config, event: WalkerOS.DeepPartialEvent, options: SimulateDestinationOptions): Promise<PushResult>;
423
432
 
424
433
  /**
425
434
  * Run Command Types
@@ -910,6 +919,57 @@ interface FeedbackOptions {
910
919
  declare function feedback(text: string, options?: FeedbackOptions): Promise<void>;
911
920
  declare function feedbackCommand(text: string): Promise<void>;
912
921
 
922
+ /**
923
+ * Publish-time wrap step.
924
+ *
925
+ * Takes a Stage 1 ESM skeleton produced via `bundle({ skipWrapper: true })`
926
+ * and produces a wrapped output:
927
+ * - `browser`: self-executing async IIFE that calls
928
+ * `startFlow(wireConfig(__configData))` and optionally assigns the
929
+ * resulting collector/elb onto `window`.
930
+ * - `node`: ESM module whose default export is an async factory function
931
+ * that the runtime container (see `runtime/load-bundle.ts:53-66`) calls
932
+ * with a context to get back `{ collector, elb, httpHandler? }`.
933
+ *
934
+ * The skeleton must export `wireConfig`, `startFlow`, and `__configData`.
935
+ * The skipWrapper branch of `bundleCore` already emits exactly that shape.
936
+ */
937
+
938
+ interface WrapSkeletonOptions {
939
+ /**
940
+ * Absolute path to the Stage 1 skeleton ESM file. Must export
941
+ * `wireConfig`, `startFlow`, and `__configData`.
942
+ */
943
+ skeletonPath: string;
944
+ /** Target platform — controls which entry generator runs. */
945
+ platform: 'browser' | 'node';
946
+ /** Absolute path where the wrapped output will be written. */
947
+ outputPath: string;
948
+ /**
949
+ * Browser-only: window property name for the collector.
950
+ * When unset, no `window.*` assignment is emitted.
951
+ */
952
+ windowCollector?: string;
953
+ /**
954
+ * Browser-only: window property name for the elb function.
955
+ * When unset, no `window.*` assignment is emitted.
956
+ */
957
+ windowElb?: string;
958
+ /** Browser-only: CDN hostname for loading preview bundles. */
959
+ previewOrigin?: string;
960
+ /** Browser-only: project scope for preview URL isolation. */
961
+ previewScope?: string;
962
+ /**
963
+ * esbuild target. @default 'es2018' for browser, 'node18' for node.
964
+ */
965
+ target?: string;
966
+ /** Whether to minify the output. @default true */
967
+ minify?: boolean;
968
+ /** Fine-grained minification options, forwarded to esbuild. */
969
+ minifyOptions?: MinifyOptions;
970
+ }
971
+ declare function wrapSkeleton(options: WrapSkeletonOptions): Promise<void>;
972
+
913
973
  /**
914
974
  * This file was auto-generated by openapi-typescript.
915
975
  * Do not make direct changes to the file.
@@ -5180,4 +5240,55 @@ declare function compareOutput(expected: unknown, actual: unknown): {
5180
5240
  diff?: string;
5181
5241
  };
5182
5242
 
5183
- export { ApiError, type ApiErrorDetail, type BuildOptions, type BundleStats, type CLIBuildOptions, type DeployOptions, type ExampleLookupResult, type FeedbackOptions, type GlobalOptions, type ListDeploymentsOptions, type ListFlowsOptions, type MinifyOptions, type PushResult, type RunCommandOptions, type RunOptions, type RunResult, type SSEEvent, type SSEParseResult, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, type ValidateResult, type ValidationError, type ValidationType, type ValidationWarning, type WalkerOSConfig, apiFetch, bundle, bundleCommand, bundleRemote, compareOutput, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createProject, createProjectCommand, deleteDeployment, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deleteProject, deleteProjectCommand, deploy, deployCommand, deployFetch, duplicateFlow, duplicateFlowCommand, feedback, feedbackCommand, findExample, getAuthHeaders, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFlow, getFlowCommand, getProject, getProjectCommand, getToken, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listProjects, listProjectsCommand, loadConfig, loadJsonConfig, loginCommand, logoutCommand, mergeAuthHeaders, parseSSEEvents, publicFetch, push, pushCommand, readConfig, requireProjectId, run, runCommand, simulateDestination, simulateSource, simulateTransformer, throwApiError, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, validate, validateCommand, whoami, whoamiCommand, writeConfig };
5243
+ /**
5244
+ * Overrides structure for destination config properties.
5245
+ * Shape mirrors Collector.InitConfig.destinations but without requiring `code`.
5246
+ * Used with deepMerge at runtime to overlay mock/disabled flags.
5247
+ */
5248
+ interface PushOverrides {
5249
+ destinations?: Record<string, {
5250
+ config?: {
5251
+ mock?: unknown;
5252
+ disabled?: boolean;
5253
+ };
5254
+ simulate?: boolean;
5255
+ env?: Record<string, unknown>;
5256
+ simulation?: string[];
5257
+ }>;
5258
+ sources?: Record<string, {
5259
+ simulate?: boolean;
5260
+ }>;
5261
+ /** Path-specific transformer mocks: chainPath → { transformerId → mockValue } */
5262
+ transformerMocks?: Record<string, Record<string, unknown>>;
5263
+ transformers?: Record<string, {
5264
+ simulate?: boolean;
5265
+ }>;
5266
+ }
5267
+
5268
+ type PrepareInput = {
5269
+ mode: 'build';
5270
+ config: Flow.Config;
5271
+ flow?: string;
5272
+ simulate?: string[];
5273
+ mock?: string[];
5274
+ silent?: boolean;
5275
+ verbose?: boolean;
5276
+ } | {
5277
+ mode: 'prebuilt';
5278
+ bundlePath: string;
5279
+ config: Flow.Config;
5280
+ flow?: string;
5281
+ simulate?: string[];
5282
+ mock?: string[];
5283
+ silent?: boolean;
5284
+ verbose?: boolean;
5285
+ };
5286
+ interface PreparedFlow {
5287
+ bundlePath: string;
5288
+ platform: 'web' | 'server';
5289
+ overrides: PushOverrides;
5290
+ flowSettings: Flow.Settings;
5291
+ cleanup: () => Promise<void>;
5292
+ }
5293
+
5294
+ export { ApiError, type ApiErrorDetail, type BuildOptions, type BundleStats, type CLIBuildOptions, type DeployOptions, type ExampleLookupResult, type FeedbackOptions, type GlobalOptions, type ListDeploymentsOptions, type ListFlowsOptions, type MinifyOptions, type PrepareInput, type PreparedFlow, type PushResult, type RunCommandOptions, type RunOptions, type RunResult, type SSEEvent, type SSEParseResult, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, type ValidateResult, type ValidationError, type ValidationType, type ValidationWarning, type WalkerOSConfig, type WrapSkeletonOptions, apiFetch, bundle, bundleCommand, bundleRemote, compareOutput, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createProject, createProjectCommand, deleteDeployment, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deleteProject, deleteProjectCommand, deploy, deployCommand, deployFetch, duplicateFlow, duplicateFlowCommand, feedback, feedbackCommand, findExample, getAuthHeaders, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFlow, getFlowCommand, getProject, getProjectCommand, getToken, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listProjects, listProjectsCommand, loadConfig, loadJsonConfig, loginCommand, logoutCommand, mergeAuthHeaders, parseSSEEvents, publicFetch, push, pushCommand, readConfig, requireProjectId, run, runCommand, simulateDestination, simulateSource, simulateTransformer, throwApiError, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, validate, validateCommand, whoami, whoamiCommand, wrapSkeleton, writeConfig };