@debugkit/cli 0.3.1 → 0.5.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 +39 -4
- package/dist/cli.js +342 -71
- package/dist/lambda/index.mjs +3 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -16,16 +16,41 @@ Run it from your app's folder. It walks you through these steps:
|
|
|
16
16
|
- **AWS:** a Lambda with a public URL and DynamoDB.
|
|
17
17
|
- **Just this machine:** no cloud, for a first look.
|
|
18
18
|
3. **Signs you in and sets everything up in your own account.**
|
|
19
|
-
- **Firebase:** you sign in with Google in your browser, then pick or create a project. The CLI creates the Firestore database, deploys the indexes and the
|
|
19
|
+
- **Firebase:** you sign in with Google in your browser, then pick or create a project. The CLI creates the Firestore database, deploys the indexes and the expiry on raw events, and deploys the ingest function. Cloud Functions need the Blaze plan, so it opens the billing page if you need to upgrade.
|
|
20
20
|
- **AWS:** you use an existing profile or sign in with AWS SSO in your browser, so you don't paste any access keys. The CLI creates the DynamoDB table, a Lambda with a public URL, an IAM role that can only write to the table, and a read-only policy for hosting the dashboard later.
|
|
21
|
-
4. **
|
|
22
|
-
5. **
|
|
23
|
-
6. **
|
|
21
|
+
4. **Asks how long to keep raw events:** 30, 60 (default), 90, 180 or 365 days, or any number, with a rough storage cost. Counts, issues and release health are kept forever. You can change it later on the dashboard's Settings page.
|
|
22
|
+
5. **Wires up your app.** It writes the endpoint and ingest key to `.env` (or into the code for bare React Native), creates `debug.ts`, and tells you the one or two lines left to add.
|
|
23
|
+
6. **Opens your dashboard,** connected to your data and still empty, behind a login you choose.
|
|
24
|
+
7. **Walks you through it:**
|
|
24
25
|
- what each part of the dashboard will show;
|
|
25
26
|
- a test event, sent through the real ingest so you watch it arrive;
|
|
26
27
|
- what the SDK records on its own;
|
|
27
28
|
- what you add in your own try/catches.
|
|
28
29
|
|
|
30
|
+
## Several environments (preview, production…)
|
|
31
|
+
|
|
32
|
+
When each environment has its own backend, such as separate Firebase projects or AWS accounts, set
|
|
33
|
+
deBug up once per environment:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx debugkit init --env preview # e.g. into your staging Firebase project
|
|
37
|
+
npx debugkit init --env production # into the production one
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Each environment gets its own provider, project, endpoint, ingest key and dashboard login. They're
|
|
41
|
+
saved under `environments` in `.debugkit/config.json`, with `.debugkit/dashboard.<env>.env`.
|
|
42
|
+
|
|
43
|
+
- **Expo apps with EAS:** for `development`, `preview` and `production`, the CLI offers to put
|
|
44
|
+
`EXPO_PUBLIC_DEBUG_ENDPOINT`, `EXPO_PUBLIC_DEBUG_KEY` and `EXPO_PUBLIC_DEBUG_ENVIRONMENT` into
|
|
45
|
+
that EAS environment (`eas env:set`). `eas build` and `eas env:pull` then pick them up.
|
|
46
|
+
- **Other apps:** it prints the three values to set wherever that environment's builds get their
|
|
47
|
+
config. With `--env` it never writes `.env`, which would point every build at one environment.
|
|
48
|
+
- **`debug.ts` is the same for every environment:** it's on in release builds that have an
|
|
49
|
+
endpoint, and off in development builds and local runs (`enabled: !__DEV__ && !!endpoint`). To
|
|
50
|
+
leave an environment out, such as development, don't set it up.
|
|
51
|
+
- **Later commands take `--env` too:** `npx debugkit dashboard --env production`, `test`, `guide`
|
|
52
|
+
and `password`.
|
|
53
|
+
|
|
29
54
|
## Commands
|
|
30
55
|
|
|
31
56
|
Every command below also works as `npx @debugkit/cli <command>`.
|
|
@@ -39,6 +64,16 @@ Every command below also works as `npx @debugkit/cli <command>`.
|
|
|
39
64
|
|
|
40
65
|
Options: `--provider firebase|aws|local` skips the provider question, `--cwd <dir>` points at another folder, and `--yes` accepts the defaults (for scripts; set `DEBUGKIT_DASHBOARD_PASSWORD`).
|
|
41
66
|
|
|
67
|
+
## What's been verified
|
|
68
|
+
|
|
69
|
+
| Path | Status |
|
|
70
|
+
|---|---|
|
|
71
|
+
| Just this machine | Run end to end: the empty dashboard, then test events arriving |
|
|
72
|
+
| Firebase | Run end to end against a real project: function deployed, indexes added without touching existing ones, test events read back on the dashboard |
|
|
73
|
+
| AWS | Unit-tested (profile parsing, the "not found" handling, key merging) and the bundled Lambda run locally. Not yet run against a real account |
|
|
74
|
+
| Environments (`--env`) | Run end to end with "just this machine" in an Expo-style app: separate config and login, `.env` untouched, `debug.ts` with the on/off switch. `eas env:set` is checked against EAS's help but not yet run against a real EAS project |
|
|
75
|
+
| Platforms | Vite and React run for real. The Expo, React Native, Next.js, TanStack Start and Node templates are unit-tested |
|
|
76
|
+
|
|
42
77
|
## What it needs
|
|
43
78
|
|
|
44
79
|
- Node 20.12 or later.
|