@telorun/cli 0.78.0 → 0.80.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/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 +9 -0
- package/dist/workspace-marker.d.ts.map +1 -0
- package/dist/workspace-marker.js +9 -0
- package/dist/workspace-marker.js.map +1 -0
- package/package.json +6 -6
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
* dependency. When a sibling adopts new syntax, every dependent fails its own
|
|
18
18
|
* edge check until its range moves. Nothing walks a graph — the check is the
|
|
19
19
|
* walk.
|
|
20
|
+
*
|
|
21
|
+
* **A forward-declared edge is not a failure here.** A module adopting new syntax
|
|
22
|
+
* declares the release that will carry it, and on the commit that does so that
|
|
23
|
+
* release does not exist yet — which is the point of declaring the bound before
|
|
24
|
+
* it. Such an edge is reported `pending` and never runs; `publish` is where it
|
|
25
|
+
* becomes fatal, by which time npm has published and the version exists.
|
|
20
26
|
*/
|
|
21
27
|
import { lowerBound, readRequires, upperBound } from "@telorun/analyzer";
|
|
22
28
|
import { execFile } from "node:child_process";
|
|
@@ -24,6 +30,7 @@ import * as fs from "node:fs";
|
|
|
24
30
|
import { promisify } from "node:util";
|
|
25
31
|
import { parseAllDocuments } from "yaml";
|
|
26
32
|
import { defaultCustomTags } from "@telorun/templating";
|
|
33
|
+
import { publishedTeloVersions, unreleasedEdge } from "./verify-requires.js";
|
|
27
34
|
const run = promisify(execFile);
|
|
28
35
|
/** Generous by design: an edge CLI is fetched on first use. Bounds a hang, does
|
|
29
36
|
* not pace the work. */
|
|
@@ -84,8 +91,24 @@ export async function checkWorkspaceRequires(workspace, currentVersion) {
|
|
|
84
91
|
byEdge.set(edge, [module]);
|
|
85
92
|
}
|
|
86
93
|
}
|
|
94
|
+
// Asked ONCE for the whole workspace, before any edge runs: the normal way new
|
|
95
|
+
// syntax lands is a module declaring the range of the release that will carry
|
|
96
|
+
// it, and until that release ships there is nothing to install. Spawning `npx`
|
|
97
|
+
// at such an edge has one possible outcome, and npm's ETARGET arrives wrapped
|
|
98
|
+
// in install noise indistinguishable from being offline.
|
|
99
|
+
const published = byEdge.size > 0 ? await publishedTeloVersions() : null;
|
|
87
100
|
const checks = [];
|
|
88
101
|
for (const [edge, modules] of [...byEdge].sort(([a], [b]) => (a < b ? -1 : 1))) {
|
|
102
|
+
const latestPublished = unreleasedEdge(edge, published);
|
|
103
|
+
if (latestPublished !== undefined) {
|
|
104
|
+
checks.push({
|
|
105
|
+
edge,
|
|
106
|
+
modules: modules.map((m) => m.key),
|
|
107
|
+
status: "pending",
|
|
108
|
+
detail: latestPublished,
|
|
109
|
+
});
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
89
112
|
checks.push(...(await checkEdge(edge, modules)));
|
|
90
113
|
}
|
|
91
114
|
return { checks, refuted: checks.some((c) => c.status === "failed") };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-requires.js","sourceRoot":"","sources":["../../src/release/check-requires.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"check-requires.js","sourceRoot":"","sources":["../../src/release/check-requires.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG7E,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEhC;yBACyB;AACzB,MAAM,eAAe,G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YACxB,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;SAC5B,CAAC,CAAC;QACH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC9B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,GAAG,GAA6E,CAAC;QACxF,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC;QAC5F,4EAA4E;QAC5E,uEAAuE;QACvE,OAAO,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;YAC/B,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE;YAC9B,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxC,CAAC;AACH,CAAC;AAED;;eAEe;AACf,SAAS,YAAY,CAAC,MAAc,EAAE,YAAoB;IACxD,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7E,OAAO,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** One `controllers:` candidate, already parsed by the caller's PURL parser.
|
|
2
|
+
* Taking parsed candidates rather than manifest text is deliberate: a second
|
|
3
|
+
* PURL grammar here would drift from the one the loader and `publish` use the
|
|
4
|
+
* moment a qualifier moves, and this decides what gets pushed to a registry. */
|
|
5
|
+
export interface ControllerCandidate {
|
|
6
|
+
readonly packageName: string;
|
|
7
|
+
readonly versionSpec: string;
|
|
8
|
+
readonly type: string;
|
|
9
|
+
/** The candidate's `local_path` qualifier, already resolved to an absolute
|
|
10
|
+
* path by the caller's parser — the package directory as the PURL states it,
|
|
11
|
+
* rather than as a directory-name convention guesses it. */
|
|
12
|
+
readonly localPath?: string;
|
|
13
|
+
}
|
|
14
|
+
/** A `pkg:npm/<name>@<version>` controller candidate this module owns. */
|
|
15
|
+
export interface OwnedNpmPackage {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
/** The version the manifest pins, which must be the module's own. */
|
|
18
|
+
readonly pinnedVersion: string;
|
|
19
|
+
readonly directory: string;
|
|
20
|
+
readonly packageVersion: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The npm packages this module's manifest names and this module's own directory
|
|
24
|
+
* provides. A PURL naming someone else's package resolves from npm as usual and
|
|
25
|
+
* is not returned.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ownedNpmPackages(controllers: readonly ControllerCandidate[], moduleDir: string): OwnedNpmPackage[];
|
|
28
|
+
/**
|
|
29
|
+
* Why this package cannot be published as it stands, or undefined.
|
|
30
|
+
*
|
|
31
|
+
* A module has ONE version, and a manifest that pins a different one is how the
|
|
32
|
+
* old arrangement failed silently: the package kept moving with its module while
|
|
33
|
+
* the PURL stayed behind, so consumers loaded a tarball years older than the
|
|
34
|
+
* manifest describing it. Stated here rather than repaired, because which of the
|
|
35
|
+
* three is wrong is the author's to say.
|
|
36
|
+
*/
|
|
37
|
+
export declare function describeVersionSkew(owned: OwnedNpmPackage, moduleVersion: string | undefined): string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Whether npm already has this exact version.
|
|
40
|
+
*
|
|
41
|
+
* An UNREACHABLE registry classifies nothing — the rule `publishedTeloVersions`
|
|
42
|
+
* already follows. `npm view` exits non-zero both for a version that does not
|
|
43
|
+
* exist and for a network or auth failure, and reading the second as the first
|
|
44
|
+
* sends the command on to `npm publish`, where the real cause surfaces as npm's
|
|
45
|
+
* message instead of this one. So only the E404 signal answers "not published";
|
|
46
|
+
* anything else is rethrown with what was actually being asked.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isPublished(name: string, version: string): Promise<boolean>;
|
|
49
|
+
export declare function publishPackage(owned: OwnedNpmPackage): Promise<void>;
|
|
50
|
+
//# sourceMappingURL=npm-controller-package.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-controller-package.d.ts","sourceRoot":"","sources":["../../src/release/npm-controller-package.ts"],"names":[],"mappings":"AA4BA;;;iFAGiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;iEAE6D;IAC7D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,SAAS,mBAAmB,EAAE,EAC3C,SAAS,EAAE,MAAM,GAChB,eAAe,EAAE,CAuBnB;AAkCD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,EACtB,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,GAAG,SAAS,CAcpB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBjF;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1E"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Publishing a module's OWN npm package, for a module whose controller is
|
|
3
|
+
* delivered that way.
|
|
4
|
+
*
|
|
5
|
+
* Most modules bundle their controller into the module artifact, so nothing is
|
|
6
|
+
* fetched at load and there is no package to push. A module that cannot be
|
|
7
|
+
* bundled — one whose driver resolves a native binary relative to its own
|
|
8
|
+
* package directory — names `pkg:npm/<name>@<version>` instead, and that tarball
|
|
9
|
+
* has to exist for any consumer outside this checkout.
|
|
10
|
+
*
|
|
11
|
+
* Nothing was pushing it. Those packages moved from changesets to the module
|
|
12
|
+
* ledger (their version is their module's, so they are listed in
|
|
13
|
+
* `.changeset/config.json`'s `ignore`), and no publisher took over — which is
|
|
14
|
+
* why a module could ship a manifest naming a version of itself that npm had
|
|
15
|
+
* never seen. `telo publish` is where it belongs: it is what ships the module,
|
|
16
|
+
* and the two must go out together or the manifest names a tarball nobody has.
|
|
17
|
+
*
|
|
18
|
+
* Only a package the module OWNS is ever published: same directory, and the name
|
|
19
|
+
* the module's own PURL asks for. A dependency's package is not this module's to
|
|
20
|
+
* release.
|
|
21
|
+
*/
|
|
22
|
+
import { execFile } from "node:child_process";
|
|
23
|
+
import fs from "node:fs";
|
|
24
|
+
import path from "node:path";
|
|
25
|
+
import { promisify } from "node:util";
|
|
26
|
+
const run = promisify(execFile);
|
|
27
|
+
/**
|
|
28
|
+
* The npm packages this module's manifest names and this module's own directory
|
|
29
|
+
* provides. A PURL naming someone else's package resolves from npm as usual and
|
|
30
|
+
* is not returned.
|
|
31
|
+
*/
|
|
32
|
+
export function ownedNpmPackages(controllers, moduleDir) {
|
|
33
|
+
const owned = [];
|
|
34
|
+
const seen = new Set();
|
|
35
|
+
for (const candidate of controllers) {
|
|
36
|
+
if (candidate.type !== "npm")
|
|
37
|
+
continue;
|
|
38
|
+
// The package directory comes from the candidate's own `local_path`, which
|
|
39
|
+
// is what the PURL already says it is. Assuming `<moduleDir>/nodejs` was a
|
|
40
|
+
// layout heuristic in the generic publish path — true of this repo and of
|
|
41
|
+
// nothing that guarantees it.
|
|
42
|
+
const directory = candidate.localPath ?? path.join(moduleDir, "nodejs");
|
|
43
|
+
const pkg = readPackageJson(path.join(directory, "package.json"));
|
|
44
|
+
if (!pkg?.name || !pkg.version || pkg.private)
|
|
45
|
+
continue;
|
|
46
|
+
if (candidate.packageName !== pkg.name)
|
|
47
|
+
continue;
|
|
48
|
+
if (!candidate.versionSpec || seen.has(candidate.versionSpec))
|
|
49
|
+
continue;
|
|
50
|
+
seen.add(candidate.versionSpec);
|
|
51
|
+
owned.push({
|
|
52
|
+
name: candidate.packageName,
|
|
53
|
+
pinnedVersion: candidate.versionSpec,
|
|
54
|
+
directory,
|
|
55
|
+
packageVersion: pkg.version,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return owned;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A package manifest, or undefined when there is none.
|
|
62
|
+
*
|
|
63
|
+
* A missing file is the ordinary answer for a module that ships no package.
|
|
64
|
+
* A MALFORMED one is not: it is the file this step reads to decide what gets
|
|
65
|
+
* pushed, so reading it as absent would silently skip the publish the caller
|
|
66
|
+
* asked for.
|
|
67
|
+
*/
|
|
68
|
+
function readPackageJson(file) {
|
|
69
|
+
let text;
|
|
70
|
+
try {
|
|
71
|
+
text = fs.readFileSync(file, "utf8");
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
return JSON.parse(text);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
throw new Error(`${file} is not valid JSON: ${err.message}. ` +
|
|
81
|
+
`It decides which package this module publishes, so it cannot be skipped.`, { cause: err });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Why this package cannot be published as it stands, or undefined.
|
|
86
|
+
*
|
|
87
|
+
* A module has ONE version, and a manifest that pins a different one is how the
|
|
88
|
+
* old arrangement failed silently: the package kept moving with its module while
|
|
89
|
+
* the PURL stayed behind, so consumers loaded a tarball years older than the
|
|
90
|
+
* manifest describing it. Stated here rather than repaired, because which of the
|
|
91
|
+
* three is wrong is the author's to say.
|
|
92
|
+
*/
|
|
93
|
+
export function describeVersionSkew(owned, moduleVersion) {
|
|
94
|
+
if (owned.packageVersion !== owned.pinnedVersion) {
|
|
95
|
+
return (`${owned.name}: the manifest pins ${owned.pinnedVersion} but the package is ` +
|
|
96
|
+
`${owned.packageVersion}. A module has one version across its manifest and its package.`);
|
|
97
|
+
}
|
|
98
|
+
if (moduleVersion && moduleVersion !== owned.packageVersion) {
|
|
99
|
+
return (`${owned.name}: the package is ${owned.packageVersion} but the module is ${moduleVersion}. ` +
|
|
100
|
+
`A module has one version across its manifest and its package.`);
|
|
101
|
+
}
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Whether npm already has this exact version.
|
|
106
|
+
*
|
|
107
|
+
* An UNREACHABLE registry classifies nothing — the rule `publishedTeloVersions`
|
|
108
|
+
* already follows. `npm view` exits non-zero both for a version that does not
|
|
109
|
+
* exist and for a network or auth failure, and reading the second as the first
|
|
110
|
+
* sends the command on to `npm publish`, where the real cause surfaces as npm's
|
|
111
|
+
* message instead of this one. So only the E404 signal answers "not published";
|
|
112
|
+
* anything else is rethrown with what was actually being asked.
|
|
113
|
+
*/
|
|
114
|
+
export async function isPublished(name, version) {
|
|
115
|
+
try {
|
|
116
|
+
const { stdout } = await run("npm", ["view", `${name}@${version}`, "version"], {
|
|
117
|
+
encoding: "utf8",
|
|
118
|
+
});
|
|
119
|
+
return stdout.trim() === version;
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
const output = `${err?.stderr ?? ""}${err?.stdout ?? ""}`;
|
|
123
|
+
if (/E404|code E404|is not in this registry|No match found/i.test(output))
|
|
124
|
+
return false;
|
|
125
|
+
throw new Error(`could not ask npm whether ${name}@${version} is published: ` +
|
|
126
|
+
`${err?.message ?? String(err)}. ` +
|
|
127
|
+
`Publishing was not attempted — an unreachable registry is not an answer.`, { cause: err });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export async function publishPackage(owned) {
|
|
131
|
+
await run("npm", ["publish", "--access", "public"], {
|
|
132
|
+
cwd: owned.directory,
|
|
133
|
+
encoding: "utf8",
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=npm-controller-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm-controller-package.js","sourceRoot":"","sources":["../../src/release/npm-controller-package.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAyBhC;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,WAA2C,EAC3C,SAAiB;IAEjB,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACpC,IAAI,SAAS,CAAC,IAAI,KAAK,KAAK;YAAE,SAAS;QACvC,2EAA2E;QAC3E,2EAA2E;QAC3E,0EAA0E;QAC1E,8BAA8B;QAC9B,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,C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,KAAsB;IACzD,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE;QAClD,GAAG,EAAE,KAAK,CAAC,SAAS;QACpB,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -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,EAClC,OAOC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC;IAC5B,IAAI,CAAC,QAAQ;QAAE,OAAO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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":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U,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,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding `telo-workspace.yaml` on disk — re-exported from the kernel, which owns
|
|
3
|
+
* it because `resolveCacheRoot` anchors the `.telo` cache on the same marker and
|
|
4
|
+
* must answer without a CLI (a child kernel started through the runtime seam, a
|
|
5
|
+
* test harness). Two walks would eventually disagree about what "this repo" means
|
|
6
|
+
* for env collection and for the cache.
|
|
7
|
+
*/
|
|
8
|
+
export { WORKSPACE_FILENAME, findWorkspaceRoot, realPath } from "@telorun/kernel";
|
|
9
|
+
//# 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;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding `telo-workspace.yaml` on disk — re-exported from the kernel, which owns
|
|
3
|
+
* it because `resolveCacheRoot` anchors the `.telo` cache on the same marker and
|
|
4
|
+
* must answer without a CLI (a child kernel started through the runtime seam, a
|
|
5
|
+
* test harness). Two walks would eventually disagree about what "this repo" means
|
|
6
|
+
* for env collection and for the cache.
|
|
7
|
+
*/
|
|
8
|
+
export { WORKSPACE_FILENAME, findWorkspaceRoot, realPath } from "@telorun/kernel";
|
|
9
|
+
//# sourceMappingURL=workspace-marker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-marker.js","sourceRoot":"","sources":["../src/workspace-marker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.80.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.64.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.16.0",
|
|
40
|
+
"@telorun/kernel": "0.80.0",
|
|
41
|
+
"@telorun/sdk": "0.80.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",
|