@unified-product-graph/core 0.8.11 → 0.8.12

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.cts CHANGED
@@ -20392,7 +20392,7 @@ declare function isCanonical(text: string): boolean;
20392
20392
  * it stamps the `upg_version` field of every `.upg` file written by the SDK.
20393
20393
  * The `check:version-lockstep` gate enforces this at release time.
20394
20394
  */
20395
- declare const UPG_VERSION: "0.8.11";
20395
+ declare const UPG_VERSION: "0.8.12";
20396
20396
  /**
20397
20397
  * The `.upg` JSON document format version. Written to the `upg_version` field.
20398
20398
  * Evolves independently from `UPG_VERSION` (the catalogue version).
package/dist/index.d.ts CHANGED
@@ -20392,7 +20392,7 @@ declare function isCanonical(text: string): boolean;
20392
20392
  * it stamps the `upg_version` field of every `.upg` file written by the SDK.
20393
20393
  * The `check:version-lockstep` gate enforces this at release time.
20394
20394
  */
20395
- declare const UPG_VERSION: "0.8.11";
20395
+ declare const UPG_VERSION: "0.8.12";
20396
20396
  /**
20397
20397
  * The `.upg` JSON document format version. Written to the `upg_version` field.
20398
20398
  * Evolves independently from `UPG_VERSION` (the catalogue version).
package/dist/index.js CHANGED
@@ -25524,9 +25524,20 @@ function canonicalCrossEdge(edge) {
25524
25524
  function canonicalProduct(product) {
25525
25525
  return orderedObject(product, PRODUCT_KEY_ORDER, { forceKeys: ["id", "title"], openKeys: ["properties"] });
25526
25526
  }
25527
+ function effectiveRootProduct(doc) {
25528
+ const node = doc.nodes?.find((n) => n.type === "product" && n.id === doc.product.id);
25529
+ if (!node) return doc.product;
25530
+ return {
25531
+ ...doc.product,
25532
+ title: node.title ?? doc.product.title,
25533
+ description: node.description ?? doc.product.description,
25534
+ // A product's lifecycle status IS its stage, the same axis (grammar/lifecycles).
25535
+ stage: node.status ?? doc.product.stage
25536
+ };
25537
+ }
25527
25538
  function singleBody(doc) {
25528
25539
  return {
25529
- product: canonicalProduct(doc.product),
25540
+ product: canonicalProduct(effectiveRootProduct(doc)),
25530
25541
  nodes: sortNodes(doc.nodes ?? []).map(canonicalNode),
25531
25542
  edges: sortEdges(doc.edges ?? []).map(canonicalEdge)
25532
25543
  };
@@ -25575,7 +25586,7 @@ function buildProvenance(doc, opts) {
25575
25586
  }
25576
25587
  function serializeSingleWithHeader(doc, opts) {
25577
25588
  const body = singleBody(doc);
25578
- const product = doc.product;
25589
+ const product = effectiveRootProduct(doc);
25579
25590
  const header = {
25580
25591
  format_version: UPG_CANONICAL_FORMAT_VERSION,
25581
25592
  spec_version: doc.upg_version,
@@ -25667,7 +25678,7 @@ function isCanonical(text) {
25667
25678
  }
25668
25679
 
25669
25680
  // src/index.ts
25670
- var UPG_VERSION = "0.8.11";
25681
+ var UPG_VERSION = "0.8.12";
25671
25682
  var UPG_FORMAT_VERSION = "0.4.0";
25672
25683
  var MARKDOWN_FORMAT_VERSION = "0.1";
25673
25684
  var UPG_TYPES = getTypes();