@ts-ioc-container/bundler 2.0.0 → 2.1.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.
Files changed (110) hide show
  1. package/AGENTS.md +13 -2
  2. package/cjm/app.js +39 -0
  3. package/cjm/bin.js +2 -2
  4. package/cjm/cli/Application.js +58 -0
  5. package/cjm/cli/IErrorHandler.js +5 -0
  6. package/cjm/cli/decorators.js +9 -0
  7. package/cjm/cli/index.js +17 -0
  8. package/cjm/cli/options.js +25 -0
  9. package/cjm/cli/usage.js +19 -0
  10. package/cjm/domain/CliIo.js +7 -0
  11. package/cjm/domain/GlobalConfig.js +7 -0
  12. package/cjm/exceptions/DomainException.js +54 -0
  13. package/cjm/exceptions/ExceptionHandler.js +38 -0
  14. package/cjm/features/build/BuildConfig.js +183 -0
  15. package/cjm/features/build/BuildController.js +91 -0
  16. package/cjm/features/build/BuildModule.js +16 -0
  17. package/cjm/{ImportPaths.js → features/build/domain/ImportPaths.js} +2 -2
  18. package/cjm/features/build/domain/configFiles.js +35 -0
  19. package/cjm/{emit.js → features/build/domain/emit.js} +9 -11
  20. package/cjm/features/build/domain/tokenCollisions.js +29 -0
  21. package/cjm/{tsconfig.js → features/build/domain/tsconfig.js} +3 -3
  22. package/cjm/features/build/services/BundleBuilder.js +116 -0
  23. package/cjm/features/build/services/TicConfigService.js +68 -0
  24. package/cjm/features/help/HelpController.js +39 -0
  25. package/cjm/features/help/HelpModule.js +12 -0
  26. package/cjm/features/help/VersionController.js +45 -0
  27. package/cjm/index.js +84 -25
  28. package/cjm/modules/CommonModule.js +28 -0
  29. package/cjm/schema/ticConfigSchema.js +24 -0
  30. package/cjm/services/ConsoleLogger.js +36 -0
  31. package/cjm/services/HandlebarsRenderService.js +33 -0
  32. package/cjm/services/NodeFileSystemService.js +32 -0
  33. package/cjm/services/OutputService.js +33 -0
  34. package/package.json +9 -7
  35. package/tic.schema.json +48 -53
  36. package/typings/app.d.ts +24 -0
  37. package/typings/cli/Application.d.ts +16 -0
  38. package/typings/cli/Application.d.ts.map +1 -0
  39. package/typings/cli/IErrorHandler.d.ts +7 -0
  40. package/typings/cli/IErrorHandler.d.ts.map +1 -0
  41. package/typings/cli/decorators.d.ts +10 -0
  42. package/typings/cli/decorators.d.ts.map +1 -0
  43. package/typings/cli/index.d.ts +6 -0
  44. package/typings/cli/index.d.ts.map +1 -0
  45. package/typings/cli/options.d.ts +23 -0
  46. package/typings/cli/options.d.ts.map +1 -0
  47. package/typings/cli/usage.d.ts +2 -0
  48. package/typings/cli/usage.d.ts.map +1 -0
  49. package/typings/domain/CliIo.d.ts +10 -0
  50. package/typings/domain/CliIo.d.ts.map +1 -0
  51. package/typings/domain/GlobalConfig.d.ts +10 -0
  52. package/typings/domain/GlobalConfig.d.ts.map +1 -0
  53. package/typings/exceptions/DomainException.d.ts +37 -0
  54. package/typings/exceptions/DomainException.d.ts.map +1 -0
  55. package/typings/exceptions/ExceptionHandler.d.ts +12 -0
  56. package/typings/exceptions/ExceptionHandler.d.ts.map +1 -0
  57. package/typings/{config.d.ts → features/build/BuildConfig.d.ts} +42 -25
  58. package/typings/features/build/BuildConfig.d.ts.map +1 -0
  59. package/typings/features/build/BuildController.d.ts +32 -0
  60. package/typings/features/build/BuildController.d.ts.map +1 -0
  61. package/typings/features/build/BuildModule.d.ts +5 -0
  62. package/typings/features/build/BuildModule.d.ts.map +1 -0
  63. package/typings/features/build/domain/ImportPaths.d.ts.map +1 -0
  64. package/typings/features/build/domain/configFiles.d.ts +13 -0
  65. package/typings/features/build/domain/configFiles.d.ts.map +1 -0
  66. package/typings/{emit.d.ts → features/build/domain/emit.d.ts} +22 -3
  67. package/typings/features/build/domain/emit.d.ts.map +1 -0
  68. package/typings/features/build/domain/glob.d.ts.map +1 -0
  69. package/typings/{scan.d.ts → features/build/domain/scan.d.ts} +1 -1
  70. package/typings/features/build/domain/scan.d.ts.map +1 -0
  71. package/typings/features/build/domain/tokenCollisions.d.ts +14 -0
  72. package/typings/features/build/domain/tokenCollisions.d.ts.map +1 -0
  73. package/typings/features/build/domain/tsconfig.d.ts.map +1 -0
  74. package/typings/features/build/services/BundleBuilder.d.ts +68 -0
  75. package/typings/features/build/services/BundleBuilder.d.ts.map +1 -0
  76. package/typings/features/build/services/TicConfigService.d.ts +37 -0
  77. package/typings/features/build/services/TicConfigService.d.ts.map +1 -0
  78. package/typings/features/help/HelpController.d.ts +8 -0
  79. package/typings/features/help/HelpController.d.ts.map +1 -0
  80. package/typings/features/help/HelpModule.d.ts +5 -0
  81. package/typings/features/help/HelpModule.d.ts.map +1 -0
  82. package/typings/features/help/VersionController.d.ts +8 -0
  83. package/typings/features/help/VersionController.d.ts.map +1 -0
  84. package/typings/index.d.ts +25 -9
  85. package/typings/modules/CommonModule.d.ts +9 -0
  86. package/typings/modules/CommonModule.d.ts.map +1 -0
  87. package/typings/schema/ticConfigSchema.d.ts +7 -0
  88. package/typings/schema/ticConfigSchema.d.ts.map +1 -0
  89. package/typings/services/ConsoleLogger.d.ts +20 -0
  90. package/typings/services/ConsoleLogger.d.ts.map +1 -0
  91. package/typings/services/HandlebarsRenderService.d.ts +23 -0
  92. package/typings/services/HandlebarsRenderService.d.ts.map +1 -0
  93. package/typings/services/NodeFileSystemService.d.ts +21 -0
  94. package/typings/services/NodeFileSystemService.d.ts.map +1 -0
  95. package/typings/services/OutputService.d.ts +13 -0
  96. package/typings/services/OutputService.d.ts.map +1 -0
  97. package/cjm/build.js +0 -106
  98. package/cjm/cli.js +0 -109
  99. package/cjm/config.js +0 -199
  100. package/cjm/errors.js +0 -15
  101. package/cjm/render.js +0 -15
  102. package/typings/build.d.ts +0 -42
  103. package/typings/cli.d.ts +0 -8
  104. package/typings/errors.d.ts +0 -13
  105. package/typings/render.d.ts +0 -8
  106. /package/cjm/{glob.js → features/build/domain/glob.js} +0 -0
  107. /package/cjm/{scan.js → features/build/domain/scan.js} +0 -0
  108. /package/typings/{ImportPaths.d.ts → features/build/domain/ImportPaths.d.ts} +0 -0
  109. /package/typings/{glob.d.ts → features/build/domain/glob.d.ts} +0 -0
  110. /package/typings/{tsconfig.d.ts → features/build/domain/tsconfig.d.ts} +0 -0
