@powerlines/plugin-deepkit 0.10.136 → 0.10.137

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.
Files changed (54) hide show
  1. package/dist/index-BgAdqTbb.d.mts +1 -0
  2. package/dist/index-CEgs-Dz2.d.cts +1 -0
  3. package/dist/index.cjs +48 -7
  4. package/dist/index.d.cts +2 -2
  5. package/dist/index.d.mts +2 -3
  6. package/dist/index.mjs +18 -4
  7. package/dist/plugin-BuwTR6h1.d.cts +1803 -0
  8. package/dist/plugin-CW8k-fOr.d.mts +1804 -0
  9. package/dist/plugin-DHXHjv16.cjs +0 -0
  10. package/dist/plugin-DNsqegEV.mjs +1 -0
  11. package/dist/types/index.cjs +2 -0
  12. package/dist/types/index.d.cts +2 -1
  13. package/dist/types/index.d.mts +2 -1
  14. package/dist/types/index.mjs +3 -0
  15. package/dist/types/plugin.cjs +1 -0
  16. package/dist/types/plugin.d.cts +1 -27
  17. package/dist/types/plugin.d.mts +1 -27
  18. package/dist/types/plugin.mjs +2 -0
  19. package/dist/types-CpP_DWx6.mjs +1 -0
  20. package/dist/types-DHkg7xmX.cjs +0 -0
  21. package/package.json +3 -3
  22. package/dist/_virtual/rolldown_runtime.cjs +0 -37
  23. package/dist/_virtual/rolldown_runtime.mjs +0 -29
  24. package/dist/deepkit/src/transformer.cjs +0 -52
  25. package/dist/deepkit/src/transformer.mjs +0 -49
  26. package/dist/deepkit/src/vendor/type-compiler/config.d.cts +0 -7
  27. package/dist/deepkit/src/vendor/type-compiler/config.d.mts +0 -7
  28. package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -38
  29. package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -19
  30. package/dist/plugin-tsc/src/helpers/index.cjs +0 -1
  31. package/dist/plugin-tsc/src/helpers/index.mjs +0 -3
  32. package/dist/plugin-tsc/src/helpers/type-check.cjs +0 -22
  33. package/dist/plugin-tsc/src/helpers/type-check.mjs +0 -21
  34. package/dist/plugin-tsc/src/index.cjs +0 -50
  35. package/dist/plugin-tsc/src/index.mjs +0 -47
  36. package/dist/plugin-tsc/src/types/plugin.d.cts +0 -33
  37. package/dist/plugin-tsc/src/types/plugin.d.mts +0 -33
  38. package/dist/powerlines/src/types/build.d.cts +0 -145
  39. package/dist/powerlines/src/types/build.d.mts +0 -145
  40. package/dist/powerlines/src/types/commands.d.cts +0 -8
  41. package/dist/powerlines/src/types/commands.d.mts +0 -9
  42. package/dist/powerlines/src/types/config.d.cts +0 -369
  43. package/dist/powerlines/src/types/config.d.mts +0 -369
  44. package/dist/powerlines/src/types/context.d.cts +0 -403
  45. package/dist/powerlines/src/types/context.d.mts +0 -405
  46. package/dist/powerlines/src/types/fs.d.cts +0 -486
  47. package/dist/powerlines/src/types/fs.d.mts +0 -486
  48. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  49. package/dist/powerlines/src/types/plugin.d.cts +0 -231
  50. package/dist/powerlines/src/types/plugin.d.mts +0 -231
  51. package/dist/powerlines/src/types/resolved.d.cts +0 -81
  52. package/dist/powerlines/src/types/resolved.d.mts +0 -81
  53. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  54. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
File without changes
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,2 @@
1
+ require('../plugin-DHXHjv16.cjs');
2
+ require('../types-DHkg7xmX.cjs');
@@ -1,2 +1,3 @@
1
- import { DeepkitPluginContext, DeepkitPluginOptions, DeepkitPluginResolvedConfig, DeepkitPluginUserConfig, __ΩDeepkitPluginContext, __ΩDeepkitPluginOptions, __ΩDeepkitPluginResolvedConfig, __ΩDeepkitPluginUserConfig } from "./plugin.cjs";
1
+ import { a as __ΩDeepkitPluginContext, c as __ΩDeepkitPluginUserConfig, i as DeepkitPluginUserConfig, n as DeepkitPluginOptions, o as __ΩDeepkitPluginOptions, r as DeepkitPluginResolvedConfig, s as __ΩDeepkitPluginResolvedConfig, t as DeepkitPluginContext } from "../plugin-BuwTR6h1.cjs";
2
+ import "../index-CEgs-Dz2.cjs";
2
3
  export { DeepkitPluginContext, DeepkitPluginOptions, DeepkitPluginResolvedConfig, DeepkitPluginUserConfig, __ΩDeepkitPluginContext, __ΩDeepkitPluginOptions, __ΩDeepkitPluginResolvedConfig, __ΩDeepkitPluginUserConfig };
