@plugjs/typescript 0.6.116 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/compiler.d.ts +1 -0
  2. package/dist/compiler.d.ts.map +1 -0
  3. package/dist/compiler.js +61 -0
  4. package/dist/compiler.js.map +1 -0
  5. package/dist/index.d.ts +34 -35
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +9 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/options.d.ts +1 -0
  10. package/dist/options.d.ts.map +1 -0
  11. package/dist/options.js +39 -0
  12. package/dist/options.js.map +1 -0
  13. package/dist/report.d.ts +1 -0
  14. package/dist/report.d.ts.map +1 -0
  15. package/dist/report.js +84 -0
  16. package/dist/report.js.map +1 -0
  17. package/dist/tscbuild.d.ts +32 -0
  18. package/dist/tscbuild.d.ts.map +1 -0
  19. package/dist/tscbuild.js +79 -0
  20. package/dist/tscbuild.js.map +1 -0
  21. package/dist/tsccompiler.d.ts +39 -0
  22. package/dist/tsccompiler.d.ts.map +1 -0
  23. package/dist/tsccompiler.js +75 -0
  24. package/dist/tsccompiler.js.map +1 -0
  25. package/dist/typescript.d.ts +1 -0
  26. package/dist/typescript.d.ts.map +1 -0
  27. package/dist/typescript.js +135 -0
  28. package/dist/typescript.js.map +1 -0
  29. package/dist/writefile.d.ts +1 -0
  30. package/dist/writefile.d.ts.map +1 -0
  31. package/dist/writefile.js +21 -0
  32. package/dist/writefile.js.map +1 -0
  33. package/package.json +12 -22
  34. package/src/index.ts +42 -52
  35. package/src/report.ts +2 -7
  36. package/src/tscbuild.ts +56 -4
  37. package/src/tsccompiler.ts +130 -0
  38. package/src/typescript.ts +5 -6
  39. package/dist/compiler.cjs +0 -100
  40. package/dist/compiler.cjs.map +0 -6
  41. package/dist/compiler.mjs +0 -65
  42. package/dist/compiler.mjs.map +0 -6
  43. package/dist/index.cjs +0 -40
  44. package/dist/index.cjs.map +0 -6
  45. package/dist/index.mjs +0 -15
  46. package/dist/index.mjs.map +0 -6
  47. package/dist/options.cjs +0 -75
  48. package/dist/options.cjs.map +0 -6
  49. package/dist/options.mjs +0 -40
  50. package/dist/options.mjs.map +0 -6
  51. package/dist/report.cjs +0 -117
  52. package/dist/report.cjs.map +0 -6
  53. package/dist/report.mjs +0 -82
  54. package/dist/report.mjs.map +0 -6
  55. package/dist/tscbuild.cjs +0 -122
  56. package/dist/tscbuild.cjs.map +0 -6
  57. package/dist/tscbuild.mjs +0 -87
  58. package/dist/tscbuild.mjs.map +0 -6
  59. package/dist/typescript.cjs +0 -136
  60. package/dist/typescript.cjs.map +0 -6
  61. package/dist/typescript.mjs +0 -101
  62. package/dist/typescript.mjs.map +0 -6
  63. package/dist/writefile.cjs +0 -56
  64. package/dist/writefile.cjs.map +0 -6
  65. package/dist/writefile.mjs +0 -21
  66. package/dist/writefile.mjs.map +0 -6
