@beehexa/hexasync-template-index 2608.20.18 → 2608.20.31
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/checkpoints.d.ts +47 -0
- package/dist/checkpoints.d.ts.map +1 -0
- package/dist/checkpoints.js +59 -0
- package/dist/checkpoints.js.map +1 -0
- package/dist/cursorContext.d.ts +204 -0
- package/dist/cursorContext.d.ts.map +1 -0
- package/dist/cursorContext.js +479 -0
- package/dist/cursorContext.js.map +1 -0
- package/dist/detectors.d.ts +103 -0
- package/dist/detectors.d.ts.map +1 -0
- package/dist/detectors.js +104 -0
- package/dist/detectors.js.map +1 -0
- package/dist/discovery.d.ts +249 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +455 -0
- package/dist/discovery.js.map +1 -0
- package/dist/effectiveGraph.d.ts +251 -0
- package/dist/effectiveGraph.d.ts.map +1 -0
- package/dist/effectiveGraph.js +559 -0
- package/dist/effectiveGraph.js.map +1 -0
- package/dist/failures.d.ts +50 -0
- package/dist/failures.d.ts.map +1 -0
- package/dist/failures.js +125 -0
- package/dist/failures.js.map +1 -0
- package/dist/graph.d.ts +47 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +230 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/queries.d.ts +102 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +469 -0
- package/dist/queries.js.map +1 -0
- package/dist/ranges.d.ts +104 -0
- package/dist/ranges.d.ts.map +1 -0
- package/dist/ranges.js +411 -0
- package/dist/ranges.js.map +1 -0
- package/dist/resolveField.d.ts +125 -0
- package/dist/resolveField.d.ts.map +1 -0
- package/dist/resolveField.js +234 -0
- package/dist/resolveField.js.map +1 -0
- package/dist/tier1Service.d.ts +96 -0
- package/dist/tier1Service.d.ts.map +1 -0
- package/dist/tier1Service.js +194 -0
- package/dist/tier1Service.js.map +1 -0
- package/dist/tier2Service.d.ts +195 -0
- package/dist/tier2Service.d.ts.map +1 -0
- package/dist/tier2Service.js +642 -0
- package/dist/tier2Service.js.map +1 -0
- package/dist/yamlScalar.d.ts +17 -0
- package/dist/yamlScalar.d.ts.map +1 -0
- package/dist/yamlScalar.js +101 -0
- package/dist/yamlScalar.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tier 1 discovery — find every project in a workspace by locating its `main.yaml` (Story 2.1).
|
|
3
|
+
*
|
|
4
|
+
* "Tier 1" means eager and workspace-wide, and the only thing that makes that affordable is how
|
|
5
|
+
* little it reads: one `main.yaml` per project and nothing else. The corpus holds 7,729 YAML
|
|
6
|
+
* files across 113 projects, so parsing anything more would put NFR-4's 2-second budget out of
|
|
7
|
+
* reach on principle rather than by a margin.
|
|
8
|
+
*
|
|
9
|
+
* TWO KINDS OF PROJECT, detected differently, because they are different document families:
|
|
10
|
+
*
|
|
11
|
+
* - a **profile template** is identified by `main.yaml`, and never by `output.yaml` (FR-37).
|
|
12
|
+
* `output.yaml` is a build artefact: absent in projects nobody has composed yet and present
|
|
13
|
+
* in folders that are not projects at all, so it would be wrong in both directions.
|
|
14
|
+
* - a **connector template** is identified by an `hx-connectors.json` marker. The folder holding
|
|
15
|
+
* that marker IS the connector project — connector definitions are flat catalogue entries
|
|
16
|
+
* (`connectorId`, `systemId`, `systemArea`) with no `main.yaml` anywhere.
|
|
17
|
+
*
|
|
18
|
+
* The distinction is not cosmetic. `compose` operates on profile templates ONLY; `compose
|
|
19
|
+
* description` works on either, because it inlines `!md[...]` and depends on no business rule.
|
|
20
|
+
* Anything offering a profile-only action has to be able to tell the two apart, and detecting
|
|
21
|
+
* only `main.yaml` cannot — it makes a connector folder look like no project at all.
|
|
22
|
+
*
|
|
23
|
+
* There is deliberately no fixed `connectors/` path. A workspace may declare several connector
|
|
24
|
+
* roots, anywhere; the marker is the signal.
|
|
25
|
+
*/
|
|
26
|
+
import { basenameUri, dirnameUri, joinUri, normalizeUri, } from '@beehexa/hexasync-template-model';
|
|
27
|
+
import { DEFAULT_DETECTORS, acceptAll, detectorFor, partialsAwareRoot, } from './detectors.js';
|
|
28
|
+
/**
|
|
29
|
+
* Paths never opened by either tier (Story 2.1, last AC).
|
|
30
|
+
*
|
|
31
|
+
* `__configs/**` is the known case — generated content that is not authored and must not appear
|
|
32
|
+
* in the index, in diagnostics, or in any coverage metric. Configurable rather than hard-coded
|
|
33
|
+
* because the next generated directory will have a different name and nobody will remember to
|
|
34
|
+
* come back here.
|
|
35
|
+
*/
|
|
36
|
+
export const DEFAULT_IGNORED_PATH_SEGMENTS = [
|
|
37
|
+
'__configs',
|
|
38
|
+
'node_modules',
|
|
39
|
+
'.git',
|
|
40
|
+
];
|
|
41
|
+
/** True when any path segment is on the ignore list. */
|
|
42
|
+
export function isIgnoredPath(uri, ignored = DEFAULT_IGNORED_PATH_SEGMENTS) {
|
|
43
|
+
// Segment-wise, not `includes`: a substring test would ignore `my__configs_backup/`, and a
|
|
44
|
+
// silently under-indexed workspace is far harder to notice than an over-indexed one.
|
|
45
|
+
const segments = normalizeUri(uri).split('/');
|
|
46
|
+
return segments.some((segment) => ignored.includes(segment));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The display name for a project rooted at `componentPath`.
|
|
50
|
+
*
|
|
51
|
+
* `main.yaml` lives in `<project>/partials/`, so the project is the PARENT — except where the
|
|
52
|
+
* folder is not named `partials`/`partial` at all, in which case it is its own project folder.
|
|
53
|
+
* Both spellings are accepted on read (FR-38); only `partials` is ever emitted.
|
|
54
|
+
*/
|
|
55
|
+
export function projectNameFor(componentPath) {
|
|
56
|
+
return basenameUri(partialsAwareRoot(componentPath)) || componentPath;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* One `DiscoveredProject` from one descriptor, shared by the downward scan and the upward walk.
|
|
60
|
+
*
|
|
61
|
+
* Factored out when `locateProjectUpward` arrived: two constructions would be two chances to
|
|
62
|
+
* disagree about a project's id, name or component path, and every consumer keys on those.
|
|
63
|
+
*/
|
|
64
|
+
function projectFrom(detector, descriptorPath, descriptorText) {
|
|
65
|
+
const componentPath = detector.componentPathFor(descriptorPath);
|
|
66
|
+
return {
|
|
67
|
+
kind: detector.kind,
|
|
68
|
+
id: componentPath,
|
|
69
|
+
name: detector.nameFor(componentPath),
|
|
70
|
+
componentPath,
|
|
71
|
+
descriptorPath,
|
|
72
|
+
descriptorText,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Both spellings of the component folder, because 2 of the 113 corpus projects use the singular
|
|
77
|
+
* (FR-38). Probed from a project ROOT, where the descriptor sits one level down.
|
|
78
|
+
*/
|
|
79
|
+
const COMPONENT_DIRS = ['partials', 'partial'];
|
|
80
|
+
/**
|
|
81
|
+
* The descriptor FILENAME a detector looks for, when its glob names exactly one.
|
|
82
|
+
*
|
|
83
|
+
* `**/main.yaml` → `main.yaml`. Returns undefined for anything more elaborate rather than guessing:
|
|
84
|
+
* a detector whose descriptor cannot be named this way is one the upward walk must admit it cannot
|
|
85
|
+
* find, and `locateProjectUpward` reports that instead of silently answering "no project".
|
|
86
|
+
*/
|
|
87
|
+
export function descriptorNameOf(detector) {
|
|
88
|
+
const glob = detector.descriptorGlob;
|
|
89
|
+
if (!glob.startsWith('**/'))
|
|
90
|
+
return undefined;
|
|
91
|
+
const tail = glob.slice(3);
|
|
92
|
+
return tail.length > 0 && !tail.includes('/') && !tail.includes('*')
|
|
93
|
+
? tail
|
|
94
|
+
: undefined;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Every project in the workspace, WITHOUT reading a single descriptor.
|
|
98
|
+
*
|
|
99
|
+
* For a list — "show me the projects so I can go to one" — the descriptor's CONTENT buys nothing:
|
|
100
|
+
* `nameFor` derives the name from the folder path, `kind` comes from which glob matched, and both shipped
|
|
101
|
+
* detectors accept every candidate (`accepts: acceptAll`). So `discoverProjects`' read per project is pure
|
|
102
|
+
* cost here: 115 of them on the reported workspace, for information no consumer of a list uses.
|
|
103
|
+
*
|
|
104
|
+
* `discoverProjects` still exists and still reads, because the INHERITANCE questions genuinely need each
|
|
105
|
+
* project's `externals` — who declares a shared file, and who inherits a project. This is the cheap half,
|
|
106
|
+
* for the question that only needs to know that a project is there.
|
|
107
|
+
*
|
|
108
|
+
* A detector whose `accepts` is not the default is EXCLUDED and named in `unverifiable`, because listing a
|
|
109
|
+
* candidate this function cannot confirm would be claiming a project exists on the strength of a filename.
|
|
110
|
+
*/
|
|
111
|
+
export async function listProjects(rootUri, reader, options = {}) {
|
|
112
|
+
const ignored = options.ignoredPathSegments ?? DEFAULT_IGNORED_PATH_SEGMENTS;
|
|
113
|
+
const detectors = options.detectors ?? DEFAULT_DETECTORS;
|
|
114
|
+
const keep = (uri) => !isIgnoredPath(uri, ignored);
|
|
115
|
+
const listable = detectors.filter((detector) => detector.accepts === acceptAll);
|
|
116
|
+
const unverifiable = detectors
|
|
117
|
+
.filter((detector) => detector.accepts !== acceptAll)
|
|
118
|
+
.map((detector) => detector.kind);
|
|
119
|
+
// One glob per kind, concurrently — the same shape `discoverProjects` uses, minus every read.
|
|
120
|
+
const hits = await Promise.all(listable.map(async (detector) => ({
|
|
121
|
+
detector,
|
|
122
|
+
uris: (await reader.glob(rootUri, detector.descriptorGlob)).filter(keep),
|
|
123
|
+
})));
|
|
124
|
+
const byId = new Map();
|
|
125
|
+
// Highest precedence first, so a folder claimed by two kinds resolves by the declared rule.
|
|
126
|
+
for (const { detector, uris } of [...hits].sort((a, b) => b.detector.precedence - a.detector.precedence)) {
|
|
127
|
+
for (const raw of uris) {
|
|
128
|
+
const descriptorPath = normalizeUri(raw);
|
|
129
|
+
const componentPath = detector.componentPathFor(descriptorPath);
|
|
130
|
+
if (byId.has(componentPath))
|
|
131
|
+
continue;
|
|
132
|
+
byId.set(componentPath, {
|
|
133
|
+
kind: detector.kind,
|
|
134
|
+
id: componentPath,
|
|
135
|
+
componentPath,
|
|
136
|
+
descriptorPath,
|
|
137
|
+
name: detector.nameFor(componentPath),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
projects: [...byId.values()].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : a.id < b.id ? -1 : 1),
|
|
143
|
+
unverifiable,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The project owning ONE file, by walking UP from it (NFR-8).
|
|
148
|
+
*
|
|
149
|
+
* ### Why this exists
|
|
150
|
+
*
|
|
151
|
+
* `discoverProjects` answers "every project in the workspace", and the editor was using it to answer
|
|
152
|
+
* "which project is this file in" — building a complete list and then searching it. On a monorepo root
|
|
153
|
+
* that cost **234 seconds** (measured: 12,979 directories, three workspace-wide globs, ~6 ms per
|
|
154
|
+
* directory through the host's file search) to answer a question about a single file. NFR-8 forbids
|
|
155
|
+
* eager workspace indexing, and that scan was one.
|
|
156
|
+
*
|
|
157
|
+
* Walking up costs one read per candidate per level — about seven for a file inside `partials`,
|
|
158
|
+
* because the first level up IS the component folder and its descriptor is right there.
|
|
159
|
+
*
|
|
160
|
+
* ### Why upward is not just faster but MORE correct
|
|
161
|
+
*
|
|
162
|
+
* Projects nest (FR-39). `projectForFile` resolves that by preferring the deepest root, because a file
|
|
163
|
+
* in `variux/maileg-2025/eu` belongs to `eu` and not to the outer `variux`. A downward scan that
|
|
164
|
+
* stopped at the first descriptor it met would answer with the OUTERMOST project; walking up and
|
|
165
|
+
* stopping at the first one gives the deepest, which is the right answer, for free.
|
|
166
|
+
*
|
|
167
|
+
* ### The shortcut that is deliberately NOT taken
|
|
168
|
+
*
|
|
169
|
+
* It is tempting to jump straight to the nearest `partials` segment in the file's own path — one read
|
|
170
|
+
* for the common case instead of a dozen. It is also wrong: a project declared WITHOUT a component
|
|
171
|
+
* folder (a connector root) can sit deeper than the nearest `partials`, and the jump would answer with
|
|
172
|
+
* the shallower one. `projectForFile` resolves nesting by depth regardless of kind, so the walk has to
|
|
173
|
+
* as well. A dozen reads is ~80 ms against the 234,000 ms this replaces; correctness is worth more than
|
|
174
|
+
* the remainder.
|
|
175
|
+
*
|
|
176
|
+
* ### A loop, deliberately
|
|
177
|
+
*
|
|
178
|
+
* Iterative, with two independent termination conditions: leaving the root, and `dirnameUri` reaching
|
|
179
|
+
* its own fixed point. A recursive walk over a path that never shortens is a stack overflow in the
|
|
180
|
+
* extension host; a loop that cannot advance simply stops.
|
|
181
|
+
*/
|
|
182
|
+
export async function locateProjectUpward(input) {
|
|
183
|
+
const ignored = input.ignoredPathSegments ?? DEFAULT_IGNORED_PATH_SEGMENTS;
|
|
184
|
+
const root = normalizeUri(input.rootUri);
|
|
185
|
+
// Highest precedence first, so a folder claimed by two kinds resolves by the declared rule rather
|
|
186
|
+
// than by which detector happens to be listed first — the same order the downward scan uses.
|
|
187
|
+
const ordered = [...(input.detectors ?? DEFAULT_DETECTORS)].sort((a, b) => b.precedence - a.precedence);
|
|
188
|
+
const searchable = ordered
|
|
189
|
+
.map((detector) => ({ detector, name: descriptorNameOf(detector) }))
|
|
190
|
+
.filter((entry) => entry.name !== undefined);
|
|
191
|
+
const unsearchable = ordered
|
|
192
|
+
.filter((detector) => descriptorNameOf(detector) === undefined)
|
|
193
|
+
.map((detector) => detector.kind);
|
|
194
|
+
let levels = 0;
|
|
195
|
+
let reads = 0;
|
|
196
|
+
let dir = dirnameUri(normalizeUri(input.fileUri));
|
|
197
|
+
while (dir === root || dir.startsWith(`${root}/`)) {
|
|
198
|
+
levels += 1;
|
|
199
|
+
if (!isIgnoredPath(dir, ignored)) {
|
|
200
|
+
for (const { detector, name } of searchable) {
|
|
201
|
+
// The descriptor here, then one level down through the component folder. The second probe is
|
|
202
|
+
// what makes a file in `<project>/docs/` belong to the project: the profile kind's root is the
|
|
203
|
+
// PARENT of `partials`, so standing at the root the descriptor is not in this directory.
|
|
204
|
+
const candidates = [
|
|
205
|
+
joinUri(dir, name),
|
|
206
|
+
...COMPONENT_DIRS.map((component) => joinUri(dir, component, name)),
|
|
207
|
+
];
|
|
208
|
+
for (const candidate of candidates) {
|
|
209
|
+
reads += 1;
|
|
210
|
+
// `read`, not `exists`: the descriptor's TEXT is needed anyway — for `accepts` and for the
|
|
211
|
+
// project's own record — so asking twice would double the round trips this exists to save.
|
|
212
|
+
const text = await input.reader.read(candidate);
|
|
213
|
+
if (text === undefined)
|
|
214
|
+
continue;
|
|
215
|
+
if (!detector.accepts(candidate, text))
|
|
216
|
+
continue;
|
|
217
|
+
return {
|
|
218
|
+
project: projectFrom(detector, candidate, text),
|
|
219
|
+
levels,
|
|
220
|
+
reads,
|
|
221
|
+
unsearchable,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const parent = dirnameUri(dir);
|
|
227
|
+
// The loop's own guard, independent of the prefix test above: `dirnameUri` of a root-most path
|
|
228
|
+
// returns itself, and without this the walk would spin on it forever.
|
|
229
|
+
if (parent === dir)
|
|
230
|
+
break;
|
|
231
|
+
dir = parent;
|
|
232
|
+
}
|
|
233
|
+
return undefined;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Whether a descriptor falls inside the area its kind's scope markers declare.
|
|
237
|
+
*
|
|
238
|
+
* ## The rule
|
|
239
|
+
*
|
|
240
|
+
* A scope marker declares its own folder as a root, and vetoes stray descriptors **among its
|
|
241
|
+
* siblings** — never across the workspace. Three cases, and the third is the one that changed:
|
|
242
|
+
*
|
|
243
|
+
* | the descriptor | verdict |
|
|
244
|
+
* | --- | --- |
|
|
245
|
+
* | under some scope root | in scope — that is what the marker declares |
|
|
246
|
+
* | under a scope root's PARENT but under no root | out of scope — the stray this rule exists to reject |
|
|
247
|
+
* | outside every scope root's parent | in scope — no marker here claims to describe it |
|
|
248
|
+
*
|
|
249
|
+
* With no markers at all nothing is vetoed, exactly as before: a workspace that has not adopted them
|
|
250
|
+
* keeps working unchanged.
|
|
251
|
+
*
|
|
252
|
+
* ## ⛔ Why it is no longer workspace-wide
|
|
253
|
+
*
|
|
254
|
+
* It used to be `scopes.length === 0 || scopes.some(under)` — any marker anywhere made every
|
|
255
|
+
* descriptor outside it invisible. That reads as "a workspace that declares its roots means them",
|
|
256
|
+
* and it holds only while a workspace folder is exactly one repository.
|
|
257
|
+
*
|
|
258
|
+
* Reported 2026-08-15. A developer opened a parent folder holding several repositories side by side:
|
|
259
|
+
* the templates corpus (115 projects, and its `.gitignore` hid `hx-*.json`, so a fresh clone carried
|
|
260
|
+
* no marker at all) next to `hexasync-templates-vscode-ext`, which COMMITTED an `examples/hx-templates.json`
|
|
261
|
+
* containing `{}` beside no YAML whatsoever. One content-free fixture, four directories away, scoped
|
|
262
|
+
* the entire workspace to itself:
|
|
263
|
+
*
|
|
264
|
+
* ```
|
|
265
|
+
* discoverProjects(parent) → 1 project [hexasync-templates-vscode-ext/examples]
|
|
266
|
+
* listProjects(parent) → 116 projects
|
|
267
|
+
* ```
|
|
268
|
+
*
|
|
269
|
+
* Nothing reported it. `projectOf` answered "no project" for all 115, the VS Code extension wrote
|
|
270
|
+
* `yaml.schemas` globs covering only `examples/**`, and the author's whole IntelliSense went quiet —
|
|
271
|
+
* no enum completions on `indexGroups`, `displayType`, `type` or `method`, no schema hovers, no schema
|
|
272
|
+
* validation. The visible symptom was Ctrl+Space returning nothing.
|
|
273
|
+
*
|
|
274
|
+
* That is the second incident from this mechanism. `apps/cli/src/__tests__/tier1Corpus.spec.ts`
|
|
275
|
+
* records the first: one stray `hx-templates.json` containing `{}`, left behind in the corpus. Both
|
|
276
|
+
* times an EMPTY marker in a place nobody was thinking about silently deleted the answer, because the
|
|
277
|
+
* veto reached further than the thing that declared it.
|
|
278
|
+
*
|
|
279
|
+
* The parent bound is what a marker can actually speak for. It still rejects the stray it was written
|
|
280
|
+
* for — markers at `001-projects/variux`, `001-projects/vin` and so on reject
|
|
281
|
+
* `001-projects/junk/partials/main.yaml` — and it can no longer reach into a sibling repository that
|
|
282
|
+
* never declared anything.
|
|
283
|
+
*
|
|
284
|
+
* A marker AT the workspace root keeps the old behaviour by construction: its parent is above the
|
|
285
|
+
* root, so its veto region is the whole workspace and every descriptor is under the root anyway.
|
|
286
|
+
*
|
|
287
|
+
* @param scopeRoots the folders holding a marker, normalized, `[]` when the kind declares no marker
|
|
288
|
+
* glob or none were found.
|
|
289
|
+
*/
|
|
290
|
+
export function scopeTest(scopeRoots) {
|
|
291
|
+
if (scopeRoots.length === 0)
|
|
292
|
+
return () => true;
|
|
293
|
+
const under = (uri, root) => uri === root || uri.startsWith(`${root}/`);
|
|
294
|
+
// Deduplicated: 91 marker roots in the corpus collapse to a handful of parents, and the test below
|
|
295
|
+
// runs once per descriptor.
|
|
296
|
+
const vetoRegions = [...new Set(scopeRoots.map((root) => dirnameUri(root)))];
|
|
297
|
+
return (uri) => scopeRoots.some((root) => under(uri, root)) ||
|
|
298
|
+
!vetoRegions.some((region) => under(uri, region));
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Find every project under `rootUri`.
|
|
302
|
+
*
|
|
303
|
+
* Projects nest arbitrarily (FR-39) — `001-projects/variux` alone contains 27 — so this globs the
|
|
304
|
+
* whole subtree rather than walking a fixed depth. The ignore list is applied to the glob results
|
|
305
|
+
* BEFORE any file is opened, which is the point: an ignored path must cost nothing to skip.
|
|
306
|
+
*
|
|
307
|
+
* WORKSPACE-WIDE, and therefore expensive: on a monorepo root this is 234 seconds. It answers a
|
|
308
|
+
* question only three features actually ask — workspace symbols, the project picker, and Find
|
|
309
|
+
* References' cold inheritance search (FR-90 AC 3, where the `type: project` edge is declared at the
|
|
310
|
+
* OTHER end and so cannot be read from one project's own files). "Which project is this file in" is
|
|
311
|
+
* `locateProjectUpward`, and must not come from here.
|
|
312
|
+
*/
|
|
313
|
+
export async function discoverProjects(rootUri, reader, options = {}) {
|
|
314
|
+
const ignored = options.ignoredPathSegments ?? DEFAULT_IGNORED_PATH_SEGMENTS;
|
|
315
|
+
const detectors = options.detectors ?? DEFAULT_DETECTORS;
|
|
316
|
+
const keep = (uri) => !isIgnoredPath(uri, ignored);
|
|
317
|
+
// One glob per kind, concurrently. Globbing is the expensive half of Tier 1 and the kinds are
|
|
318
|
+
// independent, so there is no reason to serialize them.
|
|
319
|
+
const hits = await Promise.all(detectors.map(async (detector) => {
|
|
320
|
+
const [descriptors, markers] = await Promise.all([
|
|
321
|
+
reader.glob(rootUri, detector.descriptorGlob),
|
|
322
|
+
detector.scopeMarkerGlob
|
|
323
|
+
? reader.glob(rootUri, detector.scopeMarkerGlob)
|
|
324
|
+
: Promise.resolve([]),
|
|
325
|
+
]);
|
|
326
|
+
const scopes = markers
|
|
327
|
+
.filter(keep)
|
|
328
|
+
.map((uri) => dirnameUri(normalizeUri(uri)));
|
|
329
|
+
const inScope = scopeTest(scopes);
|
|
330
|
+
return {
|
|
331
|
+
detector,
|
|
332
|
+
uris: descriptors
|
|
333
|
+
.filter(keep)
|
|
334
|
+
.filter((uri) => inScope(normalizeUri(uri))),
|
|
335
|
+
scopes,
|
|
336
|
+
};
|
|
337
|
+
}));
|
|
338
|
+
// Highest precedence first, so a folder claimed by two kinds resolves by a declared rule
|
|
339
|
+
// rather than by which detector happened to be listed first.
|
|
340
|
+
const ordered = [...hits].sort((a, b) => b.detector.precedence - a.detector.precedence);
|
|
341
|
+
const byId = new Map();
|
|
342
|
+
for (const { detector, uris } of ordered) {
|
|
343
|
+
for (const descriptorUri of uris) {
|
|
344
|
+
const normalized = normalizeUri(descriptorUri);
|
|
345
|
+
const componentPath = detector.componentPathFor(normalized);
|
|
346
|
+
// Keyed by normalized URI (AD-18) so the same project cannot enter twice under two
|
|
347
|
+
// spellings — the failure that would make every downstream count quietly wrong.
|
|
348
|
+
if (byId.has(componentPath))
|
|
349
|
+
continue;
|
|
350
|
+
const descriptorText = await reader.read(normalized);
|
|
351
|
+
// A glob hit that cannot be read is skipped rather than fatal. One unreadable file must
|
|
352
|
+
// not cost the developer every other project.
|
|
353
|
+
if (descriptorText === undefined)
|
|
354
|
+
continue;
|
|
355
|
+
// The shape check a filename cannot express.
|
|
356
|
+
if (!detector.accepts(normalized, descriptorText))
|
|
357
|
+
continue;
|
|
358
|
+
byId.set(componentPath, projectFrom(detector, normalized, descriptorText));
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
// Sorted by identity: the index is compared between versions and shown in pickers, and an
|
|
362
|
+
// order that varied with filesystem traversal would make both jitter for no reason.
|
|
363
|
+
return [...byId.values()].sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* The project owning `fileUri`, or `undefined` when none does.
|
|
367
|
+
*
|
|
368
|
+
* Deepest match wins. Projects nest, so a file inside `variux/maileg-2025/eu` belongs to `eu` and
|
|
369
|
+
* not to `variux` — the nearest enclosing project is the boundary that actually governs it.
|
|
370
|
+
*/
|
|
371
|
+
export function projectForFile(fileUri, projects) {
|
|
372
|
+
const target = normalizeUri(fileUri);
|
|
373
|
+
let best;
|
|
374
|
+
for (const project of projects) {
|
|
375
|
+
// The project root is the parent of `partials`, so ownership is tested against that, not
|
|
376
|
+
// against componentPath — otherwise a file in `<project>/docs/` would look project-less.
|
|
377
|
+
const root = projectRootOf(project);
|
|
378
|
+
const prefix = root.endsWith('/') ? root : `${root}/`;
|
|
379
|
+
if (target !== root && !target.startsWith(prefix))
|
|
380
|
+
continue;
|
|
381
|
+
if (!best || projectRootOf(best).length < root.length)
|
|
382
|
+
best = project;
|
|
383
|
+
}
|
|
384
|
+
return best;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* The project's own folder.
|
|
388
|
+
*
|
|
389
|
+
* For a profile that is the parent of `partials`/`partial`, because `main.yaml` lives one level
|
|
390
|
+
* down. A connector root holds its marker directly, so it IS its own folder — applying the
|
|
391
|
+
* partials rule there would hand ownership of the connector folder to its parent.
|
|
392
|
+
*/
|
|
393
|
+
export function projectRootOf(project, detectors = DEFAULT_DETECTORS) {
|
|
394
|
+
// Asked of the detector, not branched on the kind — that branch is exactly what would need
|
|
395
|
+
// editing for every kind added.
|
|
396
|
+
return (detectorFor(project.kind, detectors)?.rootFor(project.componentPath) ??
|
|
397
|
+
project.componentPath);
|
|
398
|
+
}
|
|
399
|
+
/** What a project of this kind can do — the question callers should ask instead of its name. */
|
|
400
|
+
export function capabilitiesOf(project, detectors = DEFAULT_DETECTORS) {
|
|
401
|
+
return (detectorFor(project.kind, detectors)?.capabilities ?? {
|
|
402
|
+
composes: false,
|
|
403
|
+
composesDescription: true,
|
|
404
|
+
inherits: false,
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Re-read ONE project's `main.yaml` and return an updated project list (Story 2.5 AC 1).
|
|
409
|
+
*
|
|
410
|
+
* The AC requires that a change to one `main.yaml` rebuilds that project's entry and its edges
|
|
411
|
+
* "and unaffected projects are not". A full re-glob reads every `main.yaml` in the workspace —
|
|
412
|
+
* 113 of them on the real corpus, for one keystroke — so this exists to read exactly one.
|
|
413
|
+
*
|
|
414
|
+
* Returns the ORIGINAL array unchanged when nothing moved, so a caller can skip publishing a
|
|
415
|
+
* new version and avoid churning every consumer's cached view for a no-op save.
|
|
416
|
+
*/
|
|
417
|
+
export async function rediscoverProject(mainYamlUri, reader, projects, options = {}) {
|
|
418
|
+
const ignored = options.ignoredPathSegments ?? DEFAULT_IGNORED_PATH_SEGMENTS;
|
|
419
|
+
const normalized = normalizeUri(mainYamlUri);
|
|
420
|
+
if (isIgnoredPath(normalized, ignored))
|
|
421
|
+
return projects;
|
|
422
|
+
const componentPath = dirnameUri(normalized);
|
|
423
|
+
const existingIndex = projects.findIndex((p) => p.id === componentPath);
|
|
424
|
+
const descriptorText = await reader.read(normalized);
|
|
425
|
+
if (descriptorText === undefined) {
|
|
426
|
+
// Deleted. Absent from the list already means nothing to do.
|
|
427
|
+
if (existingIndex < 0)
|
|
428
|
+
return projects;
|
|
429
|
+
return projects.filter((_, i) => i !== existingIndex);
|
|
430
|
+
}
|
|
431
|
+
const entry = {
|
|
432
|
+
// The incremental path is driven by the `main.yaml` watcher, so what it re-reads is a
|
|
433
|
+
// profile descriptor. A connector marker change re-globs, since markers are rare and a
|
|
434
|
+
// new one can appear anywhere.
|
|
435
|
+
kind: 'profile',
|
|
436
|
+
id: componentPath,
|
|
437
|
+
name: projectNameFor(componentPath),
|
|
438
|
+
componentPath,
|
|
439
|
+
descriptorPath: normalized,
|
|
440
|
+
descriptorText,
|
|
441
|
+
};
|
|
442
|
+
if (existingIndex >= 0) {
|
|
443
|
+
// Unchanged content: hand back the same array so the caller can tell nothing happened.
|
|
444
|
+
if (projects[existingIndex].descriptorText === descriptorText)
|
|
445
|
+
return projects;
|
|
446
|
+
const next = [...projects];
|
|
447
|
+
next[existingIndex] = entry;
|
|
448
|
+
return next;
|
|
449
|
+
}
|
|
450
|
+
// New project. Inserted in sorted position rather than appended, because the whole list is
|
|
451
|
+
// ordered by identity and a consumer comparing two versions should not see it jump.
|
|
452
|
+
const next = [...projects, entry];
|
|
453
|
+
return next.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
454
|
+
}
|
|
455
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EACL,WAAW,EACX,UAAU,EACV,OAAO,EACP,YAAY,GACb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,iBAAiB,GAGlB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAsB;IAC9D,WAAW;IACX,cAAc;IACd,MAAM;CACP,CAAC;AA4CF,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