@@ -1,3 +1,4 @@
1
+ import { z } from 'zod';
1
2
  /**
2
3
  * Which files a bundle reads and parses: the first, cheap stage of selection,
3
4
  * decided by path alone. The candidates are what the extended tsconfig compiles,
@@ -99,11 +100,6 @@ export interface BundleConfig {
99
100
  /** Which classes of a parsed file are registered. Default: every exported class. */
100
101
  classes?: ClassSelector;
101
102
  }
102
- /**
103
- * A config file is named `<name>.bundle.json`, `<name>.bundle.yaml` or `<name>.bundle.yml`,
104
- * e.g. `app.bundle.json`, `production.bundle.yaml`. Every format has the same shape.
105
- */
106
- export declare const CONFIG_FILE_SUFFIXES: string[];
107
103
  export declare const DEFAULT_EXTENDS = "./tsconfig.json";
108
104
  /** The bundle name when the config file gives none, e.g. building from `tsconfig.json` alone. */
109
105
  export declare const DEFAULT_BUNDLE_NAME = "base";
@@ -134,29 +130,50 @@ export interface ResolvedConfig {
134
130
  warnings: string[];
135
131
  }
136
132
  /**
137
- * Validates parsed `*.bundle.json` content and resolves its paths against `file`'s directory.
138
- *
139
- * @throws {TicConfigError} when the content does not match the config shape; the message names the field.
140
- */
141
- export declare function resolveConfig(content: unknown, file: string): ResolvedConfig;
142
- /** The generated class for a bundle name: `production` -> `ProductionBundle`, `my-app_v2` -> `MyAppV2Bundle`. */
143
- export declare function toClassName(name: string): string;
144
- /**
145
- * The root of the package `dir` belongs to: the nearest folder, `dir` or above, with a
146
- * `package.json` — the project root in a single-package project, the package in a
147
- * monorepo. `dir` itself when no folder above has one.
133
+ * One `*.bundle.json` / `*.bundle.yaml`. The published `tic.schema.json` is generated
134
+ * from it (`ticConfigJsonSchema`), so the schema editors validate against cannot drift
135
+ * from what `tic build` accepts.
148
136
  */
