@moneydevkit/create 0.3.2 → 0.4.0-beta.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 +33 -6
- package/dist/index.cjs +514 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +513 -26
- package/dist/index.js.map +1 -1
- package/dist/templates/nextjs/app/api/mdk/route.js +1 -0
- package/dist/templates/nextjs/app/api/mdk/route.ts +1 -0
- package/dist/templates/nextjs/app/checkout/[id]/page.js +8 -0
- package/dist/templates/nextjs/app/checkout/[id]/page.tsx +8 -0
- package/dist/templates/readme-sync.test.ts +56 -0
- package/package.json +4 -2
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/` 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` and `MDK_MNEMONIC` are ready to go.
|
|
9
10
|
|
|
10
11
|
### Customize the flow with flags
|
|
11
12
|
|
|
@@ -15,7 +16,7 @@ Pass any of the options from the table below to skip prompts or run non-interact
|
|
|
15
16
|
npx @moneydevkit/create@latest \
|
|
16
17
|
--dir ./apps/storefront \
|
|
17
18
|
--env-target .env.production \
|
|
18
|
-
--webhook-url https://example.com
|
|
19
|
+
--webhook-url https://example.com \
|
|
19
20
|
--project-name "Storefront" \
|
|
20
21
|
--no-open --no-clipboard
|
|
21
22
|
```
|
|
@@ -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/` directory. 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
|
+
- Always scaffolds App Router files (`app/api/mdk/route.(ts|js)` and `app/checkout/[id]/page.(tsx|js)`).
|
|
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
|
|
|
@@ -49,8 +58,9 @@ The CLI still creates a device code but immediately authorises it using your coo
|
|
|
49
58
|
| `--no-clipboard` | Do not place secrets on the clipboard. |
|
|
50
59
|
| `--json` | Emit JSON result payloads (no interactive prompts).
|
|
51
60
|
| `--manual-login "<cookie>"` | Use a pre-generated dashboard session cookie instead of device flow. |
|
|
52
|
-
| `--webhook-url "<url>"` | Provide the
|
|
61
|
+
| `--webhook-url "<url>"` | Provide the domain 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
|
|
|
@@ -65,8 +75,25 @@ npm run run:local # talk to a dashboard at http://localhost:3900
|
|
|
65
75
|
|
|
66
76
|
## Releasing to npm
|
|
67
77
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
All `@moneydevkit/*` packages share a unified version number and are released together.
|
|
79
|
+
|
|
80
|
+
### Beta releases (automatic)
|
|
81
|
+
|
|
82
|
+
Every push to `main` that modifies files in `packages/` triggers the `publish-beta` workflow:
|
|
83
|
+
1. All packages are bumped to the next beta version (e.g., `0.4.0-beta.0` → `0.4.0-beta.1`)
|
|
84
|
+
2. All packages are published to npm with the `beta` tag
|
|
85
|
+
|
|
86
|
+
Install the latest beta with:
|
|
87
|
+
```bash
|
|
88
|
+
npx @moneydevkit/create@beta
|
|
89
|
+
npm install @moneydevkit/nextjs@beta
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Stable releases
|
|
93
|
+
|
|
94
|
+
1. Create a GitHub release with a tag matching the version in package.json (e.g., if package.json has `0.4.0-beta.3`, create tag `v0.4.0`)
|
|
95
|
+
2. The `publish-release` workflow validates, publishes, and bumps to the next minor version
|
|
71
96
|
|
|
72
97
|
Once that workflow succeeds, `npx @moneydevkit/create@latest` automatically downloads the freshly published build.
|
|
98
|
+
|
|
99
|
+
See the [main README](../../README.md#releasing) for version flow examples and error cases.
|