@wix/himalaya-cli 0.863.0 → 0.864.0

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.mjs +101 -15
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -62248,8 +62248,97 @@ function writeAgentContext(targetDir) {
62248
62248
  // src/cli.ts
62249
62249
  init_wix_placeholders();
62250
62250
  var defaultIO = { log: (l) => console.log(l), error: (l) => console.error(l), isTTY: process.stdout.isTTY === true };
62251
- var BOOLEAN_FLAGS = /* @__PURE__ */ new Set(["browser", "no-open", "yes", "json", "deep", "quiet", "force", "replace", "watch", "no-claim", "new", "dev", "draft", "live", "accept-regressions", "accept-partial", "no-rebind"]);
62251
+ var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
62252
+ "browser",
62253
+ "no-open",
62254
+ "yes",
62255
+ "json",
62256
+ "deep",
62257
+ "quiet",
62258
+ "force",
62259
+ "replace",
62260
+ "watch",
62261
+ "no-claim",
62262
+ "new",
62263
+ "dev",
62264
+ "draft",
62265
+ "live",
62266
+ "accept-regressions",
62267
+ "accept-partial",
62268
+ "no-rebind",
62269
+ "help",
62270
+ "static",
62271
+ "strict",
62272
+ "apply",
62273
+ "apply-permissions",
62274
+ "allow-destructive",
62275
+ "allow-draft",
62276
+ "all",
62277
+ "all-screens",
62278
+ "ai",
62279
+ "binary",
62280
+ "crashes",
62281
+ "crashes-only",
62282
+ "crashesOnly",
62283
+ "dpx",
62284
+ "dry-run",
62285
+ "dump-state",
62286
+ "follow",
62287
+ "invoke",
62288
+ "licenses",
62289
+ "measure-widgets",
62290
+ "no-events",
62291
+ "no-hostile",
62292
+ "no-logs",
62293
+ "no-oauth-app",
62294
+ "no-shots",
62295
+ "no-source",
62296
+ "no-wait",
62297
+ "offline",
62298
+ "publish",
62299
+ "record",
62300
+ "remote",
62301
+ "rtl",
62302
+ "skip-version-check",
62303
+ "snapshot",
62304
+ "summary",
62305
+ "templates",
62306
+ "tree",
62307
+ "visitor",
62308
+ "wait",
62309
+ "wix",
62310
+ "silent",
62311
+ "include-disabled",
62312
+ "skip-build"
62313
+ ]);
62252
62314
  var SHELL_ENUM = SHELL_NAMES2.join("|");
62315
+ var SWITCH_FLAGS = new Set([...BOOLEAN_FLAGS].filter((name) => name !== "deep"));
62316
+ var SWITCH_CONSEQUENCE = {
62317
+ yes: "silently ignored, it would turn a real mutation into a dry run",
62318
+ new: "silently ignored, it would reuse a client instead of minting a new one",
62319
+ force: "silently ignored, it would stop at the first refusal it was meant to override",
62320
+ record: "silently ignored, it would leave you believing the fixture was refreshed",
62321
+ "no-oauth-app": "silently ignored, it would mint an OAuth client you asked to skip",
62322
+ "dry-run": "silently ignored, it would perform the real writes you asked to rehearse",
62323
+ "allow-destructive": "silently ignored, it would refuse the destructive step you opted into",
62324
+ static: "silently ignored, it would render HYDRATED when you asked for static",
62325
+ // `--wait=false` is the one spelling where "pass it bare" is the WRONG advice: bare `--wait`
62326
+ // means wait. The flag that turns waiting off is a different one, so name it.
62327
+ wait: "if you meant to stop waiting, that is `--no-wait` \u2014 a bare `--wait` means the opposite"
62328
+ };
62329
+ function switchFlagErrors(argv) {
62330
+ const out = [];
62331
+ for (const a of argv) {
62332
+ if (!a.startsWith("--")) continue;
62333
+ const eq = a.indexOf("=");
62334
+ if (eq < 0) continue;
62335
+ const name = a.slice(2, eq);
62336
+ if (!SWITCH_FLAGS.has(name)) continue;
62337
+ const because = SWITCH_CONSEQUENCE[name];
62338
+ out.push(`--${name} takes no value (got "${a}") \u2014 pass it bare${because ? `; ${because}` : ", it is an on/off flag"}`);
62339
+ }
62340
+ return out;
62341
+ }
62253
62342
  function parseFlags(argv) {
62254
62343
  const _ = [];
62255
62344
  const flags = {};
@@ -63789,9 +63878,9 @@ async function producedWidgetFamilies(dir) {
63789
63878
  }
63790
63879
  async function run(argv, io = defaultIO) {
63791
63880
  const { _: pos, flags } = parseFlags(argv);
63881
+ const flagErrors = switchFlagErrors(argv);
63792
63882
  const command = pos[0];
63793
63883
  const print = (o) => io.log(JSON.stringify(o, null, 2));
63794
- const flagInArgv = (name) => argv.some((a) => a === `--${name}` || a.startsWith(`--${name}=`));
63795
63884
  if (flags.version === true || command === "version" || pos.includes("-v")) {
63796
63885
  const v = cliVersion();
63797
63886
  io.log(flags.json ? JSON.stringify({ himi: v }, null, 2) : `himi v${v}`);
@@ -63805,6 +63894,10 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
63805
63894
  io.log(flags.json ? JSON.stringify(helpJson(), null, 2) : USAGE + footer);
63806
63895
  return command === "help" || flags.help ? 0 : 2;
63807
63896
  }
63897
+ if (flagErrors.length > 0 && flags.help !== true) {
63898
+ io.error(JSON.stringify({ ok: false, error: "invalid_flag_value", problems: flagErrors, hint: "run `himi help` for the flag grammar." }));
63899
+ return 2;
63900
+ }
63808
63901
  const contextualDefaultTarget = defaultTargetForCommand(command, contentDir(flags));
63809
63902
  const targetName = () => resolveTargetName({ target: str5(flags.target), defaultTarget: contextualDefaultTarget });
63810
63903
  const client2 = () => new ServeCliClient(
@@ -65520,7 +65613,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
65520
65613
  return 2;
65521
65614
  }
65522
65615
  }
65523
- if (flagInArgv("from-release") && !str5(flags["from-release"])) {
65616
+ if (flags["from-release"] !== void 0 && !str5(flags["from-release"])) {
65524
65617
  io.error(JSON.stringify({ ok: false, error: "from_release_needs_a_value", message: "--from-release takes a release id to branch from. Omit the flag entirely to patch the live release.", usage: ONLY_USAGE }));
65525
65618
  return 2;
65526
65619
  }
@@ -66767,7 +66860,7 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
66767
66860
  }));
