@walkeros/cli 0.3.1
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 +45 -0
- package/README.md +285 -0
- package/dist/__tests__/bundle/bundler-integration.test.d.ts +2 -0
- package/dist/__tests__/bundle/bundler-integration.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/bundler-integration.test.js +106 -0
- package/dist/__tests__/bundle/bundler-integration.test.js.map +1 -0
- package/dist/__tests__/bundle/bundler.test.d.ts +2 -0
- package/dist/__tests__/bundle/bundler.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/bundler.test.js +281 -0
- package/dist/__tests__/bundle/bundler.test.js.map +1 -0
- package/dist/__tests__/bundle/programmatic.test.d.ts +2 -0
- package/dist/__tests__/bundle/programmatic.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/programmatic.test.js +118 -0
- package/dist/__tests__/bundle/programmatic.test.js.map +1 -0
- package/dist/__tests__/bundle/serializer.test.d.ts +2 -0
- package/dist/__tests__/bundle/serializer.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/serializer.test.js +173 -0
- package/dist/__tests__/bundle/serializer.test.js.map +1 -0
- package/dist/__tests__/bundle/template-engine.test.d.ts +2 -0
- package/dist/__tests__/bundle/template-engine.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/template-engine.test.js +107 -0
- package/dist/__tests__/bundle/template-engine.test.js.map +1 -0
- package/dist/__tests__/cli-e2e.test.d.ts +8 -0
- package/dist/__tests__/cli-e2e.test.d.ts.map +1 -0
- package/dist/__tests__/cli-e2e.test.js +144 -0
- package/dist/__tests__/cli-e2e.test.js.map +1 -0
- package/dist/__tests__/cli.test.d.ts +2 -0
- package/dist/__tests__/cli.test.d.ts.map +1 -0
- package/dist/__tests__/cli.test.js +255 -0
- package/dist/__tests__/cli.test.js.map +1 -0
- package/dist/__tests__/config-loader.test.d.ts +7 -0
- package/dist/__tests__/config-loader.test.d.ts.map +1 -0
- package/dist/__tests__/config-loader.test.js +393 -0
- package/dist/__tests__/config-loader.test.js.map +1 -0
- package/dist/__tests__/core/config.test.d.ts +2 -0
- package/dist/__tests__/core/config.test.d.ts.map +1 -0
- package/dist/__tests__/core/config.test.js +72 -0
- package/dist/__tests__/core/config.test.js.map +1 -0
- package/dist/__tests__/core/logger.test.d.ts +2 -0
- package/dist/__tests__/core/logger.test.d.ts.map +1 -0
- package/dist/__tests__/core/logger.test.js +53 -0
- package/dist/__tests__/core/logger.test.js.map +1 -0
- package/dist/__tests__/simulate/programmatic.test.d.ts +2 -0
- package/dist/__tests__/simulate/programmatic.test.d.ts.map +1 -0
- package/dist/__tests__/simulate/programmatic.test.js +51 -0
- package/dist/__tests__/simulate/programmatic.test.js.map +1 -0
- package/dist/__tests__/simulate/simulator.test.d.ts +2 -0
- package/dist/__tests__/simulate/simulator.test.d.ts.map +1 -0
- package/dist/__tests__/simulate/simulator.test.js +29 -0
- package/dist/__tests__/simulate/simulator.test.js.map +1 -0
- package/dist/commands/bundle/bundler.d.ts +14 -0
- package/dist/commands/bundle/bundler.d.ts.map +1 -0
- package/dist/commands/bundle/bundler.js +372 -0
- package/dist/commands/bundle/bundler.js.map +1 -0
- package/dist/commands/bundle/index.d.ts +51 -0
- package/dist/commands/bundle/index.d.ts.map +1 -0
- package/dist/commands/bundle/index.js +200 -0
- package/dist/commands/bundle/index.js.map +1 -0
- package/dist/commands/bundle/package-manager.d.ts +7 -0
- package/dist/commands/bundle/package-manager.d.ts.map +1 -0
- package/dist/commands/bundle/package-manager.js +170 -0
- package/dist/commands/bundle/package-manager.js.map +1 -0
- package/dist/commands/bundle/serializer.d.ts +23 -0
- package/dist/commands/bundle/serializer.d.ts.map +1 -0
- package/dist/commands/bundle/serializer.js +127 -0
- package/dist/commands/bundle/serializer.js.map +1 -0
- package/dist/commands/bundle/stats.d.ts +23 -0
- package/dist/commands/bundle/stats.d.ts.map +1 -0
- package/dist/commands/bundle/stats.js +52 -0
- package/dist/commands/bundle/stats.js.map +1 -0
- package/dist/commands/bundle/template-engine.d.ts +18 -0
- package/dist/commands/bundle/template-engine.d.ts.map +1 -0
- package/dist/commands/bundle/template-engine.js +49 -0
- package/dist/commands/bundle/template-engine.js.map +1 -0
- package/dist/commands/run/__tests__/run.integration.test.d.ts +8 -0
- package/dist/commands/run/__tests__/run.integration.test.d.ts.map +1 -0
- package/dist/commands/run/__tests__/run.integration.test.js +53 -0
- package/dist/commands/run/__tests__/run.integration.test.js.map +1 -0
- package/dist/commands/run/__tests__/validators.test.d.ts +2 -0
- package/dist/commands/run/__tests__/validators.test.d.ts.map +1 -0
- package/dist/commands/run/__tests__/validators.test.js +80 -0
- package/dist/commands/run/__tests__/validators.test.js.map +1 -0
- package/dist/commands/run/index.d.ts +39 -0
- package/dist/commands/run/index.d.ts.map +1 -0
- package/dist/commands/run/index.js +251 -0
- package/dist/commands/run/index.js.map +1 -0
- package/dist/commands/run/types.d.ts +56 -0
- package/dist/commands/run/types.d.ts.map +1 -0
- package/dist/commands/run/types.js +7 -0
- package/dist/commands/run/types.js.map +1 -0
- package/dist/commands/run/validators.d.ts +29 -0
- package/dist/commands/run/validators.d.ts.map +1 -0
- package/dist/commands/run/validators.js +54 -0
- package/dist/commands/run/validators.js.map +1 -0
- package/dist/commands/simulate/index.d.ts +47 -0
- package/dist/commands/simulate/index.d.ts.map +1 -0
- package/dist/commands/simulate/index.js +121 -0
- package/dist/commands/simulate/index.js.map +1 -0
- package/dist/commands/simulate/simulator.d.ts +18 -0
- package/dist/commands/simulate/simulator.d.ts.map +1 -0
- package/dist/commands/simulate/simulator.js +236 -0
- package/dist/commands/simulate/simulator.js.map +1 -0
- package/dist/commands/simulate/tracker.d.ts +30 -0
- package/dist/commands/simulate/tracker.d.ts.map +1 -0
- package/dist/commands/simulate/tracker.js +96 -0
- package/dist/commands/simulate/tracker.js.map +1 -0
- package/dist/commands/simulate/types.d.ts +18 -0
- package/dist/commands/simulate/types.d.ts.map +1 -0
- package/dist/commands/simulate/types.js +2 -0
- package/dist/commands/simulate/types.js.map +1 -0
- package/dist/config/defaults.d.ts +33 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +73 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +14 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +16 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +74 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +136 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/parser.d.ts +64 -0
- package/dist/config/parser.d.ts.map +1 -0
- package/dist/config/parser.js +137 -0
- package/dist/config/parser.js.map +1 -0
- package/dist/config/utils.d.ts +38 -0
- package/dist/config/utils.d.ts.map +1 -0
- package/dist/config/utils.js +66 -0
- package/dist/config/utils.js.map +1 -0
- package/dist/config/validators.d.ts +23 -0
- package/dist/config/validators.d.ts.map +1 -0
- package/dist/config/validators.js +45 -0
- package/dist/config/validators.js.map +1 -0
- package/dist/core/docker.d.ts +42 -0
- package/dist/core/docker.d.ts.map +1 -0
- package/dist/core/docker.js +114 -0
- package/dist/core/docker.js.map +1 -0
- package/dist/core/execution.d.ts +33 -0
- package/dist/core/execution.d.ts.map +1 -0
- package/dist/core/execution.js +57 -0
- package/dist/core/execution.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logger.d.ts +17 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +74 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/output.d.ts +30 -0
- package/dist/core/output.d.ts.map +1 -0
- package/dist/core/output.js +46 -0
- package/dist/core/output.js.map +1 -0
- package/dist/core/timer.d.ts +14 -0
- package/dist/core/timer.d.ts.map +1 -0
- package/dist/core/timer.js +29 -0
- package/dist/core/timer.js.map +1 -0
- package/dist/index.d.ts +614 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1940 -0
- package/dist/index.js.map +1 -0
- package/dist/types/bundle.d.ts +251 -0
- package/dist/types/bundle.d.ts.map +1 -0
- package/dist/types/bundle.js +10 -0
- package/dist/types/bundle.js.map +1 -0
- package/dist/types/global.d.ts +51 -0
- package/dist/types/global.d.ts.map +1 -0
- package/dist/types/global.js +30 -0
- package/dist/types/global.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/template.d.ts +108 -0
- package/dist/types/template.d.ts.map +1 -0
- package/dist/types/template.js +10 -0
- package/dist/types/template.js.map +1 -0
- package/package.json +59 -0
- package/templates/base.hbs +44 -0
- package/templates/server.hbs +29 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/types/bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global CLI Options
|
|
3
|
+
*
|
|
4
|
+
* Options that apply to all commands.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Global options available across all CLI commands
|
|
8
|
+
*/
|
|
9
|
+
export interface GlobalOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Execute using local Node.js environment (vs Docker container)
|
|
12
|
+
* @default false (Docker mode)
|
|
13
|
+
*/
|
|
14
|
+
local?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Show detailed execution logs
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
verbose?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Suppress all output except errors
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
silent?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Preview command without executing
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
dryRun?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Execution mode for commands
|
|
33
|
+
*/
|
|
34
|
+
export type ExecutionMode = 'docker' | 'local';
|
|
35
|
+
/**
|
|
36
|
+
* Get execution mode from global options
|
|
37
|
+
*/
|
|
38
|
+
export declare function getExecutionMode(options: GlobalOptions): ExecutionMode;
|
|
39
|
+
/**
|
|
40
|
+
* Check if output should be shown based on global options
|
|
41
|
+
*/
|
|
42
|
+
export declare function shouldShowOutput(options: GlobalOptions): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Check if verbose output should be shown
|
|
45
|
+
*/
|
|
46
|
+
export declare function isVerbose(options: GlobalOptions): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Check if this is a dry run
|
|
49
|
+
*/
|
|
50
|
+
export declare function isDryRun(options: GlobalOptions): boolean;
|
|
51
|
+
//# sourceMappingURL=global.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/types/global.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/C;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAEtE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAEhE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAEzD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAExD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global CLI Options
|
|
3
|
+
*
|
|
4
|
+
* Options that apply to all commands.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get execution mode from global options
|
|
8
|
+
*/
|
|
9
|
+
export function getExecutionMode(options) {
|
|
10
|
+
return options.local ? 'local' : 'docker';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Check if output should be shown based on global options
|
|
14
|
+
*/
|
|
15
|
+
export function shouldShowOutput(options) {
|
|
16
|
+
return !options.silent;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Check if verbose output should be shown
|
|
20
|
+
*/
|
|
21
|
+
export function isVerbose(options) {
|
|
22
|
+
return options.verbose === true;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Check if this is a dry run
|
|
26
|
+
*/
|
|
27
|
+
export function isDryRun(options) {
|
|
28
|
+
return options.dryRun === true;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/types/global.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoCH;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAsB;IACrD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAsB;IACrD,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,OAAsB;IAC9C,OAAO,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAsB;IAC7C,OAAO,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for template processing and serialization.
|
|
5
|
+
* Used by the template engine and serializer.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Source or Destination configuration item for templates.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* This type is used in template processing where config objects
|
|
14
|
+
* are serialized to JavaScript code.
|
|
15
|
+
*/
|
|
16
|
+
export interface SourceDestinationItem {
|
|
17
|
+
/**
|
|
18
|
+
* JavaScript code reference (variable name or expression)
|
|
19
|
+
*/
|
|
20
|
+
code: string;
|
|
21
|
+
/**
|
|
22
|
+
* Configuration object for the source/destination
|
|
23
|
+
*/
|
|
24
|
+
config?: unknown;
|
|
25
|
+
/**
|
|
26
|
+
* Environment-specific variables
|
|
27
|
+
*/
|
|
28
|
+
env?: unknown;
|
|
29
|
+
/**
|
|
30
|
+
* Allow additional properties for extensibility
|
|
31
|
+
*/
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Template variables that can be used in Handlebars templates.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* These variables are available in template files for customization.
|
|
39
|
+
*/
|
|
40
|
+
export interface TemplateVariables {
|
|
41
|
+
/**
|
|
42
|
+
* Serialized sources configuration
|
|
43
|
+
*/
|
|
44
|
+
sources: string;
|
|
45
|
+
/**
|
|
46
|
+
* Serialized destinations configuration
|
|
47
|
+
*/
|
|
48
|
+
destinations: string;
|
|
49
|
+
/**
|
|
50
|
+
* Serialized collector configuration
|
|
51
|
+
*/
|
|
52
|
+
collector: string;
|
|
53
|
+
/**
|
|
54
|
+
* User-provided code to be inserted
|
|
55
|
+
*/
|
|
56
|
+
CODE: string;
|
|
57
|
+
/**
|
|
58
|
+
* Build configuration (optional)
|
|
59
|
+
*/
|
|
60
|
+
build?: Record<string, unknown>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Processed template variables after serialization.
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* Internal type used by the serializer to represent processed configs.
|
|
67
|
+
*/
|
|
68
|
+
export interface ProcessedTemplateVariables {
|
|
69
|
+
/**
|
|
70
|
+
* Processed sources with serialized configs
|
|
71
|
+
*/
|
|
72
|
+
sources?: Record<string, TemplateSource>;
|
|
73
|
+
/**
|
|
74
|
+
* Processed destinations with serialized configs
|
|
75
|
+
*/
|
|
76
|
+
destinations?: Record<string, TemplateDestination>;
|
|
77
|
+
/**
|
|
78
|
+
* Processed collector configuration
|
|
79
|
+
*/
|
|
80
|
+
collector?: Record<string, unknown> | string;
|
|
81
|
+
/**
|
|
82
|
+
* Allow additional properties
|
|
83
|
+
*/
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Template source after processing.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export interface TemplateSource {
|
|
92
|
+
code: string;
|
|
93
|
+
config?: unknown | string;
|
|
94
|
+
env?: unknown;
|
|
95
|
+
[key: string]: unknown;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Template destination after processing.
|
|
99
|
+
*
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
export interface TemplateDestination {
|
|
103
|
+
code: string;
|
|
104
|
+
config?: unknown | string;
|
|
105
|
+
env?: unknown;
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/types/template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAEzC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAEnD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAE7C;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/types/template.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@walkeros/cli",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "walkerOS CLI - Bundle and deploy walkerOS components",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"walkeros": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist/**",
|
|
20
|
+
"templates/**",
|
|
21
|
+
"README.md",
|
|
22
|
+
"CHANGELOG.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"dev": "tsx src/index.ts",
|
|
27
|
+
"start": "node dist/index.js",
|
|
28
|
+
"test": "jest --colors",
|
|
29
|
+
"lint": "tsc && eslint \"src/**/*.ts*\"",
|
|
30
|
+
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist && rm -rf coverage && rm -rf .temp",
|
|
31
|
+
"docker:build": "bash scripts/build-docker.sh",
|
|
32
|
+
"docker:test": "docker run --rm walkeros/cli:latest --version"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@walkeros/core": "^0.3.1",
|
|
36
|
+
"@walkeros/docker": "*",
|
|
37
|
+
"chalk": "^5.3.0",
|
|
38
|
+
"commander": "^11.0.0",
|
|
39
|
+
"esbuild": "^0.19.0",
|
|
40
|
+
"fs-extra": "^11.0.0",
|
|
41
|
+
"handlebars": "^4.7.8",
|
|
42
|
+
"jsdom": "^22.1.0",
|
|
43
|
+
"pacote": "^17.0.0",
|
|
44
|
+
"zod": "^3.23.8"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/fs-extra": "^11.0.0",
|
|
48
|
+
"@types/jsdom": "^21.1.0",
|
|
49
|
+
"@types/pacote": "^11.1.5",
|
|
50
|
+
"@walkeros/config": "*",
|
|
51
|
+
"tsx": "^4.0.0"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"url": "git+https://github.com/elbwalker/walkerOS.git",
|
|
55
|
+
"directory": "packages/cli"
|
|
56
|
+
},
|
|
57
|
+
"author": "elbwalker <hello@elbwalker.com>",
|
|
58
|
+
"homepage": "https://github.com/elbwalker/walkerOS#readme"
|
|
59
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export default async function(context = {}) {
|
|
2
|
+
const { tracker } = context;
|
|
3
|
+
const __simulationTracker = tracker;
|
|
4
|
+
|
|
5
|
+
// Check if we're in a browser environment
|
|
6
|
+
const window = typeof globalThis.window !== 'undefined' ? globalThis.window : undefined;
|
|
7
|
+
const document = typeof globalThis.document !== 'undefined' ? globalThis.document : undefined;
|
|
8
|
+
|
|
9
|
+
const config = {
|
|
10
|
+
sources: {
|
|
11
|
+
{{#each sources}}
|
|
12
|
+
{{@key}}: {
|
|
13
|
+
code: {{{code}}},
|
|
14
|
+
config: {{{config}}}{{#if env}},
|
|
15
|
+
env: {
|
|
16
|
+
window,
|
|
17
|
+
document,
|
|
18
|
+
...{{{env}}}
|
|
19
|
+
}{{/if}}
|
|
20
|
+
},
|
|
21
|
+
{{/each}}
|
|
22
|
+
},
|
|
23
|
+
destinations: {
|
|
24
|
+
{{#each destinations}}
|
|
25
|
+
{{@key}}: {
|
|
26
|
+
code: {{{code}}},
|
|
27
|
+
config: {{{config}}}{{#if env}},
|
|
28
|
+
env: {
|
|
29
|
+
window,
|
|
30
|
+
document,
|
|
31
|
+
...{{{env}}}
|
|
32
|
+
}{{/if}}
|
|
33
|
+
},
|
|
34
|
+
{{/each}}
|
|
35
|
+
}{{#if collector}},
|
|
36
|
+
...{{{collector}}}{{/if}}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
{{{CODE}}}
|
|
40
|
+
|
|
41
|
+
const result = await startFlow(config);
|
|
42
|
+
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
(async function() {
|
|
2
|
+
const config = {
|
|
3
|
+
sources: {
|
|
4
|
+
{{#each sources}}
|
|
5
|
+
{{@key}}: {
|
|
6
|
+
code: {{{code}}},
|
|
7
|
+
config: {{{config}}}{{#if env}},
|
|
8
|
+
env: {{{env}}}{{/if}}
|
|
9
|
+
},
|
|
10
|
+
{{/each}}
|
|
11
|
+
},
|
|
12
|
+
destinations: {
|
|
13
|
+
{{#each destinations}}
|
|
14
|
+
{{@key}}: {
|
|
15
|
+
code: {{{code}}},
|
|
16
|
+
config: {{{config}}}{{#if env}},
|
|
17
|
+
env: {{{env}}}{{/if}}
|
|
18
|
+
},
|
|
19
|
+
{{/each}}
|
|
20
|
+
}{{#if collector}},
|
|
21
|
+
...{{{collector}}}{{/if}}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
{{{CODE}}}
|
|
25
|
+
|
|
26
|
+
const result = await startFlow(config);
|
|
27
|
+
|
|
28
|
+
return result;
|
|
29
|
+
})();
|