@powerlines/deepkit 0.6.166 → 0.7.0
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-D9R8cdSo.d.mts} +26 -32
- 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-7QZGCBH7.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
4
|
-
var joinPaths = require('@stryke/path/join-paths');
|
|
5
|
-
|
|
6
|
-
function getReflectionsPath(context) {
|
|
7
|
-
return joinPaths.joinPaths(context.dataPath, "reflections");
|
|
8
|
-
}
|
|
9
|
-
chunkUSNT2KNT_cjs.__name(getReflectionsPath, "getReflectionsPath");
|
|
10
|
-
|
|
11
|
-
exports.getReflectionsPath = getReflectionsPath;
|
package/dist/chunk-ALM6UMVU.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { __name } from './chunk-SHUYVCID.js';
|
|
2
|
-
import { joinPaths } from '@stryke/path/join-paths';
|
|
3
|
-
|
|
4
|
-
function getReflectionsPath(context) {
|
|
5
|
-
return joinPaths(context.dataPath, "reflections");
|
|
6
|
-
}
|
|
7
|
-
__name(getReflectionsPath, "getReflectionsPath");
|
|
8
|
-
|
|
9
|
-
export { getReflectionsPath };
|
package/dist/chunk-BLLXF42T.cjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
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;
|
package/dist/chunk-H3Q3XL3D.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { esbuildPlugin } from './chunk-WYEFKIRL.js';
|
|
2
|
-
import { __name } from './chunk-SHUYVCID.js';
|
|
3
|
-
import { reflect } from '@powerlines/deepkit/vendor/type';
|
|
4
|
-
import { resolve } from '@powerlines/plugin-esbuild/helpers/resolve';
|
|
5
|
-
import defu from 'defu';
|
|
6
|
-
|
|
7
|
-
async function reflectType(context, type, overrides = {}) {
|
|
8
|
-
return reflect(await resolve(context, type, defu(overrides, {
|
|
9
|
-
plugins: [
|
|
10
|
-
esbuildPlugin(context, {
|
|
11
|
-
reflection: "default",
|
|
12
|
-
reflectionLevel: "verbose"
|
|
13
|
-
})
|
|
14
|
-
]
|
|
15
|
-
})));
|
|
16
|
-
}
|
|
17
|
-
__name(reflectType, "reflectType");
|
|
18
|
-
|
|
19
|
-
export { reflectType };
|
package/dist/chunk-HPVJ6OV3.cjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkBLLXF42T_cjs = require('./chunk-BLLXF42T.cjs');
|
|
4
|
-
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
|
-
var ts = require('typescript');
|
|
6
|
-
|
|
7
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
-
|
|
9
|
-
var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
10
|
-
|
|
11
|
-
function transpile(context, code, id, options = {}) {
|
|
12
|
-
const transformer = chunkBLLXF42T_cjs.createTransformer(context, options);
|
|
13
|
-
const declarationTransformer = chunkBLLXF42T_cjs.createDeclarationTransformer(context, options);
|
|
14
|
-
return ts__default.default.transpileModule(code, {
|
|
15
|
-
compilerOptions: {
|
|
16
|
-
...context.tsconfig.options
|
|
17
|
-
},
|
|
18
|
-
fileName: id,
|
|
19
|
-
transformers: {
|
|
20
|
-
before: [
|
|
21
|
-
transformer
|
|
22
|
-
],
|
|
23
|
-
after: [
|
|
24
|
-
declarationTransformer
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
chunkUSNT2KNT_cjs.__name(transpile, "transpile");
|
|
30
|
-
|
|
31
|
-
exports.transpile = transpile;
|
package/dist/chunk-JQUKKAFM.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { transpile } from './chunk-NPV2346T.js';
|
|
2
|
-
import { __name } from './chunk-SHUYVCID.js';
|
|
3
|
-
import { findFileExtension } from '@stryke/path';
|
|
4
|
-
import { isString } from '@stryke/type-checks';
|
|
5
|
-
import { DiagnosticCategory } from 'typescript';
|
|
6
|
-
|
|
7
|
-
var rolldownPlugin = /* @__PURE__ */ __name((context, filter = {}) => {
|
|
8
|
-
return {
|
|
9
|
-
name: "powerlines:deepkit",
|
|
10
|
-
load: {
|
|
11
|
-
filter: {
|
|
12
|
-
id: /\.(m|c)?tsx?$/,
|
|
13
|
-
...filter
|
|
14
|
-
},
|
|
15
|
-
async handler(id) {
|
|
16
|
-
const path = await context.resolve(id);
|
|
17
|
-
if (!path?.id) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
const contents = await context.fs.read(path.id);
|
|
21
|
-
if (!contents) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
const result = transpile(context, contents, path.id);
|
|
25
|
-
if (result.diagnostics && result.diagnostics.length > 0) {
|
|
26
|
-
if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Error)) {
|
|
27
|
-
const errorMessage = `Deepkit Type reflection transpilation errors: ${id}
|
|
28
|
-
${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")}`;
|
|
29
|
-
context.error(errorMessage);
|
|
30
|
-
throw new Error(errorMessage);
|
|
31
|
-
} else if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Warning)) {
|
|
32
|
-
context.warn(`Deepkit Type reflection transpilation warnings: ${id}
|
|
33
|
-
${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")}`);
|
|
34
|
-
} else {
|
|
35
|
-
context.debug(`Deepkit Type reflection transpilation diagnostics: ${id}
|
|
36
|
-
${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
code: result.outputText,
|
|
41
|
-
moduleType: findFileExtension(path.id)
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}, "rolldownPlugin");
|
|
47
|
-
|
|
48
|
-
export { rolldownPlugin };
|
package/dist/chunk-KK7TQA7L.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk34OFD7LS_cjs = require('./chunk-34OFD7LS.cjs');
|
|
4
|
-
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
|
-
var type = require('@powerlines/deepkit/vendor/type');
|
|
6
|
-
var resolve = require('@powerlines/plugin-esbuild/helpers/resolve');
|
|
7
|
-
var defu = require('defu');
|
|
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
|
-
chunk34OFD7LS_cjs.esbuildPlugin(context, {
|
|
17
|
-
reflection: "default",
|
|
18
|
-
reflectionLevel: "verbose"
|
|
19
|
-
})
|
|
20
|
-
]
|
|
21
|
-
})));
|
|
22
|
-
}
|
|
23
|
-
chunkUSNT2KNT_cjs.__name(reflectType, "reflectType");
|
|
24
|
-
|
|
25
|
-
exports.reflectType = reflectType;
|
package/dist/chunk-NPV2346T.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createTransformer, createDeclarationTransformer } from './chunk-23YNDVRG.js';
|
|
2
|
-
import { __name } from './chunk-SHUYVCID.js';
|
|
3
|
-
import ts from 'typescript';
|
|
4
|
-
|
|
5
|
-
function transpile(context, code, id, options = {}) {
|
|
6
|
-
const transformer = createTransformer(context, options);
|
|
7
|
-
const declarationTransformer = createDeclarationTransformer(context, options);
|
|
8
|
-
return ts.transpileModule(code, {
|
|
9
|
-
compilerOptions: {
|
|
10
|
-
...context.tsconfig.options
|
|
11
|
-
},
|
|
12
|
-
fileName: id,
|
|
13
|
-
transformers: {
|
|
14
|
-
before: [
|
|
15
|
-
transformer
|
|
16
|
-
],
|
|
17
|
-
after: [
|
|
18
|
-
declarationTransformer
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
__name(transpile, "transpile");
|
|
24
|
-
|
|
25
|
-
export { transpile };
|
package/dist/chunk-ORA4UQMU.cjs
DELETED