@donotdev/cli 0.0.18 → 0.0.20

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 (150) hide show
  1. package/dependencies-matrix.json +42 -55
  2. package/dist/bin/commands/bump.js +5 -2
  3. package/dist/bin/commands/coach.js +8177 -0
  4. package/dist/bin/commands/create-app.js +6 -6
  5. package/dist/bin/commands/create-project.js +23 -9
  6. package/dist/bin/commands/deploy.js +99 -59
  7. package/dist/bin/commands/doctor.js +243 -698
  8. package/dist/bin/commands/emu.js +2 -2
  9. package/dist/bin/commands/format.js +4 -1
  10. package/dist/bin/commands/get-demo.js +8351 -0
  11. package/dist/bin/commands/make-admin.js +773 -152
  12. package/dist/bin/commands/setup.js +524 -1713
  13. package/dist/bin/commands/staging.js +17870 -0
  14. package/dist/bin/commands/sync-secrets.js +2 -11
  15. package/dist/bin/commands/type-check.js +7738 -1712
  16. package/dist/bin/dndev.js +868 -199
  17. package/dist/bin/donotdev.js +868 -199
  18. package/dist/index.js +127 -67
  19. package/package.json +1 -1
  20. package/templates/app-demo/index.html.example +147 -10
  21. package/templates/app-demo/public/apple-touch-icon.png.example +0 -0
  22. package/templates/app-demo/public/favicon.svg.example +1 -0
  23. package/templates/app-demo/public/icon-192x192.png.example +0 -0
  24. package/templates/app-demo/public/icon-512x512.png.example +0 -0
  25. package/templates/app-demo/src/App.tsx.example +7 -11
  26. package/templates/app-demo/src/config/app.ts.example +13 -48
  27. package/templates/app-demo/src/entities/booking.ts.example +75 -0
  28. package/templates/app-demo/src/entities/onboarding.ts.example +160 -0
  29. package/templates/app-demo/src/entities/product.ts.example +50 -0
  30. package/templates/app-demo/src/entities/quote.ts.example +70 -0
  31. package/templates/app-demo/src/globals.css.example +5 -1
  32. package/templates/app-demo/src/main.tsx.example +13 -7
  33. package/templates/app-demo/src/pages/ChangelogPage.tsx.example +41 -0
  34. package/templates/app-demo/src/pages/ConditionalFormPage.tsx.example +88 -0
  35. package/templates/app-demo/src/pages/DashboardPage.tsx.example +17 -0
  36. package/templates/app-demo/src/pages/HomePage.tsx.example +339 -60
  37. package/templates/app-demo/src/pages/OnboardingPage.tsx.example +47 -0
  38. package/templates/app-demo/src/pages/PricingPage.tsx.example +41 -0
  39. package/templates/app-demo/src/pages/ProductsPage.tsx.example +19 -0
  40. package/templates/app-demo/src/pages/ProfilePage.tsx.example +18 -0
  41. package/templates/app-demo/src/pages/SettingsPage.tsx.example +17 -0
  42. package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +118 -0
  43. package/templates/app-demo/src/pages/ShowcasePage.tsx.example +93 -0
  44. package/templates/app-demo/src/pages/components/ComponentRenderer.tsx.example +147 -51
  45. package/templates/app-demo/src/pages/components/ComponentsData.tsx.example +103 -21
  46. package/templates/app-demo/src/pages/components/componentConfig.ts.example +139 -59
  47. package/templates/app-demo/src/pages/legal/LegalPage.tsx.example +25 -0
  48. package/templates/app-demo/src/pages/legal/PrivacyPage.tsx.example +23 -0
  49. package/templates/app-demo/src/pages/legal/TermsPage.tsx.example +23 -0
  50. package/templates/app-demo/src/themes.css.example +289 -77
  51. package/templates/app-demo/stats.html.example +4949 -0
  52. package/templates/app-demo/tsconfig.json.example +1 -1
  53. package/templates/app-demo/vite.config.ts.example +23 -48
  54. package/templates/app-expo/README.md.example +1 -1
  55. package/templates/app-expo/app/index.tsx.example +1 -1
  56. package/templates/app-next/src/locales/home_en.json.example +6 -6
  57. package/templates/app-vite/src/locales/home_en.json.example +6 -6
  58. package/templates/app-vite/src/pages/HomePage.tsx.example +8 -10
  59. package/templates/overlay-firebase/env.fragment.example +1 -1
  60. package/templates/overlay-firebase/env.fragment.expo.example +1 -1
  61. package/templates/overlay-firebase/env.fragment.nextjs.example +1 -1
  62. package/templates/overlay-supabase/env.fragment.example +1 -1
  63. package/templates/overlay-supabase/env.fragment.expo.example +1 -1
  64. package/templates/overlay-supabase/env.fragment.nextjs.example +1 -1
  65. package/templates/overlay-vercel/env.fragment.example +1 -1
  66. package/templates/overlay-vercel/env.fragment.nextjs.example +1 -1
  67. package/templates/root-consumer/AI.md.example +4 -3
  68. package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +21 -6
  69. package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +16 -179
  70. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +19 -21
  71. package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +14 -3
  72. package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
  73. package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +3 -3
  74. package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +19 -2
  75. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +35 -1
  76. package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +17 -12
  77. package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +32 -0
  78. package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +1 -1
  79. package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +19 -15
  80. package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +2 -2
  81. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +17 -12
  82. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +37 -16
  83. package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +18 -18
  84. package/templates/root-consumer/guides/dndev/advanced/COOKIE_REFERENCE.md.example +252 -252
  85. package/templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example +174 -174
  86. package/templates/root-consumer/guides/dndev/essences_reference.css.example +119 -2
  87. package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +14 -0
  88. package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +6 -0
  89. package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +14 -0
  90. package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +4 -5
  91. package/templates/root-consumer/guides/wai-way/page_patterns.md.example +2 -2
  92. package/dist/bin/commands/agent-setup.d.ts +0 -6
  93. package/dist/bin/commands/agent-setup.d.ts.map +0 -1
  94. package/dist/bin/commands/agent-setup.js.map +0 -1
  95. package/dist/bin/commands/build.d.ts +0 -11
  96. package/dist/bin/commands/build.d.ts.map +0 -1
  97. package/dist/bin/commands/build.js.map +0 -1
  98. package/dist/bin/commands/bump.d.ts +0 -11
  99. package/dist/bin/commands/bump.d.ts.map +0 -1
  100. package/dist/bin/commands/bump.js.map +0 -1
  101. package/dist/bin/commands/cacheout.d.ts +0 -11
  102. package/dist/bin/commands/cacheout.d.ts.map +0 -1
  103. package/dist/bin/commands/cacheout.js.map +0 -1
  104. package/dist/bin/commands/create-app.d.ts +0 -11
  105. package/dist/bin/commands/create-app.d.ts.map +0 -1
  106. package/dist/bin/commands/create-app.js.map +0 -1
  107. package/dist/bin/commands/create-project.d.ts +0 -11
  108. package/dist/bin/commands/create-project.d.ts.map +0 -1
  109. package/dist/bin/commands/create-project.js.map +0 -1
  110. package/dist/bin/commands/deploy.d.ts +0 -11
  111. package/dist/bin/commands/deploy.d.ts.map +0 -1
  112. package/dist/bin/commands/deploy.js.map +0 -1
  113. package/dist/bin/commands/dev.d.ts +0 -11
  114. package/dist/bin/commands/dev.d.ts.map +0 -1
  115. package/dist/bin/commands/dev.js.map +0 -1
  116. package/dist/bin/commands/doctor.d.ts +0 -6
  117. package/dist/bin/commands/doctor.d.ts.map +0 -1
  118. package/dist/bin/commands/doctor.js.map +0 -1
  119. package/dist/bin/commands/emu.d.ts +0 -11
  120. package/dist/bin/commands/emu.d.ts.map +0 -1
  121. package/dist/bin/commands/emu.js.map +0 -1
  122. package/dist/bin/commands/format.d.ts +0 -11
  123. package/dist/bin/commands/format.d.ts.map +0 -1
  124. package/dist/bin/commands/format.js.map +0 -1
  125. package/dist/bin/commands/make-admin.d.ts +0 -11
  126. package/dist/bin/commands/make-admin.d.ts.map +0 -1
  127. package/dist/bin/commands/make-admin.js.map +0 -1
  128. package/dist/bin/commands/preview.d.ts +0 -11
  129. package/dist/bin/commands/preview.d.ts.map +0 -1
  130. package/dist/bin/commands/preview.js.map +0 -1
  131. package/dist/bin/commands/setup.d.ts +0 -6
  132. package/dist/bin/commands/setup.d.ts.map +0 -1
  133. package/dist/bin/commands/setup.js.map +0 -1
  134. package/dist/bin/commands/sync-secrets.d.ts +0 -11
  135. package/dist/bin/commands/sync-secrets.d.ts.map +0 -1
  136. package/dist/bin/commands/sync-secrets.js.map +0 -1
  137. package/dist/bin/commands/type-check.d.ts +0 -14
  138. package/dist/bin/commands/type-check.d.ts.map +0 -1
  139. package/dist/bin/commands/type-check.js.map +0 -1
  140. package/dist/bin/commands/wai.d.ts +0 -11
  141. package/dist/bin/commands/wai.d.ts.map +0 -1
  142. package/dist/bin/commands/wai.js.map +0 -1
  143. package/dist/index.d.ts +0 -8
  144. package/dist/index.d.ts.map +0 -1
  145. package/dist/index.js.map +0 -1
  146. package/templates/app-demo/src/components/ThemeToggle.tsx.example +0 -48
  147. package/templates/app-demo/src/pages/DetailPage.tsx.example +0 -103
  148. package/templates/app-demo/src/pages/FullPage.tsx.example +0 -142
  149. package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +0 -266
  150. package/templates/app-demo/src/pages/components/LayoutRoute.tsx.example +0 -20
