@donotdev/cli 0.0.12 → 0.0.13
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/dependencies-matrix.json +30 -116
- package/dist/bin/commands/bump.js +33 -7
- package/dist/bin/commands/create-project.js +43 -7
- package/dist/bin/commands/deploy.js +7606 -17
- package/dist/bin/commands/firebase-setup.d.ts +6 -0
- package/dist/bin/commands/firebase-setup.d.ts.map +1 -0
- package/dist/bin/commands/firebase-setup.js +7 -0
- package/dist/bin/commands/firebase-setup.js.map +1 -0
- package/dist/bin/commands/staging.d.ts +11 -0
- package/dist/bin/commands/staging.d.ts.map +1 -0
- package/dist/bin/commands/staging.js +12 -0
- package/dist/bin/commands/staging.js.map +1 -0
- package/dist/bin/dndev.js +28 -3
- package/dist/bin/donotdev.js +28 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7671 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/app-demo/src/pages/DetailPage.tsx.example +1 -1
- package/templates/app-demo/src/pages/FullPage.tsx.example +3 -3
- package/templates/app-demo/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-demo/src/pages/components/ComponentRenderer.tsx.example +5 -5
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +3 -3
- package/templates/app-next/.env.example +2 -0
- package/templates/app-next/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-vite/.env.example +2 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +163 -73
- package/templates/functions-firebase/build.mjs.example +26 -10
- package/templates/functions-firebase/functions-firebase/build.mjs.example +26 -10
- package/templates/functions-firebase/functions.config.js.example +11 -15
- package/templates/github-consumer/.github/workflows/ci.yml.example +36 -0
- package/templates/root-consumer/.claude/agents/architect.md.example +2 -2
- package/templates/root-consumer/.claude/agents/builder.md.example +2 -2
- package/templates/root-consumer/.claude/agents/coder.md.example +2 -2
- package/templates/root-consumer/.claude/agents/extractor.md.example +2 -3
- package/templates/root-consumer/.claude/agents/polisher.md.example +67 -291
- package/templates/root-consumer/.claude/agents/prompt-engineer.md.example +4 -4
- package/templates/root-consumer/.claude/commands/build.md.example +2 -2
- package/templates/root-consumer/.claude/commands/polish.md.example +65 -81
- package/templates/root-consumer/.env.example +13 -13
- package/templates/root-consumer/.gemini/settings.json.example +9 -0
- package/templates/root-consumer/.gitignore.example +3 -1
- package/templates/root-consumer/AI.md.example +139 -0
- package/templates/root-consumer/CLAUDE.md.example +13 -104
- package/templates/root-consumer/README.md.example +81 -255
- package/templates/root-consumer/entities/Contact.ts.example +126 -0
- package/templates/root-consumer/entities/index.ts.example +6 -3
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +41 -342
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +2 -1
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +144 -9
- package/templates/root-consumer/guides/dndev/INDEX.md.example +9 -0
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +13 -16
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +263 -0
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +1 -1
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +168 -0
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +5 -12
- package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +184 -0
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +134 -69
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +66 -44
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +18 -1
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +1 -0
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +2 -1
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +2 -1
- package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +180 -108
- package/templates/root-consumer/guides/wai-way/context_map.json.example +8 -7
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +4 -4
|
@@ -2,294 +2,120 @@
|
|
|
2
2
|
|
|
3
3
|
**Built with [DoNotDev Framework](https://donotdev.com)**
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
**Start the app first — the homepage walks you through everything:**
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
# Install dependencies
|
|
9
10
|
bun install
|
|
10
|
-
|
|
11
|
-
# Start development server
|
|
12
|
-
bun run dev
|
|
13
|
-
|
|
14
|
-
# Build for production
|
|
15
|
-
bun run build
|
|
11
|
+
bun dev
|
|
16
12
|
```
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
Open the app and follow the setup steps on the homepage (Git, Firebase, Stripe, etc.).
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
## Environment Variables
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
- ✅ **Vite** - Lightning-fast development
|
|
24
|
-
- ✅ **TypeScript** - Type-safe throughout
|
|
25
|
-
- ✅ **Firebase** - Authentication & database ready
|
|
26
|
-
- ✅ **Stripe** - Billing integration ready (optional)
|
|
27
|
-
- ✅ **i18n** - Multi-language support (8 languages)
|
|
28
|
-
- ✅ **Themes** - Dark mode & custom themes
|
|
29
|
-
|
|
30
|
-
## 📁 Project Structure
|
|
18
|
+
**Each app has its own `.env` file.** Vite loads from the app directory only.
|
|
31
19
|
|
|
32
20
|
```
|
|
33
21
|
{{projectName}}/
|
|
34
|
-
├──
|
|
35
|
-
|
|
36
|
-
│
|
|
37
|
-
│
|
|
38
|
-
│
|
|
39
|
-
│
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
│ └── locales/ # Translation files
|
|
44
|
-
├── CLAUDE.md # Guide for AI agents
|
|
45
|
-
└── package.json
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## 🔧 Configuration
|
|
49
|
-
|
|
50
|
-
### License Key
|
|
51
|
-
|
|
52
|
-
This project uses `@donotdev` packages from npm. To remove the watermark, add your license key:
|
|
53
|
-
|
|
54
|
-
1. Get your license key from [donotdev.com/pricing](https://donotdev.com/pricing)
|
|
55
|
-
2. Add to `.env` file:
|
|
56
|
-
```env
|
|
57
|
-
VITE_DONOTDEV_LICENSE_KEY=dndev_your_key_here
|
|
58
|
-
```
|
|
59
|
-
Or for Next.js:
|
|
60
|
-
```env
|
|
61
|
-
NEXT_PUBLIC_DONOTDEV_LICENSE_KEY=dndev_your_key_here
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Environment Variables
|
|
65
|
-
|
|
66
|
-
1. Copy `.env.example` to `.env`:
|
|
67
|
-
```bash
|
|
68
|
-
cp .env.example .env
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
2. Update the values:
|
|
72
|
-
```env
|
|
73
|
-
VITE_FIREBASE_API_KEY=your-api-key
|
|
74
|
-
VITE_FIREBASE_PROJECT_ID=your-project-id
|
|
75
|
-
VITE_FIREBASE_AUTH_DOMAIN=your-auth-domain
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Features Configuration
|
|
79
|
-
|
|
80
|
-
Edit `vite.config.ts` to enable/disable features:
|
|
81
|
-
|
|
82
|
-
```typescript
|
|
83
|
-
export default defineConfig({
|
|
84
|
-
plugins: [
|
|
85
|
-
doNotDevPlugin({
|
|
86
|
-
features: {
|
|
87
|
-
enabled: ['auth', 'billing', 'oauth'],
|
|
88
|
-
},
|
|
89
|
-
}),
|
|
90
|
-
],
|
|
91
|
-
});
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## 🎨 Customization
|
|
95
|
-
|
|
96
|
-
### Adding Your Logo
|
|
97
|
-
|
|
98
|
-
Add your `logo.svg` to `public/`:
|
|
99
|
-
|
|
100
|
-
- Framework will prompt during build if missing: "Do you want us to provide one from the framework?"
|
|
101
|
-
- Or manually copy from `node_modules/@donotdev/ui/assets/logo.svg`
|
|
102
|
-
- Framework automatically generates favicon, app icons, and PWA assets from your logo
|
|
103
|
-
|
|
104
|
-
### Add a New Page
|
|
105
|
-
|
|
106
|
-
Create a file in `src/pages/`:
|
|
107
|
-
|
|
108
|
-
```tsx
|
|
109
|
-
// src/pages/AboutPage.tsx
|
|
110
|
-
import { PageContainer } from '@donotdev/ui';
|
|
111
|
-
import { Info } from 'lucide-react';
|
|
112
|
-
import type { PageMeta } from '@donotdev/core';
|
|
113
|
-
|
|
114
|
-
export const meta: PageMeta = {
|
|
115
|
-
namespace: 'about',
|
|
116
|
-
icon: <Info />,
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export default function AboutPage() {
|
|
120
|
-
return (
|
|
121
|
-
<PageContainer variant="standard">
|
|
122
|
-
<h1>About Us</h1>
|
|
123
|
-
</PageContainer>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Route auto-discovered as `/about` ✨
|
|
129
|
-
|
|
130
|
-
### Add Translations
|
|
131
|
-
|
|
132
|
-
Create/edit `public/assets/locales/about_en.json`:
|
|
133
|
-
|
|
134
|
-
```json
|
|
135
|
-
{
|
|
136
|
-
"title": "About Us",
|
|
137
|
-
"description": "Learn more about our mission"
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Add Custom Theme
|
|
142
|
-
|
|
143
|
-
Edit `src/themes.css`:
|
|
144
|
-
|
|
145
|
-
```css
|
|
146
|
-
.ocean {
|
|
147
|
-
--theme-icon: 'Waves';
|
|
148
|
-
--theme-label: 'Ocean';
|
|
149
|
-
--primary: #0ea5e9;
|
|
150
|
-
--background: #0a1929;
|
|
151
|
-
}
|
|
22
|
+
├── .env.example ← NOT loaded by Vite (reference only)
|
|
23
|
+
├── apps/
|
|
24
|
+
│ └── my-app/
|
|
25
|
+
│ ├── .env ← Vite reads THIS one
|
|
26
|
+
│ ├── .env.local ← Overrides .env (gitignored)
|
|
27
|
+
│ ├── .env.production ← Production overrides
|
|
28
|
+
│ └── .env.staging ← Staging overrides (used by dndev staging)
|
|
29
|
+
└── functions/
|
|
30
|
+
└── .env ← Server-side secrets (Stripe, OAuth, etc.)
|
|
152
31
|
```
|
|
153
32
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
Enable Firebase Auth:
|
|
157
|
-
|
|
158
|
-
1. Set up Firebase project
|
|
159
|
-
2. Enable authentication methods
|
|
160
|
-
3. Update `.env` with Firebase credentials
|
|
161
|
-
4. Use in your pages:
|
|
162
|
-
|
|
163
|
-
```tsx
|
|
164
|
-
import { useAuth } from '@donotdev/auth';
|
|
165
|
-
|
|
166
|
-
export default function ProfilePage() {
|
|
167
|
-
const { user, signOut } = useAuth();
|
|
168
|
-
return <div>Hello, {user?.displayName}!</div>;
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
## 💳 Billing (Optional)
|
|
173
|
-
|
|
174
|
-
Enable Stripe:
|
|
175
|
-
|
|
176
|
-
1. Create Stripe account
|
|
177
|
-
2. Add Stripe keys to `.env`
|
|
178
|
-
3. Enable in `vite.config.ts`
|
|
179
|
-
4. Use in your pages:
|
|
180
|
-
|
|
181
|
-
```tsx
|
|
182
|
-
import { useStripeBilling } from '@donotdev/billing';
|
|
183
|
-
|
|
184
|
-
export default function PricingPage() {
|
|
185
|
-
const { createCheckoutSession } = useStripeBilling();
|
|
186
|
-
return <button onClick={() => createCheckoutSession('pro')}>
|
|
187
|
-
Upgrade to Pro
|
|
188
|
-
</button>;
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
## 🚢 Deployment
|
|
193
|
-
|
|
194
|
-
### Firebase Hosting
|
|
33
|
+
**To set up:** Copy `.env.example` to `.env` in your app directory and fill in the values.
|
|
195
34
|
|
|
196
35
|
```bash
|
|
197
|
-
|
|
198
|
-
npm install -g firebase-tools
|
|
199
|
-
|
|
200
|
-
# Login and init
|
|
201
|
-
firebase login
|
|
202
|
-
firebase init hosting
|
|
203
|
-
|
|
204
|
-
# Deploy
|
|
205
|
-
bun run build
|
|
206
|
-
firebase deploy
|
|
36
|
+
cp apps/my-app/.env.example apps/my-app/.env
|
|
207
37
|
```
|
|
208
38
|
|
|
209
|
-
|
|
39
|
+
## CLI Commands
|
|
210
40
|
|
|
211
41
|
```bash
|
|
212
|
-
#
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
42
|
+
# Development
|
|
43
|
+
bun dev # Start dev server
|
|
44
|
+
dndev emu start # Start Firebase emulators (Auth, Firestore, Functions)
|
|
45
|
+
|
|
46
|
+
# Deployment
|
|
47
|
+
dndev deploy # Deploy to Firebase (hosting + functions + rules)
|
|
48
|
+
dndev staging # Deploy to staging environment
|
|
49
|
+
dndev sync-secrets # Push functions/.env secrets to Firebase Secret Manager
|
|
50
|
+
|
|
51
|
+
# Quality
|
|
52
|
+
bun run type-check # TypeScript validation
|
|
53
|
+
bun test # Run tests
|
|
54
|
+
bun run build # Build for production
|
|
217
55
|
```
|
|
218
56
|
|
|
219
|
-
##
|
|
220
|
-
|
|
221
|
-
This project includes `CLAUDE.md` - a guide for AI agents like Claude, ChatGPT, etc.
|
|
57
|
+
## Project Structure
|
|
222
58
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
### Build Errors
|
|
243
|
-
|
|
244
|
-
```bash
|
|
245
|
-
# Clear cache and reinstall
|
|
246
|
-
rm -rf node_modules bun.lock
|
|
247
|
-
bun install
|
|
59
|
+
```
|
|
60
|
+
{{projectName}}/
|
|
61
|
+
├── apps/
|
|
62
|
+
│ └── my-app/
|
|
63
|
+
│ ├── src/
|
|
64
|
+
│ │ ├── pages/ # Auto-discovered routes (*Page.tsx)
|
|
65
|
+
│ │ ├── config/ # App config (app.ts, legal.ts)
|
|
66
|
+
│ │ └── locales/ # Translations (optional)
|
|
67
|
+
│ ├── .env # App environment variables
|
|
68
|
+
│ └── vite.config.ts # Vite config
|
|
69
|
+
├── entities/ # Entity definitions (shared across apps)
|
|
70
|
+
├── functions/ # Firebase Cloud Functions
|
|
71
|
+
│ └── .env # Server-side secrets
|
|
72
|
+
├── guides/ # WAI-WAY blueprints + framework guides
|
|
73
|
+
├── AI.md # AI agent instructions
|
|
74
|
+
├── CLAUDE.md # Claude-specific instructions
|
|
75
|
+
├── firebase.json # Firebase config
|
|
76
|
+
├── firestore.rules # Firestore security rules (generated by Phase 4)
|
|
77
|
+
└── .firebaserc # Firebase project aliases
|
|
248
78
|
```
|
|
249
79
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
- Verify `.env` has correct Firebase credentials
|
|
253
|
-
- Check Firebase console for project status
|
|
254
|
-
- Ensure authentication is enabled
|
|
255
|
-
|
|
256
|
-
### Hot Reload Not Working
|
|
257
|
-
|
|
258
|
-
- Check Vite config port (default: 5173)
|
|
259
|
-
- Ensure no other process is using the port
|
|
80
|
+
## Building With AI
|
|
260
81
|
|
|
261
|
-
|
|
82
|
+
This project is configured for AI-assisted development via WAI-WAY:
|
|
262
83
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
bun run preview # Preview production build
|
|
267
|
-
bun run lint # Lint code
|
|
268
|
-
bun run type-check # TypeScript validation
|
|
269
|
-
dndev format # Format code with Prettier
|
|
270
|
-
```
|
|
84
|
+
1. Open in **Cursor**, **Claude Code**, **Windsurf**, or **AntiGravity**
|
|
85
|
+
2. The AI reads `AI.md` automatically and follows the WAI-WAY protocol
|
|
86
|
+
3. MCP tools are pre-configured — the AI looks up real TypeScript types instead of guessing
|
|
271
87
|
|
|
272
|
-
|
|
88
|
+
**The 5 phases:**
|
|
89
|
+
- Phase 0: Brainstorm — describe your app, produce a validated spec
|
|
90
|
+
- Phase 1: Scaffold — create all pages and routes from spec
|
|
91
|
+
- Phase 2: Entities — define data models with fields, access rules, visibility
|
|
92
|
+
- Phase 3: Compose — build pages with framework components
|
|
93
|
+
- Phase 4: Configure — generate tests, firestore rules, CI/CD
|
|
273
94
|
|
|
274
|
-
|
|
95
|
+
Read `guides/wai-way/WAI_WAY_CLI.md` for the full workflow.
|
|
275
96
|
|
|
276
|
-
##
|
|
97
|
+
## Key Files
|
|
277
98
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
99
|
+
| File | Purpose |
|
|
100
|
+
|------|---------|
|
|
101
|
+
| `entities/*.ts` | Data model definitions — CRUD, forms, lists auto-generated |
|
|
102
|
+
| `src/pages/*Page.tsx` | Pages — auto-discovered as routes by filename |
|
|
103
|
+
| `src/config/app.ts` | App name, preset, features |
|
|
104
|
+
| `src/config/legal.ts` | Company info, legal compliance |
|
|
105
|
+
| `guides/dndev/` | Framework setup guides (Auth, CRUD, Billing, etc.) |
|
|
106
|
+
| `guides/wai-way/` | WAI-WAY blueprints and agent personas |
|
|
284
107
|
|
|
285
|
-
##
|
|
108
|
+
## License Key
|
|
286
109
|
|
|
287
|
-
|
|
110
|
+
Add your license key to your **app's** `.env` (not the root):
|
|
288
111
|
|
|
289
|
-
|
|
112
|
+
```env
|
|
113
|
+
# apps/my-app/.env
|
|
114
|
+
VITE_DONOTDEV_LICENSE_KEY=dndev_your_key_here
|
|
115
|
+
```
|
|
290
116
|
|
|
291
|
-
|
|
117
|
+
Get your key from [donotdev.com/pricing](https://donotdev.com/pricing).
|
|
292
118
|
|
|
293
119
|
---
|
|
294
120
|
|
|
295
|
-
**Need help?** Check
|
|
121
|
+
**Need help?** Check the homepage setup guide or read `guides/dndev/` for detailed instructions.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Contact Entity — Guest-Created, Admin-Managed
|
|
3
|
+
*
|
|
4
|
+
* This entity demonstrates the PUBLIC FORM pattern:
|
|
5
|
+
* - Guests (unauthenticated) can CREATE (contact form submission)
|
|
6
|
+
* - Only admins can READ, UPDATE, DELETE (CRM inbox)
|
|
7
|
+
*
|
|
8
|
+
* COMMON USE CASES:
|
|
9
|
+
* - Contact forms, inquiry forms, support requests
|
|
10
|
+
* - Lead capture, newsletter signups
|
|
11
|
+
* - Any public submission that admins manage
|
|
12
|
+
*
|
|
13
|
+
* FIRESTORE PATH: `contacts/{contactId}`
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { defineEntity } from '@donotdev/core';
|
|
17
|
+
|
|
18
|
+
export const contactEntity = defineEntity({
|
|
19
|
+
name: 'Contact',
|
|
20
|
+
collection: 'contacts',
|
|
21
|
+
listFields: ['name', 'email', 'subject', 'status'],
|
|
22
|
+
|
|
23
|
+
// Guest can create (public form), only admins manage
|
|
24
|
+
access: {
|
|
25
|
+
create: 'guest',
|
|
26
|
+
read: 'admin',
|
|
27
|
+
update: 'admin',
|
|
28
|
+
delete: 'admin',
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
fields: {
|
|
32
|
+
// Public form fields — guests fill these on submission
|
|
33
|
+
name: {
|
|
34
|
+
name: 'name',
|
|
35
|
+
label: 'name',
|
|
36
|
+
type: 'text',
|
|
37
|
+
visibility: 'admin',
|
|
38
|
+
editable: 'admin',
|
|
39
|
+
validation: { required: true },
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
email: {
|
|
43
|
+
name: 'email',
|
|
44
|
+
label: 'email',
|
|
45
|
+
type: 'email',
|
|
46
|
+
visibility: 'admin',
|
|
47
|
+
editable: 'admin',
|
|
48
|
+
validation: { required: true },
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
phone: {
|
|
52
|
+
name: 'phone',
|
|
53
|
+
label: 'phone',
|
|
54
|
+
type: 'tel',
|
|
55
|
+
visibility: 'admin',
|
|
56
|
+
editable: 'admin',
|
|
57
|
+
validation: { required: false },
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
subject: {
|
|
61
|
+
name: 'subject',
|
|
62
|
+
label: 'subject',
|
|
63
|
+
type: 'select',
|
|
64
|
+
visibility: 'admin',
|
|
65
|
+
editable: 'create-only',
|
|
66
|
+
validation: {
|
|
67
|
+
required: true,
|
|
68
|
+
options: [
|
|
69
|
+
{ value: 'general', label: 'subject.general' },
|
|
70
|
+
{ value: 'support', label: 'subject.support' },
|
|
71
|
+
{ value: 'sales', label: 'subject.sales' },
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
message: {
|
|
77
|
+
name: 'message',
|
|
78
|
+
label: 'message',
|
|
79
|
+
type: 'textarea',
|
|
80
|
+
visibility: 'admin',
|
|
81
|
+
editable: 'create-only',
|
|
82
|
+
validation: { required: true },
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
// GDPR consent — required on public forms in EU
|
|
86
|
+
gdprConsent: {
|
|
87
|
+
name: 'gdprConsent',
|
|
88
|
+
label: 'consent',
|
|
89
|
+
type: 'gdprConsent',
|
|
90
|
+
visibility: 'guest',
|
|
91
|
+
editable: 'create-only',
|
|
92
|
+
validation: { required: true },
|
|
93
|
+
options: {
|
|
94
|
+
fieldSpecific: {
|
|
95
|
+
privacyPolicyPath: '/legal/privacy',
|
|
96
|
+
termsPath: '/legal/terms',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
// Admin-only fields for managing submissions
|
|
102
|
+
notes: {
|
|
103
|
+
name: 'notes',
|
|
104
|
+
label: 'notes',
|
|
105
|
+
type: 'textarea',
|
|
106
|
+
visibility: 'admin',
|
|
107
|
+
editable: 'admin',
|
|
108
|
+
validation: { required: false },
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
status: {
|
|
112
|
+
name: 'status',
|
|
113
|
+
label: 'status',
|
|
114
|
+
type: 'select',
|
|
115
|
+
visibility: 'admin',
|
|
116
|
+
editable: 'admin',
|
|
117
|
+
validation: {
|
|
118
|
+
options: [
|
|
119
|
+
// Framework adds: draft, available, deleted
|
|
120
|
+
// Custom statuses:
|
|
121
|
+
{ value: 'responded', label: 'status.responded' },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
});
|
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
*
|
|
6
6
|
* USAGE:
|
|
7
7
|
* ```tsx
|
|
8
|
-
* import {
|
|
8
|
+
* import { contactEntity, productEntity } from '../entities';
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
//
|
|
13
|
-
|
|
12
|
+
// Scaffolded examples — rename or replace with your own entities:
|
|
13
|
+
export { contactEntity } from './Contact';
|
|
14
|
+
export { productEntity } from './ExampleEntity';
|
|
15
|
+
|
|
16
|
+
// Add your entities:
|
|
14
17
|
// export { customerEntity } from './Customer';
|
|
15
18
|
// export { orderEntity } from './Order';
|