@donotdev/cli 0.0.25 → 0.0.27
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 +7 -295
- package/dependencies-matrix.json +49 -21
- package/dist/bin/commands/agent-setup.js +1 -1
- package/dist/bin/commands/build.js +143 -142
- package/dist/bin/commands/bump.js +145 -144
- package/dist/bin/commands/cacheout.js +142 -141
- package/dist/bin/commands/coach.js +156 -151
- package/dist/bin/commands/create-app.js +22 -22
- package/dist/bin/commands/create-project.js +165 -164
- package/dist/bin/commands/db.js +46704 -46703
- package/dist/bin/commands/deploy.js +674 -575
- package/dist/bin/commands/dev.js +179 -159
- package/dist/bin/commands/doctor.js +152 -151
- package/dist/bin/commands/emu.js +186 -176
- package/dist/bin/commands/format.js +142 -141
- package/dist/bin/commands/get-demo.js +1 -1
- package/dist/bin/commands/make-admin.js +64133 -64040
- package/dist/bin/commands/preview.js +178 -159
- package/dist/bin/commands/seed.js +46704 -46703
- package/dist/bin/commands/setup-cicd.js +164 -158
- package/dist/bin/commands/setup.js +409 -209
- package/dist/bin/commands/staging.js +674 -575
- package/dist/bin/commands/sync-secrets.js +142 -141
- package/dist/bin/commands/type-check.js +142 -141
- package/dist/bin/dndev.js +93 -1
- package/dist/bin/donotdev.js +93 -1
- package/dist/index.js +713 -605
- package/package.json +1 -1
- package/templates/app-next/postcss.config.js.example +3 -54
- package/templates/root-consumer/bunfig.toml.example +6 -49
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +19 -0
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +50 -9
package/package.json
CHANGED
|
@@ -1,58 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PostCSS config for Next.js
|
|
3
|
-
* Uses
|
|
3
|
+
* Uses framework resolver with CSS alias support (dndev.css → dndev-next.css)
|
|
4
4
|
*/
|
|
5
|
+
import { definePostCSSConfig } from '@donotdev/core/next';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
import postcssNesting from 'postcss-nesting';
|
|
8
|
-
import autoprefixer from 'autoprefixer';
|
|
9
|
-
import { createRequire } from 'node:module';
|
|
10
|
-
import { resolve, join, dirname } from 'node:path';
|
|
11
|
-
import { existsSync } from 'node:fs';
|
|
12
|
-
|
|
13
|
-
const findPackageRoot = (startDir) => {
|
|
14
|
-
let current = resolve(startDir);
|
|
15
|
-
const root = resolve('/');
|
|
16
|
-
|
|
17
|
-
while (current !== root) {
|
|
18
|
-
const pkgPath = join(current, 'package.json');
|
|
19
|
-
if (existsSync(pkgPath)) {
|
|
20
|
-
return current;
|
|
21
|
-
}
|
|
22
|
-
const parent = dirname(current);
|
|
23
|
-
if (parent === current) break;
|
|
24
|
-
current = parent;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return startDir;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const customResolve = (id, basedir) => {
|
|
31
|
-
try {
|
|
32
|
-
const packageRoot = findPackageRoot(basedir);
|
|
33
|
-
const require = createRequire(join(packageRoot, 'package.json'));
|
|
34
|
-
return require.resolve(id);
|
|
35
|
-
} catch (error) {
|
|
36
|
-
return resolve(basedir, id);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/** @type {import('postcss-load-config').Config} */
|
|
41
|
-
const config = {
|
|
42
|
-
plugins: [
|
|
43
|
-
postcssImport({ resolve: customResolve }),
|
|
44
|
-
postcssNesting,
|
|
45
|
-
autoprefixer({
|
|
46
|
-
overrideBrowserslist: [
|
|
47
|
-
'> 1%',
|
|
48
|
-
'last 2 versions',
|
|
49
|
-
'Firefox ESR',
|
|
50
|
-
'not dead',
|
|
51
|
-
'not op_mini all',
|
|
52
|
-
],
|
|
53
|
-
grid: 'autoplace',
|
|
54
|
-
}),
|
|
55
|
-
],
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default config;
|
|
7
|
+
export default await definePostCSSConfig();
|
|
@@ -1,64 +1,21 @@
|
|
|
1
|
-
# Bun Configuration for DoNotDev
|
|
2
|
-
# Copy this to bunfig.toml and adjust as needed
|
|
1
|
+
# Bun Configuration for DoNotDev Consumer App
|
|
3
2
|
# Documentation: https://bun.sh/docs/runtime/bunfig
|
|
4
3
|
|
|
5
4
|
[install]
|
|
6
|
-
# Enable workspace support for
|
|
5
|
+
# Enable workspace support for local apps/packages
|
|
7
6
|
workspace = true
|
|
8
7
|
|
|
9
8
|
# Dependency installation settings
|
|
10
|
-
exact = false
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
peer = true # Warn on missing peer dependencies (mandatory peers like valibot must be installed)
|
|
9
|
+
exact = false
|
|
10
|
+
optional = true
|
|
11
|
+
peer = true
|
|
14
12
|
|
|
15
13
|
# Workspace linking strategy
|
|
16
|
-
# "hoisted" = shared node_modules at root (faster, less disk space, better tool compatibility)
|
|
17
|
-
# "isolated" = separate node_modules per package (better phantom dependency protection)
|
|
18
14
|
linker = "hoisted"
|
|
19
15
|
|
|
20
|
-
# Hoist essential tools for cross-platform compatibility
|
|
21
|
-
# NOTE: path-to-regexp is required for Firebase emulators compatibility
|
|
22
|
-
publicHoistPattern = [
|
|
23
|
-
"*eslint*",
|
|
24
|
-
"*typescript*",
|
|
25
|
-
"*prettier*",
|
|
26
|
-
"*turbo*",
|
|
27
|
-
"*react*",
|
|
28
|
-
"*@types/react*",
|
|
29
|
-
"*esbuild*",
|
|
30
|
-
"@esbuild/*",
|
|
31
|
-
"@donotdev/*",
|
|
32
|
-
"vite",
|
|
33
|
-
"next",
|
|
34
|
-
"path-to-regexp"
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
# Cache configuration — disabled to prevent stale resolution
|
|
38
|
-
cache = false
|
|
39
|
-
|
|
40
16
|
[run]
|
|
41
|
-
# Use Bun runtime for scripts (significantly faster than Node.js)
|
|
42
17
|
bun = true
|
|
43
|
-
|
|
44
|
-
# Cross-platform shell handling
|
|
45
|
-
# "bun" = use Bun's internal shell (RECOMMENDED for cross-platform compatibility)
|
|
46
|
-
# Ensures consistent behavior across Windows/WSL/Mac/Linux
|
|
47
18
|
shell = "bun"
|
|
48
19
|
|
|
49
20
|
[install.lockfile]
|
|
50
|
-
|
|
51
|
-
version = 2
|
|
52
|
-
|
|
53
|
-
# Additional notes:
|
|
54
|
-
# - Always commit bun.lockb to version control
|
|
55
|
-
# - Use workspace:* protocol for internal package dependencies
|
|
56
|
-
# - For merge conflicts in bun.lockb: accept one side, run bun install, commit
|
|
57
|
-
#
|
|
58
|
-
# Firebase Emulators Compatibility:
|
|
59
|
-
# If using Firebase emulators, add these overrides to your root package.json:
|
|
60
|
-
# "overrides": {
|
|
61
|
-
# "path-to-regexp": "0.1.7",
|
|
62
|
-
# "express>path-to-regexp": "0.1.7",
|
|
63
|
-
# "firebase-tools>express>path-to-regexp": "0.1.7"
|
|
64
|
-
# }
|
|
21
|
+
version = 2
|
|
@@ -27,6 +27,25 @@ export const appConfig: AppConfig = {
|
|
|
27
27
|
**Firebase:** Enable providers in Firebase Console → Authentication → Sign-in method
|
|
28
28
|
**Supabase:** Enable providers in Supabase Dashboard → Authentication → Providers
|
|
29
29
|
|
|
30
|
+
### Redirect URLs (Supabase only)
|
|
31
|
+
|
|
32
|
+
After OAuth (Google, GitHub, etc.), Supabase redirects the user back to your app. You must tell Supabase which URLs are allowed.
|
|
33
|
+
|
|
34
|
+
**Supabase Dashboard → Authentication → URL Configuration:**
|
|
35
|
+
|
|
36
|
+
| Setting | Value |
|
|
37
|
+
|---------|-------|
|
|
38
|
+
| **Site URL** | Your **production** URL (e.g., `https://myapp.vercel.app`) |
|
|
39
|
+
| **Redirect URLs** | All URLs where auth should work (see below) |
|
|
40
|
+
|
|
41
|
+
**Add to Redirect URLs:**
|
|
42
|
+
- `http://localhost:5173` — local Vite dev
|
|
43
|
+
- `http://localhost:3000` — local Next.js dev
|
|
44
|
+
- `https://myapp.vercel.app` — production
|
|
45
|
+
- `https://*-yourteam.vercel.app` — Vercel preview deploys
|
|
46
|
+
|
|
47
|
+
> **Site URL must be production.** It's the fallback when no redirect URL matches. If it's `localhost:3000`, your deployed app redirects to localhost after OAuth.
|
|
48
|
+
|
|
30
49
|
---
|
|
31
50
|
|
|
32
51
|
## Advanced: Protected Routes
|
|
@@ -40,19 +40,26 @@ VERCEL_TOKEN=your_vercel_token
|
|
|
40
40
|
**Per-app (public):** add to `apps/<your-app>/.env`:
|
|
41
41
|
|
|
42
42
|
```env
|
|
43
|
-
VERCEL_ORG_ID=your_team_id
|
|
44
43
|
VERCEL_PROJECT_ID=your_project_id
|
|
45
44
|
```
|
|
46
45
|
|
|
46
|
+
**Team/Pro accounts only** — add to `apps/<your-app>/.env`:
|
|
47
|
+
|
|
48
|
+
```env
|
|
49
|
+
VERCEL_ORG_ID=your_team_id
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
> **Hobby/free accounts: Do NOT set `VERCEL_ORG_ID`.** Setting it on a hobby account causes 403 Forbidden errors. If you're unsure, run `dndev setup` — it detects your account type automatically.
|
|
53
|
+
|
|
47
54
|
**Where to find them:**
|
|
48
55
|
|
|
49
|
-
| Variable | Where | File |
|
|
50
|
-
|
|
51
|
-
| `VERCEL_TOKEN` | [vercel.com/account/tokens](https://vercel.com/account/tokens) — scope to your team | `.dndev.secrets` |
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
56
|
+
| Variable | Where | File | Required? |
|
|
57
|
+
|----------|-------|------|-----------|
|
|
58
|
+
| `VERCEL_TOKEN` | [vercel.com/account/tokens](https://vercel.com/account/tokens) — scope to your team | `.dndev.secrets` | Always |
|
|
59
|
+
| `VERCEL_PROJECT_ID` | Vercel Dashboard → Your Project → Settings → General → **Project ID** | `apps/<app>/.env` | Always |
|
|
60
|
+
| `VERCEL_ORG_ID` | Vercel Dashboard → Settings → General → **Team ID** | `apps/<app>/.env` | Team/Pro only |
|
|
54
61
|
|
|
55
|
-
That's it. No `vercel login`, no `vercel link`, no interactive prompts.
|
|
62
|
+
That's it. No `vercel login`, no `vercel link`, no interactive prompts. Run `dndev setup` to validate everything.
|
|
56
63
|
|
|
57
64
|
---
|
|
58
65
|
|
|
@@ -90,7 +97,7 @@ For Next.js apps, replace the `VITE_` prefix with `NEXT_PUBLIC_` (same var names
|
|
|
90
97
|
dndev deploy
|
|
91
98
|
```
|
|
92
99
|
|
|
93
|
-
That's it. The CLI reads your credentials from `.
|
|
100
|
+
That's it. The CLI reads your credentials from `.dndev.secrets` and `.env` and deploys to production.
|
|
94
101
|
|
|
95
102
|
**Option B — Git push (auto-deploy)**
|
|
96
103
|
|
|
@@ -185,12 +192,36 @@ dndev emu start
|
|
|
185
192
|
|
|
186
193
|
---
|
|
187
194
|
|
|
195
|
+
## Auth Redirect URLs (Supabase)
|
|
196
|
+
|
|
197
|
+
After deploying, configure Supabase so OAuth (Google, GitHub, etc.) redirects back to your Vercel URL instead of `localhost`.
|
|
198
|
+
|
|
199
|
+
**Supabase Dashboard → Authentication → URL Configuration:**
|
|
200
|
+
|
|
201
|
+
| Setting | Value |
|
|
202
|
+
|---------|-------|
|
|
203
|
+
| **Site URL** | Your production URL (e.g., `https://myapp.vercel.app`) |
|
|
204
|
+
| **Redirect URLs** | Add all deployment URLs where auth should work |
|
|
205
|
+
|
|
206
|
+
**Redirect URLs to add:**
|
|
207
|
+
|
|
208
|
+
- `http://localhost:5173` — local Vite dev
|
|
209
|
+
- `http://localhost:3000` — local Next.js dev
|
|
210
|
+
- `https://myapp.vercel.app` — production
|
|
211
|
+
- `https://*-yourteam.vercel.app` — Vercel preview deploys (wildcard)
|
|
212
|
+
- `https://mycustomdomain.com` — custom domain (if applicable)
|
|
213
|
+
|
|
214
|
+
> **Site URL is the fallback.** If the `redirectTo` sent by your app doesn't match any entry in Redirect URLs, Supabase falls back to Site URL. If Site URL is `localhost:3000`, your deployed app will redirect to localhost after OAuth. **Always set Site URL to production.**
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
188
218
|
## Custom Domain
|
|
189
219
|
|
|
190
220
|
1. Vercel Dashboard → Settings → Domains
|
|
191
221
|
2. Add your domain
|
|
192
222
|
3. Update DNS records as instructed by Vercel
|
|
193
223
|
4. If using Firebase Auth: update your `FIREBASE_AUTH_DOMAIN` env var to your custom domain
|
|
224
|
+
5. If using Supabase Auth: add your custom domain to **Supabase Dashboard → Authentication → Redirect URLs** and update **Site URL**
|
|
194
225
|
|
|
195
226
|
---
|
|
196
227
|
|
|
@@ -198,9 +229,19 @@ dndev emu start
|
|
|
198
229
|
|
|
199
230
|
**"Missing Vercel credentials"**
|
|
200
231
|
→ Check `VERCEL_TOKEN` is in `.dndev.secrets` at project root
|
|
201
|
-
→ Check `
|
|
232
|
+
→ Check `VERCEL_PROJECT_ID` is in `apps/<app>/.env`
|
|
202
233
|
→ Run `dndev setup` to validate
|
|
203
234
|
|
|
235
|
+
**"403 Forbidden" / "token does not have access"**
|
|
236
|
+
→ Hobby/free account? Remove `VERCEL_ORG_ID` from `apps/<app>/.env` — hobby accounts don't use team IDs
|
|
237
|
+
→ Team account? Ensure the token is scoped to the correct team at https://vercel.com/account/tokens
|
|
238
|
+
|
|
239
|
+
**"401 Unauthorized" / "token is invalid or expired"**
|
|
240
|
+
→ Generate a new token at https://vercel.com/account/tokens and update `.dndev.secrets`
|
|
241
|
+
|
|
242
|
+
**"404 project not found"**
|
|
243
|
+
→ Check `VERCEL_PROJECT_ID` matches the Project ID in Vercel Dashboard → Project → Settings → General
|
|
244
|
+
|
|
204
245
|
**"Build fails on Vercel"**
|
|
205
246
|
→ Check Root Directory is set to your app directory
|
|
206
247
|
→ Ensure `package.json` has correct `build` script
|