@ts-ioc-container/bundler 3.1.0 → 4.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/AGENTS.md +45 -48
- package/README.md +177 -145
- package/cjm/app.js +2 -2
- package/cjm/cli/Application.js +4 -5
- package/cjm/cli/options.js +4 -2
- package/cjm/cli/usage.js +11 -8
- package/cjm/domain/CliIo.js +7 -1
- package/cjm/exceptions/DomainException.js +7 -7
- package/cjm/features/build/BuildConfig.js +108 -71
- package/cjm/features/build/BuildController.js +36 -46
- package/cjm/features/build/domain/ImportPaths.js +31 -20
- package/cjm/features/build/domain/emit.js +2 -2
- package/cjm/features/build/domain/scan.js +20 -4
- package/cjm/features/build/domain/tokenCollisions.js +1 -1
- package/cjm/features/build/domain/tsconfig.js +10 -35
- package/cjm/features/build/services/BundleBuilder.js +36 -29
- package/cjm/features/build/services/TicConfigService.js +10 -31
- package/cjm/index.js +9 -10
- package/cjm/schema/ticConfigSchema.js +5 -1
- package/package.json +2 -2
- package/tic.schema.json +117 -84
- package/tpl/index.cjs +15 -15
- package/typings/app.d.ts +7 -6
- package/typings/cli/Application.d.ts.map +1 -1
- package/typings/cli/options.d.ts +7 -1
- package/typings/cli/options.d.ts.map +1 -1
- package/typings/cli/usage.d.ts.map +1 -1
- package/typings/domain/CliIo.d.ts +2 -0
- package/typings/domain/CliIo.d.ts.map +1 -1
- package/typings/domain/GlobalConfig.d.ts +1 -1
- package/typings/domain/GlobalConfig.d.ts.map +1 -1
- package/typings/exceptions/DomainException.d.ts +4 -4
- package/typings/exceptions/DomainException.d.ts.map +1 -1
- package/typings/features/build/BuildConfig.d.ts +107 -103
- package/typings/features/build/BuildConfig.d.ts.map +1 -1
- package/typings/features/build/BuildController.d.ts +23 -17
- package/typings/features/build/BuildController.d.ts.map +1 -1
- package/typings/features/build/domain/ImportPaths.d.ts +16 -14
- package/typings/features/build/domain/ImportPaths.d.ts.map +1 -1
- package/typings/features/build/domain/emit.d.ts +4 -4
- package/typings/features/build/domain/emit.d.ts.map +1 -1
- package/typings/features/build/domain/scan.d.ts +2 -0
- package/typings/features/build/domain/scan.d.ts.map +1 -1
- package/typings/features/build/domain/tsconfig.d.ts +9 -16
- package/typings/features/build/domain/tsconfig.d.ts.map +1 -1
- package/typings/features/build/services/BundleBuilder.d.ts +25 -29
- package/typings/features/build/services/BundleBuilder.d.ts.map +1 -1
- package/typings/features/build/services/TicConfigService.d.ts +11 -15
- package/typings/features/build/services/TicConfigService.d.ts.map +1 -1
- package/typings/index.d.ts +6 -7
- package/typings/schema/ticConfigSchema.d.ts.map +1 -1
- package/cjm/features/build/domain/configFiles.js +0 -35
- package/typings/features/build/domain/configFiles.d.ts +0 -13
- package/typings/features/build/domain/configFiles.d.ts.map +0 -1
package/tpl/index.cjs
CHANGED
|
@@ -10,10 +10,10 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
return "import "
|
|
13
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"defaultName") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":
|
|
14
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"named") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":
|
|
13
|
+
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"defaultName") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":79}}})) != null ? stack1 : "")
|
|
14
|
+
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"named") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":79},"end":{"line":5,"column":131}}})) != null ? stack1 : "")
|
|
15
15
|
+ " from '"
|
|
16
|
-
+ ((stack1 = ((helper = (helper = lookupProperty(helpers,"specifier") || (depth0 != null ? lookupProperty(depth0,"specifier") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"specifier","hash":{},"data":data,"loc":{"start":{"line":
|
|
16
|
+
+ ((stack1 = ((helper = (helper = lookupProperty(helpers,"specifier") || (depth0 != null ? lookupProperty(depth0,"specifier") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"specifier","hash":{},"data":data,"loc":{"start":{"line":5,"column":138},"end":{"line":5,"column":153}}}) : helper))) != null ? stack1 : "")
|
|
17
17
|
+ "';\n";
|
|
18
18
|
},"2":function(container,depth0,helpers,partials,data) {
|
|
19
19
|
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
@@ -23,8 +23,8 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
23
23
|
return undefined
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
return ((stack1 = ((helper = (helper = lookupProperty(helpers,"defaultName") || (depth0 != null ? lookupProperty(depth0,"defaultName") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"defaultName","hash":{},"data":data,"loc":{"start":{"line":
|
|
27
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"named") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":
|
|
26
|
+
return ((stack1 = ((helper = (helper = lookupProperty(helpers,"defaultName") || (depth0 != null ? lookupProperty(depth0,"defaultName") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"defaultName","hash":{},"data":data,"loc":{"start":{"line":5,"column":26},"end":{"line":5,"column":43}}}) : helper))) != null ? stack1 : "")
|
|
27
|
+
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"named") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":43},"end":{"line":5,"column":72}}})) != null ? stack1 : "");
|
|
28
28
|
},"3":function(container,depth0,helpers,partials,data) {
|
|
29
29
|
return ", ";
|
|
30
30
|
},"4":function(container,depth0,helpers,partials,data) {
|
|
@@ -36,7 +36,7 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
return "{ "
|
|
39
|
-
+ ((stack1 = (lookupProperty(helpers,"join")||(depth0 && lookupProperty(depth0,"join"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"named") : depth0),", ",{"name":"join","hash":{},"data":data,"loc":{"start":{"line":
|
|
39
|
+
+ ((stack1 = (lookupProperty(helpers,"join")||(depth0 && lookupProperty(depth0,"join"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"named") : depth0),", ",{"name":"join","hash":{},"data":data,"loc":{"start":{"line":5,"column":101},"end":{"line":5,"column":122}}})) != null ? stack1 : "")
|
|
40
40
|
+ " }";
|
|
41
41
|
},"5":function(container,depth0,helpers,partials,data) {
|
|
42
42
|
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
@@ -47,7 +47,7 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
return "export const registrations: IRegistration[] = [\n"
|
|
50
|
-
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"registrations") : depth0),{"name":"each","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":
|
|
50
|
+
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"registrations") : depth0),{"name":"each","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":0},"end":{"line":12,"column":9}}})) != null ? stack1 : "")
|
|
51
51
|
+ "];\n";
|
|
52
52
|
},"6":function(container,depth0,helpers,partials,data) {
|
|
53
53
|
var stack1;
|
|
@@ -58,22 +58,22 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
58
58
|
},"7":function(container,depth0,helpers,partials,data) {
|
|
59
59
|
return "export const registrations: IRegistration[] = [];\n";
|
|
60
60
|
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
|
|
61
|
-
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing,
|
|
61
|
+
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
62
62
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
63
63
|
return parent[propertyName];
|
|
64
64
|
}
|
|
65
65
|
return undefined
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
return "// Generated by `tic build
|
|
69
|
-
+ ((stack1 = ((
|
|
70
|
-
+ "
|
|
71
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"registrations") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(0, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":
|
|
68
|
+
return "// Generated by `tic build`. Do not edit by hand.\n// Paths: "
|
|
69
|
+
+ ((stack1 = (lookupProperty(helpers,"join")||(depth0 && lookupProperty(depth0,"join"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"paths") : depth0),", ",{"name":"join","hash":{},"data":data,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":31}}})) != null ? stack1 : "")
|
|
70
|
+
+ "\nimport { type IContainer, type IContainerModule, type IRegistration"
|
|
71
|
+
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"registrations") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(0, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":67},"end":{"line":3,"column":116}}})) != null ? stack1 : "")
|
|
72
72
|
+ " } from 'ts-ioc-container';\n"
|
|
73
|
-
+ ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"imports") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":
|
|
73
|
+
+ ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"imports") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":0},"end":{"line":6,"column":9}}})) != null ? stack1 : "")
|
|
74
74
|
+ "\n"
|
|
75
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"registrations") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data,"loc":{"start":{"line":
|
|
75
|
+
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"registrations") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data,"loc":{"start":{"line":8,"column":0},"end":{"line":16,"column":7}}})) != null ? stack1 : "")
|
|
76
76
|
+ "\nexport class "
|
|
77
|
-
+ ((stack1 = ((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper ===
|
|
77
|
+
+ ((stack1 = ((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":18,"column":13},"end":{"line":18,"column":23}}}) : helper))) != null ? stack1 : "")
|
|
78
78
|
+ " implements IContainerModule {\n applyTo(container: IContainer): void {\n for (const registration of registrations) container.addRegistration(registration);\n }\n}\n";
|
|
79
79
|
},"useData":true});
|
package/typings/app.d.ts
CHANGED
|
@@ -8,16 +8,17 @@ export declare function createContainer(io?: CliIo): IContainer;
|
|
|
8
8
|
/** Runs the `tic` CLI and returns its exit code; output goes through `io`. */
|
|
9
9
|
export declare function run(argv: string[], io?: CliIo): number;
|
|
10
10
|
/**
|
|
11
|
-
* Generates the bundle a config describes —
|
|
12
|
-
*
|
|
11
|
+
* Generates the bundle a config file describes — `tic build` as a function — and returns
|
|
12
|
+
* it; nothing is written.
|
|
13
13
|
*
|
|
14
|
-
* @throws {TicConfigError} when the config or the
|
|
14
|
+
* @throws {TicConfigError} when the config file is missing or unreadable, the config or its tsconfig is invalid, the bundle has no name, or no tsconfig paths alias covers a selected class's file.
|
|
15
|
+
* @throws {NamespaceNotFoundError} when a path is neither a folder nor a tsconfig paths alias of one.
|
|
15
16
|
*/
|
|
16
|
-
export declare function build({ cwd, ...request }
|
|
17
|
+
export declare function build({ cwd, ...request }: BuildOptions): BuildResult;
|
|
17
18
|
/**
|
|
18
|
-
* Reads and validates a
|
|
19
|
+
* Reads and validates a config file: JSON for `.json`, YAML for `.yaml` / `.yml`.
|
|
19
20
|
*
|
|
20
|
-
* @throws {TicConfigError} when the file is missing, cannot be parsed, or does not match the config shape.
|
|
21
|
+
* @throws {TicConfigError} when the file is missing, has another extension, cannot be parsed, or does not match the config shape.
|
|
21
22
|
*/
|
|
22
23
|
export declare function loadConfig(file: string): ResolvedConfig;
|
|
23
24
|
//# sourceMappingURL=app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../lib/cli/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,UAAU,EAAU,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../lib/cli/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,UAAU,EAAU,MAAM,kBAAkB,CAAC;AA+BpG;;;;;GAKG;AACH,qBAAa,WAAW;IAMpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAN/B,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,UAAU,GAAG,WAAW;IAIpD,OAAO;IAKP,mFAAmF;IACnF,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM;CAsB/B"}
|
package/typings/cli/options.d.ts
CHANGED
|
@@ -9,9 +9,15 @@ export declare const commandArgs: ({ args }: InjectOptions) => string[];
|
|
|
9
9
|
* from the first flag onwards belongs to the action — what precedes it is the
|
|
10
10
|
* command and the action name.
|
|
11
11
|
*
|
|
12
|
+
* With `positionals`, the default action of a command takes arguments too: everything
|
|
13
|
+
* after the command is parsed, and the words that are not flags or their values come
|
|
14
|
+
* back as `positionals` (`tic build app.bundle.json`).
|
|
15
|
+
*
|
|
12
16
|
* @throws {UsageError} when a flag is unknown or a flag that takes a value has none.
|
|
13
17
|
*/
|
|
14
|
-
export declare const parseOptions: (options: OptionsConfig
|
|
18
|
+
export declare const parseOptions: (options: OptionsConfig, { positionals }?: {
|
|
19
|
+
positionals?: boolean;
|
|
20
|
+
}) => (argv: string[]) => Record<string, unknown>;
|
|
15
21
|
/**
|
|
16
22
|
* Mapper that validates a loosely-typed value — parsed options in practice —
|
|
17
23
|
* against a schema and narrows it to the schema's output type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../lib/cli/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AAGtC,KAAK,aAAa,GAAG,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;AAE7D,4FAA4F;AAC5F,eAAO,MAAM,WAAW,GAAI,UAAe,aAAa,KAAG,MAAM,EAAsB,CAAC;AAExF
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../lib/cli/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AAGtC,KAAK,aAAa,GAAG,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;AAE7D,4FAA4F;AAC5F,eAAO,MAAM,WAAW,GAAI,UAAe,aAAa,KAAG,MAAM,EAAsB,CAAC;AAExF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GACtB,SAAS,aAAa,EAAE,kBAAyB;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,MAC/E,MAAM,MAAM,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CASvC,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAClB,CAAC,SAAS,OAAO,EAAE,QAAQ,CAAC,MAC5B,OAAO,OAAO,KAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAI3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../lib/cli/usage.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../lib/cli/usage.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,QAkBN,CAAC"}
|
|
@@ -4,6 +4,8 @@ export interface CliIo {
|
|
|
4
4
|
cwd: string;
|
|
5
5
|
stdout: (line: string) => void;
|
|
6
6
|
stderr: (line: string) => void;
|
|
7
|
+
/** All of standard input, or `undefined` when nothing is piped in (a terminal, or no stdin at all). */
|
|
8
|
+
stdin?: () => string | undefined;
|
|
7
9
|
}
|
|
8
10
|
export declare const CliIoKey: SingleToken<CliIo>;
|
|
9
11
|
export declare const processIo: () => CliIo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CliIo.d.ts","sourceRoot":"","sources":["../../lib/domain/CliIo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CliIo.d.ts","sourceRoot":"","sources":["../../lib/domain/CliIo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,6FAA6F;AAC7F,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,uGAAuG;IACvG,KAAK,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,eAAO,MAAM,QAAQ,oBAAkC,CAAC;AAExD,eAAO,MAAM,SAAS,QAAO,KAK3B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type InjectFn, SingleToken } from 'ts-ioc-container';
|
|
2
2
|
/** Settings every service shares for one run: the process-level context the CLI was started in. */
|
|
3
3
|
export type GlobalConfig = {
|
|
4
|
-
/** Directory relative
|
|
4
|
+
/** Directory a relative `<config>` path (and `build({ config })`) resolves against. */
|
|
5
5
|
cwd: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const GlobalConfigKey: SingleToken<GlobalConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalConfig.d.ts","sourceRoot":"","sources":["../../lib/domain/GlobalConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE9D,mGAAmG;AACnG,MAAM,MAAM,YAAY,GAAG;IACzB,
|
|
1
|
+
{"version":3,"file":"GlobalConfig.d.ts","sourceRoot":"","sources":["../../lib/domain/GlobalConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE9D,mGAAmG;AACnG,MAAM,MAAM,YAAY,GAAG;IACzB,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,eAAe,2BAAgD,CAAC;AAE7E,qFAAqF;AACrF,eAAO,MAAM,YAAY,GACtB,CAAC,SAAS,MAAM,YAAY,EAAE,KAAK,CAAC,KAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAE3B,CAAC"}
|
|
@@ -10,6 +10,10 @@ export declare abstract class TicError extends Error {
|
|
|
10
10
|
export declare class TicConfigError extends TicError {
|
|
11
11
|
constructor(message: string);
|
|
12
12
|
}
|
|
13
|
+
/** A namespace is neither an existing folder nor a `tsconfig.json` `paths` alias of one. */
|
|
14
|
+
export declare class NamespaceNotFoundError extends TicError {
|
|
15
|
+
constructor(message: string);
|
|
16
|
+
}
|
|
13
17
|
/** The command line names no command. */
|
|
14
18
|
export declare class MissingCommandError extends TicError {
|
|
15
19
|
constructor(usage: string);
|
|
@@ -26,8 +30,4 @@ export declare class UnknownActionError extends TicError {
|
|
|
26
30
|
export declare class UsageError extends TicError {
|
|
27
31
|
constructor(message: string);
|
|
28
32
|
}
|
|
29
|
-
/** `tic build --check` found generated bundles that differ from what a build would write. */
|
|
30
|
-
export declare class StaleBundlesError extends TicError {
|
|
31
|
-
constructor(count: number);
|
|
32
|
-
}
|
|
33
33
|
//# sourceMappingURL=DomainException.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainException.d.ts","sourceRoot":"","sources":["../../lib/exceptions/DomainException.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,8BAAsB,QAAS,SAAQ,KAAK;IAExC,QAAQ,CAAC,IAAI,EAAE,MAAM;IADvB,SAAS,aACE,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM;CAKlB;AAED,8FAA8F;AAC9F,qBAAa,cAAe,SAAQ,QAAQ;gBAC9B,OAAO,EAAE,MAAM;CAG5B;AAED,yCAAyC;AACzC,qBAAa,mBAAoB,SAAQ,QAAQ;gBACnC,KAAK,EAAE,MAAM;CAG1B;AAED,wEAAwE;AACxE,qBAAa,mBAAoB,SAAQ,QAAQ;gBACnC,OAAO,EAAE,MAAM;CAG5B;AAED,kFAAkF;AAClF,qBAAa,kBAAmB,SAAQ,QAAQ;gBAClC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAG5C;AAED,uFAAuF;AACvF,qBAAa,UAAW,SAAQ,QAAQ;gBAC1B,OAAO,EAAE,MAAM;CAG5B
|
|
1
|
+
{"version":3,"file":"DomainException.d.ts","sourceRoot":"","sources":["../../lib/exceptions/DomainException.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,8BAAsB,QAAS,SAAQ,KAAK;IAExC,QAAQ,CAAC,IAAI,EAAE,MAAM;IADvB,SAAS,aACE,IAAI,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM;CAKlB;AAED,8FAA8F;AAC9F,qBAAa,cAAe,SAAQ,QAAQ;gBAC9B,OAAO,EAAE,MAAM;CAG5B;AAED,4FAA4F;AAC5F,qBAAa,sBAAuB,SAAQ,QAAQ;gBACtC,OAAO,EAAE,MAAM;CAG5B;AAED,yCAAyC;AACzC,qBAAa,mBAAoB,SAAQ,QAAQ;gBACnC,KAAK,EAAE,MAAM;CAG1B;AAED,wEAAwE;AACxE,qBAAa,mBAAoB,SAAQ,QAAQ;gBACnC,OAAO,EAAE,MAAM;CAG5B;AAED,kFAAkF;AAClF,qBAAa,kBAAmB,SAAQ,QAAQ;gBAClC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAG5C;AAED,uFAAuF;AACvF,qBAAa,UAAW,SAAQ,QAAQ;gBAC1B,OAAO,EAAE,MAAM;CAG5B"}
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Which files a bundle reads and parses: the first, cheap stage of selection,
|
|
4
|
+
* decided by path alone. `paths` are the folders the files come from; within them
|
|
5
|
+
* a file is parsed when it matches one of `include` and none of `exclude`. Globs
|
|
6
|
+
* are relative to the config file and `/`-separated. With a file naming convention
|
|
7
|
+
* (`*.service.ts`), `include` keeps the bundler from reading anything else.
|
|
8
|
+
*/
|
|
9
|
+
export interface GlobSelector {
|
|
10
|
+
/** Folders to scan: relative to the config file (`./src/services`), or tsconfig `paths` aliases (`@app/services`). */
|
|
11
|
+
paths: (string | PathConfig)[];
|
|
12
|
+
/** Globs a file must match one of, e.g. `**\/*.service.ts`. Default: every source file. */
|
|
13
|
+
include?: string[];
|
|
14
|
+
/** Globs of files never read. Replaces {@link DEFAULT_EXCLUDE} when given. */
|
|
15
|
+
exclude?: string[];
|
|
16
|
+
}
|
|
17
|
+
/** A {@link GlobSelector} with its defaults filled in and its globs compiled. */
|
|
18
|
+
export interface ResolvedGlobSelector {
|
|
19
|
+
paths: Required<PathConfig>[];
|
|
20
|
+
include?: RegExp[];
|
|
21
|
+
exclude: RegExp[];
|
|
22
|
+
}
|
|
2
23
|
/** Which exports of a file count: both kinds, only named exports, or only the default export. */
|
|
3
24
|
export type ExportKind = 'any' | 'named' | 'default';
|
|
4
25
|
/**
|
|
5
|
-
* Which classes of a parsed file are registered
|
|
6
|
-
*
|
|
7
|
-
*
|
|
26
|
+
* Which classes of a parsed file are registered: the second stage of selection,
|
|
27
|
+
* run on the files {@link GlobSelector} let through. A class is selected when
|
|
28
|
+
* it is exported, not abstract, and meets every criterion set here; an empty
|
|
29
|
+
* rule selects every exported class.
|
|
8
30
|
*/
|
|
9
31
|
export interface ClassSelector {
|
|
10
32
|
/** Default `any`. */
|
|
@@ -14,155 +36,137 @@ export interface ClassSelector {
|
|
|
14
36
|
* composed one). Default {@link DEFAULT_DECORATORS}; `[]` requires none.
|
|
15
37
|
*/
|
|
16
38
|
decorators?: string[];
|
|
17
|
-
/** A glob the class name must match, e.g. `*Service`. An anonymous default export is named after its file. */
|
|
18
|
-
name?: string;
|
|
19
39
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
40
|
+
* Globs the class name must match one of, e.g. `*Service` or `["*Service", "*Repository"]`.
|
|
41
|
+
* An anonymous default export is named after its file.
|
|
22
42
|
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
43
|
+
glob?: string | string[];
|
|
44
|
+
/**
|
|
45
|
+
* Globs the class name must match none of, applied after every other criterion. A plain
|
|
46
|
+
* name is a glob too, so `["MockUserRepository", "*Fake"]` drops one class by name and a
|
|
47
|
+
* family by pattern.
|
|
48
|
+
*/
|
|
49
|
+
exclude?: string | string[];
|
|
26
50
|
}
|
|
27
51
|
/** A {@link ClassSelector} with its defaults filled in and its globs compiled. */
|
|
28
52
|
export interface ResolvedClassSelector {
|
|
29
53
|
export: ExportKind;
|
|
30
54
|
decorators?: string[];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
excludeName?: RegExp;
|
|
55
|
+
glob?: RegExp[];
|
|
56
|
+
exclude?: RegExp[];
|
|
34
57
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
export interface BundleCompilerOptions {
|
|
42
|
-
/** Extension of generated imports. Inferred from the tsconfig's `moduleResolution` when omitted. */
|
|
43
|
-
importExtension?: string;
|
|
44
|
-
/** Which classes of a scanned file are registered. Default: every exported class decorated with `@register`. */
|
|
45
|
-
classes?: ClassSelector;
|
|
46
|
-
[option: string]: unknown;
|
|
58
|
+
export interface PathConfig {
|
|
59
|
+
/** A folder relative to the config file (`./src/services`) or a tsconfig `paths` alias (`@app/services`). */
|
|
60
|
+
path: string;
|
|
61
|
+
/** Scan sub-folders too. Default `true`. */
|
|
62
|
+
recursive?: boolean;
|
|
47
63
|
}
|
|
48
64
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* own compiler options describe the generated module. A project that needs several bundles
|
|
53
|
-
* keeps one config file per bundle.
|
|
65
|
+
* A bundle config file: one bundle, described explicitly — the folders it scans and the
|
|
66
|
+
* classes it registers. `tic build <config>` prints the bundle to stdout; where it is
|
|
67
|
+
* saved is the caller's choice (`tic build app.bundle.json > src/di/app.bundle.ts`).
|
|
54
68
|
*/
|
|
55
69
|
export interface BundleConfig {
|
|
56
70
|
$schema?: string;
|
|
57
|
-
/**
|
|
58
|
-
* The generated file, relative to the config file. Default `<root>/<name>.bundle.ts`:
|
|
59
|
-
* `<root>` is the compiled `rootDir`, else the common folder of the files compiled.
|
|
60
|
-
*/
|
|
61
|
-
output?: string;
|
|
62
71
|
/**
|
|
63
72
|
* The bundle's name: letters, digits, `-` and `_`, starting with a letter. Default: the
|
|
64
|
-
* config file's stem (`production.bundle.json` -> `production`)
|
|
65
|
-
*
|
|
66
|
-
*
|
|
73
|
+
* config file's stem (`production.bundle.json` -> `production`); required for a config
|
|
74
|
+
* file named otherwise. It names the generated class, an `IContainerModule`
|
|
75
|
+
* (`ProductionBundle`, see {@link toClassName}).
|
|
67
76
|
*/
|
|
68
77
|
name?: string;
|
|
69
78
|
/**
|
|
70
|
-
* The tsconfig
|
|
71
|
-
*
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* The base folder this config's relative `include`, `exclude` and `output` resolve against,
|
|
76
|
-
* so they need not repeat a shared prefix such as `src`. Relative to the config file; default
|
|
77
|
-
* the config file's directory. It is also handed to TypeScript as `compilerOptions.baseUrl`
|
|
78
|
-
* (unless that is set too), so the generated imports use it as well.
|
|
79
|
+
* The tsconfig whose `paths` aliases `glob.paths` may name and generated imports are
|
|
80
|
+
* written in, and whose `moduleResolution` sets the import extension. It contributes
|
|
81
|
+
* nothing else: the files scanned are `glob.paths` alone. Relative to the config file.
|
|
82
|
+
* Default `./tsconfig.json`, which may be absent; a tsconfig named here must exist.
|
|
79
83
|
*/
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
tsconfig?: string;
|
|
85
|
+
/** Extension of generated imports. Inferred from the tsconfig's `moduleResolution` when omitted. */
|
|
86
|
+
importExtension?: string;
|
|
87
|
+
/** Which files are parsed: the folders in `glob.paths`, minus {@link DEFAULT_EXCLUDE} unless `exclude` says otherwise. */
|
|
88
|
+
glob: GlobSelector;
|
|
89
|
+
/** Which classes of a parsed file are registered. Default: every exported class. */
|
|
90
|
+
className?: ClassSelector;
|
|
86
91
|
}
|
|
87
|
-
export declare const
|
|
88
|
-
/**
|
|
89
|
-
export declare const DEFAULT_BUNDLE_NAME = "base";
|
|
90
|
-
/** What `classes.decorators` requires when omitted: the library's own `@register`. */
|
|
92
|
+
export declare const DEFAULT_TSCONFIG = "./tsconfig.json";
|
|
93
|
+
/** What `className.decorators` requires when omitted: the library's own `@register`. */
|
|
91
94
|
export declare const DEFAULT_DECORATORS: string[];
|
|
92
|
-
/** Files never scanned, whatever the tsconfig compiles: tests, and anything under `node_modules`. */
|
|
93
95
|
export declare const DEFAULT_EXCLUDE: string[];
|
|
94
|
-
/** The tsconfig part of a bundle config, handed to TypeScript as a tsconfig of its own. */
|
|
95
|
-
export interface TsconfigOverrides {
|
|
96
|
-
include?: string[];
|
|
97
|
-
exclude?: string[];
|
|
98
|
-
/** `compilerOptions` without the bundler's own options. */
|
|
99
|
-
compilerOptions: Record<string, unknown>;
|
|
100
|
-
}
|
|
101
96
|
/** A {@link BundleConfig} whose defaults are filled in and whose paths are absolute. */
|
|
102
97
|
export interface ResolvedConfig {
|
|
103
98
|
/** The config file itself. */
|
|
104
99
|
file: string;
|
|
100
|
+
/** Its folder: what the config's relative paths resolve against. */
|
|
105
101
|
dir: string;
|
|
106
|
-
/** `undefined`: derived from what is compiled at build time (see {@link BundleConfig.output}). */
|
|
107
|
-
output?: string;
|
|
108
102
|
/** The bundle name: `production` for `production.bundle.json`. */
|
|
109
103
|
name: string;
|
|
110
104
|
/** The generated class: `ProductionBundle`. */
|
|
111
|
-
|
|
112
|
-
/** The
|
|
105
|
+
bundleClassName: string;
|
|
106
|
+
/** The tsconfig of `paths` aliases; `required` when the config names it, so it must exist. */
|
|
113
107
|
tsconfig: {
|
|
114
108
|
file: string;
|
|
115
109
|
required: boolean;
|
|
116
110
|
};
|
|
117
|
-
/** What the config sets on top of {@link tsconfig}. */
|
|
118
|
-
overrides: TsconfigOverrides;
|
|
119
111
|
importExtension?: string;
|
|
120
|
-
|
|
112
|
+
glob: ResolvedGlobSelector;
|
|
113
|
+
className: ResolvedClassSelector;
|
|
114
|
+
/** Non-fatal problems found while resolving, e.g. a `glob.exclude` that drops a default test glob. */
|
|
115
|
+
warnings: string[];
|
|
121
116
|
}
|
|
122
117
|
/**
|
|
123
|
-
* One `*.bundle.json` / `*.bundle.yaml
|
|
124
|
-
*
|
|
125
|
-
*
|
|
118
|
+
* One `*.bundle.json` / `*.bundle.yaml`. The published `tic.schema.json` is generated
|
|
119
|
+
* from it (`ticConfigJsonSchema`), so the schema editors validate against cannot drift
|
|
120
|
+
* from what `tic build` accepts.
|
|
126
121
|
*/
|
|
127
122
|
export declare const BUNDLE_CONFIG_SCHEMA: z.ZodObject<{
|
|
128
123
|
$schema: z.ZodOptional<z.ZodString>;
|
|
129
|
-
extends: z.ZodOptional<z.ZodString>;
|
|
130
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
131
|
-
output: z.ZodOptional<z.ZodString>;
|
|
132
124
|
name: z.ZodOptional<z.ZodString>;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
125
|
+
tsconfig: z.ZodOptional<z.ZodString>;
|
|
126
|
+
importExtension: z.ZodOptional<z.ZodString>;
|
|
127
|
+
glob: z.ZodObject<{
|
|
128
|
+
paths: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
129
|
+
path: z.ZodString;
|
|
130
|
+
recursive: z.ZodDefault<z.ZodBoolean>;
|
|
131
|
+
}, z.core.$strip>]>>;
|
|
132
|
+
include: z.ZodOptional<z.ZodCustom<string[], string[]>>;
|
|
133
|
+
exclude: z.ZodDefault<z.ZodCustom<string[], string[]>>;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
className: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
export: z.ZodDefault<z.ZodEnum<{
|
|
137
|
+
default: "default";
|
|
138
|
+
any: "any";
|
|
139
|
+
named: "named";
|
|
140
|
+
}>>;
|
|
141
|
+
decorators: z.ZodDefault<z.ZodCustom<string[], string[]>>;
|
|
142
|
+
glob: z.ZodOptional<z.ZodCustom<string | string[], string | string[]>>;
|
|
143
|
+
exclude: z.ZodOptional<z.ZodCustom<string | string[], string | string[]>>;
|
|
144
|
+
}, z.core.$strict>>;
|
|
151
145
|
}, z.core.$strict>;
|
|
152
146
|
/**
|
|
153
|
-
* A config file is named `<name>.bundle.json`, `<name>.bundle.yaml` or `<name>.bundle.yml
|
|
154
|
-
* e.g. `app.bundle.json
|
|
147
|
+
* A config file is named `<name>.bundle.json`, `<name>.bundle.yaml` or `<name>.bundle.yml`
|
|
148
|
+
* by convention, e.g. `app.bundle.json`; any `.json` / `.yaml` / `.yml` file works.
|
|
155
149
|
*/
|
|
156
150
|
export declare const CONFIG_FILE_SUFFIXES: string[];
|
|
157
|
-
/**
|
|
158
|
-
export declare const
|
|
151
|
+
/** What stands for standard input where a config file is expected: `tic build -`. */
|
|
152
|
+
export declare const STDIN = "-";
|
|
153
|
+
/** The format of a config file, by extension; `undefined` for any other file. */
|
|
154
|
+
export declare const configFormat: (file: string) => ConfigFormat | undefined;
|
|
155
|
+
/** The format of config text: JSON or YAML. */
|
|
156
|
+
export type ConfigFormat = 'json' | 'yaml';
|
|
157
|
+
/**
|
|
158
|
+
* Parses config text in its format. An empty YAML document is `{}`.
|
|
159
|
+
*
|
|
160
|
+
* @throws {TicConfigError} when the text is not valid in its format.
|
|
161
|
+
*/
|
|
162
|
+
export declare function parseConfig(text: string, format: ConfigFormat): unknown;
|
|
159
163
|
/** The generated class for a bundle name: `production` -> `ProductionBundle`, `my-app_v2` -> `MyAppV2Bundle`. */
|
|
160
164
|
export declare function toClassName(name: string): string;
|
|
161
165
|
/**
|
|
162
|
-
* Validates parsed
|
|
163
|
-
*
|
|
166
|
+
* Validates parsed config content and resolves its paths against `file`'s directory.
|
|
167
|
+
* Without a `name` the bundle is named after the file: `production.bundle.json` -> `production`.
|
|
164
168
|
*
|
|
165
|
-
* @throws {TicConfigError} when the content does not match the config shape; the message names the field.
|
|
169
|
+
* @throws {TicConfigError} when the content does not match the config shape, or names no bundle; the message names the field.
|
|
166
170
|
*/
|
|
167
171
|
export declare function resolveConfig(content: unknown, file: string): ResolvedConfig;
|
|
168
172
|
//# sourceMappingURL=BuildConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildConfig.d.ts","sourceRoot":"","sources":["../../../lib/features/build/BuildConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuildConfig.d.ts","sourceRoot":"","sources":["../../../lib/features/build/BuildConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,sHAAsH;IACtH,KAAK,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;IAC/B,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,iFAAiF;AACjF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,iGAAiG;AACjG,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC7B;AAED,kFAAkF;AAClF,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,6GAA6G;IAC7G,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oGAAoG;IACpG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0HAA0H;IAC1H,IAAI,EAAE,YAAY,CAAC;IACnB,oFAAoF;IACpF,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAClD,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,UAAe,CAAC;AAC/C,eAAO,MAAM,eAAe,UAO3B,CAAC;AAEF,wFAAwF;AACxF,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,eAAe,EAAE,MAAM,CAAC;IACxB,8FAA8F;IAC9F,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,SAAS,EAAE,qBAAqB,CAAC;IACjC,sGAAsG;IACtG,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AA8GD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;kBA2BhC,CAAC;AAsEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,UAAkD,CAAC;AAUpF,qFAAqF;AACrF,eAAO,MAAM,KAAK,MAAM,CAAC;AAEzB,iFAAiF;AACjF,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,YAAY,GAAG,SAC6C,CAAC;AAEzG,+CAA+C;AAC/C,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAMvE;AAED,iHAAiH;AACjH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAwB5E"}
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type CliIo } from '../../domain/CliIo.js';
|
|
2
3
|
import { type ILogger } from '../../services/ConsoleLogger.js';
|
|
3
4
|
import { type IOutputService } from '../../services/OutputService.js';
|
|
4
5
|
import { type IBundleBuilder } from './services/BundleBuilder.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
6
|
+
export declare const BUILD_OPTIONS: z.ZodPipe<z.ZodObject<{
|
|
7
|
+
positionals: z.ZodArray<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
9
|
+
config: string;
|
|
10
|
+
}, {
|
|
11
|
+
positionals: string[];
|
|
12
|
+
}>>;
|
|
10
13
|
export type BuildCliOptions = z.output<typeof BUILD_OPTIONS>;
|
|
11
|
-
/** `tic build [
|
|
14
|
+
/** `tic build [<config> | -]`: the bundle goes to stdout; without a config file, the config comes from stdin. */
|
|
12
15
|
export declare class BuildController {
|
|
13
|
-
private readonly
|
|
14
|
-
private readonly configs;
|
|
16
|
+
private readonly io;
|
|
15
17
|
private readonly builder;
|
|
16
18
|
private readonly output;
|
|
17
19
|
private readonly logger;
|
|
18
|
-
constructor(
|
|
20
|
+
constructor(io: CliIo, builder: IBundleBuilder, output: IOutputService, logger: ILogger);
|
|
19
21
|
/**
|
|
20
|
-
* Builds
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* stderr; an error names the config
|
|
22
|
+
* Builds the bundle the config file `<config>` describes — or, without one (or with `-`),
|
|
23
|
+
* the config piped into stdin — and prints it to stdout. Saving it is the shell's job:
|
|
24
|
+
* `tic build app.bundle.json > src/di/app.bundle.ts`, `cat app.bundle.yml | tic build > out.ts`.
|
|
25
|
+
* Warnings go to stderr, so they never end up in the bundle; an error names the config.
|
|
24
26
|
*
|
|
25
|
-
* @throws {UsageError} when an option is unknown or
|
|
26
|
-
* @throws {TicConfigError} when
|
|
27
|
-
* @throws {
|
|
27
|
+
* @throws {UsageError} when an option is unknown, there is more than one `<config>`, or the config should come from stdin and nothing is piped in.
|
|
28
|
+
* @throws {TicConfigError} when the config file is missing or unreadable, the config or its tsconfig is invalid, the bundle has no name, or no tsconfig paths alias covers a selected class's file.
|
|
29
|
+
* @throws {NamespaceNotFoundError} when a path is neither a folder nor a tsconfig paths alias of one.
|
|
28
30
|
*/
|
|
29
|
-
build(
|
|
31
|
+
build({ config }: BuildCliOptions): void;
|
|
32
|
+
/**
|
|
33
|
+
* @throws {UsageError} when nothing is piped into stdin.
|
|
34
|
+
*/
|
|
35
|
+
private stdin;
|
|
30
36
|
}
|
|
31
37
|
//# sourceMappingURL=BuildController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildController.d.ts","sourceRoot":"","sources":["../../../lib/features/build/BuildController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BuildController.d.ts","sourceRoot":"","sources":["../../../lib/features/build/BuildController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,KAAK,cAAc,EAAqB,MAAM,8BAA8B,CAAC;AAEtF,OAAO,EAAE,KAAK,cAAc,EAAqB,MAAM,0BAA0B,CAAC;AAElF,eAAO,MAAM,aAAa;;;;;;GAOxB,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAI7D,iHAAiH;AACjH,qBACa,eAAe;IAEF,OAAO,CAAC,QAAQ,CAAC,EAAE;IACV,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAHR,EAAE,EAAE,KAAK,EACA,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,cAAc,EAC7B,MAAM,EAAE,OAAO;IAG1D;;;;;;;;;OASG;IAEH,KAAK,CAAgE,EAAE,MAAM,EAAE,EAAE,eAAe,GAAG,IAAI;IAavG;;OAEG;IACH,OAAO,CAAC,KAAK;CAOd"}
|