@@ -1,2 +1,3 @@
1
- import { DeepkitPluginContext, DeepkitPluginOptions, DeepkitPluginResolvedConfig, DeepkitPluginUserConfig, __ΩDeepkitPluginContext, __ΩDeepkitPluginOptions, __ΩDeepkitPluginResolvedConfig, __ΩDeepkitPluginUserConfig } from "./plugin.mjs";
1
+ import { a as __ΩDeepkitPluginContext, c as __ΩDeepkitPluginUserConfig, i as DeepkitPluginUserConfig, n as DeepkitPluginOptions, o as __ΩDeepkitPluginOptions, r as DeepkitPluginResolvedConfig, s as __ΩDeepkitPluginResolvedConfig, t as DeepkitPluginContext } from "../plugin-CW8k-fOr.mjs";
2
+ import "../index-BgAdqTbb.mjs";
2
3
  export { DeepkitPluginContext, DeepkitPluginOptions, DeepkitPluginResolvedConfig, DeepkitPluginUserConfig, __ΩDeepkitPluginContext, __ΩDeepkitPluginOptions, __ΩDeepkitPluginResolvedConfig, __ΩDeepkitPluginUserConfig };
@@ -1 +1,4 @@
1
+ import "../plugin-DNsqegEV.mjs";
2
+ import "../types-CpP_DWx6.mjs";
3
+
1
4
  export { };
@@ -0,0 +1 @@
1
+ require('../plugin-DHXHjv16.cjs');
@@ -1,28 +1,2 @@
1
- import { config_d_exports } from "../deepkit/src/vendor/type-compiler/config.cjs";
2
- import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig } from "../plugin-tsc/src/types/plugin.cjs";
3
-
4
- //#region src/types/plugin.d.ts
5
- type DeepkitPluginOptions = Partial<config_d_exports.ReflectionConfig> & TypeScriptCompilerPluginOptions;
6
- type DeepkitPluginUserConfig = TypeScriptCompilerPluginUserConfig & {
7
- transform: {
8
- /**
9
- * Deepkit transformation options
10
- */
11
- deepkit: DeepkitPluginOptions;
12
- };
13
- };
14
- type DeepkitPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig & {
15
- transform: {
16
- /**
17
- * Resolved deepkit transformation options
18
- */
19
- deepkit: Required<DeepkitPluginOptions>;
20
- };
21
- };
22
- type DeepkitPluginContext<TResolvedConfig extends DeepkitPluginResolvedConfig = DeepkitPluginResolvedConfig> = TypeScriptCompilerPluginContext<TResolvedConfig>;
23
- declare type __ΩDeepkitPluginOptions = any[];
24
- declare type __ΩDeepkitPluginUserConfig = any[];
25
- declare type __ΩDeepkitPluginResolvedConfig = any[];
26
- declare type __ΩDeepkitPluginContext = any[];
27
- //#endregion
1
+ import { a as __ΩDeepkitPluginContext, c as __ΩDeepkitPluginUserConfig, i as DeepkitPluginUserConfig, n as DeepkitPluginOptions, o as __ΩDeepkitPluginOptions, r as DeepkitPluginResolvedConfig, s as __ΩDeepkitPluginResolvedConfig, t as DeepkitPluginContext } from "../plugin-BuwTR6h1.cjs";
28
2
  export { DeepkitPluginContext, DeepkitPluginOptions, DeepkitPluginResolvedConfig, DeepkitPluginUserConfig, __ΩDeepkitPluginContext, __ΩDeepkitPluginOptions, __ΩDeepkitPluginResolvedConfig, __ΩDeepkitPluginUserConfig };
