@powerlines/plugin-tsc 0.2.325 → 0.2.327
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/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -5,8 +5,8 @@ import "./types/index.cjs";
|
|
|
5
5
|
import { Plugin } from "powerlines";
|
|
6
6
|
|
|
7
7
|
//#region src/index.d.ts
|
|
8
|
-
declare module "
|
|
9
|
-
interface
|
|
8
|
+
declare module "powerlines" {
|
|
9
|
+
interface Config {
|
|
10
10
|
tsc?: TypeScriptCompilerPluginOptions;
|
|
11
11
|
}
|
|
12
12
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -5,8 +5,8 @@ import "./types/index.mjs";
|
|
|
5
5
|
import { Plugin } from "powerlines";
|
|
6
6
|
|
|
7
7
|
//#region src/index.d.ts
|
|
8
|
-
declare module "
|
|
9
|
-
interface
|
|
8
|
+
declare module "powerlines" {
|
|
9
|
+
interface Config {
|
|
10
10
|
tsc?: TypeScriptCompilerPluginOptions;
|
|
11
11
|
}
|
|
12
12
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +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 \"
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-tsc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.327",
|
|
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.15",
|
|
122
122
|
"defu": "^6.1.4",
|
|
123
|
-
"powerlines": "^0.40.
|
|
123
|
+
"powerlines": "^0.40.6",
|
|
124
124
|
"typescript": "^5.9.3"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
127
|
+
"@powerlines/plugin-plugin": "^0.12.270",
|
|
128
128
|
"@types/node": "^25.3.5"
|
|
129
129
|
},
|
|
130
130
|
"publishConfig": { "access": "public" },
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "8952a4d271f29b7b174297aaa4c0d3ebb002140f"
|
|
132
132
|
}
|