149
- export declare function findPackageRoot(dir: string): string;
137
+ export declare const BUNDLE_CONFIG_SCHEMA: z.ZodObject<{
138
+ $schema: z.ZodOptional<z.ZodString>;
139
+ output: z.ZodOptional<z.ZodString>;
140
+ name: z.ZodOptional<z.ZodString>;
141
+ tags: z.ZodDefault<z.ZodCustom<string[], string[]>>;
142
+ extends: z.ZodOptional<z.ZodString>;
143
+ importExtension: z.ZodOptional<z.ZodString>;
144
+ files: z.ZodOptional<z.ZodObject<{
145
+ paths: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
146
+ path: z.ZodString;
147
+ recursive: z.ZodDefault<z.ZodBoolean>;
148
+ }, z.core.$strip>]>>>;
149
+ include: z.ZodOptional<z.ZodCustom<string[], string[]>>;
150
+ exclude: z.ZodDefault<z.ZodCustom<string[], string[]>>;
151
+ }, z.core.$strict>>;
152
+ classes: z.ZodOptional<z.ZodObject<{
153
+ export: z.ZodDefault<z.ZodEnum<{
154
+ default: "default";
155
+ any: "any";
156
+ named: "named";
157
+ }>>;
158
+ decorators: z.ZodDefault<z.ZodCustom<string[], string[]>>;
159
+ name: z.ZodOptional<z.ZodString>;
160
+ excludeClasses: z.ZodOptional<z.ZodCustom<string[], string[]>>;
161
+ excludeName: z.ZodOptional<z.ZodString>;
162
+ }, z.core.$strict>>;
163
+ }, z.core.$strict>;
150
164
  /**
151
- * The `*.bundle.{json,yaml,yml}` configs in `dir` (not its sub-folders), sorted by name.
152
- *
153
- * @throws {TicConfigError} when one bundle is described in two formats, e.g. `app.bundle.json` and `app.bundle.yaml`.
165
+ * A config file is named `<name>.bundle.json`, `<name>.bundle.yaml` or `<name>.bundle.yml`,
166
+ * e.g. `app.bundle.json`, `production.bundle.yaml`. Every format has the same shape.
154
167
  */
155
- export declare function findConfigFiles(dir: string): string[];
168
+ export declare const CONFIG_FILE_SUFFIXES: string[];
169
+ /** The config suffix `file` ends with, if any. */
170
+ export declare const configSuffix: (file: string) => string | undefined;
171
+ /** The generated class for a bundle name: `production` -> `ProductionBundle`, `my-app_v2` -> `MyAppV2Bundle`. */
172
+ export declare function toClassName(name: string): string;
156
173
  /**
157
- * Reads and validates a `*.bundle.json`, `*.bundle.yaml` or `*.bundle.yml`.
174
+ * Validates parsed `*.bundle.json` content and resolves its paths against `file`'s directory.
158
175
  *
159
- * @throws {TicConfigError} when the file is missing, cannot be parsed, or does not match the config shape.
176
+ * @throws {TicConfigError} when the content does not match the config shape; the message names the field.
160
177
  */
161
- export declare function loadConfig(file: string): ResolvedConfig;
162
- //# sourceMappingURL=config.d.ts.map
178
+ export declare function resolveConfig(content: unknown, file: string): ResolvedConfig;
179
+ //# sourceMappingURL=BuildConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildConfig.d.ts","sourceRoot":"","sources":["../../../lib/features/build/BuildConfig.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import { type ILogger } from '../../services/ConsoleLogger.js';
3
+ import { type IOutputService } from '../../services/OutputService.js';
4
+ import { type IBundleBuilder } from './services/BundleBuilder.js';
5
+ import { type ITicConfigService } from './services/TicConfigService.js';
6
+ export declare const BUILD_OPTIONS: z.ZodObject<{
7
+ config: z.ZodDefault<z.ZodArray<z.ZodString>>;
8
+ check: z.ZodDefault<z.ZodBoolean>;
9
+ }, z.core.$strip>;
10
+ export type BuildCliOptions = z.output<typeof BUILD_OPTIONS>;
11
+ /** `tic build [--config <path>]... [--check]`. */
12
+ export declare class BuildController {
13
+ private readonly cwd;
14
+ private readonly configs;
15
+ private readonly builder;
16
+ private readonly output;
17
+ private readonly logger;
18
+ constructor(cwd: string, configs: ITicConfigService, builder: IBundleBuilder, output: IOutputService, logger: ILogger);
19
+ /**
20
+ * Builds every config named with `--config`, else every `*.bundle.{json,yaml,yml}` of the
21
+ * package, else one bundle from its `tsconfig.json`. With `--check` nothing is written and
22
+ * an out-of-date bundle fails the run. One line per bundle goes to stdout, warnings to
23
+ * stderr; an error names the config it came from.
24
+ *
25
+ * @throws {UsageError} when an option is unknown or `--config` has no value.
26
+ * @throws {TicConfigError} when a config or its tsconfig is missing or invalid, or none can be found.
27
+ * @throws {NamespaceNotFoundError} when a path is neither a folder nor a tsconfig paths alias of one.
28
+ * @throws {StaleBundlesError} when `--check` finds a bundle that differs from what a build would write.
29
+ */
30
+ build(options: BuildCliOptions): void;
31
+ }
32
+ //# sourceMappingURL=BuildController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildController.d.ts","sourceRoot":"","sources":["../../../lib/features/build/BuildController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,KAAK,cAAc,EAAqB,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,KAAK,cAAc,EAAwC,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,KAAK,iBAAiB,EAAuC,MAAM,6BAA6B,CAAC;AAE1G,eAAO,MAAM,aAAa;;;iBAGxB,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAW7D,kDAAkD;AAClD,qBACa,eAAe;IAEK,OAAO,CAAC,QAAQ,CAAC,GAAG;IACf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAJD,GAAG,EAAE,MAAM,EACN,OAAO,EAAE,iBAAiB,EAC7B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,cAAc,EAC7B,MAAM,EAAE,OAAO;IAG1D;;;;;;;;;;OAUG;IAEH,KAAK,CAAgE,OAAO,EAAE,eAAe,GAAG,IAAI;CAiBrG"}
@@ -0,0 +1,5 @@
1
+ import { type IContainer, type IContainerModule } from 'ts-ioc-container';
2
+ export declare class BuildModule implements IContainerModule {
3
+ applyTo(container: IContainer): void;
4
+ }
5
+ //# sourceMappingURL=BuildModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildModule.d.ts","sourceRoot":"","sources":["../../../lib/features/build/BuildModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAqB,MAAM,kBAAkB,CAAC;AAK7F,qBAAa,WAAY,YAAW,gBAAgB;IAClD,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,IAAI;CAMrC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImportPaths.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/domain/ImportPaths.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAaD;;;GAGG;AACH,qBAAa,WAAW;IAmBpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM;IAnB5B;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,WAAW;gBAczF,OAAO,EAAE,KAAK,EAAE,EACxB,SAAS,EAAE,MAAM;IAG5B;;;;OAIG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAa5D,mGAAmG;IACnG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAUnD,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,YAAY;IAWpB,yGAAyG;IACzG,OAAO,CAAC,UAAU;CAanB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The root of the package `dir` belongs to: the nearest folder, `dir` or above, with a
3
+ * `package.json` — the project root in a single-package project, the package in a
4
+ * monorepo. `dir` itself when no folder above has one.
5
+ */
6
+ export declare function findPackageRoot(dir: string): string;
7
+ /**
8
+ * The `*.bundle.{json,yaml,yml}` configs in `dir` (not its sub-folders), sorted by name.
9
+ *
10
+ * @throws {TicConfigError} when one bundle is described in two formats, e.g. `app.bundle.json` and `app.bundle.yaml`.
11
+ */
12
+ export declare function findConfigFiles(dir: string): string[];
13
+ //# sourceMappingURL=configFiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configFiles.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/domain/configFiles.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAarD"}
@@ -14,10 +14,29 @@ export interface EmitInput {
14
14
  }
