@orkestrel/scaffold 0.0.26 → 0.0.27

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.
@@ -283,8 +283,8 @@ var DEFAULT_ENGINES = `>=${MINIMUM_NODE_VERSION}`;
283
283
  /** The tooling versions scaffold and every generated workspace share. */
284
284
  var BASE_DEV_DEPENDENCIES = Object.freeze({
285
285
  "@microsoft/api-extractor": "^7.58.12",
286
- "@orkestrel/guide": "^0.0.9",
287
- "@orkestrel/scaffold": "^0.0.26",
286
+ "@orkestrel/guide": "^0.0.10",
287
+ "@orkestrel/scaffold": "^0.0.27",
288
288
  "@types/node": "^26.2.0",
289
289
  oxfmt: "^0.62.0",
290
290
  oxlint: "^1.77.0",
@@ -299,11 +299,11 @@ var SOURCE_BROWSER_DEV_DEPENDENCIES = Object.freeze({
299
299
  playwright: "^1.62.1"
300
300
  });
301
301
  /** The development dependency every private `app` environment adds. */
302
- var APP_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/contract": "^0.0.10" });
302
+ var APP_DEV_DEPENDENCIES = Object.freeze({ "@orkestrel/contract": "^0.0.11" });
303
303
  /** The development dependencies a private Vue browser application adds. */
304
304
  var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
305
305
  ...SOURCE_BROWSER_DEV_DEPENDENCIES,
306
- "@orkestrel/html": "^0.0.2",
306
+ "@orkestrel/html": "^0.0.3",
307
307
  "@vitejs/plugin-vue": "^6.0.8",
308
308
  vue: "^3.5.40",
309
309
  "vue-tsc": "^3.3.7"
@@ -321,10 +321,10 @@ var APP_BROWSER_DEV_DEPENDENCIES = Object.freeze({
321
321
  var SHOWCASE_DEV_DEPENDENCIES = Object.freeze({ "vite-plugin-singlefile": "^2.3.3" });
322
322
  /** The development dependencies a private server application adds. */
323
323
  var APP_SERVER_DEV_DEPENDENCIES = Object.freeze({
324
- "@orkestrel/emitter": "^0.0.5",
325
- "@orkestrel/middleware": "^0.0.9",
326
- "@orkestrel/router": "^0.0.8",
327
- "@orkestrel/server": "^0.0.10"
324
+ "@orkestrel/emitter": "^0.0.6",
325
+ "@orkestrel/middleware": "^0.0.10",
326
+ "@orkestrel/router": "^0.0.9",
327
+ "@orkestrel/server": "^0.0.11"
328
328
  });
329
329
  //#endregion
330
330
  //#region src/core/templates.ts
@@ -1591,7 +1591,8 @@ var isMirror = (0, _orkestrel_contract.unionOf)((0, _orkestrel_contract.recordOf
1591
1591
  var isCatalogEntry = (0, _orkestrel_contract.unionOf)((0, _orkestrel_contract.recordOf)({
1592
1592
  name: isDependencyName,
1593
1593
  lookup: (0, _orkestrel_contract.literalOf)("found"),
1594
- version: _orkestrel_contract.isString
1594
+ version: _orkestrel_contract.isString,
1595
+ dependencies: (0, _orkestrel_contract.andOf)(isCollection, (0, _orkestrel_contract.arrayOf)(isDependency))
1595
1596
  }), (0, _orkestrel_contract.recordOf)({
1596
1597
  name: isDependencyName,
1597
1598
  lookup: (0, _orkestrel_contract.literalOf)("missing", "failed"),
@@ -2164,6 +2165,54 @@ function matchesDriftReachability(ownership, finding) {
2164
2165
  return finding.drift === "stale" && ownership === "content";
2165
2166
  }
2166
2167
  /**
2168
+ * Project a catalog into the layers it publishes in.
2169
+ *
2170
+ * @param entries - The catalog rows to order.
2171
+ * @returns One layer per round, each holding the names publishable together,
2172
+ * sorted within the layer; a name whose edges never resolve is omitted.
2173
+ *
2174
+ * @remarks
2175
+ * A layer is a deterministic function of the catalog's own edges, so it is
2176
+ * computed here rather than stored on a row that could disagree with them.
2177
+ * Only RUNTIME edges between catalogued packages count: a development
2178
+ * dependency reaches no consumer, so it constrains nothing about publish order,
2179
+ * and an edge leaving the fleet is a package this catalog does not publish.
2180
+ *
2181
+ * The order matters because these packages are `0.0.x`, where a caret pins one
2182
+ * exact release. Publishing a dependent before its dependency leaves the
2183
+ * dependent pinned to the older release, and two ranges that disagree install
2184
+ * two copies of one package that the compiler reads as two distinct types.
2185
+ *
2186
+ * A cycle cannot be published in rounds, so its members are omitted rather than
2187
+ * placed in an order that would be wrong. An absent name is the report: compare
2188
+ * the returned names against the catalog to find one.
2189
+ *
2190
+ * @example
2191
+ * ```ts
2192
+ * import { catalogToLayers } from '@orkestrel/scaffold'
2193
+ *
2194
+ * catalogToLayers(entries)[0] // the names that depend on nothing in the fleet
2195
+ * ```
2196
+ */
2197
+ function catalogToLayers(entries) {
2198
+ const published = new Set(entries.filter((entry) => entry.lookup === "found").map((entry) => entry.name));
2199
+ const pending = /* @__PURE__ */ new Map();
2200
+ for (const entry of entries) {
2201
+ if (entry.lookup !== "found") continue;
2202
+ const edges = entry.dependencies.map((dependency) => dependency.name);
2203
+ pending.set(entry.name, new Set(edges.filter((name) => published.has(name))));
2204
+ }
2205
+ const layers = [];
2206
+ while (pending.size > 0) {
2207
+ const ready = [...pending].filter(([, edges]) => edges.size === 0).map(([name]) => name);
2208
+ if (ready.length === 0) break;
2209
+ for (const name of ready) pending.delete(name);
2210
+ for (const edges of pending.values()) for (const name of ready) edges.delete(name);
2211
+ layers.push(ready.sort());
2212
+ }
2213
+ return layers;
2214
+ }
2215
+ /**
2167
2216
  * Project a plan into its tally by artifact origin.
2168
2217
  *
2169
2218
  * @param plan - The plan to summarize.
@@ -4355,6 +4404,7 @@ exports.blueprintToScripts = blueprintToScripts;
4355
4404
  exports.blueprintToSourceArtifacts = blueprintToSourceArtifacts;
4356
4405
  exports.blueprintToTestArtifacts = blueprintToTestArtifacts;
4357
4406
  exports.bytesToHex = bytesToHex;
4407
+ exports.catalogToLayers = catalogToLayers;
4358
4408
  exports.cloneValue = cloneValue;
4359
4409
  exports.compareVersions = compareVersions;
4360
4410
  exports.computeBytes = computeBytes;