@plugjs/typescript 0.6.117 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler.d.ts +1 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +61 -0
- package/dist/compiler.js.map +1 -0
- package/dist/index.d.ts +34 -35
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/options.d.ts +1 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +39 -0
- package/dist/options.js.map +1 -0
- package/dist/report.d.ts +1 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +84 -0
- package/dist/report.js.map +1 -0
- package/dist/tscbuild.d.ts +32 -0
- package/dist/tscbuild.d.ts.map +1 -0
- package/dist/tscbuild.js +79 -0
- package/dist/tscbuild.js.map +1 -0
- package/dist/tsccompiler.d.ts +39 -0
- package/dist/tsccompiler.d.ts.map +1 -0
- package/dist/tsccompiler.js +75 -0
- package/dist/tsccompiler.js.map +1 -0
- package/dist/typescript.d.ts +1 -0
- package/dist/typescript.d.ts.map +1 -0
- package/dist/typescript.js +135 -0
- package/dist/typescript.js.map +1 -0
- package/dist/writefile.d.ts +1 -0
- package/dist/writefile.d.ts.map +1 -0
- package/dist/writefile.js +21 -0
- package/dist/writefile.js.map +1 -0
- package/package.json +12 -22
- package/src/index.ts +42 -52
- package/src/report.ts +2 -7
- package/src/tscbuild.ts +56 -4
- package/src/tsccompiler.ts +130 -0
- package/src/typescript.ts +5 -6
- package/dist/compiler.cjs +0 -100
- package/dist/compiler.cjs.map +0 -6
- package/dist/compiler.mjs +0 -65
- package/dist/compiler.mjs.map +0 -6
- package/dist/index.cjs +0 -40
- package/dist/index.cjs.map +0 -6
- package/dist/index.mjs +0 -15
- package/dist/index.mjs.map +0 -6
- package/dist/options.cjs +0 -75
- package/dist/options.cjs.map +0 -6
- package/dist/options.mjs +0 -40
- package/dist/options.mjs.map +0 -6
- package/dist/report.cjs +0 -117
- package/dist/report.cjs.map +0 -6
- package/dist/report.mjs +0 -82
- package/dist/report.mjs.map +0 -6
- package/dist/tscbuild.cjs +0 -122
- package/dist/tscbuild.cjs.map +0 -6
- package/dist/tscbuild.mjs +0 -87
- package/dist/tscbuild.mjs.map +0 -6
- package/dist/typescript.cjs +0 -136
- package/dist/typescript.cjs.map +0 -6
- package/dist/typescript.mjs +0 -101
- package/dist/typescript.mjs.map +0 -6
- package/dist/writefile.cjs +0 -56
- package/dist/writefile.cjs.map +0 -6
- package/dist/writefile.mjs +0 -21
- package/dist/writefile.mjs.map +0 -6
package/dist/compiler.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,qBAAa,cACb,YAAW,EAAE,CAAC,YAAY;IAEZ,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAD3B,SAAS,EAAE,YAAY;IAKnC,yDAAyD;IACzD,aAAa,CACT,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,EAAE,CAAC,YAAY,GACjC,EAAE,CAAC,UAAU,GAAG,SAAS;IAM5B,aAAa,CACT,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACvC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,EAAE;IAWX,4BAA4B;IAC5B,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIjC,gEAAgE;IAChE,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,GAAG,MAAM;IAI1D,4CAA4C;IAC5C,yBAAyB,IAAI,OAAO;IAIpC,8CAA8C;IAC9C,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIrC,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI9C,2CAA2C;IAC3C,mBAAmB,IAAI,YAAY;IAInC,uDAAuD;IACvD,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAY9C,yDAAyD;IACzD,UAAU,IAAI,MAAM;CAGrB"}
|
package/dist/compiler.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { resolveAbsolutePath } from '@plugjs/plug/paths';
|
|
2
|
+
import ts from 'typescript';
|
|
3
|
+
export class TypeScriptHost {
|
|
4
|
+
_directory;
|
|
5
|
+
constructor(_directory) {
|
|
6
|
+
this._directory = _directory;
|
|
7
|
+
}
|
|
8
|
+
/* ======================================================================== */
|
|
9
|
+
/** Get a source file parsing one of our virtual files */
|
|
10
|
+
getSourceFile(fileName, languageVersion) {
|
|
11
|
+
const code = this.readFile(fileName);
|
|
12
|
+
if (code == null)
|
|
13
|
+
return undefined; // loose "undefined" check
|
|
14
|
+
return ts.createSourceFile(fileName, code, languageVersion);
|
|
15
|
+
}
|
|
16
|
+
readDirectory(rootDir, extensions, excludes, includes, depth) {
|
|
17
|
+
return ts.sys.readDirectory(resolveAbsolutePath(this._directory, rootDir), extensions, excludes, includes, depth);
|
|
18
|
+
}
|
|
19
|
+
/* coverage ignore next */
|
|
20
|
+
/** Never write any files */
|
|
21
|
+
writeFile(fileName) {
|
|
22
|
+
throw new Error(`Cowardly refusing to write "${fileName}"`);
|
|
23
|
+
}
|
|
24
|
+
/** Get the default library associated with the given options */
|
|
25
|
+
getDefaultLibFileName(options) {
|
|
26
|
+
return ts.getDefaultLibFilePath(options);
|
|
27
|
+
}
|
|
28
|
+
/** Check for filesystem case sensitivity */
|
|
29
|
+
useCaseSensitiveFileNames() {
|
|
30
|
+
return ts.sys.useCaseSensitiveFileNames;
|
|
31
|
+
}
|
|
32
|
+
/** Check for the existence of a given file */
|
|
33
|
+
fileExists(fileName) {
|
|
34
|
+
return ts.sys.fileExists(resolveAbsolutePath(this._directory, fileName));
|
|
35
|
+
}
|
|
36
|
+
/** Read the file if it exists, otherwise return undefined */
|
|
37
|
+
readFile(fileName) {
|
|
38
|
+
return ts.sys.readFile(resolveAbsolutePath(this._directory, fileName));
|
|
39
|
+
}
|
|
40
|
+
/** Return the current working directory */
|
|
41
|
+
getCurrentDirectory() {
|
|
42
|
+
return this._directory;
|
|
43
|
+
}
|
|
44
|
+
/** Return the canonical name for the specified file */
|
|
45
|
+
getCanonicalFileName(fileName) {
|
|
46
|
+
/* coverage ignore if */
|
|
47
|
+
if (ts.sys.useCaseSensitiveFileNames)
|
|
48
|
+
return fileName;
|
|
49
|
+
// Lifted from TypeScript sources
|
|
50
|
+
const fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
|
|
51
|
+
return fileNameLowerCaseRegExp.test(fileName) ?
|
|
52
|
+
fileName.replace(fileNameLowerCaseRegExp, (s) => s.toLowerCase()) :
|
|
53
|
+
fileName;
|
|
54
|
+
}
|
|
55
|
+
/* coverage ignore next */
|
|
56
|
+
/** Return the new line sequence used by this platform */
|
|
57
|
+
getNewLine() {
|
|
58
|
+
return ts.sys.newLine;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=compiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../src/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,MAAM,YAAY,CAAA;AAI3B,MAAM,OAAO,cAAc;IAGI;IAA7B,YAA6B,UAAwB;QAAxB,eAAU,GAAV,UAAU,CAAc;IAAG,CAAC;IAEzD,8EAA8E;IAE9E,yDA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I,CAAC,UAAU,CAAA;IACxB,CAAC;IAED,uDAAuD;IACvD,oBAAoB,CAAC,QAAgB;QACnC,wBAAwB;QACxB,IAAI,EAAE,CAAC,GAAG,CAAC,yBAAyB;YAAE,OAAO,QAAQ,CAAA;QAErD,iCAAiC;QACjC,MAAM,uBAAuB,GAAG,wCAAwC,CAAA;QACxE,OAAO,uBAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC7C,QAAQ,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YACnE,QAAQ,CAAA;IACZ,CAAC;IAED,0BAA0B;IAC1B,yDAAyD;IACzD,UAAU;QACR,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAA;IACvB,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { Pipe } from '@plugjs/plug';
|
|
2
1
|
import type { BuildOptions, CompilerOptions } from 'typescript';
|
|
3
2
|
/** Remove the mapped `[option: string]: ...` from `CompilerOptions`. */
|
|
4
|
-
type
|
|
5
|
-
[k in keyof
|
|
3
|
+
type RemoveIndexSignature<T> = {
|
|
4
|
+
[k in keyof T as string extends k ? never : number extends k ? never : symbol extends k ? never : k]: T[k];
|
|
6
5
|
};
|
|
7
6
|
/** TypeScript Compiler options with some additional properties */
|
|
8
|
-
export interface ExtendedCompilerOptions extends
|
|
7
|
+
export interface ExtendedCompilerOptions extends RemoveIndexSignature<CompilerOptions> {
|
|
9
8
|
/**
|
|
10
9
|
* An additional directory containing a set of `.d.ts` files which will
|
|
11
10
|
* be part of the compilation input, but not of the output.
|
|
@@ -16,6 +15,14 @@ export interface ExtendedCompilerOptions extends KnownCompilerOptions {
|
|
|
16
15
|
*/
|
|
17
16
|
extraTypesDir?: string | undefined;
|
|
18
17
|
}
|
|
18
|
+
export interface TscBuildOptions extends RemoveIndexSignature<BuildOptions> {
|
|
19
|
+
}
|
|
20
|
+
export interface TscCompilerOptions extends RemoveIndexSignature<CompilerOptions> {
|
|
21
|
+
}
|
|
22
|
+
export { tscBuild } from './tscbuild.ts';
|
|
23
|
+
export type { ExtendedTscBuildOptions } from './tscbuild.ts';
|
|
24
|
+
export { tsc } from './tsccompiler.ts';
|
|
25
|
+
export type { ExtendedTscCompilerOptions } from './tsccompiler.ts';
|
|
19
26
|
declare module '@plugjs/plug' {
|
|
20
27
|
interface Pipe {
|
|
21
28
|
/**
|
|
@@ -52,47 +59,39 @@ declare module '@plugjs/plug' {
|
|
|
52
59
|
/**
|
|
53
60
|
* Run the {@link https://www.typescriptlang.org/ TypeScript Builder}
|
|
54
61
|
* over the specified project `tsconfig.json` files.
|
|
62
|
+
*
|
|
63
|
+
* This is equivalent to running `tsc --build` from the command line.
|
|
55
64
|
*/
|
|
56
65
|
tscBuild(): Pipe;
|
|
57
66
|
/**
|
|
58
67
|
* Run the {@link https://www.typescriptlang.org/ TypeScript Builder}
|
|
59
68
|
* over the specified project `tsconfig.json` files.
|
|
60
69
|
*
|
|
70
|
+
* This is equivalent to running `tsc --build ...` from the command line.
|
|
71
|
+
*
|
|
61
72
|
* With regards to `options`, the defaults are:
|
|
62
73
|
* - `verbose: true`
|
|
63
74
|
* - `force: true`
|
|
64
75
|
*
|
|
65
|
-
* @param options {@link
|
|
76
|
+
* @param options {@link TscBuildOptions} to use for the build.
|
|
77
|
+
*/
|
|
78
|
+
tscBuild(options: TscBuildOptions): Pipe;
|
|
79
|
+
/**
|
|
80
|
+
* Run the {@link https://www.typescriptlang.org/ TypeScript Compiler}
|
|
81
|
+
* over the specified project `tsconfig.json` files.
|
|
82
|
+
*
|
|
83
|
+
* This is equivalent to running `tsc --project ...` from the command line.
|
|
84
|
+
*/
|
|
85
|
+
tscCompiler(): Pipe;
|
|
86
|
+
/**
|
|
87
|
+
* Run the {@link https://www.typescriptlang.org/ TypeScript Compiler}
|
|
88
|
+
* over the specified project `tsconfig.json` files.
|
|
89
|
+
*
|
|
90
|
+
* This is equivalent to running `tsc --project ...` from the command line.
|
|
91
|
+
*
|
|
92
|
+
* @param options {@link TscCompilerOptions} to use for the build.
|
|
66
93
|
*/
|
|
67
|
-
|
|
94
|
+
tscCompiler(options: TscCompilerOptions): Pipe;
|
|
68
95
|
}
|
|
69
96
|
}
|
|
70
|
-
|
|
71
|
-
/** The directory where to look for the `tsconfig.json` files. */
|
|
72
|
-
directory?: string;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Run `tsc --build` using `tsconfig.json` from the current directory.
|
|
76
|
-
*/
|
|
77
|
-
export declare function tscBuild(): Pipe;
|
|
78
|
-
/**
|
|
79
|
-
* Run `tsc --build` using the specified `tsconfig.json` file.
|
|
80
|
-
*/
|
|
81
|
-
export declare function tscBuild(tsconfig: string): Pipe;
|
|
82
|
-
/**
|
|
83
|
-
* Run `tsc --build` using the specified options.
|
|
84
|
-
*
|
|
85
|
-
* The `directory` option specifies where to look for the `tsconfig.json` files,
|
|
86
|
-
* and defaults to the current directory, `verbose` and `force` default to
|
|
87
|
-
* `true`.
|
|
88
|
-
*/
|
|
89
|
-
export declare function tscBuild(options: TscBuildOptions): Pipe;
|
|
90
|
-
/**
|
|
91
|
-
* Run `tsc --build` using the specified `tsconfig.json` and options.
|
|
92
|
-
*
|
|
93
|
-
* The `directory` option specifies where to look for the `tsconfig.json` files,
|
|
94
|
-
* and defaults to the current directory, `verbose` and `force` default to
|
|
95
|
-
* `true`.
|
|
96
|
-
*/
|
|
97
|
-
export declare function tscBuild(tsconfig: string, options?: TscBuildOptions): Pipe;
|
|
98
|
-
export {};
|
|
97
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE/D,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AA;QAEnB;;;;;;;WAOG;QACH,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAA;KAC/C;CACF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { installForking } from '@plugjs/plug/fork';
|
|
2
|
+
import { requireResolve } from '@plugjs/plug/paths';
|
|
3
|
+
/* Exports for "tscBuild" and "tsc" */
|
|
4
|
+
export { tscBuild } from "./tscbuild.js";
|
|
5
|
+
export { tsc } from "./tsccompiler.js";
|
|
6
|
+
installForking('tsc', requireResolve(import.meta.filename, './typescript'), 'Tsc');
|
|
7
|
+
installForking('tscBuild', requireResolve(import.meta.filename, './tscbuild'), 'TscBuild');
|
|
8
|
+
installForking('tscCompiler', requireResolve(import.meta.filename, './tsccompiler'), 'TscCompiler');
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AA6BnD,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAkFtC,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,EAAE,KAAK,CAAC,CAAA;AAClF,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,UAAU,CAAC,CAAA;AAC1F,cAAc,CAAC,aAAa,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,eAAe,CAAC,EAAE,aAAa,CAAC,CAAA"}
|
package/dist/options.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export type CompilerOptionsAndDiagnostics = {
|
|
|
7
7
|
};
|
|
8
8
|
/** Load compiler options from a JSON file, and merge in the overrides */
|
|
9
9
|
export declare function getCompilerOptions(file: AbsolutePath | undefined, overrides: ts.CompilerOptions, inputs: AbsolutePath[]): Promise<CompilerOptionsAndDiagnostics>;
|
|
10
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC;IAC5B,MAAM,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC;IACjC,iBAAiB,CAAC,EAAE,SAAS,EAAE,CAAC,gBAAgB,EAAE,CAAC;CACpD,CAAA;AAGD,yEAAyE;AACzE,wBAAsB,kBAAkB,CACpC,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,SAAS,EAAE,EAAE,CAAC,eAAe,EAC7B,MAAM,EAAE,YAAY,EAAE,GACvB,OAAO,CAAC,6BAA6B,CAAC,CAuCxC"}
|
package/dist/options.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { getAbsoluteParent } from '@plugjs/plug/paths';
|
|
2
|
+
import ts from 'typescript';
|
|
3
|
+
/** Load compiler options from a JSON file, and merge in the overrides */
|
|
4
|
+
export async function getCompilerOptions(file, overrides, inputs) {
|
|
5
|
+
// If we don't have a config file, return the merged defaults/overrides
|
|
6
|
+
if (!file) {
|
|
7
|
+
const options = { ...ts.getDefaultCompilerOptions(), ...overrides };
|
|
8
|
+
return { options, errors: [] };
|
|
9
|
+
}
|
|
10
|
+
// Our config parser host
|
|
11
|
+
const host = {
|
|
12
|
+
useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,
|
|
13
|
+
readDirectory(rootDir, extensions, excludes, includes, depth) {
|
|
14
|
+
return ts.sys.readDirectory(rootDir, extensions, excludes, includes, depth);
|
|
15
|
+
},
|
|
16
|
+
fileExists(path) {
|
|
17
|
+
return ts.sys.fileExists(path);
|
|
18
|
+
},
|
|
19
|
+
readFile(path) {
|
|
20
|
+
return ts.sys.readFile(path);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
// The "readJsonConfigFile" / "parseJsonSourceFileConfigFileContent" migth
|
|
24
|
+
// be better here, but "readJsonConfigFile" doesn't return any errors in
|
|
25
|
+
// case a file doesn't exist, and "parseJsonSourceFileConfigFileContent"
|
|
26
|
+
// then fails miserably as it can't really find anything in the source
|
|
27
|
+
const { config, error } = ts.readConfigFile(file, ts.sys.readFile);
|
|
28
|
+
if (error)
|
|
29
|
+
return { options: {}, errors: [error] };
|
|
30
|
+
// Inputs will be discarded, but are needed by "parseJsonConfigFileConent"
|
|
31
|
+
// otherwise it'll complain that we have no inputs in the "tsconfig.json"
|
|
32
|
+
config.include = inputs;
|
|
33
|
+
return ts.parseJsonConfigFileContent(config, // the parsed JSON
|
|
34
|
+
host, // our config parser host
|
|
35
|
+
getAbsoluteParent(file), // directory for path resolution
|
|
36
|
+
overrides, // overrides (from the TSC plug config)
|
|
37
|
+
file);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,MAAM,YAAY,CAAA;AAa3B,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACpC,IAA8B,EAC9B,SAA6B,EAC7B,MAAsB;IAExB,uEAAuE;IACvE,IAAI,CAAE,IAAI,EAAE,CAAC;QACX,MAAM,OAA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/report.d.ts
CHANGED
|
@@ -9,3 +9,4 @@ import type { AbsolutePath } from '@plugjs/plug/paths';
|
|
|
9
9
|
* report will not _fail_ in case of such diagnostics).
|
|
10
10
|
*/
|
|
11
11
|
export declare function updateReport(report: Report, diagnostics: readonly ts.Diagnostic[], directory: AbsolutePath, logger?: Logger): void;
|
|
12
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAA6B,MAAM,sBAAsB,CAAA;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAiEtD;;;;;;GAMG;AACH,wBAAgB,YAAY,CACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE,EACrC,SAAS,EAAE,YAAY,EACvB,MAAM,CAAC,EAAE,MAAM,GAChB,IAAI,CAcN"}
|
package/dist/report.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ERROR, NOTICE, WARN } from '@plugjs/plug/logging';
|
|
2
|
+
import { resolveAbsolutePath } from '@plugjs/plug/paths';
|
|
3
|
+
import ts from 'typescript';
|
|
4
|
+
function convertMessageChain(chain, indent = 0) {
|
|
5
|
+
const message = `${''.padStart(indent * 2)}${chain.messageText}`;
|
|
6
|
+
if (chain.next) {
|
|
7
|
+
const next = chain.next.map((c) => convertMessageChain(c, indent + 1));
|
|
8
|
+
return [message, ...next.flat(1)];
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return [message];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function convertDiagnostics(diagnostics, directory) {
|
|
15
|
+
return diagnostics.map((diagnostic) => {
|
|
16
|
+
// console.log(diagnostic)
|
|
17
|
+
void directory;
|
|
18
|
+
// Convert the `DiagnosticCategory` to our level
|
|
19
|
+
let level;
|
|
20
|
+
switch (diagnostic.category) {
|
|
21
|
+
case ts.DiagnosticCategory.Error:
|
|
22
|
+
level = ERROR;
|
|
23
|
+
break;
|
|
24
|
+
// coverage ignore next / generally not emitted
|
|
25
|
+
case ts.DiagnosticCategory.Warning:
|
|
26
|
+
level = WARN;
|
|
27
|
+
break;
|
|
28
|
+
// coverage ignore next / message and suggestion
|
|
29
|
+
default: level = NOTICE;
|
|
30
|
+
}
|
|
31
|
+
// Convert the `messageText` to a string
|
|
32
|
+
let message;
|
|
33
|
+
if (typeof diagnostic.messageText === 'string') {
|
|
34
|
+
message = diagnostic.messageText;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
message = convertMessageChain(diagnostic.messageText);
|
|
38
|
+
}
|
|
39
|
+
// Simple variables
|
|
40
|
+
const tags = `TS${diagnostic.code}`;
|
|
41
|
+
if (diagnostic.file) {
|
|
42
|
+
const { file: sourceFile, start, length } = diagnostic;
|
|
43
|
+
const file = resolveAbsolutePath(directory, sourceFile.fileName);
|
|
44
|
+
const source = sourceFile.getFullText();
|
|
45
|
+
// coverage ignore else
|
|
46
|
+
if (start !== undefined) {
|
|
47
|
+
const position = sourceFile.getLineAndCharacterOfPosition(start);
|
|
48
|
+
let { line, character: column } = position;
|
|
49
|
+
column += 1;
|
|
50
|
+
line += 1;
|
|
51
|
+
return { level, message, tags, file, source, line, column, length };
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return { level, message, tags, file, source };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return { level, message, tags };
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Update a report, adding records from an array of {@link ts.Diagnostic}
|
|
64
|
+
*
|
|
65
|
+
* When a `logger` is provided, diagnostics without a file will be logged
|
|
66
|
+
* directly to the logger instead of being added to the report (therefore the
|
|
67
|
+
* report will not _fail_ in case of such diagnostics).
|
|
68
|
+
*/
|
|
69
|
+
export function updateReport(report, diagnostics, directory, logger) {
|
|
70
|
+
const records = convertDiagnostics(diagnostics, directory);
|
|
71
|
+
if (!logger) {
|
|
72
|
+
report.add(...records);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
for (const record of records) {
|
|
76
|
+
if ((record.file) || (record.level != NOTICE)) {
|
|
77
|
+
report.add(record);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
logger.info(record.message);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,MAAM,YAAY,CAAA;AAM3B,SAAS,mBAAmB,CAAC,KAAgC,EAAE,MAAM,GAAG,CAAC;IACvE,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,CAAA;IAEhE,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;QACtE,OAAO,CAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAA;IACrC,CAAC;SAAM,CAAC;QACN,OAAO,CAAE,OAAO,CAAE,CAAA;IACpB,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CACvB,WAAqC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,GAAG,QAAQ,CAAA;gBAC1C,MAAM,IAAI,CAAC,CAAA;gBACX,IAAI,IAAI,CAAC,CAAA;gBAET,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;YACrE,CAAC;iBAAM,CAAC;gBACN,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;YAC/C,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;QACjC,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CACxB,MAAc,EACd,WAAqC,EACrC,SAAuB,EACvB,MAAe;IAEjB,MAAM,OAAO,GAAG,kBAAkB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IAC1D,IAAI,CAAE,MAAM,EAAE,CAAC;QACb,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAA;QACtB,OAAM;IACR,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,EAAE,CAAC;YAC9C,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/tscbuild.d.ts
CHANGED
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
import { Files } from '@plugjs/plug/files';
|
|
2
|
+
import type { Pipe } from '@plugjs/plug';
|
|
2
3
|
import type { Context, PipeParameters, Plug } from '@plugjs/plug/pipe';
|
|
4
|
+
import type { TscBuildOptions } from './index.ts';
|
|
3
5
|
export declare class TscBuild implements Plug<Files> {
|
|
4
6
|
private readonly _options;
|
|
5
7
|
constructor(...args: PipeParameters<'tscBuild'>);
|
|
6
8
|
pipe(files: Files, context: Context): Promise<Files>;
|
|
7
9
|
}
|
|
10
|
+
/** Options available for the TypeScript Builder. */
|
|
11
|
+
export interface ExtendedTscBuildOptions extends TscBuildOptions {
|
|
12
|
+
/** The directory where to look for the `tsconfig.json` files. */
|
|
13
|
+
directory?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Run `tsc --build` using `tsconfig.json` from the current directory.
|
|
17
|
+
*/
|
|
18
|
+
export declare function tscBuild(): Pipe;
|
|
19
|
+
/**
|
|
20
|
+
* Run `tsc --build` using the specified `tsconfig.json` file.
|
|
21
|
+
*/
|
|
22
|
+
export declare function tscBuild(tsconfig: string): Pipe;
|
|
23
|
+
/**
|
|
24
|
+
* Run `tsc --build` using the specified options.
|
|
25
|
+
*
|
|
26
|
+
* The `directory` option specifies where to look for the `tsconfig.json` files,
|
|
27
|
+
* and defaults to the current directory, `verbose` and `force` default to
|
|
28
|
+
* `true`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function tscBuild(options: ExtendedTscBuildOptions): Pipe;
|
|
31
|
+
/**
|
|
32
|
+
* Run `tsc --build` using the specified `tsconfig.json` and options.
|
|
33
|
+
*
|
|
34
|
+
* The `directory` option specifies where to look for the `tsconfig.json` files,
|
|
35
|
+
* and defaults to the current directory, `verbose` and `force` default to
|
|
36
|
+
* `true`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function tscBuild(tsconfig: string, options?: ExtendedTscBuildOptions): Pipe;
|
|
39
|
+
//# sourceMappingURL=tscbuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tscbuild.d.ts","sourceRoot":"","sources":["../src/tscbuild.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAM1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,qBAAa,QAAS,YAAW,IAAI,CAAC,KAAK,CAAC;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;gBAE9B,GAAG,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC;IAQzC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC;CAgE3D;AAID,oDAAoD;AACpD,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,IAAI,CAAA;AAChC;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;AAChD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAAA;AAChE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAA"}
|
package/dist/tscbuild.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { $p, assert, fail, find } from '@plugjs/plug';
|
|
2
|
+
import { Files } from '@plugjs/plug/files';
|
|
3
|
+
import ts from 'typescript';
|
|
4
|
+
import { updateReport } from "./report.js";
|
|
5
|
+
import { buildWriteFile } from "./writefile.js";
|
|
6
|
+
export class TscBuild {
|
|
7
|
+
_options;
|
|
8
|
+
constructor(...args) {
|
|
9
|
+
this._options = {
|
|
10
|
+
verbose: true,
|
|
11
|
+
force: true,
|
|
12
|
+
...(args[0] || {}),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
async pipe(files, context) {
|
|
16
|
+
const report = context.log.report('TypeScript Builder Report');
|
|
17
|
+
const builder = Files.builder(files.directory);
|
|
18
|
+
const writeFile = buildWriteFile(builder, context);
|
|
19
|
+
function reporter(diagnostic) {
|
|
20
|
+
updateReport(report, [diagnostic], files.directory, context.log);
|
|
21
|
+
}
|
|
22
|
+
const solutionBuilderHost = ts.createSolutionBuilderHost(ts.sys, // system
|
|
23
|
+
undefined, // createProgram
|
|
24
|
+
reporter, // reportDiagnostic
|
|
25
|
+
reporter);
|
|
26
|
+
const solutionBuilder = ts.createSolutionBuilder(solutionBuilderHost, [...files.absolutePaths()], this._options);
|
|
27
|
+
const exitCode = solutionBuilder.build(undefined, // project (string)
|
|
28
|
+
undefined, // cancellationToken
|
|
29
|
+
writeFile, // writeFile
|
|
30
|
+
undefined);
|
|
31
|
+
let failure;
|
|
32
|
+
switch (exitCode) {
|
|
33
|
+
case ts.ExitStatus.Success: // 0
|
|
34
|
+
context.log.info('TSC Build completed successfully');
|
|
35
|
+
failure = false;
|
|
36
|
+
break;
|
|
37
|
+
case ts.ExitStatus.DiagnosticsPresent_OutputsSkipped: // 1
|
|
38
|
+
context.log.error('TSC Build failed with errors (see report)');
|
|
39
|
+
failure = true;
|
|
40
|
+
break;
|
|
41
|
+
case ts.ExitStatus.DiagnosticsPresent_OutputsGenerated: // 2
|
|
42
|
+
context.log.warn('TSC Build completed with errors (see report)');
|
|
43
|
+
failure = true;
|
|
44
|
+
break;
|
|
45
|
+
case ts.ExitStatus.InvalidProject_OutputsSkipped: // 3
|
|
46
|
+
context.log.error('TSC Build failed due to invalid project configuration');
|
|
47
|
+
failure = true;
|
|
48
|
+
break;
|
|
49
|
+
case ts.ExitStatus.ProjectReferenceCycle_OutputsSkipped: // 4
|
|
50
|
+
context.log.error('TSC Build failed due to project reference cycle');
|
|
51
|
+
failure = true;
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
context.log.error('TSC Build failed with exit code', exitCode);
|
|
55
|
+
failure = true;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
report.done(true);
|
|
59
|
+
if (failure)
|
|
60
|
+
fail('TSC Build failed');
|
|
61
|
+
const outputs = builder.build();
|
|
62
|
+
context.log.info('TSC Build produced', outputs.length, 'files into', $p(outputs.directory));
|
|
63
|
+
return outputs;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Implementation overload
|
|
67
|
+
export function tscBuild(tsconfigOrOptions, maybeOptions) {
|
|
68
|
+
const [tsconfig, tscBuildOptions] = typeof tsconfigOrOptions === 'string'
|
|
69
|
+
? [tsconfigOrOptions, maybeOptions]
|
|
70
|
+
: ['tsconfig.json', tsconfigOrOptions];
|
|
71
|
+
const { directory, ...buildOptions } = tscBuildOptions || {};
|
|
72
|
+
return find(tsconfig, { directory })
|
|
73
|
+
.plug((files) => {
|
|
74
|
+
assert(files.length > 0, `No match for "${tsconfig}" in directory "${files.directory}"`);
|
|
75
|
+
return files;
|
|
76
|
+
})
|
|
77
|
+
.plug(new TscBuild(buildOptions));
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=tscbuild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tscbuild.js","sourceRoot":"","sources":["../src/tscbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAM/C,MAAM,OAAO,QAAQ;IACF,QAAQ,CAAiB;IAE1C,YAAY,GAAG,IAAgC;QAC7C,IAAI,CAAC,QAAQ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AAE,eAAe,CAAE,GACjC,OAAO,iBAAiB,KAAK,QAAQ;QACnC,CAAC,CAAC,CAAE,iBAAiB,EAAE,YAAY,CAAE;QACrC,CAAC,CAAC,CAAE,eAAe,EAAE,iBAAiB,CAAE,CAAA;IAE5C,MAAM,EAAE,SAAS,EAAE,GAAG,YAAY,EAAE,GAAG,eAAe,IAAI,EAAE,CAAA;IAC5D,OAAO,IAAI,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC;SAC/B,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QACd,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,iBAAiB,QAAQ,mBAAmB,KAAK,CAAC,SAAS,GAAG,CAAC,CAAA;QACxF,OAAO,KAAK,CAAA;IACd,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAA;AACvC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Files } from '@plugjs/plug/files';
|
|
2
|
+
import type { Pipe } from '@plugjs/plug';
|
|
3
|
+
import type { Context, PipeParameters, Plug } from '@plugjs/plug/pipe';
|
|
4
|
+
import type { TscCompilerOptions } from './index.ts';
|
|
5
|
+
export declare class TscCompiler implements Plug<Files> {
|
|
6
|
+
private readonly _options;
|
|
7
|
+
constructor(...args: PipeParameters<'tscCompiler'>);
|
|
8
|
+
pipe(files: Files, context: Context): Promise<Files>;
|
|
9
|
+
}
|
|
10
|
+
/** Options available for the TypeScript Compiler. */
|
|
11
|
+
export interface ExtendedTscCompilerOptions extends TscCompilerOptions {
|
|
12
|
+
/** The directory where to look for the `tsconfig.json` files. */
|
|
13
|
+
directory?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Run `tsc --project` using `tsconfig.json` from the current directory.
|
|
17
|
+
*/
|
|
18
|
+
export declare function tsc(): Pipe;
|
|
19
|
+
/**
|
|
20
|
+
* Run `tsc --project` using the specified `tsconfig.json` file.
|
|
21
|
+
*/
|
|
22
|
+
export declare function tsc(tsconfig: string): Pipe;
|
|
23
|
+
/**
|
|
24
|
+
* Run `tsc --project` using the specified options.
|
|
25
|
+
*
|
|
26
|
+
* The `directory` option specifies where to look for the `tsconfig.json` files,
|
|
27
|
+
* and defaults to the current directory, `verbose` and `force` default to
|
|
28
|
+
* `true`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function tsc(options: ExtendedTscCompilerOptions): Pipe;
|
|
31
|
+
/**
|
|
32
|
+
* Run `tsc --project` using the specified `tsconfig.json` and options.
|
|
33
|
+
*
|
|
34
|
+
* The `directory` option specifies where to look for the `tsconfig.json` files,
|
|
35
|
+
* and defaults to the current directory, `verbose` and `force` default to
|
|
36
|
+
* `true`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function tsc(tsconfig: string, options?: ExtendedTscCompilerOptions): Pipe;
|
|
39
|
+
//# sourceMappingURL=tsccompiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsccompiler.d.ts","sourceRoot":"","sources":["../src/tsccompiler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAO1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,qBAAa,WAAY,YAAW,IAAI,CAAC,KAAK,CAAC;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;gBAEjC,GAAG,IAAI,EAAE,cAAc,CAAC,aAAa,CAAC;IAQ5C,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC;CAuD3D;AAID,qDAAqD;AACrD,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,wBAAgB,GAAG,IAAI,IAAI,CAAA;AAC3B;;GAEG;AACH,wBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;AAC3C;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,0BAA0B,GAAG,IAAI,CAAA;AAC9D;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,0BAA0B,GAAG,IAAI,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { $p, assert, find } from '@plugjs/plug';
|
|
2
|
+
import { Files } from '@plugjs/plug/files';
|
|
3
|
+
import { getAbsoluteParent } from '@plugjs/plug/paths';
|
|
4
|
+
import ts from 'typescript';
|
|
5
|
+
import { updateReport } from "./report.js";
|
|
6
|
+
import { buildWriteFile } from "./writefile.js";
|
|
7
|
+
export class TscCompiler {
|
|
8
|
+
_options;
|
|
9
|
+
constructor(...args) {
|
|
10
|
+
this._options = {
|
|
11
|
+
verbose: true,
|
|
12
|
+
force: true,
|
|
13
|
+
...(args[0] || {}),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
async pipe(files, context) {
|
|
17
|
+
const report = context.log.report('TypeScript Compiler Report');
|
|
18
|
+
const builder = Files.builder(files.directory);
|
|
19
|
+
const writeFile = buildWriteFile(builder, context);
|
|
20
|
+
for (const absoluteConfigPath of files.absolutePaths()) {
|
|
21
|
+
context.log.notice('Compiling TypeScript project', $p(absoluteConfigPath));
|
|
22
|
+
const configDir = getAbsoluteParent(absoluteConfigPath);
|
|
23
|
+
/* Read the config file */
|
|
24
|
+
const configFile = ts.readConfigFile(absoluteConfigPath, ts.sys.readFile);
|
|
25
|
+
if (configFile.error) {
|
|
26
|
+
updateReport(report, [configFile.error], configDir);
|
|
27
|
+
if (report.errors)
|
|
28
|
+
report.done(true);
|
|
29
|
+
}
|
|
30
|
+
/* Parse the config file */
|
|
31
|
+
const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, // the JSON
|
|
32
|
+
ts.sys, // the system
|
|
33
|
+
configDir, // the base directory to resolve relative paths
|
|
34
|
+
this._options, // existing options to merge with
|
|
35
|
+
absoluteConfigPath);
|
|
36
|
+
if (parsedConfig.errors.length > 0) {
|
|
37
|
+
updateReport(report, parsedConfig.errors, configDir);
|
|
38
|
+
if (report.errors)
|
|
39
|
+
report.done(true);
|
|
40
|
+
}
|
|
41
|
+
/* Create the program */
|
|
42
|
+
const program = ts.createProgram({
|
|
43
|
+
rootNames: parsedConfig.fileNames,
|
|
44
|
+
options: parsedConfig.options,
|
|
45
|
+
projectReferences: parsedConfig.projectReferences,
|
|
46
|
+
configFileParsingDiagnostics: parsedConfig.errors,
|
|
47
|
+
});
|
|
48
|
+
const diagnostics = ts.getPreEmitDiagnostics(program);
|
|
49
|
+
updateReport(report, diagnostics, configDir);
|
|
50
|
+
if (report.errors)
|
|
51
|
+
report.done(true);
|
|
52
|
+
const result = program.emit(undefined, writeFile);
|
|
53
|
+
updateReport(report, result.diagnostics, configDir);
|
|
54
|
+
if (report.errors)
|
|
55
|
+
report.done(true);
|
|
56
|
+
}
|
|
57
|
+
const result = builder.build();
|
|
58
|
+
context.log.info('TSC Build produced', result.length, 'files into', $p(result.directory));
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Implementation overload
|
|
63
|
+
export function tsc(tsconfigOrOptions, maybeOptions) {
|
|
64
|
+
const [tsconfig, tscCompilerOptions] = typeof tsconfigOrOptions === 'string'
|
|
65
|
+
? [tsconfigOrOptions, maybeOptions]
|
|
66
|
+
: ['tsconfig.json', tsconfigOrOptions];
|
|
67
|
+
const { directory, ...compilerOptions } = tscCompilerOptions || {};
|
|
68
|
+
return find(tsconfig, { directory })
|
|
69
|
+
.plug((files) => {
|
|
70
|
+
assert(files.length > 0, `No match for "${tsconfig}" in directory "${files.directory}"`);
|
|
71
|
+
return files;
|
|
72
|
+
})
|
|
73
|
+
.plug(new TscCompiler(compilerOptions));
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=tsccompiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsccompiler.js","sourceRoot":"","sources":["../src/tsccompiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAM/C,MAAM,OAAO,WAAW;IACL,QAAQ,CAAoB;IAE7C,YAAY,GAAG,IAAmC;QAChD,IAAI,CAAC,QAAQ,GAAG;YACd,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;YACX,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACnB,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAY,EAAE,OAAgB;QACvC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAA;QAC/D,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC9C,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAElD,KAAK,MAAM,kBAAkB,IAAI,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC;YACvD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,8BAA8B,EAAE,EAAE,CAAC,kBAAkB,CAAC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