transone-cli 0.7.0 → 0.10.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/README.md +16 -3
- package/README.zh-CN.md +27 -0
- package/dist/app/analyze.d.ts +2 -1
- package/dist/app/components.d.ts +4 -0
- package/dist/app/types.d.ts +3 -0
- package/dist/{build-mp-vk5ap2cw.js → build-mp-y5pwahsy.js} +824 -271
- package/dist/build-mp-y5pwahsy.js.map +24 -0
- package/dist/build.d.ts +3 -1
- package/dist/bundle-inputs.d.ts +6 -0
- package/dist/cli.d.ts +4 -2
- package/dist/cli.js +49 -16
- package/dist/cli.js.map +3 -3
- package/dist/components/discovery.d.ts +5 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/report.d.ts +48 -0
- package/dist/components/resolution.d.ts +7 -0
- package/dist/components/types.d.ts +56 -0
- package/dist/components/web.d.ts +11 -0
- package/dist/config-inputs.d.ts +4 -0
- package/dist/create.d.ts +4 -4
- package/dist/{index-x5rrsfyb.js → index-2g3e5sjt.js} +1257 -1143
- package/dist/index-2g3e5sjt.js.map +32 -0
- package/dist/index-d51tp4y9.js +1402 -0
- package/dist/index-d51tp4y9.js.map +11 -0
- package/dist/index-j4h0wd27.js +489 -0
- package/dist/index-j4h0wd27.js.map +14 -0
- package/dist/index-xgn9fbc6.js +298 -0
- package/dist/index-xgn9fbc6.js.map +13 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +12 -4
- package/dist/index.js.map +2 -2
- package/dist/mp/inheritance.d.ts +17 -0
- package/dist/mp/inline.d.ts +22 -0
- package/dist/mp/methods.d.ts +1 -0
- package/dist/mp/source.d.ts +11 -0
- package/dist/mp/types.d.ts +8 -0
- package/dist/output-transaction.d.ts +19 -0
- package/dist/{project-ybacfze8.js → project-6tft5e77.js} +38 -6
- package/dist/{project-ybacfze8.js.map → project-6tft5e77.js.map} +3 -3
- package/dist/project.d.ts +2 -1
- package/dist/safe-path.d.ts +1 -0
- package/dist/scaffold.d.ts +6 -0
- package/dist/target/types.d.ts +7 -6
- package/dist/target/web-target.d.ts +1 -0
- package/dist/types.d.ts +13 -1
- package/dist/web-bundle.d.ts +3 -1
- package/dist/web-styles.d.ts +1 -1
- package/package.json +2 -2
- package/dist/build-mp-vk5ap2cw.js.map +0 -22
- package/dist/index-k1qfvp0y.js +0 -19
- package/dist/index-k1qfvp0y.js.map +0 -10
- package/dist/index-x5rrsfyb.js.map +0 -30
- package/dist/index-yb2wsc7f.js +0 -7
- package/dist/index-yb2wsc7f.js.map +0 -9
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __require = import.meta.require;
|
|
3
|
+
|
|
4
|
+
// ../transone/lib/platform/definitions.ts
|
|
5
|
+
var Platform;
|
|
6
|
+
((Platform2) => {
|
|
7
|
+
Platform2["Web"] = "web";
|
|
8
|
+
Platform2["WebMobile"] = "web-mobile";
|
|
9
|
+
Platform2["WebPc"] = "web-pc";
|
|
10
|
+
Platform2["MiniprogramWeixin"] = "miniprogram-weixin";
|
|
11
|
+
Platform2["MiniprogramAlipay"] = "miniprogram-alipay";
|
|
12
|
+
Platform2["MiniprogramBytedance"] = "miniprogram-bytedance";
|
|
13
|
+
Platform2["MiniprogramXiaohongshu"] = "miniprogram-xiaohongshu";
|
|
14
|
+
Platform2["AppIos"] = "app-ios";
|
|
15
|
+
Platform2["AppAndroid"] = "app-android";
|
|
16
|
+
Platform2["AppHarmony"] = "app-harmony";
|
|
17
|
+
})(Platform ||= {});
|
|
18
|
+
var PLATFORM_DEFINITIONS = [
|
|
19
|
+
{ platform: "web" /* Web */, decorator: "Web", family: "web", target: "web" },
|
|
20
|
+
{
|
|
21
|
+
platform: "web-mobile" /* WebMobile */,
|
|
22
|
+
decorator: "WebMobile",
|
|
23
|
+
family: "web",
|
|
24
|
+
target: "web"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
platform: "web-pc" /* WebPc */,
|
|
28
|
+
decorator: "WebPc",
|
|
29
|
+
family: "web",
|
|
30
|
+
target: "web"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
platform: "miniprogram-weixin" /* MiniprogramWeixin */,
|
|
34
|
+
decorator: "MiniprogramWeixin",
|
|
35
|
+
family: "miniprogram",
|
|
36
|
+
target: "mp-weixin"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
platform: "miniprogram-alipay" /* MiniprogramAlipay */,
|
|
40
|
+
decorator: "MiniprogramAlipay",
|
|
41
|
+
family: "miniprogram",
|
|
42
|
+
target: "mp-alipay"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
platform: "miniprogram-bytedance" /* MiniprogramBytedance */,
|
|
46
|
+
decorator: "MiniprogramBytedance",
|
|
47
|
+
family: "miniprogram",
|
|
48
|
+
target: "mp-bytedance"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
platform: "miniprogram-xiaohongshu" /* MiniprogramXiaohongshu */,
|
|
52
|
+
decorator: "MiniprogramXiaohongshu",
|
|
53
|
+
family: "miniprogram",
|
|
54
|
+
target: "mp-xiaohongshu"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
platform: "app-ios" /* AppIos */,
|
|
58
|
+
decorator: "AppIos",
|
|
59
|
+
family: "app",
|
|
60
|
+
target: "app-ios"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
platform: "app-android" /* AppAndroid */,
|
|
64
|
+
decorator: "AppAndroid",
|
|
65
|
+
family: "app",
|
|
66
|
+
target: "app-android"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
platform: "app-harmony" /* AppHarmony */,
|
|
70
|
+
decorator: "AppHarmony",
|
|
71
|
+
family: "app",
|
|
72
|
+
target: "app-harmony"
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
var COMPONENT_PLATFORM_DEFINITIONS = [
|
|
76
|
+
...PLATFORM_DEFINITIONS.map(({ platform, decorator }) => ({
|
|
77
|
+
platform,
|
|
78
|
+
decorator
|
|
79
|
+
})),
|
|
80
|
+
{ platform: "miniprogram", decorator: "Miniprogram" },
|
|
81
|
+
{ platform: "app", decorator: "App" }
|
|
82
|
+
];
|
|
83
|
+
function normalizePlatform(value) {
|
|
84
|
+
if (typeof value !== "string")
|
|
85
|
+
return;
|
|
86
|
+
return PLATFORM_DEFINITIONS.find((definition) => definition.platform === value)?.platform ?? PLATFORM_DEFINITIONS.find((definition) => definition.target === value)?.platform;
|
|
87
|
+
}
|
|
88
|
+
function getPlatformDefinition(value) {
|
|
89
|
+
const definition = PLATFORM_DEFINITIONS.find((definition2) => definition2.platform === value);
|
|
90
|
+
if (!definition)
|
|
91
|
+
throw new Error(`Unknown platform: ${String(value)}`);
|
|
92
|
+
return definition;
|
|
93
|
+
}
|
|
94
|
+
// ../transone/lib/platform/bindings.ts
|
|
95
|
+
var bindings = new Map;
|
|
96
|
+
// src/components/index.ts
|
|
97
|
+
import ts3 from "typescript";
|
|
98
|
+
|
|
99
|
+
// src/components/discovery.ts
|
|
100
|
+
import { realpathSync } from "fs";
|
|
101
|
+
import { resolve } from "path";
|
|
102
|
+
import ts from "typescript";
|
|
103
|
+
function canonicalPath(path) {
|
|
104
|
+
const absolute = resolve(path);
|
|
105
|
+
try {
|
|
106
|
+
return realpathSync(absolute);
|
|
107
|
+
} catch {
|
|
108
|
+
return absolute;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function createComponentProgram(options) {
|
|
112
|
+
const root = canonicalPath(options.root);
|
|
113
|
+
let compilerOptions = {
|
|
114
|
+
target: ts.ScriptTarget.ESNext,
|
|
115
|
+
module: ts.ModuleKind.ESNext,
|
|
116
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
117
|
+
skipLibCheck: true,
|
|
118
|
+
noEmit: true
|
|
119
|
+
};
|
|
120
|
+
const configPath = ts.findConfigFile(root, ts.sys.fileExists);
|
|
121
|
+
if (configPath) {
|
|
122
|
+
const loaded = ts.readConfigFile(configPath, ts.sys.readFile);
|
|
123
|
+
if (loaded.error)
|
|
124
|
+
throw new Error(ts.flattenDiagnosticMessageText(loaded.error.messageText, `
|
|
125
|
+
`));
|
|
126
|
+
const parsed = ts.parseJsonConfigFileContent(loaded.config, ts.sys, resolve(configPath, ".."));
|
|
127
|
+
const errors = parsed.errors.filter((error) => error.code !== 18003);
|
|
128
|
+
if (errors.length)
|
|
129
|
+
throw new Error(errors.map((error) => ts.flattenDiagnosticMessageText(error.messageText, `
|
|
130
|
+
`)).join(`
|
|
131
|
+
`));
|
|
132
|
+
compilerOptions = { ...compilerOptions, ...parsed.options, noEmit: true };
|
|
133
|
+
}
|
|
134
|
+
const discovered = ts.sys.readDirectory(root, [".ts", ".tsx"], [
|
|
135
|
+
"**/node_modules/**",
|
|
136
|
+
"**/dist/**",
|
|
137
|
+
"**/*.d.ts",
|
|
138
|
+
...options.exclude ?? []
|
|
139
|
+
], ["src/**/*.ts", "src/**/*.tsx", ...options.include ?? []]);
|
|
140
|
+
const roots = new Set([
|
|
141
|
+
...discovered,
|
|
142
|
+
...options.entrypoints.map((path) => resolve(root, path))
|
|
143
|
+
].map(canonicalPath));
|
|
144
|
+
return ts.createProgram({
|
|
145
|
+
rootNames: [...roots].sort(),
|
|
146
|
+
options: compilerOptions
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// src/components/resolution.ts
|
|
151
|
+
import ts2 from "typescript";
|
|
152
|
+
import { dirname, join } from "path";
|
|
153
|
+
function unalias(checker, symbol) {
|
|
154
|
+
const seen = new Set;
|
|
155
|
+
while (symbol && symbol.flags & ts2.SymbolFlags.Alias && !seen.has(symbol)) {
|
|
156
|
+
seen.add(symbol);
|
|
157
|
+
symbol = checker.getAliasedSymbol(symbol);
|
|
158
|
+
}
|
|
159
|
+
return symbol;
|
|
160
|
+
}
|
|
161
|
+
function sourceNode(node, source) {
|
|
162
|
+
if (node.getSourceFile() === source)
|
|
163
|
+
return node;
|
|
164
|
+
const start = node.getStart();
|
|
165
|
+
let match;
|
|
166
|
+
const visit = (current) => {
|
|
167
|
+
if (current.pos > start || current.end < node.end)
|
|
168
|
+
return;
|
|
169
|
+
if (current.kind === node.kind && current.getStart(source) === start && current.end === node.end)
|
|
170
|
+
match = current;
|
|
171
|
+
if (!match)
|
|
172
|
+
ts2.forEachChild(current, visit);
|
|
173
|
+
};
|
|
174
|
+
visit(source);
|
|
175
|
+
return match;
|
|
176
|
+
}
|
|
177
|
+
function classDeclaration(symbol) {
|
|
178
|
+
for (const declaration of symbol?.declarations ?? []) {
|
|
179
|
+
if (ts2.isClassDeclaration(declaration) || ts2.isClassExpression(declaration))
|
|
180
|
+
return declaration;
|
|
181
|
+
if (ts2.isVariableDeclaration(declaration) && declaration.initializer && ts2.isClassExpression(declaration.initializer)) {
|
|
182
|
+
return declaration.initializer;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
function frameworkSourceFiles(program, root) {
|
|
188
|
+
const configuredModules = new Set;
|
|
189
|
+
for (const name of ["transone", "transone/platform", "transone/core"]) {
|
|
190
|
+
const resolved = ts2.resolveModuleName(name, join(root, "__component_index__.ts"), program.getCompilerOptions(), ts2.sys).resolvedModule;
|
|
191
|
+
if (resolved)
|
|
192
|
+
configuredModules.add(canonicalPath(resolved.resolvedFileName));
|
|
193
|
+
}
|
|
194
|
+
const packages = new Map;
|
|
195
|
+
const packageName = (filePath) => {
|
|
196
|
+
let current = dirname(filePath);
|
|
197
|
+
const visited = [];
|
|
198
|
+
let name;
|
|
199
|
+
while (true) {
|
|
200
|
+
if (packages.has(current)) {
|
|
201
|
+
name = packages.get(current);
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
visited.push(current);
|
|
205
|
+
const manifest = ts2.sys.readFile(join(current, "package.json"));
|
|
206
|
+
if (manifest !== undefined) {
|
|
207
|
+
try {
|
|
208
|
+
name = JSON.parse(manifest).name;
|
|
209
|
+
} catch {}
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
const parent = dirname(current);
|
|
213
|
+
if (parent === current)
|
|
214
|
+
break;
|
|
215
|
+
current = parent;
|
|
216
|
+
}
|
|
217
|
+
for (const directory of visited)
|
|
218
|
+
packages.set(directory, name);
|
|
219
|
+
return name;
|
|
220
|
+
};
|
|
221
|
+
return program.getSourceFiles().filter((source) => {
|
|
222
|
+
const path = canonicalPath(source.fileName);
|
|
223
|
+
return configuredModules.has(path) || packageName(path) === "transone";
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// src/components/index.ts
|
|
228
|
+
function location(reference) {
|
|
229
|
+
const point = reference.source.getLineAndCharacterOfPosition(reference.declaration.getStart());
|
|
230
|
+
return `${reference.className} (${reference.filePath}:${point.line + 1}:${point.character + 1})`;
|
|
231
|
+
}
|
|
232
|
+
function hasModifier(node, modifier) {
|
|
233
|
+
return !!(ts3.canHaveModifiers(node) && ts3.getModifiers(node)?.some((item) => item.kind === modifier));
|
|
234
|
+
}
|
|
235
|
+
function createComponentIndex(options) {
|
|
236
|
+
const program = createComponentProgram(options);
|
|
237
|
+
const checker = program.getTypeChecker();
|
|
238
|
+
const sources = new Map(program.getSourceFiles().map((source) => [canonicalPath(source.fileName), source]));
|
|
239
|
+
const frameworkRoots = new Set;
|
|
240
|
+
const decorators2 = new Map;
|
|
241
|
+
const declarations = new Map;
|
|
242
|
+
const references = [];
|
|
243
|
+
const identities = new Map;
|
|
244
|
+
const parents = new Map;
|
|
245
|
+
const metadata = new Map;
|
|
246
|
+
const component = new Map;
|
|
247
|
+
const decisions = new Map;
|
|
248
|
+
const frameworkClasses = new Set;
|
|
249
|
+
const frameworkSources = new Set(frameworkSourceFiles(program, options.root));
|
|
250
|
+
for (const source of frameworkSources) {
|
|
251
|
+
const moduleSymbol = checker.getSymbolAtLocation(source);
|
|
252
|
+
if (!moduleSymbol)
|
|
253
|
+
continue;
|
|
254
|
+
for (const exported of checker.getExportsOfModule(moduleSymbol)) {
|
|
255
|
+
const symbol = unalias(checker, exported);
|
|
256
|
+
if (!symbol)
|
|
257
|
+
continue;
|
|
258
|
+
if (exported.name === "Component" || exported.name === "BaseComponent")
|
|
259
|
+
frameworkRoots.add(symbol);
|
|
260
|
+
const definition = COMPONENT_PLATFORM_DEFINITIONS.find((item) => item.decorator === exported.name);
|
|
261
|
+
if (definition)
|
|
262
|
+
decorators2.set(symbol, definition.platform);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const symbolAt = (node, source = node.getSourceFile()) => {
|
|
266
|
+
const actual = sources.get(canonicalPath(source.fileName));
|
|
267
|
+
if (!actual)
|
|
268
|
+
return;
|
|
269
|
+
const owned = sourceNode(node, actual);
|
|
270
|
+
if (!owned)
|
|
271
|
+
return;
|
|
272
|
+
let symbol = ts3.isIdentifier(owned) && ts3.isShorthandPropertyAssignment(owned.parent) && owned.parent.name === owned ? checker.getShorthandAssignmentValueSymbol(owned.parent) : checker.getSymbolAtLocation(owned);
|
|
273
|
+
if (!symbol && ts3.isElementAccessExpression(owned) && (ts3.isStringLiteralLike(owned.argumentExpression) || ts3.isNumericLiteral(owned.argumentExpression))) {
|
|
274
|
+
symbol = checker.getPropertyOfType(checker.getTypeAtLocation(owned.expression), owned.argumentExpression.text);
|
|
275
|
+
}
|
|
276
|
+
return unalias(checker, symbol);
|
|
277
|
+
};
|
|
278
|
+
const referenceFor = (declaration) => {
|
|
279
|
+
const previous = declarations.get(declaration);
|
|
280
|
+
if (previous)
|
|
281
|
+
return previous;
|
|
282
|
+
const source = declaration.getSourceFile();
|
|
283
|
+
const filePath = canonicalPath(source.fileName);
|
|
284
|
+
const id = `${filePath}:${declaration.getStart(source)}`;
|
|
285
|
+
const sameIdentity = identities.get(id);
|
|
286
|
+
if (sameIdentity) {
|
|
287
|
+
declarations.set(declaration, sameIdentity);
|
|
288
|
+
return sameIdentity;
|
|
289
|
+
}
|
|
290
|
+
const variable = ts3.isVariableDeclaration(declaration.parent) ? declaration.parent : undefined;
|
|
291
|
+
const nameNode = declaration.name ?? variable?.name;
|
|
292
|
+
const className = nameNode?.getText(source) ?? "default";
|
|
293
|
+
const symbol = nameNode ? unalias(checker, checker.getSymbolAtLocation(nameNode)) : undefined;
|
|
294
|
+
const moduleSymbol = checker.getSymbolAtLocation(source);
|
|
295
|
+
const exported = moduleSymbol ? checker.getExportsOfModule(moduleSymbol).find((item) => {
|
|
296
|
+
const target = unalias(checker, item);
|
|
297
|
+
return target === symbol || classDeclaration(target) === declaration;
|
|
298
|
+
}) : undefined;
|
|
299
|
+
const reference = {
|
|
300
|
+
id,
|
|
301
|
+
filePath,
|
|
302
|
+
source,
|
|
303
|
+
declaration,
|
|
304
|
+
className,
|
|
305
|
+
...exported ? { exportName: exported.name } : {}
|
|
306
|
+
};
|
|
307
|
+
declarations.set(declaration, reference);
|
|
308
|
+
identities.set(id, reference);
|
|
309
|
+
references.push(reference);
|
|
310
|
+
if (symbol && frameworkRoots.has(symbol))
|
|
311
|
+
frameworkClasses.add(reference.id);
|
|
312
|
+
return reference;
|
|
313
|
+
};
|
|
314
|
+
const resolveExpression = (expression, source) => {
|
|
315
|
+
const declaration = classDeclaration(symbolAt(expression, source));
|
|
316
|
+
return declaration ? referenceFor(declaration) : undefined;
|
|
317
|
+
};
|
|
318
|
+
for (const source of program.getSourceFiles()) {
|
|
319
|
+
if (source.isDeclarationFile || /[/\\]node_modules[/\\]/.test(source.fileName))
|
|
320
|
+
continue;
|
|
321
|
+
const visit = (node) => {
|
|
322
|
+
if (ts3.isClassDeclaration(node) || ts3.isClassExpression(node)) {
|
|
323
|
+
referenceFor(node);
|
|
324
|
+
} else if ((ts3.isIdentifier(node) || ts3.isElementAccessExpression(node)) && !frameworkSources.has(source)) {
|
|
325
|
+
const imported = classDeclaration(symbolAt(node, source));
|
|
326
|
+
if (imported)
|
|
327
|
+
referenceFor(imported);
|
|
328
|
+
}
|
|
329
|
+
ts3.forEachChild(node, visit);
|
|
330
|
+
};
|
|
331
|
+
visit(source);
|
|
332
|
+
}
|
|
333
|
+
for (let position = 0;position < references.length; position++) {
|
|
334
|
+
const reference = references[position];
|
|
335
|
+
const heritage = reference.declaration.heritageClauses?.find((item) => item.token === ts3.SyntaxKind.ExtendsKeyword)?.types[0];
|
|
336
|
+
if (heritage) {
|
|
337
|
+
const parent = resolveExpression(heritage.expression, reference.source);
|
|
338
|
+
if (parent)
|
|
339
|
+
parents.set(reference.id, parent);
|
|
340
|
+
}
|
|
341
|
+
const platforms = new Set;
|
|
342
|
+
for (const decorator of ts3.getDecorators(reference.declaration) ?? []) {
|
|
343
|
+
if (!ts3.isCallExpression(decorator.expression))
|
|
344
|
+
continue;
|
|
345
|
+
const symbol = symbolAt(decorator.expression.expression, reference.source);
|
|
346
|
+
const platform = symbol && decorators2.get(symbol);
|
|
347
|
+
if (platform)
|
|
348
|
+
platforms.add(platform);
|
|
349
|
+
}
|
|
350
|
+
metadata.set(reference.id, {
|
|
351
|
+
framework: frameworkSources.has(reference.source),
|
|
352
|
+
parent: parents.get(reference.id),
|
|
353
|
+
family: reference,
|
|
354
|
+
platforms: [...platforms],
|
|
355
|
+
abstract: hasModifier(reference.declaration, ts3.SyntaxKind.AbstractKeyword)
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
const visiting = new Set;
|
|
359
|
+
const classify = (reference) => {
|
|
360
|
+
const known = component.get(reference.id);
|
|
361
|
+
if (known !== undefined)
|
|
362
|
+
return known;
|
|
363
|
+
if (visiting.has(reference.id))
|
|
364
|
+
throw new Error(`Component inheritance cycle at ${location(reference)}`);
|
|
365
|
+
visiting.add(reference.id);
|
|
366
|
+
const parent = parents.get(reference.id);
|
|
367
|
+
const result = frameworkClasses.has(reference.id) || !!(parent && classify(parent));
|
|
368
|
+
component.set(reference.id, result);
|
|
369
|
+
visiting.delete(reference.id);
|
|
370
|
+
return result;
|
|
371
|
+
};
|
|
372
|
+
references.forEach(classify);
|
|
373
|
+
const familyFor = (reference) => {
|
|
374
|
+
const data = metadata.get(reference.id);
|
|
375
|
+
if (!data.platforms.length)
|
|
376
|
+
return reference;
|
|
377
|
+
if (!data.parent || !classify(reference)) {
|
|
378
|
+
throw new Error(`Platform implementation ${location(reference)} must extend a resolvable business component`);
|
|
379
|
+
}
|
|
380
|
+
return frameworkClasses.has(data.parent.id) ? reference : familyFor(data.parent);
|
|
381
|
+
};
|
|
382
|
+
const candidates = new Map;
|
|
383
|
+
for (const reference of references) {
|
|
384
|
+
const data = metadata.get(reference.id);
|
|
385
|
+
if (!data.platforms.length)
|
|
386
|
+
continue;
|
|
387
|
+
if (!reference.declaration.name || !reference.exportName)
|
|
388
|
+
throw new Error(`Platform implementation must be named and exported: ${location(reference)}`);
|
|
389
|
+
if (data.abstract)
|
|
390
|
+
throw new Error(`Platform implementation must be concrete: ${location(reference)}`);
|
|
391
|
+
data.family = familyFor(reference);
|
|
392
|
+
const list = candidates.get(data.family.id) ?? [];
|
|
393
|
+
list.push(reference);
|
|
394
|
+
candidates.set(data.family.id, list);
|
|
395
|
+
}
|
|
396
|
+
const decide = (reference) => {
|
|
397
|
+
const data = metadata.get(reference.id);
|
|
398
|
+
if (!data || !classify(reference) || frameworkClasses.has(reference.id) || data.platforms.length)
|
|
399
|
+
return {
|
|
400
|
+
component: reference,
|
|
401
|
+
implementation: reference,
|
|
402
|
+
reason: "explicit",
|
|
403
|
+
candidates: []
|
|
404
|
+
};
|
|
405
|
+
const available = candidates.get(reference.id) ?? [];
|
|
406
|
+
const exact = available.filter((candidate) => metadata.get(candidate.id).platforms.includes(options.platform));
|
|
407
|
+
const family = getPlatformDefinition(options.platform).family;
|
|
408
|
+
const generic = available.filter((candidate) => metadata.get(candidate.id).platforms.includes(family));
|
|
409
|
+
const matches = exact.length ? exact : generic;
|
|
410
|
+
if (matches.length > 1)
|
|
411
|
+
throw new Error(`Conflicting implementations for ${reference.className} on ${options.platform}:
|
|
412
|
+
${matches.map(location).join(`
|
|
413
|
+
`)}`);
|
|
414
|
+
return {
|
|
415
|
+
component: reference,
|
|
416
|
+
...matches[0] ? { implementation: matches[0] } : data.abstract ? {} : { implementation: reference },
|
|
417
|
+
reason: matches[0] ? exact.length ? "exact" : "family" : data.abstract ? "missing" : "base",
|
|
418
|
+
candidates: available
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
for (const reference of references)
|
|
422
|
+
decisions.set(reference.id, decide(reference));
|
|
423
|
+
const decision = (reference) => decisions.get(reference.id) ?? decide(reference);
|
|
424
|
+
const hierarchy = (reference) => {
|
|
425
|
+
const result = [];
|
|
426
|
+
let current = declarations.get(reference.declaration) ?? reference;
|
|
427
|
+
while (current && !frameworkClasses.has(current.id)) {
|
|
428
|
+
result.unshift(current);
|
|
429
|
+
current = parents.get(current.id);
|
|
430
|
+
}
|
|
431
|
+
return result;
|
|
432
|
+
};
|
|
433
|
+
return {
|
|
434
|
+
platform: options.platform,
|
|
435
|
+
classes: references.filter((reference) => !frameworkClasses.has(reference.id)),
|
|
436
|
+
sources: [...sources.values()].filter((source) => !source.isDeclarationFile && !/[/\\]node_modules[/\\]/.test(source.fileName)),
|
|
437
|
+
resolve(expression, source) {
|
|
438
|
+
const declaration = classDeclaration(symbolAt(expression, source));
|
|
439
|
+
if (!declaration)
|
|
440
|
+
return;
|
|
441
|
+
return declarations.get(declaration) ?? identities.get(`${canonicalPath(declaration.getSourceFile().fileName)}:${declaration.getStart()}`);
|
|
442
|
+
},
|
|
443
|
+
findClass: (filePath, className) => references.find((reference) => reference.filePath === canonicalPath(filePath) && reference.className === className && !frameworkClasses.has(reference.id)),
|
|
444
|
+
isComponent: (reference) => !frameworkClasses.has(reference.id) && (component.get(reference.id) ?? false),
|
|
445
|
+
select(reference) {
|
|
446
|
+
const result = decision(reference);
|
|
447
|
+
if (!result.implementation)
|
|
448
|
+
throw new Error(`Abstract component ${location(reference)} has no implementation for ${options.platform}. Candidates:
|
|
449
|
+
${result.candidates.map(location).join(`
|
|
450
|
+
`) || "(none)"}`);
|
|
451
|
+
return result.implementation;
|
|
452
|
+
},
|
|
453
|
+
decision,
|
|
454
|
+
hierarchy,
|
|
455
|
+
members(reference) {
|
|
456
|
+
const effective = new Map;
|
|
457
|
+
for (const owner of hierarchy(reference)) {
|
|
458
|
+
const own = new Map;
|
|
459
|
+
for (const declaration of owner.declaration.members) {
|
|
460
|
+
const property = declaration.name && ts3.isComputedPropertyName(declaration.name) ? declaration.name.expression : declaration.name;
|
|
461
|
+
const name = property && (ts3.isIdentifier(property) || ts3.isStringLiteralLike(property) || ts3.isNumericLiteral(property)) ? property.text : property?.getText(owner.source) ?? (ts3.isConstructorDeclaration(declaration) ? "constructor" : `@${declaration.pos}`);
|
|
462
|
+
const key = `${hasModifier(declaration, ts3.SyntaxKind.StaticKeyword) ? "static:" : ""}${name}`;
|
|
463
|
+
const group = own.get(key) ?? [];
|
|
464
|
+
group.push({ owner, declaration });
|
|
465
|
+
own.set(key, group);
|
|
466
|
+
}
|
|
467
|
+
for (const [key, group] of own)
|
|
468
|
+
effective.set(key, group);
|
|
469
|
+
}
|
|
470
|
+
return [...effective.values()].flat();
|
|
471
|
+
},
|
|
472
|
+
bindings: () => references.flatMap((base) => {
|
|
473
|
+
const implementation = decisions.get(base.id).implementation;
|
|
474
|
+
return implementation && implementation.id !== base.id ? [{ base, implementation }] : [];
|
|
475
|
+
}),
|
|
476
|
+
metadata(reference) {
|
|
477
|
+
const data = metadata.get(reference.id);
|
|
478
|
+
if (!data)
|
|
479
|
+
throw new Error(`Class is not in this component index: ${location(reference)}`);
|
|
480
|
+
return data;
|
|
481
|
+
},
|
|
482
|
+
symbolAt
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export { __require, Platform, PLATFORM_DEFINITIONS, COMPONENT_PLATFORM_DEFINITIONS, normalizePlatform, getPlatformDefinition, canonicalPath, createComponentIndex };
|
|
487
|
+
|
|
488
|
+
//# debugId=A5B045C466B64F5064756E2164756E21
|
|
489
|
+
//# sourceMappingURL=index-j4h0wd27.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../transone/lib/platform/definitions.ts", "../../transone/lib/platform/bindings.ts", "../src/components/index.ts", "../src/components/discovery.ts", "../src/components/resolution.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/** Application platform, independent of the generator backend. */\nexport enum Platform {\n Web = 'web',\n WebMobile = 'web-mobile',\n WebPc = 'web-pc',\n MiniprogramWeixin = 'miniprogram-weixin',\n MiniprogramAlipay = 'miniprogram-alipay',\n MiniprogramBytedance = 'miniprogram-bytedance',\n MiniprogramXiaohongshu = 'miniprogram-xiaohongshu',\n AppIos = 'app-ios',\n AppAndroid = 'app-android',\n AppHarmony = 'app-harmony',\n}\n\nexport type PlatformName = `${Platform}`;\nexport type PlatformFamily = 'web' | 'miniprogram' | 'app';\n/** Component markers may identify a concrete platform or its shared family. */\nexport type ComponentPlatform = Platform | PlatformFamily;\nexport type BackendTarget =\n | 'web'\n | 'mp-weixin'\n | 'mp-alipay'\n | 'mp-bytedance'\n | 'mp-xiaohongshu'\n | 'app-ios'\n | 'app-android'\n | 'app-harmony';\n\nexport interface PlatformDefinition {\n platform: Platform;\n decorator: string;\n family: PlatformFamily;\n target: BackendTarget;\n}\n\nexport const PLATFORM_DEFINITIONS: readonly PlatformDefinition[] = [\n { platform: Platform.Web, decorator: 'Web', family: 'web', target: 'web' },\n {\n platform: Platform.WebMobile,\n decorator: 'WebMobile',\n family: 'web',\n target: 'web',\n },\n {\n platform: Platform.WebPc,\n decorator: 'WebPc',\n family: 'web',\n target: 'web',\n },\n {\n platform: Platform.MiniprogramWeixin,\n decorator: 'MiniprogramWeixin',\n family: 'miniprogram',\n target: 'mp-weixin',\n },\n {\n platform: Platform.MiniprogramAlipay,\n decorator: 'MiniprogramAlipay',\n family: 'miniprogram',\n target: 'mp-alipay',\n },\n {\n platform: Platform.MiniprogramBytedance,\n decorator: 'MiniprogramBytedance',\n family: 'miniprogram',\n target: 'mp-bytedance',\n },\n {\n platform: Platform.MiniprogramXiaohongshu,\n decorator: 'MiniprogramXiaohongshu',\n family: 'miniprogram',\n target: 'mp-xiaohongshu',\n },\n {\n platform: Platform.AppIos,\n decorator: 'AppIos',\n family: 'app',\n target: 'app-ios',\n },\n {\n platform: Platform.AppAndroid,\n decorator: 'AppAndroid',\n family: 'app',\n target: 'app-android',\n },\n {\n platform: Platform.AppHarmony,\n decorator: 'AppHarmony',\n family: 'app',\n target: 'app-harmony',\n },\n];\n\n/** Family markers do not select a concrete generator and are not build targets. */\nexport const COMPONENT_PLATFORM_DEFINITIONS: readonly {\n platform: ComponentPlatform;\n decorator: string;\n}[] = [\n ...PLATFORM_DEFINITIONS.map(({ platform, decorator }) => ({\n platform,\n decorator,\n })),\n { platform: 'miniprogram', decorator: 'Miniprogram' },\n { platform: 'app', decorator: 'App' },\n];\n\nexport function normalizePlatform(value: unknown): Platform | undefined {\n if (typeof value !== 'string') return undefined;\n return (\n PLATFORM_DEFINITIONS.find((definition) => definition.platform === value)\n ?.platform ??\n PLATFORM_DEFINITIONS.find((definition) => definition.target === value)\n ?.platform\n );\n}\n\nexport function getPlatformDefinition(value: Platform): PlatformDefinition {\n const definition = PLATFORM_DEFINITIONS.find(\n (definition) => definition.platform === value\n );\n if (!definition) throw new Error(`Unknown platform: ${String(value)}`);\n return definition;\n}\n",
|
|
6
|
+
"import type {\n Component,\n ComponentConstructor,\n ComponentReference,\n ComponentProps,\n ComponentState,\n} from '../core/component/base';\n\ninterface BindingLayer {\n implementation: Function;\n}\n\n// Deliberately module-local: each generated application/SSR bundle owns its bindings.\nconst bindings = new Map<Function, BindingLayer[]>();\n\nexport function bindComponentImplementations(\n pairs: readonly (readonly [Function, Function])[]\n): () => void {\n const installed = pairs.map(([reference, implementation]) => {\n const layer = { implementation };\n const layers = bindings.get(reference) ?? [];\n layers.push(layer);\n bindings.set(reference, layers);\n return { reference, layer };\n });\n let restored = false;\n return () => {\n if (restored) return;\n restored = true;\n for (const { reference, layer } of installed) {\n const layers = bindings.get(reference);\n if (!layers) continue;\n const index = layers.indexOf(layer);\n if (index !== -1) layers.splice(index, 1);\n if (layers.length === 0) bindings.delete(reference);\n }\n };\n}\n\nexport function createComponentInstance<\n P extends ComponentProps = ComponentProps,\n S extends ComponentState = ComponentState,\n>(reference: ComponentReference<P, S>, props?: P): Component<P, S> {\n // Exact identity only; never follow inheritance or rebind an explicit implementation.\n const layers = bindings.get(reference);\n const implementation = (layers?.[layers.length - 1]?.implementation ??\n reference) as ComponentConstructor<P, S>;\n return new implementation(props);\n}\n",
|
|
7
|
+
"import ts from 'typescript';\nimport {\n COMPONENT_PLATFORM_DEFINITIONS,\n getPlatformDefinition,\n type ComponentPlatform,\n} from 'transone/platform';\nimport { canonicalPath, createComponentProgram } from './discovery';\nimport {\n classDeclaration,\n frameworkSourceFiles,\n sourceNode,\n unalias,\n} from './resolution';\nimport type {\n ClassReference,\n ComponentIndex,\n ComponentIndexOptions,\n ComponentMetadata,\n ComponentSelectionDecision,\n OwnedMember,\n} from './types';\nexport type * from './types';\n\nfunction location(reference: ClassReference): string {\n const point = reference.source.getLineAndCharacterOfPosition(\n reference.declaration.getStart()\n );\n return `${reference.className} (${reference.filePath}:${point.line + 1}:${point.character + 1})`;\n}\nfunction hasModifier(node: ts.Node, modifier: ts.SyntaxKind): boolean {\n return !!(\n ts.canHaveModifiers(node) &&\n ts.getModifiers(node)?.some((item) => item.kind === modifier)\n );\n}\n\n/** A fresh checker, selection table and source ownership graph for each build. */\nexport function createComponentIndex(\n options: ComponentIndexOptions\n): ComponentIndex {\n const program = createComponentProgram(options);\n const checker = program.getTypeChecker();\n const sources = new Map(\n program\n .getSourceFiles()\n .map((source) => [canonicalPath(source.fileName), source])\n );\n const frameworkRoots = new Set<ts.Symbol>();\n const decorators = new Map<ts.Symbol, ComponentPlatform>();\n const declarations = new Map<ts.ClassLikeDeclaration, ClassReference>();\n const references: ClassReference[] = [];\n const identities = new Map<string, ClassReference>();\n const parents = new Map<string, ClassReference>();\n const metadata = new Map<string, ComponentMetadata>();\n const component = new Map<string, boolean>();\n const decisions = new Map<string, ComponentSelectionDecision>();\n const frameworkClasses = new Set<string>();\n\n // Module ownership/resolution establishes identity before looking at export names.\n // Aliases and absolute imports reach the same real declarations as package imports.\n const frameworkSources = new Set(frameworkSourceFiles(program, options.root));\n for (const source of frameworkSources) {\n const moduleSymbol = checker.getSymbolAtLocation(source);\n if (!moduleSymbol) continue;\n for (const exported of checker.getExportsOfModule(moduleSymbol)) {\n const symbol = unalias(checker, exported);\n if (!symbol) continue;\n if (exported.name === 'Component' || exported.name === 'BaseComponent')\n frameworkRoots.add(symbol);\n const definition = COMPONENT_PLATFORM_DEFINITIONS.find(\n (item) => item.decorator === exported.name\n );\n if (definition) decorators.set(symbol, definition.platform);\n }\n }\n\n const symbolAt = (\n node: ts.Node,\n source = node.getSourceFile()\n ): ts.Symbol | undefined => {\n const actual = sources.get(canonicalPath(source.fileName));\n if (!actual) return undefined;\n const owned = sourceNode(node, actual);\n if (!owned) return undefined;\n let symbol =\n ts.isIdentifier(owned) &&\n ts.isShorthandPropertyAssignment(owned.parent) &&\n owned.parent.name === owned\n ? checker.getShorthandAssignmentValueSymbol(owned.parent)\n : checker.getSymbolAtLocation(owned);\n if (\n !symbol &&\n ts.isElementAccessExpression(owned) &&\n (ts.isStringLiteralLike(owned.argumentExpression) ||\n ts.isNumericLiteral(owned.argumentExpression))\n ) {\n symbol = checker.getPropertyOfType(\n checker.getTypeAtLocation(owned.expression),\n owned.argumentExpression.text\n );\n }\n return unalias(checker, symbol);\n };\n const referenceFor = (\n declaration: ts.ClassLikeDeclaration\n ): ClassReference => {\n const previous = declarations.get(declaration);\n if (previous) return previous;\n const source = declaration.getSourceFile();\n const filePath = canonicalPath(source.fileName);\n const id = `${filePath}:${declaration.getStart(source)}`;\n const sameIdentity = identities.get(id);\n if (sameIdentity) {\n declarations.set(declaration, sameIdentity);\n return sameIdentity;\n }\n const variable = ts.isVariableDeclaration(declaration.parent)\n ? declaration.parent\n : undefined;\n const nameNode = declaration.name ?? variable?.name;\n const className = nameNode?.getText(source) ?? 'default';\n const symbol = nameNode\n ? unalias(checker, checker.getSymbolAtLocation(nameNode))\n : undefined;\n const moduleSymbol = checker.getSymbolAtLocation(source);\n const exported = moduleSymbol\n ? checker.getExportsOfModule(moduleSymbol).find((item) => {\n const target = unalias(checker, item);\n return target === symbol || classDeclaration(target) === declaration;\n })\n : undefined;\n const reference: ClassReference = {\n id,\n filePath,\n source,\n declaration,\n className,\n ...(exported ? { exportName: exported.name } : {}),\n };\n declarations.set(declaration, reference);\n identities.set(id, reference);\n references.push(reference);\n if (symbol && frameworkRoots.has(symbol))\n frameworkClasses.add(reference.id);\n return reference;\n };\n const resolveExpression = (\n expression: ts.Expression,\n source: ts.SourceFile\n ): ClassReference | undefined => {\n const declaration = classDeclaration(symbolAt(expression, source));\n return declaration ? referenceFor(declaration) : undefined;\n };\n\n for (const source of program.getSourceFiles()) {\n if (\n source.isDeclarationFile ||\n /[/\\\\]node_modules[/\\\\]/.test(source.fileName)\n )\n continue;\n const visit = (node: ts.Node) => {\n if (ts.isClassDeclaration(node) || ts.isClassExpression(node)) {\n referenceFor(node);\n } else if (\n (ts.isIdentifier(node) || ts.isElementAccessExpression(node)) &&\n !frameworkSources.has(source)\n ) {\n // Imports and namespace property uses can point directly at installed\n // declarations without a local subclass to pull them into the graph.\n const imported = classDeclaration(symbolAt(node, source));\n if (imported) referenceFor(imported);\n }\n ts.forEachChild(node, visit);\n };\n visit(source);\n }\n // This loop can append imported ancestors, including declarations from installed packages.\n for (let position = 0; position < references.length; position++) {\n const reference = references[position]!;\n const heritage = reference.declaration.heritageClauses?.find(\n (item) => item.token === ts.SyntaxKind.ExtendsKeyword\n )?.types[0];\n if (heritage) {\n const parent = resolveExpression(heritage.expression, reference.source);\n if (parent) parents.set(reference.id, parent);\n }\n const platforms = new Set<ComponentPlatform>();\n for (const decorator of ts.getDecorators(reference.declaration) ?? []) {\n if (!ts.isCallExpression(decorator.expression)) continue;\n const symbol = symbolAt(\n decorator.expression.expression,\n reference.source\n );\n const platform = symbol && decorators.get(symbol);\n if (platform) platforms.add(platform);\n }\n metadata.set(reference.id, {\n framework: frameworkSources.has(reference.source),\n parent: parents.get(reference.id),\n family: reference,\n platforms: [...platforms],\n abstract: hasModifier(\n reference.declaration,\n ts.SyntaxKind.AbstractKeyword\n ),\n });\n }\n\n const visiting = new Set<string>();\n const classify = (reference: ClassReference): boolean => {\n const known = component.get(reference.id);\n if (known !== undefined) return known;\n if (visiting.has(reference.id))\n throw new Error(`Component inheritance cycle at ${location(reference)}`);\n visiting.add(reference.id);\n const parent = parents.get(reference.id);\n const result =\n frameworkClasses.has(reference.id) || !!(parent && classify(parent));\n component.set(reference.id, result);\n visiting.delete(reference.id);\n return result;\n };\n references.forEach(classify);\n\n const familyFor = (reference: ClassReference): ClassReference => {\n const data = metadata.get(reference.id)!;\n if (!data.platforms.length) return reference;\n if (!data.parent || !classify(reference)) {\n throw new Error(\n `Platform implementation ${location(reference)} must extend a resolvable business component`\n );\n }\n // A directly annotated framework subclass is explicit-only, never a mapping for the framework root.\n return frameworkClasses.has(data.parent.id)\n ? reference\n : familyFor(data.parent);\n };\n const candidates = new Map<string, ClassReference[]>();\n for (const reference of references) {\n const data = metadata.get(reference.id)!;\n if (!data.platforms.length) continue;\n if (!reference.declaration.name || !reference.exportName)\n throw new Error(\n `Platform implementation must be named and exported: ${location(reference)}`\n );\n if (data.abstract)\n throw new Error(\n `Platform implementation must be concrete: ${location(reference)}`\n );\n data.family = familyFor(reference);\n const list = candidates.get(data.family.id) ?? [];\n list.push(reference);\n candidates.set(data.family.id, list);\n }\n const decide = (reference: ClassReference): ComponentSelectionDecision => {\n const data = metadata.get(reference.id);\n if (\n !data ||\n !classify(reference) ||\n frameworkClasses.has(reference.id) ||\n data.platforms.length\n )\n return {\n component: reference,\n implementation: reference,\n reason: 'explicit',\n candidates: [],\n };\n const available = candidates.get(reference.id) ?? [];\n const exact = available.filter((candidate) =>\n metadata.get(candidate.id)!.platforms.includes(options.platform)\n );\n const family = getPlatformDefinition(options.platform).family;\n const generic = available.filter((candidate) =>\n metadata.get(candidate.id)!.platforms.includes(family)\n );\n const matches = exact.length ? exact : generic;\n if (matches.length > 1)\n throw new Error(\n `Conflicting implementations for ${reference.className} on ${options.platform}:\\n${matches.map(location).join('\\n')}`\n );\n return {\n component: reference,\n ...(matches[0]\n ? { implementation: matches[0] }\n : data.abstract\n ? {}\n : { implementation: reference }),\n reason: matches[0]\n ? exact.length\n ? 'exact'\n : 'family'\n : data.abstract\n ? 'missing'\n : 'base',\n candidates: available,\n };\n };\n for (const reference of references)\n decisions.set(reference.id, decide(reference));\n\n const decision = (reference: ClassReference) =>\n decisions.get(reference.id) ?? decide(reference);\n\n const hierarchy = (reference: ClassReference): readonly ClassReference[] => {\n const result: ClassReference[] = [];\n let current: ClassReference | undefined =\n declarations.get(reference.declaration) ?? reference;\n while (current && !frameworkClasses.has(current.id)) {\n result.unshift(current);\n current = parents.get(current.id);\n }\n return result;\n };\n return {\n platform: options.platform,\n classes: references.filter(\n (reference) => !frameworkClasses.has(reference.id)\n ),\n sources: [...sources.values()].filter(\n (source) =>\n !source.isDeclarationFile &&\n !/[/\\\\]node_modules[/\\\\]/.test(source.fileName)\n ),\n resolve(expression, source) {\n const declaration = classDeclaration(symbolAt(expression, source));\n // Completed indexes are immutable: never append a half-initialized class.\n if (!declaration) return undefined;\n return (\n declarations.get(declaration) ??\n identities.get(\n `${canonicalPath(declaration.getSourceFile().fileName)}:${declaration.getStart()}`\n )\n );\n },\n findClass: (filePath, className) =>\n references.find(\n (reference) =>\n reference.filePath === canonicalPath(filePath) &&\n reference.className === className &&\n !frameworkClasses.has(reference.id)\n ),\n isComponent: (reference) =>\n !frameworkClasses.has(reference.id) &&\n (component.get(reference.id) ?? false),\n select(reference) {\n const result = decision(reference);\n if (!result.implementation)\n throw new Error(\n `Abstract component ${location(reference)} has no implementation for ${options.platform}. Candidates:\\n${result.candidates.map(location).join('\\n') || '(none)'}`\n );\n return result.implementation;\n },\n decision,\n hierarchy,\n members(reference) {\n const effective = new Map<string, OwnedMember[]>();\n for (const owner of hierarchy(reference)) {\n const own = new Map<string, OwnedMember[]>();\n for (const declaration of owner.declaration.members) {\n const property =\n declaration.name && ts.isComputedPropertyName(declaration.name)\n ? declaration.name.expression\n : declaration.name;\n const name =\n property &&\n (ts.isIdentifier(property) ||\n ts.isStringLiteralLike(property) ||\n ts.isNumericLiteral(property))\n ? property.text\n : (property?.getText(owner.source) ??\n (ts.isConstructorDeclaration(declaration)\n ? 'constructor'\n : `@${declaration.pos}`));\n const key = `${hasModifier(declaration, ts.SyntaxKind.StaticKeyword) ? 'static:' : ''}${name}`;\n const group = own.get(key) ?? [];\n group.push({ owner, declaration });\n own.set(key, group);\n }\n for (const [key, group] of own) effective.set(key, group);\n }\n return [...effective.values()].flat();\n },\n bindings: () =>\n references.flatMap((base) => {\n const implementation = decisions.get(base.id)!.implementation;\n return implementation && implementation.id !== base.id\n ? [{ base, implementation }]\n : [];\n }),\n metadata(reference) {\n const data = metadata.get(reference.id);\n if (!data)\n throw new Error(\n `Class is not in this component index: ${location(reference)}`\n );\n return data;\n },\n symbolAt,\n };\n}\n",
|
|
8
|
+
"import { realpathSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport ts from 'typescript';\nimport type { ComponentIndexOptions } from './types';\n\nexport function canonicalPath(path: string): string {\n const absolute = resolve(path);\n try {\n return realpathSync(absolute);\n } catch {\n return absolute;\n }\n}\n\n/** Discovery only reads source. Imported files are loaded by TypeScript, never executed. */\nexport function createComponentProgram(\n options: ComponentIndexOptions\n): ts.Program {\n const root = canonicalPath(options.root);\n let compilerOptions: ts.CompilerOptions = {\n target: ts.ScriptTarget.ESNext,\n module: ts.ModuleKind.ESNext,\n moduleResolution: ts.ModuleResolutionKind.Bundler,\n skipLibCheck: true,\n noEmit: true,\n };\n const configPath = ts.findConfigFile(root, ts.sys.fileExists);\n if (configPath) {\n const loaded = ts.readConfigFile(configPath, ts.sys.readFile);\n if (loaded.error)\n throw new Error(\n ts.flattenDiagnosticMessageText(loaded.error.messageText, '\\n')\n );\n const parsed = ts.parseJsonConfigFileContent(\n loaded.config,\n ts.sys,\n resolve(configPath, '..')\n );\n // An empty config file list is harmless: roots come from component discovery.\n const errors = parsed.errors.filter((error) => error.code !== 18003);\n if (errors.length)\n throw new Error(\n errors\n .map((error) =>\n ts.flattenDiagnosticMessageText(error.messageText, '\\n')\n )\n .join('\\n')\n );\n compilerOptions = { ...compilerOptions, ...parsed.options, noEmit: true };\n }\n const discovered = ts.sys.readDirectory(\n root,\n ['.ts', '.tsx'],\n [\n '**/node_modules/**',\n '**/dist/**',\n '**/*.d.ts',\n ...(options.exclude ?? []),\n ],\n ['src/**/*.ts', 'src/**/*.tsx', ...(options.include ?? [])]\n );\n const roots = new Set(\n [\n ...discovered,\n ...options.entrypoints.map((path) => resolve(root, path)),\n ].map(canonicalPath)\n );\n return ts.createProgram({\n rootNames: [...roots].sort(),\n options: compilerOptions,\n });\n}\n",
|
|
9
|
+
"import ts from 'typescript';\nimport { dirname, join } from 'node:path';\nimport { canonicalPath } from './discovery';\n\nexport function unalias(\n checker: ts.TypeChecker,\n symbol: ts.Symbol | undefined\n): ts.Symbol | undefined {\n const seen = new Set<ts.Symbol>();\n while (symbol && symbol.flags & ts.SymbolFlags.Alias && !seen.has(symbol)) {\n seen.add(symbol);\n symbol = checker.getAliasedSymbol(symbol);\n }\n return symbol;\n}\n\n/** Map a parser-owned node back into the Program without losing its source scope. */\nexport function sourceNode(\n node: ts.Node,\n source: ts.SourceFile\n): ts.Node | undefined {\n if (node.getSourceFile() === source) return node;\n const start = node.getStart();\n let match: ts.Node | undefined;\n const visit = (current: ts.Node) => {\n if (current.pos > start || current.end < node.end) return;\n if (\n current.kind === node.kind &&\n current.getStart(source) === start &&\n current.end === node.end\n )\n match = current;\n if (!match) ts.forEachChild(current, visit);\n };\n visit(source);\n return match;\n}\n\nexport function classDeclaration(\n symbol: ts.Symbol | undefined\n): ts.ClassLikeDeclaration | undefined {\n for (const declaration of symbol?.declarations ?? []) {\n if (ts.isClassDeclaration(declaration) || ts.isClassExpression(declaration))\n return declaration;\n if (\n ts.isVariableDeclaration(declaration) &&\n declaration.initializer &&\n ts.isClassExpression(declaration.initializer)\n ) {\n return declaration.initializer;\n }\n }\n return undefined;\n}\n\n/** Find actual framework modules independently of consumer import spelling. */\nexport function frameworkSourceFiles(\n program: ts.Program,\n root: string\n): readonly ts.SourceFile[] {\n const configuredModules = new Set<string>();\n for (const name of ['transone', 'transone/platform', 'transone/core']) {\n const resolved = ts.resolveModuleName(\n name,\n join(root, '__component_index__.ts'),\n program.getCompilerOptions(),\n ts.sys\n ).resolvedModule;\n if (resolved)\n configuredModules.add(canonicalPath(resolved.resolvedFileName));\n }\n const packages = new Map<string, string | undefined>();\n const packageName = (filePath: string): string | undefined => {\n let current = dirname(filePath);\n const visited: string[] = [];\n let name: string | undefined;\n while (true) {\n if (packages.has(current)) {\n name = packages.get(current);\n break;\n }\n visited.push(current);\n const manifest = ts.sys.readFile(join(current, 'package.json'));\n if (manifest !== undefined) {\n try {\n name = (JSON.parse(manifest) as { name?: string }).name;\n } catch {\n /* Unrelated invalid package metadata does not confer framework identity. */\n }\n break;\n }\n const parent = dirname(current);\n if (parent === current) break;\n current = parent;\n }\n for (const directory of visited) packages.set(directory, name);\n return name;\n };\n return program.getSourceFiles().filter((source) => {\n const path = canonicalPath(source.fileName);\n return configuredModules.has(path) || packageName(path) === 'transone';\n });\n}\n"
|
|
10
|
+
],
|
|
11
|
+
"mappings": ";;;;AACO,IAAK;AAAA,CAAL,CAAK,cAAL;AAAA,EACL,mBAAM;AAAA,EACN,yBAAY;AAAA,EACZ,qBAAQ;AAAA,EACR,iCAAoB;AAAA,EACpB,iCAAoB;AAAA,EACpB,oCAAuB;AAAA,EACvB,sCAAyB;AAAA,EACzB,sBAAS;AAAA,EACT,0BAAa;AAAA,EACb,0BA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