@@ -13,7 +13,7 @@ import { Link, useNavigate, useParams } from 'react-router-dom'; // ❌ BREAKS F
13
13
 
14
14
  **✅ CORRECT:**
15
15
  ```tsx
16
- import { Link, useNavigate, useParams } from '@donotdev/ui/routing'; // ✅ Framework routing
16
+ import { Link, useNavigate, useParams } from '@donotdev/ui'; // ✅ Framework routing
17
17
  ```
18
18
 
19
19
  **Why?** The framework's routing components:
@@ -30,7 +30,7 @@ import { Link, useNavigate, useParams } from '@donotdev/ui/routing'; // ✅ Fram
30
30
  ### Components
31
31
 
32
32
  ```tsx
33
- import { Link, DnDevNavigationMenu } from '@donotdev/ui/routing';
33
+ import { Link, DnDevNavigationMenu } from '@donotdev/ui';
34
34
  ```
35
35
 
36
36
  **Link Component:**
@@ -55,7 +55,7 @@ import {
55
55
  useRouteParam,
56
56
  useSearchParams,
57
57
  useNavigationItems,
58
- } from '@donotdev/ui/routing';
58
+ } from '@donotdev/ui';
59
59
  ```
60
60
 
61
61
  ---
@@ -66,7 +66,7 @@ import {
66
66
 
67
67
  **✅ Use framework Link:**
68
68
  ```tsx
