@decocms/parity 0.33.19 → 0.33.20

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/cli.js +21 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -57919,6 +57919,21 @@ function writeBackup(version) {
57919
57919
  `);
57920
57920
  return backup;
57921
57921
  }
57922
+ function richTextCombinationRisk(usedKeys) {
57923
+ if (usedKeys.includes("RichText") && usedKeys.length > 1) {
57924
+ return "sections include RichText alongside another section — that combination is known to answer VALIDATION_ERROR on some accounts (see #348). If the commit below fails with an unexplained VALIDATION_ERROR, this is the first thing to bisect.";
57925
+ }
57926
+ return null;
57927
+ }
57928
+ function explainCommitError(err, usedKeys) {
57929
+ if (!(err instanceof Error) || !err.message.includes("VALIDATION_ERROR"))
57930
+ return err;
57931
+ const risk = richTextCombinationRisk(usedKeys);
57932
+ if (!risk)
57933
+ return err;
57934
+ return new Error(`${err.message}
57935
+ ${risk}`);
57936
+ }
57922
57937
  function resolveAuthor(explicit) {
57923
57938
  const author = explicit ?? readVtexSession()?.login;
57924
57939
  if (!author) {
@@ -58128,6 +58143,9 @@ async function cmsPushCommand(opts, call = callCms) {
58128
58143
  if (remote.baseHash !== local.baseHash) {
58129
58144
  return fail(new Error(`Stale: pulled at ${local.baseHash.slice(0, 12)}, remote is at ${remote.baseHash.slice(0, 12)}. Pull again.`));
58130
58145
  }
58146
+ const richTextRisk = richTextCombinationRisk(used);
58147
+ if (richTextRisk)
58148
+ console.log(`${chalk7.yellow("!")} ${richTextRisk}`);
58131
58149
  if (!opts.yes) {
58132
58150
  console.log(chalk7.yellow("dry run — nothing written. Pass --yes to commit."));
58133
58151
  for (const line of summarizeSections(local.data))
@@ -58150,7 +58168,9 @@ async function cmsPushCommand(opts, call = callCms) {
58150
58168
  author,
58151
58169
  identifierKeys: local.identifierKeys,
58152
58170
  searchKeywords: local.searchKeywords
58153
- }, call);
58171
+ }, call).catch((err) => {
58172
+ throw explainCommitError(err, used);
58173
+ });
58154
58174
  if (opts.json) {
58155
58175
  console.log(JSON.stringify({ commit, backup }, null, 2));
58156
58176
  return 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/parity",
3
- "version": "0.33.19",
3
+ "version": "0.33.20",
4
4
  "description": "E2E parity validator for site migrations. Compares prod vs cand and reports UI, functional, SEO, visual, and Web Vitals deltas with an LLM-ranked HTML report.",
5
5
  "type": "module",
6
6
  "license": "MIT",