@beehexa/hexasync-template-index 2608.15.1 → 2608.20.18
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/package.json +4 -4
- package/dist/checkpoints.d.ts +0 -47
- package/dist/checkpoints.d.ts.map +0 -1
- package/dist/checkpoints.js +0 -59
- package/dist/checkpoints.js.map +0 -1
- package/dist/cursorContext.d.ts +0 -204
- package/dist/cursorContext.d.ts.map +0 -1
- package/dist/cursorContext.js +0 -479
- package/dist/cursorContext.js.map +0 -1
- package/dist/detectors.d.ts +0 -103
- package/dist/detectors.d.ts.map +0 -1
- package/dist/detectors.js +0 -104
- package/dist/detectors.js.map +0 -1
- package/dist/discovery.d.ts +0 -249
- package/dist/discovery.d.ts.map +0 -1
- package/dist/discovery.js +0 -455
- package/dist/discovery.js.map +0 -1
- package/dist/effectiveGraph.d.ts +0 -240
- package/dist/effectiveGraph.d.ts.map +0 -1
- package/dist/effectiveGraph.js +0 -523
- package/dist/effectiveGraph.js.map +0 -1
- package/dist/failures.d.ts +0 -50
- package/dist/failures.d.ts.map +0 -1
- package/dist/failures.js +0 -125
- package/dist/failures.js.map +0 -1
- package/dist/graph.d.ts +0 -47
- package/dist/graph.d.ts.map +0 -1
- package/dist/graph.js +0 -230
- package/dist/graph.js.map +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -38
- package/dist/index.js.map +0 -1
- package/dist/queries.d.ts +0 -102
- package/dist/queries.d.ts.map +0 -1
- package/dist/queries.js +0 -469
- package/dist/queries.js.map +0 -1
- package/dist/ranges.d.ts +0 -71
- package/dist/ranges.d.ts.map +0 -1
- package/dist/ranges.js +0 -322
- package/dist/ranges.js.map +0 -1
- package/dist/resolveField.d.ts +0 -125
- package/dist/resolveField.d.ts.map +0 -1
- package/dist/resolveField.js +0 -234
- package/dist/resolveField.js.map +0 -1
- package/dist/tier1Service.d.ts +0 -96
- package/dist/tier1Service.d.ts.map +0 -1
- package/dist/tier1Service.js +0 -194
- package/dist/tier1Service.js.map +0 -1
- package/dist/tier2Service.d.ts +0 -195
- package/dist/tier2Service.d.ts.map +0 -1
- package/dist/tier2Service.js +0 -642
- package/dist/tier2Service.js.map +0 -1
- package/dist/yamlScalar.d.ts +0 -17
- package/dist/yamlScalar.d.ts.map +0 -1
- package/dist/yamlScalar.js +0 -101
- package/dist/yamlScalar.js.map +0 -1
package/dist/detectors.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How a folder is recognised as a project — one detector per KIND, open for extension.
|
|
3
|
-
*
|
|
4
|
-
* There are two kinds today, profile templates and connector templates, and there will be more.
|
|
5
|
-
* They are not variations on one shape: they are detected differently (a `main.yaml` versus a
|
|
6
|
-
* marker file), they support different commands, and a future kind may be recognised by document
|
|
7
|
-
* SHAPE rather than by filename at all. An enum plus a scatter of `if (kind === …)` would make
|
|
8
|
-
* every new kind a change to the discovery loop, the graph builder and the editor at once.
|
|
9
|
-
*
|
|
10
|
-
* So a kind is DATA. Adding one means adding a detector; nothing that consumes projects has to
|
|
11
|
-
* learn about it, because everything a consumer needs to decide — can this compose? does it
|
|
12
|
-
* inherit? — is declared on the detector rather than inferred from its name.
|
|
13
|
-
*
|
|
14
|
-
* Detectors are meant to be composed. The helpers below (`dirnameComponentPath`,
|
|
15
|
-
* `partialsAwareRoot`, `folderBasename`) exist precisely so a new kind can reuse the parts of an
|
|
16
|
-
* existing one it agrees with instead of restating them.
|
|
17
|
-
*/
|
|
18
|
-
import { basenameUri, dirnameUri } from '@beehexa/hexasync-template-model';
|
|
19
|
-
// ---- Reusable parts. A new detector should lean on these rather than restate them.
|
|
20
|
-
/** The descriptor's directory — right for any kind whose descriptor sits in its project. */
|
|
21
|
-
export const dirnameComponentPath = (descriptorUri) => dirnameUri(descriptorUri);
|
|
22
|
-
/**
|
|
23
|
-
* The parent of `partials`/`partial`, else the folder itself.
|
|
24
|
-
*
|
|
25
|
-
* Both spellings are read (FR-38) because 2 of the 113 corpus projects use the singular; only
|
|
26
|
-
* the plural is ever emitted.
|
|
27
|
-
*/
|
|
28
|
-
export function partialsAwareRoot(componentPath) {
|
|
29
|
-
const self = basenameUri(componentPath);
|
|
30
|
-
return self === 'partials' || self === 'partial'
|
|
31
|
-
? dirnameUri(componentPath)
|
|
32
|
-
: componentPath;
|
|
33
|
-
}
|
|
34
|
-
/** The folder's own name — the default display name. */
|
|
35
|
-
export const folderBasename = (componentPath) => basenameUri(componentPath) || componentPath;
|
|
36
|
-
/** Accept every candidate. The default for kinds whose descriptor name is enough. */
|
|
37
|
-
export const acceptAll = () => true;
|
|
38
|
-
// ---- The kinds that exist today.
|
|
39
|
-
/**
|
|
40
|
-
* A PROFILE TEMPLATE — the thing `compose` operates on.
|
|
41
|
-
*
|
|
42
|
-
* Identified by `main.yaml`, and never by `output.yaml` (FR-37): that is a build artefact,
|
|
43
|
-
* absent in projects nobody has composed and present in folders that are not projects, so it
|
|
44
|
-
* would be wrong in both directions.
|
|
45
|
-
*/
|
|
46
|
-
export const PROFILE_TEMPLATE_DETECTOR = {
|
|
47
|
-
kind: 'profile',
|
|
48
|
-
label: 'profile template',
|
|
49
|
-
descriptorGlob: '**/main.yaml',
|
|
50
|
-
// `hx-templates.json` takes priority: where a workspace declares its roots, they are the
|
|
51
|
-
// truth and a stray `main.yaml` outside them is not a project. Falling back to the
|
|
52
|
-
// descriptor glob keeps every workspace that has not adopted markers working unchanged.
|
|
53
|
-
scopeMarkerGlob: '**/hx-templates.json',
|
|
54
|
-
capabilities: { composes: true, composesDescription: true, inherits: true },
|
|
55
|
-
// Above connector: where a folder somehow claims both, the composable kind is the one every
|
|
56
|
-
// profile-only action needs to find.
|
|
57
|
-
precedence: 100,
|
|
58
|
-
componentPathFor: dirnameComponentPath,
|
|
59
|
-
rootFor: partialsAwareRoot,
|
|
60
|
-
nameFor: (componentPath) => folderBasename(partialsAwareRoot(componentPath)),
|
|
61
|
-
accepts: acceptAll,
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* A CONNECTOR TEMPLATE — a flat catalogue of connector definitions.
|
|
65
|
-
*
|
|
66
|
-
* Identified by an `hx-connectors.json` marker, wherever it sits. There is deliberately no fixed
|
|
67
|
-
* `connectors/` path: a workspace may declare several connector roots anywhere, and a path
|
|
68
|
-
* convention would silently miss every one that did not follow it.
|
|
69
|
-
*
|
|
70
|
-
* It does not compose. `compose description` still applies, because inlining `!md[...]` depends
|
|
71
|
-
* on no business rule.
|
|
72
|
-
*/
|
|
73
|
-
export const CONNECTOR_TEMPLATE_DETECTOR = {
|
|
74
|
-
kind: 'connector',
|
|
75
|
-
label: 'connector definitions',
|
|
76
|
-
descriptorGlob: '**/hx-connectors.json',
|
|
77
|
-
capabilities: { composes: false, composesDescription: true, inherits: false },
|
|
78
|
-
precedence: 50,
|
|
79
|
-
componentPathFor: dirnameComponentPath,
|
|
80
|
-
// NOT partials-aware: a connector root holds its marker directly, and applying that rule
|
|
81
|
-
// would hand ownership of the folder to its parent.
|
|
82
|
-
rootFor: (componentPath) => componentPath,
|
|
83
|
-
nameFor: folderBasename,
|
|
84
|
-
accepts: acceptAll,
|
|
85
|
-
};
|
|
86
|
-
/** The kinds shipped today. Callers may pass their own set, or extend this one. */
|
|
87
|
-
export const DEFAULT_DETECTORS = [
|
|
88
|
-
PROFILE_TEMPLATE_DETECTOR,
|
|
89
|
-
CONNECTOR_TEMPLATE_DETECTOR,
|
|
90
|
-
];
|
|
91
|
-
/** Look up a detector by kind — how a consumer asks what a project can do. */
|
|
92
|
-
export function detectorFor(kind, detectors = DEFAULT_DETECTORS) {
|
|
93
|
-
return detectors.find((d) => d.kind === kind);
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* A helper for building a kind that is a variation on an existing one.
|
|
97
|
-
*
|
|
98
|
-
* The reuse path Jazz asked for: a future kind that differs from profiles only in its descriptor
|
|
99
|
-
* name, or only in whether it inherits, should be a few lines rather than a copy.
|
|
100
|
-
*/
|
|
101
|
-
export function deriveDetector(base, overrides) {
|
|
102
|
-
return { ...base, ...overrides };
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=detectors.js.map
|
package/dist/detectors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"detectors.js","sourceRoot":"","sources":["../src/detectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AA+D3E,qFAAqF;AAErF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,aAAqB,EAAU,EAAE,CACpE,UAAU,CAAC,aAAa,CAAC,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,aAAqB;IACrD,MAAM,IAAI,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;IACxC,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,SAAS;QAC9C,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC;QAC3B,CAAC,CAAC,aAAa,CAAC;AACpB,CAAC;AAED,wDAAwD;AACxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,aAAqB,EAAU,EAAE,CAC9D,WAAW,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC;AAE9C,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC;AAE7C,mCAAmC;AAEnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAoB;IACxD,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,kBAAkB;IACzB,cAAc,EAAE,cAAc;IAC9B,yFAAyF;IACzF,mFAAmF;IACnF,wFAAwF;IACxF,eAAe,EAAE,sBAAsB;IACvC,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EA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apabilities, type ProjectDetector } from './detectors.js';
|
|
3
|
-
/**
|
|
4
|
-
* Paths never opened by either tier (Story 2.1, last AC).
|
|
5
|
-
*
|
|
6
|
-
* `__configs/**` is the known case — generated content that is not authored and must not appear
|
|
7
|
-
* in the index, in diagnostics, or in any coverage metric. Configurable rather than hard-coded
|
|
8
|
-
* because the next generated directory will have a different name and nobody will remember to
|
|
9
|
-
* come back here.
|
|
10
|
-
*/
|
|
11
|
-
export declare const DEFAULT_IGNORED_PATH_SEGMENTS: readonly string[];
|
|
12
|
-
export interface DiscoveryOptions {
|
|
13
|
-
/** Overrides `DEFAULT_IGNORED_PATH_SEGMENTS` entirely when supplied. */
|
|
14
|
-
ignoredPathSegments?: readonly string[];
|
|
15
|
-
/**
|
|
16
|
-
* The kinds to look for. Defaults to the shipped set.
|
|
17
|
-
*
|
|
18
|
-
* Passing your own is how a host adds a kind — nothing in the discovery loop, the graph or
|
|
19
|
-
* the editor has to change for it.
|
|
20
|
-
*/
|
|
21
|
-
detectors?: readonly ProjectDetector[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Which document family a project belongs to.
|
|
25
|
-
*
|
|
26
|
-
* A plain string, not a union: kinds are supplied by the DETECTOR REGISTRY, so a consumer can
|
|
27
|
-
* add one without editing this file. What a kind can do is read from its detector's
|
|
28
|
-
* capabilities, never inferred from the name.
|
|
29
|
-
*/
|
|
30
|
-
export type ProjectKind = string;
|
|
31
|
-
/** A project as Tier 1 knows it: where it is, what it is called, and what it declared. */
|
|
32
|
-
export interface DiscoveredProject {
|
|
33
|
-
/** `profile` composes; `connector` does not. See the header. */
|
|
34
|
-
readonly kind: ProjectKind;
|
|
35
|
-
/** Canonical identity (AD-18): the normalized URI of the folder holding `main.yaml`. */
|
|
36
|
-
readonly id: string;
|
|
37
|
-
/** Display name — the project folder, which is the parent of `partials`/`partial`. */
|
|
38
|
-
readonly name: string;
|
|
39
|
-
/** The folder containing `main.yaml`, normalized. */
|
|
40
|
-
readonly componentPath: string;
|
|
41
|
-
/**
|
|
42
|
-
* The file that DECLARED this project — `main.yaml` for a profile, the marker for a connector.
|
|
43
|
-
*
|
|
44
|
-
* Named for what it is rather than `mainYamlPath`, because a connector project has no
|
|
45
|
-
* `main.yaml` and a field promising one would be a lie half the time.
|
|
46
|
-
*/
|
|
47
|
-
readonly descriptorPath: string;
|
|
48
|
-
/** The descriptor's text, kept so edge-building need not read it a second time. */
|
|
49
|
-
readonly descriptorText: string;
|
|
50
|
-
}
|
|
51
|
-
/** True when any path segment is on the ignore list. */
|
|
52
|
-
export declare function isIgnoredPath(uri: string, ignored?: readonly string[]): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* The display name for a project rooted at `componentPath`.
|
|
55
|
-
*
|
|
56
|
-
* `main.yaml` lives in `<project>/partials/`, so the project is the PARENT — except where the
|
|
57
|
-
* folder is not named `partials`/`partial` at all, in which case it is its own project folder.
|
|
58
|
-
* Both spellings are accepted on read (FR-38); only `partials` is ever emitted.
|
|
59
|
-
*/
|
|
60
|
-
export declare function projectNameFor(componentPath: string): string;
|
|
61
|
-
/**
|
|
62
|
-
* The descriptor FILENAME a detector looks for, when its glob names exactly one.
|
|
63
|
-
*
|
|
64
|
-
* `**/main.yaml` → `main.yaml`. Returns undefined for anything more elaborate rather than guessing:
|
|
65
|
-
* a detector whose descriptor cannot be named this way is one the upward walk must admit it cannot
|
|
66
|
-
* find, and `locateProjectUpward` reports that instead of silently answering "no project".
|
|
67
|
-
*/
|
|
68
|
-
export declare function descriptorNameOf(detector: ProjectDetector): string | undefined;
|
|
69
|
-
/** What the upward walk found, and what it cost to find it. */
|
|
70
|
-
export interface UpwardLocation {
|
|
71
|
-
readonly project: DiscoveredProject;
|
|
72
|
-
/** Directory levels examined. The budget this whole approach exists to keep small. */
|
|
73
|
-
readonly levels: number;
|
|
74
|
-
/** Descriptor probes performed — one filesystem read each. */
|
|
75
|
-
readonly reads: number;
|
|
76
|
-
/** Detectors whose descriptor could not be named, so this walk could not look for them. */
|
|
77
|
-
readonly unsearchable: readonly string[];
|
|
78
|
-
}
|
|
79
|
-
/** One project as a LIST entry: enough to show it and open it, and nothing that costs a read. */
|
|
80
|
-
export interface ProjectListEntry {
|
|
81
|
-
readonly kind: ProjectKind;
|
|
82
|
-
/** The component path, which is the id every consumer keys on. */
|
|
83
|
-
readonly id: string;
|
|
84
|
-
readonly componentPath: string;
|
|
85
|
-
readonly descriptorPath: string;
|
|
86
|
-
readonly name: string;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Every project in the workspace, WITHOUT reading a single descriptor.
|
|
90
|
-
*
|
|
91
|
-
* For a list — "show me the projects so I can go to one" — the descriptor's CONTENT buys nothing:
|
|
92
|
-
* `nameFor` derives the name from the folder path, `kind` comes from which glob matched, and both shipped
|
|
93
|
-
* detectors accept every candidate (`accepts: acceptAll`). So `discoverProjects`' read per project is pure
|
|
94
|
-
* cost here: 115 of them on the reported workspace, for information no consumer of a list uses.
|
|
95
|
-
*
|
|
96
|
-
* `discoverProjects` still exists and still reads, because the INHERITANCE questions genuinely need each
|
|
97
|
-
* project's `externals` — who declares a shared file, and who inherits a project. This is the cheap half,
|
|
98
|
-
* for the question that only needs to know that a project is there.
|
|
99
|
-
*
|
|
100
|
-
* A detector whose `accepts` is not the default is EXCLUDED and named in `unverifiable`, because listing a
|
|
101
|
-
* candidate this function cannot confirm would be claiming a project exists on the strength of a filename.
|
|
102
|
-
*/
|
|
103
|
-
export declare function listProjects(rootUri: string, reader: TemplateReader, options?: DiscoveryOptions): Promise<{
|
|
104
|
-
readonly projects: readonly ProjectListEntry[];
|
|
105
|
-
readonly unverifiable: readonly string[];
|
|
106
|
-
}>;
|
|
107
|
-
/**
|
|
108
|
-
* The project owning ONE file, by walking UP from it (NFR-8).
|
|
109
|
-
*
|
|
110
|
-
* ### Why this exists
|
|
111
|
-
*
|
|
112
|
-
* `discoverProjects` answers "every project in the workspace", and the editor was using it to answer
|
|
113
|
-
* "which project is this file in" — building a complete list and then searching it. On a monorepo root
|
|
114
|
-
* that cost **234 seconds** (measured: 12,979 directories, three workspace-wide globs, ~6 ms per
|
|
115
|
-
* directory through the host's file search) to answer a question about a single file. NFR-8 forbids
|
|
116
|
-
* eager workspace indexing, and that scan was one.
|
|
117
|
-
*
|
|
118
|
-
* Walking up costs one read per candidate per level — about seven for a file inside `partials`,
|
|
119
|
-
* because the first level up IS the component folder and its descriptor is right there.
|
|
120
|
-
*
|
|
121
|
-
* ### Why upward is not just faster but MORE correct
|
|
122
|
-
*
|
|
123
|
-
* Projects nest (FR-39). `projectForFile` resolves that by preferring the deepest root, because a file
|
|
124
|
-
* in `variux/maileg-2025/eu` belongs to `eu` and not to the outer `variux`. A downward scan that
|
|
125
|
-
* stopped at the first descriptor it met would answer with the OUTERMOST project; walking up and
|
|
126
|
-
* stopping at the first one gives the deepest, which is the right answer, for free.
|
|
127
|
-
*
|
|
128
|
-
* ### The shortcut that is deliberately NOT taken
|
|
129
|
-
*
|
|
130
|
-
* It is tempting to jump straight to the nearest `partials` segment in the file's own path — one read
|
|
131
|
-
* for the common case instead of a dozen. It is also wrong: a project declared WITHOUT a component
|
|
132
|
-
* folder (a connector root) can sit deeper than the nearest `partials`, and the jump would answer with
|
|
133
|
-
* the shallower one. `projectForFile` resolves nesting by depth regardless of kind, so the walk has to
|
|
134
|
-
* as well. A dozen reads is ~80 ms against the 234,000 ms this replaces; correctness is worth more than
|
|
135
|
-
* the remainder.
|
|
136
|
-
*
|
|
137
|
-
* ### A loop, deliberately
|
|
138
|
-
*
|
|
139
|
-
* Iterative, with two independent termination conditions: leaving the root, and `dirnameUri` reaching
|
|
140
|
-
* its own fixed point. A recursive walk over a path that never shortens is a stack overflow in the
|
|
141
|
-
* extension host; a loop that cannot advance simply stops.
|
|
142
|
-
*/
|
|
143
|
-
export declare function locateProjectUpward(input: {
|
|
144
|
-
readonly fileUri: string;
|
|
145
|
-
/** The workspace folder to stop at. The walk never leaves it. */
|
|
146
|
-
readonly rootUri: string;
|
|
147
|
-
readonly reader: TemplateReader;
|
|
148
|
-
readonly detectors?: readonly ProjectDetector[];
|
|
149
|
-
readonly ignoredPathSegments?: readonly string[];
|
|
150
|
-
}): Promise<UpwardLocation | undefined>;
|
|
151
|
-
/**
|
|
152
|
-
* Whether a descriptor falls inside the area its kind's scope markers declare.
|
|
153
|
-
*
|
|
154
|
-
* ## The rule
|
|
155
|
-
*
|
|
156
|
-
* A scope marker declares its own folder as a root, and vetoes stray descriptors **among its
|
|
157
|
-
* siblings** — never across the workspace. Three cases, and the third is the one that changed:
|
|
158
|
-
*
|
|
159
|
-
* | the descriptor | verdict |
|
|
160
|
-
* | --- | --- |
|
|
161
|
-
* | under some scope root | in scope — that is what the marker declares |
|
|
162
|
-
* | under a scope root's PARENT but under no root | out of scope — the stray this rule exists to reject |
|
|
163
|
-
* | outside every scope root's parent | in scope — no marker here claims to describe it |
|
|
164
|
-
*
|
|
165
|
-
* With no markers at all nothing is vetoed, exactly as before: a workspace that has not adopted them
|
|
166
|
-
* keeps working unchanged.
|
|
167
|
-
*
|
|
168
|
-
* ## ⛔ Why it is no longer workspace-wide
|
|
169
|
-
*
|
|
170
|
-
* It used to be `scopes.length === 0 || scopes.some(under)` — any marker anywhere made every
|
|
171
|
-
* descriptor outside it invisible. That reads as "a workspace that declares its roots means them",
|
|
172
|
-
* and it holds only while a workspace folder is exactly one repository.
|
|
173
|
-
*
|
|
174
|
-
* Reported 2026-08-15. A developer opened a parent folder holding several repositories side by side:
|
|
175
|
-
* the templates corpus (115 projects, and its `.gitignore` hid `hx-*.json`, so a fresh clone carried
|
|
176
|
-
* no marker at all) next to `hexasync-templates-vscode-ext`, which COMMITTED an `examples/hx-templates.json`
|
|
177
|
-
* containing `{}` beside no YAML whatsoever. One content-free fixture, four directories away, scoped
|
|
178
|
-
* the entire workspace to itself:
|
|
179
|
-
*
|
|
180
|
-
* ```
|
|
181
|
-
* discoverProjects(parent) → 1 project [hexasync-templates-vscode-ext/examples]
|
|
182
|
-
* listProjects(parent) → 116 projects
|
|
183
|
-
* ```
|
|
184
|
-
*
|
|
185
|
-
* Nothing reported it. `projectOf` answered "no project" for all 115, the VS Code extension wrote
|
|
186
|
-
* `yaml.schemas` globs covering only `examples/**`, and the author's whole IntelliSense went quiet —
|
|
187
|
-
* no enum completions on `indexGroups`, `displayType`, `type` or `method`, no schema hovers, no schema
|
|
188
|
-
* validation. The visible symptom was Ctrl+Space returning nothing.
|
|
189
|
-
*
|
|
190
|
-
* That is the second incident from this mechanism. `apps/cli/src/__tests__/tier1Corpus.spec.ts`
|
|
191
|
-
* records the first: one stray `hx-templates.json` containing `{}`, left behind in the corpus. Both
|
|
192
|
-
* times an EMPTY marker in a place nobody was thinking about silently deleted the answer, because the
|
|
193
|
-
* veto reached further than the thing that declared it.
|
|
194
|
-
*
|
|
195
|
-
* The parent bound is what a marker can actually speak for. It still rejects the stray it was written
|
|
196
|
-
* for — markers at `001-projects/variux`, `001-projects/vin` and so on reject
|
|
197
|
-
* `001-projects/junk/partials/main.yaml` — and it can no longer reach into a sibling repository that
|
|
198
|
-
* never declared anything.
|
|
199
|
-
*
|
|
200
|
-
* A marker AT the workspace root keeps the old behaviour by construction: its parent is above the
|
|
201
|
-
* root, so its veto region is the whole workspace and every descriptor is under the root anyway.
|
|
202
|
-
*
|
|
203
|
-
* @param scopeRoots the folders holding a marker, normalized, `[]` when the kind declares no marker
|
|
204
|
-
* glob or none were found.
|
|
205
|
-
*/
|
|
206
|
-
export declare function scopeTest(scopeRoots: readonly string[]): (uri: string) => boolean;
|
|
207
|
-
/**
|
|
208
|
-
* Find every project under `rootUri`.
|
|
209
|
-
*
|
|
210
|
-
* Projects nest arbitrarily (FR-39) — `001-projects/variux` alone contains 27 — so this globs the
|
|
211
|
-
* whole subtree rather than walking a fixed depth. The ignore list is applied to the glob results
|
|
212
|
-
* BEFORE any file is opened, which is the point: an ignored path must cost nothing to skip.
|
|
213
|
-
*
|
|
214
|
-
* WORKSPACE-WIDE, and therefore expensive: on a monorepo root this is 234 seconds. It answers a
|
|
215
|
-
* question only three features actually ask — workspace symbols, the project picker, and Find
|
|
216
|
-
* References' cold inheritance search (FR-90 AC 3, where the `type: project` edge is declared at the
|
|
217
|
-
* OTHER end and so cannot be read from one project's own files). "Which project is this file in" is
|
|
218
|
-
* `locateProjectUpward`, and must not come from here.
|
|
219
|
-
*/
|
|
220
|
-
export declare function discoverProjects(rootUri: string, reader: TemplateReader, options?: DiscoveryOptions): Promise<DiscoveredProject[]>;
|
|
221
|
-
/**
|
|
222
|
-
* The project owning `fileUri`, or `undefined` when none does.
|
|
223
|
-
*
|
|
224
|
-
* Deepest match wins. Projects nest, so a file inside `variux/maileg-2025/eu` belongs to `eu` and
|
|
225
|
-
* not to `variux` — the nearest enclosing project is the boundary that actually governs it.
|
|
226
|
-
*/
|
|
227
|
-
export declare function projectForFile(fileUri: string, projects: readonly DiscoveredProject[]): DiscoveredProject | undefined;
|
|
228
|
-
/**
|
|
229
|
-
* The project's own folder.
|
|
230
|
-
*
|
|
231
|
-
* For a profile that is the parent of `partials`/`partial`, because `main.yaml` lives one level
|
|
232
|
-
* down. A connector root holds its marker directly, so it IS its own folder — applying the
|
|
233
|
-
* partials rule there would hand ownership of the connector folder to its parent.
|
|
234
|
-
*/
|
|
235
|
-
export declare function projectRootOf(project: DiscoveredProject, detectors?: readonly ProjectDetector[]): string;
|
|
236
|
-
/** What a project of this kind can do — the question callers should ask instead of its name. */
|
|
237
|
-
export declare function capabilitiesOf(project: DiscoveredProject, detectors?: readonly ProjectDetector[]): ProjectCapabilities;
|
|
238
|
-
/**
|
|
239
|
-
* Re-read ONE project's `main.yaml` and return an updated project list (Story 2.5 AC 1).
|
|
240
|
-
*
|
|
241
|
-
* The AC requires that a change to one `main.yaml` rebuilds that project's entry and its edges
|
|
242
|
-
* "and unaffected projects are not". A full re-glob reads every `main.yaml` in the workspace —
|
|
243
|
-
* 113 of them on the real corpus, for one keystroke — so this exists to read exactly one.
|
|
244
|
-
*
|
|
245
|
-
* Returns the ORIGINAL array unchanged when nothing moved, so a caller can skip publishing a
|
|
246
|
-
* new version and avoid churning every consumer's cached view for a no-op save.
|
|
247
|
-
*/
|
|
248
|
-
export declare function rediscoverProject(mainYamlUri: string, reader: TemplateReader, projects: readonly DiscoveredProject[], options?: DiscoveryOptions): Promise<readonly DiscoveredProject[]>;
|
|
249
|
-
//# sourceMappingURL=discovery.d.ts.map
|
package/dist/discovery.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAKL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,MAAM,EAI1D,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CACxC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,0FAA0F;AAC1F,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,wFAAwF;IACxF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,sFAAsF;IACtF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,mFAAmF;IACnF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,wDAAwD;AACxD,wBAAgB,aA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