66768
66861
  return 2;
66769
66862
  }
66770
- if (flagInArgv("from-release") && !str5(flags["from-release"])) {
66863
+ if (flags["from-release"] !== void 0 && !str5(flags["from-release"])) {
66771
66864
  io.error(JSON.stringify({ ok: false, error: "from_release_needs_a_value", message: "--from-release takes a release id to branch from. Omit the flag entirely to patch the live release.", usage: PATCH_USAGE }));
66772
66865
  return 2;
66773
66866
  }
@@ -66864,15 +66957,15 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
66864
66957
  const bytes2 = readFileSync64(file);
66865
66958
  const sha = createHash24("sha256").update(bytes2).digest("hex");
66866
66959
  const forScreens = (str5(flags["for-screen"]) ?? "").split(",").map((s) => s.trim()).filter(Boolean);
66867
- if (flagInArgv("no-rebind") && flags["no-rebind"] !== true) {
66960
+ if (flags["no-rebind"] !== void 0 && flags["no-rebind"] !== true) {
66868
66961
  io.error(JSON.stringify({ ok: false, error: "no_rebind_takes_no_value", message: "--no-rebind is a switch and takes no value; pass it bare.", usage: PATCH_USAGE }));
66869
66962
  return 2;
66870
66963
  }
66871
- if (flagInArgv("for-screen") && forScreens.length === 0) {
66964
+ if (flags["for-screen"] !== void 0 && forScreens.length === 0) {
66872
66965
  io.error(JSON.stringify({ ok: false, error: "for_screen_needs_a_value", message: "--for-screen takes one or more screen ids to repoint at the new bytes, comma-separated.", usage: PATCH_USAGE }));
66873
66966
  return 2;
66874
66967
  }
66875
- if (flagInArgv("for-screen") && flagInArgv("no-rebind")) {
66968
+ if (flags["for-screen"] !== void 0 && flags["no-rebind"] !== void 0) {
66876
66969
  io.error(JSON.stringify({
66877
66970
  ok: false,
66878
66971
  error: "conflicting_rebind",
@@ -68042,14 +68135,6 @@ ${report.ok ? "OK \u2014 data + serve plane reachable." : typeof report.hint ===
68042
68135
  if (sub === "client") {
68043
68136
  const { runSiteClientEnsure: runSiteClientEnsure2, runSiteClientList: runSiteClientList2, SITE_CLIENT_USAGE: SITE_CLIENT_USAGE2 } = await Promise.resolve().then(() => (init_site_oauth_client(), site_oauth_client_exports));
68044
68137
  const op = pos[2];
68045
- for (const bare of ["yes", "new"]) {
68046
- if (flags[bare] !== void 0 && flags[bare] !== true) {
68047
- io.error(JSON.stringify({
68048
- error: `--${bare} takes no value (got "${String(flags[bare])}") \u2014 pass it bare; ` + (bare === "yes" ? "silently ignored, it would turn a real create into a dry run" : "silently ignored, it would reuse a client instead of minting a new one")
68049
- }));
68050
- return 2;
68051
- }
68052
- }
68053
68138
  if (op !== "ensure" && op !== "list") {
68054
68139
  io.error(JSON.stringify({
68055
68140
  error: op ? `unknown site client op "${op}" \u2014 did you mean \`ensure\`? (there is no bare \`create\`: the command reconciles an existing client rather than minting a second one every run \u2014 pass --new to force a fresh client)` : "site client needs an op: ensure | list",
@@ -68234,6 +68319,7 @@ export {
68234
68319
  servePlaneAnswers,
68235
68320
  serveUnreachableError,
68236
68321
  serveUnreachableHint,
68322
+ switchFlagErrors,
68237
68323
  templatePreviewAuthError,
68238
68324
  tokenCoversApp,
68239
68325
  wixPlayerTestflightTarget,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.863.0",
3
+ "version": "0.864.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -63,5 +63,5 @@
63
63
  "artifactId": "himalaya-cli"
64
64
  }
65
65
  },
66
- "falconPackageHash": "c5d242935309a310e8916c1fc607f5bfc7aebc217e81fa9fbaa08ca7"
66
+ "falconPackageHash": "613d8c3ecd710dff1527de5fb1e8139bf446eca2891d93eb6934d5a4"
67
67
  }