@jigs.design/server 0.3.4 → 0.3.5

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/dist/compile.js +4 -11
  2. package/package.json +6 -6
package/dist/compile.js CHANGED
@@ -57,7 +57,6 @@ function compileCatalog(catalog) {
57
57
  }
58
58
  return out;
59
59
  }
60
- const TAG = /<([a-z][A-Za-z0-9]*)/g;
61
60
  /** Each procedure kind as a diagnostic names it. */
62
61
  const KIND_NAMES = {
63
62
  action: "an action",
@@ -129,12 +128,6 @@ function procedureTable(host, uses) {
129
128
  }
130
129
  return Object.fromEntries(table);
131
130
  }
132
- /** Tag names written in a source. */
133
- function tagsIn(source) {
134
- const tags = /* @__PURE__ */ new Set();
135
- for (const match of source.matchAll(TAG)) if (match[1] !== void 0) tags.add(match[1]);
136
- return tags;
137
- }
138
131
  /** The longest canonical props, as JSON, a page accepts. */
139
132
  const MAX_PAGE_PROPS = 4096;
140
133
  /** A JavaScript identifier, as the compiler requires of a define prop. */
@@ -242,7 +235,7 @@ function createChecker(host) {
242
235
  const problem = [...procedureDiagnostics(host, entry.body, uses), ...inputDiagnostics(host, entry.body)][0];
243
236
  if (problem !== void 0) throw new Error(`Jig "${entry.name}" failed to compile: line ${problem.span.line}: ${problem.message}`);
244
237
  allFacts.set(entry.name, {
245
- tags: tagsIn(entry.body),
238
+ tags: fullLibrary.get(entry.name)?.tags ?? /* @__PURE__ */ new Set(),
246
239
  uses
247
240
  });
248
241
  }
@@ -250,10 +243,10 @@ function createChecker(host) {
250
243
  const pages = new Set(host.jigs.filter((entry) => entry.page).map((entry) => entry.name));
251
244
  const tags = /* @__PURE__ */ new Set([...host.components.components.map((component) => component.name), ...tagLibrary.keys()]);
252
245
  /** The tags a source draws, through every jig it uses, and the procedures those jigs call. */
253
- const reach = (body, facts) => {
246
+ const reach = (written, facts) => {
254
247
  const drawn = new Set(MARKDOWN_ELEMENTS);
255
248
  const uses = [];
256
- const pending = [...tagsIn(body)];
249
+ const pending = [...written];
257
250
  for (let tag = pending.pop(); tag !== void 0; tag = pending.pop()) {
258
251
  if (drawn.has(tag)) continue;
259
252
  drawn.add(tag);
@@ -274,7 +267,7 @@ function createChecker(host) {
274
267
  library
275
268
  });
276
269
  const own = result.procedures;
277
- const reached = reach(result.source, facts);
270
+ const reached = reach(result.tags, facts);
278
271
  const diagnostics = [
279
272
  ...result.diagnostics,
280
273
  ...procedureDiagnostics(host, body, own),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jigs.design/server",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "createJigsServer: checks and streams programs, runs procedures, and serves the sandbox frame.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,11 +29,11 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@jigs.design/compiler": "0.3.4",
33
- "@jigs.design/host": "0.3.4",
34
- "@jigs.design/prompt": "0.3.4",
35
- "@jigs.design/runtime": "0.3.4",
36
- "@jigs.design/protocol": "0.3.4"
32
+ "@jigs.design/compiler": "0.3.5",
33
+ "@jigs.design/host": "0.3.5",
34
+ "@jigs.design/prompt": "0.3.5",
35
+ "@jigs.design/protocol": "0.3.5",
36
+ "@jigs.design/runtime": "0.3.5"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "zod": "^4.0.0"