@powerlines/plugin-tsc 0.2.345 → 0.2.347
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/helpers/index.d.cts +2 -0
- package/dist/helpers/index.d.mts +2 -0
- package/dist/helpers/type-check.d.cts +13 -0
- package/dist/helpers/type-check.d.cts.map +1 -0
- package/dist/helpers/type-check.d.mts +13 -0
- package/dist/helpers/type-check.d.mts.map +1 -0
- package/dist/helpers/type-check.mjs +2 -1
- package/dist/helpers/type-check.mjs.map +1 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +22 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -0
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/plugin.d.cts +29 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +29 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Context } from "powerlines";
|
|
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 };
|
|
13
|
+
//# sourceMappingURL=type-check.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-check.d.cts","names":[],"sources":["../../src/helpers/type-check.ts"],"sourcesContent":[],"mappings":";;;;;;AA4BA;;;iBAAsB,SAAA,UAAmB,UAAU"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Context } from "powerlines";
|
|
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 };
|
|
13
|
+
//# sourceMappingURL=type-check.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-check.d.mts","names":[],"sources":["../../src/helpers/type-check.ts"],"sourcesContent":[],"mappings":";;;;;;AA4BA;;;iBAAsB,SAAA,UAAmB,UAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-check.mjs","names":["diagnosticMessages: string[]"],"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 { replacePath } from \"@stryke/path/replace\";\nimport { Context } from \"powerlines\";\nimport { createProgram } from \"powerlines/typescript\";\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(\n context.builtinsPath,\n context.workspaceConfig.workspaceRoot\n ),\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;CAiB/D,MAAM,SAhBU,cAAc,SAAS;EACrC,6BAA6B;EAC7B,iBAAiB;GACf,aAAa;GACb,gBAAgB;GAChB,qBAAqB;GACrB,WAAW;GACX,QAAQ,YACN,QAAQ,cACR,QAAQ,gBAAgB,cACzB;GACD,WAAW;GACX,aAAa;GACb,iBAAiB;GAClB;EACF,CAAC,CACqB,cAAc;CAErC,MAAMA,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/dist/index.d.cts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { typeCheck } from "./helpers/type-check.cjs";
|
|
2
|
+
import "./helpers/index.cjs";
|
|
3
|
+
import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig } from "./types/plugin.cjs";
|
|
4
|
+
import "./types/index.cjs";
|
|
5
|
+
import { Plugin } from "powerlines";
|
|
6
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
declare module "powerlines" {
|
|
9
|
+
interface Config {
|
|
10
|
+
tsc?: TypeScriptCompilerPluginOptions;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* TypeScript Compiler plugin for Powerlines.
|
|
15
|
+
*
|
|
16
|
+
* @param options - The TypeScript Compiler plugin user configuration options.
|
|
17
|
+
* @returns A Powerlines plugin that integrates TypeScript Compiler transformations.
|
|
18
|
+
*/
|
|
19
|
+
declare const plugin: <TContext extends TypeScriptCompilerPluginContext = TypeScriptCompilerPluginContext>(options?: TypeScriptCompilerPluginOptions) => Plugin<TContext>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig, plugin as default, plugin, typeCheck };
|
|
22
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;UAiCU;EAJc;;;;;AAcxB;;;AAIW,cAJE,MAIF,EAAA,CAAA,iBAHQ,+BAGR,GAFP,+BAEO,CAAA,CAAA,OAAA,CAAA,EAAA,+BAAA,EAAA,GACR,MADQ,CACD,QADC,CAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { typeCheck } from "./helpers/type-check.mjs";
|
|
2
|
+
import "./helpers/index.mjs";
|
|
3
|
+
import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig } from "./types/plugin.mjs";
|
|
4
|
+
import "./types/index.mjs";
|
|
5
|
+
import { Plugin } from "powerlines";
|
|
6
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
declare module "powerlines" {
|
|
9
|
+
interface Config {
|
|
10
|
+
tsc?: TypeScriptCompilerPluginOptions;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* TypeScript Compiler plugin for Powerlines.
|
|
15
|
+
*
|
|
16
|
+
* @param options - The TypeScript Compiler plugin user configuration options.
|
|
17
|
+
* @returns A Powerlines plugin that integrates TypeScript Compiler transformations.
|
|
18
|
+
*/
|
|
19
|
+
declare const plugin: <TContext extends TypeScriptCompilerPluginContext = TypeScriptCompilerPluginContext>(options?: TypeScriptCompilerPluginOptions) => Plugin<TContext>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig, plugin as default, plugin, typeCheck };
|
|
22
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;UAiCU;EAJc;;;;;AAcxB;;;AAIW,cAJE,MAIF,EAAA,CAAA,iBAHQ,+BAGR,GAFP,+BAEO,CAAA,CAAA,OAAA,CAAA,EAAA,+BAAA,EAAA,GACR,MADQ,CACD,QADC,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 { findFileExtensionSafe } from \"@stryke/path/find\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport ts from \"typescript\";\nimport { typeCheck } from \"./helpers/type-check\";\nimport {\n TypeScriptCompilerPluginContext,\n TypeScriptCompilerPluginOptions\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n tsc?: TypeScriptCompilerPluginOptions;\n }\n}\n\n/**\n * TypeScript Compiler plugin for Powerlines.\n *\n * @param options - The TypeScript Compiler plugin user configuration options.\n * @returns A Powerlines plugin that integrates TypeScript Compiler transformations.\n */\nexport const plugin = <\n TContext extends TypeScriptCompilerPluginContext =\n TypeScriptCompilerPluginContext\n>(\n options: TypeScriptCompilerPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"tsc\",\n config() {\n this.trace(\"Merging TypeScript Compiler plugin configuration\");\n\n return {\n tsc: defu(options ?? {}, {\n typeCheck: false\n })\n };\n },\n async lint() {\n if (this.config.tsc.typeCheck) {\n await typeCheck(this);\n }\n },\n async transform(code: string, id: string) {\n if (\n findFileExtensionSafe(id).toLowerCase() !== \"ts\" ||\n id.endsWith(\".d.ts\")\n ) {\n return { code, id };\n }\n\n const result = ts.transpileModule(code, {\n ...this.config.tsc,\n compilerOptions: {\n ...this.tsconfig.options,\n ...this.config.tsc.compilerOptions\n },\n fileName: id\n });\n if (\n result.diagnostics &&\n result.diagnostics.length > 0 &&\n result.diagnostics?.some(\n diagnostic => diagnostic.category === ts.DiagnosticCategory.Error\n )\n ) {\n throw new Error(\n `TypeScript Compiler - TypeScript transpilation errors in file: ${id}\\n${ts.formatDiagnostics(\n result.diagnostics,\n {\n getCanonicalFileName: fileName =>\n ts.sys.useCaseSensitiveFileNames\n ? fileName\n : fileName.toLowerCase(),\n getCurrentDirectory: () => ts.sys.getCurrentDirectory(),\n getNewLine: () => ts.sys.newLine\n }\n )}`\n );\n }\n\n if (!result.outputText) {\n throw new Error(\n `TypeScript Compiler - No output generated for file during TypeScript transpilation: ${id}`\n );\n }\n\n return { code: result.outputText, id };\n }\n } as Plugin<TContext>;\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;AA2CA,MAAa,UAIX,UAA2C,EAAE,KACxB;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MAAM,mDAAmD;AAE9D,UAAO,EACL,KAAK,KAAK,WAAW,EAAE,EAAE,EACvB,WAAW,OACZ,CAAC,EACH;;EAEH,MAAM,OAAO;AACX,OAAI,KAAK,OAAO,IAAI,UAClB,OAAM,UAAU,KAAK;;EAGzB,MAAM,UAAU,MAAc,IAAY;AACxC,OACE,sBAAsB,GAAG,CAAC,aAAa,KAAK,QAC5C,GAAG,SAAS,QAAQ,CAEpB,QAAO;IAAE;IAAM;IAAI;GAGrB,MAAM,SAAS,GAAG,gBAAgB,MAAM;IACtC,GAAG,KAAK,OAAO;IACf,iBAAiB;KACf,GAAG,KAAK,SAAS;KACjB,GAAG,KAAK,OAAO,IAAI;KACpB;IACD,UAAU;IACX,CAAC;AACF,OACE,OAAO,eACP,OAAO,YAAY,SAAS,KAC5B,OAAO,aAAa,MAClB,eAAc,WAAW,aAAa,GAAG,mBAAmB,MAC7D,CAED,OAAM,IAAI,MACR,kEAAkE,GAAG,IAAI,GAAG,kBAC1E,OAAO,aACP;IACE,uBAAsB,aACpB,GAAG,IAAI,4BACH,WACA,SAAS,aAAa;IAC5B,2BAA2B,GAAG,IAAI,qBAAqB;IACvD,kBAAkB,GAAG,IAAI;IAC1B,CACF,GACF;AAGH,OAAI,CAAC,OAAO,WACV,OAAM,IAAI,MACR,uFAAuF,KACxF;AAGH,UAAO;IAAE,MAAM,OAAO;IAAY;IAAI;;EAEzC;;AAGH,kBAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig } from "./plugin.cjs";
|
|
2
|
+
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig } from "./plugin.mjs";
|
|
2
|
+
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
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
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
15
|
+
}
|
|
16
|
+
interface TypeScriptCompilerPluginResolvedConfig extends ResolvedConfig {
|
|
17
|
+
/**
|
|
18
|
+
* Resolved TypeScript Compiler transformation options
|
|
19
|
+
*/
|
|
20
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
21
|
+
}
|
|
22
|
+
type TypeScriptCompilerPluginContext<TResolvedConfig extends TypeScriptCompilerPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
23
|
+
declare type __ΩTypeScriptCompilerPluginOptions = any[];
|
|
24
|
+
declare type __ΩTypeScriptCompilerPluginUserConfig = any[];
|
|
25
|
+
declare type __ΩTypeScriptCompilerPluginResolvedConfig = any[];
|
|
26
|
+
declare type __ΩTypeScriptCompilerPluginContext = any[];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig };
|
|
29
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,+BAAA,GAAkC,QAC5C,KAAK,EAAA,CAAG;;AADV;;;;EAAqD,SAAA,CAAA,EAAA,OAAA;AAWrD,CAAA;AACoB,UADH,kCAAA,SAA2C,UACxC,CAAA;EAAL,GAAA,EAAR,OAAQ,CAAA,IAAA,CAAK,+BAAL,EAAA,WAAA,CAAA,CAAA,GACX,QADW,CACF,IADE,CACG,+BADH,EAAA,WAAA,CAAA,CAAA;;AACG,UAGD,sCAAA,SAA+C,cAH9C,CAAA;EAAL;;;EAFyD,GAAA,EAS/D,OAT+D,CASvD,IATuD,CASlD,+BATkD,EAAA,WAAA,CAAA,CAAA,GAUlE,QAVkE,CAUzD,IAVyD,CAUpD,+BAVoD,EAAA,WAAA,CAAA,CAAA;AAKtE;AAIoB,KAIR,+BAJQ,CAAA,wBAKM,sCALN,GAMhB,sCANgB,CAAA,GAOhB,aAPgB,CAOF,eAPE,CAAA;AAAL,kDAAA,GAAA,EAAA;AAAR,qDAAA,GAAA,EAAA;AACW,yDAAA,GAAA,EAAA;AAAL,kDAAA,GAAA,EAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
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
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
15
|
+
}
|
|
16
|
+
interface TypeScriptCompilerPluginResolvedConfig extends ResolvedConfig {
|
|
17
|
+
/**
|
|
18
|
+
* Resolved TypeScript Compiler transformation options
|
|
19
|
+
*/
|
|
20
|
+
tsc: Partial<Omit<TypeScriptCompilerPluginOptions, "typeCheck">> & Required<Pick<TypeScriptCompilerPluginOptions, "typeCheck">>;
|
|
21
|
+
}
|
|
22
|
+
type TypeScriptCompilerPluginContext<TResolvedConfig extends TypeScriptCompilerPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
23
|
+
declare type __ΩTypeScriptCompilerPluginOptions = any[];
|
|
24
|
+
declare type __ΩTypeScriptCompilerPluginUserConfig = any[];
|
|
25
|
+
declare type __ΩTypeScriptCompilerPluginResolvedConfig = any[];
|
|
26
|
+
declare type __ΩTypeScriptCompilerPluginContext = any[];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig };
|
|
29
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,+BAAA,GAAkC,QAC5C,KAAK,EAAA,CAAG;;AADV;;;;EAAqD,SAAA,CAAA,EAAA,OAAA;AAWrD,CAAA;AACoB,UADH,kCAAA,SAA2C,UACxC,CAAA;EAAL,GAAA,EAAR,OAAQ,CAAA,IAAA,CAAK,+BAAL,EAAA,WAAA,CAAA,CAAA,GACX,QADW,CACF,IADE,CACG,+BADH,EAAA,WAAA,CAAA,CAAA;;AACG,UAGD,sCAAA,SAA+C,cAH9C,CAAA;EAAL;;;EAFyD,GAAA,EAS/D,OAT+D,CASvD,IATuD,CASlD,+BATkD,EAAA,WAAA,CAAA,CAAA,GAUlE,QAVkE,CAUzD,IAVyD,CAUpD,+BAVoD,EAAA,WAAA,CAAA,CAAA;AAKtE;AAIoB,KAIR,+BAJQ,CAAA,wBAKM,sCALN,GAMhB,sCANgB,CAAA,GAOhB,aAPgB,CAOF,eAPE,CAAA;AAAL,kDAAA,GAAA,EAAA;AAAR,qDAAA,GAAA,EAAA;AACW,yDAAA,GAAA,EAAA;AAAL,kDAAA,GAAA,EAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-tsc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.347",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing the TypeScript compiler plugin for Powerlines.",
|
|
6
6
|
"repository": {
|
|
@@ -120,13 +120,13 @@
|
|
|
120
120
|
"dependencies": {
|
|
121
121
|
"@stryke/path": "^0.26.19",
|
|
122
122
|
"defu": "^6.1.4",
|
|
123
|
-
"powerlines": "^0.41.
|
|
123
|
+
"powerlines": "^0.41.4",
|
|
124
124
|
"typescript": "^5.9.3"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
127
|
+
"@powerlines/plugin-plugin": "^0.12.290",
|
|
128
128
|
"@types/node": "^25.4.0"
|
|
129
129
|
},
|
|
130
130
|
"publishConfig": { "access": "public" },
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "387dd4f3e14b4e5a2580ffcf2951d7727aae15a3"
|
|
132
132
|
}
|