@powerlines/deepkit 0.5.3 → 0.5.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.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
- /package/dist/vendor/{chunk-IOMA7ABE.js → type-compiler/chunk-IOMA7ABE.js} +0 -0
- /package/dist/vendor/{chunk-K5KCTNDL.cjs → type-compiler/chunk-K5KCTNDL.cjs} +0 -0
- /package/dist/vendor/{chunk-L3KIZV6P.js → type-compiler/chunk-L3KIZV6P.js} +0 -0
- /package/dist/vendor/{chunk-M3FJ3QXG.cjs → type-compiler/chunk-M3FJ3QXG.cjs} +0 -0
- /package/dist/vendor/{compiler.cjs → type-compiler/compiler.cjs} +0 -0
- /package/dist/vendor/{compiler.d.cts → type-compiler/compiler.d.cts} +0 -0
- /package/dist/vendor/{compiler.d.ts → type-compiler/compiler.d.ts} +0 -0
- /package/dist/vendor/{compiler.js → type-compiler/compiler.js} +0 -0
- /package/dist/vendor/{config.cjs → type-compiler/config.cjs} +0 -0
- /package/dist/vendor/{config.d.cts → type-compiler/config.d.cts} +0 -0
- /package/dist/vendor/{config.d.ts → type-compiler/config.d.ts} +0 -0
- /package/dist/vendor/{config.js → type-compiler/config.js} +0 -0
- /package/dist/vendor/{index.cjs → type-compiler/index.cjs} +0 -0
- /package/dist/vendor/{index.d.cts → type-compiler/index.d.cts} +0 -0
- /package/dist/vendor/{index.d.ts → type-compiler/index.d.ts} +0 -0
- /package/dist/vendor/{index.js → type-compiler/index.js} +0 -0
package/dist/chunk-35PNVYKI.js
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { reflect } from './chunk-U7WEV6HK.js';
|
|
2
|
-
import { esbuildPlugin } from './chunk-GVS5O43Z.js';
|
|
3
|
-
import { __name } from './chunk-3GQAWCBQ.js';
|
|
4
|
-
import defu from 'defu';
|
|
5
|
-
import { parseTypeDefinition } from '@stryke/convert/parse-type-definition';
|
|
6
|
-
import { isSetString } from '@stryke/type-checks/is-set-string';
|
|
7
|
-
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
8
|
-
import { build } from 'esbuild';
|
|
9
|
-
import { omit } from '@stryke/helpers/omit';
|
|
10
|
-
import { joinPaths } from '@stryke/path/join-paths';
|
|
11
|
-
import '@stryke/path/replace';
|
|
12
|
-
import { camelCase } from '@stryke/string-format/camel-case';
|
|
13
|
-
import '@stryke/type-checks/is-string';
|
|
14
|
-
import '@stryke/convert/to-array';
|
|
15
|
-
import '@stryke/fs/is-file';
|
|
16
|
-
import '@stryke/fs/list-files';
|
|
17
|
-
import '@stryke/hash/murmurhash';
|
|
18
|
-
import '@stryke/helpers/get-unique';
|
|
19
|
-
import '@stryke/path/append';
|
|
20
|
-
|
|
21
|
-
// ../powerlines/src/lib/build/esbuild.ts
|
|
22
|
-
var DEFAULT_ESBUILD_CONFIG = {
|
|
23
|
-
target: "esnext",
|
|
24
|
-
platform: "neutral",
|
|
25
|
-
format: "esm",
|
|
26
|
-
write: true,
|
|
27
|
-
minify: true,
|
|
28
|
-
sourcemap: false,
|
|
29
|
-
bundle: true,
|
|
30
|
-
treeShaking: true,
|
|
31
|
-
keepNames: true,
|
|
32
|
-
splitting: true,
|
|
33
|
-
logLevel: "silent"
|
|
34
|
-
};
|
|
35
|
-
function extractESBuildConfig(context) {
|
|
36
|
-
const inject = context.config.build.override.inject ?? context.config.build.inject;
|
|
37
|
-
if (inject && Object.keys(inject).length > 0) {
|
|
38
|
-
context.fs.writeSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
|
|
39
|
-
if (value) {
|
|
40
|
-
if (Array.isArray(value)) {
|
|
41
|
-
if (camelCase(key) !== key) {
|
|
42
|
-
if (value.length === 1) {
|
|
43
|
-
return `
|
|
44
|
-
import ${camelCase(key)} from "${value[0]}";
|
|
45
|
-
export { ${camelCase(key)} as "${key}" }`;
|
|
46
|
-
} else if (value.length > 1) {
|
|
47
|
-
return `
|
|
48
|
-
import ${value[1] === "*" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from "${value[0]}";
|
|
49
|
-
export { ${camelCase(key)} as "${key}" }`;
|
|
50
|
-
}
|
|
51
|
-
} else if (value.length === 1) {
|
|
52
|
-
return `
|
|
53
|
-
import ${key} from "${value[0]}";
|
|
54
|
-
export { ${key} };`;
|
|
55
|
-
} else if (value.length > 1) {
|
|
56
|
-
return `
|
|
57
|
-
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
58
|
-
export { ${key} };`;
|
|
59
|
-
}
|
|
60
|
-
} else if (camelCase(key) !== key) {
|
|
61
|
-
return `
|
|
62
|
-
import ${camelCase(key)} from "${value[0]}";
|
|
63
|
-
export { ${camelCase(key)} as "${key}" }`;
|
|
64
|
-
} else {
|
|
65
|
-
return `
|
|
66
|
-
import ${key} from "${value}";
|
|
67
|
-
export { ${key} };`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return "";
|
|
71
|
-
}).join("\n"));
|
|
72
|
-
}
|
|
73
|
-
return defu({
|
|
74
|
-
alias: context.builtins.reduce((ret, id) => {
|
|
75
|
-
if (!ret[id]) {
|
|
76
|
-
const path = context.fs.ids[id];
|
|
77
|
-
if (path) {
|
|
78
|
-
ret[id] = path;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return ret;
|
|
82
|
-
}, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce((ret, alias) => {
|
|
83
|
-
if (!ret[alias.find.toString()]) {
|
|
84
|
-
ret[alias.find.toString()] = alias.replacement;
|
|
85
|
-
}
|
|
86
|
-
return ret;
|
|
87
|
-
}, {}) : context.config.build.alias : {}),
|
|
88
|
-
inject: inject && Object.keys(inject).length > 0 ? [
|
|
89
|
-
joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")
|
|
90
|
-
] : void 0
|
|
91
|
-
}, context.config.build.variant === "esbuild" ? omit(context.config.build.override, [
|
|
92
|
-
"alias",
|
|
93
|
-
"inject",
|
|
94
|
-
"external",
|
|
95
|
-
"noExternal",
|
|
96
|
-
"skipNodeModulesBundle",
|
|
97
|
-
"extensions"
|
|
98
|
-
]) : {}, context.config.build.variant === "esbuild" ? omit(context.config.build, [
|
|
99
|
-
"alias",
|
|
100
|
-
"inject",
|
|
101
|
-
"external",
|
|
102
|
-
"noExternal",
|
|
103
|
-
"skipNodeModulesBundle",
|
|
104
|
-
"extensions",
|
|
105
|
-
"variant",
|
|
106
|
-
"override"
|
|
107
|
-
]) : {}, {
|
|
108
|
-
mainFields: context.config.build.mainFields,
|
|
109
|
-
conditions: context.config.build.conditions,
|
|
110
|
-
define: context.config.build.define,
|
|
111
|
-
resolveExtensions: context.config.build.extensions,
|
|
112
|
-
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
113
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
114
|
-
platform: context.config.build.platform,
|
|
115
|
-
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
116
|
-
outdir: context.config.output.buildPath,
|
|
117
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
118
|
-
minify: context.config.mode !== "development",
|
|
119
|
-
metafile: context.config.mode === "development",
|
|
120
|
-
sourcemap: context.config.mode === "development"
|
|
121
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
122
|
-
}
|
|
123
|
-
__name(extractESBuildConfig, "extractESBuildConfig");
|
|
124
|
-
|
|
125
|
-
// ../powerlines/src/lib/utilities/bundle.ts
|
|
126
|
-
async function bundle(context, file, overrides = {}) {
|
|
127
|
-
const path = await context.fs.resolve(file);
|
|
128
|
-
if (!path || !context.fs.existsSync(path)) {
|
|
129
|
-
throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
130
|
-
}
|
|
131
|
-
const result = await build({
|
|
132
|
-
...extractESBuildConfig(context),
|
|
133
|
-
entryPoints: [
|
|
134
|
-
path
|
|
135
|
-
],
|
|
136
|
-
write: false,
|
|
137
|
-
sourcemap: false,
|
|
138
|
-
splitting: false,
|
|
139
|
-
treeShaking: false,
|
|
140
|
-
bundle: true,
|
|
141
|
-
...overrides
|
|
142
|
-
});
|
|
143
|
-
if (result.errors.length > 0) {
|
|
144
|
-
throw new Error(`Failed to transpile ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
|
|
145
|
-
}
|
|
146
|
-
if (result.warnings.length > 0) {
|
|
147
|
-
context.log(LogLevelLabel.WARN, `Warnings while transpiling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
|
|
148
|
-
}
|
|
149
|
-
if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {
|
|
150
|
-
throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
|
|
151
|
-
}
|
|
152
|
-
return result.outputFiles.filter(Boolean)[0];
|
|
153
|
-
}
|
|
154
|
-
__name(bundle, "bundle");
|
|
155
|
-
|
|
156
|
-
// ../powerlines/src/lib/utilities/resolve.ts
|
|
157
|
-
async function resolve(context, type, overrides = {}) {
|
|
158
|
-
let typeDefinition;
|
|
159
|
-
if (isSetString(type)) {
|
|
160
|
-
typeDefinition = parseTypeDefinition(type);
|
|
161
|
-
} else {
|
|
162
|
-
typeDefinition = type;
|
|
163
|
-
}
|
|
164
|
-
const result = await bundle(context, typeDefinition.file, overrides);
|
|
165
|
-
const resolved = await context.resolver.evalModule(result.text, {
|
|
166
|
-
filename: result.path,
|
|
167
|
-
forceTranspile: true
|
|
168
|
-
});
|
|
169
|
-
let exportName = typeDefinition.name;
|
|
170
|
-
if (!exportName) {
|
|
171
|
-
exportName = "default";
|
|
172
|
-
}
|
|
173
|
-
return resolved[exportName] ?? resolved[`__\u03A9${exportName}`];
|
|
174
|
-
}
|
|
175
|
-
__name(resolve, "resolve");
|
|
176
|
-
|
|
177
|
-
// src/reflect-type.ts
|
|
178
|
-
async function reflectType(context, type, overrides = {}) {
|
|
179
|
-
return reflect(await resolve(context, type, defu(overrides, {
|
|
180
|
-
plugins: [
|
|
181
|
-
esbuildPlugin(context)
|
|
182
|
-
]
|
|
183
|
-
})));
|
|
184
|
-
}
|
|
185
|
-
__name(reflectType, "reflectType");
|
|
186
|
-
|
|
187
|
-
export { reflectType };
|
package/dist/chunk-3GQAWCBQ.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
-
}) : x)(function(x) {
|
|
6
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export { __name, __require };
|
package/dist/chunk-3GRTJOID.cjs
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk4UQ4UDET_cjs = require('./chunk-4UQ4UDET.cjs');
|
|
4
|
-
var chunk3PKIT7K2_cjs = require('./chunk-3PKIT7K2.cjs');
|
|
5
|
-
var chunkBGYQAVKQ_cjs = require('./chunk-BGYQAVKQ.cjs');
|
|
6
|
-
var defu = require('defu');
|
|
7
|
-
var parseTypeDefinition = require('@stryke/convert/parse-type-definition');
|
|
8
|
-
var isSetString = require('@stryke/type-checks/is-set-string');
|
|
9
|
-
var types = require('@storm-software/config-tools/types');
|
|
10
|
-
var esbuild = require('esbuild');
|
|
11
|
-
var omit = require('@stryke/helpers/omit');
|
|
12
|
-
var joinPaths = require('@stryke/path/join-paths');
|
|
13
|
-
require('@stryke/path/replace');
|
|
14
|
-
var camelCase = require('@stryke/string-format/camel-case');
|
|
15
|
-
require('@stryke/type-checks/is-string');
|
|
16
|
-
require('@stryke/convert/to-array');
|
|
17
|
-
require('@stryke/fs/is-file');
|
|
18
|
-
require('@stryke/fs/list-files');
|
|
19
|
-
require('@stryke/hash/murmurhash');
|
|
20
|
-
require('@stryke/helpers/get-unique');
|
|
21
|
-
require('@stryke/path/append');
|
|
22
|
-
|
|
23
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
-
|
|
25
|
-
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
26
|
-
|
|
27
|
-
// ../powerlines/src/lib/build/esbuild.ts
|
|
28
|
-
var DEFAULT_ESBUILD_CONFIG = {
|
|
29
|
-
target: "esnext",
|
|
30
|
-
platform: "neutral",
|
|
31
|
-
format: "esm",
|
|
32
|
-
write: true,
|
|
33
|
-
minify: true,
|
|
34
|
-
sourcemap: false,
|
|
35
|
-
bundle: true,
|
|
36
|
-
treeShaking: true,
|
|
37
|
-
keepNames: true,
|
|
38
|
-
splitting: true,
|
|
39
|
-
logLevel: "silent"
|
|
40
|
-
};
|
|
41
|
-
function extractESBuildConfig(context) {
|
|
42
|
-
const inject = context.config.build.override.inject ?? context.config.build.inject;
|
|
43
|
-
if (inject && Object.keys(inject).length > 0) {
|
|
44
|
-
context.fs.writeSync(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
|
|
45
|
-
if (value) {
|
|
46
|
-
if (Array.isArray(value)) {
|
|
47
|
-
if (camelCase.camelCase(key) !== key) {
|
|
48
|
-
if (value.length === 1) {
|
|
49
|
-
return `
|
|
50
|
-
import ${camelCase.camelCase(key)} from "${value[0]}";
|
|
51
|
-
export { ${camelCase.camelCase(key)} as "${key}" }`;
|
|
52
|
-
} else if (value.length > 1) {
|
|
53
|
-
return `
|
|
54
|
-
import ${value[1] === "*" ? `* as ${camelCase.camelCase(key)}` : `{ ${value[1]} as ${camelCase.camelCase(key)} }`} from "${value[0]}";
|
|
55
|
-
export { ${camelCase.camelCase(key)} as "${key}" }`;
|
|
56
|
-
}
|
|
57
|
-
} else if (value.length === 1) {
|
|
58
|
-
return `
|
|
59
|
-
import ${key} from "${value[0]}";
|
|
60
|
-
export { ${key} };`;
|
|
61
|
-
} else if (value.length > 1) {
|
|
62
|
-
return `
|
|
63
|
-
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
64
|
-
export { ${key} };`;
|
|
65
|
-
}
|
|
66
|
-
} else if (camelCase.camelCase(key) !== key) {
|
|
67
|
-
return `
|
|
68
|
-
import ${camelCase.camelCase(key)} from "${value[0]}";
|
|
69
|
-
export { ${camelCase.camelCase(key)} as "${key}" }`;
|
|
70
|
-
} else {
|
|
71
|
-
return `
|
|
72
|
-
import ${key} from "${value}";
|
|
73
|
-
export { ${key} };`;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return "";
|
|
77
|
-
}).join("\n"));
|
|
78
|
-
}
|
|
79
|
-
return defu__default.default({
|
|
80
|
-
alias: context.builtins.reduce((ret, id) => {
|
|
81
|
-
if (!ret[id]) {
|
|
82
|
-
const path = context.fs.ids[id];
|
|
83
|
-
if (path) {
|
|
84
|
-
ret[id] = path;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return ret;
|
|
88
|
-
}, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce((ret, alias) => {
|
|
89
|
-
if (!ret[alias.find.toString()]) {
|
|
90
|
-
ret[alias.find.toString()] = alias.replacement;
|
|
91
|
-
}
|
|
92
|
-
return ret;
|
|
93
|
-
}, {}) : context.config.build.alias : {}),
|
|
94
|
-
inject: inject && Object.keys(inject).length > 0 ? [
|
|
95
|
-
joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")
|
|
96
|
-
] : void 0
|
|
97
|
-
}, context.config.build.variant === "esbuild" ? omit.omit(context.config.build.override, [
|
|
98
|
-
"alias",
|
|
99
|
-
"inject",
|
|
100
|
-
"external",
|
|
101
|
-
"noExternal",
|
|
102
|
-
"skipNodeModulesBundle",
|
|
103
|
-
"extensions"
|
|
104
|
-
]) : {}, context.config.build.variant === "esbuild" ? omit.omit(context.config.build, [
|
|
105
|
-
"alias",
|
|
106
|
-
"inject",
|
|
107
|
-
"external",
|
|
108
|
-
"noExternal",
|
|
109
|
-
"skipNodeModulesBundle",
|
|
110
|
-
"extensions",
|
|
111
|
-
"variant",
|
|
112
|
-
"override"
|
|
113
|
-
]) : {}, {
|
|
114
|
-
mainFields: context.config.build.mainFields,
|
|
115
|
-
conditions: context.config.build.conditions,
|
|
116
|
-
define: context.config.build.define,
|
|
117
|
-
resolveExtensions: context.config.build.extensions,
|
|
118
|
-
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
119
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
120
|
-
platform: context.config.build.platform,
|
|
121
|
-
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
122
|
-
outdir: context.config.output.buildPath,
|
|
123
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
124
|
-
minify: context.config.mode !== "development",
|
|
125
|
-
metafile: context.config.mode === "development",
|
|
126
|
-
sourcemap: context.config.mode === "development"
|
|
127
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
128
|
-
}
|
|
129
|
-
chunkBGYQAVKQ_cjs.__name(extractESBuildConfig, "extractESBuildConfig");
|
|
130
|
-
|
|
131
|
-
// ../powerlines/src/lib/utilities/bundle.ts
|
|
132
|
-
async function bundle(context, file, overrides = {}) {
|
|
133
|
-
const path = await context.fs.resolve(file);
|
|
134
|
-
if (!path || !context.fs.existsSync(path)) {
|
|
135
|
-
throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
136
|
-
}
|
|
137
|
-
const result = await esbuild.build({
|
|
138
|
-
...extractESBuildConfig(context),
|
|
139
|
-
entryPoints: [
|
|
140
|
-
path
|
|
141
|
-
],
|
|
142
|
-
write: false,
|
|
143
|
-
sourcemap: false,
|
|
144
|
-
splitting: false,
|
|
145
|
-
treeShaking: false,
|
|
146
|
-
bundle: true,
|
|
147
|
-
...overrides
|
|
148
|
-
});
|
|
149
|
-
if (result.errors.length > 0) {
|
|
150
|
-
throw new Error(`Failed to transpile ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
|
|
151
|
-
}
|
|
152
|
-
if (result.warnings.length > 0) {
|
|
153
|
-
context.log(types.LogLevelLabel.WARN, `Warnings while transpiling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
|
|
154
|
-
}
|
|
155
|
-
if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {
|
|
156
|
-
throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
|
|
157
|
-
}
|
|
158
|
-
return result.outputFiles.filter(Boolean)[0];
|
|
159
|
-
}
|
|
160
|
-
chunkBGYQAVKQ_cjs.__name(bundle, "bundle");
|
|
161
|
-
|
|
162
|
-
// ../powerlines/src/lib/utilities/resolve.ts
|
|
163
|
-
async function resolve(context, type, overrides = {}) {
|
|
164
|
-
let typeDefinition;
|
|
165
|
-
if (isSetString.isSetString(type)) {
|
|
166
|
-
typeDefinition = parseTypeDefinition.parseTypeDefinition(type);
|
|
167
|
-
} else {
|
|
168
|
-
typeDefinition = type;
|
|
169
|
-
}
|
|
170
|
-
const result = await bundle(context, typeDefinition.file, overrides);
|
|
171
|
-
const resolved = await context.resolver.evalModule(result.text, {
|
|
172
|
-
filename: result.path,
|
|
173
|
-
forceTranspile: true
|
|
174
|
-
});
|
|
175
|
-
let exportName = typeDefinition.name;
|
|
176
|
-
if (!exportName) {
|
|
177
|
-
exportName = "default";
|
|
178
|
-
}
|
|
179
|
-
return resolved[exportName] ?? resolved[`__\u03A9${exportName}`];
|
|
180
|
-
}
|
|
181
|
-
chunkBGYQAVKQ_cjs.__name(resolve, "resolve");
|
|
182
|
-
|
|
183
|
-
// src/reflect-type.ts
|
|
184
|
-
async function reflectType(context, type, overrides = {}) {
|
|
185
|
-
return chunk4UQ4UDET_cjs.reflect(await resolve(context, type, defu__default.default(overrides, {
|
|
186
|
-
plugins: [
|
|
187
|
-
chunk3PKIT7K2_cjs.esbuildPlugin(context)
|
|
188
|
-
]
|
|
189
|
-
})));
|
|
190
|
-
}
|
|
191
|
-
chunkBGYQAVKQ_cjs.__name(reflectType, "reflectType");
|
|
192
|
-
|
|
193
|
-
exports.reflectType = reflectType;
|