@telorun/cli 0.77.0 → 0.79.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/dist/bundle/module-payload.d.ts +28 -8
- package/dist/bundle/module-payload.d.ts.map +1 -1
- package/dist/bundle/module-payload.js +62 -27
- package/dist/bundle/module-payload.js.map +1 -1
- package/dist/bundle/warm-layers.d.ts +10 -1
- package/dist/bundle/warm-layers.d.ts.map +1 -1
- package/dist/bundle/warm-layers.js +15 -4
- package/dist/bundle/warm-layers.js.map +1 -1
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +6 -1
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +53 -1
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/release.d.ts.map +1 -1
- package/dist/commands/release.js +7 -0
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +17 -21
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +5 -23
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/controller-progress.d.ts +14 -14
- package/dist/controller-progress.d.ts.map +1 -1
- package/dist/controller-progress.js +0 -0
- package/dist/controller-progress.js.map +1 -1
- package/dist/env-files.d.ts +46 -0
- package/dist/env-files.d.ts.map +1 -0
- package/dist/env-files.js +92 -0
- package/dist/env-files.js.map +1 -0
- package/dist/release/apply-plan.d.ts.map +1 -1
- package/dist/release/apply-plan.js +38 -1
- package/dist/release/apply-plan.js.map +1 -1
- package/dist/release/check-requires.d.ts +10 -1
- package/dist/release/check-requires.d.ts.map +1 -1
- package/dist/release/check-requires.js +23 -0
- package/dist/release/check-requires.js.map +1 -1
- package/dist/release/npm-controller-package.d.ts +50 -0
- package/dist/release/npm-controller-package.d.ts.map +1 -0
- package/dist/release/npm-controller-package.js +136 -0
- package/dist/release/npm-controller-package.js.map +1 -0
- package/dist/release/verify-requires.d.ts +50 -0
- package/dist/release/verify-requires.d.ts.map +1 -1
- package/dist/release/verify-requires.js +58 -1
- package/dist/release/verify-requires.js.map +1 -1
- package/dist/release/workspace.d.ts +5 -7
- package/dist/release/workspace.d.ts.map +1 -1
- package/dist/release/workspace.js +6 -17
- package/dist/release/workspace.js.map +1 -1
- package/dist/workspace-marker.d.ts +30 -0
- package/dist/workspace-marker.d.ts.map +1 -0
- package/dist/workspace-marker.js +49 -0
- package/dist/workspace-marker.js.map +1 -0
- package/package.json +6 -6
|
@@ -29,6 +29,28 @@
|
|
|
29
29
|
* and blocking a publish on network reachability trades one failure for a worse
|
|
30
30
|
* one. A CLI that runs and rejects the manifest is evidence, and evidence is
|
|
31
31
|
* what this gate is for.
|
|
32
|
+
*
|
|
33
|
+
* **A FORWARD-DECLARED lower bound is a third state, not an infrastructure
|
|
34
|
+
* failure.** The normal way new syntax lands is: a module adopts it and declares
|
|
35
|
+
* the range of the release that will carry it — a version that, until that
|
|
36
|
+
* release publishes, does not exist. Spawning `npx @telorun/cli@<unpublished>`
|
|
37
|
+
* can only ETARGET, and reporting *"could not run"* buries a routine, expected,
|
|
38
|
+
* self-resolving state under npm's install noise, in the same bucket as being
|
|
39
|
+
* offline. So the registry is asked FIRST and such an edge is reported
|
|
40
|
+
* `pending`, skipping a run that has no possible outcome. The latest published
|
|
41
|
+
* version rides along in the report, because that is what makes a TYPO visible:
|
|
42
|
+
* `pending against 0.790.0 (latest published: 0.78.0)` reads wrong at a glance,
|
|
43
|
+
* where a bare "could not run" reads the same for a typo and for tomorrow's
|
|
44
|
+
* release.
|
|
45
|
+
*
|
|
46
|
+
* The states are asymmetric between the two callers, and deliberately. At
|
|
47
|
+
* `telo release check` a pending edge is informational — the release that
|
|
48
|
+
* publishes the version has not happened yet, which is the entire point of
|
|
49
|
+
* declaring the bound before it. At **publish** it is fatal, for the reason an
|
|
50
|
+
* unpublished UPPER bound is: publication runs npm before modules, so by the
|
|
51
|
+
* time a module is pushed its declared minimum exists — and if it does not, the
|
|
52
|
+
* release is out of order and every consumer's `telo upgrade` would refuse the
|
|
53
|
+
* version it is about to receive.
|
|
32
54
|
*/
|
|
33
55
|
import { type VersionRange } from "@telorun/analyzer";
|
|
34
56
|
export type EdgeOutcome =
|
|
@@ -43,6 +65,13 @@ export type EdgeOutcome =
|
|
|
43
65
|
status: "failed";
|
|
44
66
|
output: string;
|
|
45
67
|
}
|
|
68
|
+
/** The edge names a version NEWER than anything published: there is nothing to
|
|
69
|
+
* install, and the claim becomes verifiable the moment that version ships. */
|
|
70
|
+
| {
|
|
71
|
+
edge: string;
|
|
72
|
+
status: "pending";
|
|
73
|
+
latestPublished: string;
|
|
74
|
+
}
|
|
46
75
|
/** The edge CLI could not be run. The claim is unverified, not disproven. */
|
|
47
76
|
| {
|
|
48
77
|
edge: string;
|
|
@@ -56,6 +85,9 @@ export interface VerifyRequiresResult {
|
|
|
56
85
|
/** True when at least one edge produced evidence the declaration is false. */
|
|
57
86
|
refuted: boolean;
|
|
58
87
|
}
|
|
88
|
+
/** True when the range names an edge no released CLI can satisfy yet. Read by
|
|
89
|
+
* `publish`, where it is fatal, and by `release check`, where it is not. */
|
|
90
|
+
export declare function hasPendingEdge(result: VerifyRequiresResult): boolean;
|
|
59
91
|
/**
|
|
60
92
|
* Verify a module manifest against the edges of its own declared range.
|
|
61
93
|
*
|
|
@@ -66,7 +98,25 @@ export interface VerifyRequiresResult {
|
|
|
66
98
|
*/
|
|
67
99
|
export declare function verifyRequires(manifestPath: string, moduleDoc: Record<string, unknown>, options: {
|
|
68
100
|
currentVersion: string;
|
|
101
|
+
/** Published `@telorun/cli` versions, for telling a forward-declared edge
|
|
102
|
+
* from an unreachable one. `null` / omitted when the registry could not be
|
|
103
|
+
* asked, in which case no edge is classified `pending` — a guess about what
|
|
104
|
+
* exists is worse than the run's own verdict. */
|
|
105
|
+
publishedVersions?: string[] | null;
|
|
69
106
|
}): Promise<VerifyRequiresResult>;
|
|
107
|
+
/**
|
|
108
|
+
* The latest published version when `edge` names something NEWER than it — a
|
|
109
|
+
* forward-declared bound, whose verification is pending that release rather than
|
|
110
|
+
* failed or unavailable. `undefined` when the edge exists, when it is older than
|
|
111
|
+
* the latest (a yanked version is deliberately left to the run, whose "could not
|
|
112
|
+
* run" is honest about it), or when the registry could not be asked.
|
|
113
|
+
*
|
|
114
|
+
* Deciding this from the registry rather than from the spawn's failure is the
|
|
115
|
+
* whole point: `npx @telorun/cli@<unpublished>` has one possible outcome, and
|
|
116
|
+
* npm's ETARGET arrives wrapped in install noise that reads exactly like being
|
|
117
|
+
* offline.
|
|
118
|
+
*/
|
|
119
|
+
export declare function unreleasedEdge(edge: string, published: string[] | null): string | undefined;
|
|
70
120
|
export declare function resetPublishedTeloVersionsCache(): void;
|
|
71
121
|
export declare function publishedTeloVersions(): Promise<string[] | null>;
|
|
72
122
|
/** The declared upper bound when it names a version the registry does not have —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-requires.d.ts","sourceRoot":"","sources":["../../src/release/verify-requires.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"verify-requires.d.ts","sourceRoot":"","sources":["../../src/release/verify-requires.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAU3B,MAAM,MAAM,WAAW;AACrB,kDAAkD;AAChD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE;AACpC,sEAAsE;GACpE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACpD;+EAC+E;GAC7E;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE;AAC9D,6EAA6E;GAC3E;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;6EAC6E;AAC7E,wBAAgB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,OAAO,EAAE;IACP,cAAc,EAAE,MAAM,CAAC;IACvB;;;sDAGkD;IAClD,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACrC,GACA,OAAO,CAAC,oBAAoB,CAAC,CAmC/B;AAqCD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAS3F;AAgCD,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAGhE;AAgBD;;kFAEkF;AAClF,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,YAAY,GAAG,SAAS,EAClC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,GACzB,MAAM,GAAG,SAAS,CAMpB"}
|
|
@@ -29,14 +29,41 @@
|
|
|
29
29
|
* and blocking a publish on network reachability trades one failure for a worse
|
|
30
30
|
* one. A CLI that runs and rejects the manifest is evidence, and evidence is
|
|
31
31
|
* what this gate is for.
|
|
32
|
+
*
|
|
33
|
+
* **A FORWARD-DECLARED lower bound is a third state, not an infrastructure
|
|
34
|
+
* failure.** The normal way new syntax lands is: a module adopts it and declares
|
|
35
|
+
* the range of the release that will carry it — a version that, until that
|
|
36
|
+
* release publishes, does not exist. Spawning `npx @telorun/cli@<unpublished>`
|
|
37
|
+
* can only ETARGET, and reporting *"could not run"* buries a routine, expected,
|
|
38
|
+
* self-resolving state under npm's install noise, in the same bucket as being
|
|
39
|
+
* offline. So the registry is asked FIRST and such an edge is reported
|
|
40
|
+
* `pending`, skipping a run that has no possible outcome. The latest published
|
|
41
|
+
* version rides along in the report, because that is what makes a TYPO visible:
|
|
42
|
+
* `pending against 0.790.0 (latest published: 0.78.0)` reads wrong at a glance,
|
|
43
|
+
* where a bare "could not run" reads the same for a typo and for tomorrow's
|
|
44
|
+
* release.
|
|
45
|
+
*
|
|
46
|
+
* The states are asymmetric between the two callers, and deliberately. At
|
|
47
|
+
* `telo release check` a pending edge is informational — the release that
|
|
48
|
+
* publishes the version has not happened yet, which is the entire point of
|
|
49
|
+
* declaring the bound before it. At **publish** it is fatal, for the reason an
|
|
50
|
+
* unpublished UPPER bound is: publication runs npm before modules, so by the
|
|
51
|
+
* time a module is pushed its declared minimum exists — and if it does not, the
|
|
52
|
+
* release is out of order and every consumer's `telo upgrade` would refuse the
|
|
53
|
+
* version it is about to receive.
|
|
32
54
|
*/
|
|
33
|
-
import {
|
|
55
|
+
import { isNewerModuleVersion, lowerBound, newestModuleVersion, readRequires, upperBound, } from "@telorun/analyzer";
|
|
34
56
|
import { execFile } from "node:child_process";
|
|
35
57
|
import { promisify } from "node:util";
|
|
36
58
|
const run = promisify(execFile);
|
|
37
59
|
/** How long a single edge check may take. An old CLI has to be fetched on first
|
|
38
60
|
* use, so this is generous; it exists to bound a hang, not to pace the work. */
|
|
39
61
|
const EDGE_TIMEOUT_MS = 300_000;
|
|
62
|
+
/** True when the range names an edge no released CLI can satisfy yet. Read by
|
|
63
|
+
* `publish`, where it is fatal, and by `release check`, where it is not. */
|
|
64
|
+
export function hasPendingEdge(result) {
|
|
65
|
+
return result.outcomes.some((o) => o.status === "pending");
|
|
66
|
+
}
|
|
40
67
|
/**
|
|
41
68
|
* Verify a module manifest against the edges of its own declared range.
|
|
42
69
|
*
|
|
@@ -72,6 +99,11 @@ export async function verifyRequires(manifestPath, moduleDoc, options) {
|
|
|
72
99
|
outcomes.push({ edge, status: "passed" });
|
|
73
100
|
continue;
|
|
74
101
|
}
|
|
102
|
+
const latestPublished = unreleasedEdge(edge, options.publishedVersions ?? null);
|
|
103
|
+
if (latestPublished !== undefined) {
|
|
104
|
+
outcomes.push({ edge, status: "pending", latestPublished });
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
75
107
|
outcomes.push(await runEdge(manifestPath, edge));
|
|
76
108
|
}
|
|
77
109
|
return { declared, outcomes, refuted: outcomes.some((o) => o.status === "failed") };
|
|
@@ -110,6 +142,31 @@ async function runEdge(manifestPath, edge) {
|
|
|
110
142
|
return { edge, status: "failed", output: output || (e.message ?? "check failed") };
|
|
111
143
|
}
|
|
112
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* The latest published version when `edge` names something NEWER than it — a
|
|
147
|
+
* forward-declared bound, whose verification is pending that release rather than
|
|
148
|
+
* failed or unavailable. `undefined` when the edge exists, when it is older than
|
|
149
|
+
* the latest (a yanked version is deliberately left to the run, whose "could not
|
|
150
|
+
* run" is honest about it), or when the registry could not be asked.
|
|
151
|
+
*
|
|
152
|
+
* Deciding this from the registry rather than from the spawn's failure is the
|
|
153
|
+
* whole point: `npx @telorun/cli@<unpublished>` has one possible outcome, and
|
|
154
|
+
* npm's ETARGET arrives wrapped in install noise that reads exactly like being
|
|
155
|
+
* offline.
|
|
156
|
+
*/
|
|
157
|
+
export function unreleasedEdge(edge, published) {
|
|
158
|
+
if (published === null)
|
|
159
|
+
return undefined;
|
|
160
|
+
const normalized = published.map((v) => (v.startsWith("v") ? v.slice(1) : v));
|
|
161
|
+
if (normalized.includes(edge))
|
|
162
|
+
return undefined;
|
|
163
|
+
// Prereleases included: an `-rc` build is installable, so the newest thing
|
|
164
|
+
// that exists is the honest comparison point for "does this edge exist yet".
|
|
165
|
+
const latest = newestModuleVersion(normalized, { includePrerelease: true });
|
|
166
|
+
if (latest === undefined)
|
|
167
|
+
return undefined;
|
|
168
|
+
return isNewerModuleVersion(edge, latest) ? latest : undefined;
|
|
169
|
+
}
|
|
113
170
|
/** Whether the edge CLI's output actually concerns the manifest under test.
|
|
114
171
|
* Compared on the basename as well as the full path, since a CLI renders a
|
|
115
172
|
* path relative to its own cwd. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-requires.js","sourceRoot":"","sources":["../../src/release/verify-requires.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"verify-requires.js","sourceRoot":"","sources":["../../src/release/verify-requires.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,UAAU,GAEX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEhC;iFACiF;AACjF,MAAM,eAAe,GAAG,OAAO,CAAC;AAqBhC;6EAC6E;AAC7E,MAAM,UAAU,cAAc,CAAC,MAA4B;IACzD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,YAAoB,EACpB,SAAkC,EA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AI,SAAS,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACtD,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvF,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACzD,CAAC"}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* Finding the workspace, and the modules inside it.
|
|
3
3
|
*
|
|
4
4
|
* The Node half of `telo-workspace.yaml`: walking up from the cwd to find the
|
|
5
|
-
* marker, and filtering its named subtrees down to actual modules.
|
|
6
|
-
* marker is
|
|
7
|
-
*
|
|
5
|
+
* marker, and filtering its named subtrees down to actual modules. Finding the
|
|
6
|
+
* marker is `workspace-marker.ts`'s — its location is a general anchor, not a
|
|
7
|
+
* release concept — and parsing it is the analyzer's
|
|
8
|
+
* (`release/workspace-config.ts`), so the editor reads the same file the same
|
|
9
|
+
* way.
|
|
8
10
|
*
|
|
9
11
|
* **Discovery, not registration.** Nothing lists the modules: `modules/sql` is a
|
|
10
12
|
* module because `modules/sql/telo.yaml` carries a `metadata.version`, and that
|
|
@@ -39,10 +41,6 @@ export interface Workspace {
|
|
|
39
41
|
}
|
|
40
42
|
export declare class WorkspaceNotFoundError extends Error {
|
|
41
43
|
}
|
|
42
|
-
/** Walk up from `from` looking for the marker. Returns the directory holding
|
|
43
|
-
* it, or `undefined` — the file is optional, and only `telo release` requires
|
|
44
|
-
* one. */
|
|
45
|
-
export declare function findWorkspaceRoot(from: string): string | undefined;
|
|
46
44
|
/**
|
|
47
45
|
* Load the workspace rooted at or above `from`.
|
|
48
46
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/release/workspace.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/release/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAO3B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,oCAAoC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACrC;AAED,MAAM,WAAW,SAAS;IACxB;oEACgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC/C;AAED,qBAAa,sBAAuB,SAAQ,KAAK;CAAG;AAEpD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,GAAE,MAAsB,GAAG,SAAS,CAYrE;AAoED;;cAEc;AACd,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAejF"}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* Finding the workspace, and the modules inside it.
|
|
3
3
|
*
|
|
4
4
|
* The Node half of `telo-workspace.yaml`: walking up from the cwd to find the
|
|
5
|
-
* marker, and filtering its named subtrees down to actual modules.
|
|
6
|
-
* marker is
|
|
7
|
-
*
|
|
5
|
+
* marker, and filtering its named subtrees down to actual modules. Finding the
|
|
6
|
+
* marker is `workspace-marker.ts`'s — its location is a general anchor, not a
|
|
7
|
+
* release concept — and parsing it is the analyzer's
|
|
8
|
+
* (`release/workspace-config.ts`), so the editor reads the same file the same
|
|
9
|
+
* way.
|
|
8
10
|
*
|
|
9
11
|
* **Discovery, not registration.** Nothing lists the modules: `modules/sql` is a
|
|
10
12
|
* module because `modules/sql/telo.yaml` carries a `metadata.version`, and that
|
|
@@ -20,25 +22,12 @@
|
|
|
20
22
|
*/
|
|
21
23
|
import { DEFAULT_MANIFEST_FILENAME, WORKSPACE_FILENAME, normalizeModuleKey, parseWorkspaceConfig, readManifestVersion, } from "@telorun/analyzer";
|
|
22
24
|
import { GLOB_PRUNE_DIRS, selectByPatterns } from "@telorun/glob";
|
|
25
|
+
import { findWorkspaceRoot } from "../workspace-marker.js";
|
|
23
26
|
import * as fs from "node:fs";
|
|
24
27
|
import * as path from "node:path";
|
|
25
28
|
import { parseAllDocuments } from "yaml";
|
|
26
29
|
export class WorkspaceNotFoundError extends Error {
|
|
27
30
|
}
|
|
28
|
-
/** Walk up from `from` looking for the marker. Returns the directory holding
|
|
29
|
-
* it, or `undefined` — the file is optional, and only `telo release` requires
|
|
30
|
-
* one. */
|
|
31
|
-
export function findWorkspaceRoot(from) {
|
|
32
|
-
let dir = path.resolve(from);
|
|
33
|
-
for (;;) {
|
|
34
|
-
if (fs.existsSync(path.join(dir, WORKSPACE_FILENAME)))
|
|
35
|
-
return dir;
|
|
36
|
-
const parent = path.dirname(dir);
|
|
37
|
-
if (parent === dir)
|
|
38
|
-
return undefined;
|
|
39
|
-
dir = parent;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
31
|
/**
|
|
43
32
|
* Load the workspace rooted at or above `from`.
|
|
44
33
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/release/workspace.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/release/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GAIpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAsBzC,MAAM,OAAO,sBAAuB,SAAQ,KAAK;CAAG;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe,OAAO,CAAC,GAAG,EAAE;IACxD,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,sBAAsB,CAC9B,MAAM,kBAAkB,cAAc,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B;YACnF,wFAAwF;YACxF,gFAAgF,CACnF,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,oBAAoB,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,kBAAkB,CAAC,CAAC;IACvF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAA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IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACrD,CAAC;AAED;;cAEc;AACd,MAAM,UAAU,aAAa,CAAC,SAAoB,EAAE,GAAW;IAC7D,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC;IAC5E,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAC5C,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,UAAU,EAAE,CAAC,CAClD,CAAC;IACF,MAAM,IAAI,KAAK,CACb,IAAI,GAAG,sCAAsC;QAC3C,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;YACvB,CAAC,CAAC,oEAAoE,aAAa;iBAC9E,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,GAAG,CAAC;iBAClC,IAAI,CAAC,MAAM,CAAC,GAAG;YACpB,CAAC,CAAC,iCAAiC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAC/E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding `telo-workspace.yaml` on disk.
|
|
3
|
+
*
|
|
4
|
+
* Its LOCATION is a general anchor — the directory workspace-relative paths are
|
|
5
|
+
* measured from, and the outer bound on how far a walk-up may look — while its
|
|
6
|
+
* `modules:` list is release scope. So the finder lives here rather than under
|
|
7
|
+
* `release/`: `telo run` bounds its `.env` collection with the marker and must
|
|
8
|
+
* not reach into the release namespace to do it, where `loadWorkspace` (which
|
|
9
|
+
* parses `modules:` and throws when the file is absent) sits one import away.
|
|
10
|
+
*
|
|
11
|
+
* Parsing the file is the analyzer's (`release/workspace-config.ts`); finding it
|
|
12
|
+
* is the Node half, and this is all of it.
|
|
13
|
+
*/
|
|
14
|
+
import { WORKSPACE_FILENAME } from "@telorun/analyzer";
|
|
15
|
+
export { WORKSPACE_FILENAME };
|
|
16
|
+
/**
|
|
17
|
+
* Walk up from `from` looking for the marker. Returns the directory holding it,
|
|
18
|
+
* or `undefined` — the file is optional. `telo release` requires one and reports
|
|
19
|
+
* its absence; `telo run` reads `undefined` as "no parent lookup".
|
|
20
|
+
*
|
|
21
|
+
* `from` is resolved through symlinks first: a manifest reached through a linked
|
|
22
|
+
* directory would otherwise walk the LINK's parents, miss a marker that is right
|
|
23
|
+
* there in the real tree, and silently fall back to a narrower answer.
|
|
24
|
+
*/
|
|
25
|
+
export declare function findWorkspaceRoot(from: string): string | undefined;
|
|
26
|
+
/** `fs.realpathSync`, falling back to the input when the path does not exist —
|
|
27
|
+
* a manifest path that is wrong is the caller's error to report, not this
|
|
28
|
+
* helper's to convert into a different one. */
|
|
29
|
+
export declare function realPath(target: string): string;
|
|
30
|
+
//# sourceMappingURL=workspace-marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-marker.d.ts","sourceRoot":"","sources":["../src/workspace-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAIvD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQlE;AAED;;gDAEgD;AAChD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM/C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding `telo-workspace.yaml` on disk.
|
|
3
|
+
*
|
|
4
|
+
* Its LOCATION is a general anchor — the directory workspace-relative paths are
|
|
5
|
+
* measured from, and the outer bound on how far a walk-up may look — while its
|
|
6
|
+
* `modules:` list is release scope. So the finder lives here rather than under
|
|
7
|
+
* `release/`: `telo run` bounds its `.env` collection with the marker and must
|
|
8
|
+
* not reach into the release namespace to do it, where `loadWorkspace` (which
|
|
9
|
+
* parses `modules:` and throws when the file is absent) sits one import away.
|
|
10
|
+
*
|
|
11
|
+
* Parsing the file is the analyzer's (`release/workspace-config.ts`); finding it
|
|
12
|
+
* is the Node half, and this is all of it.
|
|
13
|
+
*/
|
|
14
|
+
import { WORKSPACE_FILENAME } from "@telorun/analyzer";
|
|
15
|
+
import * as fs from "node:fs";
|
|
16
|
+
import * as path from "node:path";
|
|
17
|
+
export { WORKSPACE_FILENAME };
|
|
18
|
+
/**
|
|
19
|
+
* Walk up from `from` looking for the marker. Returns the directory holding it,
|
|
20
|
+
* or `undefined` — the file is optional. `telo release` requires one and reports
|
|
21
|
+
* its absence; `telo run` reads `undefined` as "no parent lookup".
|
|
22
|
+
*
|
|
23
|
+
* `from` is resolved through symlinks first: a manifest reached through a linked
|
|
24
|
+
* directory would otherwise walk the LINK's parents, miss a marker that is right
|
|
25
|
+
* there in the real tree, and silently fall back to a narrower answer.
|
|
26
|
+
*/
|
|
27
|
+
export function findWorkspaceRoot(from) {
|
|
28
|
+
let dir = realPath(path.resolve(from));
|
|
29
|
+
for (;;) {
|
|
30
|
+
if (fs.existsSync(path.join(dir, WORKSPACE_FILENAME)))
|
|
31
|
+
return dir;
|
|
32
|
+
const parent = path.dirname(dir);
|
|
33
|
+
if (parent === dir)
|
|
34
|
+
return undefined;
|
|
35
|
+
dir = parent;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** `fs.realpathSync`, falling back to the input when the path does not exist —
|
|
39
|
+
* a manifest path that is wrong is the caller's error to report, not this
|
|
40
|
+
* helper's to convert into a different one. */
|
|
41
|
+
export function realPath(target) {
|
|
42
|
+
try {
|
|
43
|
+
return fs.realpathSync(target);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return target;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=workspace-marker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-marker.js","sourceRoot":"","sources":["../src/workspace-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACvC,SAAS,CAAC;QACR,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QAClE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,SAAS,CAAC;QACrC,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC;AAED;;gDAEgD;AAChD,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"description": "Telo CLI - Command-line interface for the Telo runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"telo",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@telorun/analyzer": "0.
|
|
37
|
+
"@telorun/analyzer": "0.63.0",
|
|
38
38
|
"@telorun/glob": "0.2.0",
|
|
39
|
-
"@telorun/ide-support": "0.
|
|
40
|
-
"@telorun/kernel": "0.
|
|
41
|
-
"@telorun/sdk": "0.
|
|
39
|
+
"@telorun/ide-support": "0.15.0",
|
|
40
|
+
"@telorun/kernel": "0.79.0",
|
|
41
|
+
"@telorun/sdk": "0.79.0",
|
|
42
42
|
"@telorun/templating": "0.16.0",
|
|
43
43
|
"dotenv": "^17.4.0",
|
|
44
44
|
"packageurl-js": "^2.0.1",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"nock": "^14.0.15",
|
|
56
56
|
"typescript": "^5.0.0",
|
|
57
57
|
"vitest": "^2.1.8",
|
|
58
|
-
"@telorun/debug-ui": "0.6.
|
|
58
|
+
"@telorun/debug-ui": "0.6.2"
|
|
59
59
|
},
|
|
60
60
|
"overrides": {
|
|
61
61
|
"@telorun/analyzer": "$@telorun/analyzer",
|