@fangorn-network/westmarch 0.0.3-dev → 0.0.4-dev

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/publish/ship.js +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fangorn-network/westmarch",
3
- "version": "0.0.3-dev",
3
+ "version": "0.0.4-dev",
4
4
  "description": "Publisher and consumer surfaces for a Fangorn app: shape a graph, publish it, read it back as a searchable, agent-drivable catalog",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/publish/ship.js CHANGED
@@ -365,6 +365,10 @@ export async function buildLocal(configPath, out, { crawl = false, only = null,
365
365
  schemaId: n.fields?.entityType ?? m[1][0].toUpperCase() + m[1].slice(1), payload: n.fields });
366
366
  }
367
367
  }
368
+ // An empty stage is a crawl that did not happen (or a cache that was not restored), not
369
+ // an app with no records; a view of it would grade as a failure for the wrong reason.
370
+ const staged = Object.entries(chain).filter(([k]) => !k.endsWith(`/${view.SCHEMA_NAMESPACE}`)).reduce((n, [, c]) => n + c.vertices.length, 0);
371
+ if (!staged) throw new Error("no staged records under any source's --output-dir: run the sources (--crawl, or a ship) or restore .ship/stage first");
368
372
  rmSync(out, { recursive: true, force: true });
369
373
  mkdirSync(join(base, ".ship"), { recursive: true });
370
374
  const embed = view.cachedEmbed(join(base, ".ship/vectors.ndjson"));