@ts-ioc-container/bundler 2.0.0 → 3.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 +36 -23
- package/README.md +64 -84
- package/cjm/app.js +39 -0
- package/cjm/bin.js +2 -2
- package/cjm/cli/Application.js +58 -0
- package/cjm/cli/IErrorHandler.js +5 -0
- package/cjm/cli/decorators.js +9 -0
- package/cjm/cli/index.js +17 -0
- package/cjm/cli/options.js +25 -0
- package/cjm/cli/usage.js +19 -0
- package/cjm/domain/CliIo.js +7 -0
- package/cjm/domain/GlobalConfig.js +7 -0
- package/cjm/exceptions/DomainException.js +48 -0
- package/cjm/exceptions/ExceptionHandler.js +38 -0
- package/cjm/features/build/BuildConfig.js +146 -0
- package/cjm/features/build/BuildController.js +91 -0
- package/cjm/features/build/BuildModule.js +16 -0
- package/cjm/{ImportPaths.js → features/build/domain/ImportPaths.js} +0 -27
- package/cjm/features/build/domain/configFiles.js +35 -0
- package/cjm/{emit.js → features/build/domain/emit.js} +9 -11
- package/cjm/{scan.js → features/build/domain/scan.js} +0 -18
- package/cjm/features/build/domain/tokenCollisions.js +29 -0
- package/cjm/{tsconfig.js → features/build/domain/tsconfig.js} +17 -11
- package/cjm/features/build/services/BundleBuilder.js +93 -0
- package/cjm/features/build/services/TicConfigService.js +68 -0
- package/cjm/features/help/HelpController.js +39 -0
- package/cjm/features/help/HelpModule.js +12 -0
- package/cjm/features/help/VersionController.js +45 -0
- package/cjm/index.js +83 -26
- package/cjm/modules/CommonModule.js +28 -0
- package/cjm/schema/ticConfigSchema.js +20 -0
- package/cjm/services/ConsoleLogger.js +36 -0
- package/cjm/services/HandlebarsRenderService.js +33 -0
- package/cjm/services/NodeFileSystemService.js +32 -0
- package/cjm/services/OutputService.js +33 -0
- package/package.json +9 -7
- package/tic.schema.json +79 -113
- package/tpl/index.cjs +19 -41
- package/typings/app.d.ts +23 -0
- package/typings/cli/Application.d.ts +16 -0
- package/typings/cli/Application.d.ts.map +1 -0
- package/typings/cli/IErrorHandler.d.ts +7 -0
- package/typings/cli/IErrorHandler.d.ts.map +1 -0
- package/typings/cli/decorators.d.ts +10 -0
- package/typings/cli/decorators.d.ts.map +1 -0
- package/typings/cli/index.d.ts +6 -0
- package/typings/cli/index.d.ts.map +1 -0
- package/typings/cli/options.d.ts +23 -0
- package/typings/cli/options.d.ts.map +1 -0
- package/typings/cli/usage.d.ts +2 -0
- package/typings/cli/usage.d.ts.map +1 -0
- package/typings/domain/CliIo.d.ts +10 -0
- package/typings/domain/CliIo.d.ts.map +1 -0
- package/typings/domain/GlobalConfig.d.ts +10 -0
- package/typings/domain/GlobalConfig.d.ts.map +1 -0
- package/typings/exceptions/DomainException.d.ts +33 -0
- package/typings/exceptions/DomainException.d.ts.map +1 -0
- package/typings/exceptions/ExceptionHandler.d.ts +12 -0
- package/typings/exceptions/ExceptionHandler.d.ts.map +1 -0
- package/typings/features/build/BuildConfig.d.ts +159 -0
- package/typings/features/build/BuildConfig.d.ts.map +1 -0
- package/typings/features/build/BuildController.d.ts +31 -0
- package/typings/features/build/BuildController.d.ts.map +1 -0
- package/typings/features/build/BuildModule.d.ts +5 -0
- package/typings/features/build/BuildModule.d.ts.map +1 -0
- package/typings/{ImportPaths.d.ts → features/build/domain/ImportPaths.d.ts} +2 -9
- package/typings/features/build/domain/ImportPaths.d.ts.map +1 -0
- package/typings/features/build/domain/configFiles.d.ts +13 -0
- package/typings/features/build/domain/configFiles.d.ts.map +1 -0
- package/typings/features/build/domain/emit.d.ts +36 -0
- package/typings/features/build/domain/emit.d.ts.map +1 -0
- package/typings/features/build/domain/glob.d.ts.map +1 -0
- package/typings/{scan.d.ts → features/build/domain/scan.d.ts} +1 -3
- package/typings/features/build/domain/scan.d.ts.map +1 -0
- package/typings/features/build/domain/tokenCollisions.d.ts +14 -0
- package/typings/features/build/domain/tokenCollisions.d.ts.map +1 -0
- package/typings/features/build/domain/tsconfig.d.ts +21 -0
- package/typings/features/build/domain/tsconfig.d.ts.map +1 -0
- package/typings/features/build/services/BundleBuilder.d.ts +65 -0
- package/typings/features/build/services/BundleBuilder.d.ts.map +1 -0
- package/typings/features/build/services/TicConfigService.d.ts +37 -0
- package/typings/features/build/services/TicConfigService.d.ts.map +1 -0
- package/typings/features/help/HelpController.d.ts +8 -0
- package/typings/features/help/HelpController.d.ts.map +1 -0
- package/typings/features/help/HelpModule.d.ts +5 -0
- package/typings/features/help/HelpModule.d.ts.map +1 -0
- package/typings/features/help/VersionController.d.ts +8 -0
- package/typings/features/help/VersionController.d.ts.map +1 -0
- package/typings/index.d.ts +25 -9
- package/typings/modules/CommonModule.d.ts +9 -0
- package/typings/modules/CommonModule.d.ts.map +1 -0
- package/typings/schema/ticConfigSchema.d.ts +7 -0
- package/typings/schema/ticConfigSchema.d.ts.map +1 -0
- package/typings/services/ConsoleLogger.d.ts +20 -0
- package/typings/services/ConsoleLogger.d.ts.map +1 -0
- package/typings/services/HandlebarsRenderService.d.ts +23 -0
- package/typings/services/HandlebarsRenderService.d.ts.map +1 -0
- package/typings/services/NodeFileSystemService.d.ts +21 -0
- package/typings/services/NodeFileSystemService.d.ts.map +1 -0
- package/typings/services/OutputService.d.ts +13 -0
- package/typings/services/OutputService.d.ts.map +1 -0
- package/cjm/build.js +0 -106
- package/cjm/cli.js +0 -109
- package/cjm/config.js +0 -199
- package/cjm/errors.js +0 -15
- package/cjm/render.js +0 -15
- package/typings/build.d.ts +0 -42
- package/typings/cli.d.ts +0 -8
- package/typings/config.d.ts +0 -162
- package/typings/emit.d.ts +0 -23
- package/typings/errors.d.ts +0 -13
- package/typings/render.d.ts +0 -8
- package/typings/tsconfig.d.ts +0 -25
- /package/cjm/{glob.js → features/build/domain/glob.js} +0 -0
- /package/typings/{glob.d.ts → features/build/domain/glob.d.ts} +0 -0
package/tic.schema.json
CHANGED
|
@@ -4,145 +4,111 @@
|
|
|
4
4
|
"title": "*.bundle.json / *.bundle.yaml",
|
|
5
5
|
"description": "One bundle generated by `tic build` (@ts-ioc-container/bundler). `tic build` builds every `*.bundle.json` / `*.bundle.yaml` / `*.bundle.yml` at the root of the package it is invoked in, or — with none — one bundle from that package's tsconfig.json with every setting at its default. Relative paths resolve against this file's directory.",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"additionalProperties": false,
|
|
8
7
|
"properties": {
|
|
9
8
|
"$schema": {
|
|
10
9
|
"type": "string"
|
|
11
10
|
},
|
|
11
|
+
"extends": {
|
|
12
|
+
"default": "./tsconfig.json",
|
|
13
|
+
"description": "The tsconfig this bundle extends, as a tsconfig's own `extends`: its file set, `paths` aliases and module resolution apply unless this file overrides them. Relative to this file. The default may be absent; a tsconfig named here must exist.",
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1
|
|
16
|
+
},
|
|
12
17
|
"output": {
|
|
18
|
+
"description": "The bundle file (convention: *.bundle.ts). Default `<root>/<name>.bundle.ts`: <root> is the compiled rootDir, else the common folder of the files compiled.",
|
|
13
19
|
"type": "string",
|
|
14
|
-
"minLength": 1
|
|
15
|
-
"description": "The bundle file (convention: *.bundle.ts). Default `<root>/<name>.bundle.ts`: <root> is the tsconfig's rootDir, else the common folder of the files it compiles. Required when there is no tsconfig to extend."
|
|
20
|
+
"minLength": 1
|
|
16
21
|
},
|
|
17
22
|
"name": {
|
|
23
|
+
"description": "The bundle's name: letters, digits, \"-\" and \"_\", starting with a letter. Default: this file's stem (production.bundle.json → production), else \"base\". It names the default output (production.bundle.ts) and the generated IContainerModule class (ProductionBundle).",
|
|
18
24
|
"type": "string",
|
|
19
|
-
"pattern": "^[A-Za-z][\\w-]*$"
|
|
20
|
-
"description": "The bundle's name: letters, digits, \"-\" and \"_\", starting with a letter. Default: this file's stem (production.bundle.json → production), else \"base\". It names the default output (production.bundle.ts) and the generated IContainerModule class (ProductionBundle)."
|
|
25
|
+
"pattern": "^[A-Za-z][\\w-]*$"
|
|
21
26
|
},
|
|
22
|
-
"
|
|
27
|
+
"include": {
|
|
28
|
+
"description": "tsconfig `include`: replaces the extended tsconfig's. Relative to this file.",
|
|
23
29
|
"type": "array",
|
|
24
30
|
"items": {
|
|
25
31
|
"type": "string",
|
|
26
32
|
"minLength": 1
|
|
27
|
-
}
|
|
28
|
-
"description": "Tags associated with the bundle."
|
|
29
|
-
},
|
|
30
|
-
"extends": {
|
|
31
|
-
"type": "string",
|
|
32
|
-
"minLength": 1,
|
|
33
|
-
"default": "./tsconfig.json",
|
|
34
|
-
"description": "The tsconfig this bundle builds on, like a tsconfig's own `extends`: what it compiles (`files` / `include` / `exclude`) is the bundle's file set unless `files.paths` overrides it, and its `paths` aliases and module resolution shape the generated imports. Relative to this file. The default may be absent; a tsconfig named here must exist."
|
|
33
|
+
}
|
|
35
34
|
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
35
|
+
"exclude": {
|
|
36
|
+
"description": "tsconfig `exclude`: replaces the extended tsconfig's. Relative to this file.",
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1
|
|
41
|
+
}
|
|
39
42
|
},
|
|
40
|
-
"
|
|
43
|
+
"compilerOptions": {
|
|
41
44
|
"type": "object",
|
|
42
|
-
"additionalProperties": false,
|
|
43
|
-
"description": "Which files this bundle reads and parses — decided by path alone, before parsing. The candidates are what the extended tsconfig compiles, or the folders in `paths` when given. A candidate is parsed when it matches one of `include` and none of `exclude`. Globs are relative to this file. With a file naming convention, `include` keeps every other file unread.",
|
|
44
45
|
"properties": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
"importExtension": {
|
|
47
|
+
"description": "Extension of generated imports, e.g. \".js\". Inferred from the tsconfig: \".js\" under node16/nodenext resolution, none otherwise.",
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
"classes": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"export": {
|
|
54
|
+
"default": "any",
|
|
55
|
+
"description": "Which exports count.",
|
|
56
|
+
"type": "string",
|
|
57
|
+
"enum": ["any", "named", "default"]
|
|
58
|
+
},
|
|
59
|
+
"decorators": {
|
|
60
|
+
"default": ["register"],
|
|
61
|
+
"description": "The class must carry one of these decorators, recognised by name (e.g. \"register\", or a composed decorator). Default [\"register\"]; [] requires none.",
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": {
|
|
52
64
|
"type": "string",
|
|
53
65
|
"minLength": 1
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"type": "object",
|
|
57
|
-
"required": [
|
|
58
|
-
"path"
|
|
59
|
-
],
|
|
60
|
-
"additionalProperties": false,
|
|
61
|
-
"properties": {
|
|
62
|
-
"path": {
|
|
63
|
-
"type": "string",
|
|
64
|
-
"minLength": 1
|
|
65
|
-
},
|
|
66
|
-
"recursive": {
|
|
67
|
-
"type": "boolean",
|
|
68
|
-
"default": true
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
66
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
},
|
|
68
|
+
"name": {
|
|
69
|
+
"description": "Glob the class name must match, e.g. \"*Service\". An anonymous default export is named after its file.",
|
|
70
|
+
"type": "string",
|
|
71
|
+
"minLength": 1
|
|
72
|
+
},
|
|
73
|
+
"excludeClasses": {
|
|
74
|
+
"description": "Class names to drop after selection, e.g. one test double sitting next to the real registration in the same file.",
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"minLength": 1
|
|
79
|
+
},
|
|
80
|
+
"minItems": 1
|
|
81
|
+
},
|
|
82
|
+
"excludeName": {
|
|
83
|
+
"description": "Glob the class name must NOT match, e.g. \"*Mock\". An anonymous default export is named after its file.",
|
|
84
|
+
"type": "string",
|
|
85
|
+
"minLength": 1
|
|
86
|
+
}
|
|
81
87
|
},
|
|
82
|
-
"
|
|
88
|
+
"additionalProperties": false,
|
|
89
|
+
"description": "Which classes of a scanned file are registered. A class is selected when it is exported, not abstract, and meets every criterion set here; by default that is every exported class decorated with @register."
|
|
83
90
|
},
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
91
|
+
"paths": {
|
|
92
|
+
"description": "tsconfig `paths`: aliases the generated imports are written in.",
|
|
93
|
+
"type": "object",
|
|
94
|
+
"propertyNames": {
|
|
87
95
|
"type": "string"
|
|
88
96
|
},
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"**/node_modules/**"
|
|
96
|
-
],
|
|
97
|
-
"description": "Globs of files never read. Replaces the default when given. A non-empty list that omits a default glob makes `tic build` warn."
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
"classes": {
|
|
102
|
-
"type": "object",
|
|
103
|
-
"additionalProperties": false,
|
|
104
|
-
"description": "Which classes of a parsed file are registered. A class is selected when it is exported, not abstract, and meets every criterion set here; by default that is every exported class decorated with @register.",
|
|
105
|
-
"properties": {
|
|
106
|
-
"export": {
|
|
107
|
-
"enum": [
|
|
108
|
-
"any",
|
|
109
|
-
"named",
|
|
110
|
-
"default"
|
|
111
|
-
],
|
|
112
|
-
"default": "any",
|
|
113
|
-
"description": "Which exports count."
|
|
114
|
-
},
|
|
115
|
-
"decorators": {
|
|
116
|
-
"type": "array",
|
|
117
|
-
"items": {
|
|
118
|
-
"type": "string",
|
|
119
|
-
"minLength": 1
|
|
120
|
-
},
|
|
121
|
-
"description": "The class must carry one of these decorators, recognised by name (e.g. \"register\", or a composed decorator). Default [\"register\"]; [] requires none.",
|
|
122
|
-
"default": [
|
|
123
|
-
"register"
|
|
124
|
-
]
|
|
125
|
-
},
|
|
126
|
-
"name": {
|
|
127
|
-
"type": "string",
|
|
128
|
-
"minLength": 1,
|
|
129
|
-
"description": "Glob the class name must match, e.g. \"*Service\". An anonymous default export is named after its file."
|
|
130
|
-
},
|
|
131
|
-
"excludeClasses": {
|
|
132
|
-
"type": "array",
|
|
133
|
-
"minItems": 1,
|
|
134
|
-
"items": {
|
|
135
|
-
"type": "string",
|
|
136
|
-
"minLength": 1
|
|
137
|
-
},
|
|
138
|
-
"description": "Class names to drop after selection, e.g. one test double sitting next to the real registration in the same file."
|
|
97
|
+
"additionalProperties": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
139
103
|
},
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"description": "Glob the class name must NOT match, e.g. \"*Mock\". An anonymous default export is named after its file."
|
|
104
|
+
"rootDir": {
|
|
105
|
+
"description": "tsconfig `rootDir`: where the default output (<rootDir>/<name>.bundle.ts) goes.",
|
|
106
|
+
"type": "string"
|
|
144
107
|
}
|
|
145
|
-
}
|
|
108
|
+
},
|
|
109
|
+
"additionalProperties": {},
|
|
110
|
+
"description": "tsconfig `compilerOptions`, plus the bundler's own `importExtension` and `classes`. Every other option is handed to TypeScript on top of the extended tsconfig's, which validates it."
|
|
146
111
|
}
|
|
147
|
-
}
|
|
112
|
+
},
|
|
113
|
+
"additionalProperties": false
|
|
148
114
|
}
|
package/tpl/index.cjs
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
1
1
|
var Handlebars = require("handlebars"); var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
|
|
2
2
|
templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,partials,data) {
|
|
3
|
-
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
4
|
-
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
5
|
-
return parent[propertyName];
|
|
6
|
-
}
|
|
7
|
-
return undefined
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
return "// Paths: "
|
|
11
|
-
+ ((stack1 = (lookupProperty(helpers,"join")||(depth0 && lookupProperty(depth0,"join"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"paths") : depth0),", ",{"name":"join","hash":{},"data":data,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":44}}})) != null ? stack1 : "");
|
|
12
|
-
},"1":function(container,depth0,helpers,partials,data) {
|
|
13
|
-
var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
14
|
-
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
15
|
-
return parent[propertyName];
|
|
16
|
-
}
|
|
17
|
-
return undefined
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return "// Files: as compiled by "
|
|
21
|
-
+ ((stack1 = ((helper = (helper = lookupProperty(helpers,"tsconfigPath") || (depth0 != null ? lookupProperty(depth0,"tsconfigPath") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"tsconfigPath","hash":{},"data":data,"loc":{"start":{"line":2,"column":77},"end":{"line":2,"column":95}}}) : helper))) != null ? stack1 : "");
|
|
22
|
-
},"2":function(container,depth0,helpers,partials,data) {
|
|
23
3
|
return ", Registration";
|
|
24
|
-
},"
|
|
4
|
+
},"1":function(container,depth0,helpers,partials,data) {
|
|
25
5
|
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
26
6
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
27
7
|
return parent[propertyName];
|
|
@@ -30,12 +10,12 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
30
10
|
};
|
|
31
11
|
|
|
32
12
|
return "import "
|
|
33
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"defaultName") : depth0),{"name":"if","hash":{},"fn":container.program(
|
|
34
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"named") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(
|
|
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":4,"column":7},"end":{"line":4,"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":4,"column":79},"end":{"line":4,"column":131}}})) != null ? stack1 : "")
|
|
35
15
|
+ " from '"
|
|
36
|
-
+ ((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":4,"column":138},"end":{"line":4,"column":153}}}) : helper))) != null ? stack1 : "")
|
|
37
17
|
+ "';\n";
|
|
38
|
-
},"
|
|
18
|
+
},"2":function(container,depth0,helpers,partials,data) {
|
|
39
19
|
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
40
20
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
41
21
|
return parent[propertyName];
|
|
@@ -43,11 +23,11 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
43
23
|
return undefined
|
|
44
24
|
};
|
|
45
25
|
|
|
46
|
-
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":
|
|
47
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"named") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(
|
|
48
|
-
},"
|
|
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":4,"column":26},"end":{"line":4,"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":4,"column":43},"end":{"line":4,"column":72}}})) != null ? stack1 : "");
|
|
28
|
+
},"3":function(container,depth0,helpers,partials,data) {
|
|
49
29
|
return ", ";
|
|
50
|
-
},"
|
|
30
|
+
},"4":function(container,depth0,helpers,partials,data) {
|
|
51
31
|
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
52
32
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
53
33
|
return parent[propertyName];
|
|
@@ -56,9 +36,9 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
56
36
|
};
|
|
57
37
|
|
|
58
38
|
return "{ "
|
|
59
|
-
+ ((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":4,"column":101},"end":{"line":4,"column":122}}})) != null ? stack1 : "")
|
|
60
40
|
+ " }";
|
|
61
|
-
},"
|
|
41
|
+
},"5":function(container,depth0,helpers,partials,data) {
|
|
62
42
|
var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
63
43
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
64
44
|
return parent[propertyName];
|
|
@@ -67,15 +47,15 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
67
47
|
};
|
|
68
48
|
|
|
69
49
|
return "export const registrations: IRegistration[] = [\n"
|
|
70
|
-
+ ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"registrations") : depth0),{"name":"each","hash":{},"fn":container.program(
|
|
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":9,"column":0},"end":{"line":11,"column":9}}})) != null ? stack1 : "")
|
|
71
51
|
+ "];\n";
|
|
72
|
-
},"
|
|
52
|
+
},"6":function(container,depth0,helpers,partials,data) {
|
|
73
53
|
var stack1;
|
|
74
54
|
|
|
75
55
|
return " Registration.fromClass("
|
|
76
56
|
+ ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "")
|
|
77
57
|
+ "),\n";
|
|
78
|
-
},"
|
|
58
|
+
},"7":function(container,depth0,helpers,partials,data) {
|
|
79
59
|
return "export const registrations: IRegistration[] = [];\n";
|
|
80
60
|
},"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
|
|
81
61
|
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
@@ -87,15 +67,13 @@ templates["Bundle.ts.hbs"] = template({"0":function(container,depth0,helpers,par
|
|
|
87
67
|
|
|
88
68
|
return "// Generated by `tic build` from "
|
|
89
69
|
+ ((stack1 = ((helper = (helper = lookupProperty(helpers,"configPath") || (depth0 != null ? lookupProperty(depth0,"configPath") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"configPath","hash":{},"data":data,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":49}}}) : helper))) != null ? stack1 : "")
|
|
90
|
-
+ ". Do not edit by hand.\
|
|
91
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"
|
|
92
|
-
+ "\nimport { type IContainer, type IContainerModule, type IRegistration"
|
|
93
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"registrations") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":67},"end":{"line":3,"column":116}}})) != null ? stack1 : "")
|
|
70
|
+
+ ". Do not edit by hand.\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":2,"column":67},"end":{"line":2,"column":116}}})) != null ? stack1 : "")
|
|
94
72
|
+ " } from 'ts-ioc-container';\n"
|
|
95
|
-
+ ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"imports") : depth0),{"name":"each","hash":{},"fn":container.program(
|
|
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":3,"column":0},"end":{"line":5,"column":9}}})) != null ? stack1 : "")
|
|
96
74
|
+ "\n"
|
|
97
|
-
+ ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"registrations") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"if","hash":{},"fn":container.program(
|
|
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":7,"column":0},"end":{"line":15,"column":7}}})) != null ? stack1 : "")
|
|
98
76
|
+ "\nexport class "
|
|
99
|
-
+ ((stack1 = ((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":
|
|
77
|
+
+ ((stack1 = ((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":17,"column":13},"end":{"line":17,"column":23}}}) : helper))) != null ? stack1 : "")
|
|
100
78
|
+ " implements IContainerModule {\n applyTo(container: IContainer): void {\n for (const registration of registrations) container.addRegistration(registration);\n }\n}\n";
|
|
101
79
|
},"useData":true});
|
package/typings/app.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { type IContainer } from 'ts-ioc-container';
|
|
3
|
+
import { type CliIo } from './domain/CliIo.js';
|
|
4
|
+
import { type ResolvedConfig } from './features/build/BuildConfig.js';
|
|
5
|
+
import { type BuildOptions, type BuildResult } from './features/build/services/BundleBuilder.js';
|
|
6
|
+
/** The composition root: one container per run, holding every module of the CLI. */
|
|
7
|
+
export declare function createContainer(io?: CliIo): IContainer;
|
|
8
|
+
/** Runs the `tic` CLI and returns its exit code; output goes through `io`. */
|
|
9
|
+
export declare function run(argv: string[], io?: CliIo): number;
|
|
10
|
+
/**
|
|
11
|
+
* Generates the bundle a config describes — one `tic build` step as a function. Nothing is
|
|
12
|
+
* written unless generation succeeds.
|
|
13
|
+
*
|
|
14
|
+
* @throws {TicConfigError} when the config or the tsconfig it extends is missing or invalid.
|
|
15
|
+
*/
|
|
16
|
+
export declare function build({ cwd, ...request }?: BuildOptions): BuildResult;
|
|
17
|
+
/**
|
|
18
|
+
* Reads and validates a `*.bundle.json`, `*.bundle.yaml` or `*.bundle.yml`.
|
|
19
|
+
*
|
|
20
|
+
* @throws {TicConfigError} when the file is missing, cannot be parsed, or does not match the config shape.
|
|
21
|
+
*/
|
|
22
|
+
export declare function loadConfig(file: string): ResolvedConfig;
|
|
23
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type IContainer } from 'ts-ioc-container';
|
|
2
|
+
/**
|
|
3
|
+
* Runs one command line against a container: resolves the controller registered
|
|
4
|
+
* under the command's name, runs the hooks it declares under the action, and routes
|
|
5
|
+
* failures to the bound {@link IErrorHandler}. Each action method reads its own
|
|
6
|
+
* options from the raw command line, which reaches it as the hook's runtime args.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Application {
|
|
9
|
+
private readonly scope;
|
|
10
|
+
private readonly errorHandler;
|
|
11
|
+
static bootstrap(container: IContainer): Application;
|
|
12
|
+
private constructor();
|
|
13
|
+
/** Runs `argv` and returns the exit code; the container is disposed afterwards. */
|
|
14
|
+
run(...argv: string[]): number;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=Application.d.ts.map
|
|
@@ -0,0 +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;AA6BpG;;;;;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;CAmB/B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SingleToken } from 'ts-ioc-container';
|
|
2
|
+
export interface IErrorHandler {
|
|
3
|
+
/** Reports `error` and returns the exit code the CLI ends with. */
|
|
4
|
+
handleError(error: unknown): number;
|
|
5
|
+
}
|
|
6
|
+
export declare const IErrorHandlerKey: SingleToken<IErrorHandler>;
|
|
7
|
+
//# sourceMappingURL=IErrorHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IErrorHandler.d.ts","sourceRoot":"","sources":["../../lib/cli/IErrorHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;CACrC;AAED,eAAO,MAAM,gBAAgB,4BAAkD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type HookType } from 'ts-ioc-container';
|
|
2
|
+
export declare const DEFAULT_ACTION = "default";
|
|
3
|
+
/**
|
|
4
|
+
* Registers a method as a named CLI action: `@action('check', invoke)` makes
|
|
5
|
+
* `tic <command> check` run it. Several hooks run in declaration order.
|
|
6
|
+
*/
|
|
7
|
+
export declare const action: (name: string, ...hooks: HookType[]) => (target: object, propertyKey: string | symbol) => void;
|
|
8
|
+
/** Runs when the command is invoked without an action name. */
|
|
9
|
+
export declare const onDefault: (...hooks: HookType[]) => (target: object, propertyKey: string | symbol) => void;
|
|
10
|
+
//# sourceMappingURL=decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../lib/cli/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAc,MAAM,kBAAkB,CAAC;AAEnE,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,EAAE,GAAG,OAAO,QAAQ,EAAE,2DAAqC,CAAC;AAE/F,+DAA+D;AAC/D,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,QAAQ,EAAE,2DAAqC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { action, DEFAULT_ACTION, onDefault } from './decorators.js';
|
|
2
|
+
export { commandArgs, parseOptions, validate } from './options.js';
|
|
3
|
+
export { Application } from './Application.js';
|
|
4
|
+
export { type IErrorHandler, IErrorHandlerKey } from './IErrorHandler.js';
|
|
5
|
+
export { USAGE } from './usage.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ParseArgsConfig } from 'node:util';
|
|
2
|
+
import { type InjectOptions } from 'ts-ioc-container';
|
|
3
|
+
import { z, type ZodType } from 'zod';
|
|
4
|
+
type OptionsConfig = NonNullable<ParseArgsConfig['options']>;
|
|
5
|
+
/** The raw command line a CLI action was invoked with, handed to it as its runtime args. */
|
|
6
|
+
export declare const commandArgs: ({ args }: InjectOptions) => string[];
|
|
7
|
+
/**
|
|
8
|
+
* Mapper that parses the raw command line against an action's options. Everything
|
|
9
|
+
* from the first flag onwards belongs to the action — what precedes it is the
|
|
10
|
+
* command and the action name.
|
|
11
|
+
*
|
|
12
|
+
* @throws {UsageError} when a flag is unknown or a flag that takes a value has none.
|
|
13
|
+
*/
|
|
14
|
+
export declare const parseOptions: (options: OptionsConfig) => (argv: string[]) => Record<string, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Mapper that validates a loosely-typed value — parsed options in practice —
|
|
17
|
+
* against a schema and narrows it to the schema's output type.
|
|
18
|
+
*
|
|
19
|
+
* @throws {UsageError} when the value does not match the schema.
|
|
20
|
+
*/
|
|
21
|
+
export declare const validate: <T extends ZodType>(schema: T) => (value: unknown) => z.output<T>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +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;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GACtB,SAAS,aAAa,MACtB,MAAM,MAAM,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAOvC,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../lib/cli/usage.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,QAeN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SingleToken } from 'ts-ioc-container';
|
|
2
|
+
/** Where the CLI runs and writes: `run(argv, io)` takes one, so tests can capture output. */
|
|
3
|
+
export interface CliIo {
|
|
4
|
+
cwd: string;
|
|
5
|
+
stdout: (line: string) => void;
|
|
6
|
+
stderr: (line: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const CliIoKey: SingleToken<CliIo>;
|
|
9
|
+
export declare const processIo: () => CliIo;
|
|
10
|
+
//# sourceMappingURL=CliIo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CliIo.d.ts","sourceRoot":"","sources":["../../lib/domain/CliIo.ts"],"names":[],"mappings":"AAAA,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;CAChC;AAED,eAAO,MAAM,QAAQ,oBAAkC,CAAC;AAExD,eAAO,MAAM,SAAS,QAAO,KAA6E,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type InjectFn, SingleToken } from 'ts-ioc-container';
|
|
2
|
+
/** Settings every service shares for one run: the process-level context the CLI was started in. */
|
|
3
|
+
export type GlobalConfig = {
|
|
4
|
+
/** Directory relative paths (`--config`, `build({ config })`) resolve against. */
|
|
5
|
+
cwd: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const GlobalConfigKey: SingleToken<GlobalConfig>;
|
|
8
|
+
/** Injects one field of the {@link GlobalConfig}: `@inject(globalConfig('cwd'))`. */
|
|
9
|
+
export declare const globalConfig: <K extends keyof GlobalConfig>(key: K) => InjectFn<GlobalConfig[K]>;
|
|
10
|
+
//# sourceMappingURL=GlobalConfig.d.ts.map
|
|
@@ -0,0 +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,kFAAkF;IAClF,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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class of every error the bundler raises on purpose. `code` is a stable,
|
|
3
|
+
* machine-readable identifier; the CLI prints the message without a stack.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class TicError extends Error {
|
|
6
|
+
readonly code: string;
|
|
7
|
+
protected constructor(code: string, message: string);
|
|
8
|
+
}
|
|
9
|
+
/** The config file is missing, is not JSON, or does not match the `tic.config.json` shape. */
|
|
10
|
+
export declare class TicConfigError extends TicError {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
/** The command line names no command. */
|
|
14
|
+
export declare class MissingCommandError extends TicError {
|
|
15
|
+
constructor(usage: string);
|
|
16
|
+
}
|
|
17
|
+
/** The command line names a command no controller is registered for. */
|
|
18
|
+
export declare class UnknownCommandError extends TicError {
|
|
19
|
+
constructor(command: string);
|
|
20
|
+
}
|
|
21
|
+
/** The command line names an action the command's controller does not declare. */
|
|
22
|
+
export declare class UnknownActionError extends TicError {
|
|
23
|
+
constructor(command: string, action: string);
|
|
24
|
+
}
|
|
25
|
+
/** A command's options are malformed: an unknown flag, or a flag missing its value. */
|
|
26
|
+
export declare class UsageError extends TicError {
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
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
|
+
//# sourceMappingURL=DomainException.d.ts.map
|
|
@@ -0,0 +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;AAED,6FAA6F;AAC7F,qBAAa,iBAAkB,SAAQ,QAAQ;gBACjC,KAAK,EAAE,MAAM;CAG1B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IErrorHandler } from '../cli/IErrorHandler.js';
|
|
2
|
+
import { type ILogger } from '../services/ConsoleLogger.js';
|
|
3
|
+
/**
|
|
4
|
+
* Turns a failed command into exit code 1. A {@link TicError} is an expected failure
|
|
5
|
+
* and is reported by its message alone; anything else is a bug, reported with its stack.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExceptionHandler implements IErrorHandler {
|
|
8
|
+
private readonly logger;
|
|
9
|
+
constructor(logger: ILogger);
|
|
10
|
+
handleError(error: unknown): number;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ExceptionHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExceptionHandler.d.ts","sourceRoot":"","sources":["../../lib/exceptions/ExceptionHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,2BAA2B,CAAC;AAGrE;;;GAGG;AACH,qBACa,gBAAiB,YAAW,aAAa;IAChB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,OAAO;IAEpE,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAKpC"}
|