@thecms/cli 0.20.4-dev.137 → 0.20.4-dev.138

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.
@@ -175,7 +175,7 @@ function realContext(env = process.env) {
175
175
  import { parseArgs } from "util";
176
176
 
177
177
  // src/context.ts
178
- var CLI_VERSION = "0.20.4-dev.137";
178
+ var CLI_VERSION = "0.20.4-dev.138";
179
179
  function call(ctx, path, init = {}) {
180
180
  const { token, client = "cli", ...rest } = init;
181
181
  const headers = new Headers(rest.headers);
@@ -6047,7 +6047,17 @@ async function publish(session, input) {
6047
6047
  const live = schema.draft.ops - stale.length;
6048
6048
  for (const s of stale) plan.change.push(`schema ${input.schema}: the draft's ${s.op} no longer applies and is dropped (${s.why})`);
6049
6049
  if (live > 0) plan.change.push(`schema ${input.schema}: its draft (${live} change${live === 1 ? "" : "s"}) becomes the next version${when}`);
6050
- steps.push({ label: `schema ${input.schema}`, path: `/schemas/${enc2(input.schema)}/publish`, ...publishAt ? { body: { publishAt } } : {} });
6050
+ const published = await session.find(`/schemas/${enc2(input.schema)}?state=published`);
6051
+ const kept = new Set((schema.fields ?? []).map((f) => f.name));
6052
+ let fixable = 0;
6053
+ for (const field of (published?.fields ?? []).filter((f) => !kept.has(f.name))) {
6054
+ const impact = await session.send("POST", "/impact", { target: { kind: "field", entity: input.schema, field: field.name } });
6055
+ const ref = (r) => [r.source, r.path].filter(Boolean).join(" ");
6056
+ for (const b of impact.blocking) refused.push(`field ${field.name}: ${ref(b)} uses it \u2014 change that first`);
6057
+ for (const f of impact.fixable) plan.change.push(`field ${field.name}: ${ref(f)} is fixed with it`);
6058
+ fixable += impact.fixable.length;
6059
+ }
6060
+ steps.push({ label: `schema ${input.schema}`, path: `/schemas/${enc2(input.schema)}/publish${fixable ? "?cascade=true" : ""}`, ...publishAt ? { body: { publishAt } } : {} });
6051
6061
  }
6052
6062
  }
6053
6063
  if (input.records) {
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  CLI_VERSION,
4
4
  projectCli,
5
5
  run
6
- } from "./chunk-CSGYGLCL.js";
6
+ } from "./chunk-S6WTBB6Y.js";
7
7
 
8
8
  // src/cli.ts
9
9
  import { spawn } from "child_process";
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  personalToken,
4
4
  run
5
- } from "./chunk-CSGYGLCL.js";
5
+ } from "./chunk-S6WTBB6Y.js";
6
6
  export {
7
7
  personalToken,
8
8
  run
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecms/cli",
3
- "version": "0.20.4-dev.137",
3
+ "version": "0.20.4-dev.138",
4
4
  "license": "UNLICENSED",
5
5
  "description": "theCMS. command line: the standard's starter, checks, brand, the method's docs, sign-in with a personal token",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "@modelcontextprotocol/sdk": "1.32.1",
38
38
  "@resvg/resvg-wasm": "2.6.2",
39
- "@thecms/sdk": "0.20.4-dev.137",
39
+ "@thecms/sdk": "0.20.4-dev.138",
40
40
  "libpg-query": "18.2.0",
41
41
  "zod": "4.6.5"
42
42
  },