@powerlines/deepkit 0.7.4 → 0.7.5
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/{capnp-BLx1WTBU.cjs → capnp-BLCHrDSY.cjs} +42 -42
- package/dist/{capnp-BiGNkOmV.mjs → capnp-BqAglxrS.mjs} +265 -265
- package/dist/capnp.cjs +1 -1
- package/dist/capnp.d.cts +42 -44
- package/dist/capnp.d.mts +42 -44
- package/dist/capnp.mjs +1 -1
- package/dist/{chunk-C0xms8kb.cjs → chunk-BmvPcxpV.cjs} +7 -0
- package/dist/chunk-CgI6uo-e.mjs +32 -0
- package/dist/{vendor/type-compiler/compiler-D1z5h1MK.d.cts → compiler-B-zwyGQf.d.cts} +3 -201
- package/dist/{vendor/type-compiler/compiler-Bg8jX6qU.mjs → compiler-BUUdv7wG.mjs} +4 -191
- package/dist/{vendor/type-compiler/compiler-Nkxc4PLJ.d.mts → compiler-BzOZmhWO.d.mts} +3 -201
- package/dist/{vendor/type-compiler/compiler-BUrWMhGi.cjs → compiler-DTp8Jvav.cjs} +207 -394
- package/dist/{vendor/type-compiler/config-B_cKkYZm.d.cts → config-B2hS4_tR.d.mts} +1 -1
- package/dist/config-C0OHvihx.d.mts +1 -0
- package/dist/{vendor/type-compiler/config-y0HNkbCH.mjs → config-CuXC21KA.mjs} +3 -32
- package/dist/{vendor/type-compiler/config-D9DM7Du_.d.mts → config-DCmu3CV2.d.cts} +1 -1
- package/dist/config-GPeRZeGl.d.cts +1 -0
- package/dist/{vendor/type-compiler/config-BEX924PC.cjs → config-GVyELKY1.cjs} +20 -59
- package/dist/esbuild-plugin-BUYqx8_5.cjs +80 -0
- package/dist/esbuild-plugin-CRQUmm86.mjs +75 -0
- package/dist/esbuild-plugin.cjs +2 -47
- package/dist/esbuild-plugin.d.cts +18 -4
- package/dist/esbuild-plugin.d.mts +18 -4
- package/dist/esbuild-plugin.mjs +2 -47
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -3
- package/dist/reflect-type.cjs +4 -4
- package/dist/reflect-type.d.cts +1 -1
- package/dist/reflect-type.d.mts +1 -1
- package/dist/reflect-type.mjs +2 -2
- package/dist/{reflection-C4IlLDrv.d.cts → reflection-Bhe75GyI.d.mts} +2 -2
- package/dist/{reflection-BB3pXP5l.d.mts → reflection-DGOuMF8F.d.cts} +2 -2
- package/dist/resolve-reflections.cjs +1 -1
- package/dist/rolldown-plugin.cjs +1 -1
- package/dist/{vendor/string-BuMgdahD.mjs → string-CjkshhTG.mjs} +2 -28
- package/dist/{vendor/string-BoXo0wS7.cjs → string-CpVz34Gv.cjs} +6 -39
- package/dist/transformer.cjs +6 -7
- package/dist/transformer.d.cts +1 -1
- package/dist/transformer.d.mts +1 -1
- package/dist/transformer.mjs +2 -3
- package/dist/transpile.cjs +6 -2
- package/dist/transpile.d.cts +1 -1
- package/dist/transpile.d.mts +1 -1
- package/dist/transpile.mjs +5 -1
- package/dist/type-8AL5U7vn.d.cts +2969 -0
- package/dist/type-BDuj5wg2.d.mts +2969 -0
- package/dist/{vendor/type-Dgeqs-rL.mjs → type-BWm74eaQ.mjs} +1 -1
- package/dist/type-C7UXbXfx.cjs +10688 -0
- package/dist/{vendor/type-2yMJb9Mw.d.cts → type-DR66Hepn.d.cts} +1 -1
- package/dist/{vendor/type-DEpHWwMt.d.mts → type-DfwJ6GTs.d.mts} +1 -1
- package/dist/type-ma8o4dJG.mjs +9110 -0
- package/dist/{vendor/types-Ur6a2Srw.d.mts → types-BO3PJV5p.d.mts} +1 -1
- package/dist/{vendor/types-exLGvFgG.d.cts → types-Bb6lL3KL.d.cts} +1 -1
- package/dist/types.d.cts +4 -7
- package/dist/types.d.mts +4 -7
- package/dist/utilities-CT_jcB5h.mjs +1483 -0
- package/dist/utilities-Dr3TzxMb.cjs +1523 -0
- package/dist/utilities.cjs +8 -116
- package/dist/utilities.d.cts +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utilities.mjs +2 -110
- package/dist/vendor/core.cjs +1 -1
- package/dist/vendor/core.d.cts +1 -1
- package/dist/vendor/core.d.mts +1 -1
- package/dist/vendor/core.mjs +1 -1
- package/dist/vendor/type-compiler/compiler.cjs +1 -1
- package/dist/vendor/type-compiler/compiler.d.cts +1 -1
- package/dist/vendor/type-compiler/compiler.d.mts +1 -1
- package/dist/vendor/type-compiler/compiler.mjs +1 -1
- package/dist/vendor/type-compiler/config.cjs +1 -1
- package/dist/vendor/type-compiler/config.d.cts +1 -1
- package/dist/vendor/type-compiler/config.d.mts +1 -1
- package/dist/vendor/type-compiler/config.mjs +1 -1
- package/dist/vendor/type-compiler/index.cjs +11 -3
- package/dist/vendor/type-compiler/index.d.cts +3 -2
- package/dist/vendor/type-compiler/index.d.mts +3 -2
- package/dist/vendor/type-compiler/index.mjs +3 -2
- package/dist/vendor/type-spec.cjs +1 -1
- package/dist/vendor/type-spec.d.cts +1 -1
- package/dist/vendor/type-spec.d.mts +1 -1
- package/dist/vendor/type-spec.mjs +1 -1
- package/dist/vendor/type.cjs +268 -9374
- package/dist/vendor/type.d.cts +3 -2969
- package/dist/vendor/type.d.mts +3 -2969
- package/dist/vendor/type.mjs +3 -9109
- package/package.json +9 -14
- package/schemas/reflection.d.cts +1 -6
- package/schemas/reflection.d.mts +1 -6
- /package/dist/{vendor/type-BMLjRtLY.cjs → type-DhqntM0q.cjs} +0 -0
|
@@ -113,4 +113,4 @@ declare function getConfigResolver(cache: ReflectionConfigCache, host: ParseConf
|
|
|
113
113
|
}, tsConfigPath?: string): ConfigResolver;
|
|
114
114
|
//#endregion
|
|
115
115
|
export { reflectionModeMatcher as _, Matcher as a, ReflectionConfig as c, TsConfigJson as d, defaultExcluded as f, reflectionLevel as g, parseRawMode as h, MatchResult as i, ReflectionConfigCache as l, isObject as m, CurrentConfig as n, Mode as o, getConfigResolver as p, Level as r, RawMode as s, ConfigResolver as t, ResolvedConfig as u, reflectionModes as v };
|
|
116
|
-
//# sourceMappingURL=config-
|
|
116
|
+
//# sourceMappingURL=config-B2hS4_tR.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,37 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-CgI6uo-e.mjs";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
import { dirname, isAbsolute, join } from "node:path";
|
|
4
4
|
import { readFileSync } from "node:fs";
|
|
5
5
|
|
|
6
|
-
//#region \0rolldown/runtime.js
|
|
7
|
-
var __create = Object.create;
|
|
8
|
-
var __defProp = Object.defineProperty;
|
|
9
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
12
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
|
-
key = keys[i];
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
19
|
-
__defProp(to, key, {
|
|
20
|
-
get: ((k) => from[k]).bind(null, key),
|
|
21
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
-
value: mod,
|
|
30
|
-
enumerable: true
|
|
31
|
-
}) : target, mod));
|
|
32
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
6
|
//#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/esm/src/debug.js
|
|
36
7
|
function isDebug(level = 1) {
|
|
37
8
|
const expected = "deepkit" + (level > 1 ? "+".repeat(level - 1) : "");
|
|
@@ -3636,5 +3607,5 @@ function getConfigResolver(cache, host, compilerOptions, sourceFile, tsConfigPat
|
|
|
3636
3607
|
}
|
|
3637
3608
|
|
|
3638
3609
|
//#endregion
|
|
3639
|
-
export { reflectionLevel as a, Resolver as c,
|
|
3640
|
-
//# sourceMappingURL=config-
|
|
3610
|
+
export { reflectionLevel as a, Resolver as c, parseRawMode as i, debug as l, getConfigResolver as n, reflectionModeMatcher as o, isObject as r, reflectionModes as s, defaultExcluded as t, debug2 as u };
|
|
3611
|
+
//# sourceMappingURL=config-CuXC21KA.mjs.map
|
|
@@ -113,4 +113,4 @@ declare function getConfigResolver(cache: ReflectionConfigCache, host: ParseConf
|
|
|
113
113
|
}, tsConfigPath?: string): ConfigResolver;
|
|
114
114
|
//#endregion
|
|
115
115
|
export { reflectionModeMatcher as _, Matcher as a, ReflectionConfig as c, TsConfigJson as d, defaultExcluded as f, reflectionLevel as g, parseRawMode as h, MatchResult as i, ReflectionConfigCache as l, isObject as m, CurrentConfig as n, Mode as o, getConfigResolver as p, Level as r, RawMode as s, ConfigResolver as t, ResolvedConfig as u, reflectionModes as v };
|
|
116
|
-
//# sourceMappingURL=config-
|
|
116
|
+
//# sourceMappingURL=config-DCmu3CV2.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,33 +1,6 @@
|
|
|
1
|
-
|
|
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 __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
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
|
|
1
|
+
const require_chunk = require('./chunk-BmvPcxpV.cjs');
|
|
29
2
|
let typescript = require("typescript");
|
|
30
|
-
typescript = __toESM(typescript);
|
|
3
|
+
typescript = require_chunk.__toESM(typescript);
|
|
31
4
|
let node_path = require("node:path");
|
|
32
5
|
let node_fs = require("node:fs");
|
|
33
6
|
|
|
@@ -51,7 +24,7 @@ function debug2(...message) {
|
|
|
51
24
|
|
|
52
25
|
//#endregion
|
|
53
26
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
|
|
54
|
-
var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
27
|
+
var require_utils$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
|
|
55
28
|
exports.isInteger = (num) => {
|
|
56
29
|
if (typeof num === "number") return Number.isInteger(num);
|
|
57
30
|
if (typeof num === "string" && num.trim() !== "") return Number.isInteger(Number(num));
|
|
@@ -147,7 +120,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
147
120
|
|
|
148
121
|
//#endregion
|
|
149
122
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
|
|
150
|
-
var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
123
|
+
var require_stringify = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
151
124
|
const utils = require_utils$1();
|
|
152
125
|
module.exports = (ast, options = {}) => {
|
|
153
126
|
const stringify = (node, parent = {}) => {
|
|
@@ -174,7 +147,7 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
174
147
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
175
148
|
* Released under the MIT License.
|
|
176
149
|
*/
|
|
177
|
-
var require_is_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
150
|
+
var require_is_number = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
178
151
|
module.exports = function(num) {
|
|
179
152
|
if (typeof num === "number") return num - num === 0;
|
|
180
153
|
if (typeof num === "string" && num.trim() !== "") return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
|
@@ -190,7 +163,7 @@ var require_is_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
190
163
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
191
164
|
* Released under the MIT License.
|
|
192
165
|
*/
|
|
193
|
-
var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
166
|
+
var require_to_regex_range = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
194
167
|
const isNumber = require_is_number();
|
|
195
168
|
const toRegexRange = (min, max, options) => {
|
|
196
169
|
if (isNumber(min) === false) throw new TypeError("toRegexRange: expected the first argument to be a number");
|
|
@@ -390,7 +363,7 @@ var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
390
363
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
391
364
|
* Licensed under the MIT License.
|
|
392
365
|
*/
|
|
393
|
-
var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
366
|
+
var require_fill_range = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
394
367
|
const util$1 = require("node:util");
|
|
395
368
|
const toRegexRange = require_to_regex_range();
|
|
396
369
|
const isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
@@ -553,7 +526,7 @@ var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
553
526
|
|
|
554
527
|
//#endregion
|
|
555
528
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
|
|
556
|
-
var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
529
|
+
var require_compile = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
557
530
|
const fill = require_fill_range();
|
|
558
531
|
const utils = require_utils$1();
|
|
559
532
|
const compile = (ast, options = {}) => {
|
|
@@ -592,7 +565,7 @@ var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
592
565
|
|
|
593
566
|
//#endregion
|
|
594
567
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
|
|
595
|
-
var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
568
|
+
var require_expand = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
596
569
|
const fill = require_fill_range();
|
|
597
570
|
const stringify = require_stringify();
|
|
598
571
|
const utils = require_utils$1();
|
|
@@ -669,7 +642,7 @@ var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
669
642
|
|
|
670
643
|
//#endregion
|
|
671
644
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
|
|
672
|
-
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
645
|
+
var require_constants$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
673
646
|
module.exports = {
|
|
674
647
|
MAX_LENGTH: 1e4,
|
|
675
648
|
CHAR_0: "0",
|
|
@@ -721,7 +694,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
721
694
|
|
|
722
695
|
//#endregion
|
|
723
696
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
|
|
724
|
-
var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
697
|
+
var require_parse$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
725
698
|
const stringify = require_stringify();
|
|
726
699
|
/**
|
|
727
700
|
* Constants
|
|
@@ -1009,7 +982,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1009
982
|
|
|
1010
983
|
//#endregion
|
|
1011
984
|
//#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
|
|
1012
|
-
var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
985
|
+
var require_braces = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
1013
986
|
const stringify = require_stringify();
|
|
1014
987
|
const compile = require_compile();
|
|
1015
988
|
const expand = require_expand();
|
|
@@ -1137,7 +1110,7 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1137
1110
|
|
|
1138
1111
|
//#endregion
|
|
1139
1112
|
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
|
|
1140
|
-
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1113
|
+
var require_constants = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
1141
1114
|
const path$2 = require("node:path");
|
|
1142
1115
|
const WIN_SLASH = "\\\\/";
|
|
1143
1116
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
@@ -1305,7 +1278,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1305
1278
|
|
|
1306
1279
|
//#endregion
|
|
1307
1280
|
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
|
|
1308
|
-
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1281
|
+
var require_utils = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
|
|
1309
1282
|
const path$1 = require("node:path");
|
|
1310
1283
|
const win32 = process.platform === "win32";
|
|
1311
1284
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
@@ -1351,7 +1324,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1351
1324
|
|
|
1352
1325
|
//#endregion
|
|
1353
1326
|
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
|
|
1354
|
-
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1327
|
+
var require_scan = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
1355
1328
|
const utils = require_utils();
|
|
1356
1329
|
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
|
|
1357
1330
|
const isPathSeparator = (code) => {
|
|
@@ -1639,7 +1612,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1639
1612
|
|
|
1640
1613
|
//#endregion
|
|
1641
1614
|
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
|
|
1642
|
-
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1615
|
+
var require_parse = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
1643
1616
|
const constants = require_constants();
|
|
1644
1617
|
const utils = require_utils();
|
|
1645
1618
|
/**
|
|
@@ -2698,7 +2671,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2698
2671
|
|
|
2699
2672
|
//#endregion
|
|
2700
2673
|
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
|
|
2701
|
-
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2674
|
+
var require_picomatch$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
2702
2675
|
const path = require("node:path");
|
|
2703
2676
|
const scan = require_scan();
|
|
2704
2677
|
const parse = require_parse();
|
|
@@ -2992,13 +2965,13 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2992
2965
|
|
|
2993
2966
|
//#endregion
|
|
2994
2967
|
//#region ../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/index.js
|
|
2995
|
-
var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2968
|
+
var require_picomatch = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
2996
2969
|
module.exports = require_picomatch$1();
|
|
2997
2970
|
}));
|
|
2998
2971
|
|
|
2999
2972
|
//#endregion
|
|
3000
2973
|
//#region ../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js
|
|
3001
|
-
var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2974
|
+
var require_micromatch = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
3002
2975
|
const util = require("node:util");
|
|
3003
2976
|
const braces = require_braces();
|
|
3004
2977
|
const picomatch = require_picomatch();
|
|
@@ -3393,7 +3366,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3393
3366
|
|
|
3394
3367
|
//#endregion
|
|
3395
3368
|
//#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/esm/src/resolver.js
|
|
3396
|
-
var import_micromatch = /* @__PURE__ */ __toESM(require_micromatch(), 1);
|
|
3369
|
+
var import_micromatch = /* @__PURE__ */ require_chunk.__toESM(require_micromatch(), 1);
|
|
3397
3370
|
const { createSourceFile, resolveModuleName, isStringLiteral, JSDocParsingMode, ScriptTarget } = typescript.default;
|
|
3398
3371
|
function patternMatch(path, patterns, base) {
|
|
3399
3372
|
const include = patterns.filter((pattern) => pattern[0] !== "!");
|
|
@@ -3641,18 +3614,6 @@ Object.defineProperty(exports, 'Resolver', {
|
|
|
3641
3614
|
return Resolver;
|
|
3642
3615
|
}
|
|
3643
3616
|
});
|
|
3644
|
-
Object.defineProperty(exports, '__commonJSMin', {
|
|
3645
|
-
enumerable: true,
|
|
3646
|
-
get: function () {
|
|
3647
|
-
return __commonJSMin;
|
|
3648
|
-
}
|
|
3649
|
-
});
|
|
3650
|
-
Object.defineProperty(exports, '__toESM', {
|
|
3651
|
-
enumerable: true,
|
|
3652
|
-
get: function () {
|
|
3653
|
-
return __toESM;
|
|
3654
|
-
}
|
|
3655
|
-
});
|
|
3656
3617
|
Object.defineProperty(exports, 'debug', {
|
|
3657
3618
|
enumerable: true,
|
|
3658
3619
|
get: function () {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-BmvPcxpV.cjs');
|
|
2
|
+
const require_transpile = require('./transpile.cjs');
|
|
3
|
+
let _stryke_type_checks = require("@stryke/type-checks");
|
|
4
|
+
let typescript = require("typescript");
|
|
5
|
+
|
|
6
|
+
//#region ../../node_modules/.pnpm/@stryke+helpers@0.10.8/node_modules/@stryke/helpers/dist/omit.mjs
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new object with specified keys omitted.
|
|
9
|
+
*
|
|
10
|
+
* This function takes an object and an array of keys, and returns a new object that
|
|
11
|
+
* excludes the properties corresponding to the specified keys.
|
|
12
|
+
*
|
|
13
|
+
* @param obj - The object to omit keys from.
|
|
14
|
+
* @param keys - An array of keys to be omitted from the object.
|
|
15
|
+
* @returns A new object with the specified keys omitted.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const obj = { a: 1, b: 2, c: 3 };
|
|
20
|
+
* const result = omit(obj, ['b', 'c']);
|
|
21
|
+
* // result will be { a: 1 }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
function omit(obj, keys) {
|
|
25
|
+
const result = { ...obj };
|
|
26
|
+
for (let i = 0; i < keys.length; i++) {
|
|
27
|
+
const key = keys[i];
|
|
28
|
+
if (key) delete result[key];
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/esbuild-plugin.ts
|
|
35
|
+
/**
|
|
36
|
+
* Esbuild plugin for Deepkit Type reflections.
|
|
37
|
+
*
|
|
38
|
+
* @param context - The Powerlines context.
|
|
39
|
+
* @param options - Optional esbuild onLoad options and reflection configuration.
|
|
40
|
+
* @returns An esbuild plugin instance.
|
|
41
|
+
*/
|
|
42
|
+
const esbuildPlugin = (context, options = {}) => {
|
|
43
|
+
return {
|
|
44
|
+
name: "powerlines:deepkit",
|
|
45
|
+
setup(build) {
|
|
46
|
+
build.onLoad({
|
|
47
|
+
filter: /\.(m|c)?tsx?$/,
|
|
48
|
+
...options.onLoad ?? {}
|
|
49
|
+
}, async (args) => {
|
|
50
|
+
const contents = await context.fs.read(args.path);
|
|
51
|
+
if (!contents) return null;
|
|
52
|
+
if (args.pluginData?.isReflected) return {
|
|
53
|
+
contents,
|
|
54
|
+
loader: "ts",
|
|
55
|
+
pluginData: { isReflected: true }
|
|
56
|
+
};
|
|
57
|
+
const result = require_transpile.transpile(context, contents, args.path, omit(options, ["onLoad"]));
|
|
58
|
+
if (result.diagnostics && result.diagnostics.length > 0) if (result.diagnostics.some((d) => d.category === typescript.DiagnosticCategory.Error)) {
|
|
59
|
+
const errorMessage = `Deepkit Type reflection transpilation errors: ${args.path} \n ${result.diagnostics.filter((d) => d.category === typescript.DiagnosticCategory.Error).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${(0, _stryke_type_checks.isString)(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`;
|
|
60
|
+
context.error(errorMessage);
|
|
61
|
+
throw new Error(errorMessage);
|
|
62
|
+
} else if (result.diagnostics.some((d) => d.category === typescript.DiagnosticCategory.Warning)) context.warn(`Deepkit Type reflection transpilation warnings: ${args.path} \n ${result.diagnostics.filter((d) => d.category === typescript.DiagnosticCategory.Warning).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${(0, _stryke_type_checks.isString)(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
63
|
+
else context.debug(`Deepkit Type reflection transpilation diagnostics: ${args.path} \n ${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${(0, _stryke_type_checks.isString)(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
64
|
+
return {
|
|
65
|
+
contents: result.outputText,
|
|
66
|
+
loader: "ts",
|
|
67
|
+
pluginData: { isReflected: true }
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
Object.defineProperty(exports, 'esbuildPlugin', {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return esbuildPlugin;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { transpile } from "./transpile.mjs";
|
|
2
|
+
import { isString } from "@stryke/type-checks";
|
|
3
|
+
import { DiagnosticCategory } from "typescript";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/@stryke+helpers@0.10.8/node_modules/@stryke/helpers/dist/omit.mjs
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new object with specified keys omitted.
|
|
8
|
+
*
|
|
9
|
+
* This function takes an object and an array of keys, and returns a new object that
|
|
10
|
+
* excludes the properties corresponding to the specified keys.
|
|
11
|
+
*
|
|
12
|
+
* @param obj - The object to omit keys from.
|
|
13
|
+
* @param keys - An array of keys to be omitted from the object.
|
|
14
|
+
* @returns A new object with the specified keys omitted.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const obj = { a: 1, b: 2, c: 3 };
|
|
19
|
+
* const result = omit(obj, ['b', 'c']);
|
|
20
|
+
* // result will be { a: 1 }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
function omit(obj, keys) {
|
|
24
|
+
const result = { ...obj };
|
|
25
|
+
for (let i = 0; i < keys.length; i++) {
|
|
26
|
+
const key = keys[i];
|
|
27
|
+
if (key) delete result[key];
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/esbuild-plugin.ts
|
|
34
|
+
/**
|
|
35
|
+
* Esbuild plugin for Deepkit Type reflections.
|
|
36
|
+
*
|
|
37
|
+
* @param context - The Powerlines context.
|
|
38
|
+
* @param options - Optional esbuild onLoad options and reflection configuration.
|
|
39
|
+
* @returns An esbuild plugin instance.
|
|
40
|
+
*/
|
|
41
|
+
const esbuildPlugin = (context, options = {}) => {
|
|
42
|
+
return {
|
|
43
|
+
name: "powerlines:deepkit",
|
|
44
|
+
setup(build) {
|
|
45
|
+
build.onLoad({
|
|
46
|
+
filter: /\.(m|c)?tsx?$/,
|
|
47
|
+
...options.onLoad ?? {}
|
|
48
|
+
}, async (args) => {
|
|
49
|
+
const contents = await context.fs.read(args.path);
|
|
50
|
+
if (!contents) return null;
|
|
51
|
+
if (args.pluginData?.isReflected) return {
|
|
52
|
+
contents,
|
|
53
|
+
loader: "ts",
|
|
54
|
+
pluginData: { isReflected: true }
|
|
55
|
+
};
|
|
56
|
+
const result = transpile(context, contents, args.path, omit(options, ["onLoad"]));
|
|
57
|
+
if (result.diagnostics && result.diagnostics.length > 0) if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Error)) {
|
|
58
|
+
const errorMessage = `Deepkit Type reflection transpilation errors: ${args.path} \n ${result.diagnostics.filter((d) => d.category === DiagnosticCategory.Error).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`;
|
|
59
|
+
context.error(errorMessage);
|
|
60
|
+
throw new Error(errorMessage);
|
|
61
|
+
} else if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Warning)) context.warn(`Deepkit Type reflection transpilation warnings: ${args.path} \n ${result.diagnostics.filter((d) => d.category === DiagnosticCategory.Warning).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
62
|
+
else context.debug(`Deepkit Type reflection transpilation diagnostics: ${args.path} \n ${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
63
|
+
return {
|
|
64
|
+
contents: result.outputText,
|
|
65
|
+
loader: "ts",
|
|
66
|
+
pluginData: { isReflected: true }
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { esbuildPlugin as t };
|
|
75
|
+
//# sourceMappingURL=esbuild-plugin-CRQUmm86.mjs.map
|
package/dist/esbuild-plugin.cjs
CHANGED
|
@@ -1,49 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const require_transpile = require('./transpile.cjs');
|
|
4
|
-
let _stryke_type_checks = require("@stryke/type-checks");
|
|
5
|
-
let _stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
6
|
-
let typescript = require("typescript");
|
|
2
|
+
const require_esbuild_plugin = require('./esbuild-plugin-BUYqx8_5.cjs');
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Esbuild plugin for Deepkit Type reflections.
|
|
11
|
-
*
|
|
12
|
-
* @param context - The Powerlines context.
|
|
13
|
-
* @param options - Optional esbuild onLoad options and reflection configuration.
|
|
14
|
-
* @returns An esbuild plugin instance.
|
|
15
|
-
*/
|
|
16
|
-
const esbuildPlugin = (context, options = {}) => {
|
|
17
|
-
return {
|
|
18
|
-
name: "powerlines:deepkit",
|
|
19
|
-
setup(build) {
|
|
20
|
-
build.onLoad({
|
|
21
|
-
filter: /\.(m|c)?tsx?$/,
|
|
22
|
-
...options.onLoad ?? {}
|
|
23
|
-
}, async (args) => {
|
|
24
|
-
const contents = await context.fs.read(args.path);
|
|
25
|
-
if (!contents) return null;
|
|
26
|
-
if (args.pluginData?.isReflected) return {
|
|
27
|
-
contents,
|
|
28
|
-
loader: "ts",
|
|
29
|
-
pluginData: { isReflected: true }
|
|
30
|
-
};
|
|
31
|
-
const result = require_transpile.transpile(context, contents, args.path, (0, _stryke_helpers_omit.omit)(options, ["onLoad"]));
|
|
32
|
-
if (result.diagnostics && result.diagnostics.length > 0) if (result.diagnostics.some((d) => d.category === typescript.DiagnosticCategory.Error)) {
|
|
33
|
-
const errorMessage = `Deepkit Type reflection transpilation errors: ${args.path} \n ${result.diagnostics.filter((d) => d.category === typescript.DiagnosticCategory.Error).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${(0, _stryke_type_checks.isString)(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`;
|
|
34
|
-
context.error(errorMessage);
|
|
35
|
-
throw new Error(errorMessage);
|
|
36
|
-
} else if (result.diagnostics.some((d) => d.category === typescript.DiagnosticCategory.Warning)) context.warn(`Deepkit Type reflection transpilation warnings: ${args.path} \n ${result.diagnostics.filter((d) => d.category === typescript.DiagnosticCategory.Warning).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${(0, _stryke_type_checks.isString)(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
37
|
-
else context.debug(`Deepkit Type reflection transpilation diagnostics: ${args.path} \n ${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${(0, _stryke_type_checks.isString)(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
38
|
-
return {
|
|
39
|
-
contents: result.outputText,
|
|
40
|
-
loader: "ts",
|
|
41
|
-
pluginData: { isReflected: true }
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
exports.esbuildPlugin = esbuildPlugin;
|
|
4
|
+
exports.esbuildPlugin = require_esbuild_plugin.esbuildPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { o as Mode, r as Level } from "./config-DCmu3CV2.cjs";
|
|
1
2
|
import { PluginContext } from "@powerlines/core";
|
|
2
|
-
import { Level, Mode } from "@powerlines/deepkit/vendor/type-compiler/config";
|
|
3
3
|
import { OnLoadOptions, Plugin } from "esbuild";
|
|
4
4
|
|
|
5
5
|
//#region src/esbuild-plugin.d.ts
|
|
@@ -10,10 +10,26 @@ interface ReflectionConfig {
|
|
|
10
10
|
exclude?: string[];
|
|
11
11
|
/**
|
|
12
12
|
* Either a boolean indication general reflection mode, or a list of globs to match against.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* - `default`: The default reflection mode, which includes a standard set of type information in the output.
|
|
16
|
+
* - `true`: An alias for "default", enabling the default reflection mode.
|
|
17
|
+
* - `false`: Disables reflection, resulting in no type information being included in the output.
|
|
18
|
+
* - `string[]`: A list of glob patterns to match against files for which reflection should be applied. Only files matching these patterns will have type information included in the output.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue "default"
|
|
13
21
|
*/
|
|
14
22
|
reflection?: string[] | Mode;
|
|
15
23
|
/**
|
|
16
24
|
* Defines the level of reflection to be used during the transpilation process.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* - `minimal`: Only essential type information is included in the reflection output, resulting in a smaller output size but less detailed type metadata.
|
|
28
|
+
* - `normal`: A balanced level of type information is included, providing a good trade-off between output size and type metadata detail.
|
|
29
|
+
* - `extended`: More comprehensive type information is included, which may increase the output size but provides richer type metadata for advanced use cases.
|
|
30
|
+
* - `verbose`: Detailed type information is included, resulting in a larger output size but more comprehensive type metadata.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue "normal"
|
|
17
33
|
*/
|
|
18
34
|
reflectionLevel?: Level;
|
|
19
35
|
}
|
|
@@ -28,8 +44,6 @@ interface ESBuildPluginOptions extends Partial<ReflectionConfig> {
|
|
|
28
44
|
* @returns An esbuild plugin instance.
|
|
29
45
|
*/
|
|
30
46
|
declare const esbuildPlugin: <TContext extends PluginContext>(context: TContext, options?: ESBuildPluginOptions) => Plugin;
|
|
31
|
-
declare type __ΩReflectionConfig = any[];
|
|
32
|
-
declare type __ΩESBuildPluginOptions = any[];
|
|
33
47
|
//#endregion
|
|
34
|
-
export { ESBuildPluginOptions, ReflectionConfig,
|
|
48
|
+
export { ESBuildPluginOptions, ReflectionConfig, esbuildPlugin };
|
|
35
49
|
//# sourceMappingURL=esbuild-plugin.d.cts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { o as Mode, r as Level } from "./config-B2hS4_tR.mjs";
|
|
1
2
|
import { PluginContext } from "@powerlines/core";
|
|
2
|
-
import { Level, Mode } from "@powerlines/deepkit/vendor/type-compiler/config";
|
|
3
3
|
import { OnLoadOptions, Plugin } from "esbuild";
|
|
4
4
|
|
|
5
5
|
//#region src/esbuild-plugin.d.ts
|
|
@@ -10,10 +10,26 @@ interface ReflectionConfig {
|
|
|
10
10
|
exclude?: string[];
|
|
11
11
|
/**
|
|
12
12
|
* Either a boolean indication general reflection mode, or a list of globs to match against.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* - `default`: The default reflection mode, which includes a standard set of type information in the output.
|
|
16
|
+
* - `true`: An alias for "default", enabling the default reflection mode.
|
|
17
|
+
* - `false`: Disables reflection, resulting in no type information being included in the output.
|
|
18
|
+
* - `string[]`: A list of glob patterns to match against files for which reflection should be applied. Only files matching these patterns will have type information included in the output.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue "default"
|
|
13
21
|
*/
|
|
14
22
|
reflection?: string[] | Mode;
|
|
15
23
|
/**
|
|
16
24
|
* Defines the level of reflection to be used during the transpilation process.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* - `minimal`: Only essential type information is included in the reflection output, resulting in a smaller output size but less detailed type metadata.
|
|
28
|
+
* - `normal`: A balanced level of type information is included, providing a good trade-off between output size and type metadata detail.
|
|
29
|
+
* - `extended`: More comprehensive type information is included, which may increase the output size but provides richer type metadata for advanced use cases.
|
|
30
|
+
* - `verbose`: Detailed type information is included, resulting in a larger output size but more comprehensive type metadata.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue "normal"
|
|
17
33
|
*/
|
|
18
34
|
reflectionLevel?: Level;
|
|
19
35
|
}
|
|
@@ -28,8 +44,6 @@ interface ESBuildPluginOptions extends Partial<ReflectionConfig> {
|
|
|
28
44
|
* @returns An esbuild plugin instance.
|
|
29
45
|
*/
|
|
30
46
|
declare const esbuildPlugin: <TContext extends PluginContext>(context: TContext, options?: ESBuildPluginOptions) => Plugin;
|
|
31
|
-
declare type __ΩReflectionConfig = any[];
|
|
32
|
-
declare type __ΩESBuildPluginOptions = any[];
|
|
33
47
|
//#endregion
|
|
34
|
-
export { ESBuildPluginOptions, ReflectionConfig,
|
|
48
|
+
export { ESBuildPluginOptions, ReflectionConfig, esbuildPlugin };
|
|
35
49
|
//# sourceMappingURL=esbuild-plugin.d.mts.map
|
package/dist/esbuild-plugin.mjs
CHANGED
|
@@ -1,48 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isString } from "@stryke/type-checks";
|
|
3
|
-
import { omit } from "@stryke/helpers/omit";
|
|
4
|
-
import { DiagnosticCategory } from "typescript";
|
|
1
|
+
import { t as esbuildPlugin } from "./esbuild-plugin-CRQUmm86.mjs";
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Esbuild plugin for Deepkit Type reflections.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The Powerlines context.
|
|
11
|
-
* @param options - Optional esbuild onLoad options and reflection configuration.
|
|
12
|
-
* @returns An esbuild plugin instance.
|
|
13
|
-
*/
|
|
14
|
-
const esbuildPlugin = (context, options = {}) => {
|
|
15
|
-
return {
|
|
16
|
-
name: "powerlines:deepkit",
|
|
17
|
-
setup(build) {
|
|
18
|
-
build.onLoad({
|
|
19
|
-
filter: /\.(m|c)?tsx?$/,
|
|
20
|
-
...options.onLoad ?? {}
|
|
21
|
-
}, async (args) => {
|
|
22
|
-
const contents = await context.fs.read(args.path);
|
|
23
|
-
if (!contents) return null;
|
|
24
|
-
if (args.pluginData?.isReflected) return {
|
|
25
|
-
contents,
|
|
26
|
-
loader: "ts",
|
|
27
|
-
pluginData: { isReflected: true }
|
|
28
|
-
};
|
|
29
|
-
const result = transpile(context, contents, args.path, omit(options, ["onLoad"]));
|
|
30
|
-
if (result.diagnostics && result.diagnostics.length > 0) if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Error)) {
|
|
31
|
-
const errorMessage = `Deepkit Type reflection transpilation errors: ${args.path} \n ${result.diagnostics.filter((d) => d.category === DiagnosticCategory.Error).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`;
|
|
32
|
-
context.error(errorMessage);
|
|
33
|
-
throw new Error(errorMessage);
|
|
34
|
-
} else if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Warning)) context.warn(`Deepkit Type reflection transpilation warnings: ${args.path} \n ${result.diagnostics.filter((d) => d.category === DiagnosticCategory.Warning).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
35
|
-
else context.debug(`Deepkit Type reflection transpilation diagnostics: ${args.path} \n ${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
36
|
-
return {
|
|
37
|
-
contents: result.outputText,
|
|
38
|
-
loader: "ts",
|
|
39
|
-
pluginData: { isReflected: true }
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
|
-
export { esbuildPlugin };
|
|
48
|
-
//# sourceMappingURL=esbuild-plugin.mjs.map
|
|
3
|
+
export { esbuildPlugin };
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_capnp = require('./capnp-
|
|
2
|
+
const require_capnp = require('./capnp-BLCHrDSY.cjs');
|
|
3
|
+
const require_esbuild_plugin = require('./esbuild-plugin-BUYqx8_5.cjs');
|
|
3
4
|
const require_transformer = require('./transformer.cjs');
|
|
4
5
|
const require_transpile = require('./transpile.cjs');
|
|
5
|
-
const require_esbuild_plugin = require('./esbuild-plugin.cjs');
|
|
6
6
|
const require_reflect_type = require('./reflect-type.cjs');
|
|
7
7
|
const require_resolve_reflections = require('./resolve-reflections.cjs');
|
|
8
8
|
const require_rolldown_plugin = require('./rolldown-plugin.cjs');
|
|
9
9
|
require('./types.cjs');
|
|
10
|
-
const require_utilities = require('./utilities.cjs');
|
|
10
|
+
const require_utilities = require('./utilities-Dr3TzxMb.cjs');
|
|
11
11
|
|
|
12
12
|
exports.convertFromCapnp = require_capnp.convertFromCapnp;
|
|
13
13
|
exports.convertFromCapnpArray = require_capnp.convertFromCapnpArray;
|