69
- import { Link } from '@donotdev/ui/routing';
69
+ import { Link } from '@donotdev/ui';
70
70
 
71
71
  function ProductCard({ product }) {
72
72
  return (
@@ -77,7 +77,7 @@ function ProductCard({ product }) {
77
77
 
78
78
  **✅ Use framework useNavigate:**
79
79
  ```tsx
80
- import { useNavigate } from '@donotdev/ui/routing';
80
+ import { useNavigate } from '@donotdev/ui';
81
81
 
82
82
  function ProductForm() {
83
83
  const navigate = useNavigate();
@@ -107,7 +107,7 @@ function ProductForm() {
107
107
 
108
108
  **✅ Use framework useRouteParam:**
109
109
  ```tsx
110
- import { useRouteParam } from '@donotdev/ui/routing';
110
+ import { useRouteParam } from '@donotdev/ui';
111
111
 
112
112
  function ProductPage() {
113
113
  const id = useRouteParam('id'); // ✅ Returns string | undefined
@@ -117,7 +117,7 @@ function ProductPage() {
117
117
 
118
118
  **✅ Or use framework useParams:**
119
119
  ```tsx
120
- import { useParams } from '@donotdev/ui/routing';
120
+ import { useParams } from '@donotdev/ui';
121
121
 
122
122
  function ProductPage() {
123
123
  const params = useParams();
@@ -136,7 +136,7 @@ import { useParams } from 'react-router-dom'; // ❌ Type issues, breaks framewo
136
136
 
137
137
  **✅ Use DnDevNavigationMenu (auto-fetches routes):**
138
138
  ```tsx
139
- import { DnDevNavigationMenu, DISPLAY } from '@donotdev/ui/routing';
139
+ import { DnDevNavigationMenu, DISPLAY } from '@donotdev/ui';
140
140
 
141
141
  function Sidebar() {
142
142
  return (
@@ -151,7 +151,7 @@ function Sidebar() {
151
151
 
152
152
  **✅ Or use useNavigationItems for custom sidebar:**
153
153
  ```tsx
154
- import { Link, useNavigationItems } from '@donotdev/ui/routing';
154
+ import { Link, useNavigationItems } from '@donotdev/ui';
155
155
 
156
156
  function CustomSidebar() {
157
157
  const menuItems = useNavigationItems(); // ✅ Auth-filtered routes
@@ -194,7 +194,7 @@ function Sidebar() {
194
194
 
195
195
  **✅ Use framework useNavigate:**
196
196
  ```tsx
197
- import { useNavigate } from '@donotdev/ui/routing';
197
+ import { useNavigate } from '@donotdev/ui';
198
198
 
199
199
  function LoginForm() {
200
200
  const navigate = useNavigate();
@@ -228,7 +228,7 @@ navigate('/products', {
228
228
 
229
229
  **✅ Use framework useSearchParams (read-only, returns URLSearchParams directly):**
230
230
  ```tsx
231
- import { useSearchParams } from '@donotdev/ui/routing';
231
+ import { useSearchParams } from '@donotdev/ui';
232
232
 
233
233
  function ProductList() {
234
234
  const searchParams = useSearchParams();
@@ -240,7 +240,7 @@ function ProductList() {
240
240
 
241
241
  **✅ Or use useQueryParams helper:**
242
242
  ```tsx
243
- import { useQueryParams } from '@donotdev/ui/routing';
243
+ import { useQueryParams } from '@donotdev/ui';
244
244
 
245
245
  function ProductList() {
246
246
  const { page, sort } = useQueryParams({ page: '1', sort: 'name' });
@@ -254,7 +254,7 @@ function ProductList() {
254
254
 
255
255
  **✅ Use framework useMatch:**
256
256
  ```tsx
257
- import { useMatch } from '@donotdev/ui/routing';
257
+ import { useMatch } from '@donotdev/ui';
258
258
 
259
259
  function NavigationItem({ path }) {
260
260
  const isActive = useMatch(path);
@@ -360,7 +360,7 @@ import { Link, useNavigate } from 'react-router-dom';
360
360
  **Fix:**
361
361
  ```tsx
362
362
  // ✅ CORRECT
363
- import { Link, useNavigate } from '@donotdev/ui/routing';
363
+ import { Link, useNavigate } from '@donotdev/ui';
364
364
  ```
365
365
 
366
366
  ---
@@ -416,7 +416,7 @@ function Sidebar() {
416
416
  **Fix:**
417
417
  ```tsx
418
418
  // ✅ CORRECT
419
- import { DnDevNavigationMenu } from '@donotdev/ui/routing';
419
+ import { DnDevNavigationMenu } from '@donotdev/ui';
420
420
 
421
421
  function Sidebar() {
422
422
  return <DnDevNavigationMenu vertical />; // Auto-fetches routes
@@ -437,7 +437,7 @@ import { Link } from 'react-router-dom';
437
437
  **Fix:**
438
438
  ```tsx
439
439
  // ✅ CORRECT
440
- import { Link } from '@donotdev/ui/routing';
440
+ import { Link } from '@donotdev/ui';
441
441
 
442
442
  <Link path="/products" label="Products" />
443
443
  ```
@@ -459,7 +459,7 @@ import {
459
459
  useSearchParams,
460
460
  useNavigationItems,
461
461
  DnDevNavigationMenu,
462
- } from '@donotdev/ui/routing';
462
+ } from '@donotdev/ui';
463
463
  ```
464
464
 
465
465
  ### Common Patterns
@@ -489,7 +489,7 @@ const menuItems = useNavigationItems(); // Auth-filtered routes
489
489
 
490
490
  ## Summary
491
491
 
492
- 1. **Always use `@donotdev/ui/routing`** - never `react-router-dom`
492
+ 1. **Always import from `@donotdev/ui`** never `react-router-dom`
493
493
  2. **Use `DnDevNavigationMenu`** for sidebars/headers
494
494
  3. **Use `useNavigationItems()`** for custom navigation
495
495
  4. **Don't use `<Outlet />` manually** - framework handles it
@@ -1,252 +1,252 @@
1
- # Cookie Reference Guide
2
-
3
- **For Framework Consumers: GDPR Compliance**
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- This guide maps DoNotDev framework features to the cookies they set, helping you configure your cookie consent banner and privacy policy correctly.
10
-
11
- ---
12
-
13
- ## Cookie Categories (GDPR)
14
-
15
- - **Necessary** - Essential for service to function (no consent required per GDPR Article 6(1)(f))
16
- - **Functional** - Enhances experience (requires consent per GDPR Article 6(1)(a))
17
- - **Analytics** - Usage tracking (requires consent)
18
- - **Marketing** - Advertising/tracking (requires consent)
19
-
20
- ---
21
-
22
- ## Feature Cookie Mapping
23
-
24
- ### Authentication (`@donotdev/auth`)
25
-
26
- **Provider: Firebase Authentication**
27
-
28
- | Cookie Name | Category | Purpose | Expires |
29
- |------------|----------|---------|---------|
30
- | `__session` | Necessary | Session authentication token | Session |
31
- | `__Secure-*` | Necessary | Security tokens (HTTPS only) | Varies |
32
-
33
- **GDPR Status:** Necessary - Authentication is essential for account-based services.
34
-
35
- **Environment Variables:**
36
- ```bash
37
- VITE_FIREBASE_API_KEY=your-key
38
- VITE_FIREBASE_PROJECT_ID=your-project
39
- ```
40
-
41
- ---
42
-
43
- ### OAuth (`@donotdev/oauth`)
44
-
45
- **Providers: Google, GitHub OAuth**
46
-
47
- | Cookie Name | Category | Purpose | Expires |
48
- |------------|----------|---------|---------|
49
- | OAuth state cookies | Necessary | CSRF protection during OAuth flow | Session |
50
- | Provider session cookies | Necessary | Maintain OAuth session | Per provider |
51
-
52
- **GDPR Status:** Necessary - Part of authentication flow.
53
-
54
- **Environment Variables:**
55
- ```bash
56
- VITE_AUTH_PARTNERS=google,github
57
- ```
58
-
59
- **Third-party cookies set by OAuth providers:**
60
- - **Google:** `SID`, `HSID`, `SSID`, `APISID`, `SAPISID` (necessary for OAuth)
61
- - **GitHub:** `user_session`, `logged_in` (necessary for OAuth)
62
-
63
- ---
64
-
65
- ### Billing (`@donotdev/billing`)
66
-
67
- **Provider: Stripe**
68
-
69
- | Cookie Name | Category | Purpose | Expires |
70
- |------------|----------|---------|---------|
71
- | `__stripe_mid` | Necessary | Fraud prevention | 1 year |
72
- | `__stripe_sid` | Necessary | Checkout session | 30 minutes |
73
-
74
- **GDPR Status:** Necessary - Required for payment processing and fraud prevention.
75
-
76
- **Environment Variables:**
77
- ```bash
78
- VITE_STRIPE_PUBLIC_KEY=pk_live_xxx
79
- ```
80
-
81
- **Stripe Privacy:** Stripe sets these cookies when Checkout or Customer Portal is opened. They're classified as necessary for PCI compliance and fraud prevention.
82
-
83
- ---
84
-
85
- ### Framework Core Cookies
86
-
87
- **Set by `@donotdev/core`**
88
-
89
- | Cookie Name | Category | Purpose | Expires |
90
- |------------|----------|---------|---------|
91
- | `dndev-cookie-consent` | Necessary | Stores user's cookie preferences | 365 days |
92
- | `dndev-theme` | Necessary | Remembers dark/light mode preference | 365 days |
93
- | `dndev-lang` | Necessary | Remembers language preference | 365 days |
94
-
95
- **GDPR Status:** Necessary (essential for UX, no tracking, purely local preferences)
96
-
97
- ---
98
-
99
- ## Analytics & Marketing (Optional)
100
-
101
- These are NOT included in the framework but commonly added by consumers:
102
-
103
- ### Google Analytics
104
-
105
- | Cookie Name | Category | Purpose | Expires |
106
- |------------|----------|---------|---------|
107
- | `_ga` | Analytics | Distinguish users | 2 years |
108
- | `_gid` | Analytics | Distinguish users | 24 hours |
109
- | `_gat` | Analytics | Throttle requests | 1 minute |
110
-
111
- **GDPR Status:** Analytics - Requires explicit consent.
112
-
113
- **Setup:** Consumer must add Google Analytics script and obtain consent.
114
-
115
- ### Facebook Pixel
116
-
117
- | Cookie Name | Category | Purpose | Expires |
118
- |------------|----------|---------|---------|
119
- | `_fbp` | Marketing | Track conversions | 90 days |
120
-
121
- **GDPR Status:** Marketing - Requires explicit consent.
122
-
123
- ---
124
-
125
- ## Cookie Banner Configuration
126
-
127
- ### Minimal Setup (Auth + Billing + Theme/Lang)
128
-
129
- If your app only uses auth, billing, theme, and language preferences, all cookies are **necessary**:
130
-
131
- ```typescript
132
- // src/config/app.ts
133
- export const appConfig: AppConfig = {
134
- features: {
135
- // No config needed - all framework cookies are necessary
136
- },
137
- };
138
- ```
139
-
140
- **Result:** No cookie banner shown - all cookies are GDPR-compliant without consent.
141
-
142
- ### With Analytics/Marketing
143
-
144
- If you add Google Analytics or marketing pixels:
145
-
146
- ```typescript
147
- // src/config/app.ts
148
- export const appConfig: AppConfig = {
149
- features: {
150
- requiredCookies: ['necessary', 'functional', 'analytics'],
151
- },
152
- };
153
- ```
154
-
155
- **Result:** Cookie banner shows all categories, users must consent to analytics.
156
-
157
- ---
158
-
159
- ## Privacy Policy Template
160
-
161
- **Example text for your privacy policy:**
162
-
163
- ```markdown
164
- ## Cookies We Use
165
-
166
- ### Essential Cookies (Always Active)
167
-
168
- We use essential cookies that are necessary for our service to function:
169
-
170
- - **Authentication** (Firebase): Maintains your login session
171
- - **Payment Processing** (Stripe): Enables secure payments and fraud prevention
172
- - **Cookie Preferences**: Remembers your cookie consent choices
173
-
174
- These cookies are essential and cannot be disabled.
175
-
176
- ### Functional Cookies (Optional)
177
-
178
- With your consent, we use functional cookies to enhance your experience:
179
-
180
- - **Theme Preference**: Remembers your dark/light mode choice
181
- - **Language Preference**: Remembers your selected language
182
-
183
- You can disable these in cookie settings.
184
-
185
- ### Analytics Cookies (Optional) [If applicable]
186
-
187
- With your consent, we use Google Analytics to understand how visitors use our site.
188
- This helps us improve the user experience.
189
-
190
- You can disable these in cookie settings.
191
- ```
192
-
193
- ---
194
-
195
- ## Testing Cookie Compliance
196
-
197
- ### Check What Cookies Are Set
198
-
199
- ```javascript
200
- // Browser console
201
- document.cookie
202
- ```
203
-
204
- ### Verify Consent Before Analytics
205
-
206
- ```typescript
207
- import { useConsent } from '@donotdev/core';
208
-
209
- function MyAnalytics() {
210
- const hasAnalyticsConsent = useConsent('hasCategory')('analytics');
211
-
212
- useEffect(() => {
213
- if (hasAnalyticsConsent) {
214
- // Initialize Google Analytics
215
- }
216
- }, [hasAnalyticsConsent]);
217
- }
218
- ```
219
-
220
- ---
221
-
222
- ## GDPR Compliance Checklist
223
-
224
- - [ ] List all cookies in privacy policy with categories
225
- - [ ] Only set analytics/marketing cookies after consent
226
- - [ ] Provide cookie settings link in footer
227
- - [ ] Allow users to withdraw consent
228
- - [ ] Store consent for 12 months maximum
229
- - [ ] Don't block essential features if functional cookies declined
230
-
231
- **Framework handles:** Consent storage, banner UI, category management
232
-
233
- **You handle:** Privacy policy text, analytics integration, marketing pixels
234
-
235
- ---
236
-
237
- ## Quick Reference
238
-
239
- | Feature | Cookies | Category | Consent Required? |
240
- |---------|---------|----------|-------------------|
241
- | Auth | `__session`, `__Secure-*` | Necessary | No |
242
- | OAuth | Provider session cookies | Necessary | No |
243
- | Billing | `__stripe_mid`, `__stripe_sid` | Necessary | No |
244
- | Theme | `dndev-theme` | Necessary | No |
245
- | Language | `dndev-lang` | Necessary | No |
246
- | Consent | `dndev-cookie-consent` | Necessary | No |
247
- | Analytics | `_ga`, `_gid` | Analytics | Yes |
248
- | Marketing | `_fbp`, etc. | Marketing | Yes |
249
-
250
- ---
251
-
252
- **Need help?** Check your browser DevTools → Application → Cookies to see exactly what's being set.
1
+ # Cookie Reference Guide
2
+
3
+ **For Framework Consumers: GDPR Compliance**
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ This guide maps DoNotDev framework features to the cookies they set, helping you configure your cookie consent banner and privacy policy correctly.
10
+
11
+ ---
12
+
13
+ ## Cookie Categories (GDPR)
14
+
15
+ - **Necessary** - Essential for service to function (no consent required per GDPR Article 6(1)(f))
16
+ - **Functional** - Enhances experience (requires consent per GDPR Article 6(1)(a))
17
+ - **Analytics** - Usage tracking (requires consent)
18
+ - **Marketing** - Advertising/tracking (requires consent)
19
+
20
+ ---
21
+
22
+ ## Feature Cookie Mapping
23
+
24
+ ### Authentication (`@donotdev/auth`)
25
+
26
+ **Provider: Firebase Authentication**
27
+
28
+ | Cookie Name | Category | Purpose | Expires |
29
+ |------------|----------|---------|---------|
30
+ | `__session` | Necessary | Session authentication token | Session |
31
+ | `__Secure-*` | Necessary | Security tokens (HTTPS only) | Varies |
32
+
33
+ **GDPR Status:** Necessary - Authentication is essential for account-based services.
34
+
35
+ **Environment Variables:**
36
+ ```bash
37
+ VITE_FIREBASE_API_KEY=your-key
38
+ VITE_FIREBASE_PROJECT_ID=your-project
39
+ ```
40
+
41
+ ---
42
+
43
+ ### OAuth (`@donotdev/oauth`)
44
+
45
+ **Providers: Google, GitHub OAuth**
46
+
47
+ | Cookie Name | Category | Purpose | Expires |
48
+ |------------|----------|---------|---------|
49
+ | OAuth state cookies | Necessary | CSRF protection during OAuth flow | Session |
50
+ | Provider session cookies | Necessary | Maintain OAuth session | Per provider |
51
+
52
+ **GDPR Status:** Necessary - Part of authentication flow.
53
+
54
+ **Environment Variables:**
55
+ ```bash
56
+ VITE_AUTH_PARTNERS=google,github
57
+ ```
58
+
59
+ **Third-party cookies set by OAuth providers:**
60
+ - **Google:** `SID`, `HSID`, `SSID`, `APISID`, `SAPISID` (necessary for OAuth)
61
+ - **GitHub:** `user_session`, `logged_in` (necessary for OAuth)
62
+
63
+ ---
64
+
65
+ ### Billing (`@donotdev/billing`)
66
+
67
+ **Provider: Stripe**
68
+
69
+ | Cookie Name | Category | Purpose | Expires |
70
+ |------------|----------|---------|---------|
71
+ | `__stripe_mid` | Necessary | Fraud prevention | 1 year |
72
+ | `__stripe_sid` | Necessary | Checkout session | 30 minutes |
73
+
74
+ **GDPR Status:** Necessary - Required for payment processing and fraud prevention.
75
+
76
+ **Environment Variables:**
77
+ ```bash
78
+ VITE_STRIPE_PUBLIC_KEY=pk_live_xxx
79
+ ```
80
+
81
+ **Stripe Privacy:** Stripe sets these cookies when Checkout or Customer Portal is opened. They're classified as necessary for PCI compliance and fraud prevention.
82
+
83
+ ---
84
+
85
+ ### Framework Core Cookies
86
+
87
+ **Set by `@donotdev/core`**
88
+
89
+ | Cookie Name | Category | Purpose | Expires |
90
+ |------------|----------|---------|---------|
91
+ | `dndev-cookie-consent` | Necessary | Stores user's cookie preferences | 365 days |
92
+ | `dndev-theme` | Necessary | Remembers dark/light mode preference | 365 days |
93
+ | `dndev-lang` | Necessary | Remembers language preference | 365 days |
94
+
95
+ **GDPR Status:** Necessary (essential for UX, no tracking, purely local preferences)
96
+
97
+ ---
98
+
99
+ ## Analytics & Marketing (Optional)
100
+
101
+ These are NOT included in the framework but commonly added by consumers:
102
+
103
+ ### Google Analytics
104
+
105
+ | Cookie Name | Category | Purpose | Expires |
106
+ |------------|----------|---------|---------|
107
+ | `_ga` | Analytics | Distinguish users | 2 years |
108
+ | `_gid` | Analytics | Distinguish users | 24 hours |
109
+ | `_gat` | Analytics | Throttle requests | 1 minute |
110
+
111
+ **GDPR Status:** Analytics - Requires explicit consent.
112
+
113
+ **Setup:** Consumer must add Google Analytics script and obtain consent.
114
+
115
+ ### Facebook Pixel
116
+
117
+ | Cookie Name | Category | Purpose | Expires |
118
+ |------------|----------|---------|---------|
119
+ | `_fbp` | Marketing | Track conversions | 90 days |
120
+
121
+ **GDPR Status:** Marketing - Requires explicit consent.
122
+
123
+ ---
124
+
125
+ ## Cookie Banner Configuration
126
+
127
+ ### Minimal Setup (Auth + Billing + Theme/Lang)
128
+
129
+ If your app only uses auth, billing, theme, and language preferences, all cookies are **necessary**:
130
+
131
+ ```typescript
132
+ // src/config/app.ts
133
+ export const appConfig: AppConfig = {
134
+ features: {
135
+ // No config needed - all framework cookies are necessary
136
+ },
137
+ };
138
+ ```
139
+
140
+ **Result:** No cookie banner shown - all cookies are GDPR-compliant without consent.
141
+
142
+ ### With Analytics/Marketing
143
+
144
+ If you add Google Analytics or marketing pixels:
145
+
146
+ ```typescript
147
+ // src/config/app.ts
148
+ export const appConfig: AppConfig = {
149
+ features: {
150
+ requiredCookies: ['necessary', 'functional', 'analytics'],
151
+ },
152
+ };
153
+ ```
154
+
155
+ **Result:** Cookie banner shows all categories, users must consent to analytics.
156
+
157
+ ---
158
+
159
+ ## Privacy Policy Template
160
+
161
+ **Example text for your privacy policy:**
162
+
163
+ ```markdown
164
+ ## Cookies We Use
165
+
166
+ ### Essential Cookies (Always Active)
167
+
168
+ We use essential cookies that are necessary for our service to function:
169
+
170
+ - **Authentication** (Firebase): Maintains your login session
171
+ - **Payment Processing** (Stripe): Enables secure payments and fraud prevention
172
+ - **Cookie Preferences**: Remembers your cookie consent choices
173
+
174
+ These cookies are essential and cannot be disabled.
175
+
176
+ ### Functional Cookies (Optional)
177
+
178
+ With your consent, we use functional cookies to enhance your experience:
179
+
180
+ - **Theme Preference**: Remembers your dark/light mode choice
181
+ - **Language Preference**: Remembers your selected language
182
+
183
+ You can disable these in cookie settings.
184
+
185
+ ### Analytics Cookies (Optional) [If applicable]
186
+
187
+ With your consent, we use Google Analytics to understand how visitors use our site.
188
+ This helps us improve the user experience.
189
+
190
+ You can disable these in cookie settings.
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Testing Cookie Compliance
196
+
197
+ ### Check What Cookies Are Set
198
+
199
+ ```javascript
200
+ // Browser console
201
+ document.cookie
202
+ ```
203
+
204
+ ### Verify Consent Before Analytics
205
+
206
+ ```typescript
207
+ import { useConsent } from '@donotdev/core';
208
+
209
+ function MyAnalytics() {
210
+ const hasAnalyticsConsent = useConsent('hasCategory')('analytics');
211
+
212
+ useEffect(() => {
213
+ if (hasAnalyticsConsent) {
214
+ // Initialize Google Analytics
215
+ }
216
+ }, [hasAnalyticsConsent]);
217
+ }
218
+ ```
219
+
220
+ ---
221
+
222
+ ## GDPR Compliance Checklist
223
+
224
+ - [ ] List all cookies in privacy policy with categories
225
+ - [ ] Only set analytics/marketing cookies after consent
226
+ - [ ] Provide cookie settings link in footer
227
+ - [ ] Allow users to withdraw consent
228
+ - [ ] Store consent for 12 months maximum
229
+ - [ ] Don't block essential features if functional cookies declined
230
+
231
+ **Framework handles:** Consent storage, banner UI, category management
232
+
233
+ **You handle:** Privacy policy text, analytics integration, marketing pixels
234
+
235
+ ---
236
+
237
+ ## Quick Reference
238
+
239
+ | Feature | Cookies | Category | Consent Required? |
240
+ |---------|---------|----------|-------------------|
241
+ | Auth | `__session`, `__Secure-*` | Necessary | No |
242
+ | OAuth | Provider session cookies | Necessary | No |
243
+ | Billing | `__stripe_mid`, `__stripe_sid` | Necessary | No |
244
+ | Theme | `dndev-theme` | Necessary | No |
245
+ | Language | `dndev-lang` | Necessary | No |
246
+ | Consent | `dndev-cookie-consent` | Necessary | No |
247
+ | Analytics | `_ga`, `_gid` | Analytics | Yes |
248
+ | Marketing | `_fbp`, etc. | Marketing | Yes |
249
+
250
+ ---
251
+
252
+ **Need help?** Check your browser DevTools → Application → Cookies to see exactly what's being set.