@powerlines/deepkit 0.7.5 → 0.7.7
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/_virtual/_rolldown/runtime.cjs +31 -0
- package/dist/_virtual/_rolldown/runtime.mjs +8 -0
- package/dist/capnp.cjs +955 -46
- package/dist/capnp.d.cts +41 -41
- package/dist/capnp.d.mts +41 -41
- package/dist/capnp.mjs +911 -2
- package/dist/esbuild-plugin.cjs +47 -2
- package/dist/esbuild-plugin.d.cts +1 -1
- package/dist/esbuild-plugin.d.mts +1 -1
- package/dist/esbuild-plugin.mjs +47 -2
- package/dist/index.cjs +3 -4
- package/dist/index.mjs +3 -4
- package/dist/{capnp-BLCHrDSY.cjs → packages/deepkit/schemas/reflection.cjs} +3 -1180
- package/dist/{reflection-Bhe75GyI.d.mts → packages/deepkit/schemas/reflection.d.cts} +2 -2
- package/dist/{reflection-DGOuMF8F.d.cts → packages/deepkit/schemas/reflection.d.mts} +2 -2
- package/dist/{capnp-BqAglxrS.mjs → packages/deepkit/schemas/reflection.mjs} +2 -910
- package/dist/reflect-type.cjs +5 -5
- 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/resolve-reflections.cjs +1 -1
- package/dist/rolldown-plugin.cjs +1 -1
- package/dist/transformer.cjs +6 -5
- package/dist/transformer.d.cts +1 -1
- package/dist/transformer.d.mts +1 -1
- package/dist/transformer.mjs +2 -1
- package/dist/transpile.cjs +2 -2
- package/dist/transpile.d.cts +1 -1
- package/dist/transpile.d.mts +1 -1
- package/dist/types.d.cts +3 -3
- package/dist/types.d.mts +3 -3
- package/dist/utilities.cjs +116 -8
- package/dist/utilities.d.cts +1 -1
- package/dist/utilities.d.mts +1 -1
- package/dist/utilities.mjs +110 -2
- package/dist/{compiler-B-zwyGQf.d.cts → vendor/compiler-BYhFaVxE.d.mts} +3 -3
- package/dist/{compiler-DTp8Jvav.cjs → vendor/compiler-Ci5aO9pY.cjs} +2 -2
- package/dist/{compiler-BUUdv7wG.mjs → vendor/compiler-CqkzeoNX.mjs} +3 -3
- package/dist/{compiler-BzOZmhWO.d.mts → vendor/compiler-Dz2b4nOM.d.cts} +3 -3
- package/dist/{config-B2hS4_tR.d.mts → vendor/config-BTErH18l.d.mts} +1 -1
- package/dist/{config-DCmu3CV2.d.cts → vendor/config-Cc2qE8fH.d.cts} +1 -1
- package/dist/{config-CuXC21KA.mjs → vendor/config-eSNKiBGB.mjs} +1 -1
- 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/{string-CjkshhTG.mjs → vendor/string-DoT35ViA.mjs} +1 -1
- package/dist/{type-DfwJ6GTs.d.mts → vendor/type-2yMJb9Mw.d.cts} +1 -1
- package/dist/{type-DR66Hepn.d.cts → vendor/type-BoBEcrg7.d.mts} +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 +3 -3
- package/dist/vendor/type-compiler/index.d.cts +2 -2
- package/dist/vendor/type-compiler/index.d.mts +2 -2
- package/dist/vendor/type-compiler/index.mjs +2 -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/{type-BWm74eaQ.mjs → vendor/type-wscUl8NW.mjs} +1 -1
- package/dist/vendor/type.cjs +9375 -268
- package/dist/vendor/type.d.cts +2969 -3
- package/dist/vendor/type.d.mts +2969 -3
- package/dist/vendor/type.mjs +9109 -3
- package/dist/{types-BO3PJV5p.d.mts → vendor/types-BwPWMe3m.d.mts} +1 -1
- package/dist/{types-Bb6lL3KL.d.cts → vendor/types-exLGvFgG.d.cts} +1 -1
- package/package.json +13 -21
- package/dist/config-C0OHvihx.d.mts +0 -1
- package/dist/config-GPeRZeGl.d.cts +0 -1
- package/dist/esbuild-plugin-BUYqx8_5.cjs +0 -80
- package/dist/esbuild-plugin-CRQUmm86.mjs +0 -75
- package/dist/type-8AL5U7vn.d.cts +0 -2969
- package/dist/type-BDuj5wg2.d.mts +0 -2969
- package/dist/type-C7UXbXfx.cjs +0 -10688
- package/dist/type-ma8o4dJG.mjs +0 -9110
- package/dist/utilities-CT_jcB5h.mjs +0 -1483
- package/dist/utilities-Dr3TzxMb.cjs +0 -1523
- /package/dist/{chunk-BmvPcxpV.cjs → vendor/chunk-BmvPcxpV.cjs} +0 -0
- /package/dist/{chunk-CgI6uo-e.mjs → vendor/chunk-CgI6uo-e.mjs} +0 -0
- /package/dist/{config-GVyELKY1.cjs → vendor/config-BbFVGRVh.cjs} +0 -0
- /package/dist/{string-CpVz34Gv.cjs → vendor/string-LTCnMzW_.cjs} +0 -0
- /package/dist/{type-DhqntM0q.cjs → vendor/type-fEQrgtBF.cjs} +0 -0
package/dist/esbuild-plugin.cjs
CHANGED
|
@@ -1,4 +1,49 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
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");
|
|
3
7
|
|
|
4
|
-
|
|
8
|
+
//#region src/esbuild-plugin.ts
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Level, Mode } from "./node_modules/.pnpm/@deepkit_type-compiler@1.0.5_patch_hash_439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/cjs/src/config.cjs";
|
|
2
2
|
import { PluginContext } from "@powerlines/core";
|
|
3
3
|
import { OnLoadOptions, Plugin } from "esbuild";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Level, Mode } from "./node_modules/.pnpm/@deepkit_type-compiler@1.0.5_patch_hash_439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/cjs/src/config.mjs";
|
|
2
2
|
import { PluginContext } from "@powerlines/core";
|
|
3
3
|
import { OnLoadOptions, Plugin } from "esbuild";
|
|
4
4
|
|
package/dist/esbuild-plugin.mjs
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { transpile } from "./transpile.mjs";
|
|
2
|
+
import { isString } from "@stryke/type-checks";
|
|
3
|
+
import { omit } from "@stryke/helpers/omit";
|
|
4
|
+
import { DiagnosticCategory } from "typescript";
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
//#region src/esbuild-plugin.ts
|
|
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
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_capnp = require('./capnp
|
|
3
|
-
const require_esbuild_plugin = require('./esbuild-plugin-BUYqx8_5.cjs');
|
|
2
|
+
const require_capnp = require('./capnp.cjs');
|
|
4
3
|
const require_transformer = require('./transformer.cjs');
|
|
5
4
|
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
|
-
require('./
|
|
10
|
-
const require_utilities = require('./utilities-Dr3TzxMb.cjs');
|
|
9
|
+
const require_utilities = require('./utilities.cjs');
|
|
11
10
|
|
|
12
11
|
exports.convertFromCapnp = require_capnp.convertFromCapnp;
|
|
13
12
|
exports.convertFromCapnpArray = require_capnp.convertFromCapnpArray;
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as esbuildPlugin } from "./esbuild-plugin-CRQUmm86.mjs";
|
|
1
|
+
import { convertFromCapnp, convertFromCapnpArray, convertFromCapnpBase, convertFromCapnpClassType, convertFromCapnpDefault, convertFromCapnpEnum, convertFromCapnpFunction, convertFromCapnpIndexAccessOrigin, convertFromCapnpInfer, convertFromCapnpIntersection, convertFromCapnpLiteral, convertFromCapnpMethodSignature, convertFromCapnpObjectLiteral, convertFromCapnpOther, convertFromCapnpParameter, convertFromCapnpProperty, convertFromCapnpPropertySignature, convertFromCapnpSimple, convertFromCapnpTagsReflection, convertFromCapnpTuple, convertFromCapnpTupleMember, convertFromCapnpUnion, convertToCapnp, convertToCapnpArray, convertToCapnpBase, convertToCapnpClassType, convertToCapnpDefault, convertToCapnpEnum, convertToCapnpFunction, convertToCapnpIndexAccessOrigin, convertToCapnpInfer, convertToCapnpIntersection, convertToCapnpLiteral, convertToCapnpMethod, convertToCapnpMethodSignature, convertToCapnpObjectLiteral, convertToCapnpOther, convertToCapnpParameter, convertToCapnpProperty, convertToCapnpPropertySignature, convertToCapnpSimple, convertToCapnpTagsReflection, convertToCapnpTuple, convertToCapnpTupleMember, convertToCapnpUnion } from "./capnp.mjs";
|
|
3
2
|
import { createDeclarationTransformer, createTransformer } from "./transformer.mjs";
|
|
4
3
|
import { transpile } from "./transpile.mjs";
|
|
4
|
+
import { esbuildPlugin } from "./esbuild-plugin.mjs";
|
|
5
5
|
import { reflectType } from "./reflect-type.mjs";
|
|
6
6
|
import { getReflectionsPath } from "./resolve-reflections.mjs";
|
|
7
7
|
import { rolldownPlugin } from "./rolldown-plugin.mjs";
|
|
8
|
-
import "./
|
|
9
|
-
import { a as stringifyDefaultValue, i as kindToName, n as getUnionTypes, o as stringifyStringValue, r as isStringUnion, s as stringifyValue, t as getEnumReflectionType } from "./utilities-CT_jcB5h.mjs";
|
|
8
|
+
import { getEnumReflectionType, getUnionTypes, isStringUnion, kindToName, stringifyDefaultValue, stringifyStringValue, stringifyValue } from "./utilities.mjs";
|
|
10
9
|
|
|
11
10
|
export { convertFromCapnp, convertFromCapnpArray, convertFromCapnpBase, convertFromCapnpClassType, convertFromCapnpDefault, convertFromCapnpEnum, convertFromCapnpFunction, convertFromCapnpIndexAccessOrigin, convertFromCapnpInfer, convertFromCapnpIntersection, convertFromCapnpLiteral, convertFromCapnpMethodSignature, convertFromCapnpObjectLiteral, convertFromCapnpOther, convertFromCapnpParameter, convertFromCapnpProperty, convertFromCapnpPropertySignature, convertFromCapnpSimple, convertFromCapnpTagsReflection, convertFromCapnpTuple, convertFromCapnpTupleMember, convertFromCapnpUnion, convertToCapnp, convertToCapnpArray, convertToCapnpBase, convertToCapnpClassType, convertToCapnpDefault, convertToCapnpEnum, convertToCapnpFunction, convertToCapnpIndexAccessOrigin, convertToCapnpInfer, convertToCapnpIntersection, convertToCapnpLiteral, convertToCapnpMethod, convertToCapnpMethodSignature, convertToCapnpObjectLiteral, convertToCapnpOther, convertToCapnpParameter, convertToCapnpProperty, convertToCapnpPropertySignature, convertToCapnpSimple, convertToCapnpTagsReflection, convertToCapnpTuple, convertToCapnpTupleMember, convertToCapnpUnion, createDeclarationTransformer, createTransformer, esbuildPlugin, getEnumReflectionType, getReflectionsPath, getUnionTypes, isStringUnion, kindToName, reflectType, rolldownPlugin, stringifyDefaultValue, stringifyStringValue, stringifyValue, transpile };
|