@powerlines/deepkit 0.6.167 → 0.7.1
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/bin/deepkit-install.cjs +55 -90
- package/dist/capnp-BLx1WTBU.cjs +5175 -0
- package/dist/capnp-BiGNkOmV.mjs +4905 -0
- package/dist/capnp.cjs +47 -186
- package/dist/capnp.d.cts +78 -77
- package/dist/{capnp.d.ts → capnp.d.mts} +78 -77
- package/dist/capnp.mjs +3 -0
- package/dist/chunk-C0xms8kb.cjs +34 -0
- package/dist/esbuild-plugin.cjs +47 -11
- package/dist/esbuild-plugin.d.cts +20 -18
- package/dist/esbuild-plugin.d.mts +35 -0
- package/dist/esbuild-plugin.mjs +48 -0
- package/dist/index.cjs +69 -250
- package/dist/index.d.cts +10 -19
- package/dist/index.d.mts +10 -0
- package/dist/index.mjs +11 -0
- package/dist/reflect-type.cjs +24 -12
- package/dist/reflect-type.d.cts +7 -5
- package/dist/{reflect-type.d.ts → reflect-type.d.mts} +7 -5
- package/dist/reflect-type.mjs +24 -0
- package/dist/{reflection-9KUpjPqV.d.cts → reflection-BwdnCwaK.d.cts} +11 -17
- package/dist/{reflection-9KUpjPqV.d.ts → reflection-Chr4fE0i.d.mts} +11 -17
- package/dist/reflection-D9R8cdSo.d.mts +1561 -0
- package/dist/resolve-reflections.cjs +15 -9
- package/dist/resolve-reflections.d.cts +4 -2
- package/dist/{resolve-reflections.d.ts → resolve-reflections.d.mts} +4 -2
- package/dist/resolve-reflections.mjs +16 -0
- package/dist/rolldown-plugin.cjs +44 -11
- package/dist/rolldown-plugin.d.cts +5 -3
- package/dist/{rolldown-plugin.d.ts → rolldown-plugin.d.mts} +5 -3
- package/dist/rolldown-plugin.mjs +45 -0
- package/dist/transformer.cjs +52 -13
- package/dist/transformer.d.cts +6 -4
- package/dist/{transformer.d.ts → transformer.d.mts} +6 -4
- package/dist/transformer.mjs +51 -0
- package/dist/transpile.cjs +29 -10
- package/dist/transpile.d.cts +6 -4
- package/dist/{transpile.d.ts → transpile.d.mts} +6 -4
- package/dist/transpile.mjs +29 -0
- package/dist/types.cjs +0 -4
- package/dist/types.d.cts +9 -9
- package/dist/{types.d.ts → types.d.mts} +9 -9
- package/dist/types.mjs +1 -0
- package/dist/utilities.cjs +116 -33
- package/dist/utilities.d.cts +4 -2
- package/dist/{utilities.d.ts → utilities.d.mts} +4 -2
- package/dist/utilities.mjs +111 -0
- package/dist/vendor/core.cjs +1240 -513
- package/dist/vendor/core.mjs +1116 -0
- package/dist/vendor/string-BoXo0wS7.cjs +2983 -0
- package/dist/vendor/string-BuMgdahD.mjs +2467 -0
- package/dist/vendor/type-BMLjRtLY.cjs +202 -0
- package/dist/vendor/type-Dgeqs-rL.mjs +190 -0
- package/dist/vendor/type-compiler/compiler-BUrWMhGi.cjs +6792 -0
- package/dist/vendor/type-compiler/compiler-Bg8jX6qU.mjs +6739 -0
- package/dist/vendor/type-compiler/compiler-D1z5h1MK.d.cts +578 -0
- package/dist/vendor/type-compiler/compiler-Nkxc4PLJ.d.mts +578 -0
- package/dist/vendor/type-compiler/compiler.cjs +11 -43
- package/dist/vendor/type-compiler/compiler.d.cts +2 -3
- package/dist/vendor/type-compiler/compiler.d.mts +2 -0
- package/dist/vendor/type-compiler/compiler.mjs +3 -0
- package/dist/vendor/type-compiler/config-BEX924PC.cjs +3709 -0
- package/dist/vendor/type-compiler/config-B_cKkYZm.d.cts +116 -0
- package/dist/vendor/type-compiler/config-D9DM7Du_.d.mts +116 -0
- package/dist/vendor/type-compiler/config-y0HNkbCH.mjs +3640 -0
- package/dist/vendor/type-compiler/config.cjs +9 -34
- package/dist/vendor/type-compiler/config.d.cts +2 -1
- package/dist/vendor/type-compiler/config.d.mts +2 -0
- package/dist/vendor/type-compiler/config.mjs +3 -0
- package/dist/vendor/type-compiler/index.cjs +56 -129
- package/dist/vendor/type-compiler/index.d.cts +22 -3
- package/dist/vendor/type-compiler/index.d.mts +22 -0
- package/dist/vendor/type-compiler/index.mjs +50 -0
- package/dist/vendor/type-spec.cjs +11 -12
- package/dist/vendor/type-spec.mjs +3 -0
- package/dist/vendor/type.cjs +8407 -17892
- package/dist/vendor/type.d.cts +10 -196
- package/dist/vendor/{type.d.ts → type.d.mts} +10 -196
- package/dist/vendor/type.mjs +9109 -0
- package/package.json +43 -31
- package/schemas/reflection.cjs +4018 -4129
- package/schemas/reflection.d.cts +30 -38
- package/schemas/{reflection.d.ts → reflection.d.mts} +30 -38
- package/schemas/reflection.mjs +4036 -0
- package/dist/capnp.js +0 -2
- package/dist/chunk-23YNDVRG.js +0 -34
- package/dist/chunk-27RKMKSF.cjs +0 -50
- package/dist/chunk-2XDQUCXZ.js +0 -2392
- package/dist/chunk-34OFD7LS.cjs +0 -68
- package/dist/chunk-7FXYDYVQ.cjs +0 -5246
- package/dist/chunk-7QZGCBH7.cjs +0 -11
- package/dist/chunk-ALM6UMVU.js +0 -9
- package/dist/chunk-BLLXF42T.cjs +0 -41
- package/dist/chunk-H3Q3XL3D.js +0 -19
- package/dist/chunk-HPVJ6OV3.cjs +0 -31
- package/dist/chunk-JQUKKAFM.js +0 -48
- package/dist/chunk-KK7TQA7L.cjs +0 -25
- package/dist/chunk-NPV2346T.js +0 -25
- package/dist/chunk-ORA4UQMU.cjs +0 -2
- package/dist/chunk-OUGDFUKJ.cjs +0 -2400
- package/dist/chunk-OULCUN6I.js +0 -1
- package/dist/chunk-SHUYVCID.js +0 -4
- package/dist/chunk-TDYIUJGY.js +0 -5180
- package/dist/chunk-USNT2KNT.cjs +0 -6
- package/dist/chunk-WYEFKIRL.js +0 -66
- package/dist/esbuild-plugin.d.ts +0 -33
- package/dist/esbuild-plugin.js +0 -4
- package/dist/index.d.ts +0 -19
- package/dist/index.js +0 -10
- package/dist/reflect-type.js +0 -5
- package/dist/resolve-reflections.js +0 -2
- package/dist/rolldown-plugin.js +0 -4
- package/dist/transformer.js +0 -2
- package/dist/transpile.js +0 -3
- package/dist/types.js +0 -1
- package/dist/utilities.js +0 -2
- package/dist/vendor/chunk-5BKT4CS5.js +0 -28
- package/dist/vendor/chunk-BLN7QVCP.js +0 -3704
- package/dist/vendor/chunk-BR2FK5K7.js +0 -109
- package/dist/vendor/chunk-EPQZMVJO.cjs +0 -3859
- package/dist/vendor/chunk-IFK6AU6M.cjs +0 -42
- package/dist/vendor/chunk-SHDAXCXF.cjs +0 -115
- package/dist/vendor/core.js +0 -2
- package/dist/vendor/type-compiler/chunk-3LL3TSRJ.js +0 -3762
- package/dist/vendor/type-compiler/chunk-CUTGHVNY.js +0 -7100
- package/dist/vendor/type-compiler/chunk-IAWCLVUK.cjs +0 -3780
- package/dist/vendor/type-compiler/chunk-UIWPG352.cjs +0 -7114
- package/dist/vendor/type-compiler/compiler.d.ts +0 -3
- package/dist/vendor/type-compiler/compiler.js +0 -5
- package/dist/vendor/type-compiler/config.d.ts +0 -1
- package/dist/vendor/type-compiler/config.js +0 -5
- package/dist/vendor/type-compiler/index.d.ts +0 -3
- package/dist/vendor/type-compiler/index.js +0 -66
- package/dist/vendor/type-spec.js +0 -2
- package/dist/vendor/type.js +0 -18359
- package/schemas/reflection.js +0 -4153
- /package/dist/vendor/{core.d.ts → core.d.mts} +0 -0
- /package/dist/vendor/{type-spec.d.ts → type-spec.d.mts} +0 -0
package/dist/chunk-USNT2KNT.cjs
DELETED
package/dist/chunk-WYEFKIRL.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { transpile } from './chunk-NPV2346T.js';
|
|
2
|
-
import { __name } from './chunk-SHUYVCID.js';
|
|
3
|
-
import { isString } from '@stryke/type-checks';
|
|
4
|
-
import { DiagnosticCategory } from 'typescript';
|
|
5
|
-
|
|
6
|
-
// ../../node_modules/.pnpm/@stryke+helpers@0.10.7/node_modules/@stryke/helpers/dist/omit.mjs
|
|
7
|
-
function omit(obj, keys) {
|
|
8
|
-
const result = { ...obj };
|
|
9
|
-
for (let i = 0; i < keys.length; i++) {
|
|
10
|
-
const key = keys[i];
|
|
11
|
-
if (key) delete result[key];
|
|
12
|
-
}
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
__name(omit, "omit");
|
|
16
|
-
var esbuildPlugin = /* @__PURE__ */ __name((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) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
if (args.pluginData?.isReflected) {
|
|
29
|
-
return {
|
|
30
|
-
contents,
|
|
31
|
-
loader: "ts",
|
|
32
|
-
pluginData: {
|
|
33
|
-
isReflected: true
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
const result = transpile(context, contents, args.path, omit(options, [
|
|
38
|
-
"onLoad"
|
|
39
|
-
]));
|
|
40
|
-
if (result.diagnostics && result.diagnostics.length > 0) {
|
|
41
|
-
if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Error)) {
|
|
42
|
-
const errorMessage = `Deepkit Type reflection transpilation errors: ${args.path}
|
|
43
|
-
${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")}`;
|
|
44
|
-
context.error(errorMessage);
|
|
45
|
-
throw new Error(errorMessage);
|
|
46
|
-
} else if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Warning)) {
|
|
47
|
-
context.warn(`Deepkit Type reflection transpilation warnings: ${args.path}
|
|
48
|
-
${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")}`);
|
|
49
|
-
} else {
|
|
50
|
-
context.debug(`Deepkit Type reflection transpilation diagnostics: ${args.path}
|
|
51
|
-
${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
contents: result.outputText,
|
|
56
|
-
loader: "ts",
|
|
57
|
-
pluginData: {
|
|
58
|
-
isReflected: true
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}, "esbuildPlugin");
|
|
65
|
-
|
|
66
|
-
export { esbuildPlugin };
|
package/dist/esbuild-plugin.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { OnLoadOptions, Plugin } from 'esbuild';
|
|
2
|
-
import { PluginContext } from 'powerlines';
|
|
3
|
-
import { Mode, Level } from '@deepkit/type-compiler/config';
|
|
4
|
-
|
|
5
|
-
interface ReflectionConfig {
|
|
6
|
-
/**
|
|
7
|
-
* Allows to exclude type definitions/TS files from being included in the type compilation step. When a global .d.ts is matched, their types won't be embedded (useful to exclude DOM for example)
|
|
8
|
-
*/
|
|
9
|
-
exclude?: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Either a boolean indication general reflection mode, or a list of globs to match against.
|
|
12
|
-
*/
|
|
13
|
-
reflection?: string[] | Mode;
|
|
14
|
-
/**
|
|
15
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
16
|
-
*/
|
|
17
|
-
reflectionLevel?: Level;
|
|
18
|
-
}
|
|
19
|
-
interface ESBuildPluginOptions extends Partial<ReflectionConfig> {
|
|
20
|
-
onLoad?: Partial<OnLoadOptions>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Esbuild plugin for Deepkit Type reflections.
|
|
24
|
-
*
|
|
25
|
-
* @param context - The Powerlines context.
|
|
26
|
-
* @param options - Optional esbuild onLoad options and reflection configuration.
|
|
27
|
-
* @returns An esbuild plugin instance.
|
|
28
|
-
*/
|
|
29
|
-
declare const esbuildPlugin: <TContext extends PluginContext>(context: TContext, options?: ESBuildPluginOptions) => Plugin;
|
|
30
|
-
declare type __ΩReflectionConfig = any[];
|
|
31
|
-
declare type __ΩESBuildPluginOptions = any[];
|
|
32
|
-
|
|
33
|
-
export { type ESBuildPluginOptions, type ReflectionConfig, type __ΩESBuildPluginOptions, type __ΩReflectionConfig, esbuildPlugin };
|
package/dist/esbuild-plugin.js
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export { WithIndexAccessOrigin, WithTagsReflection, __ΩWithIndexAccessOrigin, __ΩWithTagsReflection, 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.js';
|
|
2
|
-
export { ESBuildPluginOptions, ReflectionConfig, __ΩESBuildPluginOptions, __ΩReflectionConfig, esbuildPlugin } from './esbuild-plugin.js';
|
|
3
|
-
export { reflectType } from './reflect-type.js';
|
|
4
|
-
export { getReflectionsPath } from './resolve-reflections.js';
|
|
5
|
-
export { rolldownPlugin } from './rolldown-plugin.js';
|
|
6
|
-
export { createDeclarationTransformer, createTransformer } from './transformer.js';
|
|
7
|
-
export { transpile } from './transpile.js';
|
|
8
|
-
export { ContextReflectionRecord, Reflection, ReflectionRecord, __ΩContextReflectionRecord, __ΩReflection, __ΩReflectionRecord } from './types.js';
|
|
9
|
-
export { getEnumReflectionType, getUnionTypes, isStringUnion, kindToName, stringifyDefaultValue, stringifyStringValue, stringifyValue } from './utilities.js';
|
|
10
|
-
import '@powerlines/deepkit/vendor/type';
|
|
11
|
-
import '@stryke/capnp';
|
|
12
|
-
import './reflection-9KUpjPqV.js';
|
|
13
|
-
import 'esbuild';
|
|
14
|
-
import 'powerlines';
|
|
15
|
-
import '@deepkit/type-compiler/config';
|
|
16
|
-
import '@stryke/types/configuration';
|
|
17
|
-
import 'rolldown';
|
|
18
|
-
import 'typescript';
|
|
19
|
-
import '@powerlines/deepkit/vendor/type-compiler';
|
package/dist/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import './chunk-OULCUN6I.js';
|
|
2
|
-
export { getEnumReflectionType, getUnionTypes, isStringUnion, kindToName, stringifyDefaultValue, stringifyStringValue, stringifyValue } from './chunk-2XDQUCXZ.js';
|
|
3
|
-
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 } from './chunk-TDYIUJGY.js';
|
|
4
|
-
export { reflectType } from './chunk-H3Q3XL3D.js';
|
|
5
|
-
export { esbuildPlugin } from './chunk-WYEFKIRL.js';
|
|
6
|
-
export { getReflectionsPath } from './chunk-ALM6UMVU.js';
|
|
7
|
-
export { rolldownPlugin } from './chunk-JQUKKAFM.js';
|
|
8
|
-
export { transpile } from './chunk-NPV2346T.js';
|
|
9
|
-
export { createDeclarationTransformer, createTransformer } from './chunk-23YNDVRG.js';
|
|
10
|
-
import './chunk-SHUYVCID.js';
|
package/dist/reflect-type.js
DELETED
package/dist/rolldown-plugin.js
DELETED
package/dist/transformer.js
DELETED
package/dist/transpile.js
DELETED
package/dist/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './chunk-OULCUN6I.js';
|
package/dist/utilities.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
|
|
28
|
-
export { __commonJS, __name, __toESM };
|