@telorun/assert 0.5.4 → 0.5.6

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/manifest.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DEFAULT_MANIFEST_FILENAME, Loader, StaticAnalyzer } from "@telorun/analyzer";
1
+ import { DEFAULT_MANIFEST_FILENAME, Loader, StaticAnalyzer, flattenForAnalyzer } from "@telorun/analyzer";
2
2
  import * as fs from "fs/promises";
3
3
  import * as path from "path";
4
4
  class LocalFileSource {
@@ -57,7 +57,10 @@ export async function create(manifest, ctx) {
57
57
  const resolvedUrl = new URL(manifest.source, ctx.moduleContext.source).toString();
58
58
  let manifests;
59
59
  try {
60
- manifests = await loader.loadManifests(resolvedUrl);
60
+ const graph = await loader.loadGraph(resolvedUrl);
61
+ if (graph.errors.length > 0)
62
+ throw graph.errors[0].error;
63
+ manifests = flattenForAnalyzer(graph);
61
64
  }
62
65
  catch (err) {
63
66
  const errMsg = err instanceof Error ? err.message : String(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telorun/assert",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "Telo Assert module - Assertion resource kinds for Telo manifests.",
5
5
  "keywords": [
6
6
  "telo",
@@ -20,13 +20,41 @@
20
20
  },
21
21
  "type": "module",
22
22
  "exports": {
23
- "./schema": "./src/schema.ts",
24
- "./events": "./src/events.ts",
25
- "./module-context": "./src/module-context.ts",
26
- "./manifest": "./src/manifest.ts",
27
- "./equals": "./src/equals.ts",
28
- "./matches": "./src/matches.ts",
29
- "./contains": "./src/contains.ts"
23
+ "./schema": {
24
+ "types": "./dist/schema.d.ts",
25
+ "bun": "./src/schema.ts",
26
+ "import": "./dist/schema.js"
27
+ },
28
+ "./events": {
29
+ "types": "./dist/events.d.ts",
30
+ "bun": "./src/events.ts",
31
+ "import": "./dist/events.js"
32
+ },
33
+ "./module-context": {
34
+ "types": "./dist/module-context.d.ts",
35
+ "bun": "./src/module-context.ts",
36
+ "import": "./dist/module-context.js"
37
+ },
38
+ "./manifest": {
39
+ "types": "./dist/manifest.d.ts",
40
+ "bun": "./src/manifest.ts",
41
+ "import": "./dist/manifest.js"
42
+ },
43
+ "./equals": {
44
+ "types": "./dist/equals.d.ts",
45
+ "bun": "./src/equals.ts",
46
+ "import": "./dist/equals.js"
47
+ },
48
+ "./matches": {
49
+ "types": "./dist/matches.d.ts",
50
+ "bun": "./src/matches.ts",
51
+ "import": "./dist/matches.js"
52
+ },
53
+ "./contains": {
54
+ "types": "./dist/contains.d.ts",
55
+ "bun": "./src/contains.ts",
56
+ "import": "./dist/contains.js"
57
+ }
30
58
  },
31
59
  "files": [
32
60
  "dist",
@@ -34,8 +62,8 @@
34
62
  ],
35
63
  "dependencies": {
36
64
  "@sinclair/typebox": "^0.34.48",
37
- "@telorun/analyzer": "0.8.1",
38
- "@telorun/sdk": "0.7.0"
65
+ "@telorun/analyzer": "0.10.0",
66
+ "@telorun/sdk": "0.10.0"
39
67
  },
40
68
  "devDependencies": {
41
69
  "@types/node": "^20.0.0",
package/src/manifest.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DEFAULT_MANIFEST_FILENAME, Loader, StaticAnalyzer, type AnalysisDiagnostic, type ManifestSource } from "@telorun/analyzer";
1
+ import { DEFAULT_MANIFEST_FILENAME, Loader, StaticAnalyzer, flattenForAnalyzer, type AnalysisDiagnostic, type ManifestSource } from "@telorun/analyzer";
2
2
  import type { ResourceContext, Runnable } from "@telorun/sdk";
3
3
  import * as fs from "fs/promises";
4
4
  import * as path from "path";
@@ -84,7 +84,9 @@ export async function create(
84
84
  const resolvedUrl = new URL(manifest.source, ctx.moduleContext.source).toString();
85
85
  let manifests;
86
86
  try {
87
- manifests = await loader.loadManifests(resolvedUrl);
87
+ const graph = await loader.loadGraph(resolvedUrl);
88
+ if (graph.errors.length > 0) throw graph.errors[0].error;
89
+ manifests = flattenForAnalyzer(graph);
88
90
  } catch (err) {
89
91
  const errMsg = err instanceof Error ? err.message : String(err);
90
92
  if (manifest.expect.loadError) {