@donotdev/core 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.
- package/functions/index.d.ts +1 -1448
- package/i18n/locales/lazy/crud_ar.json +34 -0
- package/i18n/locales/lazy/crud_de.json +34 -0
- package/i18n/locales/lazy/crud_en.json +34 -0
- package/i18n/locales/lazy/crud_es.json +34 -0
- package/i18n/locales/lazy/crud_fr.json +34 -0
- package/i18n/locales/lazy/crud_it.json +34 -0
- package/i18n/locales/lazy/crud_ja.json +34 -0
- package/i18n/locales/lazy/crud_ko.json +34 -0
- package/index.d.ts +757 -134
- package/index.js +46 -46
- package/next/index.d.ts +15 -777
- package/next/index.js +15 -15
- package/package.json +10 -10
- package/server.d.ts +712 -130
- package/server.js +1 -1
- package/vite/index.d.ts +17 -779
- package/vite/index.js +29 -29
package/next/index.d.ts
CHANGED
|
@@ -1,763 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
// packages/core/types/src/auth/constants.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// =============================================================================
|
|
9
|
-
// User Role Constants
|
|
10
|
-
// =============================================================================
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Standard user role names
|
|
14
|
-
* Apps can override these by providing their own role constants
|
|
15
|
-
*
|
|
16
|
-
* @version 0.0.1
|
|
17
|
-
* @since 0.0.1
|
|
18
|
-
* @author AMBROISE PARK Consulting
|
|
19
|
-
*/
|
|
20
|
-
declare const USER_ROLES = {
|
|
21
|
-
GUEST: 'guest',
|
|
22
|
-
USER: 'user',
|
|
23
|
-
ADMIN: 'admin',
|
|
24
|
-
SUPER: 'super',
|
|
25
|
-
} as const;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Type for user role names
|
|
29
|
-
* Apps can extend this with their own custom roles
|
|
30
|
-
*
|
|
31
|
-
* @version 0.0.1
|
|
32
|
-
* @since 0.0.1
|
|
33
|
-
* @author AMBROISE PARK Consulting
|
|
34
|
-
*/
|
|
35
|
-
type UserRole = (typeof USER_ROLES)[keyof typeof USER_ROLES] | string;
|
|
36
|
-
|
|
37
|
-
// =============================================================================
|
|
38
|
-
// Subscription Tier Constants
|
|
39
|
-
// =============================================================================
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Standard subscription tier names
|
|
43
|
-
* Apps can override these by providing their own tier constants
|
|
44
|
-
*
|
|
45
|
-
* @version 0.0.1
|
|
46
|
-
* @since 0.0.1
|
|
47
|
-
* @author AMBROISE PARK Consulting
|
|
48
|
-
*/
|
|
49
|
-
declare const SUBSCRIPTION_TIERS = {
|
|
50
|
-
FREE: 'free',
|
|
51
|
-
PRO: 'pro',
|
|
52
|
-
PREMIUM: 'premium',
|
|
53
|
-
} as const;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Type for subscription tier names
|
|
57
|
-
* Apps can extend this with their own custom tiers
|
|
58
|
-
*
|
|
59
|
-
* @version 0.0.1
|
|
60
|
-
* @since 0.0.1
|
|
61
|
-
* @author AMBROISE PARK Consulting
|
|
62
|
-
*/
|
|
63
|
-
type SubscriptionTier =
|
|
64
|
-
| (typeof SUBSCRIPTION_TIERS)[keyof typeof SUBSCRIPTION_TIERS]
|
|
65
|
-
| string;
|
|
66
|
-
|
|
67
|
-
// packages/core/types/src/common/index.ts
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// =============================================================================
|
|
72
|
-
// PLATFORM CONSTANTS
|
|
73
|
-
// =============================================================================
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Supported platform identifiers
|
|
77
|
-
* @constant
|
|
78
|
-
*/
|
|
79
|
-
declare const PLATFORMS = {
|
|
80
|
-
VITE: 'vite',
|
|
81
|
-
NEXTJS: 'nextjs',
|
|
82
|
-
UNKNOWN: 'unknown',
|
|
83
|
-
} as const;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Platform type derived from PLATFORMS constant
|
|
87
|
-
*/
|
|
88
|
-
type Platform = (typeof PLATFORMS)[keyof typeof PLATFORMS];
|
|
89
|
-
|
|
90
|
-
// =============================================================================
|
|
91
|
-
// ENVIRONMENT CONSTANTS
|
|
92
|
-
// =============================================================================
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Supported environment modes
|
|
96
|
-
* @constant
|
|
97
|
-
*/
|
|
98
|
-
declare const ENVIRONMENTS = {
|
|
99
|
-
DEVELOPMENT: 'development',
|
|
100
|
-
PRODUCTION: 'production',
|
|
101
|
-
TEST: 'test',
|
|
102
|
-
} as const;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Environment mode type derived from ENVIRONMENTS constant
|
|
106
|
-
*/
|
|
107
|
-
type EnvironmentMode = (typeof ENVIRONMENTS)[keyof typeof ENVIRONMENTS];
|
|
108
|
-
|
|
109
|
-
// =============================================================================
|
|
110
|
-
// CONTEXT CONSTANTS
|
|
111
|
-
// =============================================================================
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Supported execution contexts
|
|
115
|
-
* @constant
|
|
116
|
-
*/
|
|
117
|
-
declare const CONTEXTS = {
|
|
118
|
-
CLIENT: 'client',
|
|
119
|
-
SERVER: 'server',
|
|
120
|
-
BUILD: 'build',
|
|
121
|
-
} as const;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Context type derived from CONTEXTS constant
|
|
125
|
-
*/
|
|
126
|
-
type Context = (typeof CONTEXTS)[keyof typeof CONTEXTS];
|
|
127
|
-
|
|
128
|
-
// =============================================================================
|
|
129
|
-
// STORAGE CONSTANTS
|
|
130
|
-
// =============================================================================
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Supported storage backend types
|
|
134
|
-
* @constant
|
|
135
|
-
*/
|
|
136
|
-
declare const STORAGE_TYPES = {
|
|
137
|
-
LOCAL: 'localStorage',
|
|
138
|
-
SESSION: 'sessionStorage',
|
|
139
|
-
INDEXED_DB: 'indexedDB',
|
|
140
|
-
MEMORY: 'memory',
|
|
141
|
-
} as const;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Storage type derived from STORAGE_TYPES constant
|
|
145
|
-
*/
|
|
146
|
-
type StorageType = (typeof STORAGE_TYPES)[keyof typeof STORAGE_TYPES];
|
|
147
|
-
|
|
148
|
-
// =============================================================================
|
|
149
|
-
// PWA CONSTANTS
|
|
150
|
-
// =============================================================================
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* PWA display modes
|
|
154
|
-
* @constant
|
|
155
|
-
*/
|
|
156
|
-
declare const PWA_DISPLAY_MODES = {
|
|
157
|
-
STANDALONE: 'standalone',
|
|
158
|
-
FULLSCREEN: 'fullscreen',
|
|
159
|
-
MINIMAL_UI: 'minimal-ui',
|
|
160
|
-
BROWSER: 'browser',
|
|
161
|
-
} as const;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* PWA display mode type derived from PWA_DISPLAY_MODES constant
|
|
165
|
-
*/
|
|
166
|
-
type PWADisplayMode =
|
|
167
|
-
(typeof PWA_DISPLAY_MODES)[keyof typeof PWA_DISPLAY_MODES];
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* PWA asset types
|
|
171
|
-
* @constant
|
|
172
|
-
*/
|
|
173
|
-
declare const PWA_ASSET_TYPES = {
|
|
174
|
-
MANIFEST: 'manifest',
|
|
175
|
-
SERVICE_WORKER: 'service-worker',
|
|
176
|
-
ICON: 'icon',
|
|
177
|
-
} as const;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* PWA asset type derived from PWA_ASSET_TYPES constant
|
|
181
|
-
*/
|
|
182
|
-
type PWAAssetType =
|
|
183
|
-
(typeof PWA_ASSET_TYPES)[keyof typeof PWA_ASSET_TYPES];
|
|
184
|
-
|
|
185
|
-
// =============================================================================
|
|
186
|
-
// ROUTE DISCOVERY CONSTANTS
|
|
187
|
-
// =============================================================================
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Route discovery sources
|
|
191
|
-
* @constant
|
|
192
|
-
*/
|
|
193
|
-
declare const ROUTE_SOURCES = {
|
|
194
|
-
AUTO: 'auto-discovery',
|
|
195
|
-
MANUAL: 'manual',
|
|
196
|
-
HYBRID: 'hybrid',
|
|
197
|
-
} as const;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Route source type derived from ROUTE_SOURCES constant
|
|
201
|
-
*/
|
|
202
|
-
type RouteSource = (typeof ROUTE_SOURCES)[keyof typeof ROUTE_SOURCES];
|
|
203
|
-
|
|
204
|
-
// =============================================================================
|
|
205
|
-
// AUTHENTICATION TYPES
|
|
206
|
-
// =============================================================================
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Page-level authentication requirements
|
|
210
|
-
* @description Used in PageMeta and NavigationRoute for route-level auth
|
|
211
|
-
*/
|
|
212
|
-
type PageAuth =
|
|
213
|
-
| boolean
|
|
214
|
-
| {
|
|
215
|
-
/** Whether authentication is required */
|
|
216
|
-
required?: boolean;
|
|
217
|
-
/** Required user role */
|
|
218
|
-
role?: UserRole;
|
|
219
|
-
/** Required subscription tier */
|
|
220
|
-
tier?: SubscriptionTier;
|
|
221
|
-
/** Custom validation function */
|
|
222
|
-
validate?: (role: string, tier: string) => boolean;
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
// =============================================================================
|
|
226
|
-
// PAGE METADATA TYPES
|
|
227
|
-
// =============================================================================
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Page metadata interface for route discovery and configuration
|
|
231
|
-
*
|
|
232
|
-
* @remarks
|
|
233
|
-
* **ALL PROPERTIES ARE OPTIONAL** - Framework provides smart defaults:
|
|
234
|
-
*
|
|
235
|
-
* - `auth`: false (public) by default - YOU must specify auth requirements explicitly
|
|
236
|
-
* - `title`: Auto-extracted from filename (ShowcasePage → "Showcase")
|
|
237
|
-
* - `entity`: Auto-extracted from path (pages/showcase/ → "showcase")
|
|
238
|
-
* - `action`: Auto-extracted from filename patterns (ListPage → "list", FormPage → "form")
|
|
239
|
-
* - `route`: Only needed for custom paths or dynamic routes like :id, :slug
|
|
240
|
-
*
|
|
241
|
-
* @example Simple page (no meta needed):
|
|
242
|
-
* ```tsx
|
|
243
|
-
* export function HomePage() {
|
|
244
|
-
* return <PageContainer>...</PageContainer>;
|
|
245
|
-
* }
|
|
246
|
-
* // Framework provides: auth=false, title from home.title, entity=home
|
|
247
|
-
* ```
|
|
248
|
-
*
|
|
249
|
-
* @example Dynamic route (string format - explicit path):
|
|
250
|
-
* ```tsx
|
|
251
|
-
* export const meta: PageMeta = {
|
|
252
|
-
* route: '/blog/:slug' // Creates /blog/:slug
|
|
253
|
-
* };
|
|
254
|
-
* // Framework provides: auth=false, title from blog.title, entity=blog
|
|
255
|
-
* ```
|
|
256
|
-
*
|
|
257
|
-
* @example Dynamic route (object format - auto-generates base path):
|
|
258
|
-
* ```tsx
|
|
259
|
-
* export const meta: PageMeta = {
|
|
260
|
-
* route: { params: ['id'] } // Creates /myRoute/:id (base path from file location)
|
|
261
|
-
* };
|
|
262
|
-
* // For file at pages/myRoute/DetailPage.tsx → route becomes /myRoute/:id
|
|
263
|
-
* ```
|
|
264
|
-
*
|
|
265
|
-
* @example Auth-required (developer must be explicit):
|
|
266
|
-
* ```tsx
|
|
267
|
-
* export const meta: PageMeta = {
|
|
268
|
-
* auth: { required: true } // YOU decide what needs auth
|
|
269
|
-
* };
|
|
270
|
-
* ```
|
|
271
|
-
*/
|
|
272
|
-
interface PageMeta {
|
|
273
|
-
/** Authentication requirements for this route */
|
|
274
|
-
auth?: PageAuth;
|
|
275
|
-
|
|
276
|
-
/** Route configuration - just define the exact path you want */
|
|
277
|
-
route?: string | { params?: string[] };
|
|
278
|
-
|
|
279
|
-
/** Page title (optional - framework auto-extracts from filename if not provided) */
|
|
280
|
-
title?: string;
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Translation/SEO namespace for this page
|
|
284
|
-
* @description Used for meta tags and translations
|
|
285
|
-
*/
|
|
286
|
-
namespace?: string;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Icon for navigation (optional - framework provides smart defaults)
|
|
290
|
-
* @description **ONLY lucide-react JSX components** - extracted as component name string at build time for tree-shaking.
|
|
291
|
-
*
|
|
292
|
-
* **RESTRICTIONS:**
|
|
293
|
-
* - ✅ Only: `<Rocket />`, `<ShoppingCart />`, `<Home />` (lucide-react JSX components)
|
|
294
|
-
* - ❌ NOT: Emojis (`"🚀"`), strings (`"Rocket"`), or custom ReactNode
|
|
295
|
-
*
|
|
296
|
-
* **Why?** This is for build-time extraction and tree-shaking. The component name is extracted and stored as a string.
|
|
297
|
-
*
|
|
298
|
-
* **For flexible icons** (emojis, strings, custom components), use the `Icon` component directly in your JSX, not in PageMeta.
|
|
299
|
-
*
|
|
300
|
-
* @example
|
|
301
|
-
* ```tsx
|
|
302
|
-
* import { Rocket } from 'lucide-react';
|
|
303
|
-
* export const meta: PageMeta = {
|
|
304
|
-
* icon: <Rocket /> // ✅ Correct - lucide-react component
|
|
305
|
-
* };
|
|
306
|
-
* ```
|
|
307
|
-
*
|
|
308
|
-
* @example
|
|
309
|
-
* ```tsx
|
|
310
|
-
* // ❌ WRONG - Don't use emojis or strings in PageMeta
|
|
311
|
-
* export const meta: PageMeta = {
|
|
312
|
-
* icon: "🚀" // ❌ Not supported in PageMeta
|
|
313
|
-
* };
|
|
314
|
-
* ```
|
|
315
|
-
*/
|
|
316
|
-
icon?: ReactNode;
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* Hide from navigation menu (default: false - shows in navigation)
|
|
320
|
-
* @description Set to true to exclude this route from navigation menus
|
|
321
|
-
* @default false
|
|
322
|
-
* @example
|
|
323
|
-
* ```tsx
|
|
324
|
-
* export const meta: PageMeta = {
|
|
325
|
-
* hideFromMenu: true // Won't appear in HeaderNavigation, Sidebar, etc.
|
|
326
|
-
* };
|
|
327
|
-
* ```
|
|
328
|
-
*/
|
|
329
|
-
hideFromMenu?: boolean;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Route metadata (discovery-generated)
|
|
334
|
-
* @description Complete route metadata including auto-discovered fields from RouteDiscovery
|
|
335
|
-
*
|
|
336
|
-
* This extends PageMeta with fields that are automatically discovered from file paths:
|
|
337
|
-
* - `entity`: Auto-extracted from path (pages/showcase/ → "showcase")
|
|
338
|
-
* - `action`: Auto-extracted from filename patterns (ListPage → "list", FormPage → "form")
|
|
339
|
-
*
|
|
340
|
-
* These fields are always present in discovered routes but cannot be set in PageMeta.
|
|
341
|
-
*
|
|
342
|
-
* @version 0.0.1
|
|
343
|
-
* @since 0.0.1
|
|
344
|
-
* @author AMBROISE PARK Consulting
|
|
345
|
-
*/
|
|
346
|
-
interface RouteMeta extends PageMeta {
|
|
347
|
-
/** Entity/domain grouping - auto-discovered from file path (not user-configurable) */
|
|
348
|
-
entity?: string;
|
|
349
|
-
/** Action type for route categorization - auto-discovered from filename patterns (not user-configurable) */
|
|
350
|
-
action?: string | null;
|
|
351
|
-
/** File path where route was discovered */
|
|
352
|
-
file?: string;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// =============================================================================
|
|
356
|
-
// PLUGIN CONFIGURATION TYPES
|
|
357
|
-
// =============================================================================
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* i18n Plugin Configuration
|
|
361
|
-
* @description Configuration for internationalization system
|
|
362
|
-
*/
|
|
363
|
-
interface I18nPluginConfig {
|
|
364
|
-
/** Mapping of language → namespace → loader function */
|
|
365
|
-
mapping: Record<string, Record<string, () => Promise<any>>>;
|
|
366
|
-
/** List of available language codes */
|
|
367
|
-
languages: string[];
|
|
368
|
-
/** List of eagerly loaded namespace identifiers */
|
|
369
|
-
eager: string[];
|
|
370
|
-
/** Fallback language code */
|
|
371
|
-
fallback: string;
|
|
372
|
-
/** Preloaded translation content (optional) */
|
|
373
|
-
content?: Record<string, Record<string, any>>;
|
|
374
|
-
/** Storage configuration */
|
|
375
|
-
storage: {
|
|
376
|
-
/** Storage backend type */
|
|
377
|
-
type: StorageType;
|
|
378
|
-
/** Storage key prefix */
|
|
379
|
-
prefix: string;
|
|
380
|
-
/** Time-to-live in seconds */
|
|
381
|
-
ttl: number;
|
|
382
|
-
/** Whether to encrypt stored data */
|
|
383
|
-
encryption: boolean;
|
|
384
|
-
/** Maximum storage size in bytes */
|
|
385
|
-
maxSize: number;
|
|
386
|
-
};
|
|
387
|
-
/** Performance configuration */
|
|
388
|
-
performance: {
|
|
389
|
-
/** Maximum cache size */
|
|
390
|
-
cacheSize: number;
|
|
391
|
-
/** Error cache TTL in seconds */
|
|
392
|
-
errorCacheTTL: number;
|
|
393
|
-
};
|
|
394
|
-
/** Discovery manifest metadata */
|
|
395
|
-
manifest: {
|
|
396
|
-
/** Total number of translation files */
|
|
397
|
-
totalFiles: number;
|
|
398
|
-
/** Total number of namespaces */
|
|
399
|
-
totalNamespaces: number;
|
|
400
|
-
/** Total number of languages */
|
|
401
|
-
totalLanguages: number;
|
|
402
|
-
/** Number of eagerly loaded namespaces */
|
|
403
|
-
eagerNamespaces: number;
|
|
404
|
-
/** ISO timestamp of generation */
|
|
405
|
-
generatedAt: string;
|
|
406
|
-
};
|
|
407
|
-
/** Whether debug mode is enabled */
|
|
408
|
-
debug: boolean;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Routes Plugin Configuration
|
|
413
|
-
* @description Complete route configuration populated by discovery system
|
|
414
|
-
*/
|
|
415
|
-
interface RoutesPluginConfig {
|
|
416
|
-
/**
|
|
417
|
-
* Array of discovered routes
|
|
418
|
-
* @description All routes discovered by the route discovery system
|
|
419
|
-
*/
|
|
420
|
-
mapping: Array<{
|
|
421
|
-
/**
|
|
422
|
-
* URL path for the route (platform-agnostic)
|
|
423
|
-
* @description The URL path that users see in their browser
|
|
424
|
-
* @example '/showcase/layouts', '/users/:id', '/dashboard'
|
|
425
|
-
*/
|
|
426
|
-
path: string;
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Lazy component reference (Vite-specific)
|
|
430
|
-
* @description React.lazy() component for code splitting
|
|
431
|
-
* @example lazy(() => import("/src/pages/showcase/LayoutsPage"))
|
|
432
|
-
*/
|
|
433
|
-
component: any;
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* Absolute file system path (Next.js-specific)
|
|
437
|
-
* @description The absolute path to the component file
|
|
438
|
-
* @example '/src/pages/showcase/LayoutsPage.tsx'
|
|
439
|
-
*/
|
|
440
|
-
importPath: string;
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* Export name for named exports
|
|
444
|
-
* @example 'HomePage', 'AboutPage'
|
|
445
|
-
*/
|
|
446
|
-
exportName?: string;
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Authentication configuration (platform-agnostic)
|
|
450
|
-
* @description Defines whether the route requires authentication
|
|
451
|
-
*/
|
|
452
|
-
auth: PageAuth;
|
|
453
|
-
|
|
454
|
-
/**
|
|
455
|
-
* Route metadata (platform-agnostic)
|
|
456
|
-
* @description Additional information about the route, including auto-discovered fields
|
|
457
|
-
*/
|
|
458
|
-
meta: RouteMeta;
|
|
459
|
-
}>;
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Discovery metadata and statistics
|
|
463
|
-
* @description Information about the route discovery process
|
|
464
|
-
*/
|
|
465
|
-
manifest: {
|
|
466
|
-
/** Total number of discovered routes */
|
|
467
|
-
totalRoutes: number;
|
|
468
|
-
/** Number of routes requiring authentication */
|
|
469
|
-
authRequired: number;
|
|
470
|
-
/** Number of public routes */
|
|
471
|
-
publicRoutes: number;
|
|
472
|
-
/** Source of routes (auto-discovery vs manual) */
|
|
473
|
-
source: RouteSource;
|
|
474
|
-
/** ISO timestamp when routes were generated */
|
|
475
|
-
generatedAt: string;
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* Themes Plugin Configuration
|
|
481
|
-
* @description Configuration for theme discovery and management
|
|
482
|
-
*/
|
|
483
|
-
interface ThemesPluginConfig {
|
|
484
|
-
/** Mapping of theme names to theme configurations */
|
|
485
|
-
mapping: Record<string, any>;
|
|
486
|
-
/** Array of discovered themes */
|
|
487
|
-
discovered: Array<{
|
|
488
|
-
/** Theme identifier */
|
|
489
|
-
name: string;
|
|
490
|
-
/** Human-readable theme name */
|
|
491
|
-
displayName: string;
|
|
492
|
-
/** Whether this is a dark theme */
|
|
493
|
-
isDark: boolean;
|
|
494
|
-
/** Theme metadata */
|
|
495
|
-
meta: {
|
|
496
|
-
/** Icon identifier */
|
|
497
|
-
icon: string;
|
|
498
|
-
/** Theme description */
|
|
499
|
-
description?: string;
|
|
500
|
-
/** Theme category */
|
|
501
|
-
category?: string;
|
|
502
|
-
/** Theme author */
|
|
503
|
-
author?: string;
|
|
504
|
-
/** Additional metadata */
|
|
505
|
-
[key: string]: any;
|
|
506
|
-
};
|
|
507
|
-
/** Source file path */
|
|
508
|
-
source: string;
|
|
509
|
-
/** Whether theme is essential (cannot be disabled) */
|
|
510
|
-
essential: boolean;
|
|
511
|
-
}>;
|
|
512
|
-
/** CSS custom property variables */
|
|
513
|
-
variables: Record<string, string>;
|
|
514
|
-
/** Utility class mappings */
|
|
515
|
-
utilities: Record<string, Record<string, string>>;
|
|
516
|
-
/** Discovery manifest metadata */
|
|
517
|
-
manifest: {
|
|
518
|
-
/** Total number of discovered themes */
|
|
519
|
-
totalThemes: number;
|
|
520
|
-
/** Total number of CSS variables */
|
|
521
|
-
totalVariables: number;
|
|
522
|
-
/** Total number of utility classes */
|
|
523
|
-
totalUtilities: number;
|
|
524
|
-
/** ISO timestamp of generation */
|
|
525
|
-
generatedAt: string;
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Assets Plugin Configuration
|
|
531
|
-
* @description Configuration for static asset management
|
|
532
|
-
*/
|
|
533
|
-
interface AssetsPluginConfig {
|
|
534
|
-
/** Mapping of asset paths to asset metadata */
|
|
535
|
-
mapping: Record<string, any>;
|
|
536
|
-
/** SVG content of logo.svg for inline rendering with CSS variable theming */
|
|
537
|
-
logoSvgContent?: string | null;
|
|
538
|
-
/** Discovery manifest metadata */
|
|
539
|
-
manifest: {
|
|
540
|
-
/** Total number of discovered assets */
|
|
541
|
-
totalAssets: number;
|
|
542
|
-
/** ISO timestamp of generation */
|
|
543
|
-
generatedAt: string;
|
|
544
|
-
};
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* PWA Plugin Configuration
|
|
549
|
-
* @description Configuration for Progressive Web App features
|
|
550
|
-
*/
|
|
551
|
-
interface PWAPluginConfig {
|
|
552
|
-
/** Array of PWA assets */
|
|
553
|
-
assets: Array<{
|
|
554
|
-
/** Type of PWA asset */
|
|
555
|
-
type: PWAAssetType;
|
|
556
|
-
/** Asset file path */
|
|
557
|
-
path: string;
|
|
558
|
-
/** Asset file size in bytes */
|
|
559
|
-
size?: number;
|
|
560
|
-
/** Asset content (for inline assets) */
|
|
561
|
-
content?: any;
|
|
562
|
-
/** Asset format (for images) */
|
|
563
|
-
format?: string;
|
|
564
|
-
/** Asset purpose (for icons) */
|
|
565
|
-
purpose?: string;
|
|
566
|
-
}>;
|
|
567
|
-
/** PWA manifest configuration */
|
|
568
|
-
manifest: {
|
|
569
|
-
/** Application name */
|
|
570
|
-
name: string;
|
|
571
|
-
/** Short application name */
|
|
572
|
-
short_name: string;
|
|
573
|
-
/** Application description */
|
|
574
|
-
description: string;
|
|
575
|
-
/** Start URL */
|
|
576
|
-
start_url: string;
|
|
577
|
-
/** Display mode */
|
|
578
|
-
display: PWADisplayMode;
|
|
579
|
-
/** Background color */
|
|
580
|
-
background_color: string;
|
|
581
|
-
/** Theme color */
|
|
582
|
-
theme_color: string;
|
|
583
|
-
/** Array of app icons */
|
|
584
|
-
icons: Array<{
|
|
585
|
-
/** Icon source path */
|
|
586
|
-
src: string;
|
|
587
|
-
/** Icon sizes (e.g., '192x192') */
|
|
588
|
-
sizes: string;
|
|
589
|
-
/** Icon MIME type */
|
|
590
|
-
type: string;
|
|
591
|
-
/** Icon purpose (e.g., 'any', 'maskable') */
|
|
592
|
-
purpose: string;
|
|
593
|
-
}>;
|
|
594
|
-
};
|
|
595
|
-
/** Discovery manifest metadata */
|
|
596
|
-
manifestInfo: {
|
|
597
|
-
/** Total number of PWA assets */
|
|
598
|
-
totalAssets: number;
|
|
599
|
-
/** Total number of icons */
|
|
600
|
-
totalIcons: number;
|
|
601
|
-
/** Whether service worker is present */
|
|
602
|
-
hasServiceWorker: boolean;
|
|
603
|
-
/** ISO timestamp of generation */
|
|
604
|
-
generatedAt: string;
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* Features Plugin Configuration
|
|
610
|
-
* @description Configuration for feature discovery and enablement
|
|
611
|
-
*
|
|
612
|
-
* @remarks
|
|
613
|
-
* This interface defines the structure for feature discovery data that is populated
|
|
614
|
-
* at build time and made available at runtime for feature availability checking.
|
|
615
|
-
*
|
|
616
|
-
* @example
|
|
617
|
-
* ```typescript
|
|
618
|
-
* // Generated by feature discovery system
|
|
619
|
-
* const featuresConfig: FeaturesPluginConfig = {
|
|
620
|
-
* available: ['auth', 'billing', 'i18n', 'oauth'],
|
|
621
|
-
* enabled: ['auth', 'i18n'],
|
|
622
|
-
* overridden: false
|
|
623
|
-
* };
|
|
624
|
-
* ```
|
|
625
|
-
*/
|
|
626
|
-
interface FeaturesPluginConfig {
|
|
627
|
-
/**
|
|
628
|
-
* List of all available features discovered in packages/features/
|
|
629
|
-
* @example ['auth', 'billing', 'i18n', 'oauth']
|
|
630
|
-
*/
|
|
631
|
-
available: string[];
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
// =============================================================================
|
|
635
|
-
// FRAMEWORK CONFIGURATION
|
|
636
|
-
// =============================================================================
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* Complete DoNotDev framework configuration structure
|
|
640
|
-
* @description Single source of truth for all framework configuration
|
|
641
|
-
*
|
|
642
|
-
* @remarks
|
|
643
|
-
* All discovery plugins add their data to this unified config.
|
|
644
|
-
* Available at runtime via globalThis._DNDEV_CONFIG_ or window._DNDEV_CONFIG_
|
|
645
|
-
*/
|
|
646
|
-
interface DndevFrameworkConfig {
|
|
647
|
-
/** Framework platform (Vite or Next.js) */
|
|
648
|
-
platform: Platform;
|
|
649
|
-
/** Current environment mode */
|
|
650
|
-
mode: EnvironmentMode;
|
|
651
|
-
/** Framework version */
|
|
652
|
-
version: string;
|
|
653
|
-
/** Execution context */
|
|
654
|
-
context: Context;
|
|
655
|
-
/** Unix timestamp of config generation */
|
|
656
|
-
timestamp: number;
|
|
657
|
-
/** i18n plugin configuration (optional) */
|
|
658
|
-
i18n?: I18nPluginConfig;
|
|
659
|
-
/** Routes plugin configuration (optional) */
|
|
660
|
-
routes?: RoutesPluginConfig;
|
|
661
|
-
/** Themes plugin configuration (optional) */
|
|
662
|
-
themes?: ThemesPluginConfig;
|
|
663
|
-
/** Assets plugin configuration (optional) */
|
|
664
|
-
assets?: AssetsPluginConfig;
|
|
665
|
-
/** PWA plugin configuration (optional) */
|
|
666
|
-
pwa?: PWAPluginConfig;
|
|
667
|
-
/** Features plugin configuration (optional) */
|
|
668
|
-
features?: FeaturesPluginConfig;
|
|
669
|
-
/** Environment variables (VITE_* variables from .env files) */
|
|
670
|
-
env?: Record<string, string>;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
// =============================================================================
|
|
674
|
-
// GLOBAL AUGMENTATIONS
|
|
675
|
-
// =============================================================================
|
|
676
|
-
|
|
677
|
-
declare global {
|
|
678
|
-
interface Window {
|
|
679
|
-
/**
|
|
680
|
-
* Single source of truth for all DoNotDev framework configuration
|
|
681
|
-
* @description Set by platform detection and populated by discovery plugins
|
|
682
|
-
*/
|
|
683
|
-
_DNDEV_CONFIG_?: DndevFrameworkConfig;
|
|
684
|
-
|
|
685
|
-
/**
|
|
686
|
-
* Global store registry for singleton Zustand stores
|
|
687
|
-
* @description Ensures single instance across code-split chunks
|
|
688
|
-
*/
|
|
689
|
-
_DNDEV_STORES_?: Record<string, any>;
|
|
690
|
-
|
|
691
|
-
/** PapaParse CSV parser library (external) */
|
|
692
|
-
Papa?: {
|
|
693
|
-
parse: (input: string | File, config?: any) => any;
|
|
694
|
-
unparse: (data: any[], config?: any) => string;
|
|
695
|
-
};
|
|
696
|
-
|
|
697
|
-
/** Sentry error tracking library (external) */
|
|
698
|
-
Sentry?: {
|
|
699
|
-
captureException: (error: unknown) => void;
|
|
700
|
-
withScope: (callback: (scope: any) => void) => void;
|
|
701
|
-
getClient: () => { close: () => Promise<boolean> } | undefined;
|
|
702
|
-
};
|
|
703
|
-
|
|
704
|
-
/**
|
|
705
|
-
* Google APIs (Maps, One Tap, etc.)
|
|
706
|
-
* @description Unified type for all Google services
|
|
707
|
-
*/
|
|
708
|
-
google?: {
|
|
709
|
-
/** Google Maps API */
|
|
710
|
-
maps?: {
|
|
711
|
-
places?: {
|
|
712
|
-
AutocompleteService: new () => any;
|
|
713
|
-
PlacesService: new (element: HTMLElement) => any;
|
|
714
|
-
PlacesServiceStatus: {
|
|
715
|
-
OK: string;
|
|
716
|
-
};
|
|
717
|
-
};
|
|
718
|
-
[key: string]: any;
|
|
719
|
-
};
|
|
720
|
-
/** Google Identity Services (One Tap) */
|
|
721
|
-
accounts?: {
|
|
722
|
-
id?: {
|
|
723
|
-
initialize: (config: any) => void;
|
|
724
|
-
prompt: (callback?: (notification: any) => void) => void;
|
|
725
|
-
cancel?: () => void;
|
|
726
|
-
disableAutoSelect?: () => void;
|
|
727
|
-
};
|
|
728
|
-
};
|
|
729
|
-
[key: string]: any;
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
/** FedCM Identity Credential API */
|
|
733
|
-
IdentityCredential?: any;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
namespace NodeJS {
|
|
737
|
-
interface ProcessEnv {
|
|
738
|
-
/** Serialized framework config for Node.js environment */
|
|
739
|
-
_DNDEV_CONFIG_?: string;
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
namespace globalThis {
|
|
744
|
-
/** Framework configuration (same as window._DNDEV_CONFIG_) */
|
|
745
|
-
var _DNDEV_CONFIG_: DndevFrameworkConfig | undefined;
|
|
746
|
-
/** Store registry (same as window._DNDEV_STORES_) */
|
|
747
|
-
var _DNDEV_STORES_: Record<string, any> | undefined;
|
|
748
|
-
|
|
749
|
-
// Third-party framework globals (not owned by DoNotDev)
|
|
750
|
-
var __vite_plugin_react_preamble_installed__: boolean | undefined;
|
|
751
|
-
var __vite_hmr_port: number | undefined;
|
|
752
|
-
var __NEXT_DATA__: any | undefined;
|
|
753
|
-
var __REACT_QUERY_CLIENT__: any | undefined;
|
|
754
|
-
var __REACT_QUERY_PROVIDER__: any | undefined;
|
|
755
|
-
var __DNDEV_DEBUG: boolean | undefined;
|
|
756
|
-
var __FIREBASE_DEMO_MODE__: boolean | undefined;
|
|
757
|
-
// gc is already defined by Node.js globals - removed to avoid TS 5.9+ conflict
|
|
758
|
-
var getAvailableThemes: (() => string[]) | undefined;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
2
|
|
|
762
3
|
type $MergeBy<T, K> = Omit<T, keyof K> & K;
|
|
763
4
|
|
|
@@ -931,9 +172,6 @@ interface AppMetadata {
|
|
|
931
172
|
/** Short application name for mobile/compact displays (defaults to name if not set) */
|
|
932
173
|
shortName?: string;
|
|
933
174
|
|
|
934
|
-
/** Application URL (base URL for production, defaults to localhost in development) */
|
|
935
|
-
url?: string;
|
|
936
|
-
|
|
937
175
|
/** Application description */
|
|
938
176
|
description?: string;
|
|
939
177
|
|
|
@@ -1079,7 +317,7 @@ interface AuthConfig {
|
|
|
1079
317
|
interface SEOConfig {
|
|
1080
318
|
/** Enable automatic SEO (default: true) */
|
|
1081
319
|
enabled?: boolean;
|
|
1082
|
-
/** Base URL for SEO files (robots.txt, sitemap.xml) -
|
|
320
|
+
/** Base URL for SEO files (robots.txt, sitemap.xml) - reads from VITE_APP_URL/NEXT_PUBLIC_APP_URL env var */
|
|
1083
321
|
baseUrl?: string;
|
|
1084
322
|
/** Site name for SEO - defaults to APP_NAME from app.ts */
|
|
1085
323
|
siteName?: string;
|
|
@@ -1421,11 +659,11 @@ interface PWAOptions {
|
|
|
1421
659
|
runtimeCaching?: Array<{
|
|
1422
660
|
urlPattern: RegExp | ((options: { request: Request }) => boolean);
|
|
1423
661
|
handler:
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
662
|
+
| 'CacheFirst'
|
|
663
|
+
| 'NetworkFirst'
|
|
664
|
+
| 'StaleWhileRevalidate'
|
|
665
|
+
| 'NetworkOnly'
|
|
666
|
+
| 'CacheOnly';
|
|
1429
667
|
options?: Record<string, any>;
|
|
1430
668
|
}>;
|
|
1431
669
|
/** Navigation fallback URL (default: '/') */
|
|
@@ -1441,15 +679,15 @@ interface PWAOptions {
|
|
|
1441
679
|
>;
|
|
1442
680
|
/** Background sync configuration for offline actions */
|
|
1443
681
|
backgroundSync?:
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
682
|
+
| {
|
|
683
|
+
/** Queue name for background sync (default: 'background-sync-queue') */
|
|
684
|
+
queueName?: string;
|
|
685
|
+
/** Maximum retention time in minutes (default: 24 * 60) */
|
|
686
|
+
maxRetentionTime?: number;
|
|
687
|
+
/** URL pattern for background sync routes (default: matches /api/ routes) */
|
|
688
|
+
urlPattern?: RegExp | ((options: { request: Request }) => boolean);
|
|
689
|
+
}
|
|
690
|
+
| false;
|
|
1453
691
|
[key: string]: any; // Allow other workbox options
|
|
1454
692
|
};
|
|
1455
693
|
}
|