@camox/cli 0.54.0 → 0.56.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 +5 -5
- package/dist/{api-BlAAQ7d9.mjs → api-CBYfBQrH.mjs} +1 -1
- package/dist/api-Ph2yMPXw.mjs +2 -0
- package/dist/index.mjs +14 -14
- package/package.json +2 -2
- package/dist/api-DPrc6jjc.mjs +0 -2
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`, `
|
|
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
|
|
33
|
+
publish or delete it together.
|
|
34
34
|
|
|
35
|
-
## Publishing and
|
|
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
|
|
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
|
|
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
|
|
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
|
/**
|
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-
|
|
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-
|
|
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/
|
|
664
|
-
const parser$11 = command("
|
|
665
|
-
command: constant("
|
|
666
|
-
yes: option("--yes", "-y", { description: message`
|
|
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`
|
|
671
|
-
const WARNING = "This
|
|
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}
|
|
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
|
|
690
|
+
message: "Nothing was deleted."
|
|
691
691
|
});
|
|
692
692
|
process.exit(1);
|
|
693
693
|
}
|
|
694
694
|
const result = await callToolResult({
|
|
695
|
-
toolName: "
|
|
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("
|
|
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 === "
|
|
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 "
|
|
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.
|
|
3
|
+
"version": "0.56.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.
|
|
31
|
+
"@camox/api-contract": "0.56.0"
|
|
32
32
|
},
|
|
33
33
|
"nx": {
|
|
34
34
|
"tags": [
|
package/dist/api-DPrc6jjc.mjs
DELETED