@zyno-io/ts-reflection 26.803.2224
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/README.md +13 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +966 -0
- package/dist/reflection/annotations.d.ts +15 -0
- package/dist/reflection/annotations.d.ts.map +1 -0
- package/dist/reflection/compact-metadata.d.ts +18 -0
- package/dist/reflection/compact-metadata.d.ts.map +1 -0
- package/dist/reflection/conversion.d.ts +15 -0
- package/dist/reflection/conversion.d.ts.map +1 -0
- package/dist/reflection/deserializer.d.ts +15 -0
- package/dist/reflection/deserializer.d.ts.map +1 -0
- package/dist/reflection/errors.d.ts +8 -0
- package/dist/reflection/errors.d.ts.map +1 -0
- package/dist/reflection/index.d.ts +10 -0
- package/dist/reflection/index.d.ts.map +1 -0
- package/dist/reflection/metadata-store.d.ts +20 -0
- package/dist/reflection/metadata-store.d.ts.map +1 -0
- package/dist/reflection/model.d.ts +273 -0
- package/dist/reflection/model.d.ts.map +1 -0
- package/dist/reflection/primitive-conversion.d.ts +2 -0
- package/dist/reflection/primitive-conversion.d.ts.map +1 -0
- package/dist/reflection/reflection-class.d.ts +60 -0
- package/dist/reflection/reflection-class.d.ts.map +1 -0
- package/dist/reflection/type-utils.d.ts +34 -0
- package/dist/reflection/type-utils.d.ts.map +1 -0
- package/dist/type-compiler/download-prebuilt.cjs +114 -0
- package/dist/type-compiler/go/ast_expression.go +187 -0
- package/dist/type-compiler/go/ast_metadata.go +388 -0
- package/dist/type-compiler/go/collect.go +963 -0
- package/dist/type-compiler/go/compact_metadata.go +553 -0
- package/dist/type-compiler/go/emission_plan.go +340 -0
- package/dist/type-compiler/go/emit_ast.go +557 -0
- package/dist/type-compiler/go/emit_ast_test.go +558 -0
- package/dist/type-compiler/go/go.mod +10 -0
- package/dist/type-compiler/go/plugin.go +359 -0
- package/dist/type-compiler/go/plugin_test.go +1206 -0
- package/dist/type-compiler/go/precompute.go +86 -0
- package/dist/type-compiler/go/receive_type.go +912 -0
- package/dist/type-compiler/go/resolve.go +265 -0
- package/dist/type-compiler/go/source_scan.go +51 -0
- package/dist/type-compiler/go/text_parse.go +734 -0
- package/dist/type-compiler/go/type_expr.go +1291 -0
- package/dist/type-compiler/go/typia_expr.go +2316 -0
- package/dist/type-compiler/index.cjs +43 -0
- package/dist/type-compiler/pnp.cjs +474 -0
- package/dist/type-compiler/prebuilt.cjs +324 -0
- package/dist/type-metadata-runtime.cjs +1 -0
- package/dist/type-metadata-runtime.d.ts +2 -0
- package/dist/type-metadata-runtime.d.ts.map +1 -0
- package/dist/type-metadata-runtime.js +107 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/primitives.d.ts +33 -0
- package/dist/types/primitives.d.ts.map +1 -0
- package/dist/types/runtime.d.ts +2 -0
- package/dist/types/runtime.d.ts.map +1 -0
- package/dist/types/type-annotations.d.ts +28 -0
- package/dist/types/type-annotations.d.ts.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* oxlint-disable typescript/no-require-imports -- this file ships with the CommonJS plugin descriptor. */
|
|
3
|
+
|
|
4
|
+
const crypto = require('node:crypto');
|
|
5
|
+
const fs = require('node:fs');
|
|
6
|
+
const { createRequire } = require('node:module');
|
|
7
|
+
const path = require('node:path');
|
|
8
|
+
const { spawnSync } = require('node:child_process');
|
|
9
|
+
|
|
10
|
+
const DEFAULT_RELEASE_BASE_URL = 'https://github.com/zyno-io/ts-server-foundation/releases/download';
|
|
11
|
+
const DEFAULT_DOWNLOAD_TIMEOUT_MS = 20_000;
|
|
12
|
+
const PREBUILT_MISS_TTL_MS = 10 * 60 * 1000;
|
|
13
|
+
const PREBUILT_SCHEMA_VERSION = 1;
|
|
14
|
+
const attemptedCacheKeys = new Set();
|
|
15
|
+
const customGoEnvironmentKeys = [
|
|
16
|
+
'GOOS',
|
|
17
|
+
'GOARCH',
|
|
18
|
+
'GOAMD64',
|
|
19
|
+
'GOARM',
|
|
20
|
+
'GOARM64',
|
|
21
|
+
'GO386',
|
|
22
|
+
'GOMIPS',
|
|
23
|
+
'GOMIPS64',
|
|
24
|
+
'GOPPC64',
|
|
25
|
+
'GORISCV64',
|
|
26
|
+
'GOWASM',
|
|
27
|
+
'GOFLAGS',
|
|
28
|
+
'GOEXPERIMENT',
|
|
29
|
+
'GOFIPS140',
|
|
30
|
+
'GO_EXTLINK_ENABLED',
|
|
31
|
+
'GCCGO',
|
|
32
|
+
'GCCGOTOOLDIR',
|
|
33
|
+
'CGO_ENABLED',
|
|
34
|
+
'AR',
|
|
35
|
+
'CC',
|
|
36
|
+
'CXX',
|
|
37
|
+
'FC',
|
|
38
|
+
'PKG_CONFIG',
|
|
39
|
+
'CGO_CFLAGS',
|
|
40
|
+
'CGO_CFLAGS_ALLOW',
|
|
41
|
+
'CGO_CFLAGS_DISALLOW',
|
|
42
|
+
'CGO_CPPFLAGS',
|
|
43
|
+
'CGO_CPPFLAGS_ALLOW',
|
|
44
|
+
'CGO_CPPFLAGS_DISALLOW',
|
|
45
|
+
'CGO_CXXFLAGS',
|
|
46
|
+
'CGO_CXXFLAGS_ALLOW',
|
|
47
|
+
'CGO_CXXFLAGS_DISALLOW',
|
|
48
|
+
'CGO_FFLAGS',
|
|
49
|
+
'CGO_FFLAGS_ALLOW',
|
|
50
|
+
'CGO_FFLAGS_DISALLOW',
|
|
51
|
+
'CGO_LDFLAGS',
|
|
52
|
+
'CGO_LDFLAGS_ALLOW',
|
|
53
|
+
'CGO_LDFLAGS_DISALLOW',
|
|
54
|
+
'GOTOOLCHAIN',
|
|
55
|
+
'GOROOT',
|
|
56
|
+
'CPATH',
|
|
57
|
+
'C_INCLUDE_PATH',
|
|
58
|
+
'CPLUS_INCLUDE_PATH',
|
|
59
|
+
'DYLD_LIBRARY_PATH',
|
|
60
|
+
'INCLUDE',
|
|
61
|
+
'LD_LIBRARY_PATH',
|
|
62
|
+
'LIB',
|
|
63
|
+
'LIBRARY_PATH',
|
|
64
|
+
'LIBPATH',
|
|
65
|
+
'MACOSX_DEPLOYMENT_TARGET',
|
|
66
|
+
'OBJC_INCLUDE_PATH',
|
|
67
|
+
'PKG_CONFIG_ALLOW_SYSTEM_CFLAGS',
|
|
68
|
+
'PKG_CONFIG_ALLOW_SYSTEM_LIBS',
|
|
69
|
+
'PKG_CONFIG_LIBDIR',
|
|
70
|
+
'PKG_CONFIG_PATH',
|
|
71
|
+
'PKG_CONFIG_SYSROOT_DIR',
|
|
72
|
+
'PKG_CONFIG_TOP_BUILD_DIR',
|
|
73
|
+
'SDKROOT'
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
function tryInstallPrebuiltTypeCompiler(context, source) {
|
|
77
|
+
try {
|
|
78
|
+
if (!prebuiltDownloadsEnabled() || !context?.projectRoot || hasCustomGoBuildEnvironment()) return false;
|
|
79
|
+
|
|
80
|
+
const packageRoot = findReflectionPackageRoot(context.dirname);
|
|
81
|
+
const packageVersion = readJson(path.join(packageRoot, 'package.json')).version;
|
|
82
|
+
if (!isPublishedReleaseVersion(packageVersion)) return false;
|
|
83
|
+
|
|
84
|
+
const build = resolveTtscBuild(context.projectRoot, source);
|
|
85
|
+
const target = `${process.platform}-${process.arch}`;
|
|
86
|
+
const destination = path.join(build.cachePaths.pluginRoot, build.cacheKey, process.platform === 'win32' ? 'plugin.exe' : 'plugin');
|
|
87
|
+
if (fs.existsSync(destination)) return true;
|
|
88
|
+
|
|
89
|
+
const attemptKey = `${packageVersion}:${target}:${build.cacheKey}`;
|
|
90
|
+
if (attemptedCacheKeys.has(attemptKey)) return false;
|
|
91
|
+
attemptedCacheKeys.add(attemptKey);
|
|
92
|
+
|
|
93
|
+
const missMarker = path.join(build.cachePaths.root, 'prebuilt-misses', crypto.createHash('sha256').update(attemptKey).digest('hex'));
|
|
94
|
+
if (isFreshMissMarker(missMarker)) return false;
|
|
95
|
+
|
|
96
|
+
const assets = prebuiltAssetNames(target);
|
|
97
|
+
const releaseBaseUrl = (process.env.TSF_TYPE_COMPILER_PREBUILT_BASE_URL ?? DEFAULT_RELEASE_BASE_URL).replace(/\/+$/, '');
|
|
98
|
+
const releaseUrl = `${releaseBaseUrl}/${encodeURIComponent(`v${packageVersion}`)}`;
|
|
99
|
+
const timeout = resolveDownloadTimeout();
|
|
100
|
+
const result = spawnSync(process.execPath, [path.join(__dirname, 'download-prebuilt.cjs')], {
|
|
101
|
+
encoding: 'utf8',
|
|
102
|
+
input: JSON.stringify({
|
|
103
|
+
allowHttp: process.env.TSF_TYPE_COMPILER_PREBUILT_ALLOW_HTTP === '1',
|
|
104
|
+
binaryUrl: `${releaseUrl}/${encodeURIComponent(assets.binary)}`,
|
|
105
|
+
destination,
|
|
106
|
+
expected: {
|
|
107
|
+
binaryAsset: assets.binary,
|
|
108
|
+
packageVersion,
|
|
109
|
+
platform: process.platform,
|
|
110
|
+
arch: process.arch,
|
|
111
|
+
pluginSourceSha256: hashPluginSource(source),
|
|
112
|
+
schemaVersion: PREBUILT_SCHEMA_VERSION,
|
|
113
|
+
ttscVersion: build.ttscVersion,
|
|
114
|
+
typescriptVersion: build.typescriptVersion
|
|
115
|
+
},
|
|
116
|
+
manifestUrl: `${releaseUrl}/${encodeURIComponent(assets.manifest)}`,
|
|
117
|
+
requestTimeoutMs: Math.min(timeout, 15_000)
|
|
118
|
+
}),
|
|
119
|
+
timeout,
|
|
120
|
+
windowsHide: true
|
|
121
|
+
});
|
|
122
|
+
if (result.status === 0 && fs.existsSync(destination)) {
|
|
123
|
+
fs.rmSync(missMarker, { force: true });
|
|
124
|
+
debug(`installed ${target} prebuilt compiler in ${destination}`);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
recordMiss(missMarker, result.error?.message ?? result.stderr ?? result.stdout ?? `exit ${result.status}`);
|
|
129
|
+
return false;
|
|
130
|
+
} catch (error) {
|
|
131
|
+
debug(`prebuilt compiler unavailable: ${error instanceof Error ? error.message : String(error)}`);
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function resolveTtscBuild(projectRoot, source) {
|
|
137
|
+
const projectRequire = createRequire(path.join(projectRoot, 'package.json'));
|
|
138
|
+
const ttscPackageJson = projectRequire.resolve('ttsc/package.json');
|
|
139
|
+
const ttscRoot = path.dirname(ttscPackageJson);
|
|
140
|
+
const internalsPath = path.join(ttscRoot, 'lib', 'plugin', 'internal', 'buildSourcePlugin.js');
|
|
141
|
+
const internals = require(internalsPath);
|
|
142
|
+
if (typeof internals.computeCacheKey !== 'function' || typeof internals.resolveSourceBuildCachePaths !== 'function') {
|
|
143
|
+
throw new Error('installed ttsc does not expose compatible cache helpers');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const { ttscVersion, typescriptVersion } = resolveToolchainVersions(projectRoot);
|
|
147
|
+
const goBinary = resolveGoBinary(ttscRoot, internalsPath);
|
|
148
|
+
const cacheKey = internals.computeCacheKey({
|
|
149
|
+
dir: source,
|
|
150
|
+
entry: '.',
|
|
151
|
+
goBinary,
|
|
152
|
+
overlayDirs: findTtscOverlayDirs(ttscRoot),
|
|
153
|
+
ttscVersion,
|
|
154
|
+
tsgoVersion: typescriptVersion
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
cacheKey,
|
|
158
|
+
cachePaths: internals.resolveSourceBuildCachePaths(projectRoot),
|
|
159
|
+
ttscVersion,
|
|
160
|
+
typescriptVersion
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Resolves the *installed* toolchain versions, never the package.json dependency
|
|
166
|
+
* ranges. Prebuilt manifests are validated against these exact versions, so the
|
|
167
|
+
* release builder and the consumer-side check must both read them from here.
|
|
168
|
+
*/
|
|
169
|
+
function resolveToolchainVersions(projectRoot) {
|
|
170
|
+
const projectRequire = createRequire(path.join(projectRoot, 'package.json'));
|
|
171
|
+
return {
|
|
172
|
+
ttscVersion: readJson(projectRequire.resolve('ttsc/package.json')).version,
|
|
173
|
+
typescriptVersion: readJson(projectRequire.resolve('typescript/package.json')).version
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function resolveGoBinary(ttscRoot, internalsPath) {
|
|
178
|
+
if (process.env.TTSC_GO_BINARY) return process.env.TTSC_GO_BINARY;
|
|
179
|
+
const executable = process.platform === 'win32' ? 'go.exe' : 'go';
|
|
180
|
+
try {
|
|
181
|
+
return createRequire(internalsPath).resolve(`@ttsc/${process.platform}-${process.arch}/bin/go/bin/${executable}`);
|
|
182
|
+
} catch {
|
|
183
|
+
const platformPackage = path.resolve(ttscRoot, '..', `ttsc-${process.platform}-${process.arch}`, 'bin', 'go', 'bin', executable);
|
|
184
|
+
if (fs.existsSync(platformPackage)) return platformPackage;
|
|
185
|
+
const local = path.resolve(ttscRoot, '..', 'native', 'go', 'bin', executable);
|
|
186
|
+
if (fs.existsSync(local)) return local;
|
|
187
|
+
const homeSdk = path.join(process.env.HOME ?? '', 'go-sdk', 'go', 'bin', executable);
|
|
188
|
+
if (fs.existsSync(homeSdk)) return homeSdk;
|
|
189
|
+
return 'go';
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function findTtscOverlayDirs(ttscRoot) {
|
|
194
|
+
const directories = [];
|
|
195
|
+
if (fs.existsSync(path.join(ttscRoot, 'go.mod'))) directories.push(ttscRoot);
|
|
196
|
+
collectGoModules(path.join(ttscRoot, 'shim'), directories);
|
|
197
|
+
return directories.sort();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function collectGoModules(directory, output) {
|
|
201
|
+
if (!fs.existsSync(directory)) return;
|
|
202
|
+
const entries = fs.readdirSync(directory, { withFileTypes: true });
|
|
203
|
+
if (entries.some(entry => entry.isFile() && entry.name === 'go.mod')) output.push(directory);
|
|
204
|
+
for (const entry of entries) {
|
|
205
|
+
if (!entry.isDirectory() || ['.git', '.ttsc', 'node_modules'].includes(entry.name)) continue;
|
|
206
|
+
collectGoModules(path.join(directory, entry.name), output);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function hashPluginSource(root) {
|
|
211
|
+
const hash = crypto.createHash('sha256');
|
|
212
|
+
for (const file of collectSourceFiles(root)) {
|
|
213
|
+
hash.update(`f=${path.relative(root, file).replaceAll(path.sep, '/')}\n`);
|
|
214
|
+
hash.update(fs.readFileSync(file));
|
|
215
|
+
hash.update('\n');
|
|
216
|
+
}
|
|
217
|
+
return hash.digest('hex');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function collectSourceFiles(root) {
|
|
221
|
+
const output = [];
|
|
222
|
+
const walk = directory => {
|
|
223
|
+
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
|
|
224
|
+
if (entry.isDirectory() && ['.git', '.ttsc', 'node_modules'].includes(entry.name)) continue;
|
|
225
|
+
const file = path.join(directory, entry.name);
|
|
226
|
+
if (entry.isDirectory()) walk(file);
|
|
227
|
+
else if (entry.isFile() && !shouldOmitSourceFile(entry.name)) output.push(file);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
walk(root);
|
|
231
|
+
return output.sort();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function shouldOmitSourceFile(name) {
|
|
235
|
+
return (
|
|
236
|
+
name === 'go.work' ||
|
|
237
|
+
name === 'go.work.sum' ||
|
|
238
|
+
name === '.complete' ||
|
|
239
|
+
name.endsWith('~') ||
|
|
240
|
+
name.endsWith('.tgz') ||
|
|
241
|
+
name.endsWith('.tar.gz') ||
|
|
242
|
+
name === '.DS_Store' ||
|
|
243
|
+
name === 'Thumbs.db'
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function prebuiltAssetNames(target) {
|
|
248
|
+
const base = `tsf-type-compiler-${target}`;
|
|
249
|
+
return {
|
|
250
|
+
binary: target.startsWith('win32-') ? `${base}.exe` : base,
|
|
251
|
+
manifest: `${base}.json`
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function findReflectionPackageRoot(start) {
|
|
256
|
+
let directory = path.resolve(start);
|
|
257
|
+
for (;;) {
|
|
258
|
+
const packageJson = path.join(directory, 'package.json');
|
|
259
|
+
if (fs.existsSync(packageJson)) {
|
|
260
|
+
const pkg = readJson(packageJson);
|
|
261
|
+
if (pkg.name === '@zyno-io/ts-reflection') return directory;
|
|
262
|
+
}
|
|
263
|
+
const parent = path.dirname(directory);
|
|
264
|
+
if (parent === directory) throw new Error('could not locate the ts-reflection package root');
|
|
265
|
+
directory = parent;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function readJson(file) {
|
|
270
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function prebuiltDownloadsEnabled() {
|
|
274
|
+
return !['0', 'false', 'off'].includes((process.env.TSF_TYPE_COMPILER_PREBUILT ?? '').toLowerCase());
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function isPublishedReleaseVersion(version) {
|
|
278
|
+
return typeof version === 'string' && version !== '0.0.0-dev' && !version.includes('-canary.') && /^[0-9A-Za-z][0-9A-Za-z._-]*$/.test(version);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function hasCustomGoBuildEnvironment() {
|
|
282
|
+
if (process.env.TTSC_GO_BINARY) return true;
|
|
283
|
+
return customGoEnvironmentKeys.some(key => {
|
|
284
|
+
const value = process.env[key];
|
|
285
|
+
return value !== undefined && value !== '' && !(key === 'CGO_ENABLED' && value === '0');
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function resolveDownloadTimeout() {
|
|
290
|
+
const parsed = Number(process.env.TSF_TYPE_COMPILER_PREBUILT_TIMEOUT_MS ?? DEFAULT_DOWNLOAD_TIMEOUT_MS);
|
|
291
|
+
return Number.isFinite(parsed) ? Math.max(1000, Math.min(120_000, Math.floor(parsed))) : DEFAULT_DOWNLOAD_TIMEOUT_MS;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function isFreshMissMarker(file) {
|
|
295
|
+
try {
|
|
296
|
+
return Date.now() - fs.statSync(file).mtimeMs < PREBUILT_MISS_TTL_MS;
|
|
297
|
+
} catch {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function recordMiss(file, reason) {
|
|
303
|
+
try {
|
|
304
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
305
|
+
fs.writeFileSync(file, `${String(reason).trim().slice(0, 2000)}\n`);
|
|
306
|
+
} catch {
|
|
307
|
+
// A read-only cache must never prevent ttsc's source-build fallback.
|
|
308
|
+
}
|
|
309
|
+
debug(`prebuilt compiler unavailable: ${String(reason).trim()}`);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function debug(message) {
|
|
313
|
+
if (process.env.TSF_TYPE_COMPILER_PREBUILT_DEBUG === '1') process.stderr.write(`tsf type compiler: ${message}\n`);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
module.exports = {
|
|
317
|
+
PREBUILT_SCHEMA_VERSION,
|
|
318
|
+
hashPluginSource,
|
|
319
|
+
isPublishedReleaseVersion,
|
|
320
|
+
prebuiltAssetNames,
|
|
321
|
+
resolveToolchainVersions,
|
|
322
|
+
resolveTtscBuild,
|
|
323
|
+
tryInstallPrebuiltTypeCompiler
|
|
324
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=1,t=`$tsf`,n=`$tsfImport`,r=`$tsfAlias`,i=`$tsfType`;function a(e,t,n){return l(c(e),t,n)}function o(e,t){let n=c(e);if(!Array.isArray(n))throw Error(`Invalid TSF compact metadata registry`);let r=Array(n.length),i=new Uint8Array(n.length),a=e=>{if(!Number.isSafeInteger(e)||e<0||e>=n.length)throw Error(`Invalid TSF compact metadata type ${e}`);return i[e]||(i[e]=1,r[e]=n[e],r[e]=l(n[e],t,a)),r[e]};return a}function s(e,t,n,r){let[i,a,o]=r===void 0?[e,t,n]:[()=>e(t),n,r],s;try{let e=i();e&&typeof e==`object`&&(s=e)}catch{}let c=s?.__tsfTypeAliases?.[a];return c&&typeof c==`object`?{...c,typeName:o}:{kind:16,typeName:o,classType:()=>s?.[a]}}function c(t){let n=JSON.parse(t);if(!Array.isArray(n)||n.length!==2||n[0]!==e)throw Error(`Unsupported TSF compact metadata format`);return n[1]}function l(e,a,o){if(!e||typeof e!=`object`)return e;if(f(e))return u(a,e[t]);if(p(e)){let t=e[n],[r,i]=t.length===2?t:[t[0],t[2]],o=d(a,r,t.length===3?t[1]:void 0);return()=>o()?.[i]}if(m(e)){let t=e[r],[n,i,o]=t.length===3?t:[t[0],t[2],t[3]];return s(d(a,n,t.length===4?t[1]:void 0),i,o)}if(h(e)){if(!o)throw Error(`Missing TSF compact metadata type registry`);return o(e[i])}if(Array.isArray(e)){for(let t=0;t<e.length;t++)e[t]=l(e[t],a,o);return e}let c=e;for(let e of Object.keys(c))c[e]=l(c[e],a,o);return c}function u(e,t){if(t<0||t>=e.length)throw Error(`Invalid TSF compact metadata reference ${t}`);return e[t]}function d(e,t,n){let r=u(e,t);if(typeof r!=`function`)throw Error(`Invalid TSF compact metadata module loader ${t}`);return n===void 0?r:()=>{try{return r(n)}catch{return}}}function f(e){if(Array.isArray(e))return!1;let n=Object.keys(e);return n.length===1&&n[0]===t&&Number.isSafeInteger(e[t])}function p(e){if(Array.isArray(e))return!1;let t=Object.keys(e),r=e[n];return t.length===1&&t[0]===n&&Array.isArray(r)&&(r.length===2||r.length===3)&&Number.isSafeInteger(r[0])&&typeof r[1]==`string`&&(r.length===2||typeof r[2]==`string`)}function m(e){if(Array.isArray(e))return!1;let t=Object.keys(e),n=e[r];return t.length===1&&t[0]===r&&Array.isArray(n)&&(n.length===3||n.length===4)&&Number.isSafeInteger(n[0])&&typeof n[1]==`string`&&typeof n[2]==`string`&&(n.length===3||typeof n[3]==`string`)}function h(e){if(Array.isArray(e))return!1;let t=Object.keys(e);return t.length===1&&t[0]===i&&Number.isSafeInteger(e[i])}exports.createCompactMetadataRegistryV1=o,exports.decodeCompactMetadataV1=a,exports.resolveCompactMetadataAliasV1=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-metadata-runtime.d.ts","sourceRoot":"","sources":["../src/type-metadata-runtime.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
//#region src/reflection/compact-metadata.ts
|
|
2
|
+
var e = "$tsf", t = "$tsfImport", n = "$tsfAlias", r = "$tsfType";
|
|
3
|
+
function i(e, t, n) {
|
|
4
|
+
return c(s(e), t, n);
|
|
5
|
+
}
|
|
6
|
+
function a(e, t) {
|
|
7
|
+
let n = s(e);
|
|
8
|
+
if (!Array.isArray(n)) throw Error("Invalid TSF compact metadata registry");
|
|
9
|
+
let r = Array(n.length), i = new Uint8Array(n.length), a = (e) => {
|
|
10
|
+
if (!Number.isSafeInteger(e) || e < 0 || e >= n.length) throw Error(`Invalid TSF compact metadata type ${e}`);
|
|
11
|
+
return i[e] || (i[e] = 1, r[e] = n[e], r[e] = c(n[e], t, a)), r[e];
|
|
12
|
+
};
|
|
13
|
+
return a;
|
|
14
|
+
}
|
|
15
|
+
function o(e, t, n, r) {
|
|
16
|
+
let [i, a, o] = r === void 0 ? [
|
|
17
|
+
e,
|
|
18
|
+
t,
|
|
19
|
+
n
|
|
20
|
+
] : [
|
|
21
|
+
() => e(t),
|
|
22
|
+
n,
|
|
23
|
+
r
|
|
24
|
+
], s;
|
|
25
|
+
try {
|
|
26
|
+
let e = i();
|
|
27
|
+
e && typeof e == "object" && (s = e);
|
|
28
|
+
} catch {}
|
|
29
|
+
let c = s?.__tsfTypeAliases?.[a];
|
|
30
|
+
return c && typeof c == "object" ? {
|
|
31
|
+
...c,
|
|
32
|
+
typeName: o
|
|
33
|
+
} : {
|
|
34
|
+
kind: 16,
|
|
35
|
+
typeName: o,
|
|
36
|
+
classType: () => s?.[a]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function s(e) {
|
|
40
|
+
let t = JSON.parse(e);
|
|
41
|
+
if (!Array.isArray(t) || t.length !== 2 || t[0] !== 1) throw Error("Unsupported TSF compact metadata format");
|
|
42
|
+
return t[1];
|
|
43
|
+
}
|
|
44
|
+
function c(i, a, s) {
|
|
45
|
+
if (!i || typeof i != "object") return i;
|
|
46
|
+
if (d(i)) return l(a, i[e]);
|
|
47
|
+
if (f(i)) {
|
|
48
|
+
let e = i[t], [n, r] = e.length === 2 ? e : [e[0], e[2]], o = u(a, n, e.length === 3 ? e[1] : void 0);
|
|
49
|
+
return () => o()?.[r];
|
|
50
|
+
}
|
|
51
|
+
if (p(i)) {
|
|
52
|
+
let e = i[n], [t, r, s] = e.length === 3 ? e : [
|
|
53
|
+
e[0],
|
|
54
|
+
e[2],
|
|
55
|
+
e[3]
|
|
56
|
+
];
|
|
57
|
+
return o(u(a, t, e.length === 4 ? e[1] : void 0), r, s);
|
|
58
|
+
}
|
|
59
|
+
if (m(i)) {
|
|
60
|
+
if (!s) throw Error("Missing TSF compact metadata type registry");
|
|
61
|
+
return s(i[r]);
|
|
62
|
+
}
|
|
63
|
+
if (Array.isArray(i)) {
|
|
64
|
+
for (let e = 0; e < i.length; e++) i[e] = c(i[e], a, s);
|
|
65
|
+
return i;
|
|
66
|
+
}
|
|
67
|
+
let h = i;
|
|
68
|
+
for (let e of Object.keys(h)) h[e] = c(h[e], a, s);
|
|
69
|
+
return h;
|
|
70
|
+
}
|
|
71
|
+
function l(e, t) {
|
|
72
|
+
if (t < 0 || t >= e.length) throw Error(`Invalid TSF compact metadata reference ${t}`);
|
|
73
|
+
return e[t];
|
|
74
|
+
}
|
|
75
|
+
function u(e, t, n) {
|
|
76
|
+
let r = l(e, t);
|
|
77
|
+
if (typeof r != "function") throw Error(`Invalid TSF compact metadata module loader ${t}`);
|
|
78
|
+
return n === void 0 ? r : () => {
|
|
79
|
+
try {
|
|
80
|
+
return r(n);
|
|
81
|
+
} catch {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function d(t) {
|
|
87
|
+
if (Array.isArray(t)) return !1;
|
|
88
|
+
let n = Object.keys(t);
|
|
89
|
+
return n.length === 1 && n[0] === e && Number.isSafeInteger(t[e]);
|
|
90
|
+
}
|
|
91
|
+
function f(e) {
|
|
92
|
+
if (Array.isArray(e)) return !1;
|
|
93
|
+
let n = Object.keys(e), r = e[t];
|
|
94
|
+
return n.length === 1 && n[0] === t && Array.isArray(r) && (r.length === 2 || r.length === 3) && Number.isSafeInteger(r[0]) && typeof r[1] == "string" && (r.length === 2 || typeof r[2] == "string");
|
|
95
|
+
}
|
|
96
|
+
function p(e) {
|
|
97
|
+
if (Array.isArray(e)) return !1;
|
|
98
|
+
let t = Object.keys(e), r = e[n];
|
|
99
|
+
return t.length === 1 && t[0] === n && Array.isArray(r) && (r.length === 3 || r.length === 4) && Number.isSafeInteger(r[0]) && typeof r[1] == "string" && typeof r[2] == "string" && (r.length === 3 || typeof r[3] == "string");
|
|
100
|
+
}
|
|
101
|
+
function m(e) {
|
|
102
|
+
if (Array.isArray(e)) return !1;
|
|
103
|
+
let t = Object.keys(e);
|
|
104
|
+
return t.length === 1 && t[0] === r && Number.isSafeInteger(e[r]);
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { a as createCompactMetadataRegistryV1, i as decodeCompactMetadataV1, o as resolveCompactMetadataAliasV1 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type ConcretePrimitive = string | number | boolean;
|
|
2
|
+
export type DefinedPrimitive = ConcretePrimitive | null;
|
|
3
|
+
export type Primitive = DefinedPrimitive | undefined;
|
|
4
|
+
export type StrictBool = true | false;
|
|
5
|
+
export type KVObject<T = any> = Record<string, T>;
|
|
6
|
+
export type NestedKVObject<T = any> = KVObject<T | T[] | KVObject<T>>;
|
|
7
|
+
export type Serializable<T = ConcretePrimitive> = T | T[] | NestedKVObject<T> | NestedKVObject<T>[];
|
|
8
|
+
export type RequireFields<T, K extends keyof T> = T & {
|
|
9
|
+
[P in K]-?: T[P];
|
|
10
|
+
};
|
|
11
|
+
type NullUnionKeys<T extends object> = {
|
|
12
|
+
[K in keyof T]-?: null extends T[K] ? K : never;
|
|
13
|
+
}[keyof T];
|
|
14
|
+
type Simplify<T> = {
|
|
15
|
+
[K in keyof T]: T[K];
|
|
16
|
+
};
|
|
17
|
+
export type Overwrite<A extends object, B extends object> = Simplify<Omit<A, keyof B> & B>;
|
|
18
|
+
export type OptionalNulls<T extends object> = Simplify<Omit<T, NullUnionKeys<T>> & Partial<Pick<T, NullUnionKeys<T>>>>;
|
|
19
|
+
export type StringKeyOf<T> = Extract<keyof T, string>;
|
|
20
|
+
export type ObjectKeysMatching<O extends object, V> = {
|
|
21
|
+
[K in StringKeyOf<O>]: O[K] extends V ? (O[K] extends (...args: any[]) => any ? never : K) : V extends O[K] ? K : never;
|
|
22
|
+
}[StringKeyOf<O>];
|
|
23
|
+
export type ArrowFunction = (...args: any[]) => any;
|
|
24
|
+
export type ArrowFunctionNoArgs = () => any;
|
|
25
|
+
export type VoidFunction = () => void;
|
|
26
|
+
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
27
|
+
type DefinitelyFunction<T> = IfAny<T, never, T extends (...args: any[]) => any ? T : never>;
|
|
28
|
+
export type MethodsOf<T> = {
|
|
29
|
+
[K in keyof T as DefinitelyFunction<T[K]> extends never ? never : K]: T[K];
|
|
30
|
+
};
|
|
31
|
+
export type MethodKeys<T> = keyof MethodsOf<T>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/types/primitives.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/types/runtime.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAInD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { MaxLength, MinLength, Minimum, MySQL, Type, TypeAnnotation, TypiaFormat, TsfDatabaseFieldTag, TsfTypeTag, TsfTypiaTag, TsfValidatorTag } from '../reflection/index.js';
|
|
2
|
+
export type DateString = string & TypiaFormat<'date'> & TsfDatabaseFieldTag<{
|
|
3
|
+
type: 'DATE';
|
|
4
|
+
}> & TsfTypeTag<'string', 'date'>;
|
|
5
|
+
export type OnUpdate<T extends string> = TypeAnnotation<'tsf:onUpdate', T>;
|
|
6
|
+
export type HasDefault = TypeAnnotation<'tsf:hasDefault'>;
|
|
7
|
+
export type WithDefault<T> = T & HasDefault;
|
|
8
|
+
export type UuidString = string & TypiaFormat<'uuid'> & TsfTypeTag<'string', 'uuidString'>;
|
|
9
|
+
export type { UUID } from '../reflection/index.js';
|
|
10
|
+
export type UnsignedNumber = number & Minimum<0>;
|
|
11
|
+
export declare class Coordinate {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
}
|
|
15
|
+
export type MySQLCoordinate = Coordinate & MySQL<{
|
|
16
|
+
type: 'point';
|
|
17
|
+
}>;
|
|
18
|
+
export type NullableMySQLCoordinate = (Coordinate & MySQL<{
|
|
19
|
+
type: 'point';
|
|
20
|
+
}>) | null;
|
|
21
|
+
export type Length<T extends number> = string & MinLength<T> & MaxLength<T> & TsfTypiaTag<'string', 'tsf:length', T>;
|
|
22
|
+
export type ValidDate = Date & TsfValidatorTag<'object', 'validDate'>;
|
|
23
|
+
export type TrimmedString = string & TsfTypiaTag<'string', 'tsf:trim'>;
|
|
24
|
+
export type NonEmptyTrimmedString = TrimmedString & MinLength<1>;
|
|
25
|
+
export declare function getFirstTypeAnnotation(t: Type, ...names: string[]): Type | undefined;
|
|
26
|
+
export declare const EMAIL_REGEX: RegExp;
|
|
27
|
+
export type EmailAddress = string & TypiaFormat<'email'>;
|
|
28
|
+
//# sourceMappingURL=type-annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-annotations.d.ts","sourceRoot":"","sources":["../../src/types/type-annotations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,SAAS,EACT,SAAS,EACT,OAAO,EACP,KAAK,EACL,IAAI,EACJ,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,eAAe,EAClB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,mBAAmB,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC7H,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,cAAc,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC3F,YAAY,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACnD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAEjD,qBAAa,UAAU;IACnB,CAAC,EAAG,MAAM,CAAC;IACX,CAAC,EAAG,MAAM,CAAC;CACd;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AACpE,MAAM,MAAM,uBAAuB,GAAG,CAAC,UAAU,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,GAAG,IAAI,CAAC;AAErF,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;AAUrH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,eAAe,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAEtE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACvE,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAEjE,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,oBAKjE;AASD,eAAO,MAAM,WAAW,QAAyC,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zyno-io/ts-reflection",
|
|
3
|
+
"version": "26.803.2224",
|
|
4
|
+
"description": "Browser-neutral TypeScript reflection and runtime metadata",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/",
|
|
8
|
+
"package.json",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./type-metadata-runtime": {
|
|
22
|
+
"types": "./dist/type-metadata-runtime.d.ts",
|
|
23
|
+
"import": "./dist/type-metadata-runtime.js",
|
|
24
|
+
"require": "./dist/type-metadata-runtime.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./type-compiler": "./dist/type-compiler/index.cjs"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"clean": "rm -rf dist",
|
|
30
|
+
"build": "yarn clean && yarn build:types && yarn build:type-compiler && vite build --config vite.config.ts",
|
|
31
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
32
|
+
"build:type-compiler": "rm -rf dist/type-compiler && mkdir -p dist/type-compiler && cp -R src/type-compiler/*.cjs src/type-compiler/go dist/type-compiler/"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"typescript": "^7.0.2",
|
|
36
|
+
"vite": "^8.1.5"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"ttsc": "^0.23.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"ttsc": {
|
|
43
|
+
"optional": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"preferUnplugged": true
|
|
47
|
+
}
|