@@ -1,28 +1,2 @@
1
- import { config_d_exports } from "../deepkit/src/vendor/type-compiler/config.mjs";
2
- import { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig } from "../plugin-tsc/src/types/plugin.mjs";
3
-
4
- //#region src/types/plugin.d.ts
5
- type DeepkitPluginOptions = Partial<config_d_exports.ReflectionConfig> & TypeScriptCompilerPluginOptions;
6
- type DeepkitPluginUserConfig = TypeScriptCompilerPluginUserConfig & {
7
- transform: {
8
- /**
9
- * Deepkit transformation options
10
- */
11
- deepkit: DeepkitPluginOptions;
12
- };
13
- };
14
- type DeepkitPluginResolvedConfig = TypeScriptCompilerPluginResolvedConfig & {
15
- transform: {
16
- /**
17
- * Resolved deepkit transformation options
18
- */
19
- deepkit: Required<DeepkitPluginOptions>;
20
- };
21
- };
22
- type DeepkitPluginContext<TResolvedConfig extends DeepkitPluginResolvedConfig = DeepkitPluginResolvedConfig> = TypeScriptCompilerPluginContext<TResolvedConfig>;
23
- declare type __ΩDeepkitPluginOptions = any[];
24
- declare type __ΩDeepkitPluginUserConfig = any[];
25
- declare type __ΩDeepkitPluginResolvedConfig = any[];
26
- declare type __ΩDeepkitPluginContext = any[];
27
- //#endregion
1
+ import { a as __ΩDeepkitPluginContext, c as __ΩDeepkitPluginUserConfig, i as DeepkitPluginUserConfig, n as DeepkitPluginOptions, o as __ΩDeepkitPluginOptions, r as DeepkitPluginResolvedConfig, s as __ΩDeepkitPluginResolvedConfig, t as DeepkitPluginContext } from "../plugin-CW8k-fOr.mjs";
28
2
  export { DeepkitPluginContext, DeepkitPluginOptions, DeepkitPluginResolvedConfig, DeepkitPluginUserConfig, __ΩDeepkitPluginContext, __ΩDeepkitPluginOptions, __ΩDeepkitPluginResolvedConfig, __ΩDeepkitPluginUserConfig };
@@ -1 +1,3 @@
1
+ import "../plugin-DNsqegEV.mjs";
2
+
1
3
  export { };
@@ -0,0 +1 @@
1
+ export { };
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-deepkit",
3
- "version": "0.10.136",
3
+ "version": "0.10.137",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "repository": {
@@ -118,7 +118,7 @@
118
118
  "keywords": ["deepkit", "powerlines", "storm-software", "powerlines-plugin"],
119
119
  "dependencies": {
120
120
  "@stryke/json": "^0.9.33",
121
- "@powerlines/deepkit": "^0.5.36",
121
+ "@powerlines/deepkit": "^0.5.37",
122
122
  "@powerlines/plugin-tsc": "^0.2.129",
123
123
  "powerlines": "^0.36.26",
124
124
  "typescript": "^5.9.3"
@@ -128,5 +128,5 @@
128
128
  "@types/node": "^24.10.4"
129
129
  },
130
130
  "publishConfig": { "access": "public" },
131
- "gitHead": "b9a0574767447bffa6549e0492812dfe64e879e3"
131
+ "gitHead": "9e66d0e1d9210071bcabcd4e4dc04ad4d2bbfe15"
132
132
  }
