@powerlines/deepkit 0.5.3 → 0.5.4
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.cjs +47 -49
- package/dist/capnp.js +2 -4
- package/dist/chunk-23YNDVRG.js +34 -0
- package/dist/chunk-5MYRXRS2.cjs +2191 -0
- package/dist/{chunk-MSO7PT57.cjs → chunk-7FXYDYVQ.cjs} +128 -128
- package/dist/{chunk-B47NLUDW.cjs → chunk-7QZGCBH7.cjs} +2 -2
- package/dist/{chunk-47WBQTA6.js → chunk-ALM6UMVU.js} +1 -1
- package/dist/chunk-BLLXF42T.cjs +41 -0
- package/dist/{chunk-3PKIT7K2.cjs → chunk-CJMS4ES3.cjs} +4 -4
- package/dist/{chunk-JSH5MVQG.js → chunk-EJIBYA23.js} +2 -2
- package/dist/{chunk-GVS5O43Z.js → chunk-JE36RI7U.js} +2 -2
- package/dist/chunk-KGCRCOJQ.cjs +22 -0
- package/dist/chunk-SHUYVCID.js +4 -0
- package/dist/{chunk-XI47ZADG.js → chunk-TDYIUJGY.js} +9 -9
- package/dist/chunk-USNT2KNT.cjs +6 -0
- package/dist/chunk-WL27D7L7.js +2183 -0
- package/dist/chunk-XHSSGKUT.js +16 -0
- package/dist/{chunk-KDKCOXXC.cjs → chunk-YAEE7DDW.cjs} +5 -5
- package/dist/esbuild-plugin.cjs +5 -6
- package/dist/esbuild-plugin.js +4 -5
- package/dist/index.cjs +66 -68
- package/dist/index.js +8 -10
- package/dist/reflect-type.cjs +6 -8
- package/dist/reflect-type.js +5 -7
- package/dist/resolve-reflections.cjs +3 -3
- package/dist/resolve-reflections.js +2 -2
- package/dist/transformer.cjs +4 -5
- package/dist/transformer.js +2 -3
- package/dist/transpile.cjs +4 -5
- package/dist/transpile.js +3 -4
- package/dist/utilities.cjs +9 -11
- package/dist/utilities.js +2 -4
- package/package.json +4 -4
- package/dist/chunk-35PNVYKI.js +0 -187
- package/dist/chunk-3GQAWCBQ.js +0 -10
- package/dist/chunk-3GRTJOID.cjs +0 -193
- package/dist/chunk-4UQ4UDET.cjs +0 -19685
- package/dist/chunk-5NPGWGPO.cjs +0 -109
- package/dist/chunk-BGYQAVKQ.cjs +0 -13
- package/dist/chunk-F5QUFY7D.cjs +0 -135
- package/dist/chunk-KWUXT6EF.js +0 -127
- package/dist/chunk-O2LKJ62Q.cjs +0 -2863
- package/dist/chunk-U7WEV6HK.js +0 -19678
- package/dist/chunk-W423FBJ2.js +0 -2854
- package/dist/chunk-XU55W26B.js +0 -109
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
4
4
|
var joinPaths = require('@stryke/path/join-paths');
|
|
5
5
|
|
|
6
6
|
function getReflectionsPath(context) {
|
|
7
7
|
return joinPaths.joinPaths(context.dataPath, "reflections");
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
chunkUSNT2KNT_cjs.__name(getReflectionsPath, "getReflectionsPath");
|
|
10
10
|
|
|
11
11
|
exports.getReflectionsPath = getReflectionsPath;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
4
|
+
var typeCompiler = require('@powerlines/deepkit/vendor/type-compiler');
|
|
5
|
+
var defu = require('defu');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
10
|
+
|
|
11
|
+
var cache = new typeCompiler.Cache();
|
|
12
|
+
function createTransformer(context, options = {}) {
|
|
13
|
+
return /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(function transformer(ctx) {
|
|
14
|
+
cache.tick();
|
|
15
|
+
return new typeCompiler.ReflectionTransformer(ctx, cache).withReflection(defu__default.default(options, {
|
|
16
|
+
reflection: context.tsconfig.tsconfigJson.compilerOptions?.reflection || context.tsconfig.tsconfigJson.reflection,
|
|
17
|
+
reflectionLevel: context.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel || context.tsconfig.tsconfigJson.reflectionLevel
|
|
18
|
+
}, {
|
|
19
|
+
exclude: [],
|
|
20
|
+
reflection: "default",
|
|
21
|
+
reflectionLevel: "minimal"
|
|
22
|
+
}));
|
|
23
|
+
}, "transformer");
|
|
24
|
+
}
|
|
25
|
+
chunkUSNT2KNT_cjs.__name(createTransformer, "createTransformer");
|
|
26
|
+
function createDeclarationTransformer(context, options = {}) {
|
|
27
|
+
return /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(function declarationTransformer(ctx) {
|
|
28
|
+
return new typeCompiler.DeclarationTransformer(ctx, cache).withReflection(defu__default.default(options, {
|
|
29
|
+
reflection: context.tsconfig.tsconfigJson.compilerOptions?.reflection || context.tsconfig.tsconfigJson.reflection,
|
|
30
|
+
reflectionLevel: context.tsconfig.tsconfigJson.compilerOptions?.reflectionLevel || context.tsconfig.tsconfigJson.reflectionLevel
|
|
31
|
+
}, {
|
|
32
|
+
exclude: [],
|
|
33
|
+
reflection: "default",
|
|
34
|
+
reflectionLevel: "minimal"
|
|
35
|
+
}));
|
|
36
|
+
}, "declarationTransformer");
|
|
37
|
+
}
|
|
38
|
+
chunkUSNT2KNT_cjs.__name(createDeclarationTransformer, "createDeclarationTransformer");
|
|
39
|
+
|
|
40
|
+
exports.createDeclarationTransformer = createDeclarationTransformer;
|
|
41
|
+
exports.createTransformer = createTransformer;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkYAEE7DDW_cjs = require('./chunk-YAEE7DDW.cjs');
|
|
4
|
+
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var typeChecks = require('@stryke/type-checks');
|
|
6
6
|
var typescript = require('typescript');
|
|
7
7
|
|
|
8
|
-
var esbuildPlugin = /* @__PURE__ */
|
|
8
|
+
var esbuildPlugin = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((context, options = {}) => {
|
|
9
9
|
return {
|
|
10
10
|
name: "powerlines:deepkit",
|
|
11
11
|
setup(build) {
|
|
@@ -26,7 +26,7 @@ var esbuildPlugin = /* @__PURE__ */ chunkBGYQAVKQ_cjs.__name((context, options =
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
const result =
|
|
29
|
+
const result = chunkYAEE7DDW_cjs.transpile(context, contents, args.path);
|
|
30
30
|
if (result.diagnostics && result.diagnostics.length > 0) {
|
|
31
31
|
if (result.diagnostics.some((d) => d.category === typescript.DiagnosticCategory.Error)) {
|
|
32
32
|
const errorMessage = `Deepkit Type reflection transpilation errors: ${args.path}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createTransformer, createDeclarationTransformer } from './chunk-
|
|
2
|
-
import { __name } from './chunk-
|
|
1
|
+
import { createTransformer, createDeclarationTransformer } from './chunk-23YNDVRG.js';
|
|
2
|
+
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import ts from 'typescript';
|
|
4
4
|
|
|
5
5
|
function transpile(context, code, id) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { transpile } from './chunk-
|
|
2
|
-
import { __name } from './chunk-
|
|
1
|
+
import { transpile } from './chunk-EJIBYA23.js';
|
|
2
|
+
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { isString } from '@stryke/type-checks';
|
|
4
4
|
import { DiagnosticCategory } from 'typescript';
|
|
5
5
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCJMS4ES3_cjs = require('./chunk-CJMS4ES3.cjs');
|
|
4
|
+
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
|
+
var type = require('@powerlines/deepkit/vendor/type');
|
|
6
|
+
var defu = require('defu');
|
|
7
|
+
var resolve = require('powerlines/lib/utilities/resolve');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
12
|
+
|
|
13
|
+
async function reflectType(context, type$1, overrides = {}) {
|
|
14
|
+
return type.reflect(await resolve.resolve(context, type$1, defu__default.default(overrides, {
|
|
15
|
+
plugins: [
|
|
16
|
+
chunkCJMS4ES3_cjs.esbuildPlugin(context)
|
|
17
|
+
]
|
|
18
|
+
})));
|
|
19
|
+
}
|
|
20
|
+
chunkUSNT2KNT_cjs.__name(reflectType, "reflectType");
|
|
21
|
+
|
|
22
|
+
exports.reflectType = reflectType;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { __name } from './chunk-SHUYVCID.js';
|
|
2
|
+
import { ReflectionKind, ReflectionVisibility as ReflectionVisibility$1 } from '@powerlines/deepkit/vendor/type';
|
|
3
3
|
import { isSetObject, isUndefined, isInteger } from '@stryke/type-checks';
|
|
4
4
|
import * as $ from '@stryke/capnp';
|
|
5
5
|
|
|
6
6
|
BigInt("0xae3c363dcecf2729");
|
|
7
|
-
var
|
|
7
|
+
var ReflectionVisibility = {
|
|
8
8
|
PUBLIC: 0,
|
|
9
9
|
PROTECTED: 1,
|
|
10
10
|
PRIVATE: 2
|
|
@@ -4628,7 +4628,7 @@ function convertToCapnpProperty(serializedType, result) {
|
|
|
4628
4628
|
result.description = serializedType.description || "";
|
|
4629
4629
|
result.optional = serializedType.optional ?? false;
|
|
4630
4630
|
result.readonly = serializedType.readonly ?? false;
|
|
4631
|
-
result.visibility = serializedType.visibility === ReflectionVisibility.public ?
|
|
4631
|
+
result.visibility = serializedType.visibility === ReflectionVisibility$1.public ? ReflectionVisibility.PUBLIC : serializedType.visibility === ReflectionVisibility$1.protected ? ReflectionVisibility.PROTECTED : ReflectionVisibility.PRIVATE;
|
|
4632
4632
|
result.abstract = serializedType.abstract ?? false;
|
|
4633
4633
|
result.name = String(serializedType.name) || "";
|
|
4634
4634
|
if (typeof serializedType.default !== "undefined") {
|
|
@@ -4670,7 +4670,7 @@ function convertFromCapnpProperty(serializedType) {
|
|
|
4670
4670
|
default: convertFromCapnpDefault(serializedType.default),
|
|
4671
4671
|
optional: serializedType.optional ? true : void 0,
|
|
4672
4672
|
readonly: serializedType.readonly ? true : void 0,
|
|
4673
|
-
visibility: serializedType.visibility ===
|
|
4673
|
+
visibility: serializedType.visibility === ReflectionVisibility.PUBLIC ? ReflectionVisibility$1.public : serializedType.visibility === ReflectionVisibility.PROTECTED ? ReflectionVisibility$1.protected : ReflectionVisibility$1.private,
|
|
4674
4674
|
abstract: serializedType.abstract ? true : void 0,
|
|
4675
4675
|
name: serializedType.name,
|
|
4676
4676
|
type: serializedType.type.id,
|
|
@@ -4945,7 +4945,7 @@ function convertToCapnpMethod(serializedType, result) {
|
|
|
4945
4945
|
result.kind = serializedType.kind;
|
|
4946
4946
|
result.typeName = serializedType.typeName || "";
|
|
4947
4947
|
result.abstract = serializedType.abstract ?? false;
|
|
4948
|
-
result.visibility = serializedType.visibility === ReflectionVisibility.public ?
|
|
4948
|
+
result.visibility = serializedType.visibility === ReflectionVisibility$1.public ? ReflectionVisibility.PUBLIC : serializedType.visibility === ReflectionVisibility$1.protected ? ReflectionVisibility.PROTECTED : ReflectionVisibility.PRIVATE;
|
|
4949
4949
|
if (serializedType.decorators?.length) {
|
|
4950
4950
|
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
4951
4951
|
serializedType.decorators.forEach((d, index) => {
|
|
@@ -5002,7 +5002,7 @@ function convertFromCapnpMethod(serializedType) {
|
|
|
5002
5002
|
typeName: serializedType.typeName || void 0,
|
|
5003
5003
|
abstract: serializedType.abstract ? true : void 0,
|
|
5004
5004
|
return: serializedType.return.id,
|
|
5005
|
-
visibility: serializedType.visibility ===
|
|
5005
|
+
visibility: serializedType.visibility === ReflectionVisibility.PUBLIC ? ReflectionVisibility$1.public : serializedType.visibility === ReflectionVisibility.PROTECTED ? ReflectionVisibility$1.protected : ReflectionVisibility$1.private,
|
|
5006
5006
|
parameters: serializedType._hasParameters() ? serializedType.parameters.map((parameter) => convertFromCapnpParameter(parameter)) : []
|
|
5007
5007
|
};
|
|
5008
5008
|
return result;
|
|
@@ -5126,7 +5126,7 @@ function convertToCapnpParameter(serializedType, result) {
|
|
|
5126
5126
|
result.name = serializedType.name || "";
|
|
5127
5127
|
result.optional = serializedType.optional ?? false;
|
|
5128
5128
|
result.readonly = serializedType.readonly ?? false;
|
|
5129
|
-
result.visibility = serializedType.visibility === ReflectionVisibility.public ?
|
|
5129
|
+
result.visibility = serializedType.visibility === ReflectionVisibility$1.public ? ReflectionVisibility.PUBLIC : serializedType.visibility === ReflectionVisibility$1.protected ? ReflectionVisibility.PROTECTED : ReflectionVisibility.PRIVATE;
|
|
5130
5130
|
if (typeof serializedType.default !== "undefined") {
|
|
5131
5131
|
const defaultValue = result._initDefault();
|
|
5132
5132
|
convertToCapnpDefault(serializedType.default, defaultValue);
|
|
@@ -5166,7 +5166,7 @@ function convertFromCapnpParameter(serializedType) {
|
|
|
5166
5166
|
default: convertFromCapnpDefault(serializedType.default),
|
|
5167
5167
|
optional: serializedType.optional ? true : void 0,
|
|
5168
5168
|
readonly: serializedType.readonly ? true : void 0,
|
|
5169
|
-
visibility: serializedType.visibility ===
|
|
5169
|
+
visibility: serializedType.visibility === ReflectionVisibility.PUBLIC ? ReflectionVisibility$1.public : serializedType.visibility === ReflectionVisibility.PROTECTED ? ReflectionVisibility$1.protected : ReflectionVisibility$1.private,
|
|
5170
5170
|
type: serializedType.type.id,
|
|
5171
5171
|
decorators: serializedType._hasDecorators() ? serializedType.decorators.map((d) => d.id) : void 0,
|
|
5172
5172
|
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map((t) => t.id) : void 0,
|