15
15
  /** The first line of every generated bundle; marks it as output, never input. */
16
16
  export declare const GENERATED_HEADER = "// Generated by `tic build`";
17
+ /** What `protocols/Bundle.ts.hbs` renders. */
18
+ export interface BundleView {
19
+ configPath: string;
20
+ paths?: string[];
21
+ tsconfigPath: string;
22
+ name: string;
23
+ imports: {
24
+ specifier: string;
25
+ defaultName?: string;
26
+ named: string[];
27
+ }[];
28
+ registrations: string[];
29
+ }
30
+ /** The protocol a bundle is rendered from. */
31
+ export declare const BUNDLE_PROTOCOL = "Bundle.ts.hbs";
32
+ /**
33
+ * Prepares the data the bundle protocol renders: unique local names, and one import
34
+ * per file in file order.
35
+ */
36
+ export declare function bundleView({ name, configPath, paths, tsconfigPath, classes }: EmitInput): BundleView;
17
37
  /**
18
38
  * Renders the generated bundle — static imports, `registrations`, and the bundle applying them —
19
- * from its protocol, `protocols/Bundle.ts.hbs`. This function only prepares the data: unique local
20
- * names, and one import per file in file order.
39
+ * from its protocol, `protocols/Bundle.ts.hbs`.
21
40
  */
22
- export declare function emitBundle({ name, configPath, paths, tsconfigPath, classes }: EmitInput): string;
41
+ export declare function emitBundle(input: EmitInput): string;
23
42
  //# sourceMappingURL=emit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/domain/emit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,MAAM,WAAW,SAAS;IACxB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,yFAAyF;IACzF,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,CAAC,eAAe,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CACtD;AAED,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,gCAAgC,CAAC;AAE9D,8CAA8C;AAC9C,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IACxE,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,8CAA8C;AAC9C,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAI/C;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,SAAS,GAAG,UAAU,CAqBpG;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAEnD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/domain/glob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBjD;AAED,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,KAAG,MAAoC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ResolvedClassSelector } from './config.js';
1
+ import type { ResolvedClassSelector } from '../BuildConfig.js';
2
2
  /** An exported class the generated bundle registers. */
