@moneydevkit/create 0.3.1 → 0.3.3
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 +11 -1
- package/dist/index.cjs +687 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +687 -18
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@ Developer onboarding CLI for Money Dev Kit. This package publishes the interacti
|
|
|
5
5
|
## Getting Started
|
|
6
6
|
|
|
7
7
|
1. Run `npx @moneydevkit/create@latest` from the root of your project. The CLI walks you through login, webhook verification, and writes your secrets to `.env.local` (or a path you pick) while also copying them to the clipboard by default.
|
|
8
|
-
2.
|
|
8
|
+
2. If we detect a Next.js app (package.json `next` dependency, `next.config.*`, or an `app/`/`pages/` directory), we’ll offer to install and scaffold `@moneydevkit/nextjs` for you.
|
|
9
|
+
3. Follow the prompts. When you reach your editor again, `MDK_ACCESS_TOKEN`, `MDK_WEBHOOK_SECRET`, and `MDK_MNEMONIC` are ready to go.
|
|
9
10
|
|
|
10
11
|
### Customize the flow with flags
|
|
11
12
|
|
|
@@ -36,6 +37,14 @@ The CLI still creates a device code but immediately authorises it using your coo
|
|
|
36
37
|
2. Launches the browser for sign-in (or prints the verification URL when `--no-open` or `--json` are supplied).
|
|
37
38
|
3. Polls until the dashboard authorises the device, then provisions an API key + webhook secret, and generates a mnemonic locally via BIP-39.
|
|
38
39
|
4. Shows an env diff, writes `.env.local` (or a user-specified file), and optionally copies secrets to the clipboard.
|
|
40
|
+
5. Detects a Next.js app and (with your confirmation or `--scaffold-nextjs`) installs `@moneydevkit/nextjs`, wraps `next.config.*` with `withMdkCheckout`, and scaffolds the API route plus `/checkout/[id]` page without overwriting existing files.
|
|
41
|
+
|
|
42
|
+
## Next.js scaffolding
|
|
43
|
+
|
|
44
|
+
- Auto-detects Next.js via `package.json`, `next.config.*`, or `app/`/`pages/` directories. If found, you’ll be prompted to install and scaffold `@moneydevkit/nextjs`. Requires Next.js 15+ (per SDK peer deps).
|
|
45
|
+
- `--scaffold-nextjs` forces the install/scaffold (useful for CI); if no Next.js app is found, the CLI prints a warning and skips.
|
|
46
|
+
- Prefers the App Router (`app/api/mdk/route.(ts|js)` and `app/checkout/[id]/page.(tsx|js)`); falls back to the Pages Router paths when only `pages/` exists.
|
|
47
|
+
- Existing files are left untouched; `next.config.*` is backed up if we need to wrap it with `withMdkCheckout`.
|
|
39
48
|
|
|
40
49
|
## Flags
|
|
41
50
|
|
|
@@ -51,6 +60,7 @@ The CLI still creates a device code but immediately authorises it using your coo
|
|
|
51
60
|
| `--manual-login "<cookie>"` | Use a pre-generated dashboard session cookie instead of device flow. |
|
|
52
61
|
| `--webhook-url "<url>"` | Provide the webhook URL when running in `--manual-login` or `--json` modes. |
|
|
53
62
|
| `--force-new-webhook` | Force creation of a new webhook even if one already exists for the URL. |
|
|
63
|
+
| `--scaffold-nextjs` | Force install + scaffold `@moneydevkit/nextjs` (warns and skips if no Next.js app is detected). |
|
|
54
64
|
|
|
55
65
|
Manual login mode calls `POST /api/cli/device/authorize` with the supplied session cookie. When used with `--json`, pass `--webhook-url` to avoid interactive prompts.
|
|
56
66
|
|