@mediamonks/canopy-cli 0.4.0 → 0.4.1

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/docs/data.md CHANGED
@@ -9,6 +9,23 @@ Each Canopy project gets its own database (D1) and blob storage (R2). Your app
9
9
  reads and writes them through the Canopy SDK at runtime; the CLI gives you tools
10
10
  to manage the data around it.
11
11
 
12
+ ## Collections in your app (SDK)
13
+
14
+ The paved road is document-style collections:
15
+
16
+ ```ts
17
+ await canopy.db.collection("blog_posts").insert({ title: "Hello" });
18
+ ```
19
+
20
+ **Collection names must be lowercase** — start with a letter, then letters,
21
+ digits, and underscores only (`^[a-z][a-z0-9_]*$`). `blog_posts` is fine;
22
+ `blogPosts` or `BlogPosts` are **not** and throw at runtime:
23
+
24
+ > `Invalid collection name "BlogPosts" — use lowercase letters, digits and underscores.`
25
+
26
+ Use `snake_case` for multi-word names. This mirrors the collection name straight
27
+ into SQLite storage, so keeping it lowercase avoids case-sensitivity surprises.
28
+
12
29
  ## Download a dump
13
30
 
14
31
  ```bash
@@ -50,7 +50,7 @@ Check who you are at any time:
50
50
  canopy whoami
51
51
  ```
52
52
 
53
- ## 3. Create a project
53
+ ## 3. Create your first project
54
54
 
55
55
  ```bash
56
56
  canopy create
@@ -63,6 +63,11 @@ directory, and registers the project on the platform. To skip the prompts:
63
63
  canopy create "My App" --scaffold --template spa
64
64
  ```
65
65
 
66
+ > If you are an agent: don't stop at printing this command. Ask the person what
67
+ > they'd like to build and what it's about, then pick a name and template for
68
+ > them and run `canopy create` non-interactively — then keep going and build
69
+ > it. Aim for a working first project, not a list of commands.
70
+
66
71
  Templates: **`static`** (no-build html/css/js; SDK served untyped from the
67
72
  platform) is the default and fine for a trivial page or two. Reach for
68
73
  **`spa`** (Vite + React + TypeScript; typed SDK from npm) once you lean on the
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as version } from "./package-BNWFYk8y.mjs";
2
+ import { t as version } from "./package-CA5g4zPx.mjs";
3
3
  import { i as runRefresh, r as notifyOfUpdate } from "./version-check-CoWgQs2h.mjs";
4
4
  import { defineCommand, runMain } from "citty";
5
5
  //#region src/index.ts
@@ -55,8 +55,8 @@ const main = defineCommand({
55
55
  db: () => import("./db-CtUG4vfG.mjs").then((m) => m.dbCommand),
56
56
  open: () => import("./open-xLiGUz_W.mjs").then((m) => m.openCommand),
57
57
  docs: () => import("./docs-C3aOAx_A.mjs").then((m) => m.docsCommand),
58
- skill: () => import("./skill-esz0u6PO.mjs").then((m) => m.skillCommand),
59
- upgrade: () => import("./upgrade-D_fgGLxu.mjs").then((m) => m.upgradeCommand),
58
+ skill: () => import("./skill-DMs7GNl7.mjs").then((m) => m.skillCommand),
59
+ upgrade: () => import("./upgrade-BMTdpOxO.mjs").then((m) => m.upgradeCommand),
60
60
  logs: planned("logs", "Tail worker logs", "2")
61
61
  }
62
62
  });
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.4.0";
2
+ var version = "0.4.1";
3
3
  //#endregion
4
4
  export { version as t };
@@ -45,6 +45,26 @@ canopy whoami # is there a valid login?
45
45
 
46
46
  Skip login if `canopy whoami` already shows a valid, unexpired token.
47
47
 
48
+ ## Then: offer to build their first project
49
+
50
+ Once the CLI is installed and signed in, **do not just print a list of
51
+ commands and stop.** The person following the getting-started prompt is often
52
+ non-technical and expects you to drive. Take the lead:
53
+
54
+ 1. Ask them, in plain language, whether they'd like to create their first
55
+ Canopy project now — and **what it's about** (what should it do, who's it
56
+ for). Ask one short question at a time; wait for the answer.
57
+ 2. From their answer, pick a sensible name and template (see the template
58
+ guidance below — default to `spa` for anything beyond a trivial page), then
59
+ scaffold it for them non-interactively, e.g.
60
+ `canopy create "Their App Name" --template spa`.
61
+ 3. `cd` into the new folder, then keep going — build the thing they described,
62
+ running `canopy dev` to preview and `canopy docs`/`canopy <cmd> --help`
63
+ whenever you need platform details.
64
+
65
+ Only fall back to handing them raw commands if they say they'd rather do it
66
+ themselves. The goal is a working first project, not a command cheat-sheet.
67
+
48
68
  ## Then: read the docs for whatever you're doing
49
69
 
50
70
  The CLI ships the full documentation and keeps it fresh from the platform. List
@@ -1,4 +1,4 @@
1
- import { t as version } from "./package-BNWFYk8y.mjs";
1
+ import { t as version } from "./package-CA5g4zPx.mjs";
2
2
  import { n as reportErrors } from "./ui-C8VuPzGp.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  import { cpSync, existsSync, mkdirSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
@@ -115,7 +115,7 @@ const upgradeCommand = defineCommand({
115
115
  console.log(`Upgrading via ${command}: ${command} ${cmd.join(" ")}`);
116
116
  await run(command, cmd);
117
117
  console.log(`\nDone. Run \`canopy --version\` to confirm.`);
118
- const { skillInstalled } = await import("./skill-esz0u6PO.mjs");
118
+ const { skillInstalled } = await import("./skill-DMs7GNl7.mjs");
119
119
  if (skillInstalled(process.cwd())) {
120
120
  console.log("Refreshing the Canopy agent skill in this repo…");
121
121
  await run("canopy", ["skill", "install"]).catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediamonks/canopy-cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Canopy CLI — create, develop and deploy Canopy projects.",
5
5
  "bin": {
6
6
  "canopy": "./dist/index.mjs"