@pplethai/cli 0.2.0 → 0.2.2

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.
@@ -94,6 +94,14 @@ function report(deps, app, build) {
94
94
  ? "Show the message above to your AI coding agent — it says what to fix."
95
95
  : `See what happened at https://console.ppleth.ai/apps/${app.slug}.`);
96
96
  }
97
+ // Migrations are the part of a deploy a Builder can't see for themselves —
98
+ // no Cloudflare account (ADR-0001/0002) — so say when some landed. Silence
99
+ // means the database is unchanged (#75).
100
+ const applied = build.migrations.applied ?? [];
101
+ if (applied.length > 0) {
102
+ const what = applied.length === 1 ? "1 migration" : `${applied.length} migrations`;
103
+ deps.out.say(`Applied ${what} to your database.`);
104
+ }
97
105
  if (build.status === "unverified") {
98
106
  deps.out.say(`${app.name} was updated, but it hasn't answered yet.`);
99
107
  deps.out.say(`Give it a minute, then open ${app.url}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplethai/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,7 +44,9 @@ which attach the PPLE ID bearer token. Same origin, so paths are relative
44
44
  - **Mobile-first.** The app runs in a phone-sized WebView. Use the design
45
45
  system's components and the layout classes in `web/app.css`.
46
46
  - **Add a DB table** by writing a new `migrations/000N_*.sql` (never edit an
47
- applied migration) and running `npm run db:migrate:local`.
47
+ applied migration) and running `npm run db:migrate:local`. The platform
48
+ applies `migrations/` to the live database on every deploy, so shipping the
49
+ file is all a deploy needs — there is no remote migrate command to run.
48
50
 
49
51
  ## Before you finish
50
52
 
@@ -51,7 +51,8 @@ PPLE Today, it signs the real user in via the mini-app SDK.
51
51
  ## Making it yours
52
52
 
53
53
  - **Add a table:** create `migrations/0002_*.sql`, run `npm run db:migrate:local`,
54
- add queries in `src/db.ts`.
54
+ add queries in `src/db.ts`. Deploying applies it to the live database for you
55
+ — never edit a migration that has already shipped, add another one.
55
56
  - **Add an API route:** add it under `/api` in `src/index.ts`.
56
57
  - **Change the UI:** edit `web/App.tsx` using `@pplethai/components`.
57
58
  - **Send notifications:** the platform provisions `NOTIFY_API_KEY`; the helper
@@ -1,6 +1,7 @@
1
1
  -- The example table behind the D1 read/write demo. Replace it with your own
2
- -- schema: add a new file (0002_add_something.sql, …) and apply it with
3
- -- `npm run db:migrate:local` (local) or `npm run db:migrate:remote` (deployed).
2
+ -- schema: add a new file (0002_add_something.sql, …) and apply it locally with
3
+ -- `npm run db:migrate:local`. Deployed databases migrate themselves — the
4
+ -- platform applies everything in this directory on each deploy.
4
5
  CREATE TABLE notes (
5
6
  id INTEGER PRIMARY KEY AUTOINCREMENT,
6
7
  body TEXT NOT NULL,
@@ -11,7 +11,6 @@
11
11
  "test": "vitest run",
12
12
  "test:watch": "vitest",
13
13
  "db:migrate:local": "wrangler d1 migrations apply DB --local",
14
- "db:migrate:remote": "wrangler d1 migrations apply DB --remote",
15
14
  "deploy": "vite build && wrangler deploy"
16
15
  },
17
16
  "dependencies": {
@@ -9,6 +9,15 @@
9
9
  "main": "src/index.ts",
10
10
  "compatibility_date": "2026-06-01",
11
11
 
12
+ // Workers Logs: `console.log` and uncaught exceptions are retained, so a
13
+ // 500 in production can be read back instead of guessed at.
14
+ //
15
+ // This setting governs local development only. Your deployed app does not
16
+ // ship this file — the platform uploads the Worker through the Cloudflare
17
+ // API and sets observability itself (workers/src/provisioner/tenant-worker.ts),
18
+ // so logging is on in production whether or not this line survives.
19
+ "observability": { "enabled": true, "head_sampling_rate": 1 },
20
+
12
21
  // The React SPA (built to dist/client by Vite) is served for any request
13
22
  // that isn't worker-first. "/api/*" is the app's API; "/.pple/*" is reserved
14
23
  // for the platform deploy probe. "single-page-application" makes every