@specverse/engines 6.30.5 → 6.32.11
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/ai/analyse-runner.d.ts.map +1 -1
- package/dist/ai/analyse-runner.js +19 -0
- package/dist/ai/analyse-runner.js.map +1 -1
- package/dist/ai/behaviours-runner.d.ts.map +1 -1
- package/dist/ai/behaviours-runner.js +47 -7
- package/dist/ai/behaviours-runner.js.map +1 -1
- package/dist/ai/create-runner.d.ts.map +1 -1
- package/dist/ai/create-runner.js +6 -0
- package/dist/ai/create-runner.js.map +1 -1
- package/dist/ai/manifest-emitter.d.ts +35 -10
- package/dist/ai/manifest-emitter.d.ts.map +1 -1
- package/dist/ai/manifest-emitter.js +140 -54
- package/dist/ai/manifest-emitter.js.map +1 -1
- package/dist/ai/microcall-orchestrator.d.ts +8 -0
- package/dist/ai/microcall-orchestrator.d.ts.map +1 -1
- package/dist/ai/microcall-orchestrator.js +5 -1
- package/dist/ai/microcall-orchestrator.js.map +1 -1
- package/dist/ai/processes-to-microcall-context.d.ts +66 -0
- package/dist/ai/processes-to-microcall-context.d.ts.map +1 -0
- package/dist/ai/processes-to-microcall-context.js +148 -0
- package/dist/ai/processes-to-microcall-context.js.map +1 -0
- package/dist/ai/skeleton-emitter.d.ts +1 -1
- package/dist/ai/skeleton-emitter.d.ts.map +1 -1
- package/dist/ai/skeleton-emitter.js +162 -14
- package/dist/ai/skeleton-emitter.js.map +1 -1
- package/dist/analyse-prepass/adapters/react-views.d.ts +85 -0
- package/dist/analyse-prepass/adapters/react-views.d.ts.map +1 -1
- package/dist/analyse-prepass/adapters/react-views.js +290 -0
- package/dist/analyse-prepass/adapters/react-views.js.map +1 -1
- package/dist/analyse-prepass/imports-graph.d.ts +133 -0
- package/dist/analyse-prepass/imports-graph.d.ts.map +1 -0
- package/dist/analyse-prepass/imports-graph.js +430 -0
- package/dist/analyse-prepass/imports-graph.js.map +1 -0
- package/dist/analyse-prepass/index.d.ts +31 -0
- package/dist/analyse-prepass/index.d.ts.map +1 -1
- package/dist/analyse-prepass/index.js +22 -0
- package/dist/analyse-prepass/index.js.map +1 -1
- package/dist/inference/logical/generators/view-generator.d.ts +10 -0
- package/dist/inference/logical/generators/view-generator.d.ts.map +1 -1
- package/dist/inference/logical/generators/view-generator.js +20 -0
- package/dist/inference/logical/generators/view-generator.js.map +1 -1
- package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +10 -3
- package/libs/instance-factories/cli/templates/commander/command-generator.ts +10 -3
- package/package.json +3 -3
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-component imports graph (engines 6.32.6+).
|
|
3
|
+
*
|
|
4
|
+
* Phase A of Dom Williams's "shared library / reference vs implicit
|
|
5
|
+
* include" feedback (2026-05-07). When the analysed source is a
|
|
6
|
+
* monorepo with shared/ libraries (idle_meta has shared/services/,
|
|
7
|
+
* shared/ui/, shared/data/, shared/schemas/), the prepass already
|
|
8
|
+
* decomposes the source into one component per top-level dir — but
|
|
9
|
+
* never models the dependency direction. `IdleApiService` ends up
|
|
10
|
+
* with action steps like `[call] AuthService.login` without any
|
|
11
|
+
* spec-level binding to the `Services` component that owns AuthService.
|
|
12
|
+
*
|
|
13
|
+
* This module walks each component's TS/JS files for `import { X } from
|
|
14
|
+
* '...'` statements, resolves the import path relative to the source
|
|
15
|
+
* tree, and matches the resolved path against the other components'
|
|
16
|
+
* sourceDirs. Result: a map of consumer → (target component → set of
|
|
17
|
+
* imported symbol names). The skeleton-emitter consumes that map to
|
|
18
|
+
* emit `import:` blocks per consumer component.
|
|
19
|
+
*
|
|
20
|
+
* Detection is regex-based — same approach as the express-routes /
|
|
21
|
+
* zod-schemas adapters. Good enough for ES module + CommonJS source;
|
|
22
|
+
* misses dynamic `await import()` and `require(variable)` (rare in
|
|
23
|
+
* spec-able codebases). Type-only imports are included; the realize
|
|
24
|
+
* engine will ignore unused selects.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Extract all import statements from a TS/JS source file. Handles:
|
|
28
|
+
* - `import { A, B as C } from 'mod'` — named
|
|
29
|
+
* - `import D from 'mod'` — default
|
|
30
|
+
* - `import * as M from 'mod'` — namespace
|
|
31
|
+
* - `import 'mod'` — side-effect (returns names: [])
|
|
32
|
+
* - `import type { A } from 'mod'` — type-only
|
|
33
|
+
* - `const { A } = require('mod')` — CommonJS destructuring
|
|
34
|
+
*
|
|
35
|
+
* Returns an empty array on empty input. Skips comments and string
|
|
36
|
+
* literals (basic heuristic — strips block comments and line comments).
|
|
37
|
+
*/
|
|
38
|
+
export function parseImports(source) {
|
|
39
|
+
if (!source)
|
|
40
|
+
return [];
|
|
41
|
+
// Strip comments — naive but adequate; we don't need exact lex
|
|
42
|
+
const cleaned = source
|
|
43
|
+
.replace(/\/\*[\s\S]*?\*\//g, ' ')
|
|
44
|
+
.replace(/(^|[^:])\/\/[^\n]*/g, '$1');
|
|
45
|
+
const out = [];
|
|
46
|
+
// ES module imports: `import [type] (...) from 'mod'`
|
|
47
|
+
// Cases:
|
|
48
|
+
// import { A, B as C } from 'mod'
|
|
49
|
+
// import D from 'mod'
|
|
50
|
+
// import D, { A } from 'mod'
|
|
51
|
+
// import * as M from 'mod'
|
|
52
|
+
// import 'mod' (side-effect)
|
|
53
|
+
// import type { A } from 'mod'
|
|
54
|
+
const esRe = /import\s+(type\s+)?(?:([\w$]+)(?:\s*,\s*\{([^}]*)\})?|(\{[^}]*\})|(\*\s+as\s+[\w$]+))?\s*(?:from\s+)?['"]([^'"]+)['"]/g;
|
|
55
|
+
let m;
|
|
56
|
+
while ((m = esRe.exec(cleaned)) !== null) {
|
|
57
|
+
const typeOnly = !!m[1];
|
|
58
|
+
const defaultName = m[2];
|
|
59
|
+
const namedAfterDefault = m[3];
|
|
60
|
+
const namedOnly = m[4];
|
|
61
|
+
const namespaceForm = m[5];
|
|
62
|
+
const moduleName = m[6];
|
|
63
|
+
const names = [];
|
|
64
|
+
let namespaceAlias;
|
|
65
|
+
if (defaultName)
|
|
66
|
+
names.push(defaultName);
|
|
67
|
+
if (namedAfterDefault)
|
|
68
|
+
names.push(...parseNamedSpecifiers(namedAfterDefault));
|
|
69
|
+
if (namedOnly)
|
|
70
|
+
names.push(...parseNamedSpecifiers(namedOnly.slice(1, -1)));
|
|
71
|
+
if (namespaceForm) {
|
|
72
|
+
const aliasMatch = namespaceForm.match(/\*\s+as\s+([\w$]+)/);
|
|
73
|
+
if (aliasMatch)
|
|
74
|
+
namespaceAlias = aliasMatch[1];
|
|
75
|
+
}
|
|
76
|
+
out.push({
|
|
77
|
+
source: moduleName,
|
|
78
|
+
names: dedup(names),
|
|
79
|
+
...(namespaceAlias ? { namespaceAlias } : {}),
|
|
80
|
+
typeOnly,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// CommonJS destructuring: `const { A, B } = require('mod')`
|
|
84
|
+
const cjsDestructuringRe = /(?:const|let|var)\s+\{([^}]+)\}\s*=\s*require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
85
|
+
while ((m = cjsDestructuringRe.exec(cleaned)) !== null) {
|
|
86
|
+
const names = parseNamedSpecifiers(m[1]);
|
|
87
|
+
out.push({ source: m[2], names: dedup(names), typeOnly: false });
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
/** Parse `A, B as C, D` into ['A', 'B', 'D'] (uses imported name, not local alias). */
|
|
92
|
+
function parseNamedSpecifiers(raw) {
|
|
93
|
+
return raw
|
|
94
|
+
.split(',')
|
|
95
|
+
.map((s) => s.trim())
|
|
96
|
+
.filter(Boolean)
|
|
97
|
+
.map((s) => s.split(/\s+as\s+/)[0].trim())
|
|
98
|
+
.filter((s) => /^[\w$]+$/.test(s));
|
|
99
|
+
}
|
|
100
|
+
function dedup(arr) {
|
|
101
|
+
return [...new Set(arr)];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Resolve a relative import path against the file that contains the
|
|
105
|
+
* import. Returns a normalised path (no `..` / `.` segments, no leading
|
|
106
|
+
* `./`). Non-relative specifiers (`react`, `@scope/pkg`) return null
|
|
107
|
+
* unless they match an alias in `aliases` (Engines 6.32.7+).
|
|
108
|
+
*
|
|
109
|
+
* The result is the path as it would appear in the source tree, NOT
|
|
110
|
+
* the absolute disk path. Caller compares it against component
|
|
111
|
+
* sourceDirs (which are also tree-relative) to see if the import
|
|
112
|
+
* crosses a component boundary.
|
|
113
|
+
*
|
|
114
|
+
* @param aliases Optional map of alias resolutions from a tsconfig
|
|
115
|
+
* `paths` block. Keys are alias patterns (e.g. `@shared/ui`,
|
|
116
|
+
* `@/*`); values are pre-resolved tree-paths. The resolver
|
|
117
|
+
* substitutes a longest-prefix match before falling back
|
|
118
|
+
* to relative-only resolution.
|
|
119
|
+
*/
|
|
120
|
+
export function resolveImportPath(fromFile, importSpec, aliases = {}) {
|
|
121
|
+
// 1. Try alias resolution first — longest-prefix match wins.
|
|
122
|
+
const aliasKeys = Object.keys(aliases).sort((a, b) => b.length - a.length);
|
|
123
|
+
for (const pattern of aliasKeys) {
|
|
124
|
+
if (pattern.endsWith('/*')) {
|
|
125
|
+
const stem = pattern.slice(0, -2);
|
|
126
|
+
if (importSpec.startsWith(stem + '/') || importSpec === stem) {
|
|
127
|
+
const tail = importSpec.slice(stem.length).replace(/^\//, '');
|
|
128
|
+
const target = aliases[pattern].replace(/\/\*$/, '');
|
|
129
|
+
return tail ? `${target}/${tail}` : target;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (importSpec === pattern) {
|
|
133
|
+
return aliases[pattern];
|
|
134
|
+
}
|
|
135
|
+
else if (importSpec.startsWith(pattern + '/')) {
|
|
136
|
+
const tail = importSpec.slice(pattern.length + 1);
|
|
137
|
+
return `${aliases[pattern]}/${tail}`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// 2. Relative resolution — `./X` or `../../X`.
|
|
141
|
+
// Engines 6.32.10+: preserve leading `/` so absolute paths
|
|
142
|
+
// (`/tmp/run/input/...`) round-trip cleanly. Earlier the empty-segment
|
|
143
|
+
// filter dropped the leading slash, breaking startsWith() matches
|
|
144
|
+
// against component sourceDirs (which keep their absolute prefix).
|
|
145
|
+
if (!importSpec.startsWith('.'))
|
|
146
|
+
return null;
|
|
147
|
+
const fromDir = fromFile.replace(/\/[^/]*$/, '');
|
|
148
|
+
const isAbsolute = fromFile.startsWith('/');
|
|
149
|
+
const segments = (fromDir + '/' + importSpec).split('/');
|
|
150
|
+
const stack = [];
|
|
151
|
+
for (const seg of segments) {
|
|
152
|
+
if (seg === '' || seg === '.')
|
|
153
|
+
continue;
|
|
154
|
+
if (seg === '..') {
|
|
155
|
+
stack.pop();
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
stack.push(seg);
|
|
159
|
+
}
|
|
160
|
+
return (isAbsolute ? '/' : '') + stack.join('/');
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Engines 6.32.7+ — parse the `compilerOptions.paths` block from a
|
|
164
|
+
* tsconfig.json and return an absolute alias map.
|
|
165
|
+
*
|
|
166
|
+
* tsconfig paths are relative to the tsconfig's directory (or to
|
|
167
|
+
* `compilerOptions.baseUrl` if set). This function resolves them to
|
|
168
|
+
* tree-relative absolute paths so the import resolver can match them
|
|
169
|
+
* against component sourceDirs without further normalisation.
|
|
170
|
+
*
|
|
171
|
+
* Returns an empty object when the tsconfig has no paths block, or
|
|
172
|
+
* when parsing fails (best-effort — broken tsconfigs shouldn't break
|
|
173
|
+
* the analyse pipeline).
|
|
174
|
+
*
|
|
175
|
+
* Note: paths entries like `[ "../../shared/ui/src/index.ts" ]` — we
|
|
176
|
+
* strip the trailing `index.ts` segment so the alias maps to the
|
|
177
|
+
* directory level (which is what the import resolver needs to match
|
|
178
|
+
* against component sourceDirs).
|
|
179
|
+
*/
|
|
180
|
+
export function parseTsconfigPaths(tsconfigSource, tsconfigDir) {
|
|
181
|
+
let parsed;
|
|
182
|
+
try {
|
|
183
|
+
parsed = JSON.parse(stripJsonComments(tsconfigSource));
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
return {};
|
|
187
|
+
}
|
|
188
|
+
const co = parsed?.compilerOptions ?? {};
|
|
189
|
+
const paths = co.paths ?? {};
|
|
190
|
+
const baseUrl = co.baseUrl ?? '.';
|
|
191
|
+
const baseDir = resolveJoin(tsconfigDir, baseUrl);
|
|
192
|
+
const out = {};
|
|
193
|
+
for (const [pattern, targets] of Object.entries(paths)) {
|
|
194
|
+
if (!Array.isArray(targets) || targets.length === 0)
|
|
195
|
+
continue;
|
|
196
|
+
const target = targets[0];
|
|
197
|
+
let resolved = resolveJoin(baseDir, target.replace(/\/\*$/, ''));
|
|
198
|
+
// Strip trailing index file so the alias points at the directory.
|
|
199
|
+
resolved = resolved.replace(/\/(index|main)\.(ts|tsx|js|jsx|mjs|cjs)$/, '');
|
|
200
|
+
out[pattern] = resolved;
|
|
201
|
+
}
|
|
202
|
+
return out;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* String-aware comment stripper for JSON-with-comments (tsconfig.json
|
|
206
|
+
* is the canonical case). Walks character by character, tracking
|
|
207
|
+
* whether we're inside a string literal — comment delimiters inside
|
|
208
|
+
* strings (e.g. paths like `"@lib/*"`) are preserved.
|
|
209
|
+
*
|
|
210
|
+
* Engines 6.32.7+. A previous regex-based approach choked on string
|
|
211
|
+
* values containing wildcards because comment-style delimiters could
|
|
212
|
+
* appear inside legitimate JSON keys like `"@lib/*"`. Walking
|
|
213
|
+
* character by character with string awareness is the only safe way.
|
|
214
|
+
*/
|
|
215
|
+
function stripJsonComments(src) {
|
|
216
|
+
let out = '';
|
|
217
|
+
let i = 0;
|
|
218
|
+
let inString = false;
|
|
219
|
+
while (i < src.length) {
|
|
220
|
+
const c = src[i];
|
|
221
|
+
if (inString) {
|
|
222
|
+
out += c;
|
|
223
|
+
if (c === '\\') {
|
|
224
|
+
out += src[i + 1] ?? '';
|
|
225
|
+
i += 2;
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
if (c === '"')
|
|
229
|
+
inString = false;
|
|
230
|
+
i++;
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
if (c === '"') {
|
|
234
|
+
inString = true;
|
|
235
|
+
out += c;
|
|
236
|
+
i++;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
if (c === '/' && src[i + 1] === '/') {
|
|
240
|
+
// Line comment — skip to end of line (preserve the newline so
|
|
241
|
+
// downstream line counting still works for error messages).
|
|
242
|
+
const nl = src.indexOf('\n', i);
|
|
243
|
+
if (nl < 0)
|
|
244
|
+
return out;
|
|
245
|
+
i = nl;
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
if (c === '/' && src[i + 1] === '*') {
|
|
249
|
+
const end = src.indexOf('*/', i + 2);
|
|
250
|
+
if (end < 0)
|
|
251
|
+
return out;
|
|
252
|
+
i = end + 2;
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
out += c;
|
|
256
|
+
i++;
|
|
257
|
+
}
|
|
258
|
+
return out;
|
|
259
|
+
}
|
|
260
|
+
function resolveJoin(base, rel) {
|
|
261
|
+
const stack = base.split('/').filter((s) => s !== '' && s !== '.');
|
|
262
|
+
for (const seg of rel.split('/')) {
|
|
263
|
+
if (seg === '' || seg === '.')
|
|
264
|
+
continue;
|
|
265
|
+
if (seg === '..') {
|
|
266
|
+
stack.pop();
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
stack.push(seg);
|
|
270
|
+
}
|
|
271
|
+
return (base.startsWith('/') ? '/' : '') + stack.join('/');
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Match a resolved import path against component sourceDirs and return
|
|
275
|
+
* the owning component's suggestedName. Picks the LONGEST matching
|
|
276
|
+
* sourceDir prefix (handles the case where one component's dir is
|
|
277
|
+
* nested inside another's). Returns null if no component owns the path.
|
|
278
|
+
*/
|
|
279
|
+
export function findOwningComponent(resolvedPath, components) {
|
|
280
|
+
let best = null;
|
|
281
|
+
for (const comp of components) {
|
|
282
|
+
const sd = comp.structural?.sourceDir;
|
|
283
|
+
if (!sd)
|
|
284
|
+
continue;
|
|
285
|
+
if (resolvedPath === sd || resolvedPath.startsWith(sd + '/') || resolvedPath.startsWith(sd)) {
|
|
286
|
+
if (!best || sd.length > best.len) {
|
|
287
|
+
best = { name: comp.suggestedName, len: sd.length };
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return best?.name ?? null;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Build the per-consumer imports graph. Each component's files are
|
|
295
|
+
* walked, their imports parsed, and resolved against the source tree;
|
|
296
|
+
* imports that cross into another component's sourceDir are aggregated.
|
|
297
|
+
*/
|
|
298
|
+
export async function buildImportsByComponent(opts) {
|
|
299
|
+
const result = {};
|
|
300
|
+
const components = opts.facts.suggestedComponents ?? [];
|
|
301
|
+
if (components.length === 0)
|
|
302
|
+
return result;
|
|
303
|
+
const fileExt = opts.extensionFilter ?? defaultExtFilter;
|
|
304
|
+
const filesByComponent = new Map();
|
|
305
|
+
for (const comp of components) {
|
|
306
|
+
filesByComponent.set(comp.suggestedName, []);
|
|
307
|
+
}
|
|
308
|
+
// Collect all files known to the prepass — candidateMethods + views +
|
|
309
|
+
// entities + routes is sufficient coverage; we don't re-walk the FS.
|
|
310
|
+
const allFiles = new Set();
|
|
311
|
+
for (const cm of opts.facts.candidateMethods ?? [])
|
|
312
|
+
allFiles.add(cm.filePath);
|
|
313
|
+
for (const v of opts.facts.views ?? [])
|
|
314
|
+
allFiles.add(v.filePath);
|
|
315
|
+
for (const e of opts.facts.entities ?? []) {
|
|
316
|
+
if (e.filePath)
|
|
317
|
+
allFiles.add(e.filePath);
|
|
318
|
+
}
|
|
319
|
+
for (const r of opts.facts.routes ?? []) {
|
|
320
|
+
if (r.filePath)
|
|
321
|
+
allFiles.add(r.filePath);
|
|
322
|
+
}
|
|
323
|
+
for (const file of allFiles) {
|
|
324
|
+
if (!fileExt(file))
|
|
325
|
+
continue;
|
|
326
|
+
const owner = findOwningComponent(file, components);
|
|
327
|
+
if (owner)
|
|
328
|
+
filesByComponent.get(owner).push(file);
|
|
329
|
+
}
|
|
330
|
+
// Engines 6.32.7+ — load each component's tsconfig.json paths block
|
|
331
|
+
// upfront so workspace-style aliases (`@shared/ui`, `@/*`) resolve to
|
|
332
|
+
// tree-paths the resolver can match. Most monorepos use these
|
|
333
|
+
// patterns; without alias resolution idle-meta-style codebases
|
|
334
|
+
// produce zero detected cross-component imports.
|
|
335
|
+
//
|
|
336
|
+
// Engines 6.32.8+ — also load each component's package.json `name`
|
|
337
|
+
// field. Workspace imports like `import { X } from '@idle-games/ui'`
|
|
338
|
+
// resolve via npm/yarn workspaces, not tsconfig paths. We build a
|
|
339
|
+
// shared-alias bag keyed by package name → owning component sourceDir
|
|
340
|
+
// and merge it with each component's tsconfig aliases.
|
|
341
|
+
const packageAliases = {};
|
|
342
|
+
for (const comp of components) {
|
|
343
|
+
const sd = comp.structural?.sourceDir;
|
|
344
|
+
if (!sd)
|
|
345
|
+
continue;
|
|
346
|
+
try {
|
|
347
|
+
const pkgJson = await opts.readFile(`${sd}/package.json`);
|
|
348
|
+
if (pkgJson) {
|
|
349
|
+
const parsed = JSON.parse(pkgJson);
|
|
350
|
+
if (parsed?.name) {
|
|
351
|
+
// Conventional source-root for TS packages — most monorepos
|
|
352
|
+
// ship from `src/` or `lib/`. Probe a couple of obvious dirs;
|
|
353
|
+
// if neither exists, fall through to the package root.
|
|
354
|
+
packageAliases[parsed.name] = sd;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
catch { /* missing or malformed package.json — skip */ }
|
|
359
|
+
}
|
|
360
|
+
const aliasesByComponent = new Map();
|
|
361
|
+
for (const comp of components) {
|
|
362
|
+
const sd = comp.structural?.sourceDir;
|
|
363
|
+
if (!sd)
|
|
364
|
+
continue;
|
|
365
|
+
let tsAliases = {};
|
|
366
|
+
try {
|
|
367
|
+
const tsconfig = await opts.readFile(`${sd}/tsconfig.json`);
|
|
368
|
+
if (tsconfig)
|
|
369
|
+
tsAliases = parseTsconfigPaths(tsconfig, sd);
|
|
370
|
+
}
|
|
371
|
+
catch { /* component without a tsconfig */ }
|
|
372
|
+
// tsconfig aliases override workspace package names when both
|
|
373
|
+
// patterns match (the local tsconfig is the closer authority).
|
|
374
|
+
aliasesByComponent.set(comp.suggestedName, { ...packageAliases, ...tsAliases });
|
|
375
|
+
}
|
|
376
|
+
for (const consumer of components) {
|
|
377
|
+
const files = filesByComponent.get(consumer.suggestedName) ?? [];
|
|
378
|
+
if (files.length === 0)
|
|
379
|
+
continue;
|
|
380
|
+
const aliases = aliasesByComponent.get(consumer.suggestedName) ?? {};
|
|
381
|
+
// Build with Sets for O(1) dedup, then convert to sorted arrays.
|
|
382
|
+
const perTarget = new Map();
|
|
383
|
+
for (const file of files) {
|
|
384
|
+
let source;
|
|
385
|
+
try {
|
|
386
|
+
source = await opts.readFile(file);
|
|
387
|
+
}
|
|
388
|
+
catch {
|
|
389
|
+
continue; // unreadable files don't block the others
|
|
390
|
+
}
|
|
391
|
+
const imports = parseImports(source);
|
|
392
|
+
for (const imp of imports) {
|
|
393
|
+
const resolved = resolveImportPath(file, imp.source, aliases);
|
|
394
|
+
if (!resolved)
|
|
395
|
+
continue;
|
|
396
|
+
const target = findOwningComponent(resolved, components);
|
|
397
|
+
if (!target || target === consumer.suggestedName)
|
|
398
|
+
continue;
|
|
399
|
+
if (!perTarget.has(target))
|
|
400
|
+
perTarget.set(target, new Set());
|
|
401
|
+
const bucket = perTarget.get(target);
|
|
402
|
+
for (const name of imp.names)
|
|
403
|
+
bucket.add(name);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (perTarget.size > 0) {
|
|
407
|
+
const targetMap = {};
|
|
408
|
+
for (const [target, names] of perTarget) {
|
|
409
|
+
targetMap[target] = [...names].sort();
|
|
410
|
+
}
|
|
411
|
+
result[consumer.suggestedName] = targetMap;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return result;
|
|
415
|
+
}
|
|
416
|
+
function defaultExtFilter(path) {
|
|
417
|
+
return /\.(ts|tsx|js|jsx|mjs|cjs)$/.test(path);
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Convenience: build the imports graph from a StructuralPrepass backend.
|
|
421
|
+
* The backend's `fileSourceText` provides the file reader; this is the
|
|
422
|
+
* same surface the adapters use to read files.
|
|
423
|
+
*/
|
|
424
|
+
export async function buildImportsByComponentFromBackend(facts, backend) {
|
|
425
|
+
return buildImportsByComponent({
|
|
426
|
+
facts,
|
|
427
|
+
readFile: (path) => backend.fileSourceText(path),
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
//# sourceMappingURL=imports-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports-graph.js","sourceRoot":"","sources":["../../src/analyse-prepass/imports-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAwBH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,+DAA+D;IAC/D,MAAM,OAAO,GAAG,MAAM;SACnB,OAAO,CAAC,mBAAmB,EAAE,GAAG,CAAC;SACjC,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;IACxC,MAAM,GAAG,GAAmB,EAAE,CAAC;IAE/B,sDAAsD;IACtD,SAAS;IACT,oCAAoC;IACpC,wBAAwB;IACxB,+BAA+B;IAC/B,6BAA6B;IAC7B,wDAAwD;IACxD,iCAAiC;IACjC,MAAM,IAAI,GAAG,wHAAwH,CAAC;IACtI,IAAI,CAAyB,CAAC;IAC9B,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,C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AK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK;oBAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,SAAS,GAA6B,EAAE,CAAC;YAC/C,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,SAAS,EAAE,CAAC;gBACxC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;YACxC,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;QAC7C,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kCAAkC,CACtD,KAAqB,EACrB,OAA0B;IAE1B,OAAO,uBAAuB,CAAC;QAC7B,KAAK;QACL,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;KACjD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -153,6 +153,24 @@ export interface SpecVerseFacts {
|
|
|
153
153
|
* (engines 6.30.3+). Used by skeleton-emitter as the view's
|
|
154
154
|
* `description:` when present; falls back to humanized name otherwise. */
|
|
155
155
|
docstring?: string;
|
|
156
|
+
/** Engines 6.31.0+. Classified standard view type (`list`, `form`,
|
|
157
|
+
* `detail`, `dashboard`, `modal`, `provider`, `screen`, `layout`,
|
|
158
|
+
* `widget`, `page`, ...). Emitted into the spec as `type:`. */
|
|
159
|
+
viewType?: string;
|
|
160
|
+
/** Engines 6.31.0+. Sub-component names rendered inside this view's
|
|
161
|
+
* JSX. Skeleton-emitter cross-references against detected views to
|
|
162
|
+
* keep only known refs. */
|
|
163
|
+
usesComponents?: string[];
|
|
164
|
+
/** Engines 6.31.0+. Action handles extracted from button/link
|
|
165
|
+
* click handlers (handler name, optional label + variant). */
|
|
166
|
+
actions?: Array<{
|
|
167
|
+
name: string;
|
|
168
|
+
label?: string;
|
|
169
|
+
variant?: 'primary' | 'destructive' | 'secondary';
|
|
170
|
+
}>;
|
|
171
|
+
/** Engines 6.31.0+. True when the view has an explicit empty-state
|
|
172
|
+
* branch (zero-items / isEmpty). */
|
|
173
|
+
emptyState?: boolean;
|
|
156
174
|
}>;
|
|
157
175
|
/**
|
|
158
176
|
* HTTP routes detected via the backend's native route extraction
|
|
@@ -211,6 +229,19 @@ export interface SpecVerseFacts {
|
|
|
211
229
|
step: number;
|
|
212
230
|
}>;
|
|
213
231
|
}>;
|
|
232
|
+
/**
|
|
233
|
+
* Per-consumer cross-component import graph (engines 6.32.6+,
|
|
234
|
+
* 2026-05-07 — Dom Williams shared-library / reference-or-implicit-
|
|
235
|
+
* include feedback). Map shape: `{ [consumerComponent]: { [targetComponent]:
|
|
236
|
+
* [...importedSymbols] } }`. Populated by walking each component's
|
|
237
|
+
* source files for `import { ... } from '...'` statements and
|
|
238
|
+
* resolving the path against the other components' sourceDirs.
|
|
239
|
+
*
|
|
240
|
+
* Skeleton-emitter uses this to emit per-component `import:` blocks
|
|
241
|
+
* — a real cross-component dependency model that the schema has long
|
|
242
|
+
* supported but our analyse pipeline never produced.
|
|
243
|
+
*/
|
|
244
|
+
importsByComponent?: Record<string, Record<string, string[]>>;
|
|
214
245
|
/**
|
|
215
246
|
* Audit-trail decision log — one entry per walker class, including
|
|
216
247
|
* methods that were filtered out + their drop reason. Populated when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analyse-prepass/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,MA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
...(v.docstring ? { docstring: v.docstring } : {}),
|
|
453
|
+
...(v.viewType ? { viewType: v.viewType } : {}),
|
|
454
|
+
...(v.usesComponents && v.usesComponents.length > 0 ? { usesComponents: v.usesComponents } : {}),
|
|
455
|
+
...(v.actions && v.actions.length > 0 ? { actions: v.actions } : {}),
|
|
456
|
+
...(v.emptyState ? { emptyState: true } : {}),
|
|
453
457
|
});
|
|
454
458
|
}
|
|
455
459
|
}
|
|
@@ -691,6 +695,24 @@ export async function runPrepass(sourceDir, options = {}) {
|
|
|
691
695
|
}
|
|
692
696
|
catch { /* best-effort */ }
|
|
693
697
|
}
|
|
698
|
+
// Engines 6.32.6+ — cross-component imports graph. Walks each
|
|
699
|
+
// component's source files for `import { ... } from '...'` and
|
|
700
|
+
// resolves to the owning component sourceDir; surfaces the consumer
|
|
701
|
+
// → library dependency that the source has but the spec previously
|
|
702
|
+
// didn't model. See `imports-graph.ts` for matching rules.
|
|
703
|
+
// Best-effort: if file reads fail we leave the field unset.
|
|
704
|
+
if ((facts.suggestedComponents?.length ?? 0) > 1) {
|
|
705
|
+
try {
|
|
706
|
+
const { buildImportsByComponentFromBackend } = await import('./imports-graph.js');
|
|
707
|
+
const importsByComponent = await buildImportsByComponentFromBackend(facts, prepass);
|
|
708
|
+
if (Object.keys(importsByComponent).length > 0) {
|
|
709
|
+
facts.importsByComponent = importsByComponent;
|
|
710
|
+
if (!adaptersRun.includes('imports-graph'))
|
|
711
|
+
adaptersRun.push('imports-graph');
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
catch { /* best-effort — imports remain unset */ }
|
|
715
|
+
}
|
|
694
716
|
facts.meta.durationMs = Date.now() - start;
|
|
695
717
|
return facts;
|
|
696
718
|
}
|