@walkeros/cli 0.7.0-next.0 → 1.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 +8 -151
- package/README.md +123 -37
- package/dist/examples/flow-order-complete.json +0 -1
- package/dist/examples/flow-simple.json +0 -3
- package/dist/examples/flow.json +0 -1
- package/dist/index.d.ts +23 -13
- package/dist/index.js +882 -846
- package/dist/index.js.map +1 -1
- package/dist/runtime/main.d.ts +2 -0
- package/dist/runtime/main.js +271 -0
- package/dist/runtime/main.js.map +1 -0
- package/examples/flow-order-complete.json +0 -1
- package/examples/flow-simple.json +0 -3
- package/examples/flow.json +0 -1
- package/package.json +10 -7
- 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 -353
- 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 -130
- 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 -180
- 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 -72
- package/dist/__tests__/core/config.test.js.map +0 -1
- package/dist/__tests__/core/docker-url.test.d.ts +0 -2
- package/dist/__tests__/core/docker-url.test.d.ts.map +0 -1
- package/dist/__tests__/core/docker-url.test.js +0 -54
- package/dist/__tests__/core/docker-url.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 -583
- package/dist/commands/bundle/bundler.js.map +0 -1
- package/dist/commands/bundle/index.d.ts +0 -57
- package/dist/commands/bundle/index.d.ts.map +0 -1
- package/dist/commands/bundle/index.js +0 -200
- 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 -197
- 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 -3
- package/dist/commands/cache.d.ts.map +0 -1
- package/dist/commands/cache.js +0 -44
- 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 -257
- package/dist/commands/push/index.js.map +0 -1
- package/dist/commands/push/types.d.ts +0 -21
- 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 -8
- package/dist/commands/run/__tests__/run.integration.test.d.ts.map +0 -1
- package/dist/commands/run/__tests__/run.integration.test.js +0 -52
- 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 -39
- package/dist/commands/run/index.d.ts.map +0 -1
- package/dist/commands/run/index.js +0 -191
- package/dist/commands/run/index.js.map +0 -1
- package/dist/commands/run/types.d.ts +0 -60
- 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 -46
- 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 -116
- 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 -162
- 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 -18
- 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 -70
- 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 -155
- package/dist/config/loader.js.map +0 -1
- package/dist/config/utils.d.ts +0 -114
- package/dist/config/utils.d.ts.map +0 -1
- package/dist/config/utils.js +0 -257
- 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 -43
- 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/docker.d.ts +0 -102
- package/dist/core/docker.d.ts.map +0 -1
- package/dist/core/docker.js +0 -278
- package/dist/core/docker.js.map +0 -1
- package/dist/core/execution.d.ts +0 -34
- package/dist/core/execution.d.ts.map +0 -1
- package/dist/core/execution.js +0 -64
- package/dist/core/execution.js.map +0 -1
- package/dist/core/index.d.ts +0 -10
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -10
- 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 -28
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/logger.js +0 -88
- 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/temp-manager.d.ts +0 -51
- package/dist/core/temp-manager.d.ts.map +0 -1
- package/dist/core/temp-manager.js +0 -73
- package/dist/core/temp-manager.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/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/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 -51
- package/dist/types/global.d.ts.map +0 -1
- package/dist/types/global.js +0 -30
- 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,30 +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 interface ApiCall {
|
|
8
|
-
type: 'call';
|
|
9
|
-
path: string;
|
|
10
|
-
args: unknown[];
|
|
11
|
-
timestamp: number;
|
|
12
|
-
}
|
|
13
|
-
export declare class CallTracker {
|
|
14
|
-
private calls;
|
|
15
|
-
/**
|
|
16
|
-
* Wrap a function to track its calls
|
|
17
|
-
*/
|
|
18
|
-
wrapFunction(name: string, fn?: (...args: unknown[]) => unknown): (...args: unknown[]) => unknown;
|
|
19
|
-
/**
|
|
20
|
-
* Wrap an environment object, tracking specified paths
|
|
21
|
-
*
|
|
22
|
-
* @param env - Environment object (from destination's examples/env.ts)
|
|
23
|
-
* @param paths - Paths to track (e.g., ['gtag:window.gtag', 'gtag:window.dataLayer.push'])
|
|
24
|
-
*/
|
|
25
|
-
wrapEnv<T extends Record<string, unknown>>(env: T, paths: string[]): T;
|
|
26
|
-
private logCall;
|
|
27
|
-
getCalls(): Record<string, ApiCall[]>;
|
|
28
|
-
reset(): void;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=tracker.d.ts.map
|
|
@@ -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":"AAAA;;;;;GAKG;AASH,MAAM,OA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ACJ,CAAC;QAED,OAAO,OAAY,CAAC;IACtB,CAAC;IAEO,OAAO,CAAC,QAAgB,EAAE,IAAe;QAC/C,iDAAiD;QACjD,MAAM,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEpC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAE,CAAC,IAAI,CAAC;YAC5B,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,OAAO;YACb,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Elb } from '@walkeros/core';
|
|
2
|
-
import type { GlobalOptions } from '../../types/index.js';
|
|
3
|
-
import type { ApiCall } from './tracker.js';
|
|
4
|
-
export interface SimulateCommandOptions extends GlobalOptions {
|
|
5
|
-
config: string;
|
|
6
|
-
event?: string;
|
|
7
|
-
json?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface SimulationResult {
|
|
10
|
-
success: boolean;
|
|
11
|
-
error?: string;
|
|
12
|
-
collector?: unknown;
|
|
13
|
-
elbResult?: Elb.PushResult;
|
|
14
|
-
logs?: unknown[];
|
|
15
|
-
usage?: Record<string, ApiCall[]>;
|
|
16
|
-
duration?: number;
|
|
17
|
-
}
|
|
18
|
-
//# 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,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,sBAAuB,SAAQ,aAAa;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;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,CAUxE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,UAAU,CASzE,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,70 +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
|
-
tempDir: '.tmp',
|
|
21
|
-
windowCollector: 'collector',
|
|
22
|
-
windowElb: 'elb',
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Build defaults for server platform (Node.js bundles).
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* These settings produce Node.js-compatible ESM bundles.
|
|
29
|
-
*/
|
|
30
|
-
export const SERVER_BUILD_DEFAULTS = {
|
|
31
|
-
format: 'esm',
|
|
32
|
-
platform: 'node',
|
|
33
|
-
target: 'node20',
|
|
34
|
-
minify: true,
|
|
35
|
-
sourcemap: false,
|
|
36
|
-
cache: true,
|
|
37
|
-
tempDir: '.tmp',
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Default output paths by platform.
|
|
41
|
-
*/
|
|
42
|
-
export const DEFAULT_OUTPUT_PATHS = {
|
|
43
|
-
web: './dist/walker.js',
|
|
44
|
-
server: './dist/bundle.mjs',
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Get build defaults for a platform.
|
|
48
|
-
*
|
|
49
|
-
* @param platform - Target platform ('web' or 'server')
|
|
50
|
-
* @returns Platform-specific build defaults
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```typescript
|
|
54
|
-
* const defaults = getBuildDefaults('web');
|
|
55
|
-
* // { format: 'iife', platform: 'browser', ... }
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export function getBuildDefaults(platform) {
|
|
59
|
-
return platform === 'web' ? WEB_BUILD_DEFAULTS : SERVER_BUILD_DEFAULTS;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get default output path for a platform.
|
|
63
|
-
*
|
|
64
|
-
* @param platform - Target platform ('web' or 'server')
|
|
65
|
-
* @returns Default output file path
|
|
66
|
-
*/
|
|
67
|
-
export function getDefaultOutput(platform) {
|
|
68
|
-
return DEFAULT_OUTPUT_PATHS[platform];
|
|
69
|
-
}
|
|
70
|
-
//# 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,OAAO,EAAE,MAAM;IACf,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;IACX,OAAO,EAAE,MAAM;CAChB,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, getTempDir, } 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,UAAU,GACX,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, getTempDir, } 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,UAAU,GACX,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;AAWvD;;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,CAyElB;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,155 +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
|
-
/** Default folder for includes if it exists */
|
|
13
|
-
const DEFAULT_INCLUDE_FOLDER = './shared';
|
|
14
|
-
/**
|
|
15
|
-
* Load and parse bundle configuration.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* Uses Flow.Setup from @walkeros/core as the only config format.
|
|
19
|
-
* - Validates config structure
|
|
20
|
-
* - Uses core getFlowConfig() for variable/definition resolution
|
|
21
|
-
* - Determines platform from resolved config
|
|
22
|
-
* - Applies static build defaults based on platform
|
|
23
|
-
*
|
|
24
|
-
* @param rawConfig - Raw configuration object from JSON file
|
|
25
|
-
* @param options - Loading options
|
|
26
|
-
* @returns Parsed configuration with flow and build separated
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```typescript
|
|
30
|
-
* const config = loadBundleConfig(rawConfig, {
|
|
31
|
-
* configPath: './walkeros.config.json',
|
|
32
|
-
* flowName: 'production',
|
|
33
|
-
* });
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export function loadBundleConfig(rawConfig, options) {
|
|
37
|
-
// Validate as Flow.Setup
|
|
38
|
-
const setup = validateFlowSetup(rawConfig);
|
|
39
|
-
const availableFlows = getFlowNames(setup);
|
|
40
|
-
// Determine which flow to use
|
|
41
|
-
const flowName = resolveFlow(setup, options.flowName, availableFlows);
|
|
42
|
-
// Use core getFlowConfig() for resolution (variables, $refs, cascading)
|
|
43
|
-
const flowConfig = getFlowConfig(setup, flowName);
|
|
44
|
-
// Detect platform from resolved config
|
|
45
|
-
const platform = getPlatform(flowConfig);
|
|
46
|
-
if (!platform) {
|
|
47
|
-
throw new Error(`Invalid configuration: flow "${flowName}" must have a "web" or "server" key.`);
|
|
48
|
-
}
|
|
49
|
-
// Get static build defaults based on platform
|
|
50
|
-
const buildDefaults = getBuildDefaults(platform);
|
|
51
|
-
// Extract packages from flowConfig (if present)
|
|
52
|
-
const packages = flowConfig.packages || {};
|
|
53
|
-
// Resolve output path relative to config directory
|
|
54
|
-
let output = getDefaultOutput(platform);
|
|
55
|
-
if (options.buildOverrides?.output) {
|
|
56
|
-
output = options.buildOverrides.output;
|
|
57
|
-
}
|
|
58
|
-
// Get config directory for relative path resolution
|
|
59
|
-
const configDir = path.dirname(options.configPath);
|
|
60
|
-
// Make output path absolute relative to config file
|
|
61
|
-
if (!path.isAbsolute(output)) {
|
|
62
|
-
output = path.resolve(configDir, output);
|
|
63
|
-
}
|
|
64
|
-
// Get includes from config or use default if ./shared exists
|
|
65
|
-
let includes = setup.include;
|
|
66
|
-
if (!includes) {
|
|
67
|
-
const defaultIncludePath = path.resolve(configDir, DEFAULT_INCLUDE_FOLDER);
|
|
68
|
-
if (fs.pathExistsSync(defaultIncludePath)) {
|
|
69
|
-
includes = [DEFAULT_INCLUDE_FOLDER];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
// Merge build options: defaults + CLI overrides
|
|
73
|
-
const buildOptions = {
|
|
74
|
-
...buildDefaults,
|
|
75
|
-
packages,
|
|
76
|
-
output,
|
|
77
|
-
include: includes,
|
|
78
|
-
configDir,
|
|
79
|
-
...options.buildOverrides,
|
|
80
|
-
};
|
|
81
|
-
// Log flow selection
|
|
82
|
-
const isMultiFlow = availableFlows.length > 1;
|
|
83
|
-
if (isMultiFlow && options.logger) {
|
|
84
|
-
options.logger.info(`📦 Using flow: ${flowName} (${availableFlows.length} total)`);
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
flowConfig,
|
|
88
|
-
buildOptions,
|
|
89
|
-
flowName,
|
|
90
|
-
isMultiFlow,
|
|
91
|
-
availableFlows,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Resolve which flow to use.
|
|
96
|
-
*
|
|
97
|
-
* @param setup - Flow.Setup configuration
|
|
98
|
-
* @param requestedFlow - Flow name from CLI (optional)
|
|
99
|
-
* @param available - Available flow names
|
|
100
|
-
* @returns Flow name to use
|
|
101
|
-
* @throws Error if flow selection is invalid
|
|
102
|
-
*/
|
|
103
|
-
function resolveFlow(setup, requestedFlow, available) {
|
|
104
|
-
// If only one flow, use it automatically
|
|
105
|
-
if (available.length === 1) {
|
|
106
|
-
return available[0];
|
|
107
|
-
}
|
|
108
|
-
// Multiple flows require explicit selection
|
|
109
|
-
if (!requestedFlow) {
|
|
110
|
-
throw new Error(`Multiple flows found. Please specify a flow using --flow flag.\n` +
|
|
111
|
-
`Available flows: ${available.join(', ')}`);
|
|
112
|
-
}
|
|
113
|
-
// Validate the requested flow exists
|
|
114
|
-
if (!available.includes(requestedFlow)) {
|
|
115
|
-
throw new Error(`Flow "${requestedFlow}" not found in configuration.\n` +
|
|
116
|
-
`Available flows: ${available.join(', ')}`);
|
|
117
|
-
}
|
|
118
|
-
return requestedFlow;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Load all flows from a configuration.
|
|
122
|
-
*
|
|
123
|
-
* @remarks
|
|
124
|
-
* Used by the --all flag to build all flows.
|
|
125
|
-
*
|
|
126
|
-
* @param rawConfig - Raw configuration object
|
|
127
|
-
* @param options - Loading options (without flowName)
|
|
128
|
-
* @returns Array of loaded configurations for all flows
|
|
129
|
-
*/
|
|
130
|
-
export function loadAllFlows(rawConfig, options) {
|
|
131
|
-
// Validate as Flow.Setup
|
|
132
|
-
const setup = validateFlowSetup(rawConfig);
|
|
133
|
-
const flows = getFlowNames(setup);
|
|
134
|
-
if (options.logger) {
|
|
135
|
-
options.logger.info(`📦 Loading all ${flows.length} flows: ${flows.join(', ')}`);
|
|
136
|
-
}
|
|
137
|
-
// Load each flow
|
|
138
|
-
return flows.map((name) => loadBundleConfig(rawConfig, {
|
|
139
|
-
...options,
|
|
140
|
-
flowName: name,
|
|
141
|
-
}));
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Get list of available flows from configuration.
|
|
145
|
-
*
|
|
146
|
-
* @param rawConfig - Raw configuration object
|
|
147
|
-
* @returns Array of flow names
|
|
148
|
-
*/
|
|
149
|
-
export function getAvailableFlows(rawConfig) {
|
|
150
|
-
if (isFlowSetup(rawConfig)) {
|
|
151
|
-
return getFlowNames(rawConfig);
|
|
152
|
-
}
|
|
153
|
-
return [];
|
|
154
|
-
}
|
|
155
|
-
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +0,0 @@
|
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