@telorun/analyzer 0.49.0 → 0.50.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/index.d.ts CHANGED
@@ -26,7 +26,7 @@ export { parseLoadedFile } from "./parse-loaded-file.js";
26
26
  export type { ParseOptions } from "./parse-loaded-file.js";
27
27
  export { desugarLoadedFile, inlineImportManifests } from "./inline-imports.js";
28
28
  export type { SyntheticImport } from "./inline-imports.js";
29
- export { compareModuleVersions, compareParsedModuleVersions, isNewerModuleVersion, isSameModuleVersion, parseModuleVersion, } from "./module-version-order.js";
29
+ export { compareModuleVersions, compareParsedModuleVersions, isNewerModuleVersion, isSameModuleVersion, newestModuleVersion, parseModuleVersion, } from "./module-version-order.js";
30
30
  export type { ParsedModuleVersion } from "./module-version-order.js";
31
31
  export { reconcileModuleVersions } from "./reconcile-module-versions.js";
32
32
  export type { VersionReconciliation } from "./reconcile-module-versions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,YAAY,EACR,cAAc,EACd,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,YAAY,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE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index.js CHANGED
@@ -14,7 +14,7 @@ export { Loader } from "./manifest-loader.js";
14
14
  export { isModuleKind, MODULE_KINDS } from "./module-kinds.js";
15
15
  export { parseLoadedFile } from "./parse-loaded-file.js";
16
16
  export { desugarLoadedFile, inlineImportManifests } from "./inline-imports.js";
17
- export { compareModuleVersions, compareParsedModuleVersions, isNewerModuleVersion, isSameModuleVersion, parseModuleVersion, } from "./module-version-order.js";
17
+ export { compareModuleVersions, compareParsedModuleVersions, isNewerModuleVersion, isSameModuleVersion, newestModuleVersion, parseModuleVersion, } from "./module-version-order.js";
18
18
  export { reconcileModuleVersions } from "./reconcile-module-versions.js";
19
19
  export { residualEntrySchema, residualEntrySchemaMap } from "./residual-schema.js";
20
20
  export { buildDocumentPositions, buildLineOffsets, buildPositionIndex, documentLineOffsets, offsetToPosition, } from "./position-metadata.js";
