@powerlines/plugin-tsc 0.2.129 → 0.2.131
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/context-BKnG0PBM.d.mts +1756 -0
- package/dist/context-DJwegHpz.d.cts +1756 -0
- package/dist/helpers/index.cjs +3 -2
- package/dist/helpers/index.d.cts +3 -1
- package/dist/helpers/index.d.mts +3 -1
- package/dist/helpers/index.mjs +2 -1
- package/dist/helpers/type-check.cjs +2 -21
- package/dist/helpers/type-check.d.cts +2 -11
- package/dist/helpers/type-check.d.mts +2 -11
- package/dist/helpers/type-check.mjs +1 -19
- package/dist/helpers-B15z10jN.mjs +1 -0
- package/dist/helpers-LF26RHol.cjs +0 -0
- package/dist/index-CUbWeWHc.d.mts +1 -0
- package/dist/index-D6CnpA_r.d.cts +1 -0
- package/dist/index-DL0uimUT.d.mts +1 -0
- package/dist/index-DWPDThxu.d.cts +1 -0
- package/dist/index.cjs +36 -7
- package/dist/index.d.cts +5 -3
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +4 -2
- package/dist/plugin-BH3d1UOw.d.mts +35 -0
- package/dist/plugin-DZYL6q5t.d.cts +35 -0
- package/dist/plugin-ifZVa20V.mjs +1 -0
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/type-check-BM6tW_xw.cjs +27 -0
- package/dist/type-check-Bkbb5EkH.mjs +21 -0
- package/dist/type-check-CTF3SB99.d.mts +12 -0
- package/dist/type-check-yDG1LQxV.d.cts +12 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +3 -1
- package/dist/types/index.d.mts +3 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +2 -36
- package/dist/types/plugin.d.mts +2 -36
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-U3zd8PTP.mjs +1 -0
- package/dist/types-o3zWarRp.cjs +0 -0
- package/package.json +4 -4
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- package/dist/powerlines/src/types/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -145
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/config.d.cts +0 -369
- package/dist/powerlines/src/types/config.d.mts +0 -369
- package/dist/powerlines/src/types/context.d.cts +0 -403
- package/dist/powerlines/src/types/context.d.mts +0 -405
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/plugin.d.cts +0 -231
- package/dist/powerlines/src/types/plugin.d.mts +0 -231
- package/dist/powerlines/src/types/resolved.d.cts +0 -81
- package/dist/powerlines/src/types/resolved.d.mts +0 -81
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_type_check = require('../type-check-BM6tW_xw.cjs');
|
|
2
|
+
require('../helpers-LF26RHol.cjs');
|
|
2
3
|
|
|
3
|
-
exports.typeCheck =
|
|
4
|
+
exports.typeCheck = require_type_check.typeCheck;
|
package/dist/helpers/index.d.cts
CHANGED
package/dist/helpers/index.d.mts
CHANGED
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
let typescript = require("typescript");
|
|
1
|
+
const require_type_check = require('../type-check-BM6tW_xw.cjs');
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Perform type checks on the provided sources using TypeScript's compiler API.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The build context containing information about the current build.
|
|
9
|
-
*/
|
|
10
|
-
async function typeCheck(context) {
|
|
11
|
-
const result = context.program.emitToMemory();
|
|
12
|
-
const diagnosticMessages = [];
|
|
13
|
-
result.getDiagnostics().forEach((diagnostic) => {
|
|
14
|
-
if (diagnostic.getSourceFile()?.getBaseName()) diagnosticMessages.push(`${diagnostic.getSourceFile()?.getBaseName()} (${(diagnostic.getLineNumber() ?? 0) + 1}): ${(0, typescript.flattenDiagnosticMessageText)(diagnostic.getMessageText().toString(), "\n")}`);
|
|
15
|
-
else diagnosticMessages.push((0, typescript.flattenDiagnosticMessageText)(diagnostic.getMessageText().toString(), "\n"));
|
|
16
|
-
});
|
|
17
|
-
const diagnosticMessage = diagnosticMessages.join("\n");
|
|
18
|
-
if (diagnosticMessage) throw new Error(`TypeScript compilation failed: \n\n${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : diagnosticMessage}`);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
exports.typeCheck = typeCheck;
|
|
3
|
+
exports.typeCheck = require_type_check.typeCheck;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/type-check.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Perform type checks on the provided sources using TypeScript's compiler API.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The build context containing information about the current build.
|
|
9
|
-
*/
|
|
10
|
-
declare function typeCheck(context: Context): Promise<void>;
|
|
11
|
-
//#endregion
|
|
1
|
+
import "../context-DJwegHpz.cjs";
|
|
2
|
+
import { t as typeCheck } from "../type-check-yDG1LQxV.cjs";
|
|
12
3
|
export { typeCheck };
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/helpers/type-check.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Perform type checks on the provided sources using TypeScript's compiler API.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The build context containing information about the current build.
|
|
9
|
-
*/
|
|
10
|
-
declare function typeCheck(context: Context): Promise<void>;
|
|
11
|
-
//#endregion
|
|
1
|
+
import "../context-BKnG0PBM.mjs";
|
|
2
|
+
import { t as typeCheck } from "../type-check-CTF3SB99.mjs";
|
|
12
3
|
export { typeCheck };
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as typeCheck } from "../type-check-Bkbb5EkH.mjs";
|
|
2
2
|
|
|
3
|
-
//#region src/helpers/type-check.ts
|
|
4
|
-
/**
|
|
5
|
-
* Perform type checks on the provided sources using TypeScript's compiler API.
|
|
6
|
-
*
|
|
7
|
-
* @param context - The build context containing information about the current build.
|
|
8
|
-
*/
|
|
9
|
-
async function typeCheck(context) {
|
|
10
|
-
const result = context.program.emitToMemory();
|
|
11
|
-
const diagnosticMessages = [];
|
|
12
|
-
result.getDiagnostics().forEach((diagnostic) => {
|
|
13
|
-
if (diagnostic.getSourceFile()?.getBaseName()) diagnosticMessages.push(`${diagnostic.getSourceFile()?.getBaseName()} (${(diagnostic.getLineNumber() ?? 0) + 1}): ${flattenDiagnosticMessageText(diagnostic.getMessageText().toString(), "\n")}`);
|
|
14
|
-
else diagnosticMessages.push(flattenDiagnosticMessageText(diagnostic.getMessageText().toString(), "\n"));
|
|
15
|
-
});
|
|
16
|
-
const diagnosticMessage = diagnosticMessages.join("\n");
|
|
17
|
-
if (diagnosticMessage) throw new Error(`TypeScript compilation failed: \n\n${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : diagnosticMessage}`);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
3
|
export { typeCheck };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
const require_type_check = require('./type-check-BM6tW_xw.cjs');
|
|
30
|
+
require('./helpers-LF26RHol.cjs');
|
|
31
|
+
require('./plugin-pBKbb5K9.cjs');
|
|
32
|
+
require('./types-o3zWarRp.cjs');
|
|
5
33
|
let defu = require("defu");
|
|
6
|
-
defu =
|
|
34
|
+
defu = __toESM(defu);
|
|
7
35
|
let typescript = require("typescript");
|
|
8
|
-
typescript =
|
|
36
|
+
typescript = __toESM(typescript);
|
|
9
37
|
|
|
10
38
|
//#region src/index.ts
|
|
11
39
|
/**
|
|
@@ -21,7 +49,7 @@ const plugin = (options = {}) => {
|
|
|
21
49
|
return { transform: { tsc: (0, defu.default)(options ?? {}, { typeCheck: false }) } };
|
|
22
50
|
},
|
|
23
51
|
async lint() {
|
|
24
|
-
if (this.config.transform.tsc.typeCheck) await
|
|
52
|
+
if (this.config.transform.tsc.typeCheck) await require_type_check.typeCheck(this);
|
|
25
53
|
},
|
|
26
54
|
async transform(code, id) {
|
|
27
55
|
const result = typescript.default.transpileModule(code, {
|
|
@@ -48,6 +76,7 @@ const plugin = (options = {}) => {
|
|
|
48
76
|
var src_default = plugin;
|
|
49
77
|
|
|
50
78
|
//#endregion
|
|
79
|
+
exports.__toESM = __toESM;
|
|
51
80
|
exports.default = src_default;
|
|
52
81
|
exports.plugin = plugin;
|
|
53
|
-
exports.typeCheck =
|
|
82
|
+
exports.typeCheck = require_type_check.typeCheck;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Plugin } from "./
|
|
2
|
-
import { typeCheck } from "./
|
|
3
|
-
import
|
|
1
|
+
import { i as Plugin } from "./context-DJwegHpz.cjs";
|
|
2
|
+
import { t as typeCheck } from "./type-check-yDG1LQxV.cjs";
|
|
3
|
+
import "./index-D6CnpA_r.cjs";
|
|
4
|
+
import { a as __ΩTypeScriptCompilerPluginContext, c as __ΩTypeScriptCompilerPluginUserConfig, i as TypeScriptCompilerPluginUserConfig, n as TypeScriptCompilerPluginOptions, o as __ΩTypeScriptCompilerPluginOptions, r as TypeScriptCompilerPluginResolvedConfig, s as __ΩTypeScriptCompilerPluginResolvedConfig, t as TypeScriptCompilerPluginContext } from "./plugin-DZYL6q5t.cjs";
|
|
5
|
+
import "./index-DWPDThxu.cjs";
|
|
4
6
|
|
|
5
7
|
//#region src/index.d.ts
|
|
6
8
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Plugin } from "./
|
|
2
|
-
import { typeCheck } from "./
|
|
3
|
-
import "./
|
|
4
|
-
import { TypeScriptCompilerPluginContext,
|
|
5
|
-
import "./
|
|
1
|
+
import { i as Plugin } from "./context-BKnG0PBM.mjs";
|
|
2
|
+
import { t as typeCheck } from "./type-check-CTF3SB99.mjs";
|
|
3
|
+
import "./index-DL0uimUT.mjs";
|
|
4
|
+
import { a as __ΩTypeScriptCompilerPluginContext, c as __ΩTypeScriptCompilerPluginUserConfig, i as TypeScriptCompilerPluginUserConfig, n as TypeScriptCompilerPluginOptions, o as __ΩTypeScriptCompilerPluginOptions, r as TypeScriptCompilerPluginResolvedConfig, s as __ΩTypeScriptCompilerPluginResolvedConfig, t as TypeScriptCompilerPluginContext } from "./plugin-BH3d1UOw.mjs";
|
|
5
|
+
import "./index-CUbWeWHc.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/index.d.ts
|
|
8
8
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { typeCheck } from "./
|
|
2
|
-
import "./helpers
|
|
1
|
+
import { t as typeCheck } from "./type-check-Bkbb5EkH.mjs";
|
|
2
|
+
import "./helpers-B15z10jN.mjs";
|
|
3
|
+
import "./plugin-ifZVa20V.mjs";
|
|
4
|
+
import "./types-U3zd8PTP.mjs";
|
|
3
5
|
import defu from "defu";
|
|
4
6
|
import ts from "typescript";
|
|
5
7
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { a as ResolvedConfig, n as PluginContext, r as UserConfig } from "./context-BKnG0PBM.mjs";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
type TypeScriptCompilerPluginOptions = Partial<Omit<ts.TranspileOptions, "fileName">> & {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to perform type checking during the `lint` task.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue false
|
|
10
|
+
*/
|
|
11
|
+
typeCheck?: boolean;
|
|
12
|
+
};
|
|
13
|
+
interface TypeScriptCompilerPluginUserConfig extends UserConfig {
|
|
14
|
+
transform: {
|
|
15
|
+
/**
|
|
16
|
+
* TypeScript Compiler transformation options
|
|
17
|
+
*/
|
|
18
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
interface TypeScriptCompilerPluginResolvedConfig extends ResolvedConfig {
|
|
22
|
+
transform: {
|
|
23
|
+
/**
|
|
24
|
+
* Resolved TypeScript Compiler transformation options
|
|
25
|
+
*/
|
|
26
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
type TypeScriptCompilerPluginContext<TResolvedConfig extends TypeScriptCompilerPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
30
|
+
declare type __ΩTypeScriptCompilerPluginOptions = any[];
|
|
31
|
+
declare type __ΩTypeScriptCompilerPluginUserConfig = any[];
|
|
32
|
+
declare type __ΩTypeScriptCompilerPluginResolvedConfig = any[];
|
|
33
|
+
declare type __ΩTypeScriptCompilerPluginContext = any[];
|
|
34
|
+
//#endregion
|
|
35
|
+
export { __ΩTypeScriptCompilerPluginContext as a, __ΩTypeScriptCompilerPluginUserConfig as c, TypeScriptCompilerPluginUserConfig as i, TypeScriptCompilerPluginOptions as n, __ΩTypeScriptCompilerPluginOptions as o, TypeScriptCompilerPluginResolvedConfig as r, __ΩTypeScriptCompilerPluginResolvedConfig as s, TypeScriptCompilerPluginContext as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { a as ResolvedConfig, n as PluginContext, r as UserConfig } from "./context-DJwegHpz.cjs";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
type TypeScriptCompilerPluginOptions = Partial<Omit<ts.TranspileOptions, "fileName">> & {
|
|
6
|
+
/**
|
|
7
|
+
* Whether to perform type checking during the `lint` task.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue false
|
|
10
|
+
*/
|
|
11
|
+
typeCheck?: boolean;
|
|
12
|
+
};
|
|
13
|
+
interface TypeScriptCompilerPluginUserConfig extends UserConfig {
|
|
14
|
+
transform: {
|
|
15
|
+
/**
|
|
16
|
+
* TypeScript Compiler transformation options
|
|
17
|
+
*/
|
|
18
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
interface TypeScriptCompilerPluginResolvedConfig extends ResolvedConfig {
|
|
22
|
+
transform: {
|
|
23
|
+
/**
|
|
24
|
+
* Resolved TypeScript Compiler transformation options
|
|
25
|
+
*/
|
|
26
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
type TypeScriptCompilerPluginContext<TResolvedConfig extends TypeScriptCompilerPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
30
|
+
declare type __ΩTypeScriptCompilerPluginOptions = any[];
|
|
31
|
+
declare type __ΩTypeScriptCompilerPluginUserConfig = any[];
|
|
32
|
+
declare type __ΩTypeScriptCompilerPluginResolvedConfig = any[];
|
|
33
|
+
declare type __ΩTypeScriptCompilerPluginContext = any[];
|
|
34
|
+
//#endregion
|
|
35
|
+
export { __ΩTypeScriptCompilerPluginContext as a, __ΩTypeScriptCompilerPluginUserConfig as c, TypeScriptCompilerPluginUserConfig as i, TypeScriptCompilerPluginOptions as n, __ΩTypeScriptCompilerPluginOptions as o, TypeScriptCompilerPluginResolvedConfig as r, __ΩTypeScriptCompilerPluginResolvedConfig as s, TypeScriptCompilerPluginContext as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const require_index = require('./index.cjs');
|
|
2
|
+
let typescript = require("typescript");
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/type-check.ts
|
|
5
|
+
/**
|
|
6
|
+
* Perform type checks on the provided sources using TypeScript's compiler API.
|
|
7
|
+
*
|
|
8
|
+
* @param context - The build context containing information about the current build.
|
|
9
|
+
*/
|
|
10
|
+
async function typeCheck(context) {
|
|
11
|
+
const result = context.program.emitToMemory();
|
|
12
|
+
const diagnosticMessages = [];
|
|
13
|
+
result.getDiagnostics().forEach((diagnostic) => {
|
|
14
|
+
if (diagnostic.getSourceFile()?.getBaseName()) diagnosticMessages.push(`${diagnostic.getSourceFile()?.getBaseName()} (${(diagnostic.getLineNumber() ?? 0) + 1}): ${(0, typescript.flattenDiagnosticMessageText)(diagnostic.getMessageText().toString(), "\n")}`);
|
|
15
|
+
else diagnosticMessages.push((0, typescript.flattenDiagnosticMessageText)(diagnostic.getMessageText().toString(), "\n"));
|
|
16
|
+
});
|
|
17
|
+
const diagnosticMessage = diagnosticMessages.join("\n");
|
|
18
|
+
if (diagnosticMessage) throw new Error(`TypeScript compilation failed: \n\n${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : diagnosticMessage}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
Object.defineProperty(exports, 'typeCheck', {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return typeCheck;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { flattenDiagnosticMessageText } from "typescript";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/type-check.ts
|
|
4
|
+
/**
|
|
5
|
+
* Perform type checks on the provided sources using TypeScript's compiler API.
|
|
6
|
+
*
|
|
7
|
+
* @param context - The build context containing information about the current build.
|
|
8
|
+
*/
|
|
9
|
+
async function typeCheck(context) {
|
|
10
|
+
const result = context.program.emitToMemory();
|
|
11
|
+
const diagnosticMessages = [];
|
|
12
|
+
result.getDiagnostics().forEach((diagnostic) => {
|
|
13
|
+
if (diagnostic.getSourceFile()?.getBaseName()) diagnosticMessages.push(`${diagnostic.getSourceFile()?.getBaseName()} (${(diagnostic.getLineNumber() ?? 0) + 1}): ${flattenDiagnosticMessageText(diagnostic.getMessageText().toString(), "\n")}`);
|
|
14
|
+
else diagnosticMessages.push(flattenDiagnosticMessageText(diagnostic.getMessageText().toString(), "\n"));
|
|
15
|
+
});
|
|
16
|
+
const diagnosticMessage = diagnosticMessages.join("\n");
|
|
17
|
+
if (diagnosticMessage) throw new Error(`TypeScript compilation failed: \n\n${diagnosticMessage.length > 5e3 ? `${diagnosticMessage.slice(0, 5e3)}...` : diagnosticMessage}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { typeCheck as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as Context } from "./context-BKnG0PBM.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/type-check.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Perform type checks on the provided sources using TypeScript's compiler API.
|
|
7
|
+
*
|
|
8
|
+
* @param context - The build context containing information about the current build.
|
|
9
|
+
*/
|
|
10
|
+
declare function typeCheck(context: Context): Promise<void>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { typeCheck as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as Context } from "./context-DJwegHpz.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/type-check.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Perform type checks on the provided sources using TypeScript's compiler API.
|
|
7
|
+
*
|
|
8
|
+
* @param context - The build context containing information about the current build.
|
|
9
|
+
*/
|
|
10
|
+
declare function typeCheck(context: Context): Promise<void>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { typeCheck as t };
|
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../context-DJwegHpz.cjs";
|
|
2
|
+
import { a as __ΩTypeScriptCompilerPluginContext, c as __ΩTypeScriptCompilerPluginUserConfig, i as TypeScriptCompilerPluginUserConfig, n as TypeScriptCompilerPluginOptions, o as __ΩTypeScriptCompilerPluginOptions, r as TypeScriptCompilerPluginResolvedConfig, s as __ΩTypeScriptCompilerPluginResolvedConfig, t as TypeScriptCompilerPluginContext } from "../plugin-DZYL6q5t.cjs";
|
|
3
|
+
import "../index-DWPDThxu.cjs";
|
|
2
4
|
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../context-BKnG0PBM.mjs";
|
|
2
|
+
import { a as __ΩTypeScriptCompilerPluginContext, c as __ΩTypeScriptCompilerPluginUserConfig, i as TypeScriptCompilerPluginUserConfig, n as TypeScriptCompilerPluginOptions, o as __ΩTypeScriptCompilerPluginOptions, r as TypeScriptCompilerPluginResolvedConfig, s as __ΩTypeScriptCompilerPluginResolvedConfig, t as TypeScriptCompilerPluginContext } from "../plugin-BH3d1UOw.mjs";
|
|
3
|
+
import "../index-CUbWeWHc.mjs";
|
|
2
4
|
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../plugin-pBKbb5K9.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { PluginContext } from "../powerlines/src/types/context.cjs";
|
|
4
|
-
import ts from "typescript";
|
|
5
|
-
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
|
-
type TypeScriptCompilerPluginOptions = Partial<Omit<ts.TranspileOptions, "fileName">> & {
|
|
8
|
-
/**
|
|
9
|
-
* Whether to perform type checking during the `lint` task.
|
|
10
|
-
*
|
|
11
|
-
* @defaultValue false
|
|
12
|
-
*/
|
|
13
|
-
typeCheck?: boolean;
|
|
14
|
-
};
|
|
15
|
-
interface TypeScriptCompilerPluginUserConfig extends UserConfig {
|
|
16
|
-
transform: {
|
|
17
|
-
/**
|
|
18
|
-
* TypeScript Compiler transformation options
|
|
19
|
-
*/
|
|
20
|
-
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
interface TypeScriptCompilerPluginResolvedConfig extends ResolvedConfig {
|
|
24
|
-
transform: {
|
|
25
|
-
/**
|
|
26
|
-
* Resolved TypeScript Compiler transformation options
|
|
27
|
-
*/
|
|
28
|
-
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
type TypeScriptCompilerPluginContext<TResolvedConfig extends TypeScriptCompilerPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
32
|
-
declare type __ΩTypeScriptCompilerPluginOptions = any[];
|
|
33
|
-
declare type __ΩTypeScriptCompilerPluginUserConfig = any[];
|
|
34
|
-
declare type __ΩTypeScriptCompilerPluginResolvedConfig = any[];
|
|
35
|
-
declare type __ΩTypeScriptCompilerPluginContext = any[];
|
|
36
|
-
//#endregion
|
|
1
|
+
import "../context-DJwegHpz.cjs";
|
|
2
|
+
import { a as __ΩTypeScriptCompilerPluginContext, c as __ΩTypeScriptCompilerPluginUserConfig, i as TypeScriptCompilerPluginUserConfig, n as TypeScriptCompilerPluginOptions, o as __ΩTypeScriptCompilerPluginOptions, r as TypeScriptCompilerPluginResolvedConfig, s as __ΩTypeScriptCompilerPluginResolvedConfig, t as TypeScriptCompilerPluginContext } from "../plugin-DZYL6q5t.cjs";
|
|
37
3
|
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { PluginContext } from "../powerlines/src/types/context.mjs";
|
|
4
|
-
import ts from "typescript";
|
|
5
|
-
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
|
-
type TypeScriptCompilerPluginOptions = Partial<Omit<ts.TranspileOptions, "fileName">> & {
|
|
8
|
-
/**
|
|
9
|
-
* Whether to perform type checking during the `lint` task.
|
|
10
|
-
*
|
|
11
|
-
* @defaultValue false
|
|
12
|
-
*/
|
|
13
|
-
typeCheck?: boolean;
|
|
14
|
-
};
|
|
15
|
-
interface TypeScriptCompilerPluginUserConfig extends UserConfig {
|
|
16
|
-
transform: {
|
|
17
|
-
/**
|
|
18
|
-
* TypeScript Compiler transformation options
|
|
19
|
-
*/
|
|
20
|
-
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
interface TypeScriptCompilerPluginResolvedConfig extends ResolvedConfig {
|
|
24
|
-
transform: {
|
|
25
|
-
/**
|
|
26
|
-
* Resolved TypeScript Compiler transformation options
|
|
27
|
-
*/
|
|
28
|
-
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
type TypeScriptCompilerPluginContext<TResolvedConfig extends TypeScriptCompilerPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
32
|
-
declare type __ΩTypeScriptCompilerPluginOptions = any[];
|
|
33
|
-
declare type __ΩTypeScriptCompilerPluginUserConfig = any[];
|
|
34
|
-
declare type __ΩTypeScriptCompilerPluginResolvedConfig = any[];
|
|
35
|
-
declare type __ΩTypeScriptCompilerPluginContext = any[];
|
|
36
|
-
//#endregion
|
|
1
|
+
import "../context-BKnG0PBM.mjs";
|
|
2
|
+
import { a as __ΩTypeScriptCompilerPluginContext, c as __ΩTypeScriptCompilerPluginUserConfig, i as TypeScriptCompilerPluginUserConfig, n as TypeScriptCompilerPluginOptions, o as __ΩTypeScriptCompilerPluginOptions, r as TypeScriptCompilerPluginResolvedConfig, s as __ΩTypeScriptCompilerPluginResolvedConfig, t as TypeScriptCompilerPluginContext } from "../plugin-BH3d1UOw.mjs";
|
|
37
3
|
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-tsc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.131",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing the TypeScript compiler plugin for Powerlines.",
|
|
6
6
|
"repository": {
|
|
@@ -146,13 +146,13 @@
|
|
|
146
146
|
"keywords": ["tsc", "powerlines", "storm-software", "powerlines-plugin"],
|
|
147
147
|
"dependencies": {
|
|
148
148
|
"defu": "^6.1.4",
|
|
149
|
-
"powerlines": "^0.36.
|
|
149
|
+
"powerlines": "^0.36.27",
|
|
150
150
|
"typescript": "^5.9.3"
|
|
151
151
|
},
|
|
152
152
|
"devDependencies": {
|
|
153
|
-
"@powerlines/nx": "^0.11.
|
|
153
|
+
"@powerlines/nx": "^0.11.53",
|
|
154
154
|
"@types/node": "^24.10.4"
|
|
155
155
|
},
|
|
156
156
|
"publishConfig": { "access": "public" },
|
|
157
|
-
"gitHead": "
|
|
157
|
+
"gitHead": "fbc59ce584fd0f78d90d2dbaa18f9c9267bd3b61"
|
|
158
158
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
|
|
29
|
-
exports.__toESM = __toESM;
|