@camox/cli 0.54.0 → 0.57.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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  ## Runtime lookup and monorepos
4
4
 
5
5
  Runtime-backed commands (`status`, `pages`, `blocks`, `layouts`, `locales`, `files`,
6
- `publish`, `discard`, `preview`, and `logout`) accept `--cwd PATH`:
6
+ `publish`, `delete`, `preview`, and `logout`) accept `--cwd PATH`:
7
7
 
8
8
  ```sh
9
9
  camox pages list --cwd apps/site
@@ -30,15 +30,15 @@ your site locally once (e.g. `pnpm dev`) before using the CLI; until then,
30
30
  commands fail with `NO_DEVELOPMENT_DRAFT`.
31
31
 
32
32
  Agents in parallel worktrees share their developer's development draft, and
33
- publish or discard it together.
33
+ publish or delete it together.
34
34
 
35
- ## Publishing and discarding
35
+ ## Publishing and deleting
36
36
 
37
37
  ```sh
38
38
  camox status # whether your development draft exists, and how many changes it holds
39
39
  camox publish # what publishing would do, with a token
40
40
  camox publish --confirm TOKEN # publish to Live
41
- camox discard # empty your development draft (asks first; --yes skips the question)
41
+ camox delete # empty your development draft (asks first; --yes skips the question)
42
42
  ```
43
43
 
44
44
  `camox publish` lists, in order:
@@ -57,7 +57,7 @@ publishes the whole draft, which then stays open, emptied. If Live changed since
57
57
  the list was printed, nothing is published: the command prints the new list and
58
58
  token, fails with `CONFLICTS_CHANGED`, and you review it before confirming again.
59
59
 
60
- `camox discard` empties your development draft without touching Live. It asks
60
+ `camox delete` empties your development draft without touching Live. It asks
61
61
  for confirmation in a terminal; elsewhere it fails with `CONFIRMATION_REQUIRED`
62
62
  unless you pass `--yes`.
63
63
 
@@ -17,7 +17,7 @@ const DEVELOPMENT_DRAFT = "development";
17
17
  const NO_DEVELOPMENT_DRAFT_ERROR = "NO_DEVELOPMENT_DRAFT";
18
18
  /**
19
19
  * The oRPC error code a request naming an ended draft fails with. Its `data` is an `EndedDraft`,
20
- * so a page can render Live and say who published or discarded the draft.
20
+ * so a page can render Live and say who published or deleted the draft.
21
21
  */
22
22
  const DRAFT_ENDED_ERROR_CODE = "DRAFT_ENDED";
23
23
  /**
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export { a as verifySession } from "./api-CBYfBQrH.mjs";
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as NOT_PUBLISHED_CODES, i as getProject, l as NO_DEVELOPMENT_DRAFT_ERROR, n as developmentDraftHeaders, o as DEVELOPMENT_DRAFT, r as getDevelopmentDraft, s as DRAFT_ENDED_ERROR_CODE, t as callTool } from "./api-BlAAQ7d9.mjs";
2
+ import { c as NOT_PUBLISHED_CODES, i as getProject, l as NO_DEVELOPMENT_DRAFT_ERROR, n as developmentDraftHeaders, o as DEVELOPMENT_DRAFT, r as getDevelopmentDraft, s as DRAFT_ENDED_ERROR_CODE, t as callTool } from "./api-CBYfBQrH.mjs";
3
3
  import { t as installLocalhostDns } from "./local-dns-DQIT1ucr.mjs";
4
4
  import { a as removeAuthTokenForUrl, i as readAuthTokenForUrl, n as isLoopbackUrl, o as verifyOneTimeToken, r as normalizeUrl, s as writeAuthTokenForUrl, t as createPreviewSignInUrl } from "./auth-core-xLeorUUV.mjs";
5
5
  import { object, or } from "@optique/core/constructs";
@@ -118,7 +118,7 @@ async function authenticateUser() {
118
118
  async function getOrAuthenticate() {
119
119
  const stored = readAuthToken();
120
120
  if (stored) {
121
- const { verifySession } = await import("./api-DPrc6jjc.mjs");
121
+ const { verifySession } = await import("./api-Ph2yMPXw.mjs");
122
122
  if (await verifySession(stored.token)) {
123
123
  p.log.info(`Authenticated as ${stored.name}`);
124
124
  return stored;
@@ -660,15 +660,15 @@ async function handler$12(args) {
660
660
  }
661
661
  }
662
662
  //#endregion
663
- //#region src/commands/discard.ts
664
- const parser$11 = command("discard", object({
665
- command: constant("discard"),
666
- yes: option("--yes", "-y", { description: message`Discard without asking for confirmation.` }),
663
+ //#region src/commands/delete.ts
664
+ const parser$11 = command("delete", object({
665
+ command: constant("delete"),
666
+ yes: option("--yes", "-y", { description: message`Delete without asking for confirmation.` }),
667
667
  cwd: cwdFlag,
668
668
  project: projectFlag,
669
669
  json: option("--json")
670
- }), { description: message`Discard every change in your development draft. Live is untouched.` });
671
- const WARNING = "This discards every change in your development draft and can't be undone.";
670
+ }), { description: message`Delete every change in your development draft. Live is untouched.` });
671
+ const WARNING = "This deletes every change in your development draft and can't be undone.";
672
672
  async function confirmed() {
673
673
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
674
674
  printError({
@@ -678,7 +678,7 @@ async function confirmed() {
678
678
  process.exit(2);
679
679
  }
680
680
  return await p.confirm({
681
- message: `${WARNING} Discard it?`,
681
+ message: `${WARNING} Delete it?`,
682
682
  initialValue: false
683
683
  }) === true;
684
684
  }
@@ -687,18 +687,18 @@ async function handler$11(args) {
687
687
  if (!args.yes && !await confirmed()) {
688
688
  printError({
689
689
  code: "CANCELLED",
690
- message: "Nothing was discarded."
690
+ message: "Nothing was deleted."
691
691
  });
692
692
  process.exit(1);
693
693
  }
694
694
  const result = await callToolResult({
695
- toolName: "discardDraft",
695
+ toolName: "deleteDraft",
696
696
  args: {},
697
697
  cwd: args.cwd,
698
698
  projectFlag: args.project
699
699
  });
700
700
  if (isJsonMode(outputMode)) printResult(result, outputMode);
701
- else process.stdout.write("Discarded every change in your development draft.\n");
701
+ else process.stdout.write("Deleted every change in your development draft.\n");
702
702
  process.exit(0);
703
703
  }
704
704
  const TIMEOUT_MS = 12e4;
@@ -1458,7 +1458,7 @@ async function handler$2(args) {
1458
1458
  else process.stdout.write("Your development draft has no changes: nothing to publish.\n");
1459
1459
  process.exit(0);
1460
1460
  }
1461
- if (result.reason === "discarded") {
1461
+ if (result.reason === "deleted") {
1462
1462
  printError({
1463
1463
  code: DRAFT_ENDED_ERROR_CODE,
1464
1464
  message: `${result.message} Nothing was published.`
@@ -1666,7 +1666,7 @@ switch (result.command) {
1666
1666
  case "publish":
1667
1667
  await handler$2(result);
1668
1668
  break;
1669
- case "discard": await handler$11(result);
1669
+ case "delete": await handler$11(result);
1670
1670
  }
1671
1671
  //#endregion
1672
1672
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camox/cli",
3
- "version": "0.54.0",
3
+ "version": "0.57.0",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "camox": "./dist/index.mjs"
@@ -28,7 +28,7 @@
28
28
  "devDependencies": {
29
29
  "@types/node": "^24.12.4",
30
30
  "vite-plus": "1.3.0",
31
- "@camox/api-contract": "0.54.0"
31
+ "@camox/api-contract": "0.57.0"
32
32
  },
33
33
  "nx": {
34
34
  "tags": [
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export { a as verifySession } from "./api-BlAAQ7d9.mjs";