@powerlines/plugin-tsc 0.3.1 → 0.3.4
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
3
|
let typescript = require("typescript");
|
|
4
|
+
let _powerlines_core_lib_typescript = require("@powerlines/core/lib/typescript");
|
|
4
5
|
let _stryke_path_replace = require("@stryke/path/replace");
|
|
5
|
-
let powerlines_typescript = require("powerlines/typescript");
|
|
6
6
|
|
|
7
7
|
//#region src/helpers/type-check.ts
|
|
8
8
|
/**
|
|
@@ -11,7 +11,7 @@ let powerlines_typescript = require("powerlines/typescript");
|
|
|
11
11
|
* @param context - The build context containing information about the current build.
|
|
12
12
|
*/
|
|
13
13
|
async function typeCheck(context) {
|
|
14
|
-
const result = (0,
|
|
14
|
+
const result = (0, _powerlines_core_lib_typescript.createProgram)(context, {
|
|
15
15
|
skipAddingFilesFromTsConfig: true,
|
|
16
16
|
compilerOptions: {
|
|
17
17
|
declaration: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { flattenDiagnosticMessageText } from "typescript";
|
|
2
|
+
import { createProgram } from "@powerlines/core/lib/typescript";
|
|
2
3
|
import { replacePath } from "@stryke/path/replace";
|
|
3
|
-
import { createProgram } from "powerlines/typescript";
|
|
4
4
|
|
|
5
5
|
//#region src/helpers/type-check.ts
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-check.mjs","names":[],"sources":["../../src/helpers/type-check.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {
|
|
1
|
+
{"version":3,"file":"type-check.mjs","names":[],"sources":["../../src/helpers/type-check.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createProgram } from \"@powerlines/core/lib/typescript\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { Context } from \"powerlines\";\nimport { flattenDiagnosticMessageText } from \"typescript\";\n\n/**\n * Perform type checks on the provided sources using TypeScript's compiler API.\n *\n * @param context - The build context containing information about the current build.\n */\nexport async function typeCheck(context: Context): Promise<void> {\n const program = createProgram(context, {\n skipAddingFilesFromTsConfig: true,\n compilerOptions: {\n declaration: true,\n declarationMap: false,\n emitDeclarationOnly: true,\n sourceMap: false,\n outDir: replacePath(context.builtinsPath, context.config.cwd),\n composite: false,\n incremental: false,\n tsBuildInfoFile: undefined\n }\n });\n const result = program.emitToMemory();\n\n const diagnosticMessages: string[] = [];\n result.getDiagnostics().forEach(diagnostic => {\n if (diagnostic.getSourceFile()?.getBaseName()) {\n diagnosticMessages.push(\n `${diagnostic.getSourceFile()?.getBaseName()} (${\n (diagnostic.getLineNumber() ?? 0) + 1\n }): ${flattenDiagnosticMessageText(\n diagnostic.getMessageText().toString(),\n \"\\n\"\n )}`\n );\n } else {\n diagnosticMessages.push(\n flattenDiagnosticMessageText(\n diagnostic.getMessageText().toString(),\n \"\\n\"\n )\n );\n }\n });\n\n const diagnosticMessage = diagnosticMessages.join(\"\\n\");\n if (diagnosticMessage) {\n throw new Error(\n `TypeScript compilation failed: \\n\\n${\n diagnosticMessage.length > 5000\n ? `${diagnosticMessage.slice(0, 5000)}...`\n : diagnosticMessage\n }`\n );\n }\n}\n"],"mappings":";;;;;;;;;;AA4BA,eAAsB,UAAU,SAAiC;CAc/D,MAAM,SAbU,cAAc,SAAS;EACrC,6BAA6B;EAC7B,iBAAiB;GACf,aAAa;GACb,gBAAgB;GAChB,qBAAqB;GACrB,WAAW;GACX,QAAQ,YAAY,QAAQ,cAAc,QAAQ,OAAO,IAAI;GAC7D,WAAW;GACX,aAAa;GACb,iBAAiB;GAClB;EACF,CACqB,CAAC,cAAc;CAErC,MAAM,qBAA+B,EAAE;AACvC,QAAO,gBAAgB,CAAC,SAAQ,eAAc;AAC5C,MAAI,WAAW,eAAe,EAAE,aAAa,CAC3C,oBAAmB,KACjB,GAAG,WAAW,eAAe,EAAE,aAAa,CAAC,KAC1C,WAAW,eAAe,IAAI,KAAK,EACrC,KAAK,6BACJ,WAAW,gBAAgB,CAAC,UAAU,EACtC,KACD,GACF;MAED,oBAAmB,KACjB,6BACE,WAAW,gBAAgB,CAAC,UAAU,EACtC,KACD,CACF;GAEH;CAEF,MAAM,oBAAoB,mBAAmB,KAAK,KAAK;AACvD,KAAI,kBACF,OAAM,IAAI,MACR,sCACE,kBAAkB,SAAS,MACvB,GAAG,kBAAkB,MAAM,GAAG,IAAK,CAAC,OACpC,oBAEP"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-tsc",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing the TypeScript compiler plugin for Powerlines.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "github",
|
|
8
8
|
"url": "https://github.com/storm-software/powerlines.git",
|
|
9
|
-
"directory": "packages/plugin-tsc"
|
|
9
|
+
"directory": "packages/plugins/plugin-tsc"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://stormsoftware.com",
|
|
12
12
|
"bugs": {
|
|
@@ -41,93 +41,40 @@
|
|
|
41
41
|
"main": "./dist/index.cjs",
|
|
42
42
|
"module": "./dist/index.mjs",
|
|
43
43
|
"exports": {
|
|
44
|
-
".": {
|
|
45
|
-
"require": {
|
|
46
|
-
"types": "./dist/index.d.cts",
|
|
47
|
-
"default": "./dist/index.cjs"
|
|
48
|
-
},
|
|
49
|
-
"import": {
|
|
50
|
-
"types": "./dist/index.d.mts",
|
|
51
|
-
"default": "./dist/index.mjs"
|
|
52
|
-
},
|
|
53
|
-
"default": {
|
|
54
|
-
"types": "./dist/index.d.mts",
|
|
55
|
-
"default": "./dist/index.mjs"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
44
|
+
".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" },
|
|
58
45
|
"./helpers": {
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
"default": "./dist/helpers/index.cjs"
|
|
62
|
-
},
|
|
63
|
-
"import": {
|
|
64
|
-
"types": "./dist/helpers/index.d.mts",
|
|
65
|
-
"default": "./dist/helpers/index.mjs"
|
|
66
|
-
},
|
|
67
|
-
"default": {
|
|
68
|
-
"types": "./dist/helpers/index.d.mts",
|
|
69
|
-
"default": "./dist/helpers/index.mjs"
|
|
70
|
-
}
|
|
46
|
+
"import": "./dist/helpers/index.mjs",
|
|
47
|
+
"require": "./dist/helpers/index.cjs"
|
|
71
48
|
},
|
|
72
49
|
"./helpers/type-check": {
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
"default": "./dist/helpers/type-check.cjs"
|
|
76
|
-
},
|
|
77
|
-
"import": {
|
|
78
|
-
"types": "./dist/helpers/type-check.d.mts",
|
|
79
|
-
"default": "./dist/helpers/type-check.mjs"
|
|
80
|
-
},
|
|
81
|
-
"default": {
|
|
82
|
-
"types": "./dist/helpers/type-check.d.mts",
|
|
83
|
-
"default": "./dist/helpers/type-check.mjs"
|
|
84
|
-
}
|
|
50
|
+
"import": "./dist/helpers/type-check.mjs",
|
|
51
|
+
"require": "./dist/helpers/type-check.cjs"
|
|
85
52
|
},
|
|
86
|
-
"./package.json": "./package.json",
|
|
87
53
|
"./types": {
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
"default": "./dist/types/index.cjs"
|
|
91
|
-
},
|
|
92
|
-
"import": {
|
|
93
|
-
"types": "./dist/types/index.d.mts",
|
|
94
|
-
"default": "./dist/types/index.mjs"
|
|
95
|
-
},
|
|
96
|
-
"default": {
|
|
97
|
-
"types": "./dist/types/index.d.mts",
|
|
98
|
-
"default": "./dist/types/index.mjs"
|
|
99
|
-
}
|
|
54
|
+
"import": "./dist/types/index.mjs",
|
|
55
|
+
"require": "./dist/types/index.cjs"
|
|
100
56
|
},
|
|
101
57
|
"./types/plugin": {
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"import": {
|
|
107
|
-
"types": "./dist/types/plugin.d.mts",
|
|
108
|
-
"default": "./dist/types/plugin.mjs"
|
|
109
|
-
},
|
|
110
|
-
"default": {
|
|
111
|
-
"types": "./dist/types/plugin.d.mts",
|
|
112
|
-
"default": "./dist/types/plugin.mjs"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
58
|
+
"import": "./dist/types/plugin.mjs",
|
|
59
|
+
"require": "./dist/types/plugin.cjs"
|
|
60
|
+
},
|
|
61
|
+
"./package.json": "./package.json"
|
|
115
62
|
},
|
|
116
63
|
"types": "./dist/index.d.cts",
|
|
117
64
|
"typings": "dist/index.d.mts",
|
|
118
65
|
"files": ["dist/**/*"],
|
|
119
66
|
"keywords": ["tsc", "powerlines", "storm-software", "powerlines-plugin"],
|
|
120
67
|
"dependencies": {
|
|
121
|
-
"@stryke/path": "^0.
|
|
68
|
+
"@stryke/path": "^0.29.2",
|
|
122
69
|
"defu": "^6.1.7",
|
|
123
|
-
"powerlines": "^0.47.
|
|
70
|
+
"powerlines": "^0.47.7",
|
|
124
71
|
"unplugin": "^3.0.0",
|
|
125
72
|
"typescript": "^6.0.3"
|
|
126
73
|
},
|
|
127
74
|
"devDependencies": {
|
|
128
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
129
|
-
"@types/node": "^25.
|
|
75
|
+
"@powerlines/plugin-plugin": "^0.12.419",
|
|
76
|
+
"@types/node": "^25.7.0"
|
|
130
77
|
},
|
|
131
78
|
"publishConfig": { "access": "public" },
|
|
132
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "3c5c701e16af74006dd70b965009d41eb22ace2a"
|
|
133
80
|
}
|