3
3
  export interface DiscoveredClass {
4
4
  file: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/domain/scan.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,iEAAiE;IACjE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;;OAIG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;;OAIG;IACH,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CACpD;AAKD,8EAA8E;AAC9E,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,OAAiE,CAAC;AAE9G,+FAA+F;AAC/F,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,EAAE,CAchH;AA2BD;;;GAGG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,qBAAqB,EAC/B,IAAI,SAA6B,GAChC,eAAe,EAAE,CAmFnB"}
@@ -0,0 +1,14 @@
1
+ import type { DiscoveredClass } from './scan.js';
2
+ /**
3
+ * A heuristic for "two selected classes bind the same token": when the decorator's
4
+ * first argument is a plain identifier, equal identifiers are almost always the same
5
+ * token, and registration is last-wins, so one silently replaces the other. Purely
6
+ * syntactic — aliased imports and computed keys are not resolved.
7
+ *
8
+ * Scope-gated classes (`@perPage('stations')`, `@perPage('sessions')`) share the
9
+ * token but are not last-wins: the classes are distinguished by a decorator they
10
+ * share called with different arguments, so each scope registers its own. Those
11
+ * groups are not warned about.
12
+ */
13
+ export declare function tokenCollisions(classes: DiscoveredClass[]): string[];
14
+ //# sourceMappingURL=tokenCollisions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenCollisions.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/domain/tokenCollisions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,EAAE,CAmBpE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsconfig.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/domain/tsconfig.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAeD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,EAC7C,eAAe,CAAC,EAAE,MAAM,GACvB,gBAAgB,CAkBlB"}
@@ -0,0 +1,68 @@
1
+ import { SingleToken } from 'ts-ioc-container';
2
+ import { type IRenderService } from '../../../services/HandlebarsRenderService.js';
3
+ import { type IFileSystemService } from '../../../services/NodeFileSystemService.js';
4
+ import { type ITicConfigService } from './TicConfigService.js';
5
+ /** What one build does. Paths resolve against the run's working directory. */
6
+ export interface BuildRequest {
7
+ /**
8
+ * Path of the `*.bundle.json` to build, relative to the working directory. Omitted: build
9
+ * from the `tsconfig.json` of the package the working directory is in (see `findPackageRoot`),
10
+ * every setting at its default.
11
+ */
12
+ config?: string;
13
+ /** Compare instead of writing: outputs that would change are reported `stale`. */
14
+ check?: boolean;
15
+ }
16
+ export interface BuildOptions extends BuildRequest {
17
+ /** Default `process.cwd()`. */
18
+ cwd?: string;
19
+ }
20
+ /** `written` / `unchanged` after a build; `stale` / `unchanged` after a check. */
21
+ export type OutputStatus = 'written' | 'unchanged' | 'stale';
22
+ export interface OutputResult {
23
+ /** Absolute path of the generated file. */
24
+ file: string;
25
+ /** Name of the generated class. */
26
+ bundle: string;
27
+ status: OutputStatus;
28
+ registrations: number;
29
+ content: string;
30
+ }
31
+ export interface BuildResult {
32
+ /** Absolute path of the config that was built. */
33
+ config: string;
34
+ output: OutputResult;
35
+ /**
36
+ * Non-fatal problems found while building, e.g. a `files.exclude` that drops a default
37
+ * test glob or two selected classes passing the same decorator token.
38
+ */
39
+ warnings: string[];
40
+ }
41
+ export interface IBundleBuilder {
42
+ /**
43
+ * Generates the bundle a config describes. Nothing is written unless generation succeeds.
44
+ *
45
+ * @throws {TicConfigError} when the config or its tsconfig is missing or invalid, or the config has neither `files.paths` nor a tsconfig.
46
+ * @throws {NamespaceNotFoundError} when a path is neither a folder nor a tsconfig paths alias of one.
47
+ */
48
+ build(request?: BuildRequest): BuildResult;
49
+ }
50
+ export declare const IBundleBuilderKey: SingleToken<IBundleBuilder>;
51
+ export declare class BundleBuilder implements IBundleBuilder {
52
+ private readonly cwd;
53
+ private readonly configs;
54
+ private readonly fs;
55
+ private readonly renderer;
56
+ constructor(cwd: string, configs: ITicConfigService, fs: IFileSystemService, renderer: IRenderService);
57
+ /**
58
+ * @throws {TicConfigError} when the config or its tsconfig is missing or invalid, or the config has neither `files.paths` nor a tsconfig.
59
+ * @throws {NamespaceNotFoundError} when a path is neither a folder nor a tsconfig paths alias of one.
60
+ */
61
+ build({ config, check }?: BuildRequest): BuildResult;
62
+ /**
63
+ * @throws {TicConfigError} when the tsconfig is invalid, or the config names no `files.paths` and there is no tsconfig to take files from.
64
+ * @throws {NamespaceNotFoundError} when a path is neither a folder nor a tsconfig paths alias of one.
65
+ */
66
+ private generate;
67
+ }
68
+ //# sourceMappingURL=BundleBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleBuilder.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/services/BundleBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,KAAK,cAAc,EAAqB,MAAM,2CAA2C,CAAC;AACnG,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,yCAAyC,CAAC;AAQzG,OAAO,EAAE,KAAK,iBAAiB,EAAuC,MAAM,oBAAoB,CAAC;AAEjG,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,+BAA+B;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;IACrB;;;OAGG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CAC5C;AAED,eAAO,MAAM,iBAAiB,6BAAoD,CAAC;AAEnF,qBACa,aAAc,YAAW,cAAc;IAEnB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACf,OAAO,CAAC,QAAQ,CAAC,OAAO;IACvB,OAAO,CAAC,QAAQ,CAAC,EAAE;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAHV,GAAG,EAAE,MAAM,EACN,OAAO,EAAE,iBAAiB,EACzB,EAAE,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,cAAc;IAG1E;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,KAAa,EAAE,GAAE,YAAiB,GAAG,WAAW;IAiBhE;;;OAGG;IACH,OAAO,CAAC,QAAQ;CAkDjB"}
@@ -0,0 +1,37 @@
1
+ import { SingleToken } from 'ts-ioc-container';
2
+ import { type IFileSystemService } from '../../../services/NodeFileSystemService.js';
3
+ import { type ResolvedConfig } from '../BuildConfig.js';
4
+ /** The tsconfig a build without a config file extends. */
5
+ export declare const TSCONFIG_FILE = "tsconfig.json";
6
+ export interface ITicConfigService {
7
+ /**
8
+ * Reads and validates a `*.bundle.json`, `*.bundle.yaml` or `*.bundle.yml`.
9
+ *
10
+ * @throws {TicConfigError} when the file is missing, cannot be parsed, or does not match the config shape.
11
+ */
12
+ load(file: string): ResolvedConfig;
13
+ /**
14
+ * The configs to build, as absolute paths: the ones named (relative to the working
15
+ * directory), else every `*.bundle.{json,yaml,yml}` at the root of the package the working
16
+ * directory is in, else `[undefined]` — one build from that package's `tsconfig.json`
17
+ * with default settings. Never looks past the package into a workspace root.
18
+ *
19
+ * @throws {TicConfigError} when none is named and the package has neither a config nor a `tsconfig.json`, or one bundle is described in two formats.
20
+ */
21
+ discover(named: string[]): (string | undefined)[];
22
+ }
23
+ export declare const ITicConfigServiceKey: SingleToken<ITicConfigService>;
24
+ export declare class TicConfigService implements ITicConfigService {
25
+ private readonly cwd;
26
+ private readonly fs;
27
+ constructor(cwd: string, fs: IFileSystemService);
28
+ /**
29
+ * @throws {TicConfigError} when the file is missing, cannot be parsed, or does not match the config shape.
30
+ */
31
+ load(file: string): ResolvedConfig;
32
+ /**
33
+ * @throws {TicConfigError} when none is named and the package has neither a config nor a `tsconfig.json`, or one bundle is described in two formats.
34
+ */
35
+ discover(named: string[]): (string | undefined)[];
36
+ }
37
+ //# sourceMappingURL=TicConfigService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TicConfigService.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/services/TicConfigService.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIrE,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,yCAAyC,CAAC;AACzG,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,gBAAgB,CAAC;AAGpE,0DAA0D;AAC1D,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAE7C,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC;IAEnC;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;CACnD;AAED,eAAO,MAAM,oBAAoB,gCAA0D,CAAC;AAE5F,qBACa,gBAAiB,YAAW,iBAAiB;IAEzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACd,OAAO,CAAC,QAAQ,CAAC,EAAE;gBADR,GAAG,EAAE,MAAM,EACL,EAAE,EAAE,kBAAkB;IAG5E;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAKlC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE;CAQlD"}
@@ -0,0 +1,8 @@
1
+ import { type IOutputService } from '../../services/OutputService.js';
2
+ /** `tic help`, also `tic --help` / `tic -h`. */
3
+ export declare class HelpController {
4
+ private readonly output;
5
+ constructor(output: IOutputService);
6
+ printUsage(): void;
7
+ }
8
+ //# sourceMappingURL=HelpController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HelpController.d.ts","sourceRoot":"","sources":["../../../lib/features/help/HelpController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAqB,MAAM,8BAA8B,CAAC;AAEtF,gDAAgD;AAChD,qBACa,cAAc;IACkB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,cAAc;IAGlF,UAAU,IAAI,IAAI;CAGnB"}
@@ -0,0 +1,5 @@
1
+ import { type IContainer, type IContainerModule } from 'ts-ioc-container';
2
+ export declare class HelpModule implements IContainerModule {
3
+ applyTo(container: IContainer): void;
4
+ }
5
+ //# sourceMappingURL=HelpModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HelpModule.d.ts","sourceRoot":"","sources":["../../../lib/features/help/HelpModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAqB,MAAM,kBAAkB,CAAC;AAI7F,qBAAa,UAAW,YAAW,gBAAgB;IACjD,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,IAAI;CAGrC"}
@@ -0,0 +1,8 @@
1
+ import { type IOutputService } from '../../services/OutputService.js';
2
+ /** `tic version`, also `tic --version` / `tic -v`. */
3
+ export declare class VersionController {
4
+ private readonly output;
5
+ constructor(output: IOutputService);
6
+ printVersion(): void;
7
+ }
8
+ //# sourceMappingURL=VersionController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VersionController.d.ts","sourceRoot":"","sources":["../../../lib/features/help/VersionController.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAqB,MAAM,8BAA8B,CAAC;AAItF,sDAAsD;AACtD,qBACa,iBAAiB;IACe,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,cAAc;IAGlF,YAAY,IAAI,IAAI;CAGrB"}
@@ -1,10 +1,26 @@
1
- export { build, TSCONFIG_FILE, type BuildOptions, type BuildResult, type OutputResult, type OutputStatus, } from './build.js';
2
- export { run, type CliIo } from './cli.js';
3
- export { loadConfig, resolveConfig, CONFIG_FILE_SUFFIXES, findConfigFiles, findPackageRoot, DEFAULT_EXTENDS, DEFAULT_EXCLUDE, DEFAULT_BUNDLE_NAME, DEFAULT_DECORATORS, toClassName, type BundleConfig, type PathConfig, type ClassSelector, type ExportKind, type ResolvedClassSelector, type FileSelector, type ResolvedFileSelector, type ResolvedConfig, } from './config.js';
4
- export { ImportPaths } from './ImportPaths.js';
5
- export { loadTsconfig, type ExtendedTsconfig } from './tsconfig.js';
6
- export { findClasses, isSourceFile, listSourceFiles, type DiscoveredClass } from './scan.js';
7
- export { emitBundle, GENERATED_HEADER, type EmitInput } from './emit.js';
8
- export { globToRegExp } from './glob.js';
9
- export { TicError, TicConfigError, NamespaceNotFoundError } from './errors.js';
1
+ export { build, run, loadConfig, createContainer } from './app.js';
2
+ export { type CliIo, CliIoKey } from './domain/CliIo.js';
3
+ export { type GlobalConfig, GlobalConfigKey, globalConfig } from './domain/GlobalConfig.js';
4
+ export { Application, action, onDefault, DEFAULT_ACTION, commandArgs, parseOptions, validate, type IErrorHandler, IErrorHandlerKey, USAGE, } from './cli.js';
5
+ export { BuildModule } from './features/build/BuildModule.js';
6
+ export { BuildController, BUILD_OPTIONS, type BuildCliOptions } from './features/build/BuildController.js';
7
+ export { BundleBuilder, IBundleBuilderKey, type IBundleBuilder, type BuildRequest, type BuildOptions, type BuildResult, type OutputResult, type OutputStatus, } from './features/build/services/BundleBuilder.js';
8
+ export { TicConfigService, ITicConfigServiceKey, TSCONFIG_FILE, type ITicConfigService, } from './features/build/services/TicConfigService.js';
9
+ export { resolveConfig, BUNDLE_CONFIG_SCHEMA, CONFIG_FILE_SUFFIXES, DEFAULT_EXTENDS, DEFAULT_EXCLUDE, DEFAULT_BUNDLE_NAME, DEFAULT_DECORATORS, toClassName, type BundleConfig, type PathConfig, type ClassSelector, type ExportKind, type ResolvedClassSelector, type FileSelector, type ResolvedFileSelector, type ResolvedConfig, } from './features/build/BuildConfig.js';
10
+ export { findConfigFiles, findPackageRoot } from './features/build/domain/configFiles.js';
11
+ export { ticConfigJsonSchema } from './schema/ticConfigSchema.js';
12
+ export { ImportPaths } from './features/build/domain/ImportPaths.js';
13
+ export { loadTsconfig, type ExtendedTsconfig } from './features/build/domain/tsconfig.js';
14
+ export { findClasses, isSourceFile, listSourceFiles, type DiscoveredClass } from './features/build/domain/scan.js';
15
+ export { emitBundle, bundleView, BUNDLE_PROTOCOL, GENERATED_HEADER, type EmitInput, type BundleView, } from './features/build/domain/emit.js';
16
+ export { tokenCollisions } from './features/build/domain/tokenCollisions.js';
17
+ export { globToRegExp } from './features/build/domain/glob.js';
18
+ export { HelpModule } from './features/help/HelpModule.js';
19
+ export { CommonModule } from './modules/CommonModule.js';
20
+ export { type IOutputService, IOutputServiceKey, StdOutputService } from './services/OutputService.js';
21
+ export { type ILogger, ILoggerKey, ConsoleLogger } from './services/ConsoleLogger.js';
22
+ export { type IFileSystemService, IFileSystemServiceKey, NodeFileSystemService, } from './services/NodeFileSystemService.js';
23
+ export { type IRenderService, IRenderServiceKey, HandlebarsRenderService, renderProtocol, } from './services/HandlebarsRenderService.js';
24
+ export { TicError, TicConfigError, NamespaceNotFoundError, MissingCommandError, UnknownCommandError, UnknownActionError, UsageError, StaleBundlesError, } from './exceptions/DomainException.js';
25
+ export { ExceptionHandler } from './exceptions/ExceptionHandler.js';
10
26
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { type IContainer, type IContainerModule } from 'ts-ioc-container';
2
+ import { type CliIo } from '../domain/CliIo.js';
3
+ /** Services every feature shares: the run's context, its output streams, and error reporting. */
4
+ export declare class CommonModule implements IContainerModule {
5
+ private readonly io;
6
+ constructor(io: CliIo);
7
+ applyTo(container: IContainer): void;
8
+ }
9
+ //# sourceMappingURL=CommonModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommonModule.d.ts","sourceRoot":"","sources":["../../lib/modules/CommonModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAqB,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,iBAAiB,CAAC;AAQvD,iGAAiG;AACjG,qBAAa,YAAa,YAAW,gBAAgB;IACvC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,KAAK;IAEtC,OAAO,CAAC,SAAS,EAAE,UAAU,GAAG,IAAI;CAUrC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The JSON Schema published as `tic.schema.json`, generated from the zod schema
3
+ * `tic build` validates with. `pnpm run generate:schema` writes it; a test fails
4
+ * when the committed file is stale.
5
+ */
6
+ export declare function ticConfigJsonSchema(): Record<string, unknown>;
7
+ //# sourceMappingURL=ticConfigSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticConfigSchema.d.ts","sourceRoot":"","sources":["../../lib/schema/ticConfigSchema.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoB7D"}
@@ -0,0 +1,20 @@
1
+ import { SingleToken } from 'ts-ioc-container';
2
+ import { type CliIo } from '../domain/CliIo.js';
3
+ /**
4
+ * Diagnostics, kept off stdout so a command's output stays machine-readable.
5
+ * Every line is prefixed with `tic:`.
6
+ */
7
+ export interface ILogger {
8
+ /** A non-fatal problem: `tic: warning: <message>`. */
9
+ warn(message: string): void;
10
+ /** A fatal problem: `tic: <message>`. */
11
+ error(message: string): void;
12
+ }
13
+ export declare const ILoggerKey: SingleToken<ILogger>;
14
+ export declare class ConsoleLogger implements ILogger {
15
+ private readonly io;
16
+ constructor(io: CliIo);
17
+ warn(message: string): void;
18
+ error(message: string): void;
19
+ }
20
+ //# sourceMappingURL=ConsoleLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsoleLogger.d.ts","sourceRoot":"","sources":["../../lib/services/ConsoleLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,iBAAiB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,sDAAsD;IACtD,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,yCAAyC;IACzC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,UAAU,sBAAsC,CAAC;AAE9D,qBACa,aAAc,YAAW,OAAO;IACT,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,KAAK;IAE5D,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG7B"}
@@ -0,0 +1,23 @@
1
+ import '../../tpl/index.cjs';
2
+ import { SingleToken } from 'ts-ioc-container';
3
+ /**
4
+ * Renders a precompiled protocol, looked up by its file basename (`Bundle.ts.hbs`).
5
+ *
6
+ * @throws {Error} when no protocol is registered under `name`.
7
+ */
8
+ export declare function renderProtocol(name: string, data: unknown): string;
9
+ /** Turns prepared data into a generated file through its protocol. */
10
+ export interface IRenderService {
11
+ /**
12
+ * @throws {Error} when no protocol is registered under `protocol`.
13
+ */
14
+ render(protocol: string, data: unknown): string;
15
+ }
16
+ export declare const IRenderServiceKey: SingleToken<IRenderService>;
17
+ export declare class HandlebarsRenderService implements IRenderService {
18
+ /**
19
+ * @throws {Error} when no protocol is registered under `protocol`.
20
+ */
21
+ render(protocol: string, data: unknown): string;
22
+ }
23
+ //# sourceMappingURL=HandlebarsRenderService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HandlebarsRenderService.d.ts","sourceRoot":"","sources":["../../lib/services/HandlebarsRenderService.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAY,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAIlE;AAED,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;CACjD;AAED,eAAO,MAAM,iBAAiB,6BAAoD,CAAC;AAEnF,qBACa,uBAAwB,YAAW,cAAc;IAC5D;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM;CAGhD"}
@@ -0,0 +1,21 @@
1
+ import { SingleToken } from 'ts-ioc-container';
2
+ /** The files a build reads and writes. Paths are absolute. */
3
+ export interface IFileSystemService {
4
+ fileExists(file: string): boolean;
5
+ /**
6
+ * @throws {Error} when the file cannot be read, e.g. it does not exist (`ENOENT`).
7
+ */
8
+ readFile(file: string): string;
9
+ /** Creates missing parent folders. */
10
+ writeFile(file: string, content: string): void;
11
+ }
12
+ export declare const IFileSystemServiceKey: SingleToken<IFileSystemService>;
13
+ export declare class NodeFileSystemService implements IFileSystemService {
14
+ fileExists(file: string): boolean;
15
+ /**
16
+ * @throws {Error} when the file cannot be read, e.g. it does not exist (`ENOENT`).
17
+ */
18
+ readFile(file: string): string;
19
+ writeFile(file: string, content: string): void;
20
+ }
21
+ //# sourceMappingURL=NodeFileSystemService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeFileSystemService.d.ts","sourceRoot":"","sources":["../../lib/services/NodeFileSystemService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEzD,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,sCAAsC;IACtC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,qBAAqB,iCAA4D,CAAC;AAE/F,qBACa,qBAAsB,YAAW,kBAAkB;IAC9D,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIjC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI9B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;CAI/C"}
@@ -0,0 +1,13 @@
1
+ import { SingleToken } from 'ts-ioc-container';
2
+ import { type CliIo } from '../domain/CliIo.js';
3
+ /** A command's result, one line at a time: what a caller of `tic` reads from stdout. */
4
+ export interface IOutputService {
5
+ write(line: string): void;
6
+ }
7
+ export declare const IOutputServiceKey: SingleToken<IOutputService>;
8
+ export declare class StdOutputService implements IOutputService {
9
+ private readonly io;
10
+ constructor(io: CliIo);
11
+ write(line: string): void;
12
+ }
13
+ //# sourceMappingURL=OutputService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OutputService.d.ts","sourceRoot":"","sources":["../../lib/services/OutputService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,iBAAiB,CAAC;AAEvD,wFAAwF;AACxF,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,6BAAoD,CAAC;AAEnF,qBACa,gBAAiB,YAAW,cAAc;IACnB,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,KAAK;IAE5D,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAG1B"}