@mediamonks/canopy-cli 0.7.55 → 0.7.57

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 (66) hide show
  1. package/dist/{ai-BlqO9NhM.mjs → ai-00f2Mgqh.mjs} +2 -2
  2. package/dist/{api-D4KUT6Ly.mjs → api-fmc8CEMT.mjs} +5 -1
  3. package/dist/{audience-Dlrsdthb.mjs → audience-ByM1jUH3.mjs} +3 -3
  4. package/dist/{browse-CW3CnhK_.mjs → browse-CxwKuka0.mjs} +2 -2
  5. package/dist/{calls-DFtWVJfv.mjs → calls-DsbRjCcy.mjs} +3 -3
  6. package/dist/{db-Dy1csI71.mjs → db-BU-ni9fj.mjs} +4 -4
  7. package/dist/{deploy-DHjZj2Pq.mjs → deploy-7tgGJZUK.mjs} +17 -6
  8. package/dist/dev-BtacZ4HE.mjs +2 -0
  9. package/dist/{dev-BvzqZU_F.mjs → dev-qp1VRNM_.mjs} +9 -9
  10. package/dist/{dev-worker-BdVcP-SM.mjs → dev-worker-7tqL9UFi.mjs} +1 -1
  11. package/dist/docs/cli-download.md +1 -1
  12. package/dist/docs/cli-members.md +7 -0
  13. package/dist/docs/cli-promote.md +2 -0
  14. package/dist/docs/cli-rollback.md +3 -1
  15. package/dist/docs/cli-staging.md +2 -0
  16. package/dist/docs/cli-versions.md +79 -0
  17. package/dist/docs/cli.md +2 -0
  18. package/dist/docs/index.json +6 -1
  19. package/dist/docs/outside-sign-in.md +16 -5
  20. package/dist/docs/platform-deploys-and-rollbacks.md +37 -5
  21. package/dist/docs/platform-members-and-access.md +8 -0
  22. package/dist/{docs-DdSbSiCj.mjs → docs-hcHwEc6n.mjs} +4 -4
  23. package/dist/{egress-hKpsJF84.mjs → egress-Bzn2VKDe.mjs} +3 -3
  24. package/dist/{feedback-Bzu_KQtb.mjs → feedback-COujxFBV.mjs} +4 -4
  25. package/dist/{files-DKtyMjY0.mjs → files-CBbAtHIK.mjs} +3 -3
  26. package/dist/index.mjs +39 -38
  27. package/dist/{local-B1N4TpE9.mjs → local-C1i2uhAf.mjs} +3 -3
  28. package/dist/login-Baso-JE0.mjs +355 -0
  29. package/dist/{logs-ByDPHO28.mjs → logs-c76jVOhb.mjs} +3 -3
  30. package/dist/{mcp-DmWfG-NS.mjs → mcp-aWskwkXw.mjs} +3 -3
  31. package/dist/{migrations-k5pyUUR0.mjs → migrations-ChafLorm.mjs} +2 -2
  32. package/dist/{open-CYfkeTaw.mjs → open-Doat726T.mjs} +2 -2
  33. package/dist/{package-B_o_DJ8u.mjs → package-BpOFa8Qi.mjs} +1 -1
  34. package/dist/project-template--mESzwea.mjs +2 -0
  35. package/dist/{project-template-B297eCQ0.mjs → project-template-BnX47DpF.mjs} +3 -3
  36. package/dist/{projects-BBm9nQb0.mjs → projects-DOqpkUVT.mjs} +29 -10
  37. package/dist/{rename-BZ8hvUUt.mjs → rename-RA_oYbRT.mjs} +3 -3
  38. package/dist/{repo-BUIM4d_1.mjs → repo-DD3eK1P_.mjs} +3 -3
  39. package/dist/repo-DayXVvyj.mjs +2 -0
  40. package/dist/{roles-Yn8U3cr-.mjs → roles-BS8-Gvv-.mjs} +63 -10
  41. package/dist/roles-tqf4sYDM.mjs +2 -0
  42. package/dist/{schedule-Cv26MIfS.mjs → schedule-D8AQ8MVF.mjs} +3 -3
  43. package/dist/{secrets-C6tF7BI9.mjs → secrets-Bi7BYCla.mjs} +3 -3
  44. package/dist/{site-C0nf9RXY.mjs → site-BcZ0LOvm.mjs} +2 -1
  45. package/dist/skill/canopy/SKILL.md +5 -0
  46. package/dist/{skill-DAlJwr4A.mjs → skill-984KseKb.mjs} +2 -2
  47. package/dist/{src-B0WdnVz9.mjs → src-DpjA-a59.mjs} +23 -22
  48. package/dist/{staging-C9mn0EBS.mjs → staging-BxG3Cffd.mjs} +3 -3
  49. package/dist/{token-DIJtUPrE.mjs → token-bHdy_IoX.mjs} +3 -3
  50. package/dist/{ui-BPq6-hKS.mjs → ui-9f_lF2Ak.mjs} +1 -1
  51. package/dist/{upgrade-DN0JQ7gm.mjs → upgrade-DhK_PlAN.mjs} +2 -2
  52. package/dist/{usage-DBhL6SUo.mjs → usage-DFs2TERV.mjs} +3 -3
  53. package/dist/versions-Cgw7sB3h.mjs +106 -0
  54. package/package.json +4 -4
  55. package/dist/dev-wHv8RrDn.mjs +0 -2
  56. package/dist/login-cbwynFoT.mjs +0 -355
  57. package/dist/project-template-B6YpesjZ.mjs +0 -2
  58. package/dist/repo-fDD4TcJ4.mjs +0 -2
  59. package/dist/roles-DvywfJ8x.mjs +0 -2
  60. package/dist/templates/worker/.github/workflows/canopy-deploy.yml +0 -40
  61. package/dist/templates/worker/index.html +0 -12
  62. package/dist/templates/worker/src/app.tsx +0 -25
  63. package/dist/templates/worker/src/canopy.ts +0 -5
  64. package/dist/templates/worker/src/main.tsx +0 -10
  65. package/dist/templates/worker/src/style.css +0 -29
  66. package/dist/templates/worker/vite.config.ts +0 -7