@@ -1,37 +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 __reExport = (target, mod, secondTarget, symbols) => {
23
- if (symbols) {
24
- __defProp(target, Symbol.toStringTag, { value: "Module" });
25
- secondTarget && __defProp(secondTarget, Symbol.toStringTag, { value: "Module" });
26
- }
27
- __copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
28
- };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
32
- }) : target, mod));
33
-
34
- //#endregion
35
-
36
- exports.__reExport = __reExport;
37
- exports.__toESM = __toESM;
@@ -1,29 +0,0 @@
1
- //#region rolldown:runtime
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
9
- key = keys[i];
10
- if (!__hasOwnProp.call(to, key) && key !== except) {
11
- __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
15
- }
16
- }
17
- }
18
- return to;
19
- };
20
- var __reExport = (target, mod, secondTarget, symbols) => {
21
- if (symbols) {
22
- __defProp(target, Symbol.toStringTag, { value: "Module" });
23
- secondTarget && __defProp(secondTarget, Symbol.toStringTag, { value: "Module" });
24
- }
25
- __copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
26
- };
27
-
28
- //#endregion
29
- export { __reExport };
@@ -1,52 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_index = require('./vendor/type-compiler/index.cjs');
3
- let defu = require("defu");
4
- defu = require_rolldown_runtime.__toESM(defu);
5
-
6
- //#region ../deepkit/src/transformer.ts
7
- let loaded = false;
8
- const cache = new require_index.type_compiler_exports.Cache();
9
- /**
10
- * Creates a Deepkit TypeScript transformer.
11
- *
12
- * @param context - The Powerlines plugin context.
13
- * @param options - The transformation options.
14
- * @returns A Deepkit TypeScript custom transformer factory.
15
- */
16
- function createTransformer(context, options = {}) {
17
- return function transformer(ctx) {
18
- if (!loaded) loaded = true;
19
- cache.tick();
20
- return new require_index.type_compiler_exports.ReflectionTransformer(ctx, cache).withReflection((0, defu.default)(options, {
21
- reflection: context.tsconfig.tsconfigJson.compilerOptions?.reflection || context.tsconfig.tsconfigJson.reflection,
22
- reflectionLevel: context.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel || context.tsconfig.tsconfigJson.reflectionLevel
23
- }, {
24
- exclude: [],
25
- reflection: "default",
26
- reflectionLevel: "minimal"
27
- }));
28
- };
29
- }
30
- /**
31
- * Creates a Deepkit TypeScript declaration transformer.
32
- *
33
- * @param context - The Powerlines plugin context.
34
- * @param options - The transformation options.
35
- * @returns A Deepkit TypeScript custom declaration transformer factory.
36
- */
37
- function createDeclarationTransformer(context, options = {}) {
38
- return function declarationTransformer(ctx) {
39
- return new require_index.type_compiler_exports.DeclarationTransformer(ctx, cache).withReflection((0, defu.default)(options, {
40
- reflection: context.tsconfig.tsconfigJson.compilerOptions?.reflection || context.tsconfig.tsconfigJson.reflection,
41
- reflectionLevel: context.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel || context.tsconfig.tsconfigJson.reflectionLevel
42
- }, {
43
- exclude: [],
44
- reflection: "default",
45
- reflectionLevel: "minimal"
46
- }));
47
- };
48
- }
49
-
50
- //#endregion
51
- exports.createDeclarationTransformer = createDeclarationTransformer;
52
- exports.createTransformer = createTransformer;
@@ -1,49 +0,0 @@
1
- import { type_compiler_exports } from "./vendor/type-compiler/index.mjs";
2
- import defu from "defu";
3
-
4
- //#region ../deepkit/src/transformer.ts
5
- let loaded = false;
6
- const cache = new type_compiler_exports.Cache();
7
- /**
8
- * Creates a Deepkit TypeScript transformer.
9
- *
10
- * @param context - The Powerlines plugin context.
11
- * @param options - The transformation options.
12
- * @returns A Deepkit TypeScript custom transformer factory.
13
- */
14
- function createTransformer(context, options = {}) {
15
- return function transformer(ctx) {
16
- if (!loaded) loaded = true;
17
- cache.tick();
18
- return new type_compiler_exports.ReflectionTransformer(ctx, cache).withReflection(defu(options, {
19
- reflection: context.tsconfig.tsconfigJson.compilerOptions?.reflection || context.tsconfig.tsconfigJson.reflection,
20
- reflectionLevel: context.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel || context.tsconfig.tsconfigJson.reflectionLevel
21
- }, {
22
- exclude: [],
23
- reflection: "default",
24
- reflectionLevel: "minimal"
25
- }));
26
- };
27
- }
28
- /**
29
- * Creates a Deepkit TypeScript declaration transformer.
30
- *
31
- * @param context - The Powerlines plugin context.
32
- * @param options - The transformation options.
33
- * @returns A Deepkit TypeScript custom declaration transformer factory.
34
- */
35
- function createDeclarationTransformer(context, options = {}) {
36
- return function declarationTransformer(ctx) {
37
- return new type_compiler_exports.DeclarationTransformer(ctx, cache).withReflection(defu(options, {
38
- reflection: context.tsconfig.tsconfigJson.compilerOptions?.reflection || context.tsconfig.tsconfigJson.reflection,
39
- reflectionLevel: context.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel || context.tsconfig.tsconfigJson.reflectionLevel
40
- }, {
41
- exclude: [],
42
- reflection: "default",
43
- reflectionLevel: "minimal"
44
- }));
45
- };
46
- }
47
-
48
- //#endregion
49
- export { createDeclarationTransformer, createTransformer };
@@ -1,7 +0,0 @@
1
- export * from "@deepkit/type-compiler/config";
2
-
3
- //#region ../deepkit/src/vendor/type-compiler/config.d.ts
4
-
5
- import * as import___deepkit_type_compiler_config from "@deepkit/type-compiler/config";
6
- //#endregion
7
- export { import___deepkit_type_compiler_config as config_d_exports };
@@ -1,7 +0,0 @@
1
- export * from "@deepkit/type-compiler/config";
2
-
3
- //#region ../deepkit/src/vendor/type-compiler/config.d.ts
4
-
5
- import * as import___deepkit_type_compiler_config from "@deepkit/type-compiler/config";
6
- //#endregion
7
- export { import___deepkit_type_compiler_config as config_d_exports };
@@ -1,38 +0,0 @@
1
- const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
-
3
- //#region ../deepkit/src/vendor/type-compiler/index.ts
4
- var type_compiler_exports = {};
5
- require_rolldown_runtime.__reExport(type_compiler_exports, require("@deepkit/type-compiler"));
6
- require_rolldown_runtime.__reExport(type_compiler_exports, require("@deepkit/type-compiler/compiler"));
7
- require_rolldown_runtime.__reExport(type_compiler_exports, require("@deepkit/type-compiler/config"));
8
-
9
- //#endregion
10
- Object.defineProperty(exports, 'type_compiler_exports', {
11
- enumerable: true,
12
- get: function () {
13
- return type_compiler_exports;
14
- }
15
- });
16
- var __deepkit_type_compiler = require("@deepkit/type-compiler");
17
- Object.keys(__deepkit_type_compiler).forEach(function (k) {
18
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
19
- enumerable: true,
20
- get: function () { return __deepkit_type_compiler[k]; }
21
- });
22
- });
23
-
24
- var __deepkit_type_compiler_compiler = require("@deepkit/type-compiler/compiler");
25
- Object.keys(__deepkit_type_compiler_compiler).forEach(function (k) {
26
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
27
- enumerable: true,
28
- get: function () { return __deepkit_type_compiler_compiler[k]; }
29
- });
30
- });
31
-
32
- var __deepkit_type_compiler_config = require("@deepkit/type-compiler/config");
33
- Object.keys(__deepkit_type_compiler_config).forEach(function (k) {
34
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
35
- enumerable: true,
36
- get: function () { return __deepkit_type_compiler_config[k]; }
37
- });
38
- });
@@ -1,19 +0,0 @@
1
- import { __reExport } from "../../../../_virtual/rolldown_runtime.mjs";
2
-
3
- export * from "@deepkit/type-compiler"
4
-
5
- export * from "@deepkit/type-compiler/compiler"
6
-
7
- export * from "@deepkit/type-compiler/config"
8
-
9
- //#region ../deepkit/src/vendor/type-compiler/index.ts
10
- var type_compiler_exports = {};
11
- import * as import___deepkit_type_compiler from "@deepkit/type-compiler";
12
- __reExport(type_compiler_exports, import___deepkit_type_compiler);
13
- import * as import___deepkit_type_compiler_compiler from "@deepkit/type-compiler/compiler";
14
- __reExport(type_compiler_exports, import___deepkit_type_compiler_compiler);
15
- import * as import___deepkit_type_compiler_config from "@deepkit/type-compiler/config";
16
- __reExport(type_compiler_exports, import___deepkit_type_compiler_config);
17
-
18
- //#endregion
19
- export { type_compiler_exports };
@@ -1 +0,0 @@
1
- const require_type_check = require('./type-check.cjs');
@@ -1,3 +0,0 @@
1
- import { typeCheck } from "./type-check.mjs";
2
-
3
- export { };
@@ -1,22 +0,0 @@
1
- const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
2
- let typescript = require("typescript");
3
-
4
- //#region ../plugin-tsc/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
- exports.typeCheck = typeCheck;
@@ -1,21 +0,0 @@
1
- import { flattenDiagnosticMessageText } from "typescript";
2
-
3
- //#region ../plugin-tsc/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 };
@@ -1,50 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_type_check = require('./helpers/type-check.cjs');
3
- require('./helpers/index.cjs');
4
- let defu = require("defu");
5
- defu = require_rolldown_runtime.__toESM(defu);
6
- let typescript = require("typescript");
7
- typescript = require_rolldown_runtime.__toESM(typescript);
8
-
9
- //#region ../plugin-tsc/src/index.ts
10
- /**
11
- * TypeScript Compiler plugin for Powerlines.
12
- *
13
- * @param options - The TypeScript Compiler plugin user configuration options.
14
- * @returns A Powerlines plugin that integrates TypeScript Compiler transformations.
15
- */
16
- const plugin = (options = {}) => {
17
- return {
18
- name: "tsc",
19
- config() {
20
- return { transform: { tsc: (0, defu.default)(options ?? {}, { typeCheck: false }) } };
21
- },
22
- async lint() {
23
- if (this.config.transform.tsc.typeCheck) await require_type_check.typeCheck(this);
24
- },
25
- async transform(code, id) {
26
- const result = typescript.default.transpileModule(code, {
27
- ...this.config.transform.tsc,
28
- compilerOptions: {
29
- ...this.tsconfig.options,
30
- ...this.config.transform.tsc.compilerOptions
31
- },
32
- fileName: id
33
- });
34
- if (result.diagnostics && result.diagnostics.length > 0 && result.diagnostics?.some((diagnostic) => diagnostic.category === typescript.default.DiagnosticCategory.Error)) throw new Error(`TypeScript Compiler - TypeScript transpilation errors in file: ${id}\n${typescript.default.formatDiagnostics(result.diagnostics, {
35
- getCanonicalFileName: (fileName) => typescript.default.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(),
36
- getCurrentDirectory: () => typescript.default.sys.getCurrentDirectory(),
37
- getNewLine: () => typescript.default.sys.newLine
38
- })}`);
39
- if (!result.outputText) throw new Error(`TypeScript Compiler - No output generated for file during TypeScript transpilation: ${id}`);
40
- return {
41
- code: result.outputText,
42
- id
43
- };
44
- }
45
- };
46
- };
47
- var src_default = plugin;
48
-
49
- //#endregion
50
- exports.default = src_default;
@@ -1,47 +0,0 @@
1
- import { typeCheck } from "./helpers/type-check.mjs";
2
- import "./helpers/index.mjs";
3
- import defu from "defu";
4
- import ts from "typescript";
5
-
6
- //#region ../plugin-tsc/src/index.ts
7
- /**
8
- * TypeScript Compiler plugin for Powerlines.
9
- *
10
- * @param options - The TypeScript Compiler plugin user configuration options.
11
- * @returns A Powerlines plugin that integrates TypeScript Compiler transformations.
12
- */
13
- const plugin = (options = {}) => {
14
- return {
15
- name: "tsc",
16
- config() {
17
- return { transform: { tsc: defu(options ?? {}, { typeCheck: false }) } };
18
- },
19
- async lint() {
20
- if (this.config.transform.tsc.typeCheck) await typeCheck(this);
21
- },
22
- async transform(code, id) {
23
- const result = ts.transpileModule(code, {
24
- ...this.config.transform.tsc,
25
- compilerOptions: {
26
- ...this.tsconfig.options,
27
- ...this.config.transform.tsc.compilerOptions
28
- },
29
- fileName: id
30
- });
31
- if (result.diagnostics && result.diagnostics.length > 0 && result.diagnostics?.some((diagnostic) => diagnostic.category === ts.DiagnosticCategory.Error)) throw new Error(`TypeScript Compiler - TypeScript transpilation errors in file: ${id}\n${ts.formatDiagnostics(result.diagnostics, {
32
- getCanonicalFileName: (fileName) => ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(),
33
- getCurrentDirectory: () => ts.sys.getCurrentDirectory(),
34
- getNewLine: () => ts.sys.newLine
35
- })}`);
36
- if (!result.outputText) throw new Error(`TypeScript Compiler - No output generated for file during TypeScript transpilation: ${id}`);
37
- return {
38
- code: result.outputText,
39
- id
40
- };
41
- }
42
- };
43
- };
44
- var src_default = plugin;
45
-
46
- //#endregion
47
- export { src_default as default };
@@ -1,33 +0,0 @@
1
- import { UserConfig } from "../../../powerlines/src/types/config.cjs";
2
- import { ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
3
- import { PluginContext } from "../../../powerlines/src/types/context.cjs";
4
- import ts from "typescript";
5
-
6
- //#region ../plugin-tsc/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
- //#endregion
33
- export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig };
@@ -1,33 +0,0 @@
1
- import { UserConfig } from "../../../powerlines/src/types/config.mjs";
2
- import { ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
3
- import { PluginContext } from "../../../powerlines/src/types/context.mjs";
4
- import ts from "typescript";
5
-
6
- //#region ../plugin-tsc/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
- //#endregion
33
- export { TypeScriptCompilerPluginContext, TypeScriptCompilerPluginOptions, TypeScriptCompilerPluginResolvedConfig, TypeScriptCompilerPluginUserConfig };