@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/tscbuild.cjs
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// tscbuild.ts
|
|
31
|
-
var tscbuild_exports = {};
|
|
32
|
-
__export(tscbuild_exports, {
|
|
33
|
-
TscBuild: () => TscBuild
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(tscbuild_exports);
|
|
36
|
-
var import_plug = require("@plugjs/plug");
|
|
37
|
-
var import_files = require("@plugjs/plug/files");
|
|
38
|
-
var import_typescript = __toESM(require("typescript"), 1);
|
|
39
|
-
var import_report = require("./report.cjs");
|
|
40
|
-
var import_writefile = require("./writefile.cjs");
|
|
41
|
-
var TscBuild = class {
|
|
42
|
-
_options;
|
|
43
|
-
constructor(...args) {
|
|
44
|
-
this._options = {
|
|
45
|
-
verbose: true,
|
|
46
|
-
force: true,
|
|
47
|
-
...args[0] || {}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
async pipe(files, context) {
|
|
51
|
-
const report = context.log.report("TypeScript Builder Report");
|
|
52
|
-
const builder = import_files.Files.builder(files.directory);
|
|
53
|
-
const writeFile = (0, import_writefile.buildWriteFile)(builder, context);
|
|
54
|
-
function reporter(diagnostic) {
|
|
55
|
-
(0, import_report.updateReport)(report, [diagnostic], files.directory, context.log);
|
|
56
|
-
}
|
|
57
|
-
const solutionBuilderHost = import_typescript.default.createSolutionBuilderHost(
|
|
58
|
-
import_typescript.default.sys,
|
|
59
|
-
// system
|
|
60
|
-
void 0,
|
|
61
|
-
// createProgram
|
|
62
|
-
reporter,
|
|
63
|
-
// reportDiagnostic
|
|
64
|
-
reporter,
|
|
65
|
-
// reportSolutionBuilderStatus
|
|
66
|
-
void 0
|
|
67
|
-
// reportSolutionBuilderErrorSummary
|
|
68
|
-
);
|
|
69
|
-
const solutionBuilder = import_typescript.default.createSolutionBuilder(
|
|
70
|
-
solutionBuilderHost,
|
|
71
|
-
[...files.absolutePaths()],
|
|
72
|
-
this._options
|
|
73
|
-
);
|
|
74
|
-
const exitCode = solutionBuilder.build(
|
|
75
|
-
void 0,
|
|
76
|
-
// project (string)
|
|
77
|
-
void 0,
|
|
78
|
-
// cancellationToken
|
|
79
|
-
writeFile,
|
|
80
|
-
// writeFile
|
|
81
|
-
void 0
|
|
82
|
-
// getCustomTransformers
|
|
83
|
-
);
|
|
84
|
-
let failure;
|
|
85
|
-
switch (exitCode) {
|
|
86
|
-
case import_typescript.default.ExitStatus.Success:
|
|
87
|
-
context.log.info("TSC Build completed successfully");
|
|
88
|
-
failure = false;
|
|
89
|
-
break;
|
|
90
|
-
case import_typescript.default.ExitStatus.DiagnosticsPresent_OutputsSkipped:
|
|
91
|
-
context.log.error("TSC Build failed with errors (see report)");
|
|
92
|
-
failure = true;
|
|
93
|
-
break;
|
|
94
|
-
case import_typescript.default.ExitStatus.DiagnosticsPresent_OutputsGenerated:
|
|
95
|
-
context.log.warn("TSC Build completed with errors (see report)");
|
|
96
|
-
failure = true;
|
|
97
|
-
break;
|
|
98
|
-
case import_typescript.default.ExitStatus.InvalidProject_OutputsSkipped:
|
|
99
|
-
context.log.error("TSC Build failed due to invalid project configuration");
|
|
100
|
-
failure = true;
|
|
101
|
-
break;
|
|
102
|
-
case import_typescript.default.ExitStatus.ProjectReferenceCycle_OutputsSkipped:
|
|
103
|
-
context.log.error("TSC Build failed due to project reference cycle");
|
|
104
|
-
failure = true;
|
|
105
|
-
break;
|
|
106
|
-
default:
|
|
107
|
-
context.log.error("TSC Build failed with exit code", exitCode);
|
|
108
|
-
failure = true;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
report.done(true);
|
|
112
|
-
if (failure) (0, import_plug.fail)("TSC Build failed");
|
|
113
|
-
const outputs = builder.build();
|
|
114
|
-
context.log.info("TSC Build produced", outputs.length, "files into", (0, import_plug.$p)(outputs.directory));
|
|
115
|
-
return outputs;
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
119
|
-
0 && (module.exports = {
|
|
120
|
-
TscBuild
|
|
121
|
-
});
|
|
122
|
-
//# sourceMappingURL=tscbuild.cjs.map
|
package/dist/tscbuild.cjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/tscbuild.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAyB;AACzB,mBAAsB;AACtB,wBAAe;AAEf,oBAA6B;AAC7B,uBAA+B;AAIxB,IAAM,WAAN,MAAsC;AAAA,EAC1B;AAAA,EAEjB,eAAe,MAAkC;AAC/C,SAAK,WAAW;AAAA,MACd,SAAS;AAAA,MACT,OAAO;AAAA,MACP,GAAI,KAAK,CAAC,KAAK,CAAC;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,MAAM,KAAK,OAAc,SAAkC;AACzD,UAAM,SAAS,QAAQ,IAAI,OAAO,2BAA2B;AAC7D,UAAM,UAAU,mBAAM,QAAQ,MAAM,SAAS;AAC7C,UAAM,gBAAY,iCAAe,SAAS,OAAO;AAEjD,aAAS,SAAS,YAAiC;AACjD,sCAAa,QAAQ,CAAE,UAAW,GAAG,MAAM,WAAW,QAAQ,GAAG;AAAA,IACnE;AAEA,UAAM,sBAAsB,kBAAAA,QAAG;AAAA,MAC3B,kBAAAA,QAAG;AAAA;AAAA,MACH;AAAA;AAAA,MACA;AAAA;AAAA,MACA;AAAA;AAAA,MACA;AAAA;AAAA,IACJ;AAEA,UAAM,kBAAkB,kBAAAA,QAAG;AAAA,MACvB;AAAA,MACA,CAAE,GAAG,MAAM,cAAc,CAAE;AAAA,MAC3B,KAAK;AAAA,IACT;AAEA,UAAM,WAAW,gBAAgB;AAAA,MAC7B;AAAA;AAAA,MACA;AAAA;AAAA,MACA;AAAA;AAAA,MACA;AAAA;AAAA,IACJ;AAEA,QAAI;AACJ,YAAQ,UAAU;AAAA,MAChB,KAAK,kBAAAA,QAAG,WAAW;AACjB,gBAAQ,IAAI,KAAK,kCAAkC;AACnD,kBAAU;AACV;AAAA,MACF,KAAK,kBAAAA,QAAG,WAAW;AACjB,gBAAQ,IAAI,MAAM,2CAA2C;AAC7D,kBAAU;AACV;AAAA,MACF,KAAK,kBAAAA,QAAG,WAAW;AACjB,gBAAQ,IAAI,KAAK,8CAA8C;AAC/D,kBAAU;AACV;AAAA,MACF,KAAK,kBAAAA,QAAG,WAAW;AACjB,gBAAQ,IAAI,MAAM,uDAAuD;AACzE,kBAAU;AACV;AAAA,MACF,KAAK,kBAAAA,QAAG,WAAW;AACjB,gBAAQ,IAAI,MAAM,iDAAiD;AACnE,kBAAU;AACV;AAAA,MACF;AACE,gBAAQ,IAAI,MAAM,mCAAmC,QAAQ;AAC7D,kBAAU;AACV;AAAA,IACJ;AAEA,WAAO,KAAK,IAAI;AAChB,QAAI,QAAS,uBAAK,kBAAkB;AAEpC,UAAM,UAAU,QAAQ,MAAM;AAC9B,YAAQ,IAAI,KAAK,sBAAsB,QAAQ,QAAQ,kBAAc,gBAAG,QAAQ,SAAS,CAAC;AAC1F,WAAO;AAAA,EACT;AACF;",
|
|
5
|
-
"names": ["ts"]
|
|
6
|
-
}
|
package/dist/tscbuild.mjs
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// tscbuild.ts
|
|
2
|
-
import { $p, fail } from "@plugjs/plug";
|
|
3
|
-
import { Files } from "@plugjs/plug/files";
|
|
4
|
-
import ts from "typescript";
|
|
5
|
-
import { updateReport } from "./report.mjs";
|
|
6
|
-
import { buildWriteFile } from "./writefile.mjs";
|
|
7
|
-
var TscBuild = class {
|
|
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 Builder Report");
|
|
18
|
-
const builder = Files.builder(files.directory);
|
|
19
|
-
const writeFile = buildWriteFile(builder, context);
|
|
20
|
-
function reporter(diagnostic) {
|
|
21
|
-
updateReport(report, [diagnostic], files.directory, context.log);
|
|
22
|
-
}
|
|
23
|
-
const solutionBuilderHost = ts.createSolutionBuilderHost(
|
|
24
|
-
ts.sys,
|
|
25
|
-
// system
|
|
26
|
-
void 0,
|
|
27
|
-
// createProgram
|
|
28
|
-
reporter,
|
|
29
|
-
// reportDiagnostic
|
|
30
|
-
reporter,
|
|
31
|
-
// reportSolutionBuilderStatus
|
|
32
|
-
void 0
|
|
33
|
-
// reportSolutionBuilderErrorSummary
|
|
34
|
-
);
|
|
35
|
-
const solutionBuilder = ts.createSolutionBuilder(
|
|
36
|
-
solutionBuilderHost,
|
|
37
|
-
[...files.absolutePaths()],
|
|
38
|
-
this._options
|
|
39
|
-
);
|
|
40
|
-
const exitCode = solutionBuilder.build(
|
|
41
|
-
void 0,
|
|
42
|
-
// project (string)
|
|
43
|
-
void 0,
|
|
44
|
-
// cancellationToken
|
|
45
|
-
writeFile,
|
|
46
|
-
// writeFile
|
|
47
|
-
void 0
|
|
48
|
-
// getCustomTransformers
|
|
49
|
-
);
|
|
50
|
-
let failure;
|
|
51
|
-
switch (exitCode) {
|
|
52
|
-
case ts.ExitStatus.Success:
|
|
53
|
-
context.log.info("TSC Build completed successfully");
|
|
54
|
-
failure = false;
|
|
55
|
-
break;
|
|
56
|
-
case ts.ExitStatus.DiagnosticsPresent_OutputsSkipped:
|
|
57
|
-
context.log.error("TSC Build failed with errors (see report)");
|
|
58
|
-
failure = true;
|
|
59
|
-
break;
|
|
60
|
-
case ts.ExitStatus.DiagnosticsPresent_OutputsGenerated:
|
|
61
|
-
context.log.warn("TSC Build completed with errors (see report)");
|
|
62
|
-
failure = true;
|
|
63
|
-
break;
|
|
64
|
-
case ts.ExitStatus.InvalidProject_OutputsSkipped:
|
|
65
|
-
context.log.error("TSC Build failed due to invalid project configuration");
|
|
66
|
-
failure = true;
|
|
67
|
-
break;
|
|
68
|
-
case ts.ExitStatus.ProjectReferenceCycle_OutputsSkipped:
|
|
69
|
-
context.log.error("TSC Build failed due to project reference cycle");
|
|
70
|
-
failure = true;
|
|
71
|
-
break;
|
|
72
|
-
default:
|
|
73
|
-
context.log.error("TSC Build failed with exit code", exitCode);
|
|
74
|
-
failure = true;
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
report.done(true);
|
|
78
|
-
if (failure) fail("TSC Build failed");
|
|
79
|
-
const outputs = builder.build();
|
|
80
|
-
context.log.info("TSC Build produced", outputs.length, "files into", $p(outputs.directory));
|
|
81
|
-
return outputs;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
export {
|
|
85
|
-
TscBuild
|
|
86
|
-
};
|
|
87
|
-
//# sourceMappingURL=tscbuild.mjs.map
|
package/dist/tscbuild.mjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/tscbuild.ts"],
|
|
4
|
-
"mappings": ";AAAA,SAAS,IAAI,YAAY;AACzB,SAAS,aAAa;AACtB,OAAO,QAAQ;AAEf,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAIxB,IAAM,WAAN,MAAsC;AAAA,EAC1B;AAAA,EAEjB,eAAe,MAAkC;AAC/C,SAAK,WAAW;AAAA,MACd,SAAS;AAAA,MACT,OAAO;AAAA,MACP,GAAI,KAAK,CAAC,KAAK,CAAC;AAAA,IAClB;AAAA,EACF;AAAA,EAEA,MAAM,KAAK,OAAc,SAAkC;AACzD,UAAM,SAAS,QAAQ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,QAAQ,SAAS,CAAC;AAC1F,WAAO;AAAA,EACT;AACF;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/typescript.cjs
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// typescript.ts
|
|
31
|
-
var typescript_exports = {};
|
|
32
|
-
__export(typescript_exports, {
|
|
33
|
-
Tsc: () => Tsc
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(typescript_exports);
|
|
36
|
-
var import_asserts = require("@plugjs/plug/asserts");
|
|
37
|
-
var import_files = require("@plugjs/plug/files");
|
|
38
|
-
var import_logging = require("@plugjs/plug/logging");
|
|
39
|
-
var import_paths = require("@plugjs/plug/paths");
|
|
40
|
-
var import_utils = require("@plugjs/plug/utils");
|
|
41
|
-
var import_typescript = __toESM(require("typescript"), 1);
|
|
42
|
-
var import_compiler = require("./compiler.cjs");
|
|
43
|
-
var import_options = require("./options.cjs");
|
|
44
|
-
var import_report = require("./report.cjs");
|
|
45
|
-
var import_writefile = require("./writefile.cjs");
|
|
46
|
-
function defaultRootDir(paths) {
|
|
47
|
-
const [firstPath, ...restPaths] = paths.filter((path) => {
|
|
48
|
-
return !path.match(/\.d\.[mc]?ts$/i);
|
|
49
|
-
});
|
|
50
|
-
(0, import_asserts.assert)(firstPath, "No non-declaration files found to compile");
|
|
51
|
-
if (restPaths.length) return (0, import_paths.commonPath)(firstPath, ...restPaths);
|
|
52
|
-
return (0, import_paths.getAbsoluteParent)(firstPath);
|
|
53
|
-
}
|
|
54
|
-
var Tsc = class {
|
|
55
|
-
_tsconfig;
|
|
56
|
-
_options;
|
|
57
|
-
constructor(...args) {
|
|
58
|
-
const { params: [tsconfig], options } = (0, import_utils.parseOptions)(args, {});
|
|
59
|
-
this._tsconfig = tsconfig;
|
|
60
|
-
this._options = options;
|
|
61
|
-
}
|
|
62
|
-
async pipe(files, context) {
|
|
63
|
-
const paths = [...files.absolutePaths()];
|
|
64
|
-
const report = context.log.report("TypeScript Report");
|
|
65
|
-
const { extraTypesDir, ...__overrides } = { ...this._options };
|
|
66
|
-
if (extraTypesDir) {
|
|
67
|
-
const directory = context.resolve(extraTypesDir);
|
|
68
|
-
for await (const file of (0, import_utils.walk)(directory, ["**/*.d.ts"])) {
|
|
69
|
-
const path = (0, import_paths.resolveAbsolutePath)(directory, file);
|
|
70
|
-
context.log.debug(`Including extra type file "${(0, import_logging.$p)(path)}"`);
|
|
71
|
-
paths.push(path);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const sourcesConfig = (0, import_paths.resolveFile)(files.directory, "tsconfig.json");
|
|
75
|
-
const tsconfig = this._tsconfig ? context.resolve(this._tsconfig) : sourcesConfig || (0, import_paths.resolveFile)(context.resolve("tsconfig.json"));
|
|
76
|
-
if (__overrides.rootDir) {
|
|
77
|
-
__overrides.rootDir = context.resolve(__overrides.rootDir);
|
|
78
|
-
}
|
|
79
|
-
if (__overrides.outDir) {
|
|
80
|
-
__overrides.outDir = context.resolve(__overrides.outDir);
|
|
81
|
-
}
|
|
82
|
-
if (__overrides.rootDirs) {
|
|
83
|
-
__overrides.rootDirs = __overrides.rootDirs.map((dir) => context.resolve(dir));
|
|
84
|
-
}
|
|
85
|
-
if (__overrides.baseUrl) __overrides.baseUrl = context.resolve(__overrides.baseUrl);
|
|
86
|
-
if (__overrides.outFile) __overrides.outFile = context.resolve(__overrides.outFile);
|
|
87
|
-
const { errors, options, projectReferences } = await (0, import_options.getCompilerOptions)(
|
|
88
|
-
tsconfig,
|
|
89
|
-
// resolved tsconfig.json from constructor, might be undefined
|
|
90
|
-
__overrides,
|
|
91
|
-
paths
|
|
92
|
-
);
|
|
93
|
-
(0, import_report.updateReport)(report, errors, context.resolve("."));
|
|
94
|
-
if (report.errors) report.done(true);
|
|
95
|
-
for (const path of paths) context.log.debug(`Compiling "${(0, import_logging.$p)(path)}"`);
|
|
96
|
-
context.log.info("Compiling", paths.length, "files");
|
|
97
|
-
if (extraTypesDir) {
|
|
98
|
-
const directory = context.resolve(extraTypesDir);
|
|
99
|
-
for await (const file of (0, import_utils.walk)(directory, ["**/*.d.ts"])) {
|
|
100
|
-
const path = (0, import_paths.resolveAbsolutePath)(directory, file);
|
|
101
|
-
context.log.debug(`Including extra type file "${(0, import_logging.$p)(path)}"`);
|
|
102
|
-
paths.push(path);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
const rootDir = options.rootDir ? context.resolve(options.rootDir) : defaultRootDir(paths);
|
|
106
|
-
if (!(options.rootDir || options.rootDirs)) options.rootDir = rootDir;
|
|
107
|
-
const outDir = options.outDir ? context.resolve(options.outDir) : rootDir;
|
|
108
|
-
if (!(options.outDir || options.outFile)) options.outDir = outDir;
|
|
109
|
-
context.log.info("Compliation options", options);
|
|
110
|
-
if (projectReferences?.length) context.log.info("Project references", projectReferences);
|
|
111
|
-
const host = new import_compiler.TypeScriptHost(rootDir);
|
|
112
|
-
const program = import_typescript.default.createProgram({
|
|
113
|
-
configFileParsingDiagnostics: errors,
|
|
114
|
-
rootNames: paths,
|
|
115
|
-
projectReferences,
|
|
116
|
-
options,
|
|
117
|
-
host
|
|
118
|
-
});
|
|
119
|
-
const diagnostics = import_typescript.default.getPreEmitDiagnostics(program);
|
|
120
|
-
(0, import_report.updateReport)(report, diagnostics, rootDir);
|
|
121
|
-
if (report.errors) report.done(true);
|
|
122
|
-
const builder = import_files.Files.builder(outDir);
|
|
123
|
-
const writeFile = (0, import_writefile.buildWriteFile)(builder, context);
|
|
124
|
-
const result = program.emit(void 0, writeFile);
|
|
125
|
-
(0, import_report.updateReport)(report, result.diagnostics, rootDir);
|
|
126
|
-
if (report.errors) report.done(true);
|
|
127
|
-
const outputs = builder.build();
|
|
128
|
-
context.log.info("TSC produced", outputs.length, "files into", (0, import_logging.$p)(outputs.directory));
|
|
129
|
-
return outputs;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
133
|
-
0 && (module.exports = {
|
|
134
|
-
Tsc
|
|
135
|
-
});
|
|
136
|
-
//# sourceMappingURL=typescript.cjs.map
|
package/dist/typescript.cjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/typescript.ts"],
|
|
4
|
-
"mappings":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QAAQ,SAAS,QAAQ,QAAQ,QAAQ,MAAM,IAAI;AAClE,QAAI,EAAE,QAAQ,UAAU,QAAQ,SAAU,SAAQ,SAAS;AAG3D,YAAQ,IAAI,KAAK,uBAAuB,OAAO;AAC/C,QAAI,mBAAmB,OAAQ,SAAQ,IAAI,KAAK,sBAAsB,iBAAiB;AAGvF,UAAM,OAAO,IAAI,+BAAe,OAAO;AACvC,UAAM,UAAU,kBAAAA,QAAG,cAAc;AAAA,MAC/B,8BAA8B;AAAA,MAC9B,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AACD,UAAM,cAAc,kBAAAA,QAAG,sBAAsB,OAAO;AAGpD,oCAAa,QAAQ,aAAa,OAAO;AACzC,QAAI,OAAO,OAAQ,QAAO,KAAK,IAAI;AAGnC,UAAM,UAAU,mBAAM,QAAQ,MAAM;AACpC,UAAM,gBAAY,iCAAe,SAAS,OAAO;AACjD,UAAM,SAAS,QAAQ,KAAK,QAAW,SAAS;AAGhD,oCAAa,QAAQ,OAAO,aAAa,OAAO;AAEhD,QAAI,OAAO,OAAQ,QAAO,KAAK,IAAI;AAGnC,UAAM,UAAU,QAAQ,MAAM;AAC9B,YAAQ,IAAI,KAAK,gBAAgB,QAAQ,QAAQ,kBAAc,mBAAG,QAAQ,SAAS,CAAC;AACpF,WAAO;AAAA,EACT;AACF;",
|
|
5
|
-
"names": ["ts"]
|
|
6
|
-
}
|
package/dist/typescript.mjs
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// typescript.ts
|
|
2
|
-
import { assert } from "@plugjs/plug/asserts";
|
|
3
|
-
import { Files } from "@plugjs/plug/files";
|
|
4
|
-
import { $p } from "@plugjs/plug/logging";
|
|
5
|
-
import { commonPath, getAbsoluteParent, resolveAbsolutePath, resolveFile } from "@plugjs/plug/paths";
|
|
6
|
-
import { parseOptions, walk } from "@plugjs/plug/utils";
|
|
7
|
-
import ts from "typescript";
|
|
8
|
-
import { TypeScriptHost } from "./compiler.mjs";
|
|
9
|
-
import { getCompilerOptions } from "./options.mjs";
|
|
10
|
-
import { updateReport } from "./report.mjs";
|
|
11
|
-
import { buildWriteFile } from "./writefile.mjs";
|
|
12
|
-
function defaultRootDir(paths) {
|
|
13
|
-
const [firstPath, ...restPaths] = paths.filter((path) => {
|
|
14
|
-
return !path.match(/\.d\.[mc]?ts$/i);
|
|
15
|
-
});
|
|
16
|
-
assert(firstPath, "No non-declaration files found to compile");
|
|
17
|
-
if (restPaths.length) return commonPath(firstPath, ...restPaths);
|
|
18
|
-
return getAbsoluteParent(firstPath);
|
|
19
|
-
}
|
|
20
|
-
var Tsc = class {
|
|
21
|
-
_tsconfig;
|
|
22
|
-
_options;
|
|
23
|
-
constructor(...args) {
|
|
24
|
-
const { params: [tsconfig], options } = parseOptions(args, {});
|
|
25
|
-
this._tsconfig = tsconfig;
|
|
26
|
-
this._options = options;
|
|
27
|
-
}
|
|
28
|
-
async pipe(files, context) {
|
|
29
|
-
const paths = [...files.absolutePaths()];
|
|
30
|
-
const report = context.log.report("TypeScript Report");
|
|
31
|
-
const { extraTypesDir, ...__overrides } = { ...this._options };
|
|
32
|
-
if (extraTypesDir) {
|
|
33
|
-
const directory = context.resolve(extraTypesDir);
|
|
34
|
-
for await (const file of walk(directory, ["**/*.d.ts"])) {
|
|
35
|
-
const path = resolveAbsolutePath(directory, file);
|
|
36
|
-
context.log.debug(`Including extra type file "${$p(path)}"`);
|
|
37
|
-
paths.push(path);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const sourcesConfig = resolveFile(files.directory, "tsconfig.json");
|
|
41
|
-
const tsconfig = this._tsconfig ? context.resolve(this._tsconfig) : sourcesConfig || resolveFile(context.resolve("tsconfig.json"));
|
|
42
|
-
if (__overrides.rootDir) {
|
|
43
|
-
__overrides.rootDir = context.resolve(__overrides.rootDir);
|
|
44
|
-
}
|
|
45
|
-
if (__overrides.outDir) {
|
|
46
|
-
__overrides.outDir = context.resolve(__overrides.outDir);
|
|
47
|
-
}
|
|
48
|
-
if (__overrides.rootDirs) {
|
|
49
|
-
__overrides.rootDirs = __overrides.rootDirs.map((dir) => context.resolve(dir));
|
|
50
|
-
}
|
|
51
|
-
if (__overrides.baseUrl) __overrides.baseUrl = context.resolve(__overrides.baseUrl);
|
|
52
|
-
if (__overrides.outFile) __overrides.outFile = context.resolve(__overrides.outFile);
|
|
53
|
-
const { errors, options, projectReferences } = await getCompilerOptions(
|
|
54
|
-
tsconfig,
|
|
55
|
-
// resolved tsconfig.json from constructor, might be undefined
|
|
56
|
-
__overrides,
|
|
57
|
-
paths
|
|
58
|
-
);
|
|
59
|
-
updateReport(report, errors, context.resolve("."));
|
|
60
|
-
if (report.errors) report.done(true);
|
|
61
|
-
for (const path of paths) context.log.debug(`Compiling "${$p(path)}"`);
|
|
62
|
-
context.log.info("Compiling", paths.length, "files");
|
|
63
|
-
if (extraTypesDir) {
|
|
64
|
-
const directory = context.resolve(extraTypesDir);
|
|
65
|
-
for await (const file of walk(directory, ["**/*.d.ts"])) {
|
|
66
|
-
const path = resolveAbsolutePath(directory, file);
|
|
67
|
-
context.log.debug(`Including extra type file "${$p(path)}"`);
|
|
68
|
-
paths.push(path);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
const rootDir = options.rootDir ? context.resolve(options.rootDir) : defaultRootDir(paths);
|
|
72
|
-
if (!(options.rootDir || options.rootDirs)) options.rootDir = rootDir;
|
|
73
|
-
const outDir = options.outDir ? context.resolve(options.outDir) : rootDir;
|
|
74
|
-
if (!(options.outDir || options.outFile)) options.outDir = outDir;
|
|
75
|
-
context.log.info("Compliation options", options);
|
|
76
|
-
if (projectReferences?.length) context.log.info("Project references", projectReferences);
|
|
77
|
-
const host = new TypeScriptHost(rootDir);
|
|
78
|
-
const program = ts.createProgram({
|
|
79
|
-
configFileParsingDiagnostics: errors,
|
|
80
|
-
rootNames: paths,
|
|
81
|
-
projectReferences,
|
|
82
|
-
options,
|
|
83
|
-
host
|
|
84
|
-
});
|
|
85
|
-
const diagnostics = ts.getPreEmitDiagnostics(program);
|
|
86
|
-
updateReport(report, diagnostics, rootDir);
|
|
87
|
-
if (report.errors) report.done(true);
|
|
88
|
-
const builder = Files.builder(outDir);
|
|
89
|
-
const writeFile = buildWriteFile(builder, context);
|
|
90
|
-
const result = program.emit(void 0, writeFile);
|
|
91
|
-
updateReport(report, result.diagnostics, rootDir);
|
|
92
|
-
if (report.errors) report.done(true);
|
|
93
|
-
const outputs = builder.build();
|
|
94
|
-
context.log.info("TSC produced", outputs.length, "files into", $p(outputs.directory));
|
|
95
|
-
return outputs;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
export {
|
|
99
|
-
Tsc
|
|
100
|
-
};
|
|
101
|
-
//# sourceMappingURL=typescript.mjs.map
|
package/dist/typescript.mjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/typescript.ts"],
|
|
4
|
-
"mappings": ";AAAA,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,YAAY,mBAAmB,qBAAqB,mBAAmB;AAChF,SAAS,cAAc,YAAY;AACnC,OAAO,QAAQ;AAEf,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAW/B,SAAS,eAAe,OAAqC;AAC3D,QAAM,CAAE,WAAW,GAAG,SAAU,IAAI,MAAM,OAAO,CAAC,SAAS;AACzD,WAAO,CAAE,KAAK,MAAM,gBAAgB;AAAA,EACtC,CAAC;AAED,SAAO,WAAW,2CAA2C;AAC7D,MAAI,UAAU,OAAQ,QAAO,WAAW,WAAW,GAAG,SAAS;AAC/D,SAAO,kBAAkB,SAAS;AACpC;AAEO,IAAM,MAAN,MAAiC;AAAA,EACrB;AAAA,EACA;AAAA,EAEjB,eAAe,MAA6B;AAC1C,UAAM,EAAE,QAAQ,CAAE,QAAS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hD,iBAAa,QAAQ,OAAO,aAAa,OAAO;AAEhD,QAAI,OAAO,OAAQ,QAAO,KAAK,IAAI;AAGnC,UAAM,UAAU,QAAQ,MAAM;AAC9B,YAAQ,IAAI,KAAK,gBAAgB,QAAQ,QAAQ,cAAc,GAAG,QAAQ,SAAS,CAAC;AACpF,WAAO;AAAA,EACT;AACF;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
package/dist/writefile.cjs
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// writefile.ts
|
|
31
|
-
var writefile_exports = {};
|
|
32
|
-
__export(writefile_exports, {
|
|
33
|
-
buildWriteFile: () => buildWriteFile
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(writefile_exports);
|
|
36
|
-
var import_plug = require("@plugjs/plug");
|
|
37
|
-
var import_paths = require("@plugjs/plug/paths");
|
|
38
|
-
var import_typescript = __toESM(require("typescript"), 1);
|
|
39
|
-
function buildWriteFile(builder, context) {
|
|
40
|
-
return function writeFile(fileName, code, writeBOM, onError) {
|
|
41
|
-
const outFile = (0, import_paths.resolveAbsolutePath)(builder.directory, fileName);
|
|
42
|
-
try {
|
|
43
|
-
import_typescript.default.sys.writeFile(outFile, code, writeBOM);
|
|
44
|
-
builder.add(outFile);
|
|
45
|
-
} catch (error) {
|
|
46
|
-
context.log.error("Error writing to", (0, import_plug.$p)(outFile), error);
|
|
47
|
-
if (onError && error.message) onError(error.message);
|
|
48
|
-
throw error;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {
|
|
54
|
-
buildWriteFile
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=writefile.cjs.map
|
package/dist/writefile.cjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/writefile.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAoC;AACpC,wBAAe;AAMR,SAAS,eACZ,SACA,SACoB;AACtB,SAAO,SAAS,UACZ,UACA,MACA,UACA,SACI;AACN,UAAM,cAAU,kCAAoB,QAAQ,WAAW,QAAQ;AAE/D,QAAI;AACF,wBAAAA,QAAG,IAAI,UAAU,SAAS,MAAM,QAAQ;AACxC,cAAQ,IAAI,OAAO;AAAA,IACrB,SAAS,OAAY;AACnB,cAAQ,IAAI,MAAM,wBAAoB,gBAAG,OAAO,GAAG,KAAK;AACxD,UAAI,WAAW,MAAM,QAAS,SAAQ,MAAM,OAAO;AACnD,YAAM;AAAA,IACR;AAAA,EACF;AACF;",
|
|
5
|
-
"names": ["ts"]
|
|
6
|
-
}
|
package/dist/writefile.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// writefile.ts
|
|
2
|
-
import { $p } from "@plugjs/plug";
|
|
3
|
-
import { resolveAbsolutePath } from "@plugjs/plug/paths";
|
|
4
|
-
import ts from "typescript";
|
|
5
|
-
function buildWriteFile(builder, context) {
|
|
6
|
-
return function writeFile(fileName, code, writeBOM, onError) {
|
|
7
|
-
const outFile = resolveAbsolutePath(builder.directory, fileName);
|
|
8
|
-
try {
|
|
9
|
-
ts.sys.writeFile(outFile, code, writeBOM);
|
|
10
|
-
builder.add(outFile);
|
|
11
|
-
} catch (error) {
|
|
12
|
-
context.log.error("Error writing to", $p(outFile), error);
|
|
13
|
-
if (onError && error.message) onError(error.message);
|
|
14
|
-
throw error;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
buildWriteFile
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=writefile.mjs.map
|
package/dist/writefile.mjs.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/writefile.ts"],
|
|
4
|
-
"mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,2BAA2B;AACpC,OAAO,QAAQ;AAMR,SAAS,eACZ,SACA,SACoB;AACtB,SAAO,SAAS,UACZ,UACA,MACA,UACA,SACI;AACN,UAAM,UAAU,oBAAoB,QAAQ,WAAW,QAAQ;AAE/D,QAAI;AACF,SAAG,IAAI,UAAU,SAAS,MAAM,QAAQ;AACxC,cAAQ,IAAI,OAAO;AAAA,IACrB,SAAS,OAAY;AACnB,cAAQ,IAAI,MAAM,oBAAoB,GAAG,OAAO,GAAG,KAAK;AACxD,UAAI,WAAW,MAAM,QAAS,SAAQ,MAAM,OAAO;AACnD,YAAM;AAAA,IACR;AAAA,EACF;AACF;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|