@hcmai/cli 0.27.3 → 0.27.4

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.js CHANGED
@@ -10414,7 +10414,8 @@ import {
10414
10414
  } from "@hcmai/sdk";
10415
10415
  var COLUMN_SLOT_SQL_PURPOSE = {
10416
10416
  countSlot: "\u69FD\u91CC\u672C\u79DF\u6237\u7684\u975E\u7A7A\u884C\u6570\uFF08\u7ED1\u5B9A\u524D\u987B\u4E3A 0\uFF09",
10417
- flexToSlot: "\u628A flex \u91CC\u7684\u503C\u642C\u8FDB\u69FD",
10417
+ flexToSlotBatched: "\u51BB\u7ED3\u524D\u5206\u6279\u628A flex \u91CC\u7684\u503C\u56DE\u586B\u8FDB\u69FD\uFF08\u533F\u540D\u5757\u3001\u6BCF\u6279\u63D0\u4EA4\uFF0C\u4E0D\u8981\u5305\u5728\u4E8B\u52A1\u91CC\uFF09",
10418
+ flexToSlot: "\u628A flex \u91CC\u7684\u503C\u642C\u8FDB\u69FD\uFF08\u53EA\u6539\u4E0E flex \u4E0D\u4E00\u81F4\u7684\u884C\uFF0C\u53EF\u91CD\u590D\u6267\u884C\uFF09",
10418
10419
  verifyFlexToSlot: "\u6838\u5BF9 flex \u4E0E\u69FD\u662F\u5426\u4E00\u81F4\uFF0C\u7ED3\u679C\u987B\u4E3A 0",
10419
10420
  slotToFlex: "\u628A\u69FD\u91CC\u7684\u503C\u5199\u56DE flex",
10420
10421
  removeFlexKey: "\u5220\u6389 flex \u91CC\u7684\u540C\u540D\u952E",
@@ -12116,12 +12117,14 @@ async function preflightWorkspacePlan(http, workspaceKey, operations, localFiles
12116
12117
  }
12117
12118
  try {
12118
12119
  const verdict = await validateWorkspaceFiles(http, workspaceKey, files, deletedPaths);
12120
+ const warnings = verdict.warnings ? { warnings: verdict.warnings } : {};
12119
12121
  if (!verdict.ok) {
12120
12122
  return {
12121
12123
  status: "failed",
12122
12124
  sent,
12123
12125
  checked: verdict.checked,
12124
12126
  issues: verdict.issues,
12127
+ ...warnings,
12125
12128
  nextStep: preflightFailureNextStep(verdict.issues)
12126
12129
  };
12127
12130
  }
@@ -12131,11 +12134,12 @@ async function preflightWorkspacePlan(http, workspaceKey, operations, localFiles
12131
12134
  sent,
12132
12135
  checked: verdict.checked,
12133
12136
  issues: [],
12137
+ ...warnings,
12134
12138
  reason: `\u670D\u52A1\u7AEF\u53EA\u68C0\u67E5\u4E86 ${verdict.checked}/${sent} \u4E2A\u6587\u4EF6\uFF0C\u7ED3\u8BBA\u4E0D\u8986\u76D6\u6574\u4EFD\u8BA1\u5212`,
12135
12139
  nextStep: "\u628A\u8FD9\u6761\u8F93\u51FA\u8FDE\u540C\u670D\u52A1\u7AEF\u7248\u672C\uFF08hcm version\uFF09\u62A5\u7ED9\u4EA7\u54C1\u4FA7\uFF1B\u5728\u6B64\u4E4B\u524D\u4EE5\u771F\u5B9E push \u7684\u7ED3\u679C\u4E3A\u51C6\u3002"
12136
12140
  };
12137
12141
  }
12138
- return { status: "passed", sent, checked: verdict.checked, issues: [] };
12142
+ return { status: "passed", sent, checked: verdict.checked, issues: [], ...warnings };
12139
12143
  } catch (error) {
12140
12144
  const status = error?.response?.status;
12141
12145
  const translated = error?.isAxiosError ? fromAxiosError25(error, profile) : error;
@@ -12178,6 +12182,14 @@ function formatPreflightIssues(issues, indent2 = "") {
12178
12182
  return lines.join("\n");
12179
12183
  }).join("\n");
12180
12184
  }
12185
+ function formatPreflightWarnings(warnings, indent2 = "") {
12186
+ return warnings.map((warning) => {
12187
+ const lines = [`${indent2}\u26A0 ${warning.path ?? "(\u6574\u6279)"} [${warning.warnCode ?? "WARN"}] ${warning.message}`];
12188
+ if (warning.fields?.length) lines.push(`${indent2} \u21B3 \u5B57\u6BB5\uFF1A${warning.fields.join(", ")}`);
12189
+ if (warning.nextStep) lines.push(`${indent2} \u21B3 \u4E0B\u4E00\u6B65\uFF1A${warning.nextStep}`);
12190
+ return lines.join("\n");
12191
+ }).join("\n");
12192
+ }
12181
12193
  function conflictHolder(issue) {
12182
12194
  const data = issue.data;
12183
12195
  if (typeof data?.conflictingWorkspaceKey !== "string" || !data.conflictingWorkspaceKey) return void 0;
@@ -12212,6 +12224,10 @@ function formatPreflightSummary(preflight, indent2 = "") {
12212
12224
  const head = preflight.status === "passed" ? `server preflight: OK (${preflight.checked}/${preflight.sent} checked)` : preflight.status === "failed" ? `server preflight: FAIL (${preflight.issues.length} issues in ${preflight.checked}/${preflight.sent} checked)` : preflight.status === "unavailable" ? `server preflight: UNAVAILABLE \u2014 ${preflight.reason}\uFF08\u4E0D\u662F\u901A\u8FC7\uFF09` : `server preflight: nothing to check (${preflight.reason})`;
12213
12225
  const lines = [`${indent2}${head}`];
12214
12226
  if (preflight.issues.length) lines.push(formatPreflightIssues(preflight.issues, `${indent2} `));
12227
+ if (preflight.warnings?.length) {
12228
+ lines.push(`${indent2} warnings: ${preflight.warnings.length}\uFF08\u4E0D\u5F71\u54CD\u901A\u8FC7\u4E0E\u5426\uFF0C\u6309\u4E0B\u4E00\u6B65\u5904\u7406\uFF09`);
12229
+ lines.push(formatPreflightWarnings(preflight.warnings, `${indent2} `));
12230
+ }
12215
12231
  if (preflight.nextStep) lines.push(`${indent2} next: ${preflight.nextStep}`);
12216
12232
  return lines.join("\n");
12217
12233
  }