@donotdev/cli 0.0.16 → 0.0.17

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.
Files changed (32) hide show
  1. package/dependencies-matrix.json +33 -129
  2. package/dist/bin/commands/bump.js +9 -2
  3. package/dist/bin/commands/create-app.js +195 -40
  4. package/dist/bin/commands/create-project.js +195 -40
  5. package/dist/bin/commands/deploy.js +51 -20
  6. package/dist/bin/commands/doctor.js +249 -56
  7. package/dist/bin/commands/emu.js +18 -20
  8. package/dist/bin/commands/make-admin.js +30 -10
  9. package/dist/bin/commands/setup.js +512 -122
  10. package/dist/bin/commands/type-check.d.ts.map +1 -1
  11. package/dist/bin/commands/type-check.js +7 -3
  12. package/dist/bin/commands/type-check.js.map +1 -1
  13. package/dist/bin/donotdev.js +26 -14
  14. package/dist/index.js +264 -80
  15. package/package.json +1 -1
  16. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +6 -6
  17. package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
  18. package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +13 -6
  19. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +149 -1086
  20. package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +68 -16
  21. package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +6 -111
  22. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +123 -32
  23. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +108 -91
  24. package/templates/root-consumer/guides/dndev/advanced/EMULATORS.md.example +2 -2
  25. package/dist/bin/commands/firebase-setup.d.ts +0 -6
  26. package/dist/bin/commands/firebase-setup.d.ts.map +0 -1
  27. package/dist/bin/commands/firebase-setup.js +0 -7
  28. package/dist/bin/commands/firebase-setup.js.map +0 -1
  29. package/dist/bin/commands/supabase-setup.d.ts +0 -6
  30. package/dist/bin/commands/supabase-setup.d.ts.map +0 -1
  31. package/dist/bin/commands/supabase-setup.js +0 -7
  32. package/dist/bin/commands/supabase-setup.js.map +0 -1
@@ -1,6 +1,6 @@
1
- # Setup: Authentication (Firebase Auth)
1
+ # Setup: Authentication
2
2
 
3
- **Most is pre-configured.** Firebase Auth for user sign-in/sign-up. Add env vars and config. Framework handles providers, callbacks, sessions.
3
+ **Most is pre-configured.** Works with Firebase Auth or Supabase Auth. Add env vars and config. Framework handles providers, callbacks, sessions.
4
4
 
5
5
  ---
6
6
 
@@ -24,7 +24,8 @@ export const appConfig: AppConfig = {
24
24
  };
25
25
  ```
26
26
 
27
- **Firebase Console:** Enable providers in Authentication > Sign-in method
27
+ **Firebase:** Enable providers in Firebase Console → Authentication Sign-in method
28
+ **Supabase:** Enable providers in Supabase Dashboard → Authentication → Providers
28
29
 
29
30
  ---
30
31
 
@@ -80,10 +81,10 @@ const signOut = useAuth('signOut');
80
81
 
81
82
  **Default:** All authenticated users are `'user'` role.
82
83
 
83
- **Setting admin/super roles:** Set Firebase Auth customClaims:
84
+ **Setting admin/super roles:**
84
85
 
86
+ **Firebase** — Set customClaims:
85
87
  ```typescript
86
- // Using Firebase Admin SDK
87
88
  import { getFirebaseAdminAuth } from '@donotdev/firebase/server';
88
89
 
89
90
  const auth = getFirebaseAdminAuth();
@@ -93,12 +94,18 @@ await auth.setCustomUserClaims(userId, {
93
94
  });
94
95
  ```
95
96
 
97
+ **Supabase** — Set user metadata:
98
+ ```sql
99
+ -- In Supabase Dashboard → SQL Editor
100
+ UPDATE auth.users SET raw_app_meta_data = raw_app_meta_data || '{"role": "admin"}' WHERE id = '<user-id>';
101
+ ```
102
+
96
103
  **Using CLI:**
97
104
  ```bash
98
105
  dndev make-admin <userId>
99
106
  ```
100
107
 
101
- **Note:** User must sign out and sign in again for role changes to take effect (customClaims are in the ID token).
108
+ **Note:** User must sign out and sign in again for role changes to take effect.
102
109
 
103
110
  **Used by:** CRUD access control, protected routes, field visibility filtering.
104
111