@walkeros/cli 0.6.0 → 0.6.1-next-1766186076625
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 +12 -0
- package/README.md +53 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.js +364 -194
- package/dist/index.js.map +1 -1
- package/dist/runtime/main.js +3 -2
- package/dist/runtime/main.js.map +1 -1
- package/package.json +2 -2
- package/dist/__tests__/bundle/bundler-helpers.test.d.ts +0 -2
- package/dist/__tests__/bundle/bundler-helpers.test.d.ts.map +0 -1
- package/dist/__tests__/bundle/bundler-helpers.test.js +0 -151
- package/dist/__tests__/bundle/bundler-helpers.test.js.map +0 -1
- package/dist/__tests__/bundle/bundler.test.d.ts +0 -2
- package/dist/__tests__/bundle/bundler.test.d.ts.map +0 -1
- package/dist/__tests__/bundle/bundler.test.js +0 -352
- package/dist/__tests__/bundle/bundler.test.js.map +0 -1
- package/dist/__tests__/bundle/programmatic.test.d.ts +0 -2
- package/dist/__tests__/bundle/programmatic.test.d.ts.map +0 -1
- package/dist/__tests__/bundle/programmatic.test.js +0 -148
- package/dist/__tests__/bundle/programmatic.test.js.map +0 -1
- package/dist/__tests__/cli-e2e.test.d.ts +0 -8
- package/dist/__tests__/cli-e2e.test.d.ts.map +0 -1
- package/dist/__tests__/cli-e2e.test.js +0 -145
- package/dist/__tests__/cli-e2e.test.js.map +0 -1
- package/dist/__tests__/cli.test.d.ts +0 -2
- package/dist/__tests__/cli.test.d.ts.map +0 -1
- package/dist/__tests__/cli.test.js +0 -179
- package/dist/__tests__/cli.test.js.map +0 -1
- package/dist/__tests__/config-loader.test.d.ts +0 -7
- package/dist/__tests__/config-loader.test.d.ts.map +0 -1
- package/dist/__tests__/config-loader.test.js +0 -414
- package/dist/__tests__/config-loader.test.js.map +0 -1
- package/dist/__tests__/core/asset-resolver.test.d.ts +0 -2
- package/dist/__tests__/core/asset-resolver.test.d.ts.map +0 -1
- package/dist/__tests__/core/asset-resolver.test.js +0 -14
- package/dist/__tests__/core/asset-resolver.test.js.map +0 -1
- package/dist/__tests__/core/build-cache.test.d.ts +0 -2
- package/dist/__tests__/core/build-cache.test.d.ts.map +0 -1
- package/dist/__tests__/core/build-cache.test.js +0 -55
- package/dist/__tests__/core/build-cache.test.js.map +0 -1
- package/dist/__tests__/core/cache-utils.test.d.ts +0 -2
- package/dist/__tests__/core/cache-utils.test.d.ts.map +0 -1
- package/dist/__tests__/core/cache-utils.test.js +0 -70
- package/dist/__tests__/core/cache-utils.test.js.map +0 -1
- package/dist/__tests__/core/config.test.d.ts +0 -2
- package/dist/__tests__/core/config.test.d.ts.map +0 -1
- package/dist/__tests__/core/config.test.js +0 -79
- package/dist/__tests__/core/config.test.js.map +0 -1
- package/dist/__tests__/core/logger.test.d.ts +0 -2
- package/dist/__tests__/core/logger.test.d.ts.map +0 -1
- package/dist/__tests__/core/logger.test.js +0 -53
- package/dist/__tests__/core/logger.test.js.map +0 -1
- package/dist/__tests__/integration/bundle-run.integration.test.d.ts +0 -8
- package/dist/__tests__/integration/bundle-run.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/bundle-run.integration.test.js +0 -54
- package/dist/__tests__/integration/bundle-run.integration.test.js.map +0 -1
- package/dist/__tests__/push/push.test.d.ts +0 -7
- package/dist/__tests__/push/push.test.d.ts.map +0 -1
- package/dist/__tests__/push/push.test.js +0 -197
- package/dist/__tests__/push/push.test.js.map +0 -1
- package/dist/__tests__/simulate/env-loader.test.d.ts +0 -2
- package/dist/__tests__/simulate/env-loader.test.d.ts.map +0 -1
- package/dist/__tests__/simulate/env-loader.test.js +0 -47
- package/dist/__tests__/simulate/env-loader.test.js.map +0 -1
- package/dist/__tests__/simulate/node-executor.test.d.ts +0 -5
- package/dist/__tests__/simulate/node-executor.test.d.ts.map +0 -1
- package/dist/__tests__/simulate/node-executor.test.js +0 -25
- package/dist/__tests__/simulate/node-executor.test.js.map +0 -1
- package/dist/__tests__/simulate/server-simulate.integration.test.d.ts +0 -5
- package/dist/__tests__/simulate/server-simulate.integration.test.d.ts.map +0 -1
- package/dist/__tests__/simulate/server-simulate.integration.test.js +0 -58
- package/dist/__tests__/simulate/server-simulate.integration.test.js.map +0 -1
- package/dist/__tests__/smoke/production.smoke.test.d.ts +0 -8
- package/dist/__tests__/smoke/production.smoke.test.d.ts.map +0 -1
- package/dist/__tests__/smoke/production.smoke.test.js +0 -65
- package/dist/__tests__/smoke/production.smoke.test.js.map +0 -1
- package/dist/commands/bundle/bundler.d.ts +0 -32
- package/dist/commands/bundle/bundler.d.ts.map +0 -1
- package/dist/commands/bundle/bundler.js +0 -569
- package/dist/commands/bundle/bundler.js.map +0 -1
- package/dist/commands/bundle/index.d.ts +0 -59
- package/dist/commands/bundle/index.d.ts.map +0 -1
- package/dist/commands/bundle/index.js +0 -184
- package/dist/commands/bundle/index.js.map +0 -1
- package/dist/commands/bundle/package-manager.d.ts +0 -8
- package/dist/commands/bundle/package-manager.d.ts.map +0 -1
- package/dist/commands/bundle/package-manager.js +0 -220
- package/dist/commands/bundle/package-manager.js.map +0 -1
- package/dist/commands/bundle/stats.d.ts +0 -23
- package/dist/commands/bundle/stats.d.ts.map +0 -1
- package/dist/commands/bundle/stats.js +0 -52
- package/dist/commands/bundle/stats.js.map +0 -1
- package/dist/commands/cache.d.ts +0 -7
- package/dist/commands/cache.d.ts.map +0 -1
- package/dist/commands/cache.js +0 -68
- package/dist/commands/cache.js.map +0 -1
- package/dist/commands/push/index.d.ts +0 -7
- package/dist/commands/push/index.d.ts.map +0 -1
- package/dist/commands/push/index.js +0 -247
- package/dist/commands/push/index.js.map +0 -1
- package/dist/commands/push/types.d.ts +0 -22
- package/dist/commands/push/types.d.ts.map +0 -1
- package/dist/commands/push/types.js +0 -2
- package/dist/commands/push/types.js.map +0 -1
- package/dist/commands/run/__tests__/run.integration.test.d.ts +0 -7
- package/dist/commands/run/__tests__/run.integration.test.d.ts.map +0 -1
- package/dist/commands/run/__tests__/run.integration.test.js +0 -51
- package/dist/commands/run/__tests__/run.integration.test.js.map +0 -1
- package/dist/commands/run/__tests__/validators.test.d.ts +0 -2
- package/dist/commands/run/__tests__/validators.test.d.ts.map +0 -1
- package/dist/commands/run/__tests__/validators.test.js +0 -80
- package/dist/commands/run/__tests__/validators.test.js.map +0 -1
- package/dist/commands/run/execution.d.ts +0 -14
- package/dist/commands/run/execution.d.ts.map +0 -1
- package/dist/commands/run/execution.js +0 -41
- package/dist/commands/run/execution.js.map +0 -1
- package/dist/commands/run/index.d.ts +0 -38
- package/dist/commands/run/index.d.ts.map +0 -1
- package/dist/commands/run/index.js +0 -154
- package/dist/commands/run/index.js.map +0 -1
- package/dist/commands/run/types.d.ts +0 -65
- package/dist/commands/run/types.d.ts.map +0 -1
- package/dist/commands/run/types.js +0 -7
- package/dist/commands/run/types.js.map +0 -1
- package/dist/commands/run/utils.d.ts +0 -29
- package/dist/commands/run/utils.d.ts.map +0 -1
- package/dist/commands/run/utils.js +0 -52
- package/dist/commands/run/utils.js.map +0 -1
- package/dist/commands/run/validators.d.ts +0 -33
- package/dist/commands/run/validators.d.ts.map +0 -1
- package/dist/commands/run/validators.js +0 -58
- package/dist/commands/run/validators.js.map +0 -1
- package/dist/commands/simulate/env-loader.d.ts +0 -19
- package/dist/commands/simulate/env-loader.d.ts.map +0 -1
- package/dist/commands/simulate/env-loader.js +0 -44
- package/dist/commands/simulate/env-loader.js.map +0 -1
- package/dist/commands/simulate/index.d.ts +0 -48
- package/dist/commands/simulate/index.d.ts.map +0 -1
- package/dist/commands/simulate/index.js +0 -113
- package/dist/commands/simulate/index.js.map +0 -1
- package/dist/commands/simulate/jsdom-executor.d.ts +0 -37
- package/dist/commands/simulate/jsdom-executor.d.ts.map +0 -1
- package/dist/commands/simulate/jsdom-executor.js +0 -137
- package/dist/commands/simulate/jsdom-executor.js.map +0 -1
- package/dist/commands/simulate/node-executor.d.ts +0 -28
- package/dist/commands/simulate/node-executor.d.ts.map +0 -1
- package/dist/commands/simulate/node-executor.js +0 -94
- package/dist/commands/simulate/node-executor.js.map +0 -1
- package/dist/commands/simulate/simulator.d.ts +0 -14
- package/dist/commands/simulate/simulator.d.ts.map +0 -1
- package/dist/commands/simulate/simulator.js +0 -163
- package/dist/commands/simulate/simulator.js.map +0 -1
- package/dist/commands/simulate/tracker.d.ts +0 -30
- package/dist/commands/simulate/tracker.d.ts.map +0 -1
- package/dist/commands/simulate/tracker.js +0 -96
- package/dist/commands/simulate/tracker.js.map +0 -1
- package/dist/commands/simulate/types.d.ts +0 -20
- package/dist/commands/simulate/types.d.ts.map +0 -1
- package/dist/commands/simulate/types.js +0 -2
- package/dist/commands/simulate/types.js.map +0 -1
- package/dist/config/build-defaults.d.ts +0 -49
- package/dist/config/build-defaults.d.ts.map +0 -1
- package/dist/config/build-defaults.js +0 -68
- package/dist/config/build-defaults.js.map +0 -1
- package/dist/config/index.d.ts +0 -13
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -15
- package/dist/config/index.js.map +0 -1
- package/dist/config/loader.d.ts +0 -81
- package/dist/config/loader.d.ts.map +0 -1
- package/dist/config/loader.js +0 -153
- package/dist/config/loader.js.map +0 -1
- package/dist/config/utils.d.ts +0 -101
- package/dist/config/utils.d.ts.map +0 -1
- package/dist/config/utils.js +0 -235
- package/dist/config/utils.js.map +0 -1
- package/dist/config/validators.d.ts +0 -52
- package/dist/config/validators.d.ts.map +0 -1
- package/dist/config/validators.js +0 -85
- package/dist/config/validators.js.map +0 -1
- package/dist/core/asset-resolver.d.ts +0 -34
- package/dist/core/asset-resolver.d.ts.map +0 -1
- package/dist/core/asset-resolver.js +0 -70
- package/dist/core/asset-resolver.js.map +0 -1
- package/dist/core/build-cache.d.ts +0 -23
- package/dist/core/build-cache.d.ts.map +0 -1
- package/dist/core/build-cache.js +0 -44
- package/dist/core/build-cache.js.map +0 -1
- package/dist/core/cache-utils.d.ts +0 -27
- package/dist/core/cache-utils.d.ts.map +0 -1
- package/dist/core/cache-utils.js +0 -60
- package/dist/core/cache-utils.js.map +0 -1
- package/dist/core/index.d.ts +0 -8
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -8
- package/dist/core/index.js.map +0 -1
- package/dist/core/local-packages.d.ts +0 -19
- package/dist/core/local-packages.d.ts.map +0 -1
- package/dist/core/local-packages.js +0 -60
- package/dist/core/local-packages.js.map +0 -1
- package/dist/core/logger.d.ts +0 -30
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/logger.js +0 -85
- package/dist/core/logger.js.map +0 -1
- package/dist/core/output.d.ts +0 -30
- package/dist/core/output.d.ts.map +0 -1
- package/dist/core/output.js +0 -46
- package/dist/core/output.js.map +0 -1
- package/dist/core/timer.d.ts +0 -14
- package/dist/core/timer.d.ts.map +0 -1
- package/dist/core/timer.js +0 -29
- package/dist/core/timer.js.map +0 -1
- package/dist/core/tmp.d.ts +0 -27
- package/dist/core/tmp.d.ts.map +0 -1
- package/dist/core/tmp.js +0 -36
- package/dist/core/tmp.js.map +0 -1
- package/dist/core/utils.d.ts +0 -10
- package/dist/core/utils.d.ts.map +0 -1
- package/dist/core/utils.js +0 -12
- package/dist/core/utils.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/runtime/index.d.ts +0 -10
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -10
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/main.d.ts.map +0 -1
- package/dist/runtime/runner.d.ts +0 -20
- package/dist/runtime/runner.d.ts.map +0 -1
- package/dist/runtime/runner.js +0 -72
- package/dist/runtime/runner.js.map +0 -1
- package/dist/runtime/serve.d.ts +0 -19
- package/dist/runtime/serve.d.ts.map +0 -1
- package/dist/runtime/serve.js +0 -97
- package/dist/runtime/serve.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -9
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/index.js +0 -9
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/primitives.d.ts +0 -37
- package/dist/schemas/primitives.d.ts.map +0 -1
- package/dist/schemas/primitives.js +0 -43
- package/dist/schemas/primitives.js.map +0 -1
- package/dist/schemas/run.d.ts +0 -23
- package/dist/schemas/run.d.ts.map +0 -1
- package/dist/schemas/run.js +0 -20
- package/dist/schemas/run.js.map +0 -1
- package/dist/types/bundle.d.ts +0 -141
- package/dist/types/bundle.d.ts.map +0 -1
- package/dist/types/bundle.js +0 -10
- package/dist/types/bundle.js.map +0 -1
- package/dist/types/global.d.ts +0 -38
- package/dist/types/global.d.ts.map +0 -1
- package/dist/types/global.js +0 -24
- package/dist/types/global.js.map +0 -1
- package/dist/types/index.d.ts +0 -8
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -8
- package/dist/types/index.js.map +0 -1
- package/dist/version.d.ts +0 -3
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -27
- package/dist/version.js.map +0 -1
- package/dist/walker.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tracker.d.ts","sourceRoot":"","sources":["../../../src/commands/simulate/tracker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,KAAK,CAAqC;IAElD;;OAEG;IACH,YAAY,CACV,IAAI,EAAE,MAAM,EACZ,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,GACnC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO;IAYlC;;;;;OAKG;IACH,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC;IA4DtE,OAAO,CAAC,OAAO;IAiBf,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;IAIrC,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Call Tracker for Simulation
|
|
3
|
-
*
|
|
4
|
-
* Wraps mock environment functions to track API calls.
|
|
5
|
-
* Used with destination-provided examples/env.ts mocks.
|
|
6
|
-
*/
|
|
7
|
-
export class CallTracker {
|
|
8
|
-
calls = new Map();
|
|
9
|
-
/**
|
|
10
|
-
* Wrap a function to track its calls
|
|
11
|
-
*/
|
|
12
|
-
wrapFunction(name, fn) {
|
|
13
|
-
const self = this;
|
|
14
|
-
const targetFn = fn || (() => { });
|
|
15
|
-
return new Proxy(targetFn, {
|
|
16
|
-
apply(_target, thisArg, args) {
|
|
17
|
-
self.logCall(name, args);
|
|
18
|
-
return targetFn.apply(thisArg, args);
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Wrap an environment object, tracking specified paths
|
|
24
|
-
*
|
|
25
|
-
* @param env - Environment object (from destination's examples/env.ts)
|
|
26
|
-
* @param paths - Paths to track (e.g., ['gtag:window.gtag', 'gtag:window.dataLayer.push'])
|
|
27
|
-
*/
|
|
28
|
-
wrapEnv(env, paths) {
|
|
29
|
-
const wrapped = {};
|
|
30
|
-
// Deep clone the env object first
|
|
31
|
-
for (const [key, value] of Object.entries(env)) {
|
|
32
|
-
if (typeof value === 'object' && value !== null) {
|
|
33
|
-
wrapped[key] = Array.isArray(value)
|
|
34
|
-
? [...value]
|
|
35
|
-
: { ...value };
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
wrapped[key] = value;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Wrap specified paths
|
|
42
|
-
for (const fullPath of paths) {
|
|
43
|
-
// Parse path: "gtag:window.gtag" → destKey="gtag", path="window.gtag"
|
|
44
|
-
const [destKey, ...pathParts] = fullPath.split(':');
|
|
45
|
-
const path = pathParts.join(':');
|
|
46
|
-
if (!path)
|
|
47
|
-
continue;
|
|
48
|
-
// Remove "call:" prefix if present (from simulation array)
|
|
49
|
-
const cleanPath = path.replace(/^call:/, '');
|
|
50
|
-
const parts = cleanPath.split('.');
|
|
51
|
-
let current = wrapped;
|
|
52
|
-
let source = env;
|
|
53
|
-
// Navigate to parent object
|
|
54
|
-
for (let i = 0; i < parts.length - 1; i++) {
|
|
55
|
-
const part = parts[i];
|
|
56
|
-
if (!current[part]) {
|
|
57
|
-
current[part] = {};
|
|
58
|
-
}
|
|
59
|
-
current = current[part];
|
|
60
|
-
source =
|
|
61
|
-
source && typeof source[part] === 'object' && source[part] !== null
|
|
62
|
-
? source[part]
|
|
63
|
-
: undefined;
|
|
64
|
-
}
|
|
65
|
-
// Wrap the final property
|
|
66
|
-
const finalKey = parts[parts.length - 1];
|
|
67
|
-
const originalFn = source?.[finalKey];
|
|
68
|
-
// Wrap with full path for tracking
|
|
69
|
-
current[finalKey] = this.wrapFunction(`${destKey}:${cleanPath}`, typeof originalFn === 'function'
|
|
70
|
-
? originalFn
|
|
71
|
-
: undefined);
|
|
72
|
-
}
|
|
73
|
-
return wrapped;
|
|
74
|
-
}
|
|
75
|
-
logCall(fullPath, args) {
|
|
76
|
-
// Parse "destKey:api.path" → destKey and apiPath
|
|
77
|
-
const [destKey, ...pathParts] = fullPath.split(':');
|
|
78
|
-
const apiPath = pathParts.join(':');
|
|
79
|
-
if (!this.calls.has(destKey)) {
|
|
80
|
-
this.calls.set(destKey, []);
|
|
81
|
-
}
|
|
82
|
-
this.calls.get(destKey).push({
|
|
83
|
-
type: 'call',
|
|
84
|
-
path: apiPath,
|
|
85
|
-
args,
|
|
86
|
-
timestamp: Date.now(),
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
getCalls() {
|
|
90
|
-
return Object.fromEntries(this.calls);
|
|
91
|
-
}
|
|
92
|
-
reset() {
|
|
93
|
-
this.calls.clear();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=tracker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tracker.js","sourceRoot":"","sources":["../../../src/commands/simulate/tracker.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Elb } from '@walkeros/core';
|
|
2
|
-
import type { ApiCall } from './tracker.js';
|
|
3
|
-
export interface SimulateCommandOptions {
|
|
4
|
-
config: string;
|
|
5
|
-
event?: string;
|
|
6
|
-
json?: boolean;
|
|
7
|
-
verbose?: boolean;
|
|
8
|
-
dryRun?: boolean;
|
|
9
|
-
silent?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface SimulationResult {
|
|
12
|
-
success: boolean;
|
|
13
|
-
error?: string;
|
|
14
|
-
collector?: unknown;
|
|
15
|
-
elbResult?: Elb.PushResult;
|
|
16
|
-
logs?: unknown[];
|
|
17
|
-
usage?: Record<string, ApiCall[]>;
|
|
18
|
-
duration?: number;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/simulate/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/simulate/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Static Build Defaults
|
|
3
|
-
*
|
|
4
|
-
* Platform-specific build defaults for CLI bundling.
|
|
5
|
-
* Build options are CLI concerns, separate from Flow configuration.
|
|
6
|
-
*/
|
|
7
|
-
import type { BuildOptions } from '../types/bundle.js';
|
|
8
|
-
/**
|
|
9
|
-
* Build defaults for web platform (browser bundles).
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* These settings produce browser-compatible IIFE bundles.
|
|
13
|
-
*/
|
|
14
|
-
export declare const WEB_BUILD_DEFAULTS: Omit<BuildOptions, 'output' | 'packages'>;
|
|
15
|
-
/**
|
|
16
|
-
* Build defaults for server platform (Node.js bundles).
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* These settings produce Node.js-compatible ESM bundles.
|
|
20
|
-
*/
|
|
21
|
-
export declare const SERVER_BUILD_DEFAULTS: Omit<BuildOptions, 'output' | 'packages'>;
|
|
22
|
-
/**
|
|
23
|
-
* Default output paths by platform.
|
|
24
|
-
*/
|
|
25
|
-
export declare const DEFAULT_OUTPUT_PATHS: {
|
|
26
|
-
readonly web: "./dist/walker.js";
|
|
27
|
-
readonly server: "./dist/bundle.mjs";
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Get build defaults for a platform.
|
|
31
|
-
*
|
|
32
|
-
* @param platform - Target platform ('web' or 'server')
|
|
33
|
-
* @returns Platform-specific build defaults
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const defaults = getBuildDefaults('web');
|
|
38
|
-
* // { format: 'iife', platform: 'browser', ... }
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare function getBuildDefaults(platform: 'web' | 'server'): Omit<BuildOptions, 'output' | 'packages'>;
|
|
42
|
-
/**
|
|
43
|
-
* Get default output path for a platform.
|
|
44
|
-
*
|
|
45
|
-
* @param platform - Target platform ('web' or 'server')
|
|
46
|
-
* @returns Default output file path
|
|
47
|
-
*/
|
|
48
|
-
export declare function getDefaultOutput(platform: 'web' | 'server'): string;
|
|
49
|
-
//# sourceMappingURL=build-defaults.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-defaults.d.ts","sourceRoot":"","sources":["../../src/config/build-defaults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,UAAU,CASxE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,UAAU,CAQzE,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;CAGvB,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,KAAK,GAAG,QAAQ,GACzB,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,UAAU,CAAC,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAEnE"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Static Build Defaults
|
|
3
|
-
*
|
|
4
|
-
* Platform-specific build defaults for CLI bundling.
|
|
5
|
-
* Build options are CLI concerns, separate from Flow configuration.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Build defaults for web platform (browser bundles).
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* These settings produce browser-compatible IIFE bundles.
|
|
12
|
-
*/
|
|
13
|
-
export const WEB_BUILD_DEFAULTS = {
|
|
14
|
-
format: 'iife',
|
|
15
|
-
platform: 'browser',
|
|
16
|
-
target: 'es2020',
|
|
17
|
-
minify: true,
|
|
18
|
-
sourcemap: false,
|
|
19
|
-
cache: true,
|
|
20
|
-
windowCollector: 'collector',
|
|
21
|
-
windowElb: 'elb',
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Build defaults for server platform (Node.js bundles).
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* These settings produce Node.js-compatible ESM bundles.
|
|
28
|
-
*/
|
|
29
|
-
export const SERVER_BUILD_DEFAULTS = {
|
|
30
|
-
format: 'esm',
|
|
31
|
-
platform: 'node',
|
|
32
|
-
target: 'node20',
|
|
33
|
-
minify: true,
|
|
34
|
-
sourcemap: false,
|
|
35
|
-
cache: true,
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Default output paths by platform.
|
|
39
|
-
*/
|
|
40
|
-
export const DEFAULT_OUTPUT_PATHS = {
|
|
41
|
-
web: './dist/walker.js',
|
|
42
|
-
server: './dist/bundle.mjs',
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Get build defaults for a platform.
|
|
46
|
-
*
|
|
47
|
-
* @param platform - Target platform ('web' or 'server')
|
|
48
|
-
* @returns Platform-specific build defaults
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* const defaults = getBuildDefaults('web');
|
|
53
|
-
* // { format: 'iife', platform: 'browser', ... }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
export function getBuildDefaults(platform) {
|
|
57
|
-
return platform === 'web' ? WEB_BUILD_DEFAULTS : SERVER_BUILD_DEFAULTS;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Get default output path for a platform.
|
|
61
|
-
*
|
|
62
|
-
* @param platform - Target platform ('web' or 'server')
|
|
63
|
-
* @returns Default output file path
|
|
64
|
-
*/
|
|
65
|
-
export function getDefaultOutput(platform) {
|
|
66
|
-
return DEFAULT_OUTPUT_PATHS[platform];
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=build-defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-defaults.js","sourceRoot":"","sources":["../../src/config/build-defaults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA8C;IAC3E,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,IAAI;IACX,eAAe,EAAE,WAAW;IAC5B,SAAS,EAAE,KAAK;CACjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC;IACE,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,IAAI;CACZ,CAAC;AAEJ;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,GAAG,EAAE,kBAAkB;IACvB,MAAM,EAAE,mBAAmB;CACnB,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAA0B;IAE1B,OAAO,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,qBAAqB,CAAC;AACzE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAA0B;IACzD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC"}
|
package/dist/config/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration Module
|
|
3
|
-
*
|
|
4
|
-
* Config format: Flow.Setup from @walkeros/core
|
|
5
|
-
* Build options: Static platform defaults from build-defaults.ts
|
|
6
|
-
*/
|
|
7
|
-
export { isObject, detectPlatform, isFlowSetup, validateFlowSetup, getAvailableFlows as getFlowNames, } from './validators.js';
|
|
8
|
-
export { WEB_BUILD_DEFAULTS, SERVER_BUILD_DEFAULTS, DEFAULT_OUTPUT_PATHS, getBuildDefaults, getDefaultOutput, } from './build-defaults.js';
|
|
9
|
-
export { substituteEnvVariables, loadJsonConfig, loadJsonFromSource, isUrl, } from './utils.js';
|
|
10
|
-
export { loadBundleConfig, loadAllFlows, getAvailableFlows } from './loader.js';
|
|
11
|
-
export type { LoadConfigResult, LoadConfigOptions } from './loader.js';
|
|
12
|
-
export type { BuildOptions, CLIBuildOptions, MinifyOptions, Flow, } from '../types/bundle.js';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,QAAQ,EACR,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,iBAAiB,IAAI,YAAY,GAClC,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,KAAK,GACN,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChF,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGvE,YAAY,EACV,YAAY,EACZ,eAAe,EACf,aAAa,EACb,IAAI,GACL,MAAM,oBAAoB,CAAC"}
|
package/dist/config/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration Module
|
|
3
|
-
*
|
|
4
|
-
* Config format: Flow.Setup from @walkeros/core
|
|
5
|
-
* Build options: Static platform defaults from build-defaults.ts
|
|
6
|
-
*/
|
|
7
|
-
// Type guards and validators
|
|
8
|
-
export { isObject, detectPlatform, isFlowSetup, validateFlowSetup, getAvailableFlows as getFlowNames, } from './validators.js';
|
|
9
|
-
// Build defaults
|
|
10
|
-
export { WEB_BUILD_DEFAULTS, SERVER_BUILD_DEFAULTS, DEFAULT_OUTPUT_PATHS, getBuildDefaults, getDefaultOutput, } from './build-defaults.js';
|
|
11
|
-
// Utility functions
|
|
12
|
-
export { substituteEnvVariables, loadJsonConfig, loadJsonFromSource, isUrl, } from './utils.js';
|
|
13
|
-
// Loader
|
|
14
|
-
export { loadBundleConfig, loadAllFlows, getAvailableFlows } from './loader.js';
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,6BAA6B;AAC7B,OAAO,EACL,QAAQ,EACR,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,iBAAiB,IAAI,YAAY,GAClC,MAAM,iBAAiB,CAAC;AAEzB,iBAAiB;AACjB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,oBAAoB;AACpB,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,KAAK,GACN,MAAM,YAAY,CAAC;AAEpB,SAAS;AACT,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/config/loader.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration Loader
|
|
3
|
-
*
|
|
4
|
-
* Loads and parses Flow.Setup configurations using core getFlowConfig().
|
|
5
|
-
* Build options are determined by static platform defaults.
|
|
6
|
-
*/
|
|
7
|
-
import { type Flow } from '@walkeros/core';
|
|
8
|
-
import type { BuildOptions } from '../types/bundle.js';
|
|
9
|
-
/**
|
|
10
|
-
* Result of configuration loading.
|
|
11
|
-
*/
|
|
12
|
-
export interface LoadConfigResult {
|
|
13
|
-
/** Runtime event processing configuration */
|
|
14
|
-
flowConfig: Flow.Config;
|
|
15
|
-
/** Build-time configuration */
|
|
16
|
-
buildOptions: BuildOptions;
|
|
17
|
-
/** Name of the selected flow */
|
|
18
|
-
flowName: string;
|
|
19
|
-
/** Whether multiple flows are available */
|
|
20
|
-
isMultiFlow: boolean;
|
|
21
|
-
/** All available flow names */
|
|
22
|
-
availableFlows: string[];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Options for loading configuration.
|
|
26
|
-
*/
|
|
27
|
-
export interface LoadConfigOptions {
|
|
28
|
-
/** Path to config file */
|
|
29
|
-
configPath: string;
|
|
30
|
-
/** Flow name to load (required for multi-flow, optional for single-flow) */
|
|
31
|
-
flowName?: string;
|
|
32
|
-
/** CLI build overrides (future: --output, --minify, etc.) */
|
|
33
|
-
buildOverrides?: Partial<BuildOptions>;
|
|
34
|
-
/** Logger for warnings */
|
|
35
|
-
logger?: {
|
|
36
|
-
warn: (message: string) => void;
|
|
37
|
-
info: (message: string) => void;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Load and parse bundle configuration.
|
|
42
|
-
*
|
|
43
|
-
* @remarks
|
|
44
|
-
* Uses Flow.Setup from @walkeros/core as the only config format.
|
|
45
|
-
* - Validates config structure
|
|
46
|
-
* - Uses core getFlowConfig() for variable/definition resolution
|
|
47
|
-
* - Determines platform from resolved config
|
|
48
|
-
* - Applies static build defaults based on platform
|
|
49
|
-
*
|
|
50
|
-
* @param rawConfig - Raw configuration object from JSON file
|
|
51
|
-
* @param options - Loading options
|
|
52
|
-
* @returns Parsed configuration with flow and build separated
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```typescript
|
|
56
|
-
* const config = loadBundleConfig(rawConfig, {
|
|
57
|
-
* configPath: './walkeros.config.json',
|
|
58
|
-
* flowName: 'production',
|
|
59
|
-
* });
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
export declare function loadBundleConfig(rawConfig: unknown, options: LoadConfigOptions): LoadConfigResult;
|
|
63
|
-
/**
|
|
64
|
-
* Load all flows from a configuration.
|
|
65
|
-
*
|
|
66
|
-
* @remarks
|
|
67
|
-
* Used by the --all flag to build all flows.
|
|
68
|
-
*
|
|
69
|
-
* @param rawConfig - Raw configuration object
|
|
70
|
-
* @param options - Loading options (without flowName)
|
|
71
|
-
* @returns Array of loaded configurations for all flows
|
|
72
|
-
*/
|
|
73
|
-
export declare function loadAllFlows(rawConfig: unknown, options: Omit<LoadConfigOptions, 'flowName'>): LoadConfigResult[];
|
|
74
|
-
/**
|
|
75
|
-
* Get list of available flows from configuration.
|
|
76
|
-
*
|
|
77
|
-
* @param rawConfig - Raw configuration object
|
|
78
|
-
* @returns Array of flow names
|
|
79
|
-
*/
|
|
80
|
-
export declare function getAvailableFlows(rawConfig: unknown): string[];
|
|
81
|
-
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAA8B,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAYvD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;IACxB,+BAA+B;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,WAAW,EAAE,OAAO,CAAC;IACrB,+BAA+B;IAC/B,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACvC,0BAA0B;IAC1B,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;QAChC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;KACjC,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,iBAAiB,GACzB,gBAAgB,CAqElB;AAwCD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAC3C,gBAAgB,EAAE,CAkBpB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,EAAE,CAK9D"}
|
package/dist/config/loader.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration Loader
|
|
3
|
-
*
|
|
4
|
-
* Loads and parses Flow.Setup configurations using core getFlowConfig().
|
|
5
|
-
* Build options are determined by static platform defaults.
|
|
6
|
-
*/
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import fs from 'fs-extra';
|
|
9
|
-
import { getFlowConfig, getPlatform } from '@walkeros/core';
|
|
10
|
-
import { validateFlowSetup, isFlowSetup, getAvailableFlows as getFlowNames, } from './validators.js';
|
|
11
|
-
import { getBuildDefaults, getDefaultOutput } from './build-defaults.js';
|
|
12
|
-
import { isUrl } from './utils.js';
|
|
13
|
-
/** Default folder for includes if it exists */
|
|
14
|
-
const DEFAULT_INCLUDE_FOLDER = './shared';
|
|
15
|
-
/**
|
|
16
|
-
* Load and parse bundle configuration.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* Uses Flow.Setup from @walkeros/core as the only config format.
|
|
20
|
-
* - Validates config structure
|
|
21
|
-
* - Uses core getFlowConfig() for variable/definition resolution
|
|
22
|
-
* - Determines platform from resolved config
|
|
23
|
-
* - Applies static build defaults based on platform
|
|
24
|
-
*
|
|
25
|
-
* @param rawConfig - Raw configuration object from JSON file
|
|
26
|
-
* @param options - Loading options
|
|
27
|
-
* @returns Parsed configuration with flow and build separated
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const config = loadBundleConfig(rawConfig, {
|
|
32
|
-
* configPath: './walkeros.config.json',
|
|
33
|
-
* flowName: 'production',
|
|
34
|
-
* });
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export function loadBundleConfig(rawConfig, options) {
|
|
38
|
-
// Validate as Flow.Setup
|
|
39
|
-
const setup = validateFlowSetup(rawConfig);
|
|
40
|
-
const availableFlows = getFlowNames(setup);
|
|
41
|
-
// Determine which flow to use
|
|
42
|
-
const flowName = resolveFlow(setup, options.flowName, availableFlows);
|
|
43
|
-
// Use core getFlowConfig() for resolution (variables, $refs, cascading)
|
|
44
|
-
const flowConfig = getFlowConfig(setup, flowName);
|
|
45
|
-
// Detect platform from resolved config
|
|
46
|
-
const platform = getPlatform(flowConfig);
|
|
47
|
-
if (!platform) {
|
|
48
|
-
throw new Error(`Invalid configuration: flow "${flowName}" must have a "web" or "server" key.`);
|
|
49
|
-
}
|
|
50
|
-
// Get static build defaults based on platform
|
|
51
|
-
const buildDefaults = getBuildDefaults(platform);
|
|
52
|
-
// Extract packages from flowConfig (if present)
|
|
53
|
-
const packages = flowConfig.packages || {};
|
|
54
|
-
// Output path: use --output if provided, otherwise default
|
|
55
|
-
// Always relative to cwd, no dynamic resolution
|
|
56
|
-
const output = options.buildOverrides?.output || getDefaultOutput(platform);
|
|
57
|
-
// Get config directory for resolving includes and local packages
|
|
58
|
-
// For URLs, use cwd since there's no local config directory
|
|
59
|
-
const configDir = isUrl(options.configPath)
|
|
60
|
-
? process.cwd()
|
|
61
|
-
: path.dirname(options.configPath);
|
|
62
|
-
// Get includes from config or use default if ./shared exists
|
|
63
|
-
let includes = setup.include;
|
|
64
|
-
if (!includes) {
|
|
65
|
-
const defaultIncludePath = path.resolve(configDir, DEFAULT_INCLUDE_FOLDER);
|
|
66
|
-
if (fs.pathExistsSync(defaultIncludePath)) {
|
|
67
|
-
includes = [DEFAULT_INCLUDE_FOLDER];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
// Merge build options: defaults + CLI overrides
|
|
71
|
-
const buildOptions = {
|
|
72
|
-
...buildDefaults,
|
|
73
|
-
packages,
|
|
74
|
-
output,
|
|
75
|
-
include: includes,
|
|
76
|
-
configDir,
|
|
77
|
-
...options.buildOverrides,
|
|
78
|
-
};
|
|
79
|
-
// Log flow selection
|
|
80
|
-
const isMultiFlow = availableFlows.length > 1;
|
|
81
|
-
if (isMultiFlow && options.logger) {
|
|
82
|
-
options.logger.info(`📦 Using flow: ${flowName} (${availableFlows.length} total)`);
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
flowConfig,
|
|
86
|
-
buildOptions,
|
|
87
|
-
flowName,
|
|
88
|
-
isMultiFlow,
|
|
89
|
-
availableFlows,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Resolve which flow to use.
|
|
94
|
-
*
|
|
95
|
-
* @param setup - Flow.Setup configuration
|
|
96
|
-
* @param requestedFlow - Flow name from CLI (optional)
|
|
97
|
-
* @param available - Available flow names
|
|
98
|
-
* @returns Flow name to use
|
|
99
|
-
* @throws Error if flow selection is invalid
|
|
100
|
-
*/
|
|
101
|
-
function resolveFlow(setup, requestedFlow, available) {
|
|
102
|
-
// If only one flow, use it automatically
|
|
103
|
-
if (available.length === 1) {
|
|
104
|
-
return available[0];
|
|
105
|
-
}
|
|
106
|
-
// Multiple flows require explicit selection
|
|
107
|
-
if (!requestedFlow) {
|
|
108
|
-
throw new Error(`Multiple flows found. Please specify a flow using --flow flag.\n` +
|
|
109
|
-
`Available flows: ${available.join(', ')}`);
|
|
110
|
-
}
|
|
111
|
-
// Validate the requested flow exists
|
|
112
|
-
if (!available.includes(requestedFlow)) {
|
|
113
|
-
throw new Error(`Flow "${requestedFlow}" not found in configuration.\n` +
|
|
114
|
-
`Available flows: ${available.join(', ')}`);
|
|
115
|
-
}
|
|
116
|
-
return requestedFlow;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Load all flows from a configuration.
|
|
120
|
-
*
|
|
121
|
-
* @remarks
|
|
122
|
-
* Used by the --all flag to build all flows.
|
|
123
|
-
*
|
|
124
|
-
* @param rawConfig - Raw configuration object
|
|
125
|
-
* @param options - Loading options (without flowName)
|
|
126
|
-
* @returns Array of loaded configurations for all flows
|
|
127
|
-
*/
|
|
128
|
-
export function loadAllFlows(rawConfig, options) {
|
|
129
|
-
// Validate as Flow.Setup
|
|
130
|
-
const setup = validateFlowSetup(rawConfig);
|
|
131
|
-
const flows = getFlowNames(setup);
|
|
132
|
-
if (options.logger) {
|
|
133
|
-
options.logger.info(`📦 Loading all ${flows.length} flows: ${flows.join(', ')}`);
|
|
134
|
-
}
|
|
135
|
-
// Load each flow
|
|
136
|
-
return flows.map((name) => loadBundleConfig(rawConfig, {
|
|
137
|
-
...options,
|
|
138
|
-
flowName: name,
|
|
139
|
-
}));
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Get list of available flows from configuration.
|
|
143
|
-
*
|
|
144
|
-
* @param rawConfig - Raw configuration object
|
|
145
|
-
* @returns Array of flow names
|
|
146
|
-
*/
|
|
147
|
-
export function getAvailableFlows(rawConfig) {
|
|
148
|
-
if (isFlowSetup(rawConfig)) {
|
|
149
|
-
return getFlowNames(rawConfig);
|
|
150
|
-
}
|
|
151
|
-
return [];
|
|
152
|
-
}
|
|
153
|
-
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"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"}
|
package/dist/config/utils.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration Utility Functions
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Check if a string is a valid URL
|
|
6
|
-
*
|
|
7
|
-
* @param str - String to check
|
|
8
|
-
* @returns True if string is a valid HTTP/HTTPS URL
|
|
9
|
-
*/
|
|
10
|
-
export declare function isUrl(str: string): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Download a file from a URL to a temporary location
|
|
13
|
-
*
|
|
14
|
-
* @param url - HTTP/HTTPS URL to download
|
|
15
|
-
* @returns Path to downloaded temporary file
|
|
16
|
-
* @throws Error if download fails or response is not OK
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* const tempPath = await downloadFromUrl('https://example.com/config.json')
|
|
21
|
-
* // Returns: "/tmp/walkeros-download-1647261462000-abc123.json"
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function downloadFromUrl(url: string): Promise<string>;
|
|
25
|
-
/**
|
|
26
|
-
* Substitute environment variables in a string.
|
|
27
|
-
*
|
|
28
|
-
* @param value - String with ${VAR} placeholders
|
|
29
|
-
* @returns String with environment variables substituted
|
|
30
|
-
* @throws Error if environment variable is not found
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* substituteEnvVariables('${HOME}/config') // "/Users/name/config"
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export declare function substituteEnvVariables(value: string): string;
|
|
38
|
-
/**
|
|
39
|
-
* Load and parse JSON configuration file from local path or URL.
|
|
40
|
-
*
|
|
41
|
-
* @param configPath - Path to JSON file or HTTP/HTTPS URL
|
|
42
|
-
* @returns Parsed configuration object and cleanup function
|
|
43
|
-
* @throws Error if file not found, download fails, or invalid JSON
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* // Local file
|
|
48
|
-
* const config = await loadJsonConfig('./config.json')
|
|
49
|
-
*
|
|
50
|
-
* // Remote URL
|
|
51
|
-
* const config = await loadJsonConfig('https://example.com/config.json')
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export declare function loadJsonConfig<T>(configPath: string): Promise<T>;
|
|
55
|
-
/**
|
|
56
|
-
* Load JSON from inline string, file path, or URL.
|
|
57
|
-
*
|
|
58
|
-
* Supports three input formats:
|
|
59
|
-
* 1. Inline JSON string - parsed directly
|
|
60
|
-
* 2. Local file path - read and parsed
|
|
61
|
-
* 3. HTTP/HTTPS URL - downloaded and parsed
|
|
62
|
-
*
|
|
63
|
-
* Detection priority:
|
|
64
|
-
* 1. URL (http://, https://) → download and parse
|
|
65
|
-
* 2. Existing file path → read and parse
|
|
66
|
-
* 3. Valid JSON string → parse directly
|
|
67
|
-
* 4. Simple string → treat as {name: string} for backward compatibility
|
|
68
|
-
*
|
|
69
|
-
* @param source - JSON string, file path, or URL
|
|
70
|
-
* @param options - Optional configuration
|
|
71
|
-
* @param options.name - Parameter name for error messages (e.g., "event", "config")
|
|
72
|
-
* @param options.required - Throw error if source is empty (default: false)
|
|
73
|
-
* @param options.fallback - Default value if source is empty
|
|
74
|
-
* @returns Parsed JSON object
|
|
75
|
-
* @throws Error if source is required but empty, or if loading/parsing fails
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* // Inline JSON
|
|
80
|
-
* await loadJsonFromSource('{"name":"order complete","data":{}}')
|
|
81
|
-
*
|
|
82
|
-
* // File path
|
|
83
|
-
* await loadJsonFromSource('./examples/event.json')
|
|
84
|
-
*
|
|
85
|
-
* // URL
|
|
86
|
-
* await loadJsonFromSource('https://example.com/event.json')
|
|
87
|
-
*
|
|
88
|
-
* // With options
|
|
89
|
-
* await loadJsonFromSource(input, {
|
|
90
|
-
* name: 'event',
|
|
91
|
-
* required: true,
|
|
92
|
-
* fallback: { name: 'default' }
|
|
93
|
-
* })
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
export declare function loadJsonFromSource<T = unknown>(source: string | undefined, options?: {
|
|
97
|
-
name?: string;
|
|
98
|
-
required?: boolean;
|
|
99
|
-
fallback?: T;
|
|
100
|
-
}): Promise<T>;
|
|
101
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/config/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAO1C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BlE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAmCtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,GAAG,OAAO,EAClD,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,CAAC,EAAE;IACR,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,CAAC;CACd,GACA,OAAO,CAAC,CAAC,CAAC,CAmEZ"}
|