@@ -1,5 +1,5 @@
1
- import { a as apiRequest, m as withContext } from "./api-D4KUT6Ly.mjs";
2
- import { i as reportErrors } from "./ui-BPq6-hKS.mjs";
1
+ import { a as apiRequest, m as withContext } from "./api-fmc8CEMT.mjs";
2
+ import { i as reportErrors } from "./ui-9f_lF2Ak.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  //#region src/ai.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { h as tryReadCanopyJson, p as rewriteCanopyJsonSlug, r as siteConfig, t as projectDir } from "./site-C0nf9RXY.mjs";
1
+ import { h as tryReadCanopyJson, p as rewriteCanopyJsonSlug, r as siteConfig, t as projectDir } from "./site-BcZ0LOvm.mjs";
2
2
  //#region src/api.ts
3
3
  /**
4
4
  * Authenticated requests to the Canopy control plane. Credentials, in order:
@@ -226,6 +226,10 @@ const ERROR_COPY = {
226
226
  why: "branches are full git refs, and the staging branch must differ from the live one",
227
227
  fix: "Pass e.g. `--ref refs/heads/main --staging-ref refs/heads/develop`."
228
228
  },
229
+ version_expired: {
230
+ why: "version retention expired that version: its files are gone, so it can no longer be made live, staged, pinned or downloaded",
231
+ fix: "Pick a version that is still kept (`canopy versions` shows how many are), or rebuild it from source and deploy."
232
+ },
229
233
  slug_unchanged: {
230
234
  why: "the project already has that slug",
231
235
  fix: "Pass the new slug you want, e.g. `canopy rename my-new-name`."
@@ -1,6 +1,6 @@
1
- import { f as resolveProject, l as projectDirArgs, 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";
1
+ import { f as resolveProject, l as projectDirArgs, u as projectFlagArgs } from "./site-BcZ0LOvm.mjs";
2
+ import { a as apiRequest, m as withContext } from "./api-fmc8CEMT.mjs";
3
+ import { i as reportErrors } from "./ui-9f_lF2Ak.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  import * as p from "@clack/prompts";
6
6
  //#region src/audience.ts
@@ -1,5 +1,5 @@
1
- import { g as tryResolveProject, r as siteConfig } from "./site-C0nf9RXY.mjs";
2
- import { a as apiRequest, t as ApiError } from "./api-D4KUT6Ly.mjs";
1
+ import { g as tryResolveProject, r as siteConfig } from "./site-BcZ0LOvm.mjs";
2
+ import { a as apiRequest, t as ApiError } from "./api-fmc8CEMT.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  //#region src/browse.ts
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { f as resolveProject, l as projectDirArgs } from "./site-C0nf9RXY.mjs";
2
- import { a as apiRequest, m as withContext } from "./api-D4KUT6Ly.mjs";
3
- import { i as reportErrors, n as formatDateTime } from "./ui-BPq6-hKS.mjs";
1
+ import { f as resolveProject, l as projectDirArgs } from "./site-BcZ0LOvm.mjs";
2
+ import { a as apiRequest, m as withContext } from "./api-fmc8CEMT.mjs";
3
+ import { i as reportErrors, n as formatDateTime } from "./ui-9f_lF2Ak.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  //#region src/calls.ts
6
6
  /**
@@ -1,7 +1,7 @@
1
- import { f as resolveProject, u as projectFlagArgs } from "./site-C0nf9RXY.mjs";
2
- import { a as apiRequest, m as withContext, r as apiDataRequest } from "./api-D4KUT6Ly.mjs";
3
- import { a as requireTty, i as reportErrors, o as spinner$1, s as unwrap, t as confirmTypedSlug } from "./ui-BPq6-hKS.mjs";
4
- import { n as migrateProject, r as readMigrationFiles, t as describeMigrateResult } from "./migrations-k5pyUUR0.mjs";
1
+ import { f as resolveProject, u as projectFlagArgs } from "./site-BcZ0LOvm.mjs";
2
+ import { a as apiRequest, m as withContext, r as apiDataRequest } from "./api-fmc8CEMT.mjs";
3
+ import { a as requireTty, i as reportErrors, o as spinner$1, s as unwrap, t as confirmTypedSlug } from "./ui-9f_lF2Ak.mjs";
4
+ import { n as migrateProject, r as readMigrationFiles, t as describeMigrateResult } from "./migrations-ChafLorm.mjs";
5
5
  import { defineCommand } from "citty";
6
6
  import { readFileSync, writeFileSync } from "node:fs";
7
7
  import * as p from "@clack/prompts";
@@ -1,7 +1,7 @@
1
- import { d as projectUrl, f as resolveProject, h as tryReadCanopyJson, l as projectDirArgs, m as stagingUrl, r as siteConfig, s as parseVersionArg, u as projectFlagArgs } from "./site-C0nf9RXY.mjs";
2
- import { a as apiRequest, d as githubActionsCredentials, i as apiDownload, l as currentSlug, m as withContext, p as onGithubActions, r as apiDataRequest, t as ApiError } from "./api-D4KUT6Ly.mjs";
3
- import { i as reportErrors, n as formatDateTime, o as spinner$1, s as unwrap } from "./ui-BPq6-hKS.mjs";
4
- import { n as migrateProject, r as readMigrationFiles, t as describeMigrateResult } from "./migrations-k5pyUUR0.mjs";
1
+ import { d as projectUrl, f as resolveProject, h as tryReadCanopyJson, l as projectDirArgs, m as stagingUrl, r as siteConfig, s as parseVersionArg, u as projectFlagArgs } from "./site-BcZ0LOvm.mjs";
2
+ import { a as apiRequest, d as githubActionsCredentials, i as apiDownload, l as currentSlug, m as withContext, p as onGithubActions, r as apiDataRequest, t as ApiError } from "./api-fmc8CEMT.mjs";
3
+ import { i as reportErrors, n as formatDateTime, o as spinner$1, s as unwrap } from "./ui-9f_lF2Ak.mjs";
4
+ import { n as migrateProject, r as readMigrationFiles, t as describeMigrateResult } from "./migrations-ChafLorm.mjs";
5
5
  import { builtinModules } from "node:module";
6
6
  import { defineCommand } from "citty";
7
7
  import { mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
@@ -293,12 +293,14 @@ const deployCommand = defineCommand({
293
293
  let result;
294
294
  let migrateResult;
295
295
  let stagingCreated = false;
296
+ let retentionHint = null;
296
297
  try {
297
- const { upload } = await withContext(apiRequest("POST", `/projects/${slug}/deploys`, {
298
+ const { upload, retention } = await withContext(apiRequest("POST", `/projects/${slug}/deploys`, {
298
299
  worker: workerBytes !== null,
299
300
  channel
300
301
  }, { headers: source }), { action: `deploy "${slug}"` });
301
302
  stagingCreated = upload.stagingCreated === true;
303
+ retentionHint = retentionHintLine(retention);
302
304
  const overLimit = bundleLimitError(files, upload);
303
305
  if (overLimit) {
304
306
  spin.error("Deploy refused — nothing was uploaded.");
@@ -333,8 +335,17 @@ const deployCommand = defineCommand({
333
335
  console.log(` happy with it? \`canopy promote\` makes v${result.version} live`);
334
336
  } else spin.stop(`Live: ${projectUrl(currentSlug(slug))} (v${result.version})${backend}`);
335
337
  if (migrateResult !== void 0) for (const line of describeMigrateResult(migrateResult)) console.log(` ${line}`);
338
+ if (retentionHint) console.log(`\n${retentionHint}`);
336
339
  })
337
340
  });
341
+ /**
342
+ * The retention hint a deploy prints when the platform sends one: a project
343
+ * without version retention that has grown large (deploy-retention). One
344
+ * block, worded so an agent reading the output can pass it on.
345
+ */
346
+ function retentionHintLine(retention) {
347
+ return retention?.hint ? ` hint: ${retention.hint}` : null;
348
+ }
338
349
  const promoteCommand = defineCommand({
339
350
  meta: {
340
351
  name: "promote",
@@ -463,7 +474,7 @@ async function uploadFiles(grant, files) {
463
474
  async function pickVersion(deploys, live, message, initial) {
464
475
  return unwrap(await p.select({
465
476
  message,
466
- options: deploys.map((deploy) => ({
477
+ options: deploys.filter((deploy) => !deploy.expired).map((deploy) => ({
467
478
  value: deploy.version,
468
479
  label: `v${deploy.version} ${formatDateTime(deploy.created_at)} (${deploy.source})`,
469
480
  hint: deploy.version === live ? "live" : void 0
@@ -0,0 +1,2 @@
1
+ import { n as devCommand } from "./dev-qp1VRNM_.mjs";
2
+ export { devCommand };
@@ -1,9 +1,9 @@
1
- import { c as projectDialect, f as resolveProject, h as tryReadCanopyJson, l as projectDirArgs, r as siteConfig } from "./site-C0nf9RXY.mjs";
2
- import { a as apiRequest, m as withContext, t as ApiError } from "./api-D4KUT6Ly.mjs";
3
- import { i as reportErrors, n as formatDateTime } from "./ui-BPq6-hKS.mjs";
4
- import { r as readMigrationFiles } from "./migrations-k5pyUUR0.mjs";
5
- import { r as stampWorkerHeaders, t as WORKER_ATTEST_HEADER } from "./src-B0WdnVz9.mjs";
6
- import { a as parseAppRoleFlag } from "./roles-Yn8U3cr-.mjs";
1
+ import { c as projectDialect, f as resolveProject, h as tryReadCanopyJson, l as projectDirArgs, r as siteConfig } from "./site-BcZ0LOvm.mjs";
2
+ import { r as stampWorkerHeaders, t as WORKER_ATTEST_HEADER } from "./src-DpjA-a59.mjs";
3
+ import { a as apiRequest, m as withContext, t as ApiError } from "./api-fmc8CEMT.mjs";
4
+ import { i as reportErrors, n as formatDateTime } from "./ui-9f_lF2Ak.mjs";
5
+ import { r as readMigrationFiles } from "./migrations-ChafLorm.mjs";
6
+ import { s as parseAppRoleFlag } from "./roles-BS8-Gvv-.mjs";
7
7
  import { n as writeDevServerRecord } from "./dev-server-file-Dk9pk4AR.mjs";
8
8
  import { createRequire } from "node:module";
9
9
  import { defineCommand } from "citty";
@@ -107,7 +107,7 @@ async function workerPlugin(flags, slug, workerAttest, remoteUser, roles) {
107
107
  console.log(`note: canopy.json points "worker" at ${entry}, which does not exist — skipping.`);
108
108
  return;
109
109
  }
110
- const { missingSecretNames, readDevVars, workerDevPlugin } = await import("./dev-worker-BdVcP-SM.mjs");
110
+ const { missingSecretNames, readDevVars, workerDevPlugin } = await import("./dev-worker-7tqL9UFi.mjs");
111
111
  const secrets = readDevVars(flags.dir);
112
112
  const email = siteConfig().email;
113
113
  const found = await remoteUser?.() ?? (email ? {
@@ -326,7 +326,7 @@ async function devRemote(flags, slug) {
326
326
  async function devLocal(flags, slug) {
327
327
  let dump;
328
328
  if (flags.pull) {
329
- const { fetchProjectDump } = await import("./local-B1N4TpE9.mjs");
329
+ const { fetchProjectDump } = await import("./local-C1i2uhAf.mjs");
330
330
  console.log(`Pulling a fresh export of ${slug}${flags.staging ? " [staging]" : ""}…`);
331
331
  dump = await fetchProjectDump(slug, flags.staging ? "staging" : "live");
332
332
  }
@@ -343,7 +343,7 @@ async function devLocal(flags, slug) {
343
343
  }
344
344
  const workerAttest = randomBytes(24).toString("base64url");
345
345
  const devRoles = await resolveDevRoles(slug, flags.asRoles);
346
- const { createSandbox } = await import("./local-B1N4TpE9.mjs");
346
+ const { createSandbox } = await import("./local-C1i2uhAf.mjs");
347
347
  const sandbox = await createSandbox({
348
348
  slug,
349
349
  persistDir: join(flags.dir, ".canopy", "local"),
@@ -1,4 +1,4 @@
1
- import { a as readPersonCaller, i as CALLER_HEADER, n as redactCanopyCredentials, o as readUser, r as stampWorkerHeaders, t as WORKER_ATTEST_HEADER } from "./src-B0WdnVz9.mjs";
1
+ import { a as readPersonCaller, i as CALLER_HEADER, n as redactCanopyCredentials, o as readUser, r as stampWorkerHeaders, t as WORKER_ATTEST_HEADER } from "./src-DpjA-a59.mjs";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { relative, resolve, sep } from "node:path";
4
4
  //#region src/dev-worker.ts
@@ -23,7 +23,7 @@ canopy download --project my-app --out backup.zip
23
23
 
24
24
  ## How it works
25
25
 
26
- The CLI resolves the target version (argument, picker, or live), asks the platform for that deploy's assets as a zip, and writes the archive to `--out`. The zip contains the deployed bundle as uploaded — the static files, and for worker projects the bundled `_canopy/worker.mjs`. It does not include files [canopy deploy](https://docs.canopy.website/cli/deploy) skips (like `canopy.json` itself), nor your project's database or blobs — those are handled by the data tooling, not deploy versions. A project with no deploys yet has nothing to download.
26
+ The CLI resolves the target version (argument, picker, or live), asks the platform for that deploy's assets as a zip, and writes the archive to `--out`. The zip contains the deployed bundle as uploaded — the static files, and for worker projects the bundled `_canopy/worker.mjs`. It does not include files [canopy deploy](https://docs.canopy.website/cli/deploy) skips (like `canopy.json` itself), nor your project's database or blobs — those are handled by the data tooling, not deploy versions. A project with no deploys yet has nothing to download. A version that [version retention](https://docs.canopy.website/cli/versions) expired has no files left, and fails with `version_expired`.
27
27
 
28
28
  ## Examples
29
29
 
@@ -14,6 +14,8 @@ and viewers can do.
14
14
  canopy members list
15
15
  canopy members add jane@monks.com
16
16
  canopy members add sam@monks.com --viewer --app-role approver
17
+ canopy members add dana@client.example
18
+ canopy members add dana@client.example --send-invitation
17
19
  canopy members set sam@monks.com --app-role approver --app-role reviewer
18
20
  canopy members set sam@monks.com --editor
19
21
  canopy members set sam@monks.com --clear-app-roles
@@ -33,6 +35,11 @@ directory, or `--project <slug>`) and honor the global `--profile <site>`.
33
35
  manager with `--manager`. Someone who hasn't signed in to Canopy yet gets an
34
36
  invite and joins at their first sign-in. The owner and managers can add
35
37
  editors and viewers; only the owner adds managers.
38
+ - `add <email>` for someone outside Monks (where the site allows it) adds them
39
+ as a viewer and prints a message to send them: the project's link and how
40
+ to sign in with their email. Canopy doesn't email them unless you pass
41
+ `--send-invitation`. See
42
+ [Sharing a project with people outside Monks](https://docs.canopy.website/guides/outside-sign-in).
36
43
  - `set <email>` changes someone. `--manager`, `--editor` or `--viewer` changes
37
44
  their Canopy role: managers switch people between editor and viewer, and only
38
45
  the owner makes or changes a manager. `--app-role <slug>` sets their app
@@ -19,6 +19,8 @@ canopy promote --yes # skip the confirmation (CI)
19
19
 
20
20
  - `[version]` — the version to make live, as `8` or `v8`. Defaults to whatever
21
21
  is currently staged; errors when nothing is staged and no version is given.
22
+ A version that [version retention](https://docs.canopy.website/cli/versions) expired fails with
23
+ `version_expired`.
22
24
  - `--project <slug>` — project slug, overriding `canopy.json`.
23
25
  - `--dir <path>` — project directory (defaults to the current directory).
24
26
  - `--yes` — skip the confirmation prompt.
@@ -24,7 +24,9 @@ canopy rollback --project my-app 3
24
24
 
25
25
  Every deploy is stored immutably as a numbered version; "live" is just a pointer to one of them. Rolling back moves that pointer — no files are rebuilt, uploaded, or deleted. Projects with a custom backend also get their backend rolled to the bundle matching the target version, so frontend and backend stay in step. The command prints the target, asks the platform to repoint, and confirms with the live URL, the now-live version, and the version that was live before.
26
26
 
27
- Because versions are never destroyed, rolling back is symmetric: "roll forward" is simply `canopy rollback <newer-version>` — pass the number of the newer deploy you want live again. Picking the version that's already live is an error, and a project with fewer than two deploys has nothing to roll back to.
27
+ Rolling back is symmetric: "roll forward" is simply `canopy rollback <newer-version>` — pass the number of the newer deploy you want live again. Picking the version that's already live is an error, and a project with fewer than two deploys has nothing to roll back to.
28
+
29
+ With [version retention](https://docs.canopy.website/cli/versions) on, old versions expire: their files are removed, and they leave the picker. Rolling back to an expired version fails with `version_expired`. The version before live is always kept, so a one-step rollback always works.
28
30
 
29
31
  Deploy history is also visible in the dashboard, where the same rollback is a button.
30
32
 
@@ -32,6 +32,8 @@ rebuilt, and the version's backend (if any) is redeployed to the staging
32
32
  worker. Omit the version on a terminal to pick from the history. Requires the
33
33
  staging channel to exist; it applies no migrations, so an old version runs
34
34
  against staging's current schema (the same caveat version previews have).
35
+ A version that [version retention](https://docs.canopy.website/cli/versions) expired fails with
36
+ `version_expired`.
35
37
 
36
38
  ### `sync`
37
39
 
@@ -0,0 +1,79 @@
1
+ ---
2
+ title: canopy versions
3
+ description: See how many deploy versions a project keeps, and turn version retention on or off.
4
+ ---
5
+
6
+ `canopy versions` shows how many of a project's deploy versions still have
7
+ their files, and whether **version retention** cleans up the old ones.
8
+
9
+ ## Usage
10
+
11
+ ```bash
12
+ canopy versions [--project <slug>]
13
+ canopy versions retention [--project <slug>]
14
+ canopy versions retention on|off [--yes] [--project <slug>]
15
+ ```
16
+
17
+ The project comes from `canopy.json` in the current directory, or from
18
+ `--project <slug>`. The global `--profile <site>` / `CANOPY_PROFILE` picks the
19
+ site.
20
+
21
+ ### canopy versions
22
+
23
+ Prints whether retention is on, how many versions are kept and how much they
24
+ store, and how many have expired. With retention off it also says how many
25
+ versions turning it on would expire.
26
+
27
+ ### canopy versions retention
28
+
29
+ Without an argument, prints the same summary. `on` turns retention on, `off`
30
+ turns it off.
31
+
32
+ With retention on, Canopy keeps:
33
+
34
+ - the 20 most recent versions
35
+ - the live version and the one before it
36
+ - every version newer than live (the ones a rollback stepped back from)
37
+ - the staging version and the one before it
38
+
39
+ Once a day, Canopy removes the files of every other version. A project that
40
+ never passes 20 versions keeps all of them. Expired versions stay in the
41
+ deploy history, but they can no longer be made live, staged, promoted,
42
+ previewed or downloaded.
43
+
44
+ Turning it on first shows how many versions it would expire, and asks before
45
+ going ahead. Pass `--yes` to skip the question, for example in a script. Without
46
+ a terminal and without `--yes`, the command stops instead of guessing.
47
+ Turning it off never asks: from then on every version keeps its files.
48
+
49
+ Only you can change it, signed in as yourself (`canopy login` or the
50
+ dashboard). Deploy tokens and other project tokens can't.
51
+
52
+ New projects start with retention on. Projects created before it existed start
53
+ with it off.
54
+
55
+ ## The hint on deploy
56
+
57
+ When a project without retention passes 100 versions or 500 MB of deploy
58
+ files, every `canopy deploy` ends with a hint saying how many versions it keeps
59
+ and that `canopy versions retention on` would clean them up. The deploy itself
60
+ is unaffected.
61
+
62
+ ## Examples
63
+
64
+ ```bash
65
+ canopy versions
66
+ ```
67
+
68
+ Prints for example `notes: version retention is off — every version keeps its
69
+ files.` and `432 versions kept (1.3 GB)`.
70
+
71
+ ```bash
72
+ canopy versions retention on --project client-site --profile main
73
+ ```
74
+
75
+ Shows how many old versions of `client-site` would expire and asks before
76
+ turning retention on.
77
+
78
+ See also [canopy rollback](https://docs.canopy.website/cli/rollback), [canopy download](https://docs.canopy.website/cli/download), and
79
+ [Deploys & rollbacks](https://docs.canopy.website/platform/deploys-and-rollbacks).
package/dist/docs/cli.md CHANGED
@@ -49,6 +49,8 @@ has a full page per command.
49
49
  - `canopy download [version]` — download a deploy's assets as a zip, e.g. `v3`
50
50
  (the live version when omitted, or picked from history interactively).
51
51
  `--out <file>` to name it.
52
+ - `canopy versions` — how many deploy versions are kept.
53
+ `canopy versions retention on|off` turns version retention on or off.
52
54
  - `canopy open` — open the deployed project in your browser.
53
55
 
54
56
  ## Data
@@ -142,7 +142,7 @@
142
142
  {
143
143
  "slug": "platform-deploys-and-rollbacks",
144
144
  "title": "Deploys & rollbacks",
145
- "summary": "Every deploy is a numbered version you can preview, download, and make live again — rolling back is instant and loses nothing."
145
+ "summary": "Every deploy is a numbered version you can preview, download, and make live again. Rolling back is instant, and version retention clears out the old ones."
146
146
  },
147
147
  {
148
148
  "slug": "platform-project-data",
@@ -301,6 +301,11 @@
301
301
  "title": "canopy download",
302
302
  "summary": "Download the deployed files of any version of a project as a zip archive."
303
303
  },
304
+ {
305
+ "slug": "cli-versions",
306
+ "title": "canopy versions",
307
+ "summary": "See how many deploy versions a project keeps, and turn version retention on or off."
308
+ },
304
309
  {
305
310
  "slug": "cli-token",
306
311
  "title": "canopy token",
@@ -4,8 +4,9 @@ description: Invite a client contact by email and they get their own sign-in to
4
4
  ---
5
5
 
6
6
  Anyone who manages a project's members can add someone from outside Monks by
7
- their email address. They get an invitation email, sign in with that address,
8
- and from then on open your app as themselves. Each person has their own
7
+ their email address. You send them the link, or have Canopy email them an
8
+ invitation. They sign in with that address and from then on open your app as
9
+ themselves. Each person has their own
9
10
  sign-in, so you can see who is who, give one person an app role, and remove
10
11
  one person without touching anyone else.
11
12
 
@@ -22,11 +23,21 @@ them [app roles](https://docs.canopy.website/guides/roles) like anyone else.
22
23
  The owner, managers and platform admins can invite outsiders. Each invitation
23
24
  is recorded under the person who sent it.
24
25
 
25
- They get an email naming the project and who added them, with a link to it.
26
- If the email didn't go out, the Members card says so and lets you send it
27
- again. The card marks outside members and invitations so you can tell them
26
+ Before anything is saved, a dialog shows a message to send them. It has the
27
+ project's link and the steps to sign in with their email. Copy it and send it
28
+ however suits you: in a chat, an email of your own, or along with links to
29
+ your other projects. If you'd rather Canopy emailed them, tick **Also send an
30
+ invitation email**. That email names the project and who added them, with a
31
+ link to it. If it didn't go out, the Members card says so.
32
+
33
+ Their row in the Members card has two buttons. One copies the same message
34
+ again, and the other emails them the invitation, even long after you added
35
+ them. The card marks outside members and invitations so you can tell them
28
36
  apart from colleagues.
29
37
 
38
+ From a terminal, [`canopy members add`](https://docs.canopy.website/cli/members) prints the same message.
39
+ Add `--send-invitation` to have Canopy email them too.
40
+
30
41
  ## What they see
31
42
 
32
43
  When they open the project's link, the sign-in page offers **Not at Monks?
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Deploys & rollbacks
3
- description: Every deploy is a numbered version you can preview, download, and make live again — rolling back is instant and loses nothing.
3
+ description: Every deploy is a numbered version you can preview, download, and make live again. Rolling back is instant, and version retention clears out the old ones.
4
4
  ---
5
5
 
6
6
  Every time you publish a project, Canopy records it as a numbered version —
@@ -51,7 +51,38 @@ canopy rollback v3 # make v3 live directly
51
51
  ```
52
52
 
53
53
  You can also "roll forward": after reverting to v3, making v5 live again is
54
- the same one-step operation. Any version in the history can be live.
54
+ the same one-step operation. Any version in the history can be live, as long
55
+ as it hasn't expired (see below).
56
+
57
+ ## Version retention
58
+
59
+ Old versions take up storage, and after a while nobody rolls back to them.
60
+ With **version retention** on, Canopy keeps:
61
+
62
+ - the 20 most recent versions
63
+ - the live version and the one before it
64
+ - every version newer than live (the ones a rollback stepped back from)
65
+ - the staging version and the one before it
66
+
67
+ Once a day, Canopy removes the files of every other version. A project that
68
+ never passes 20 versions keeps all of them, and a one-step rollback always
69
+ works.
70
+
71
+ An expired version stays in the deploy history, marked **expired**, but it
72
+ can no longer be made live, staged, promoted, previewed or downloaded. If you
73
+ ever need it back, rebuild it from your source and deploy.
74
+
75
+ New projects have retention on. Projects from before it existed have it off
76
+ until someone turns it on:
77
+
78
+ - **Dashboard** — the **Version retention** card on the project's Deploys tab.
79
+ Turning it on shows how many versions would expire and asks first.
80
+ - **CLI** — `canopy versions retention on` (see
81
+ [canopy versions](https://docs.canopy.website/cli/versions)).
82
+
83
+ Only project editors signed in as themselves can change it. When a project
84
+ without retention passes 100 versions or 500 MB of deploy files, every deploy
85
+ ends with a hint to turn it on.
55
86
 
56
87
  ## The staging channel
57
88
 
@@ -76,12 +107,13 @@ Preview URLs sit behind the same sign-in as the live site — they're for
76
107
  comparing builds and reviewing history, not for sharing something different
77
108
  from what access settings allow. A preview shows an old frontend against the
78
109
  live data; for a full candidate environment (frontend + backend + own
79
- database) use the staging channel above.
110
+ database) use the staging channel above. The preview URL of an expired version
111
+ shows a page saying it has expired, never another version.
80
112
 
81
113
  ## Downloading a version
82
114
 
83
- You can download the exact files behind any past version as a zip — handy for
84
- comparing builds or restoring something by hand:
115
+ You can download the exact files behind any past version that hasn't expired
116
+ as a zip — handy for comparing builds or restoring something by hand:
85
117
 
86
118
  - **Dashboard** — from the version's entry in the deploy history.
87
119
  - **CLI** — `canopy download`, which lets you pick a version.
@@ -56,6 +56,14 @@ automatically the first time they sign in, whether that's opening the
56
56
  project's URL or running `canopy login`. Until then the invite grants nothing.
57
57
  Canopy doesn't send them a message, so let them know yourself.
58
58
 
59
+ Where the site allows it, you can also add people outside Monks by email.
60
+ They're always viewers. Before anything is saved, a dialog shows a message to
61
+ send them: the project's link and how to sign in with their email. Copy it
62
+ and send it however you like, or tick the box to have Canopy email them an
63
+ invitation as well. Their row in the card has buttons to copy that message
64
+ again or email the invitation later. Read
65
+ [Sharing a project with people outside Monks](https://docs.canopy.website/guides/outside-sign-in).
66
+
59
67
  The owner and managers can switch people between editor and viewer, remove
60
68
  them, or withdraw an invite from the same card. Only the owner can make
61
69
  someone a manager or change a manager. From a terminal,
@@ -1,8 +1,8 @@
1
- import { t as version } from "./package-B_o_DJ8u.mjs";
2
- import { r as siteConfig } from "./site-C0nf9RXY.mjs";
1
+ import { t as version } from "./package-BpOFa8Qi.mjs";
2
+ import { r as siteConfig } from "./site-BcZ0LOvm.mjs";
3
3
  import { i as latestKnownVersion, r as compareSemver } from "./version-check-CcsA1QjI.mjs";
4
- import { n as agentHeaders } from "./api-D4KUT6Ly.mjs";
5
- import { i as reportErrors } from "./ui-BPq6-hKS.mjs";
4
+ import { n as agentHeaders } from "./api-fmc8CEMT.mjs";
5
+ import { i as reportErrors } from "./ui-9f_lF2Ak.mjs";
6
6
  import { defineCommand } from "citty";
7
7
  import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
8
8
  import { homedir } from "node:os";
@@ -1,6 +1,6 @@
1
- import { f as resolveProject, l as projectDirArgs } from "./site-C0nf9RXY.mjs";
2
- import { a as apiRequest, m as withContext } from "./api-D4KUT6Ly.mjs";
3
- import { i as reportErrors, n as formatDateTime, s as unwrap, t as confirmTypedSlug } from "./ui-BPq6-hKS.mjs";
1
+ import { f as resolveProject, l as projectDirArgs } from "./site-BcZ0LOvm.mjs";
2
+ import { a as apiRequest, m as withContext } from "./api-fmc8CEMT.mjs";
3
+ import { i as reportErrors, n as formatDateTime, s as unwrap, t as confirmTypedSlug } from "./ui-9f_lF2Ak.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  import * as p from "@clack/prompts";
6
6
  //#region src/egress.ts
@@ -1,7 +1,7 @@
1
- import { t as version } from "./package-B_o_DJ8u.mjs";
2
- import { f as resolveProject, g as tryResolveProject, h as tryReadCanopyJson, l as projectDirArgs, r as siteConfig } from "./site-C0nf9RXY.mjs";
3
- import { a as apiRequest, c as credentials, i as apiDownload, o as apiUpload, s as commonHeaders } from "./api-D4KUT6Ly.mjs";
4
- import { i as reportErrors, n as formatDateTime } from "./ui-BPq6-hKS.mjs";
1
+ import { t as version } from "./package-BpOFa8Qi.mjs";
2
+ import { f as resolveProject, g as tryResolveProject, h as tryReadCanopyJson, l as projectDirArgs, r as siteConfig } from "./site-BcZ0LOvm.mjs";
3
+ import { a as apiRequest, c as credentials, i as apiDownload, o as apiUpload, s as commonHeaders } from "./api-fmc8CEMT.mjs";
4
+ import { i as reportErrors, n as formatDateTime } from "./ui-9f_lF2Ak.mjs";
5
5
  import { defineCommand } from "citty";
6
6
  import { basename, extname, join } from "node:path";
7
7
  import { readFile, writeFile } from "node:fs/promises";
@@ -1,6 +1,6 @@
1
- import { f as resolveProject, u as projectFlagArgs } from "./site-C0nf9RXY.mjs";
2
- import { a as apiRequest } from "./api-D4KUT6Ly.mjs";
3
- import { i as reportErrors } from "./ui-BPq6-hKS.mjs";
1
+ import { f as resolveProject, u as projectFlagArgs } from "./site-BcZ0LOvm.mjs";
2
+ import { a as apiRequest } from "./api-fmc8CEMT.mjs";
3
+ import { i as reportErrors } from "./ui-9f_lF2Ak.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  //#region src/files.ts
6
6
  /**