@powerlines/plugin-tsc 0.2.349 → 0.2.350

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/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the <b>🔌 Powerlines</b> monorepo. Powerlines is the "
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.2.342-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.2.349-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -58,21 +58,19 @@ A package containing the TypeScript compiler plugin for Powerlines, various help
58
58
 
59
59
  ## Table of Contents
60
60
 
61
- - [Powerlines - TypeScript Compiler Plugin](#powerlines---typescript-compiler-plugin)
62
- - [Table of Contents](#table-of-contents)
63
- - [Installing](#installing)
64
- - [Reduced Package Size](#reduced-package-size)
65
- - [Development](#development)
66
- - [Building](#building)
67
- - [Running unit tests](#running-unit-tests)
68
- - [Linting](#linting)
69
- - [Storm Workspaces](#storm-workspaces)
70
- - [Roadmap](#roadmap)
71
- - [Support](#support)
72
- - [License](#license)
73
- - [Changelog](#changelog)
74
- - [Contributing](#contributing)
75
- - [Contributors](#contributors)
61
+ - [Installing](#installing)
62
+ - [Reduced Package Size](#reduced-package-size)
63
+ - [Development](#development)
64
+ - [Building](#building)
65
+ - [Running unit tests](#running-unit-tests)
66
+ - [Linting](#linting)
67
+ - [Storm Workspaces](#storm-workspaces)
68
+ - [Roadmap](#roadmap)
69
+ - [Support](#support)
70
+ - [License](#license)
71
+ - [Changelog](#changelog)
72
+ - [Contributing](#contributing)
73
+ - [Contributors](#contributors)
76
74
 
77
75
  <!-- END doctoc -->
78
76
 
@@ -1,4 +1,4 @@
1
- //#region rolldown:runtime
1
+ //#region \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -0,0 +1,3 @@
1
+ import "node:module";
2
+
3
+ export { };
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  const require_helpers_type_check = require('./type-check.cjs');
2
3
 
3
4
  exports.typeCheck = require_helpers_type_check.typeCheck;
@@ -1,6 +1,7 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let typescript = require("typescript");
3
- let __stryke_path_replace = require("@stryke/path/replace");
4
+ let _stryke_path_replace = require("@stryke/path/replace");
4
5
  let powerlines_typescript = require("powerlines/typescript");
5
6
 
6
7
  //#region src/helpers/type-check.ts
@@ -17,7 +18,7 @@ async function typeCheck(context) {
17
18
  declarationMap: false,
18
19
  emitDeclarationOnly: true,
19
20
  sourceMap: false,
20
- outDir: (0, __stryke_path_replace.replacePath)(context.builtinsPath, context.workspaceConfig.workspaceRoot),
21
+ outDir: (0, _stryke_path_replace.replacePath)(context.builtinsPath, context.workspaceConfig.workspaceRoot),
21
22
  composite: false,
22
23
  incremental: false,
23
24
  tsBuildInfoFile: void 0
@@ -1,7 +1,6 @@
1
1
  import { Context } from "powerlines";
2
2
 
3
3
  //#region src/helpers/type-check.d.ts
4
-
5
4
  /**
6
5
  * Perform type checks on the provided sources using TypeScript's compiler API.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"type-check.d.cts","names":[],"sources":["../../src/helpers/type-check.ts"],"sourcesContent":[],"mappings":";;;;;;AA4BA;;;iBAAsB,SAAA,UAAmB,UAAU"}
1
+ {"version":3,"file":"type-check.d.cts","names":[],"sources":["../../src/helpers/type-check.ts"],"mappings":";;;;;AA4BA;;;iBAAsB,SAAA,CAAU,OAAA,EAAS,OAAA,GAAU,OAAA"}
@@ -1,7 +1,6 @@
1
1
  import { Context } from "powerlines";
2
2
 
3
3
  //#region src/helpers/type-check.d.ts
4
-
5
4
  /**
6
5
  * Perform type checks on the provided sources using TypeScript's compiler API.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"type-check.d.mts","names":[],"sources":["../../src/helpers/type-check.ts"],"sourcesContent":[],"mappings":";;;;;;AA4BA;;;iBAAsB,SAAA,UAAmB,UAAU"}
1
+ {"version":3,"file":"type-check.d.mts","names":[],"sources":["../../src/helpers/type-check.ts"],"mappings":";;;;;AA4BA;;;iBAAsB,SAAA,CAAU,OAAA,EAAS,OAAA,GAAU,OAAA"}
@@ -1 +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"}
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 { 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,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/dist/index.cjs CHANGED
@@ -1,12 +1,12 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
3
  const require_helpers_type_check = require('./helpers/type-check.cjs');
4
4
  require('./helpers/index.cjs');
5
- let __stryke_path_find = require("@stryke/path/find");
5
+ let _stryke_path_find = require("@stryke/path/find");
6
6
  let defu = require("defu");
7
- defu = require_rolldown_runtime.__toESM(defu);
7
+ defu = require_runtime.__toESM(defu);
8
8
  let typescript = require("typescript");
9
- typescript = require_rolldown_runtime.__toESM(typescript);
9
+ typescript = require_runtime.__toESM(typescript);
10
10
 
11
11
  //#region src/index.ts
12
12
  /**
@@ -26,7 +26,7 @@ const plugin = (options = {}) => {
26
26
  if (this.config.tsc.typeCheck) await require_helpers_type_check.typeCheck(this);
27
27
  },
28
28
  async transform(code, id) {
29
- if ((0, __stryke_path_find.findFileExtensionSafe)(id).toLowerCase() !== "ts" || id.endsWith(".d.ts")) return {
29
+ if ((0, _stryke_path_find.findFileExtensionSafe)(id).toLowerCase() !== "ts" || id.endsWith(".d.ts")) return {
30
30
  code,
31
31
  id
32
32
  };
@@ -51,9 +51,8 @@ const plugin = (options = {}) => {
51
51
  }
52
52
  };
53
53
  };
54
- var src_default = plugin;
55
54
 
56
55
  //#endregion
57
- exports.default = src_default;
56
+ exports.default = plugin;
58
57
  exports.plugin = plugin;
59
58
  exports.typeCheck = require_helpers_type_check.typeCheck;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { typeCheck } from "./helpers/type-check.cjs";
2
- import "./helpers/index.cjs";
3
2
  import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig } from "./types/plugin.cjs";
4
- import "./types/index.cjs";
5
3
  import { Plugin } from "powerlines";
6
4
 
7
5
  //#region src/index.d.ts
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YAgCY,MAAA;IACR,GAAA,GAAM,+BAAA;EAAA;AAAA;;;;;;;cAUG,MAAA,oBACM,+BAAA,GACf,+BAAA,EAEF,OAAA,GAAS,+BAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { typeCheck } from "./helpers/type-check.mjs";
2
- import "./helpers/index.mjs";
3
2
  import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig, __ΩTypeScriptCompilerPluginContext, __ΩTypeScriptCompilerPluginOptions, __ΩTypeScriptCompilerPluginResolvedConfig, __ΩTypeScriptCompilerPluginUserConfig } from "./types/plugin.mjs";
4
- import "./types/index.mjs";
5
3
  import { Plugin } from "powerlines";
6
4
 
7
5
  //#region src/index.d.ts
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YAgCY,MAAA;IACR,GAAA,GAAM,+BAAA;EAAA;AAAA;;;;;;;cAUG,MAAA,oBACM,+BAAA,GACf,+BAAA,EAEF,OAAA,GAAS,+BAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -47,8 +47,7 @@ const plugin = (options = {}) => {
47
47
  }
48
48
  };
49
49
  };
50
- var src_default = plugin;
51
50
 
52
51
  //#endregion
53
- export { src_default as default, plugin, typeCheck };
52
+ export { plugin as default, plugin, typeCheck };
54
53
  //# sourceMappingURL=index.mjs.map
@@ -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 \"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"}
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"}
@@ -1 +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"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,+BAAA,GAAkC,OAAA,CAC5C,IAAA,CAAK,EAAA,CAAG,gBAAA;;AADV;;;;EAQE,SAAA;AAAA;AAAA,UAGe,kCAAA,SAA2C,UAAA;EAC1D,GAAA,EAAK,OAAA,CAAQ,IAAA,CAAK,+BAAA,kBAChB,QAAA,CAAS,IAAA,CAAK,+BAAA;AAAA;AAAA,UAGD,sCAAA,SAA+C,cAAA;EAfzD;;;EAmBL,GAAA,EAAK,OAAA,CAAQ,IAAA,CAAK,+BAAA,kBAChB,QAAA,CAAS,IAAA,CAAK,+BAAA;AAAA;AAAA,KAGN,+BAAA,yBACc,sCAAA,GACtB,sCAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -1 +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"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,+BAAA,GAAkC,OAAA,CAC5C,IAAA,CAAK,EAAA,CAAG,gBAAA;;AADV;;;;EAQE,SAAA;AAAA;AAAA,UAGe,kCAAA,SAA2C,UAAA;EAC1D,GAAA,EAAK,OAAA,CAAQ,IAAA,CAAK,+BAAA,kBAChB,QAAA,CAAS,IAAA,CAAK,+BAAA;AAAA;AAAA,UAGD,sCAAA,SAA+C,cAAA;EAfzD;;;EAmBL,GAAA,EAAK,OAAA,CAAQ,IAAA,CAAK,+BAAA,kBAChB,QAAA,CAAS,IAAA,CAAK,+BAAA;AAAA;AAAA,KAGN,+BAAA,yBACc,sCAAA,GACtB,sCAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-tsc",
3
- "version": "0.2.349",
3
+ "version": "0.2.350",
4
4
  "type": "module",
5
5
  "description": "A package containing the TypeScript compiler plugin for Powerlines.",
6
6
  "repository": {
@@ -55,7 +55,6 @@
55
55
  "default": "./dist/index.mjs"
56
56
  }
57
57
  },
58
- "./*": "./*",
59
58
  "./helpers": {
60
59
  "require": {
61
60
  "types": "./dist/helpers/index.d.cts",
@@ -84,6 +83,7 @@
84
83
  "default": "./dist/helpers/type-check.mjs"
85
84
  }
86
85
  },
86
+ "./package.json": "./package.json",
87
87
  "./types": {
88
88
  "require": {
89
89
  "types": "./dist/types/index.d.cts",
@@ -120,13 +120,13 @@
120
120
  "dependencies": {
121
121
  "@stryke/path": "^0.26.19",
122
122
  "defu": "^6.1.4",
123
- "powerlines": "^0.41.6",
123
+ "powerlines": "^0.41.7",
124
124
  "typescript": "^5.9.3"
125
125
  },
126
126
  "devDependencies": {
127
- "@powerlines/plugin-plugin": "^0.12.292",
127
+ "@powerlines/plugin-plugin": "^0.12.293",
128
128
  "@types/node": "^25.4.0"
129
129
  },
130
130
  "publishConfig": { "access": "public" },
131
- "gitHead": "86bbe64da57a38d472b37261ca9d113171841a6c"
131
+ "gitHead": "2fb48143904805988bac9bdbc04cdc4a35ff398b"
132
132
  }