@camox/cli 0.22.0 → 0.23.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.
package/dist/index.mjs CHANGED
@@ -364,20 +364,20 @@ async function dispatch(opts) {
364
364
  }
365
365
  //#endregion
366
366
  //#region src/commands/blocks.ts
367
- const projectFlag$2 = optional(option("--project", string({ metavar: "SLUG" })));
368
- const jsonFlag$2 = option("--json");
367
+ const projectFlag$3 = optional(option("--project", string({ metavar: "SLUG" })));
368
+ const jsonFlag$3 = option("--json");
369
369
  const productionFlag$2 = option("--production");
370
- const parser$6 = command("blocks", or(command("types", object({
370
+ const parser$7 = command("blocks", or(command("types", object({
371
371
  command: constant("blocks.types"),
372
- project: projectFlag$2,
372
+ project: projectFlag$3,
373
373
  production: productionFlag$2,
374
- json: jsonFlag$2
374
+ json: jsonFlag$3
375
375
  })), command("describe", object({
376
376
  command: constant("blocks.describe"),
377
377
  type: multiple(option("--type", string({ metavar: "TYPE" })), { min: 1 }),
378
- project: projectFlag$2,
378
+ project: projectFlag$3,
379
379
  production: productionFlag$2,
380
- json: jsonFlag$2
380
+ json: jsonFlag$3
381
381
  })), command("create", object({
382
382
  command: constant("blocks.create"),
383
383
  pageId: option("--page-id", integer({ metavar: "ID" })),
@@ -389,17 +389,17 @@ const parser$6 = command("blocks", or(command("types", object({
389
389
  beforeId: optional(option("--before-id", integer({ metavar: "ID" }))),
390
390
  afterPosition: optional(option("--after-position", string({ metavar: "POS" }))),
391
391
  beforePosition: optional(option("--before-position", string({ metavar: "POS" }))),
392
- project: projectFlag$2,
392
+ project: projectFlag$3,
393
393
  production: productionFlag$2,
394
- json: jsonFlag$2
394
+ json: jsonFlag$3
395
395
  })), command("edit", object({
396
396
  command: constant("blocks.edit"),
397
397
  id: option("--id", integer({ metavar: "ID" })),
398
398
  content: optional(option("--content", string({ metavar: "JSON" }))),
399
399
  settings: optional(option("--settings", string({ metavar: "JSON" }))),
400
- project: projectFlag$2,
400
+ project: projectFlag$3,
401
401
  production: productionFlag$2,
402
- json: jsonFlag$2
402
+ json: jsonFlag$3
403
403
  })), command("move", object({
404
404
  command: constant("blocks.move"),
405
405
  id: option("--id", integer({ metavar: "ID" })),
@@ -408,15 +408,15 @@ const parser$6 = command("blocks", or(command("types", object({
408
408
  beforeId: optional(option("--before-id", integer({ metavar: "ID" }))),
409
409
  afterPosition: optional(option("--after-position", string({ metavar: "POS" }))),
410
410
  beforePosition: optional(option("--before-position", string({ metavar: "POS" }))),
411
- project: projectFlag$2,
411
+ project: projectFlag$3,
412
412
  production: productionFlag$2,
413
- json: jsonFlag$2
413
+ json: jsonFlag$3
414
414
  })), command("delete", object({
415
415
  command: constant("blocks.delete"),
416
416
  id: option("--id", integer({ metavar: "ID" })),
417
- project: projectFlag$2,
417
+ project: projectFlag$3,
418
418
  production: productionFlag$2,
419
- json: jsonFlag$2
419
+ json: jsonFlag$3
420
420
  }))));
421
421
  const POSITIONING_FLAGS = [
422
422
  ["position", "--position"],
@@ -444,7 +444,7 @@ function collectPositioningArgs(args) {
444
444
  toolArgs
445
445
  };
446
446
  }
447
- async function handler$6(args) {
447
+ async function handler$7(args) {
448
448
  const outputMode = args.json ? "json" : "auto";
449
449
  const projectFlag = args.project;
450
450
  const production = args.production;
@@ -545,6 +545,55 @@ async function handler$6(args) {
545
545
  }
546
546
  }
547
547
  //#endregion
548
+ //#region src/commands/env.ts
549
+ const projectFlag$2 = optional(option("--project", string({ metavar: "SLUG" })));
550
+ const jsonFlag$2 = option("--json");
551
+ const yesFlag = option("--yes", "-y");
552
+ const parser$6 = command("env", or(command("check", object({
553
+ command: constant("env.check"),
554
+ project: projectFlag$2,
555
+ json: jsonFlag$2
556
+ })), command("push", object({
557
+ command: constant("env.push"),
558
+ yes: yesFlag,
559
+ project: projectFlag$2,
560
+ json: jsonFlag$2
561
+ })), command("pull", object({
562
+ command: constant("env.pull"),
563
+ yes: yesFlag,
564
+ project: projectFlag$2,
565
+ json: jsonFlag$2
566
+ }))));
567
+ async function handler$6(args) {
568
+ const outputMode = args.json ? "json" : "auto";
569
+ const projectFlag = args.project;
570
+ switch (args.command) {
571
+ case "env.check": return dispatch({
572
+ toolName: "checkEnvironmentCompatibility",
573
+ args: {},
574
+ projectFlag,
575
+ outputMode
576
+ });
577
+ case "env.push":
578
+ case "env.pull": {
579
+ const isPush = args.command === "env.push";
580
+ if (!args.yes) {
581
+ printError({
582
+ code: "CONFIRMATION_REQUIRED",
583
+ message: `This will replace all content in ${isPush ? "production" : "your dev environment"} with ${isPush ? "your dev environment" : "production"}. This action cannot be undone. Re-run with --yes to confirm.`
584
+ });
585
+ process.exit(2);
586
+ }
587
+ return dispatch({
588
+ toolName: "replicateEnvironment",
589
+ args: { direction: isPush ? "push" : "pull" },
590
+ projectFlag,
591
+ outputMode
592
+ });
593
+ }
594
+ }
595
+ }
596
+ //#endregion
548
597
  //#region src/lib/utils.ts
549
598
  const pmCommands = {
550
599
  pnpm: {
@@ -1015,7 +1064,7 @@ async function handler(args) {
1015
1064
  //#endregion
1016
1065
  //#region src/index.ts
1017
1066
  const result = runSync(defineProgram({
1018
- parser: or(parser$5, parser$3, parser$2, parser, parser$1, parser$6, parser$4),
1067
+ parser: or(parser$5, parser$3, parser$2, parser, parser$1, parser$7, parser$4, parser$6),
1019
1068
  metadata: {
1020
1069
  name: "camox",
1021
1070
  brief: message`Camox CLI`
@@ -1048,11 +1097,16 @@ switch (result.command) {
1048
1097
  case "blocks.edit":
1049
1098
  case "blocks.move":
1050
1099
  case "blocks.delete":
1051
- await handler$6(result);
1100
+ await handler$7(result);
1052
1101
  break;
1053
1102
  case "layouts.list":
1054
1103
  await handler$4(result);
1055
1104
  break;
1105
+ case "env.check":
1106
+ case "env.push":
1107
+ case "env.pull":
1108
+ await handler$6(result);
1109
+ break;
1056
1110
  }
1057
1111
  //#endregion
1058
1112
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camox/cli",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "bin": {
5
5
  "camox": "./dist/index.mjs"
6
6
  },
@@ -26,7 +26,7 @@
26
26
  "@types/node": "^24.12.2",
27
27
  "@typescript/native-preview": "7.0.0-dev.20260412.1",
28
28
  "vite-plus": "latest",
29
- "@camox/api-contract": "0.22.0"
29
+ "@camox/api-contract": "0.23.0"
30
30
  },
31
31
  "nx": {
32
32
  "tags": [
@@ -13,7 +13,7 @@ const faq = createBlock({
13
13
  description:
14
14
  "Use this block to answer common questions about the product, pricing, or company. Place it near the bottom of a page to address objections before a conversion section.",
15
15
  content: {
16
- items: Type.RepeatableItem({
16
+ items: Type.Repeater({
17
17
  content: {
18
18
  question: Type.String({
19
19
  default: "What is your refund policy?",
@@ -8,7 +8,7 @@ const footer = createBlock({
8
8
  description: "A footer at the bottom of a page with a site name and navigation links.",
9
9
  content: {
10
10
  title: Type.String({ default: "{{projectName}}" }),
11
- links: Type.RepeatableItem({
11
+ links: Type.Repeater({
12
12
  content: {
13
13
  link: Type.Link({
14
14
  default: { text: "Footer link", href: "#", newTab: false },
@@ -19,7 +19,7 @@ const navbar = createBlock({
19
19
  newTab: false,
20
20
  },
21
21
  }),
22
- links: Type.RepeatableItem({
22
+ links: Type.Repeater({
23
23
  content: {
24
24
  link: Type.Link({
25
25
  default: { text: "Link", href: "#", newTab: false },
@@ -20,7 +20,7 @@ const statistics = createBlock({
20
20
  "Our platform empowers teams to build and ship faster. Here are some numbers we're proud of.",
21
21
  title: "Description",
22
22
  }),
23
- statistics: Type.RepeatableItem({
23
+ statistics: Type.Repeater({
24
24
  content: {
25
25
  number: Type.String({
26
26
  default: "100+",