package/dist/compiler.cjs DELETED
@@ -1,100 +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
- // compiler.ts
31
- var compiler_exports = {};
32
- __export(compiler_exports, {
33
- TypeScriptHost: () => TypeScriptHost
34
- });
35
- module.exports = __toCommonJS(compiler_exports);
36
- var import_paths = require("@plugjs/plug/paths");
37
- var import_typescript = __toESM(require("typescript"), 1);
38
- var TypeScriptHost = class {
39
- constructor(_directory) {
40
- this._directory = _directory;
41
- }
42
- _directory;
43
- /* ======================================================================== */
44
- /** Get a source file parsing one of our virtual files */
45
- getSourceFile(fileName, languageVersion) {
46
- const code = this.readFile(fileName);
47
- if (code == null) return void 0;
48
- return import_typescript.default.createSourceFile(fileName, code, languageVersion);
49
- }
50
- readDirectory(rootDir, extensions, excludes, includes, depth) {
51
- return import_typescript.default.sys.readDirectory(
52
- (0, import_paths.resolveAbsolutePath)(this._directory, rootDir),
53
- extensions,
54
- excludes,
55
- includes,
56
- depth
57
- );
58
- }
59
- /* coverage ignore next */
60
- /** Never write any files */
61
- writeFile(fileName) {
62
- throw new Error(`Cowardly refusing to write "${fileName}"`);
63
- }
64
- /** Get the default library associated with the given options */
65
- getDefaultLibFileName(options) {
66
- return import_typescript.default.getDefaultLibFilePath(options);
67
- }
68
- /** Check for filesystem case sensitivity */
69
- useCaseSensitiveFileNames() {
70
- return import_typescript.default.sys.useCaseSensitiveFileNames;
71
- }
72
- /** Check for the existence of a given file */
73
- fileExists(fileName) {
74
- return import_typescript.default.sys.fileExists((0, import_paths.resolveAbsolutePath)(this._directory, fileName));
75
- }
76
- /** Read the file if it exists, otherwise return undefined */
77
- readFile(fileName) {
78
- return import_typescript.default.sys.readFile((0, import_paths.resolveAbsolutePath)(this._directory, fileName));
79
- }
80
- /** Return the current working directory */
81
- getCurrentDirectory() {
82
- return this._directory;
83
- }
84
- /** Return the canonical name for the specified file */
85
- getCanonicalFileName(fileName) {
86
- if (import_typescript.default.sys.useCaseSensitiveFileNames) return fileName;
87
- const fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
88
- return fileNameLowerCaseRegExp.test(fileName) ? fileName.replace(fileNameLowerCaseRegExp, (s) => s.toLowerCase()) : fileName;
89
- }
90
- /* coverage ignore next */
91
- /** Return the new line sequence used by this platform */
92
- getNewLine() {
93
- return import_typescript.default.sys.newLine;
94
- }
95
- };
96
- // Annotate the CommonJS export names for ESM import in node:
97
- 0 && (module.exports = {
98
- TypeScriptHost
99
- });
100
- //# sourceMappingURL=compiler.cjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/compiler.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AACpC,wBAAe;AAIR,IAAM,iBAAN,MACoB;AAAA,EAEzB,YAA6B,YAA0B;AAA1B;AAAA,EAA2B;AAAA,EAA3B;AAAA;AAAA;AAAA,EAK7B,cACI,UACA,iBACyB;AAC3B,UAAM,OAAO,KAAK,SAAS,QAAQ;AACnC,QAAI,QAAQ,KAAM,QAAO;AACzB,WAAO,kBAAAA,QAAG,iBAAiB,UAAU,MAAM,eAAe;AAAA,EAC5D;AAAA,EAEA,cACI,SACA,YACA,UACA,UACA,OACQ;AACV,WAAO,kBAAAA,QAAG,IAAI;AAAA,UACV,kCAAoB,KAAK,YAAY,OAAO;AAAA,MAC5C;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACF;AAAA;AAAA;AAAA,EAIA,UAAU,UAAwB;AAChC,UAAM,IAAI,MAAM,+BAA+B,QAAQ,GAAG;AAAA,EAC5D;AAAA;AAAA,EAGA,sBAAsB,SAAqC;AACzD,WAAO,kBAAAA,QAAG,sBAAsB,OAAO;AAAA,EACzC;AAAA;AAAA,EAGA,4BAAqC;AACnC,WAAO,kBAAAA,QAAG,IAAI;AAAA,EAChB;AAAA;AAAA,EAGA,WAAW,UAA2B;AACpC,WAAO,kBAAAA,QAAG,IAAI,eAAW,kCAAoB,KAAK,YAAY,QAAQ,CAAC;AAAA,EACzE;AAAA;AAAA,EAGA,SAAS,UAAsC;AAC7C,WAAO,kBAAAA,QAAG,IAAI,aAAS,kCAAoB,KAAK,YAAY,QAAQ,CAAC;AAAA,EACvE;AAAA;AAAA,EAGA,sBAAoC;AAClC,WAAO,KAAK;AAAA,EACd;AAAA;AAAA,EAGA,qBAAqB,UAA0B;AAE7C,QAAI,kBAAAA,QAAG,IAAI,0BAA2B,QAAO;AAG7C,UAAM,0BAA0B;AAChC,WAAO,wBAAwB,KAAK,QAAQ,IAC1C,SAAS,QAAQ,yBAAyB,CAAC,MAAM,EAAE,YAAY,CAAC,IAChE;AAAA,EACJ;AAAA;AAAA;AAAA,EAIA,aAAqB;AACnB,WAAO,kBAAAA,QAAG,IAAI;AAAA,EAChB;AACF;",
5
- "names": ["ts"]
6
- }
package/dist/compiler.mjs DELETED
@@ -1,65 +0,0 @@
1
- // compiler.ts
2
- import { resolveAbsolutePath } from "@plugjs/plug/paths";
3
- import ts from "typescript";
4
- var TypeScriptHost = class {
5
- constructor(_directory) {
6
- this._directory = _directory;
7
- }
8
- _directory;
9
- /* ======================================================================== */
10
- /** Get a source file parsing one of our virtual files */
11
- getSourceFile(fileName, languageVersion) {
12
- const code = this.readFile(fileName);
13
- if (code == null) return void 0;
14
- return ts.createSourceFile(fileName, code, languageVersion);
15
- }
16
- readDirectory(rootDir, extensions, excludes, includes, depth) {
17
- return ts.sys.readDirectory(
18
- resolveAbsolutePath(this._directory, rootDir),
19
- extensions,
20
- excludes,
21
- includes,
22
- depth
23
- );
24
- }
25
- /* coverage ignore next */
26
- /** Never write any files */
27
- writeFile(fileName) {
28
- throw new Error(`Cowardly refusing to write "${fileName}"`);
29
- }
30
- /** Get the default library associated with the given options */
31
- getDefaultLibFileName(options) {
32
- return ts.getDefaultLibFilePath(options);
33
- }
34
- /** Check for filesystem case sensitivity */
35
- useCaseSensitiveFileNames() {
36
- return ts.sys.useCaseSensitiveFileNames;
37
- }
38
- /** Check for the existence of a given file */
39
- fileExists(fileName) {
40
- return ts.sys.fileExists(resolveAbsolutePath(this._directory, fileName));
41
- }
42
- /** Read the file if it exists, otherwise return undefined */
43
- readFile(fileName) {
44
- return ts.sys.readFile(resolveAbsolutePath(this._directory, fileName));
45
- }
46
- /** Return the current working directory */
47
- getCurrentDirectory() {
48
- return this._directory;
49
- }
50
- /** Return the canonical name for the specified file */
51
- getCanonicalFileName(fileName) {
52
- if (ts.sys.useCaseSensitiveFileNames) return fileName;
53
- const fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;
54
- return fileNameLowerCaseRegExp.test(fileName) ? fileName.replace(fileNameLowerCaseRegExp, (s) => s.toLowerCase()) : fileName;
55
- }
56
- /* coverage ignore next */
57
- /** Return the new line sequence used by this platform */
58
- getNewLine() {
59
- return ts.sys.newLine;
60
- }
61
- };
62
- export {
63
- TypeScriptHost
64
- };
65
- //# sourceMappingURL=compiler.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/compiler.ts"],
4
- "mappings": ";AAAA,SAAS,2BAA2B;AACpC,OAAO,QAAQ;AAIR,IAAM,iBAAN,MACoB;AAAA,EAEzB,YAA6B,YAA0B;AAA1B;AAAA,EAA2B;AAAA,EAA3B;AAAA;AAAA;AAAA,EAK7B,cACI,UACA,iBACyB;AAC3B,UAAM,OAAO,KAAK,SAAS,QAAQ;AACnC,QAAI,QAAQ,KAAM,QAAO;AACzB,WAAO,GAAG,iBAAiB,UAAU,MAAM,eAAe;AAAA,EAC5D;AAAA,EAEA,cACI,SACA,YACA,UACA,UACA,OACQ;AACV,WAAO,GAAG,IAAI;AAAA,MACV,oBAAoB,KAAK,YAAY,OAAO;AAAA,MAC5C;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACF;AAAA;AAAA;AAAA,EAIA,UAAU,UAAwB;AAChC,UAAM,IAAI,MAAM,+BAA+B,QAAQ,GAAG;AAAA,EAC5D;AAAA;AAAA,EAGA,sBAAsB,SAAqC;AACzD,WAAO,GAAG,sBAAsB,OAAO;AAAA,EACzC;AAAA;AAAA,EAGA,4BAAqC;AACnC,WAAO,GAAG,IAAI;AAAA,EAChB;AAAA;AAAA,EAGA,WAAW,UAA2B;AACpC,WAAO,GAAG,IAAI,WAAW,oBAAoB,KAAK,YAAY,QAAQ,CAAC;AAAA,EACzE;AAAA;AAAA,EAGA,SAAS,UAAsC;AAC7C,WAAO,GAAG,IAAI,SAAS,oBAAoB,KAAK,YAAY,QAAQ,CAAC;AAAA,EACvE;AAAA;AAAA,EAGA,sBAAoC;AAClC,WAAO,KAAK;AAAA,EACd;AAAA;AAAA,EAGA,qBAAqB,UAA0B;AAE7C,QAAI,GAAG,IAAI,0BAA2B,QAAO;AAG7C,UAAM,0BAA0B;AAChC,WAAO,wBAAwB,KAAK,QAAQ,IAC1C,SAAS,QAAQ,yBAAyB,CAAC,MAAM,EAAE,YAAY,CAAC,IAChE;AAAA,EACJ;AAAA;AAAA;AAAA,EAIA,aAAqB;AACnB,WAAO,GAAG,IAAI;AAAA,EAChB;AACF;",
5
- "names": []
6
- }
package/dist/index.cjs DELETED
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- tscBuild: () => tscBuild
24
- });
25
- module.exports = __toCommonJS(index_exports);
26
- var import_plug = require("@plugjs/plug");
27
- var import_fork = require("@plugjs/plug/fork");
28
- var import_paths = require("@plugjs/plug/paths");
29
- (0, import_fork.installForking)("tsc", (0, import_paths.requireResolve)(__filename, "./typescript"), "Tsc");
30
- (0, import_fork.installForking)("tscBuild", (0, import_paths.requireResolve)(__filename, "./tscbuild"), "TscBuild");
31
- function tscBuild(tsconfigOrOptions, maybeOptions) {
32
- const [tsconfig, tscBuildOptions] = typeof tsconfigOrOptions === "string" ? [tsconfigOrOptions, maybeOptions] : ["tsconfig.json", tsconfigOrOptions];
33
- const { directory, ...buildOptions } = tscBuildOptions || {};
34
- return (0, import_plug.find)(tsconfig, { directory }).tscBuild(buildOptions);
35
- }
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- tscBuild
39
- });
40
- //# sourceMappingURL=index.cjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AACrB,kBAA+B;AAC/B,mBAA+B;AAAA,IAgF/B,4BAAe,WAAO,6BAAe,YAAW,cAAc,GAAG,KAAK;AAAA,IACtE,4BAAe,gBAAY,6BAAe,YAAW,YAAY,GAAG,UAAU;AAiCvE,SAAS,SACZ,mBACA,cACI;AACN,QAAM,CAAE,UAAU,eAAgB,IAChC,OAAO,sBAAsB,WACzB,CAAE,mBAAmB,YAAa,IAClC,CAAE,iBAAiB,iBAAkB;AAE3C,QAAM,EAAE,WAAW,GAAG,aAAa,IAAI,mBAAmB,CAAC;AAC3D,aAAO,kBAAK,UAAU,EAAE,UAAU,CAAC,EAAE,SAAS,YAAY;AAC5D;",
5
- "names": []
6
- }
package/dist/index.mjs DELETED
@@ -1,15 +0,0 @@
1
- // index.ts
2
- import { find } from "@plugjs/plug";
3
- import { installForking } from "@plugjs/plug/fork";
4
- import { requireResolve } from "@plugjs/plug/paths";
5
- installForking("tsc", requireResolve(import.meta.url, "./typescript"), "Tsc");
6
- installForking("tscBuild", requireResolve(import.meta.url, "./tscbuild"), "TscBuild");
7
- function tscBuild(tsconfigOrOptions, maybeOptions) {
8
- const [tsconfig, tscBuildOptions] = typeof tsconfigOrOptions === "string" ? [tsconfigOrOptions, maybeOptions] : ["tsconfig.json", tsconfigOrOptions];
9
- const { directory, ...buildOptions } = tscBuildOptions || {};
10
- return find(tsconfig, { directory }).tscBuild(buildOptions);
11
- }
12
- export {
13
- tscBuild
14
- };
15
- //# sourceMappingURL=index.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "mappings": ";AAAA,SAAS,YAAY;AACrB,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAgF/B,eAAe,OAAO,eAAe,iBAAW,cAAc,GAAG,KAAK;AACtE,eAAe,YAAY,eAAe,iBAAW,YAAY,GAAG,UAAU;AAiCvE,SAAS,SACZ,mBACA,cACI;AACN,QAAM,CAAE,UAAU,eAAgB,IAChC,OAAO,sBAAsB,WACzB,CAAE,mBAAmB,YAAa,IAClC,CAAE,iBAAiB,iBAAkB;AAE3C,QAAM,EAAE,WAAW,GAAG,aAAa,IAAI,mBAAmB,CAAC;AAC3D,SAAO,KAAK,UAAU,EAAE,UAAU,CAAC,EAAE,SAAS,YAAY;AAC5D;",
5
- "names": []
6
- }
package/dist/options.cjs DELETED
@@ -1,75 +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
- // options.ts
31
- var options_exports = {};
32
- __export(options_exports, {
33
- getCompilerOptions: () => getCompilerOptions
34
- });
35
- module.exports = __toCommonJS(options_exports);
36
- var import_paths = require("@plugjs/plug/paths");
37
- var import_typescript = __toESM(require("typescript"), 1);
38
- async function getCompilerOptions(file, overrides, inputs) {
39
- if (!file) {
40
- const options = { ...import_typescript.default.getDefaultCompilerOptions(), ...overrides };
41
- return { options, errors: [] };
42
- }
43
- const host = {
44
- useCaseSensitiveFileNames: import_typescript.default.sys.useCaseSensitiveFileNames,
45
- readDirectory(rootDir, extensions, excludes, includes, depth) {
46
- return import_typescript.default.sys.readDirectory(rootDir, extensions, excludes, includes, depth);
47
- },
48
- fileExists(path) {
49
- return import_typescript.default.sys.fileExists(path);
50
- },
51
- readFile(path) {
52
- return import_typescript.default.sys.readFile(path);
53
- }
54
- };
55
- const { config, error } = import_typescript.default.readConfigFile(file, import_typescript.default.sys.readFile);
56
- if (error) return { options: {}, errors: [error] };
57
- config.include = inputs;
58
- return import_typescript.default.parseJsonConfigFileContent(
59
- config,
60
- // the parsed JSON
61
- host,
62
- // our config parser host
63
- (0, import_paths.getAbsoluteParent)(file),
64
- // directory for path resolution
65
- overrides,
66
- // overrides (from the TSC plug config)
67
- file
68
- // the file name for path resolution
69
- );
70
- }
71
- // Annotate the CommonJS export names for ESM import in node:
72
- 0 && (module.exports = {
73
- getCompilerOptions
74
- });
75
- //# sourceMappingURL=options.cjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/options.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkC;AAClC,wBAAe;AAcf,eAAsB,mBAClB,MACA,WACA,QACsC;AAExC,MAAI,CAAE,MAAM;AACV,UAAM,UAAU,EAAE,GAAG,kBAAAA,QAAG,0BAA0B,GAAG,GAAG,UAAU;AAClE,WAAO,EAAE,SAAS,QAAQ,CAAC,EAAE;AAAA,EAC/B;AAGA,QAAM,OAA2B;AAAA,IAC/B,2BAA2B,kBAAAA,QAAG,IAAI;AAAA,IAClC,cAAc,SAAS,YAAY,UAAU,UAAU,OAA0B;AAC/E,aAAO,kBAAAA,QAAG,IAAI,cAAc,SAAS,YAAY,UAAU,UAAU,KAAK;AAAA,IAC5E;AAAA,IACA,WAAW,MAAuB;AAChC,aAAO,kBAAAA,QAAG,IAAI,WAAW,IAAI;AAAA,IAC/B;AAAA,IACA,SAAS,MAAkC;AACzC,aAAO,kBAAAA,QAAG,IAAI,SAAS,IAAI;AAAA,IAC7B;AAAA,EACF;AAMA,QAAM,EAAE,QAAQ,MAAM,IAAI,kBAAAA,QAAG,eAAe,MAAM,kBAAAA,QAAG,IAAI,QAAQ;AACjE,MAAI,MAAO,QAAO,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAE,KAAM,EAAE;AAInD,SAAO,UAAU;AAEjB,SAAO,kBAAAA,QAAG;AAAA,IACN;AAAA;AAAA,IACA;AAAA;AAAA,QACA,gCAAkB,IAAI;AAAA;AAAA,IACtB;AAAA;AAAA,IACA;AAAA;AAAA,EACJ;AACF;",
5
- "names": ["ts"]
6
- }
package/dist/options.mjs DELETED
@@ -1,40 +0,0 @@
1
- // options.ts
2
- import { getAbsoluteParent } from "@plugjs/plug/paths";
3
- import ts from "typescript";
4
- async function getCompilerOptions(file, overrides, inputs) {
5
- if (!file) {
6
- const options = { ...ts.getDefaultCompilerOptions(), ...overrides };
7
- return { options, errors: [] };
8
- }
9
- const host = {
10
- useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,
11
- readDirectory(rootDir, extensions, excludes, includes, depth) {
12
- return ts.sys.readDirectory(rootDir, extensions, excludes, includes, depth);
13
- },
14
- fileExists(path) {
15
- return ts.sys.fileExists(path);
16
- },
17
- readFile(path) {
18
- return ts.sys.readFile(path);
19
- }
20
- };
21
- const { config, error } = ts.readConfigFile(file, ts.sys.readFile);
22
- if (error) return { options: {}, errors: [error] };
23
- config.include = inputs;
24
- return ts.parseJsonConfigFileContent(
25
- config,
26
- // the parsed JSON
27
- host,
28
- // our config parser host
29
- getAbsoluteParent(file),
30
- // directory for path resolution
31
- overrides,
32
- // overrides (from the TSC plug config)
33
- file
34
- // the file name for path resolution
35
- );
36
- }
37
- export {
38
- getCompilerOptions
39
- };
40
- //# sourceMappingURL=options.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/options.ts"],
4
- "mappings": ";AAAA,SAAS,yBAAyB;AAClC,OAAO,QAAQ;AAcf,eAAsB,mBAClB,MACA,WACA,QACsC;AAExC,MAAI,CAAE,MAAM;AACV,UAAM,UAAU,EAAE,GAAG,GAAG,0BAA0B,GAAG,GAAG,UAAU;AAClE,WAAO,EAAE,SAAS,QAAQ,CAAC,EAAE;AAAA,EAC/B;AAGA,QAAM,OAA2B;AAAA,IAC/B,2BAA2B,GAAG,IAAI;AAAA,IAClC,cAAc,SAAS,YAAY,UAAU,UAAU,OAA0B;AAC/E,aAAO,GAAG,IAAI,cAAc,SAAS,YAAY,UAAU,UAAU,KAAK;AAAA,IAC5E;AAAA,IACA,WAAW,MAAuB;AAChC,aAAO,GAAG,IAAI,WAAW,IAAI;AAAA,IAC/B;AAAA,IACA,SAAS,MAAkC;AACzC,aAAO,GAAG,IAAI,SAAS,IAAI;AAAA,IAC7B;AAAA,EACF;AAMA,QAAM,EAAE,QAAQ,MAAM,IAAI,GAAG,eAAe,MAAM,GAAG,IAAI,QAAQ;AACjE,MAAI,MAAO,QAAO,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAE,KAAM,EAAE;AAInD,SAAO,UAAU;AAEjB,SAAO,GAAG;AAAA,IACN;AAAA;AAAA,IACA;AAAA;AAAA,IACA,kBAAkB,IAAI;AAAA;AAAA,IACtB;AAAA;AAAA,IACA;AAAA;AAAA,EACJ;AACF;",
5
- "names": []
6
- }
package/dist/report.cjs DELETED
@@ -1,117 +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
- // report.ts
31
- var report_exports = {};
32
- __export(report_exports, {
33
- updateReport: () => updateReport
34
- });
35
- module.exports = __toCommonJS(report_exports);
36
- var import_logging = require("@plugjs/plug/logging");
37
- var import_paths = require("@plugjs/plug/paths");
38
- var import_typescript = __toESM(require("typescript"), 1);
39
- function convertMessageChain(chain, indent = 0) {
40
- const message = `${"".padStart(indent * 2)}${chain.messageText}`;
41
- if (chain.next) {
42
- const next = chain.next.map((c) => convertMessageChain(c, indent + 1));
43
- return [message, ...next.flat(1)];
44
- } else {
45
- return [message];
46
- }
47
- }
48
- function convertDiagnostics(diagnostics, directory) {
49
- return diagnostics.map((diagnostic) => {
50
- void directory;
51
- let level;
52
- switch (diagnostic.category) {
53
- case import_typescript.default.DiagnosticCategory.Error:
54
- level = import_logging.ERROR;
55
- break;
56
- // coverage ignore next / generally not emitted
57
- case import_typescript.default.DiagnosticCategory.Warning:
58
- level = import_logging.WARN;
59
- break;
60
- // coverage ignore next / message and suggestion
61
- default:
62
- level = import_logging.NOTICE;
63
- }
64
- let message;
65
- if (typeof diagnostic.messageText === "string") {
66
- message = diagnostic.messageText;
67
- } else {
68
- message = convertMessageChain(diagnostic.messageText);
69
- }
70
- const tags = `TS${diagnostic.code}`;
71
- if (diagnostic.file) {
72
- const { file: sourceFile, start, length } = diagnostic;
73
- const file = (0, import_paths.resolveAbsolutePath)(directory, sourceFile.fileName);
74
- const source = sourceFile.getFullText();
75
- if (start !== void 0) {
76
- const position = sourceFile.getLineAndCharacterOfPosition(start);
77
- let { line, character: column } = position;
78
- column += 1;
79
- line += 1;
80
- return { level, message, tags, file, source, line, column, length };
81
- } else {
82
- return { level, message, tags, file, source };
83
- }
84
- } else {
85
- return { level, message, tags };
86
- }
87
- });
88
- }
89
- function updateReport(report, diagnostics, directory, logger) {
90
- const records = convertDiagnostics(diagnostics, directory);
91
- if (!logger) {
92
- report.add(...records);
93
- return;
94
- }
95
- for (const record of records) {
96
- if (record.file) {
97
- report.add(record);
98
- } else {
99
- switch (record.level) {
100
- case import_logging.ERROR:
101
- logger.error(record.message);
102
- break;
103
- case import_logging.WARN:
104
- logger.warn(record.message);
105
- break;
106
- case import_logging.NOTICE:
107
- logger.info(record.message);
108
- break;
109
- }
110
- }
111
- }
112
- }
113
- // Annotate the CommonJS export names for ESM import in node:
114
- 0 && (module.exports = {
115
- updateReport
116
- });
117
- //# sourceMappingURL=report.cjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/report.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoC;AACpC,mBAAoC;AACpC,wBAAe;AAMf,SAAS,oBAAoB,OAAkC,SAAS,GAAa;AACnF,QAAM,UAAU,GAAG,GAAG,SAAS,SAAS,CAAC,CAAC,GAAG,MAAM,WAAW;AAE9D,MAAI,MAAM,MAAM;AACd,UAAM,OAAO,MAAM,KAAK,IAAI,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC,CAAC;AACrE,WAAO,CAAE,SAAS,GAAG,KAAK,KAAK,CAAC,CAAE;AAAA,EACpC,OAAO;AACL,WAAO,CAAE,OAAQ;AAAA,EACnB;AACF;AAEA,SAAS,mBACL,aACA,WACc;AAChB,SAAO,YAAY,IAAI,CAAC,eAA6B;AAEnD,SAAK;AAGL,QAAI;AACJ,YAAQ,WAAW,UAAU;AAAA,MAC3B,KAAK,kBAAAA,QAAG,mBAAmB;AAAO,gBAAQ;AAAO;AAAA;AAAA,MAEjD,KAAK,kBAAAA,QAAG,mBAAmB;AAAS,gBAAQ;AAAM;AAAA;AAAA,MAElD;AAAS,gBAAQ;AAAA,IACnB;AAGA,QAAI;AACJ,QAAI,OAAO,WAAW,gBAAgB,UAAU;AAC9C,gBAAU,WAAW;AAAA,IACvB,OAAO;AACL,gBAAU,oBAAoB,WAAW,WAAW;AAAA,IACtD;AAGA,UAAM,OAAO,KAAK,WAAW,IAAI;AAGjC,QAAI,WAAW,MAAM;AACnB,YAAM,EAAE,MAAM,YAAY,OAAO,OAAO,IAAI;AAC5C,YAAM,WAAO,kCAAoB,WAAW,WAAW,QAAQ;AAC/D,YAAM,SAAS,WAAW,YAAY;AAGtC,UAAI,UAAU,QAAW;AACvB,cAAM,WAAW,WAAW,8BAA8B,KAAK;AAC/D,YAAI,EAAE,MAAM,WAAW,OAAO,IAAI;AAClC,kBAAU;AACV,gBAAQ;AAER,eAAO,EAAE,OAAO,SAAS,MAAM,MAAM,QAAQ,MAAM,QAAQ,OAAO;AAAA,MACpE,OAAO;AACL,eAAO,EAAE,OAAO,SAAS,MAAM,MAAM,OAAO;AAAA,MAC9C;AAAA,IACF,OAAO;AACL,aAAO,EAAE,OAAO,SAAS,KAAK;AAAA,IAChC;AAAA,EACF,CAAC;AACH;AASO,SAAS,aACZ,QACA,aACA,WACA,QACI;AACN,QAAM,UAAU,mBAAmB,aAAa,SAAS;AACzD,MAAI,CAAE,QAAQ;AACZ,WAAO,IAAI,GAAG,OAAO;AACrB;AAAA,EACF;AAEA,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,MAAM;AACf,aAAO,IAAI,MAAM;AAAA,IACnB,OAAO;AACL,cAAQ,OAAO,OAAO;AAAA,QACpB,KAAK;AAAO,iBAAO,MAAM,OAAO,OAAO;AAAG;AAAA,QAC1C,KAAK;AAAM,iBAAO,KAAK,OAAO,OAAO;AAAG;AAAA,QACxC,KAAK;AAAQ,iBAAO,KAAK,OAAO,OAAO;AAAG;AAAA,MAC5C;AAAA,IACF;AAAA,EACF;AACF;",
5
- "names": ["ts"]
6
- }
package/dist/report.mjs DELETED
@@ -1,82 +0,0 @@
1
- // report.ts
2
- import { ERROR, NOTICE, WARN } from "@plugjs/plug/logging";
3
- import { resolveAbsolutePath } from "@plugjs/plug/paths";
4
- import ts from "typescript";
5
- function convertMessageChain(chain, indent = 0) {
6
- const message = `${"".padStart(indent * 2)}${chain.messageText}`;
7
- if (chain.next) {
8
- const next = chain.next.map((c) => convertMessageChain(c, indent + 1));
9
- return [message, ...next.flat(1)];
10
- } else {
11
- return [message];
12
- }
13
- }
14
- function convertDiagnostics(diagnostics, directory) {
15
- return diagnostics.map((diagnostic) => {
16
- void directory;
17
- let level;
18
- switch (diagnostic.category) {
19
- case ts.DiagnosticCategory.Error:
20
- level = ERROR;
21
- break;
22
- // coverage ignore next / generally not emitted
23
- case ts.DiagnosticCategory.Warning:
24
- level = WARN;
25
- break;
26
- // coverage ignore next / message and suggestion
27
- default:
28
- level = NOTICE;
29
- }
30
- let message;
31
- if (typeof diagnostic.messageText === "string") {
32
- message = diagnostic.messageText;
33
- } else {
34
- message = convertMessageChain(diagnostic.messageText);
35
- }
36
- const tags = `TS${diagnostic.code}`;
37
- if (diagnostic.file) {
38
- const { file: sourceFile, start, length } = diagnostic;
39
- const file = resolveAbsolutePath(directory, sourceFile.fileName);
40
- const source = sourceFile.getFullText();
41
- if (start !== void 0) {
42
- const position = sourceFile.getLineAndCharacterOfPosition(start);
43
- let { line, character: column } = position;
44
- column += 1;
45
- line += 1;
46
- return { level, message, tags, file, source, line, column, length };
47
- } else {
48
- return { level, message, tags, file, source };
49
- }
50
- } else {
51
- return { level, message, tags };
52
- }
53
- });
54
- }
55
- function updateReport(report, diagnostics, directory, logger) {
56
- const records = convertDiagnostics(diagnostics, directory);
57
- if (!logger) {
58
- report.add(...records);
59
- return;
60
- }
61
- for (const record of records) {
62
- if (record.file) {
63
- report.add(record);
64
- } else {
65
- switch (record.level) {
66
- case ERROR:
67
- logger.error(record.message);
68
- break;
69
- case WARN:
70
- logger.warn(record.message);
71
- break;
72
- case NOTICE:
73
- logger.info(record.message);
74
- break;
75
- }
76
- }
77
- }
78
- }
79
- export {
80
- updateReport
81
- };
82
- //# sourceMappingURL=report.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/report.ts"],
4
- "mappings": ";AAAA,SAAS,OAAO,QAAQ,YAAY;AACpC,SAAS,2BAA2B;AACpC,OAAO,QAAQ;AAMf,SAAS,oBAAoB,OAAkC,SAAS,GAAa;AACnF,QAAM,UAAU,GAAG,GAAG,SAAS,SAAS,CAAC,CAAC,GAAG,MAAM,WAAW;AAE9D,MAAI,MAAM,MAAM;AACd,UAAM,OAAO,MAAM,KAAK,IAAI,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC,CAAC;AACrE,WAAO,CAAE,SAAS,GAAG,KAAK,KAAK,CAAC,CAAE;AAAA,EACpC,OAAO;AACL,WAAO,CAAE,OAAQ;AAAA,EACnB;AACF;AAEA,SAAS,mBACL,aACA,WACc;AAChB,SAAO,YAAY,IAAI,CAAC,eAA6B;AAEnD,SAAK;AAGL,QAAI;AACJ,YAAQ,WAAW,UAAU;AAAA,MAC3B,KAAK,GAAG,mBAAmB;AAAO,gBAAQ;AAAO;AAAA;AAAA,MAEjD,KAAK,GAAG,mBAAmB;AAAS,gBAAQ;AAAM;AAAA;AAAA,MAElD;AAAS,gBAAQ;AAAA,IACnB;AAGA,QAAI;AACJ,QAAI,OAAO,WAAW,gBAAgB,UAAU;AAC9C,gBAAU,WAAW;AAAA,IACvB,OAAO;AACL,gBAAU,oBAAoB,WAAW,WAAW;AAAA,IACtD;AAGA,UAAM,OAAO,KAAK,WAAW,IAAI;AAGjC,QAAI,WAAW,MAAM;AACnB,YAAM,EAAE,MAAM,YAAY,OAAO,OAAO,IAAI;AAC5C,YAAM,OAAO,oBAAoB,WAAW,WAAW,QAAQ;AAC/D,YAAM,SAAS,WAAW,YAAY;AAGtC,UAAI,UAAU,QAAW;AACvB,cAAM,WAAW,WAAW,8BAA8B,KAAK;AAC/D,YAAI,EAAE,MAAM,WAAW,OAAO,IAAI;AAClC,kBAAU;AACV,gBAAQ;AAER,eAAO,EAAE,OAAO,SAAS,MAAM,MAAM,QAAQ,MAAM,QAAQ,OAAO;AAAA,MACpE,OAAO;AACL,eAAO,EAAE,OAAO,SAAS,MAAM,MAAM,OAAO;AAAA,MAC9C;AAAA,IACF,OAAO;AACL,aAAO,EAAE,OAAO,SAAS,KAAK;AAAA,IAChC;AAAA,EACF,CAAC;AACH;AASO,SAAS,aACZ,QACA,aACA,WACA,QACI;AACN,QAAM,UAAU,mBAAmB,aAAa,SAAS;AACzD,MAAI,CAAE,QAAQ;AACZ,WAAO,IAAI,GAAG,OAAO;AACrB;AAAA,EACF;AAEA,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,MAAM;AACf,aAAO,IAAI,MAAM;AAAA,IACnB,OAAO;AACL,cAAQ,OAAO,OAAO;AAAA,QACpB,KAAK;AAAO,iBAAO,MAAM,OAAO,OAAO;AAAG;AAAA,QAC1C,KAAK;AAAM,iBAAO,KAAK,OAAO,OAAO;AAAG;AAAA,QACxC,KAAK;AAAQ,iBAAO,KAAK,OAAO,OAAO;AAAG;AAAA,MAC5C;AAAA,IACF;AAAA,EACF;AACF;",
5
- "names": []
6
- }