@@ -30,6 +30,17 @@ export declare class Loader {
30
30
  * set-membership against a previous graph walk's modules without
31
31
  * triggering an extra source read. */
32
32
  canonicalize(url: string): string | undefined;
33
+ /** Drop every memo for `url` so the next `loadFile` reads it from the source
34
+ * chain again — the parsed file in each variant, plus every request URL that
35
+ * canonicalised to it (a module reached under several refs must not stay
36
+ * reachable through one of them).
37
+ *
38
+ * `loadFile`'s fast path assumes a file's contents do not change under a
39
+ * single Loader, which holds until something invalidates one deliberately:
40
+ * `telo check` dropping a manifest whose upstream tag has moved, and watch
41
+ * mode when it returns. Without this the only way to un-cache one file is to
42
+ * discard the whole Loader, taking every unrelated file's memo with it. */
43
+ forget(url: string): void;
33
44
  /** Read one file via the source chain and parse it into a LoadedFile.
34
45
  * The result is shared with `Loader.fileCache`. Callers that want a
35
46
  * private mutable copy must call `parseLoadedFile` directly with the
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-loader.d.ts","sourceRoot":"","sources":["../src/manifest-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,UAAU,EACV,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AAK3B,OA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AO,CAAC,oBAAoB;IAa5B;gFAC4E;IAC5E,OAAO,CAAC,cAAc;IAQtB;;wEAEoE;IAC9D,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAsB3E;;;qCAGiC;IAC3B,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAiI9E;;;;;;;;sBAQkB;IAClB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM;IAOlE,OAAO,CAAC,6BAA6B;IAarC,OAAO,CAAC,mCAAmC;IAc3C,OAAO,CAAC,2BAA2B;YAkCrB,eAAe;IAmB7B;;;0CAGsC;IAChC,gBAAgB,CACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC;QAAE,KAAK,EAAE,WAAW,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CA0B5D"}
@@ -88,6 +88,26 @@ export class Loader {
88
88
  canonicalize(url) {
89
89
  return this.urlToSource.get(url);
90
90
  }
91
+ /** Drop every memo for `url` so the next `loadFile` reads it from the source
92
+ * chain again — the parsed file in each variant, plus every request URL that
93
+ * canonicalised to it (a module reached under several refs must not stay
94
+ * reachable through one of them).
95
+ *
96
+ * `loadFile`'s fast path assumes a file's contents do not change under a
97
+ * single Loader, which holds until something invalidates one deliberately:
98
+ * `telo check` dropping a manifest whose upstream tag has moved, and watch
99
+ * mode when it returns. Without this the only way to un-cache one file is to
100
+ * discard the whole Loader, taking every unrelated file's memo with it. */
101
+ forget(url) {
102
+ const source = this.urlToSource.get(url) ?? url;
103
+ for (const [requestUrl, canonical] of this.urlToSource) {
104
+ if (canonical === source)
105
+ this.urlToSource.delete(requestUrl);
106
+ }
107
+ for (const variant of CACHE_VARIANTS) {
108
+ this.fileCache.delete(`${variant}:${source}`);
109
+ }
110
+ }
91
111
  // --- New API: returns LoadedFile / LoadedModule / LoadedGraph ----------
92
112
  /** Read one file via the source chain and parse it into a LoadedFile.
93
113
  * The result is shared with `Loader.fileCache`. Callers that want a
@@ -33,4 +33,26 @@ export declare function isNewerModuleVersion(candidate: string, current: string)
33
33
  * side. Falls back to exact equality for unparseable tags, so a digest still
34
34
  * matches itself. */
35
35
  export declare function isSameModuleVersion(a: string, b: string): boolean;
36
+ /** The highest-precedence version in `versions`, or `undefined` when none is
37
+ * eligible — the counterpart to {@link isNewerModuleVersion}, and the answer to
38
+ * "what would this import be upgraded TO".
39
+ *
40
+ * Both halves of an upgrade check have to come from the same rule. A host that
41
+ * decides "behind" here but reads "latest" off the head of a version list is
42
+ * answering with whatever order its index happened to return: for a module
43
+ * whose newest tag is a prerelease, list-order says the import is behind and
44
+ * this says it is current — the same manifest against the same index, two
45
+ * answers.
46
+ *
47
+ * Unparseable tags (an OCI digest, a moving `latest`) are dropped rather than
48
+ * ordered, matching this module's refusal to guess elsewhere: keeping one as
49
+ * the running maximum would silence every comparable candidate after it.
50
+ *
51
+ * Prereleases are excluded unless `includePrerelease` — an upgrade offered
52
+ * without being asked for must not walk a caller onto an `-rc` build. A
53
+ * release still outranks a prerelease pin, so `1.0.0-rc.1` → `1.0.0` is found
54
+ * either way. */
55
+ export declare function newestModuleVersion(versions: readonly string[], options?: {
56
+ includePrerelease?: boolean;
57
+ }): string | undefined;
36
58
  //# sourceMappingURL=module-version-order.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module-version-order.d.ts","sourceRoot":"","sources":["../src/module-version-order.ts"],"names":[],"mappings":"AAAA;;;;;;;kDAOkD;AAElD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACtB;AAED;;wBAEwB;AACxB,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,GAAG,IAAI,CAatF;AAED;;iEAEiE;AACjE,wBAAgB,2BAA2B,CACzC,CAAC,EAAE,mBAAmB,EACtB,CAAC,EAAE,mBAAmB,GACrB,MAAM,CAyBR;AAED;+EAC+E;AAC/E,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKzE;AAED;;;+EAG+E;AAC/E,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhF;AAED;;sBAEsB;AACtB,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAEjE"}
1
+ {"version":3,"file":"module-version-order.d.ts","sourceRoot":"","sources":["../src/module-version-order.ts"],"names":[],"mappings":"AAAA;;;;;;;kDAOkD;AAElD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACtB;AAED;;wBAEwB;AACxB,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,GAAG,IAAI,CAatF;AAED;;iEAEiE;AACjE,wBAAgB,2BAA2B,CACzC,CAAC,EAAE,mBAAmB,EACtB,CAAC,EAAE,mBAAmB,GACrB,MAAM,CAyBR;AAED;+EAC+E;AAC/E,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKzE;AAED;;;+EAG+E;AAC/E,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhF;AAED;;sBAEsB;AACtB,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED;;;;;;;;;;;;;;;;;;kBAkBkB;AAClB,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,MAAM,GAAG,SAAS,CAapB"}
@@ -89,3 +89,38 @@ export function isNewerModuleVersion(candidate, current) {
89
89
  export function isSameModuleVersion(a, b) {
90
90
  return a === b || compareModuleVersions(a, b) === 0;
91
91
  }
92
+ /** The highest-precedence version in `versions`, or `undefined` when none is
93
+ * eligible — the counterpart to {@link isNewerModuleVersion}, and the answer to
94
+ * "what would this import be upgraded TO".
95
+ *
96
+ * Both halves of an upgrade check have to come from the same rule. A host that
97
+ * decides "behind" here but reads "latest" off the head of a version list is
98
+ * answering with whatever order its index happened to return: for a module
99
+ * whose newest tag is a prerelease, list-order says the import is behind and
100
+ * this says it is current — the same manifest against the same index, two
101
+ * answers.
102
+ *
103
+ * Unparseable tags (an OCI digest, a moving `latest`) are dropped rather than
104
+ * ordered, matching this module's refusal to guess elsewhere: keeping one as
105
+ * the running maximum would silence every comparable candidate after it.
106
+ *
107
+ * Prereleases are excluded unless `includePrerelease` — an upgrade offered
108
+ * without being asked for must not walk a caller onto an `-rc` build. A
109
+ * release still outranks a prerelease pin, so `1.0.0-rc.1` → `1.0.0` is found
110
+ * either way. */
111
+ export function newestModuleVersion(versions, options = {}) {
112
+ let best;
113
+ let bestParsed;
114
+ for (const version of versions) {
115
+ const parsed = parseModuleVersion(version);
116
+ if (parsed === null)
117
+ continue;
118
+ if (parsed.pre !== null && !options.includePrerelease)
119
+ continue;
120
+ if (bestParsed === undefined || compareParsedModuleVersions(parsed, bestParsed) > 0) {
121
+ best = version;
122
+ bestParsed = parsed;
123
+ }
124
+ }
125
+ return best;
126
+ }
@@ -33,7 +33,11 @@ export function validateModuleArtifact(manifests) {
33
33
  }
34
34
  return out;
35
35
  }
36
- const KNOWN_QUALIFIERS = new Set(["path", "siblings", ...PLATFORM_AXES]);
36
+ /** `local_path` names the source `path=` was built from, so a working copy runs
37
+ * with no build step. It is inert in a published artifact — which ships no
38
+ * `src/` — and contributes nothing to the selector, so it never affects which
39
+ * layer a host fetches. */
40
+ const KNOWN_QUALIFIERS = new Set(["path", "local_path", "siblings", ...PLATFORM_AXES]);
37
41
  /** `pkg:telo/local/<format>?…` — the bundled-controller delivery mode. Parsed by
38
42
  * hand rather than with a PURL library: the analyzer must stay browser-safe and
39
43
  * dependency-light, and the only thing needed here is the qualifier map. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telorun/analyzer",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "Telo Analyzer - Static manifest validator for Telo manifests.",
5
5
  "keywords": [
6
6
  "telo",
@@ -42,13 +42,13 @@
42
42
  "ajv-formats": "^3.0.1",
43
43
  "jsonpath-plus": "^10.3.0",
44
44
  "yaml": "^2.8.3",
45
- "@telorun/templating": "0.11.0"
45
+ "@telorun/templating": "0.11.1"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "^20.0.0",
49
49
  "typescript": "^5.0.0",
50
50
  "vitest": "^2.1.8",
51
- "@telorun/sdk": "0.61.0"
51
+ "@telorun/sdk": "0.63.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@telorun/sdk": "*"
package/src/index.ts CHANGED
@@ -90,6 +90,7 @@ export {
90
90
  compareParsedModuleVersions,
91
91
  isNewerModuleVersion,
92
92
  isSameModuleVersion,
93
+ newestModuleVersion,
93
94
  parseModuleVersion,
94
95
  } from "./module-version-order.js";
95
96
  export type { ParsedModuleVersion } from "./module-version-order.js";
@@ -117,6 +117,26 @@ export class Loader {
117
117
  return this.urlToSource.get(url);
118
118
  }
119
119
 
120
+ /** Drop every memo for `url` so the next `loadFile` reads it from the source
121
+ * chain again — the parsed file in each variant, plus every request URL that
122
+ * canonicalised to it (a module reached under several refs must not stay
123
+ * reachable through one of them).
124
+ *
125
+ * `loadFile`'s fast path assumes a file's contents do not change under a
126
+ * single Loader, which holds until something invalidates one deliberately:
127
+ * `telo check` dropping a manifest whose upstream tag has moved, and watch
128
+ * mode when it returns. Without this the only way to un-cache one file is to
129
+ * discard the whole Loader, taking every unrelated file's memo with it. */
130
+ forget(url: string): void {
131
+ const source = this.urlToSource.get(url) ?? url;
132
+ for (const [requestUrl, canonical] of this.urlToSource) {
133
+ if (canonical === source) this.urlToSource.delete(requestUrl);
134
+ }
135
+ for (const variant of CACHE_VARIANTS) {
136
+ this.fileCache.delete(`${variant}:${source}`);
137
+ }
138
+ }
139
+
120
140
  // --- New API: returns LoadedFile / LoadedModule / LoadedGraph ----------
121
141
 
122
142
  /** Read one file via the source chain and parse it into a LoadedFile.
@@ -89,3 +89,40 @@ export function isNewerModuleVersion(candidate: string, current: string): boolea
89
89
  export function isSameModuleVersion(a: string, b: string): boolean {
90
90
  return a === b || compareModuleVersions(a, b) === 0;
91
91
  }
92
+
93
+ /** The highest-precedence version in `versions`, or `undefined` when none is
94
+ * eligible — the counterpart to {@link isNewerModuleVersion}, and the answer to
95
+ * "what would this import be upgraded TO".
96
+ *
97
+ * Both halves of an upgrade check have to come from the same rule. A host that
98
+ * decides "behind" here but reads "latest" off the head of a version list is
99
+ * answering with whatever order its index happened to return: for a module
100
+ * whose newest tag is a prerelease, list-order says the import is behind and
101
+ * this says it is current — the same manifest against the same index, two
102
+ * answers.
103
+ *
104
+ * Unparseable tags (an OCI digest, a moving `latest`) are dropped rather than
105
+ * ordered, matching this module's refusal to guess elsewhere: keeping one as
106
+ * the running maximum would silence every comparable candidate after it.
107
+ *
108
+ * Prereleases are excluded unless `includePrerelease` — an upgrade offered
109
+ * without being asked for must not walk a caller onto an `-rc` build. A
110
+ * release still outranks a prerelease pin, so `1.0.0-rc.1` → `1.0.0` is found
111
+ * either way. */
112
+ export function newestModuleVersion(
113
+ versions: readonly string[],
114
+ options: { includePrerelease?: boolean } = {},
115
+ ): string | undefined {
116
+ let best: string | undefined;
117
+ let bestParsed: ParsedModuleVersion | undefined;
118
+ for (const version of versions) {
119
+ const parsed = parseModuleVersion(version);
120
+ if (parsed === null) continue;
121
+ if (parsed.pre !== null && !options.includePrerelease) continue;
122
+ if (bestParsed === undefined || compareParsedModuleVersions(parsed, bestParsed) > 0) {
123
+ best = version;
124
+ bestParsed = parsed;
125
+ }
126
+ }
127
+ return best;
128
+ }
@@ -42,7 +42,11 @@ export function validateModuleArtifact(manifests: ResourceManifest[]): AnalysisD
42
42
  return out;
43
43
  }
44
44
 
45
- const KNOWN_QUALIFIERS = new Set<string>(["path", "siblings", ...PLATFORM_AXES]);
45
+ /** `local_path` names the source `path=` was built from, so a working copy runs
46
+ * with no build step. It is inert in a published artifact — which ships no
47
+ * `src/` — and contributes nothing to the selector, so it never affects which
48
+ * layer a host fetches. */
49
+ const KNOWN_QUALIFIERS = new Set<string>(["path", "local_path", "siblings", ...PLATFORM_AXES]);
46
50
 
47
51
  /** `pkg:telo/local/<format>?…` — the bundled-controller delivery mode. Parsed by
48
52
  * hand rather than with a PURL library: the analyzer must stay browser-safe and