@stndrds/cli 1.0.0-alpha.284 → 1.0.0-alpha.286

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/bin.mjs +36 -2
  2. package/package.json +2 -2
package/dist/bin.mjs CHANGED
@@ -605,10 +605,10 @@ var PREAMBLE = [
605
605
  ""
606
606
  ].join("\n");
607
607
  function isViewDiverged(view) {
608
- return view.baselineHash !== null && view.dbHash !== view.baselineHash;
608
+ return view.origin !== "code" && view.baselineHash !== null && view.dbHash !== view.baselineHash;
609
609
  }
610
610
  function hasReconcilableDrift(state) {
611
- return state.drift.customObjects.length > 0 || state.drift.systemObjectDrift.length > 0 || state.views.some(isViewDiverged);
611
+ return state.drift.customObjects.length > 0 || state.drift.systemObjectDrift.length > 0 || state.views.some(isViewDiverged) || state.views.some((v) => v.origin === "code" && v.workspaceOverlay !== null) || state.views.some((v) => v.origin === "runtime");
612
612
  }
613
613
  function renderAttribute(objectName, sealed, attr) {
614
614
  const action = attr.tolerated ? "Already tolerated \u2014 declare it in the builder to make it a system attribute, or leave tolerated." : `Choose: **declare** \`${attr.name}\` on the \`${objectName}\` builder (\u2192 becomes system on next sync), OR **tolerate** it \u2014 add \`.tolerate(["${attr.name}"])\`${sealed ? " (required: the object is sealed)" : ""}.`;
@@ -634,6 +634,28 @@ function renderView(view) {
634
634
  );
635
635
  return lines.join("\n");
636
636
  }
637
+ function renderWorkspaceOverlay(view) {
638
+ const lines = [
639
+ `### view \`${view.object}:${view.name}:${view.type}\``,
640
+ "",
641
+ "Workspace overlay to fold into the builder call (or leave as a runtime-only workspace customization):",
642
+ "```json",
643
+ JSON.stringify(view.workspaceOverlay, null, 2),
644
+ "```"
645
+ ];
646
+ return lines.join("\n");
647
+ }
648
+ function renderAdoptionCandidate(view) {
649
+ const lines = [
650
+ `### view \`${view.object}:${view.name}:${view.type}\``,
651
+ "",
652
+ "Runtime-only view to adopt into a builder call (or leave as runtime-only):",
653
+ "```json",
654
+ JSON.stringify(view.config, null, 2),
655
+ "```"
656
+ ];
657
+ return lines.join("\n");
658
+ }
637
659
  function renderReconciliationPrompt(state) {
638
660
  if (!hasReconcilableDrift(state))
639
661
  return `${PREAMBLE}
@@ -652,6 +674,18 @@ Add an \`object("${obj.name}")\` builder, then its attributes:`
652
674
  for (const a of entry.customAttributes)
653
675
  parts.push(renderAttribute(entry.objectName, entry.sealed, a));
654
676
  }
677
+ const overlaidViews = state.views.filter(
678
+ (v) => v.origin === "code" && v.workspaceOverlay !== null
679
+ );
680
+ if (overlaidViews.length) {
681
+ parts.push("## Workspace customizations to fold into code");
682
+ for (const v of overlaidViews) parts.push(renderWorkspaceOverlay(v));
683
+ }
684
+ const runtimeViews = state.views.filter((v) => v.origin === "runtime");
685
+ if (runtimeViews.length) {
686
+ parts.push("## Runtime views to adopt into code");
687
+ for (const v of runtimeViews) parts.push(renderAdoptionCandidate(v));
688
+ }
655
689
  const divergedViews = state.views.filter(isViewDiverged);
656
690
  if (divergedViews.length) {
657
691
  parts.push("## Drifted views");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stndrds/cli",
3
- "version": "1.0.0-alpha.284",
3
+ "version": "1.0.0-alpha.286",
4
4
  "description": "CLI tool to interact with Standards API",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,7 +13,7 @@
13
13
  "chalk": "^5.4.1",
14
14
  "cli-table3": "^0.6.5",
15
15
  "commander": "^13.1.0",
16
- "@stndrds/schema": "1.0.0-alpha.284"
16
+ "@stndrds/schema": "1.0.0-alpha.286"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/node": "^25.6.0",