@pplethai/cli 0.22.0 → 0.24.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 +12 -14
- package/dist/bin.js +109 -109
- package/package.json +3 -6
- package/templates/golden-path/.dev.vars.example +0 -33
- package/templates/golden-path/.env.example +0 -10
- package/templates/golden-path/.github/workflows/ci.yml +0 -22
- package/templates/golden-path/AGENTS.md +0 -1
- package/templates/golden-path/CLAUDE.md +0 -191
- package/templates/golden-path/README.md +0 -121
- package/templates/golden-path/gitignore +0 -17
- package/templates/golden-path/index.html +0 -16
- package/templates/golden-path/migrations/0001_init.sql +0 -10
- package/templates/golden-path/overlay-mtime.mjs +0 -30
- package/templates/golden-path/package-lock.json +0 -4318
- package/templates/golden-path/package.json +0 -41
- package/templates/golden-path/scripts/assert-dev-compiled-out.mjs +0 -45
- package/templates/golden-path/shared/api.ts +0 -325
- package/templates/golden-path/src/auth.ts +0 -230
- package/templates/golden-path/src/call-service.ts +0 -147
- package/templates/golden-path/src/dataset-query.ts +0 -470
- package/templates/golden-path/src/dataset-schema.ts +0 -398
- package/templates/golden-path/src/db.ts +0 -32
- package/templates/golden-path/src/dev-call-service.ts +0 -392
- package/templates/golden-path/src/dev-personas.ts +0 -186
- package/templates/golden-path/src/dev-read-dataset.ts +0 -444
- package/templates/golden-path/src/dev-registry.ts +0 -294
- package/templates/golden-path/src/email.ts +0 -49
- package/templates/golden-path/src/entry-name.ts +0 -114
- package/templates/golden-path/src/env.ts +0 -38
- package/templates/golden-path/src/files.ts +0 -38
- package/templates/golden-path/src/identity-header.ts +0 -17
- package/templates/golden-path/src/index.ts +0 -282
- package/templates/golden-path/src/legal-identity.ts +0 -180
- package/templates/golden-path/src/levels.ts +0 -132
- package/templates/golden-path/src/notification-response.ts +0 -55
- package/templates/golden-path/src/notify.ts +0 -311
- package/templates/golden-path/src/party-email.ts +0 -183
- package/templates/golden-path/src/payment.ts +0 -676
- package/templates/golden-path/src/read-dataset.ts +0 -490
- package/templates/golden-path/src/registry.ts +0 -128
- package/templates/golden-path/src/vite-env.d.ts +0 -27
- package/templates/golden-path/test/apply-migrations.ts +0 -4
- package/templates/golden-path/test/call-service.test.ts +0 -288
- package/templates/golden-path/test/dev-call-service.test.ts +0 -455
- package/templates/golden-path/test/dev-read-dataset.test.ts +0 -379
- package/templates/golden-path/test/dev-registry.test.ts +0 -404
- package/templates/golden-path/test/effective-sub.test.ts +0 -101
- package/templates/golden-path/test/email-offline.test.ts +0 -51
- package/templates/golden-path/test/email.test.ts +0 -117
- package/templates/golden-path/test/env.d.ts +0 -17
- package/templates/golden-path/test/fixtures/overlay/branch-list/entry.md +0 -85
- package/templates/golden-path/test/fixtures/overlay/branch-list/mocks/audience.json +0 -3
- package/templates/golden-path/test/fixtures/overlay/branch-list/mocks/named.json +0 -3
- package/templates/golden-path/test/fixtures/overlay/branch-list/mocks/offices.json +0 -6
- package/templates/golden-path/test/fixtures/overlay/branch-list/mocks/roster.json +0 -3
- package/templates/golden-path/test/fixtures/overlay/branch-list/mocks/summary.json +0 -1
- package/templates/golden-path/test/fixtures/overlay/catalog/entry.md +0 -8
- package/templates/golden-path/test/fixtures/overlay/catalog/mocks/responses.json +0 -7
- package/templates/golden-path/test/fixtures/overlay/election/2027/score/entry.md +0 -11
- package/templates/golden-path/test/fixtures/overlay/election/2027/score/mocks/responses.json +0 -7
- package/templates/golden-path/test/fixtures/overlay/election/results/entry.md +0 -24
- package/templates/golden-path/test/fixtures/overlay/election/results/mocks/turnout.json +0 -1
- package/templates/golden-path/test/fixtures/overlay/orders/entry.md +0 -12
- package/templates/golden-path/test/fixtures/overlay/orders/mocks/responses.json +0 -36
- package/templates/golden-path/test/fixtures/overlay/platform/email/entry.md +0 -12
- package/templates/golden-path/test/fixtures/overlay/platform/email/mocks/responses.json +0 -11
- package/templates/golden-path/test/fixtures/overlay/platform/legal-identity/entry.md +0 -8
- package/templates/golden-path/test/fixtures/overlay/platform/legal-identity/mocks/responses.json +0 -13
- package/templates/golden-path/test/fixtures/overlay/platform/payments/entry.md +0 -12
- package/templates/golden-path/test/fixtures/overlay/platform/payments/mocks/responses.json +0 -98
- package/templates/golden-path/test/fixtures/overlay/platform/sms/entry.md +0 -10
- package/templates/golden-path/test/fixtures/overlay/platform/sms/mocks/responses.json +0 -7
- package/templates/golden-path/test/fixtures/overlay/score/entry.md +0 -10
- package/templates/golden-path/test/fixtures/overlay/score/mocks/responses.json +0 -7
- package/templates/golden-path/test/harness.ts +0 -153
- package/templates/golden-path/test/interaction.test.ts +0 -230
- package/templates/golden-path/test/legal-identity.test.ts +0 -323
- package/templates/golden-path/test/membership.test.ts +0 -105
- package/templates/golden-path/test/notification-response.test.ts +0 -79
- package/templates/golden-path/test/payment-app.test.ts +0 -211
- package/templates/golden-path/test/payment-offline.test.ts +0 -91
- package/templates/golden-path/test/payment.test.ts +0 -518
- package/templates/golden-path/test/payments-offline.ts +0 -33
- package/templates/golden-path/test/read-dataset.test.ts +0 -387
- package/templates/golden-path/test/service-call.test.ts +0 -166
- package/templates/golden-path/test/smoke.test.ts +0 -464
- package/templates/golden-path/tsconfig.json +0 -20
- package/templates/golden-path/tsconfig.worker.json +0 -21
- package/templates/golden-path/vite.config.ts +0 -12
- package/templates/golden-path/vitest.config.ts +0 -28
- package/templates/golden-path/web/App.tsx +0 -478
- package/templates/golden-path/web/app.css +0 -83
- package/templates/golden-path/web/main.tsx +0 -51
- package/templates/golden-path/web/pple.ts +0 -124
- package/templates/golden-path/web/vite-env.d.ts +0 -10
- package/templates/golden-path/wrangler.jsonc +0 -89
- package/templates/payment-bridge/.github/workflows/ci.yml +0 -21
- package/templates/payment-bridge/CLAUDE.md +0 -9
- package/templates/payment-bridge/README.md +0 -57
- package/templates/payment-bridge/docs/verify-webhook.md +0 -80
- package/templates/payment-bridge/docs/verify-webhook.ts +0 -29
- package/templates/payment-bridge/gitignore +0 -5
- package/templates/payment-bridge/package-lock.json +0 -4198
- package/templates/payment-bridge/package.json +0 -21
- package/templates/payment-bridge/src/bridge-key.ts +0 -18
- package/templates/payment-bridge/src/env.ts +0 -14
- package/templates/payment-bridge/src/index.ts +0 -39
- package/templates/payment-bridge/src/platform.ts +0 -49
- package/templates/payment-bridge/src/webhook.ts +0 -86
- package/templates/payment-bridge/test/docs.test.ts +0 -9
- package/templates/payment-bridge/test/fixtures/payments-responses.json +0 -98
- package/templates/payment-bridge/test/harness.ts +0 -78
- package/templates/payment-bridge/test/inbound.test.ts +0 -138
- package/templates/payment-bridge/test/webhook.test.ts +0 -174
- package/templates/payment-bridge/tsconfig.json +0 -22
- package/templates/payment-bridge/vitest.config.ts +0 -8
- package/templates/payment-bridge/wrangler.jsonc +0 -15
- package/templates/payment-bridge.version +0 -1
package/README.md
CHANGED
|
@@ -105,8 +105,8 @@ owns. `pple whoami` renews an expiring token silently via the refresh token.
|
|
|
105
105
|
**`pple init`** creates a Builder App (prompt for App Name, or `--name`) via
|
|
106
106
|
the same Provisioner `POST /apps` the Console uses, waits until the app is
|
|
107
107
|
ready, then scaffolds it — or, given an App Slug, scaffolds an app that
|
|
108
|
-
already exists. Either way it fetches the app's code,
|
|
109
|
-
template under the app's own name, writes `.pple/app.json` linking the folder
|
|
108
|
+
already exists. Either way it fetches the app's code, writes the golden-path
|
|
109
|
+
template the platform serves now under the app's own name (ADR-0048), writes `.pple/app.json` linking the folder
|
|
110
110
|
to the app, and installs the Skill and Platform Rules the Builder's AI coding
|
|
111
111
|
agent reads (ADR-0001, ADR-0019). The App Slug stays platform-generated;
|
|
112
112
|
bare `pple init` in a folder that already has an App Link is refused.
|
|
@@ -158,9 +158,8 @@ and name roles by key or Thai label, resolved against the Provisioner's
|
|
|
158
158
|
`GET /role-options` (`pple roles`) — the list the Console's picker shows.
|
|
159
159
|
|
|
160
160
|
**`pple upgrade`** asks npm what the latest `@pplethai/cli` is and, when
|
|
161
|
-
this copy is one npm's global root holds, installs it
|
|
162
|
-
the
|
|
163
|
-
travels with the CLI, ADR-0019). Any
|
|
161
|
+
this copy is one npm's global root holds, installs it (ADR-0007). Neither the
|
|
162
|
+
Skill nor the templates travel with the CLI any more (ADR-0019, ADR-0048). Any
|
|
164
163
|
other install channel is told the manual `npm install -g @pplethai/cli`
|
|
165
164
|
line rather than having a second copy installed over the first, and so is a
|
|
166
165
|
failed install, carrying npm's own reason. The CLI never uses `sudo`: a global
|
|
@@ -200,11 +199,12 @@ echo '{ "updateCheck": false }' > ~/.config/pple/config.json # this machine
|
|
|
200
199
|
| `src/target.ts` | which app a command acts on (`--app`, else the App Link) |
|
|
201
200
|
| `src/commands/` | the commands, each taking `Deps` and what it was given |
|
|
202
201
|
| `src/labels.ts`, `src/requests.ts` | the Thai a Builder reads for platform values and Requests |
|
|
203
|
-
| `src/deps.ts` | every seam: fetch, clock, subprocesses, output, template
|
|
202
|
+
| `src/deps.ts` | every seam: fetch, clock, subprocesses, output, local template override |
|
|
204
203
|
| `src/device-flow.ts` | RFC 8628 against PPLE ID |
|
|
205
204
|
| `src/api.ts` | the Provisioner API, and the only place that knows its error codes |
|
|
206
205
|
| `src/git.ts` | git, and the only place that names it or holds the repo token |
|
|
207
|
-
| `src/
|
|
206
|
+
| `src/template.ts` | fetching a template from the platform and checking it before it is written |
|
|
207
|
+
| `src/scaffold.ts` | writing a template into the app folder under the app's name |
|
|
208
208
|
| `src/guidance.ts` | refreshing the Skill and Platform Rules into an app folder |
|
|
209
209
|
| `src/npm.ts` | npm: the registry's latest version, and the install channel |
|
|
210
210
|
| `src/update.ts` | the daily update check, its cadence state, and its opt-outs |
|
|
@@ -216,7 +216,7 @@ echo '{ "updateCheck": false }' > ~/.config/pple/config.json # this machine
|
|
|
216
216
|
npm install
|
|
217
217
|
npm test # drives whole commands against a fake Provisioner and real git
|
|
218
218
|
npm run typecheck
|
|
219
|
-
npm run build #
|
|
219
|
+
npm run build # esbuild → dist/bin.js
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
Tests run the real command path — real `git` in a temp directory, a fake
|
|
@@ -229,12 +229,10 @@ minted. A local path would let every clone and push succeed with no credential
|
|
|
229
229
|
at all, and nothing would show that the platform's token is what opens a
|
|
230
230
|
private repo.
|
|
231
231
|
|
|
232
|
-
The published package carries
|
|
233
|
-
the Payment Bridge
|
|
234
|
-
|
|
235
|
-
the
|
|
236
|
-
those repo paths directly. The Skill is not bundled: tests serve it from
|
|
237
|
-
the fake platform. `PPLE_TEMPLATE_DIR`, `PPLE_API_BASE`, `PPLE_SSO_BASE`, `PPLE_CLIENT_ID`,
|
|
232
|
+
The published package carries no template (ADR-0048): `pple init` fetches the
|
|
233
|
+
golden path or the Payment Bridge from the Provisioner's `GET /templates`, which
|
|
234
|
+
CI fills on every Platform deploy (`scripts/publish-templates.mjs`). Tests serve
|
|
235
|
+
both from folders the fake platform reads, as they serve the Skill. `PPLE_TEMPLATE_DIR`, `PPLE_API_BASE`, `PPLE_SSO_BASE`, `PPLE_CLIENT_ID`,
|
|
238
236
|
`PPLE_REPO_BASE`, and `PPLE_REGISTRY_BASE` override the defaults for staging
|
|
239
237
|
work.
|
|
240
238
|
|