@mediamonks/canopy-cli 0.7.51 → 0.7.53
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/{ai-BjnuSjmw.mjs → ai-BlqO9NhM.mjs} +2 -2
- package/dist/{api-DmJrIsE7.mjs → api-D4KUT6Ly.mjs} +9 -8
- package/dist/{audience-BSvOEbco.mjs → audience-Dlrsdthb.mjs} +3 -3
- package/dist/{browse-BPLWhoFI.mjs → browse-CW3CnhK_.mjs} +2 -2
- package/dist/{calls-COIxX32d.mjs → calls-DFtWVJfv.mjs} +3 -3
- package/dist/{db-D5SXZrp5.mjs → db-Dy1csI71.mjs} +15 -18
- package/dist/{deploy-D8OZyhH8.mjs → deploy-DHjZj2Pq.mjs} +13 -19
- package/dist/dev-CVC7elOr.mjs +2 -0
- package/dist/{dev-DjK3Y8jb.mjs → dev-L5slb6ke.mjs} +10 -9
- package/dist/{dev-worker-CDxgu7c1.mjs → dev-worker-DBBN0F6X.mjs} +15 -33
- package/dist/docs/access-tokens.md +145 -0
- package/dist/docs/ci.md +8 -0
- package/dist/docs/cli-dev.md +1 -1
- package/dist/docs/cli-schedule.md +1 -1
- package/dist/docs/cli-token.md +1 -1
- package/dist/docs/developers-architecture.md +16 -5
- package/dist/docs/index.json +10 -0
- package/dist/docs/outside-sign-in.md +1 -1
- package/dist/docs/overview-faq.md +4 -3
- package/dist/docs/platform-client-access.md +1 -1
- package/dist/docs/platform-credentials.md +76 -0
- package/dist/docs/platform-egress.md +4 -4
- package/dist/docs/platform-members-and-access.md +31 -6
- package/dist/docs/platform-project-data.md +4 -0
- package/dist/docs/platform-schedules.md +4 -4
- package/dist/docs/porting-nextjs.md +23 -23
- package/dist/docs/sdk-auth.md +61 -14
- package/dist/docs/sdk-files.md +117 -4
- package/dist/docs/sdk.md +17 -10
- package/dist/docs/staging.md +1 -1
- package/dist/docs/static-serving.md +6 -3
- package/dist/docs/troubleshooting.md +21 -1
- package/dist/{docs-CLgKBi8H.mjs → docs-bnQLqEOn.mjs} +4 -4
- package/dist/{egress-BoGWBHRa.mjs → egress-hKpsJF84.mjs} +4 -10
- package/dist/{feedback-B6tqJ3cd.mjs → feedback-vHJwLyWF.mjs} +4 -4
- package/dist/{files-B7toJRlj.mjs → files-DKtyMjY0.mjs} +3 -3
- package/dist/index.mjs +39 -52
- package/dist/{local-BmUmiOUN.mjs → local-B15wYk6z.mjs} +19 -8
- package/dist/{login-DrMr99-A.mjs → login-cbwynFoT.mjs} +3 -3
- package/dist/{logs-DJWrL6ja.mjs → logs-ByDPHO28.mjs} +3 -3
- package/dist/{mcp-CWtqUFE3.mjs → mcp-BmT4Es_B.mjs} +3 -3
- package/dist/{migrations-BReMlGWP.mjs → migrations-k5pyUUR0.mjs} +3 -3
- package/dist/{open-6ev_6m0p.mjs → open-CYfkeTaw.mjs} +2 -2
- package/dist/{package-4SGn0Cy3.mjs → package-DtU4jB_Z.mjs} +1 -1
- package/dist/{project-template-Bas1UN2O.mjs → project-template-B297eCQ0.mjs} +3 -3
- package/dist/project-template-B6YpesjZ.mjs +2 -0
- package/dist/{projects-BEBYhy6k.mjs → projects-ztlDQi0P.mjs} +28 -28
- package/dist/{rename-PIJmdzHk.mjs → rename-BZ8hvUUt.mjs} +3 -3
- package/dist/{repo-Dry87b9d.mjs → repo-BUIM4d_1.mjs} +4 -10
- package/dist/repo-fDD4TcJ4.mjs +2 -0
- package/dist/{roles-CXY226VM.mjs → roles-DvywfJ8x.mjs} +1 -1
- package/dist/{roles-CUFRTp_R.mjs → roles-Yn8U3cr-.mjs} +3 -3
- package/dist/{schedule-DJsclUxC.mjs → schedule-Cv26MIfS.mjs} +3 -3
- package/dist/{secrets-CV2IwVwU.mjs → secrets-C6tF7BI9.mjs} +3 -3
- package/dist/{site-BL5Ik-yj.mjs → site-C0nf9RXY.mjs} +8 -3
- package/dist/skill/canopy/SKILL.md +9 -1
- package/dist/{skill-CY_4eqOD.mjs → skill-CRTV3ZQ1.mjs} +2 -2
- package/dist/{src-DbqT3K2l.mjs → src-UBUAqzqH.mjs} +419 -41
- package/dist/{staging-B9sjqvfh.mjs → staging-C9mn0EBS.mjs} +6 -14
- package/dist/templates/spa/AGENTS.md +3 -3
- package/dist/templates/spa/README.md +2 -2
- package/dist/templates/spa/package.json +1 -1
- package/dist/templates/static/AGENTS.md +3 -3
- package/dist/templates/static/README.md +2 -2
- package/dist/templates/worker/AGENTS.md +3 -3
- package/dist/templates/worker/README.md +2 -2
- package/dist/templates/worker/package.json +1 -1
- package/dist/{token-BT2_ELX6.mjs → token-DIJtUPrE.mjs} +3 -3
- package/dist/{ui-Ddw4d2Nn.mjs → ui-BPq6-hKS.mjs} +16 -3
- package/dist/{upgrade-Dxzb3e3r.mjs → upgrade-LTEfQn4L.mjs} +2 -2
- package/dist/{usage-VMT75MZ4.mjs → usage-DBhL6SUo.mjs} +3 -3
- package/package.json +3 -3
- package/dist/dev-DkaQjBTp.mjs +0 -2
- package/dist/project-template-Dti_Mmnb.mjs +0 -2
- package/dist/repo-CGTFmIWM.mjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { a as apiRequest, m as withContext } from "./api-
|
|
3
|
-
import { a as
|
|
1
|
+
import { d as projectUrl, f as resolveProject, m as stagingUrl, s as parseVersionArg, u as projectFlagArgs } from "./site-C0nf9RXY.mjs";
|
|
2
|
+
import { a as apiRequest, m as withContext } from "./api-D4KUT6Ly.mjs";
|
|
3
|
+
import { a as requireTty, i as reportErrors, n as formatDateTime, o as spinner$1, s as unwrap, t as confirmTypedSlug } from "./ui-BPq6-hKS.mjs";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
import * as p from "@clack/prompts";
|
|
6
6
|
//#region src/staging.ts
|
|
@@ -52,10 +52,8 @@ const stagingCommand = defineCommand({
|
|
|
52
52
|
run: reportErrors("staging use", async ({ args }) => {
|
|
53
53
|
const { slug } = resolveProject(args);
|
|
54
54
|
let target;
|
|
55
|
-
if (args.version !== void 0)
|
|
56
|
-
|
|
57
|
-
target = Number(args.version.replace(/^v/, ""));
|
|
58
|
-
} else {
|
|
55
|
+
if (args.version !== void 0) target = parseVersionArg(args.version);
|
|
56
|
+
else {
|
|
59
57
|
requireTty("pass a version, e.g. `canopy staging use v3`.");
|
|
60
58
|
const { deploys, live, staging: staged } = await apiRequest("GET", `/projects/${slug}/deploys`);
|
|
61
59
|
if (deploys.length === 0) throw new Error("This project has no deploys yet.");
|
|
@@ -129,13 +127,7 @@ const stagingCommand = defineCommand({
|
|
|
129
127
|
},
|
|
130
128
|
run: reportErrors("staging destroy", async ({ args }) => {
|
|
131
129
|
const { slug } = resolveProject(args);
|
|
132
|
-
if (!args.yes)
|
|
133
|
-
requireTty("pass --yes to destroy without confirmation.");
|
|
134
|
-
if (unwrap(await p.text({ message: `This deletes "${slug}"'s staging database, files and backend (live is untouched). Type the slug to confirm.` })).trim() !== slug) {
|
|
135
|
-
p.cancel("Aborted.");
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
130
|
+
if (!args.yes && !await confirmTypedSlug(slug, `This deletes "${slug}"'s staging database, files and backend (live is untouched). Type the slug to confirm.`, "pass --yes to destroy without confirmation.")) return;
|
|
139
131
|
const spin = spinner$1();
|
|
140
132
|
spin.start(`Destroying staging for ${slug}…`);
|
|
141
133
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}} — a Canopy React SPA
|
|
2
2
|
|
|
3
|
-
A Vite + React single-page app on [Canopy](
|
|
3
|
+
A Vite + React single-page app on [Canopy]({{dashboardUrl}}),
|
|
4
4
|
Monks' managed platform for internal projects. Everything is served behind
|
|
5
5
|
company login; there is no infrastructure to manage and none should be added.
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ npx skills add mediamonks/canopy
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
If that fails the skill isn't published yet — the SDK surface is documented on
|
|
18
|
-
the [Canopy dashboard](
|
|
18
|
+
the [Canopy dashboard]({{dashboardUrl}}).
|
|
19
19
|
|
|
20
20
|
## Working on this project
|
|
21
21
|
|
|
@@ -29,7 +29,7 @@ the [Canopy dashboard](https://dashboard.thanarie.dev).
|
|
|
29
29
|
- `canopy dev --local [--pull]` — offline sandbox with local data instead;
|
|
30
30
|
writes never reach the platform. Prefer it for destructive experiments.
|
|
31
31
|
- `canopy deploy` — builds (`npm run build`) and publishes `dist/`; live
|
|
32
|
-
(behind company login) at
|
|
32
|
+
(behind company login) at {{url}}.
|
|
33
33
|
- Risky change (schema migration, backend rework)? `canopy deploy --staging`
|
|
34
34
|
first — a private copy with its own database cloned from live — verify, then
|
|
35
35
|
`canopy promote` ships the exact tested version. Never promote with failing
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
A [Canopy](
|
|
4
|
-
(behind company login) at
|
|
3
|
+
A [Canopy]({{dashboardUrl}}) project — Vite + React. Live
|
|
4
|
+
(behind company login) at {{url}} after the first
|
|
5
5
|
`canopy deploy`.
|
|
6
6
|
|
|
7
7
|
- `npm install` — once, then:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}} — a Canopy static app
|
|
2
2
|
|
|
3
|
-
A no-build web app on [Canopy](
|
|
3
|
+
A no-build web app on [Canopy]({{dashboardUrl}}), Monks' managed
|
|
4
4
|
platform for internal projects. Everything is served behind company login;
|
|
5
5
|
there is no infrastructure to manage and none should be added.
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ npx skills add mediamonks/canopy
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
If that fails the skill isn't published yet — the SDK surface is documented on
|
|
18
|
-
the [Canopy dashboard](
|
|
18
|
+
the [Canopy dashboard]({{dashboardUrl}}).
|
|
19
19
|
|
|
20
20
|
## Working on this project
|
|
21
21
|
|
|
@@ -28,7 +28,7 @@ the [Canopy dashboard](https://dashboard.thanarie.dev).
|
|
|
28
28
|
- `canopy dev --local [--pull]` — offline sandbox with local data instead;
|
|
29
29
|
writes never reach the platform. Prefer it for destructive experiments.
|
|
30
30
|
- `canopy deploy` — publish; live (behind company login) at
|
|
31
|
-
|
|
31
|
+
{{url}}.
|
|
32
32
|
- Risky change (schema migration, backend rework)? `canopy deploy --staging`
|
|
33
33
|
first — a private copy with its own database cloned from live — verify, then
|
|
34
34
|
`canopy promote` ships the exact tested version. Never promote with failing
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
A [Canopy](
|
|
4
|
-
login) at
|
|
3
|
+
A [Canopy]({{dashboardUrl}}) project. Live (behind company
|
|
4
|
+
login) at {{url}} after the first `canopy deploy`.
|
|
5
5
|
|
|
6
6
|
- `canopy dev` — develop locally against the live platform (real data!)
|
|
7
7
|
- `canopy dev --local [--pull]` — offline sandbox with local data instead
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# {{name}} — a Canopy React SPA with a backend Worker
|
|
2
2
|
|
|
3
3
|
A Vite + React single-page app plus a per-project backend Worker on
|
|
4
|
-
[Canopy](
|
|
4
|
+
[Canopy]({{dashboardUrl}}), Monks' managed platform for internal
|
|
5
5
|
projects. Everything is served behind company login; there is no
|
|
6
6
|
infrastructure to manage and none should be added.
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ npx skills add mediamonks/canopy
|
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
If that fails the skill isn't published yet — the SDK surface is documented on
|
|
19
|
-
the [Canopy dashboard](
|
|
19
|
+
the [Canopy dashboard]({{dashboardUrl}}).
|
|
20
20
|
|
|
21
21
|
## Working on this project
|
|
22
22
|
|
|
@@ -42,7 +42,7 @@ the [Canopy dashboard](https://dashboard.thanarie.dev).
|
|
|
42
42
|
- `canopy dev --local [--pull]` — offline sandbox with local data instead;
|
|
43
43
|
writes never reach the platform. Prefer it for destructive experiments.
|
|
44
44
|
- `canopy deploy` — builds (`npm run build`) and publishes; live (behind
|
|
45
|
-
company login) at
|
|
45
|
+
company login) at {{url}}.
|
|
46
46
|
- Defining your own tables (raw `sql()` / Drizzle)? Use the migrations flow —
|
|
47
47
|
`canopy docs migrations`. Never invent a `DATABASE_URL` (none exists):
|
|
48
48
|
generate migrations locally, and `canopy deploy` applies them.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
A [Canopy](
|
|
3
|
+
A [Canopy]({{dashboardUrl}}) project — Vite + React with a
|
|
4
4
|
backend Worker (`worker/`). Live (behind company login) at
|
|
5
|
-
|
|
5
|
+
{{url}} after the first `canopy deploy`.
|
|
6
6
|
|
|
7
7
|
- `npm install` — once, then:
|
|
8
8
|
- `canopy dev` — develop locally against the live platform (real data!);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as apiRequest } from "./api-
|
|
3
|
-
import {
|
|
1
|
+
import { f as resolveProject, l as projectDirArgs, u as projectFlagArgs } from "./site-C0nf9RXY.mjs";
|
|
2
|
+
import { a as apiRequest } from "./api-D4KUT6Ly.mjs";
|
|
3
|
+
import { i as reportErrors, n as formatDateTime } from "./ui-BPq6-hKS.mjs";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
const tokenCommand = defineCommand({
|
|
6
6
|
meta: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as ApiError } from "./api-
|
|
1
|
+
import { t as ApiError } from "./api-D4KUT6Ly.mjs";
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
|
-
import { cancel, isCancel, spinner } from "@clack/prompts";
|
|
3
|
+
import { cancel, isCancel, spinner, text } from "@clack/prompts";
|
|
4
4
|
//#region src/ui.ts
|
|
5
5
|
/**
|
|
6
6
|
* Shared terminal UX plumbing: clack prompt unwrapping and uniform
|
|
@@ -119,6 +119,19 @@ function requireTty(hint) {
|
|
|
119
119
|
if (!process.stdin.isTTY) throw new Error(`This needs an interactive terminal — ${hint}`);
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
|
+
* The type-the-slug guard in front of a destructive command: needs a TTY
|
|
123
|
+
* (`ttyHint` says which flag skips it), shows `message`, and is true only when
|
|
124
|
+
* the answer is the slug. Anything else prints `abortedText` and is false.
|
|
125
|
+
*/
|
|
126
|
+
async function confirmTypedSlug(slug, message, ttyHint, abortedText = "Aborted.") {
|
|
127
|
+
requireTty(ttyHint);
|
|
128
|
+
if (unwrap(await text({ message })).trim() !== slug) {
|
|
129
|
+
cancel(abortedText);
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
122
135
|
* API timestamps are UTC — ISO with a Z suffix, though a lagging API site may
|
|
123
136
|
* still send the bare "YYYY-MM-DD HH:MM:SS" form. Parse either as UTC and
|
|
124
137
|
* render compact local wall-clock time ("2026-08-25 14:23").
|
|
@@ -139,4 +152,4 @@ function openBrowser(url) {
|
|
|
139
152
|
}).on("error", () => {}).unref();
|
|
140
153
|
}
|
|
141
154
|
//#endregion
|
|
142
|
-
export {
|
|
155
|
+
export { requireTty as a, reportErrors as i, formatDateTime as n, spinner$1 as o, openBrowser as r, unwrap as s, confirmTypedSlug as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as PACKAGE_NAME } from "./version-check-CcsA1QjI.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { i as reportErrors } from "./ui-BPq6-hKS.mjs";
|
|
3
3
|
import { defineCommand } from "citty";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -112,7 +112,7 @@ const upgradeCommand = defineCommand({
|
|
|
112
112
|
const spec = `${PACKAGE_NAME}@${args.version ?? "latest"}`;
|
|
113
113
|
const command = pmCommand(pm);
|
|
114
114
|
const cmd = installArgs(pm, spec);
|
|
115
|
-
const { skillInstalled } = await import("./skill-
|
|
115
|
+
const { skillInstalled } = await import("./skill-CRTV3ZQ1.mjs");
|
|
116
116
|
const { homedir } = await import("node:os");
|
|
117
117
|
const refreshGlobal = skillInstalled(homedir());
|
|
118
118
|
const refreshRepo = process.cwd() !== homedir() && skillInstalled(process.cwd());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as apiRequest, m as withContext } from "./api-
|
|
3
|
-
import {
|
|
1
|
+
import { f as resolveProject, u as projectFlagArgs } from "./site-C0nf9RXY.mjs";
|
|
2
|
+
import { a as apiRequest, m as withContext } from "./api-D4KUT6Ly.mjs";
|
|
3
|
+
import { i as reportErrors } from "./ui-BPq6-hKS.mjs";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
//#region src/usage.ts
|
|
6
6
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediamonks/canopy-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.53",
|
|
4
4
|
"description": "Canopy CLI — create, develop and deploy Canopy projects.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"canopy": "./dist/index.mjs"
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"esbuild": "^0.28.1",
|
|
23
23
|
"hono": "^4.8.0",
|
|
24
24
|
"vite-server": "npm:vite@^7",
|
|
25
|
-
"@mediamonks/canopy": "0.0.
|
|
26
|
-
"@mediamonks/canopy
|
|
25
|
+
"@mediamonks/canopy-data-plane": "0.0.4",
|
|
26
|
+
"@mediamonks/canopy": "0.0.20"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^26.1.1",
|
package/dist/dev-DkaQjBTp.mjs
DELETED
package/dist/repo-CGTFmIWM.mjs
DELETED