@ts-ioc-container/bundler 3.0.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 -40
- package/README.md +181 -129
- 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 -59
- package/cjm/features/build/BuildController.js +36 -46
- package/cjm/features/build/domain/ImportPaths.js +30 -8
- 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 -73
- 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 -94
- 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 +15 -4
- 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
|
@@ -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,146 +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
|
-
*
|
|
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.
|
|
72
83
|
*/
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
|
|
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;
|
|
79
91
|
}
|
|
80
|
-
export declare const
|
|
81
|
-
/**
|
|
82
|
-
export declare const DEFAULT_BUNDLE_NAME = "base";
|
|
83
|
-
/** 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`. */
|
|
84
94
|
export declare const DEFAULT_DECORATORS: string[];
|
|
85
|
-
/** Files never scanned, whatever the tsconfig compiles: tests, and anything under `node_modules`. */
|
|
86
95
|
export declare const DEFAULT_EXCLUDE: string[];
|
|
87
|
-
/** The tsconfig part of a bundle config, handed to TypeScript as a tsconfig of its own. */
|
|
88
|
-
export interface TsconfigOverrides {
|
|
89
|
-
include?: string[];
|
|
90
|
-
exclude?: string[];
|
|
91
|
-
/** `compilerOptions` without the bundler's own options. */
|
|
92
|
-
compilerOptions: Record<string, unknown>;
|
|
93
|
-
}
|
|
94
96
|
/** A {@link BundleConfig} whose defaults are filled in and whose paths are absolute. */
|
|
95
97
|
export interface ResolvedConfig {
|
|
96
98
|
/** The config file itself. */
|
|
97
99
|
file: string;
|
|
100
|
+
/** Its folder: what the config's relative paths resolve against. */
|
|
98
101
|
dir: string;
|
|
99
|
-
/** `undefined`: derived from what is compiled at build time (see {@link BundleConfig.output}). */
|
|
100
|
-
output?: string;
|
|
101
102
|
/** The bundle name: `production` for `production.bundle.json`. */
|
|
102
103
|
name: string;
|
|
103
104
|
/** The generated class: `ProductionBundle`. */
|
|
104
|
-
|
|
105
|
-
/** The
|
|
105
|
+
bundleClassName: string;
|
|
106
|
+
/** The tsconfig of `paths` aliases; `required` when the config names it, so it must exist. */
|
|
106
107
|
tsconfig: {
|
|
107
108
|
file: string;
|
|
108
109
|
required: boolean;
|
|
109
110
|
};
|
|
110
|
-
/** What the config sets on top of {@link tsconfig}. */
|
|
111
|
-
overrides: TsconfigOverrides;
|
|
112
111
|
importExtension?: string;
|
|
113
|
-
|
|
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[];
|
|
114
116
|
}
|
|
115
117
|
/**
|
|
116
|
-
* One `*.bundle.json` / `*.bundle.yaml
|
|
117
|
-
*
|
|
118
|
-
*
|
|
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.
|
|
119
121
|
*/
|
|
120
122
|
export declare const BUNDLE_CONFIG_SCHEMA: z.ZodObject<{
|
|
121
123
|
$schema: z.ZodOptional<z.ZodString>;
|
|
122
|
-
extends: z.ZodOptional<z.ZodString>;
|
|
123
|
-
output: z.ZodOptional<z.ZodString>;
|
|
124
124
|
name: z.ZodOptional<z.ZodString>;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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>>;
|
|
143
145
|
}, z.core.$strict>;
|
|
144
146
|
/**
|
|
145
|
-
* A config file is named `<name>.bundle.json`, `<name>.bundle.yaml` or `<name>.bundle.yml
|
|
146
|
-
* 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.
|
|
147
149
|
*/
|
|
148
150
|
export declare const CONFIG_FILE_SUFFIXES: string[];
|
|
149
|
-
/**
|
|
150
|
-
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;
|
|
151
163
|
/** The generated class for a bundle name: `production` -> `ProductionBundle`, `my-app_v2` -> `MyAppV2Bundle`. */
|
|
152
164
|
export declare function toClassName(name: string): string;
|
|
153
165
|
/**
|
|
154
|
-
* Validates parsed
|
|
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`.
|
|
155
168
|
*
|
|
156
|
-
* @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.
|
|
157
170
|
*/
|
|
158
171
|
export declare function resolveConfig(content: unknown, file: string): ResolvedConfig;
|
|
159
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":"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"}
|
|
@@ -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"}
|
|
@@ -5,8 +5,8 @@ interface Alias {
|
|
|
5
5
|
targets: string[];
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Import paths as a project's `tsconfig.json` sees them:
|
|
9
|
-
*
|
|
8
|
+
* Import paths as a project's `tsconfig.json` sees them: resolves namespaces
|
|
9
|
+
* written as `paths` aliases to folders, and writes imports back in alias form.
|
|
10
10
|
*/
|
|
11
11
|
export declare class ImportPaths {
|
|
12
12
|
private readonly aliases;
|
|
@@ -17,9 +17,20 @@ export declare class ImportPaths {
|
|
|
17
17
|
*/
|
|
18
18
|
static fromOptions(options: ts.CompilerOptions, tsconfigFile: string, importExtension?: string): ImportPaths;
|
|
19
19
|
constructor(aliases: Alias[], extension: string);
|
|
20
|
-
/**
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The folder a namespace names: a path relative to `baseDir`, or a `paths` alias.
|
|
22
|
+
*
|
|
23
|
+
* @throws {NamespaceNotFoundError} when the namespace is neither an existing folder nor an alias of one.
|
|
24
|
+
*/
|
|
25
|
+
resolveNamespace(namespace: string, baseDir: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* The specifier `file` is imported by: its most specific `paths` alias. `undefined` when no
|
|
28
|
+
* alias covers it — a bundle is written to stdout, so it has no location a relative import
|
|
29
|
+
* could start from.
|
|
30
|
+
*/
|
|
31
|
+
specifier(file: string): string | undefined;
|
|
22
32
|
private bestAlias;
|
|
33
|
+
private aliasTargets;
|
|
23
34
|
/** A longer matched target prefix is a more specific alias; an exact file alias beats every wildcard. */
|
|
24
35
|
private matchAlias;
|
|
25
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportPaths.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/domain/ImportPaths.ts"],"names":[],"mappings":"
|
|
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;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAK3C,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,YAAY;IAWpB,yGAAyG;IACzG,OAAO,CAAC,UAAU;CAanB"}
|
|
@@ -2,8 +2,8 @@ import type { DiscoveredClass } from './scan.js';
|
|
|
2
2
|
export interface EmitInput {
|
|
3
3
|
/** Name of the generated class. */
|
|
4
4
|
name: string;
|
|
5
|
-
/** Shown in the header:
|
|
6
|
-
|
|
5
|
+
/** Shown in the header: the folders scanned. */
|
|
6
|
+
paths: string[];
|
|
7
7
|
classes: (DiscoveredClass & {
|
|
8
8
|
specifier: string;
|
|
9
9
|
})[];
|
|
@@ -12,7 +12,7 @@ export interface EmitInput {
|
|
|
12
12
|
export declare const GENERATED_HEADER = "// Generated by `tic build`";
|
|
13
13
|
/** What `protocols/Bundle.ts.hbs` renders. */
|
|
14
14
|
export interface BundleView {
|
|
15
|
-
|
|
15
|
+
paths: string[];
|
|
16
16
|
name: string;
|
|
17
17
|
imports: {
|
|
18
18
|
specifier: string;
|
|
@@ -27,7 +27,7 @@ export declare const BUNDLE_PROTOCOL = "Bundle.ts.hbs";
|
|
|
27
27
|
* Prepares the data the bundle protocol renders: unique local names, and one import
|
|
28
28
|
* per file in file order.
|
|
29
29
|
*/
|
|
30
|
-
export declare function bundleView({ name,
|
|
30
|
+
export declare function bundleView({ name, paths, classes }: EmitInput): BundleView;
|
|
31
31
|
/**
|
|
32
32
|
* Renders the generated bundle — static imports, `registrations`, and the bundle applying them —
|
|
33
33
|
* from its protocol, `protocols/Bundle.ts.hbs`.
|
|
@@ -1 +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,
|
|
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,gDAAgD;IAChD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,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,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,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,KAAK,EAAE,OAAO,EAAE,EAAE,SAAS,GAAG,UAAU,CAqB1E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAEnD"}
|
|
@@ -29,6 +29,8 @@ export interface DiscoveredClass {
|
|
|
29
29
|
}
|
|
30
30
|
/** A TypeScript source file the bundler may parse: not a declaration file. */
|
|
31
31
|
export declare const isSourceFile: (file: string) => boolean;
|
|
32
|
+
/** Source files of `dir`, sorted by path so the generated output is stable across machines. */
|
|
33
|
+
export declare function listSourceFiles(dir: string, recursive: boolean, isExcluded: (file: string) => boolean): string[];
|
|
32
34
|
/**
|
|
33
35
|
* The exported, non-abstract classes of one file that `selector` selects, in
|
|
34
36
|
* declaration order. Syntax only: decorators are recognised by name, not by type.
|
|
@@ -1 +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;
|
|
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,CAkFnB"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import type { ResolvedConfig } from '../BuildConfig.js';
|
|
2
1
|
import { ImportPaths } from './ImportPaths.js';
|
|
3
|
-
/** What a bundle compiles: the bundle config read as a tsconfig, on top of the tsconfig it extends. */
|
|
4
|
-
export interface CompiledTsconfig {
|
|
5
|
-
importPaths: ImportPaths;
|
|
6
|
-
/** Absolute paths of the files compiled. */
|
|
7
|
-
fileNames: string[];
|
|
8
|
-
/**
|
|
9
|
-
* Where the sources live, as tsc sees it: `rootDir`, else the longest common folder of
|
|
10
|
-
* the non-declaration files compiled, else the config's folder.
|
|
11
|
-
*/
|
|
12
|
-
rootDir: string;
|
|
13
|
-
}
|
|
14
2
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
3
|
+
* Reads a bundle's tsconfig, following its own `extends`: its `paths` aliases and the
|
|
4
|
+
* import extension its `moduleResolution` needs; `importExtension` overrides the latter.
|
|
5
|
+
* Nothing else is taken from it — which files it compiles plays no part in a bundle.
|
|
6
|
+
* An absent tsconfig that was not named explicitly yields no aliases.
|
|
17
7
|
*
|
|
18
|
-
* @throws {TicConfigError} when a required tsconfig is missing
|
|
8
|
+
* @throws {TicConfigError} when a required tsconfig is missing or cannot be parsed.
|
|
19
9
|
*/
|
|
20
|
-
export declare function
|
|
10
|
+
export declare function loadImportPaths(tsconfig: {
|
|
11
|
+
file: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
}, importExtension?: string): ImportPaths;
|
|
21
14
|
//# sourceMappingURL=tsconfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsconfig.d.ts","sourceRoot":"","sources":["../../../../lib/features/build/domain/tsconfig.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
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;AAK5C;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,WAAW,CAapH"}
|