@fnd-platform/cms 1.0.0-alpha.1
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/LICENSE +21 -0
- package/README.md +283 -0
- package/lib/cms-project.d.ts +127 -0
- package/lib/cms-project.d.ts.map +1 -0
- package/lib/cms-project.js +343 -0
- package/lib/cms-project.js.map +1 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +20 -0
- package/lib/index.js.map +1 -0
- package/lib/options.d.ts +59 -0
- package/lib/options.d.ts.map +1 -0
- package/lib/options.js +3 -0
- package/lib/options.js.map +1 -0
- package/lib/templates/admin-breadcrumbs.d.ts +13 -0
- package/lib/templates/admin-breadcrumbs.d.ts.map +1 -0
- package/lib/templates/admin-breadcrumbs.js +80 -0
- package/lib/templates/admin-breadcrumbs.js.map +1 -0
- package/lib/templates/admin-content-route.d.ts +18 -0
- package/lib/templates/admin-content-route.d.ts.map +1 -0
- package/lib/templates/admin-content-route.js +100 -0
- package/lib/templates/admin-content-route.js.map +1 -0
- package/lib/templates/admin-content-type-route.d.ts +9 -0
- package/lib/templates/admin-content-type-route.d.ts.map +1 -0
- package/lib/templates/admin-content-type-route.js +96 -0
- package/lib/templates/admin-content-type-route.js.map +1 -0
- package/lib/templates/admin-header.d.ts +13 -0
- package/lib/templates/admin-header.d.ts.map +1 -0
- package/lib/templates/admin-header.js +123 -0
- package/lib/templates/admin-header.js.map +1 -0
- package/lib/templates/admin-index.d.ts +9 -0
- package/lib/templates/admin-index.d.ts.map +1 -0
- package/lib/templates/admin-index.js +60 -0
- package/lib/templates/admin-index.js.map +1 -0
- package/lib/templates/admin-layout.d.ts +10 -0
- package/lib/templates/admin-layout.d.ts.map +1 -0
- package/lib/templates/admin-layout.js +46 -0
- package/lib/templates/admin-layout.js.map +1 -0
- package/lib/templates/admin-sidebar.d.ts +13 -0
- package/lib/templates/admin-sidebar.d.ts.map +1 -0
- package/lib/templates/admin-sidebar.js +149 -0
- package/lib/templates/admin-sidebar.js.map +1 -0
- package/lib/templates/content-editor.d.ts +10 -0
- package/lib/templates/content-editor.d.ts.map +1 -0
- package/lib/templates/content-editor.js +354 -0
- package/lib/templates/content-editor.js.map +1 -0
- package/lib/templates/content-schema.d.ts +10 -0
- package/lib/templates/content-schema.d.ts.map +1 -0
- package/lib/templates/content-schema.js +274 -0
- package/lib/templates/content-schema.js.map +1 -0
- package/lib/templates/content-table.d.ts +13 -0
- package/lib/templates/content-table.d.ts.map +1 -0
- package/lib/templates/content-table.js +177 -0
- package/lib/templates/content-table.js.map +1 -0
- package/lib/templates/content-types-examples.d.ts +19 -0
- package/lib/templates/content-types-examples.d.ts.map +1 -0
- package/lib/templates/content-types-examples.js +275 -0
- package/lib/templates/content-types-examples.js.map +1 -0
- package/lib/templates/content-types-registry.d.ts +10 -0
- package/lib/templates/content-types-registry.d.ts.map +1 -0
- package/lib/templates/content-types-registry.js +87 -0
- package/lib/templates/content-types-registry.js.map +1 -0
- package/lib/templates/content-types.d.ts +10 -0
- package/lib/templates/content-types.d.ts.map +1 -0
- package/lib/templates/content-types.js +384 -0
- package/lib/templates/content-types.js.map +1 -0
- package/lib/templates/dashboard-stats.d.ts +13 -0
- package/lib/templates/dashboard-stats.d.ts.map +1 -0
- package/lib/templates/dashboard-stats.js +117 -0
- package/lib/templates/dashboard-stats.js.map +1 -0
- package/lib/templates/editor/index.d.ts +6 -0
- package/lib/templates/editor/index.d.ts.map +1 -0
- package/lib/templates/editor/index.js +21 -0
- package/lib/templates/editor/index.js.map +1 -0
- package/lib/templates/editor/rich-text-editor.d.ts +7 -0
- package/lib/templates/editor/rich-text-editor.d.ts.map +1 -0
- package/lib/templates/editor/rich-text-editor.js +115 -0
- package/lib/templates/editor/rich-text-editor.js.map +1 -0
- package/lib/templates/editor/toolbar.d.ts +7 -0
- package/lib/templates/editor/toolbar.d.ts.map +1 -0
- package/lib/templates/editor/toolbar.js +272 -0
- package/lib/templates/editor/toolbar.js.map +1 -0
- package/lib/templates/form-fields/boolean-field.d.ts +7 -0
- package/lib/templates/form-fields/boolean-field.d.ts.map +1 -0
- package/lib/templates/form-fields/boolean-field.js +76 -0
- package/lib/templates/form-fields/boolean-field.js.map +1 -0
- package/lib/templates/form-fields/date-field.d.ts +7 -0
- package/lib/templates/form-fields/date-field.d.ts.map +1 -0
- package/lib/templates/form-fields/date-field.js +61 -0
- package/lib/templates/form-fields/date-field.js.map +1 -0
- package/lib/templates/form-fields/datetime-field.d.ts +7 -0
- package/lib/templates/form-fields/datetime-field.d.ts.map +1 -0
- package/lib/templates/form-fields/datetime-field.js +87 -0
- package/lib/templates/form-fields/datetime-field.js.map +1 -0
- package/lib/templates/form-fields/index.d.ts +23 -0
- package/lib/templates/form-fields/index.d.ts.map +1 -0
- package/lib/templates/form-fields/index.js +275 -0
- package/lib/templates/form-fields/index.js.map +1 -0
- package/lib/templates/form-fields/media-field.d.ts +10 -0
- package/lib/templates/form-fields/media-field.d.ts.map +1 -0
- package/lib/templates/form-fields/media-field.js +225 -0
- package/lib/templates/form-fields/media-field.js.map +1 -0
- package/lib/templates/form-fields/multiselect-field.d.ts +7 -0
- package/lib/templates/form-fields/multiselect-field.d.ts.map +1 -0
- package/lib/templates/form-fields/multiselect-field.js +121 -0
- package/lib/templates/form-fields/multiselect-field.js.map +1 -0
- package/lib/templates/form-fields/number-field.d.ts +7 -0
- package/lib/templates/form-fields/number-field.d.ts.map +1 -0
- package/lib/templates/form-fields/number-field.js +87 -0
- package/lib/templates/form-fields/number-field.js.map +1 -0
- package/lib/templates/form-fields/reference-field.d.ts +9 -0
- package/lib/templates/form-fields/reference-field.d.ts.map +1 -0
- package/lib/templates/form-fields/reference-field.js +145 -0
- package/lib/templates/form-fields/reference-field.js.map +1 -0
- package/lib/templates/form-fields/richtext-field.d.ts +9 -0
- package/lib/templates/form-fields/richtext-field.d.ts.map +1 -0
- package/lib/templates/form-fields/richtext-field.js +60 -0
- package/lib/templates/form-fields/richtext-field.js.map +1 -0
- package/lib/templates/form-fields/select-field.d.ts +7 -0
- package/lib/templates/form-fields/select-field.d.ts.map +1 -0
- package/lib/templates/form-fields/select-field.js +70 -0
- package/lib/templates/form-fields/select-field.js.map +1 -0
- package/lib/templates/form-fields/slug-field.d.ts +7 -0
- package/lib/templates/form-fields/slug-field.d.ts.map +1 -0
- package/lib/templates/form-fields/slug-field.js +143 -0
- package/lib/templates/form-fields/slug-field.js.map +1 -0
- package/lib/templates/form-fields/tags-field.d.ts +7 -0
- package/lib/templates/form-fields/tags-field.d.ts.map +1 -0
- package/lib/templates/form-fields/tags-field.js +172 -0
- package/lib/templates/form-fields/tags-field.js.map +1 -0
- package/lib/templates/form-fields/text-field.d.ts +7 -0
- package/lib/templates/form-fields/text-field.d.ts.map +1 -0
- package/lib/templates/form-fields/text-field.js +63 -0
- package/lib/templates/form-fields/text-field.js.map +1 -0
- package/lib/templates/form-fields/textarea-field.d.ts +7 -0
- package/lib/templates/form-fields/textarea-field.d.ts.map +1 -0
- package/lib/templates/form-fields/textarea-field.js +64 -0
- package/lib/templates/form-fields/textarea-field.js.map +1 -0
- package/lib/templates/index.d.ts +34 -0
- package/lib/templates/index.d.ts.map +1 -0
- package/lib/templates/index.js +92 -0
- package/lib/templates/index.js.map +1 -0
- package/lib/templates/media/index.d.ts +12 -0
- package/lib/templates/media/index.d.ts.map +1 -0
- package/lib/templates/media/index.js +50 -0
- package/lib/templates/media/index.js.map +1 -0
- package/lib/templates/media/media-api.d.ts +13 -0
- package/lib/templates/media/media-api.d.ts.map +1 -0
- package/lib/templates/media/media-api.js +274 -0
- package/lib/templates/media/media-api.js.map +1 -0
- package/lib/templates/media/media-grid.d.ts +14 -0
- package/lib/templates/media/media-grid.d.ts.map +1 -0
- package/lib/templates/media/media-grid.js +314 -0
- package/lib/templates/media/media-grid.js.map +1 -0
- package/lib/templates/media/media-library-route.d.ts +13 -0
- package/lib/templates/media/media-library-route.d.ts.map +1 -0
- package/lib/templates/media/media-library-route.js +105 -0
- package/lib/templates/media/media-library-route.js.map +1 -0
- package/lib/templates/media/media-picker.d.ts +13 -0
- package/lib/templates/media/media-picker.d.ts.map +1 -0
- package/lib/templates/media/media-picker.js +152 -0
- package/lib/templates/media/media-picker.js.map +1 -0
- package/lib/templates/media/media-uploader.d.ts +14 -0
- package/lib/templates/media/media-uploader.d.ts.map +1 -0
- package/lib/templates/media/media-uploader.js +318 -0
- package/lib/templates/media/media-uploader.js.map +1 -0
- package/lib/templates/recent-content.d.ts +13 -0
- package/lib/templates/recent-content.d.ts.map +1 -0
- package/lib/templates/recent-content.js +138 -0
- package/lib/templates/recent-content.js.map +1 -0
- package/lib/templates/slug-utils.d.ts +10 -0
- package/lib/templates/slug-utils.d.ts.map +1 -0
- package/lib/templates/slug-utils.js +194 -0
- package/lib/templates/slug-utils.js.map +1 -0
- package/lib/templates/ui-avatar.d.ts +8 -0
- package/lib/templates/ui-avatar.d.ts.map +1 -0
- package/lib/templates/ui-avatar.js +60 -0
- package/lib/templates/ui-avatar.js.map +1 -0
- package/lib/templates/ui-badge.d.ts +8 -0
- package/lib/templates/ui-badge.d.ts.map +1 -0
- package/lib/templates/ui-badge.js +52 -0
- package/lib/templates/ui-badge.js.map +1 -0
- package/lib/templates/ui-dialog.d.ts +10 -0
- package/lib/templates/ui-dialog.d.ts.map +1 -0
- package/lib/templates/ui-dialog.js +134 -0
- package/lib/templates/ui-dialog.js.map +1 -0
- package/lib/templates/ui-dropdown-menu.d.ts +8 -0
- package/lib/templates/ui-dropdown-menu.d.ts.map +1 -0
- package/lib/templates/ui-dropdown-menu.js +210 -0
- package/lib/templates/ui-dropdown-menu.js.map +1 -0
- package/lib/templates/ui-popover.d.ts +8 -0
- package/lib/templates/ui-popover.d.ts.map +1 -0
- package/lib/templates/ui-popover.js +43 -0
- package/lib/templates/ui-popover.js.map +1 -0
- package/lib/templates/ui-progress.d.ts +10 -0
- package/lib/templates/ui-progress.d.ts.map +1 -0
- package/lib/templates/ui-progress.js +40 -0
- package/lib/templates/ui-progress.js.map +1 -0
- package/lib/templates/ui-table.d.ts +8 -0
- package/lib/templates/ui-table.d.ts.map +1 -0
- package/lib/templates/ui-table.js +129 -0
- package/lib/templates/ui-table.js.map +1 -0
- package/lib/templates/ui-tabs.d.ts +10 -0
- package/lib/templates/ui-tabs.d.ts.map +1 -0
- package/lib/templates/ui-tabs.js +67 -0
- package/lib/templates/ui-tabs.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FndCmsProject = void 0;
|
|
4
|
+
const projen_1 = require("projen");
|
|
5
|
+
const frontend_1 = require("@fnd-platform/frontend");
|
|
6
|
+
const templates_1 = require("./templates");
|
|
7
|
+
/**
|
|
8
|
+
* Creates a CMS admin package within an fnd-platform monorepo.
|
|
9
|
+
*
|
|
10
|
+
* This class generates a complete CMS admin interface scaffold with:
|
|
11
|
+
* - Remix app structure (inherited from FndFrontendProject)
|
|
12
|
+
* - Protected admin routes with authentication
|
|
13
|
+
* - Admin layout and dashboard
|
|
14
|
+
* - shadcn/ui components for admin UI
|
|
15
|
+
*
|
|
16
|
+
* The CMS extends the frontend project and adds admin-specific functionality.
|
|
17
|
+
* Authentication is always enabled for CMS (admin access required).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { FndMonorepoProject } from '@fnd-platform/core';
|
|
22
|
+
* import { FndApiProject } from '@fnd-platform/api';
|
|
23
|
+
* import { FndCmsProject } from '@fnd-platform/cms';
|
|
24
|
+
*
|
|
25
|
+
* const monorepo = new FndMonorepoProject({
|
|
26
|
+
* name: 'my-app',
|
|
27
|
+
* defaultReleaseBranch: 'main',
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* const api = new FndApiProject({
|
|
31
|
+
* parent: monorepo,
|
|
32
|
+
* name: 'api',
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* const cms = new FndCmsProject({
|
|
36
|
+
* parent: monorepo,
|
|
37
|
+
* name: 'cms',
|
|
38
|
+
* api: api,
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* monorepo.synth();
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
class FndCmsProject extends frontend_1.FndFrontendProject {
|
|
45
|
+
/**
|
|
46
|
+
* Whether media upload functionality is enabled.
|
|
47
|
+
*/
|
|
48
|
+
mediaUpload;
|
|
49
|
+
/**
|
|
50
|
+
* Rich text editor to use for content editing.
|
|
51
|
+
*/
|
|
52
|
+
richTextEditor;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new FndCmsProject.
|
|
55
|
+
*
|
|
56
|
+
* @param options - Configuration options for the CMS project
|
|
57
|
+
* @throws {Error} If required options are missing
|
|
58
|
+
*/
|
|
59
|
+
constructor(options) {
|
|
60
|
+
// Validate required options
|
|
61
|
+
if (!options.parent) {
|
|
62
|
+
throw new Error('FndCmsProject requires a parent option');
|
|
63
|
+
}
|
|
64
|
+
if (!options.name) {
|
|
65
|
+
throw new Error('FndCmsProject requires a name option');
|
|
66
|
+
}
|
|
67
|
+
if (!options.api) {
|
|
68
|
+
throw new Error('FndCmsProject requires an api option');
|
|
69
|
+
}
|
|
70
|
+
// Call parent with CMS defaults
|
|
71
|
+
// Note: auth is always true for CMS - admin requires authentication
|
|
72
|
+
super({
|
|
73
|
+
parent: options.parent,
|
|
74
|
+
name: options.name,
|
|
75
|
+
outdir: options.outdir,
|
|
76
|
+
api: options.api,
|
|
77
|
+
auth: true, // CMS always requires auth
|
|
78
|
+
port: options.port ?? 3001, // Different port than frontend (3000)
|
|
79
|
+
shadcnTheme: options.shadcnTheme,
|
|
80
|
+
});
|
|
81
|
+
// Store CMS-specific options
|
|
82
|
+
this.mediaUpload = options.mediaUpload ?? true;
|
|
83
|
+
this.richTextEditor = options.richTextEditor ?? 'tiptap';
|
|
84
|
+
// Add CMS-specific dependencies
|
|
85
|
+
this.addDeps('lucide-react@^0.344.0');
|
|
86
|
+
this.addDeps('@radix-ui/react-dropdown-menu@^2.0.0');
|
|
87
|
+
this.addDeps('@radix-ui/react-avatar@^1.0.0');
|
|
88
|
+
this.addDeps('zod@^3.22.0');
|
|
89
|
+
// Tiptap rich text editor dependencies
|
|
90
|
+
this.addDeps('@tiptap/react@^2.2.0');
|
|
91
|
+
this.addDeps('@tiptap/starter-kit@^2.2.0');
|
|
92
|
+
this.addDeps('@tiptap/extension-link@^2.2.0');
|
|
93
|
+
this.addDeps('@tiptap/extension-image@^2.2.0');
|
|
94
|
+
// Radix Popover for link insertion dialog
|
|
95
|
+
this.addDeps('@radix-ui/react-popover@^1.0.0');
|
|
96
|
+
// Additional Radix dependencies for media library
|
|
97
|
+
this.addDeps('@radix-ui/react-dialog@^1.0.0');
|
|
98
|
+
this.addDeps('@radix-ui/react-tabs@^1.0.0');
|
|
99
|
+
this.addDeps('@radix-ui/react-progress@^1.0.0');
|
|
100
|
+
// Generate all CMS files
|
|
101
|
+
this.generateUiComponents();
|
|
102
|
+
this.generateAdminComponents();
|
|
103
|
+
this.generateAdminRoutes();
|
|
104
|
+
this.generateContentTypeSystem();
|
|
105
|
+
this.generateEditorComponents();
|
|
106
|
+
// Generate media library components if enabled
|
|
107
|
+
if (this.mediaUpload) {
|
|
108
|
+
this.generateMediaComponents();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Generates additional shadcn/ui components for the CMS.
|
|
113
|
+
*
|
|
114
|
+
* Creates:
|
|
115
|
+
* - badge.tsx - Status badge component
|
|
116
|
+
* - avatar.tsx - User avatar component
|
|
117
|
+
* - dropdown-menu.tsx - Dropdown menu component
|
|
118
|
+
* - table.tsx - Table component
|
|
119
|
+
* - popover.tsx - Popover component for link dialogs
|
|
120
|
+
*/
|
|
121
|
+
generateUiComponents() {
|
|
122
|
+
new projen_1.SampleFile(this, 'app/components/ui/badge.tsx', {
|
|
123
|
+
contents: (0, templates_1.getBadgeTemplate)(),
|
|
124
|
+
});
|
|
125
|
+
new projen_1.SampleFile(this, 'app/components/ui/avatar.tsx', {
|
|
126
|
+
contents: (0, templates_1.getAvatarTemplate)(),
|
|
127
|
+
});
|
|
128
|
+
new projen_1.SampleFile(this, 'app/components/ui/dropdown-menu.tsx', {
|
|
129
|
+
contents: (0, templates_1.getDropdownMenuTemplate)(),
|
|
130
|
+
});
|
|
131
|
+
new projen_1.SampleFile(this, 'app/components/ui/table.tsx', {
|
|
132
|
+
contents: (0, templates_1.getTableTemplate)(),
|
|
133
|
+
});
|
|
134
|
+
new projen_1.SampleFile(this, 'app/components/ui/popover.tsx', {
|
|
135
|
+
contents: (0, templates_1.getPopoverTemplate)(),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Generates the admin components for the CMS.
|
|
140
|
+
*
|
|
141
|
+
* Creates:
|
|
142
|
+
* - sidebar.tsx - Admin sidebar navigation
|
|
143
|
+
* - header.tsx - Admin header with user menu
|
|
144
|
+
* - breadcrumbs.tsx - Breadcrumb navigation
|
|
145
|
+
* - dashboard-stats.tsx - Dashboard statistics cards
|
|
146
|
+
* - recent-content.tsx - Recent content list
|
|
147
|
+
* - content-table.tsx - Content list table
|
|
148
|
+
*/
|
|
149
|
+
generateAdminComponents() {
|
|
150
|
+
new projen_1.SampleFile(this, 'app/components/admin/sidebar.tsx', {
|
|
151
|
+
contents: (0, templates_1.getAdminSidebarTemplate)(),
|
|
152
|
+
});
|
|
153
|
+
new projen_1.SampleFile(this, 'app/components/admin/header.tsx', {
|
|
154
|
+
contents: (0, templates_1.getAdminHeaderTemplate)(),
|
|
155
|
+
});
|
|
156
|
+
new projen_1.SampleFile(this, 'app/components/admin/breadcrumbs.tsx', {
|
|
157
|
+
contents: (0, templates_1.getAdminBreadcrumbsTemplate)(),
|
|
158
|
+
});
|
|
159
|
+
new projen_1.SampleFile(this, 'app/components/admin/dashboard-stats.tsx', {
|
|
160
|
+
contents: (0, templates_1.getDashboardStatsTemplate)(),
|
|
161
|
+
});
|
|
162
|
+
new projen_1.SampleFile(this, 'app/components/admin/recent-content.tsx', {
|
|
163
|
+
contents: (0, templates_1.getRecentContentTemplate)(),
|
|
164
|
+
});
|
|
165
|
+
new projen_1.SampleFile(this, 'app/components/admin/content-table.tsx', {
|
|
166
|
+
contents: (0, templates_1.getContentTableTemplate)(),
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Generates the admin routes for the CMS.
|
|
171
|
+
*
|
|
172
|
+
* Creates:
|
|
173
|
+
* - _admin.tsx - Admin layout with sidebar and header
|
|
174
|
+
* - _admin._index.tsx - Admin dashboard with stats
|
|
175
|
+
* - _admin.content.tsx - Content section layout
|
|
176
|
+
* - _admin.content._index.tsx - Content overview
|
|
177
|
+
* - _admin.content.$type.tsx - Content type list
|
|
178
|
+
*/
|
|
179
|
+
generateAdminRoutes() {
|
|
180
|
+
// Admin layout with sidebar and header
|
|
181
|
+
new projen_1.SampleFile(this, 'app/routes/_admin.tsx', {
|
|
182
|
+
contents: (0, templates_1.getAdminLayoutTemplate)(),
|
|
183
|
+
});
|
|
184
|
+
// Admin dashboard with stats
|
|
185
|
+
new projen_1.SampleFile(this, 'app/routes/_admin._index.tsx', {
|
|
186
|
+
contents: (0, templates_1.getAdminIndexTemplate)(),
|
|
187
|
+
});
|
|
188
|
+
// Content section layout
|
|
189
|
+
new projen_1.SampleFile(this, 'app/routes/_admin.content.tsx', {
|
|
190
|
+
contents: (0, templates_1.getAdminContentRouteTemplate)(),
|
|
191
|
+
});
|
|
192
|
+
// Content overview
|
|
193
|
+
new projen_1.SampleFile(this, 'app/routes/_admin.content._index.tsx', {
|
|
194
|
+
contents: (0, templates_1.getAdminContentIndexTemplate)(),
|
|
195
|
+
});
|
|
196
|
+
// Content type list
|
|
197
|
+
new projen_1.SampleFile(this, 'app/routes/_admin.content.$type.tsx', {
|
|
198
|
+
contents: (0, templates_1.getAdminContentTypeRouteTemplate)(),
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Generates the content type definition system.
|
|
203
|
+
*
|
|
204
|
+
* Creates:
|
|
205
|
+
* - app/lib/content-types.ts - Content type definitions and interfaces
|
|
206
|
+
* - app/lib/content-schema.ts - Zod schema generation utilities
|
|
207
|
+
* - app/lib/slug-utils.ts - Slug generation utilities
|
|
208
|
+
* - app/content-types/index.ts - Content type registry
|
|
209
|
+
* - app/content-types/blog-post.ts - Example blog post content type
|
|
210
|
+
* - app/content-types/page.ts - Example page content type
|
|
211
|
+
* - app/components/form-fields/* - All form field components
|
|
212
|
+
* - app/components/admin/content-editor.tsx - Dynamic content editor
|
|
213
|
+
*/
|
|
214
|
+
generateContentTypeSystem() {
|
|
215
|
+
// Core content type system files
|
|
216
|
+
new projen_1.SampleFile(this, 'app/lib/content-types.ts', {
|
|
217
|
+
contents: (0, templates_1.getContentTypesTemplate)(),
|
|
218
|
+
});
|
|
219
|
+
new projen_1.SampleFile(this, 'app/lib/content-schema.ts', {
|
|
220
|
+
contents: (0, templates_1.getContentSchemaTemplate)(),
|
|
221
|
+
});
|
|
222
|
+
new projen_1.SampleFile(this, 'app/lib/slug-utils.ts', {
|
|
223
|
+
contents: (0, templates_1.getSlugUtilsTemplate)(),
|
|
224
|
+
});
|
|
225
|
+
// Content type definitions
|
|
226
|
+
new projen_1.SampleFile(this, 'app/content-types/index.ts', {
|
|
227
|
+
contents: (0, templates_1.getContentTypesRegistryTemplate)(),
|
|
228
|
+
});
|
|
229
|
+
new projen_1.SampleFile(this, 'app/content-types/blog-post.ts', {
|
|
230
|
+
contents: (0, templates_1.getBlogPostContentTypeTemplate)(),
|
|
231
|
+
});
|
|
232
|
+
new projen_1.SampleFile(this, 'app/content-types/page.ts', {
|
|
233
|
+
contents: (0, templates_1.getPageContentTypeTemplate)(),
|
|
234
|
+
});
|
|
235
|
+
// Content editor component
|
|
236
|
+
new projen_1.SampleFile(this, 'app/components/admin/content-editor.tsx', {
|
|
237
|
+
contents: (0, templates_1.getContentEditorTemplate)(),
|
|
238
|
+
});
|
|
239
|
+
// Form field components
|
|
240
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/index.ts', {
|
|
241
|
+
contents: (0, templates_1.getFormFieldsIndexTemplate)(),
|
|
242
|
+
});
|
|
243
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/text-field.tsx', {
|
|
244
|
+
contents: (0, templates_1.getTextFieldTemplate)(),
|
|
245
|
+
});
|
|
246
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/textarea-field.tsx', {
|
|
247
|
+
contents: (0, templates_1.getTextareaFieldTemplate)(),
|
|
248
|
+
});
|
|
249
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/richtext-field.tsx', {
|
|
250
|
+
contents: (0, templates_1.getRichtextFieldTemplate)(),
|
|
251
|
+
});
|
|
252
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/slug-field.tsx', {
|
|
253
|
+
contents: (0, templates_1.getSlugFieldTemplate)(),
|
|
254
|
+
});
|
|
255
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/media-field.tsx', {
|
|
256
|
+
contents: (0, templates_1.getMediaFieldTemplate)(),
|
|
257
|
+
});
|
|
258
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/select-field.tsx', {
|
|
259
|
+
contents: (0, templates_1.getSelectFieldTemplate)(),
|
|
260
|
+
});
|
|
261
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/multiselect-field.tsx', {
|
|
262
|
+
contents: (0, templates_1.getMultiselectFieldTemplate)(),
|
|
263
|
+
});
|
|
264
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/date-field.tsx', {
|
|
265
|
+
contents: (0, templates_1.getDateFieldTemplate)(),
|
|
266
|
+
});
|
|
267
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/datetime-field.tsx', {
|
|
268
|
+
contents: (0, templates_1.getDatetimeFieldTemplate)(),
|
|
269
|
+
});
|
|
270
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/boolean-field.tsx', {
|
|
271
|
+
contents: (0, templates_1.getBooleanFieldTemplate)(),
|
|
272
|
+
});
|
|
273
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/number-field.tsx', {
|
|
274
|
+
contents: (0, templates_1.getNumberFieldTemplate)(),
|
|
275
|
+
});
|
|
276
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/tags-field.tsx', {
|
|
277
|
+
contents: (0, templates_1.getTagsFieldTemplate)(),
|
|
278
|
+
});
|
|
279
|
+
new projen_1.SampleFile(this, 'app/components/form-fields/reference-field.tsx', {
|
|
280
|
+
contents: (0, templates_1.getReferenceFieldTemplate)(),
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Generates the editor components for rich text editing.
|
|
285
|
+
*
|
|
286
|
+
* Creates:
|
|
287
|
+
* - app/components/editor/toolbar.tsx - Editor toolbar with formatting buttons
|
|
288
|
+
* - app/components/editor/rich-text-editor.tsx - Tiptap-based rich text editor
|
|
289
|
+
*/
|
|
290
|
+
generateEditorComponents() {
|
|
291
|
+
new projen_1.SampleFile(this, 'app/components/editor/toolbar.tsx', {
|
|
292
|
+
contents: (0, templates_1.getEditorToolbarTemplate)(),
|
|
293
|
+
});
|
|
294
|
+
new projen_1.SampleFile(this, 'app/components/editor/rich-text-editor.tsx', {
|
|
295
|
+
contents: (0, templates_1.getRichTextEditorTemplate)(),
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Generates the media library components.
|
|
300
|
+
*
|
|
301
|
+
* Creates:
|
|
302
|
+
* - app/lib/media-api.ts - Client-side API helpers for presigned URL uploads
|
|
303
|
+
* - app/components/media/media-uploader.tsx - Drag-drop upload with progress
|
|
304
|
+
* - app/components/media/media-grid.tsx - Grid display with selection
|
|
305
|
+
* - app/components/media/media-picker.tsx - Dialog for field integration
|
|
306
|
+
* - app/routes/_admin.media.tsx - Media library route
|
|
307
|
+
* - app/components/ui/progress.tsx - Progress bar component
|
|
308
|
+
* - app/components/ui/dialog.tsx - Dialog component
|
|
309
|
+
* - app/components/ui/tabs.tsx - Tabs component
|
|
310
|
+
*/
|
|
311
|
+
generateMediaComponents() {
|
|
312
|
+
// Media API client
|
|
313
|
+
new projen_1.SampleFile(this, 'app/lib/media-api.ts', {
|
|
314
|
+
contents: (0, templates_1.getMediaApiTemplate)(),
|
|
315
|
+
});
|
|
316
|
+
// Media components
|
|
317
|
+
new projen_1.SampleFile(this, 'app/components/media/media-uploader.tsx', {
|
|
318
|
+
contents: (0, templates_1.getMediaUploaderTemplate)(),
|
|
319
|
+
});
|
|
320
|
+
new projen_1.SampleFile(this, 'app/components/media/media-grid.tsx', {
|
|
321
|
+
contents: (0, templates_1.getMediaGridTemplate)(),
|
|
322
|
+
});
|
|
323
|
+
new projen_1.SampleFile(this, 'app/components/media/media-picker.tsx', {
|
|
324
|
+
contents: (0, templates_1.getMediaPickerTemplate)(),
|
|
325
|
+
});
|
|
326
|
+
// Media library route
|
|
327
|
+
new projen_1.SampleFile(this, 'app/routes/_admin.media.tsx', {
|
|
328
|
+
contents: (0, templates_1.getMediaLibraryRouteTemplate)(),
|
|
329
|
+
});
|
|
330
|
+
// Additional UI components for media library
|
|
331
|
+
new projen_1.SampleFile(this, 'app/components/ui/progress.tsx', {
|
|
332
|
+
contents: (0, templates_1.getProgressTemplate)(),
|
|
333
|
+
});
|
|
334
|
+
new projen_1.SampleFile(this, 'app/components/ui/dialog.tsx', {
|
|
335
|
+
contents: (0, templates_1.getDialogTemplate)(),
|
|
336
|
+
});
|
|
337
|
+
new projen_1.SampleFile(this, 'app/components/ui/tabs.tsx', {
|
|
338
|
+
contents: (0, templates_1.getTabsTemplate)(),
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
exports.FndCmsProject = FndCmsProject;
|
|
343
|
+
//# sourceMappingURL=cms-project.js.map
|
|
@@ -0,0 +1 @@
|
|
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AAQ,EAAE,IAAA,wCAA4B,GAAE;SACzC,CAAC,CAAC;QAEH,6CAA6C;QAC7C,IAAI,mBAAU,CAAC,IAAI,EAAE,gCAAgC,EAAE;YACrD,QAAQ,EAAE,IAAA,+BAAmB,GAAE;SAChC,CAAC,CAAC;QAEH,IAAI,mBAAU,CAAC,IAAI,EAAE,8BAA8B,EAAE;YACnD,QAAQ,EAAE,IAAA,6BAAiB,GAAE;SAC9B,CAAC,CAAC;QAEH,IAAI,mBAAU,CAAC,IAAI,EAAE,4BAA4B,EAAE;YACjD,QAAQ,EAAE,IAAA,2BAAe,GAAE;SAC5B,CAAC,CAAC;IACL,CAAC;CACF;AAlWD,sCAkWC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fnd-platform/cms
|
|
3
|
+
*
|
|
4
|
+
* Projen project class for generating CMS admin packages in fnd-platform.
|
|
5
|
+
* Creates complete CMS admin interfaces with Remix, Vite, Tailwind CSS, and shadcn/ui.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export { FndCmsProject } from './cms-project';
|
|
10
|
+
export type { FndCmsProjectOptions } from './options';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,YAAY,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* @fnd-platform/cms
|
|
4
|
+
*
|
|
5
|
+
* Projen project class for generating CMS admin packages in fnd-platform.
|
|
6
|
+
* Creates complete CMS admin interfaces with Remix, Vite, Tailwind CSS, and shadcn/ui.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
exports.FndCmsProject = void 0;
|
|
12
|
+
// Main project class
|
|
13
|
+
var cms_project_1 = require('./cms-project');
|
|
14
|
+
Object.defineProperty(exports, 'FndCmsProject', {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return cms_project_1.FndCmsProject;
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,qBAAqB;AACrB,6CAA8C;AAArC,4GAAA,aAAa,OAAA"}
|
package/lib/options.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { FndMonorepoProject } from '@fnd-platform/core';
|
|
2
|
+
import type { FndApiProject } from '@fnd-platform/api';
|
|
3
|
+
import type { ShadcnTheme } from '@fnd-platform/frontend';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for FndCmsProject.
|
|
6
|
+
*/
|
|
7
|
+
export interface FndCmsProjectOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Parent monorepo project.
|
|
10
|
+
* The CMS project will be added as a subproject of this monorepo.
|
|
11
|
+
*/
|
|
12
|
+
readonly parent: FndMonorepoProject;
|
|
13
|
+
/**
|
|
14
|
+
* Package name for the CMS project.
|
|
15
|
+
* This will be prefixed with the parent project name to create the full
|
|
16
|
+
* package name (e.g., '@my-app/cms').
|
|
17
|
+
*
|
|
18
|
+
* @example 'cms'
|
|
19
|
+
*/
|
|
20
|
+
readonly name: string;
|
|
21
|
+
/**
|
|
22
|
+
* Output directory relative to monorepo root.
|
|
23
|
+
*
|
|
24
|
+
* @default 'packages/{name}'
|
|
25
|
+
*/
|
|
26
|
+
readonly outdir?: string;
|
|
27
|
+
/**
|
|
28
|
+
* API project reference for type-safe client generation.
|
|
29
|
+
* The CMS will use this reference to generate typed API calls.
|
|
30
|
+
*/
|
|
31
|
+
readonly api: FndApiProject;
|
|
32
|
+
/**
|
|
33
|
+
* Development server port.
|
|
34
|
+
*
|
|
35
|
+
* @default 3001
|
|
36
|
+
*/
|
|
37
|
+
readonly port?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Enable media upload functionality.
|
|
40
|
+
* When true, generates media library routes and components.
|
|
41
|
+
*
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
readonly mediaUpload?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Rich text editor to use for content editing.
|
|
47
|
+
*
|
|
48
|
+
* @default 'tiptap'
|
|
49
|
+
*/
|
|
50
|
+
readonly richTextEditor?: 'tiptap' | 'lexical';
|
|
51
|
+
/**
|
|
52
|
+
* shadcn/ui theme color.
|
|
53
|
+
* Controls the color scheme used by shadcn/ui components.
|
|
54
|
+
*
|
|
55
|
+
* @default 'zinc'
|
|
56
|
+
*/
|
|
57
|
+
readonly shadcnTheme?: ShadcnTheme;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAEpC;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAE/C;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;CACpC"}
|
package/lib/options.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates the admin breadcrumbs component template.
|
|
3
|
+
*
|
|
4
|
+
* This component provides:
|
|
5
|
+
* - Home icon for admin root
|
|
6
|
+
* - Chevron separators between items
|
|
7
|
+
* - Current page rendered as text (not a link)
|
|
8
|
+
* - Truncation for long paths
|
|
9
|
+
*
|
|
10
|
+
* @returns Template string for app/components/admin/breadcrumbs.tsx
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAdminBreadcrumbsTemplate(): string;
|
|
13
|
+
//# sourceMappingURL=admin-breadcrumbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/templates/admin-breadcrumbs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,CAgEpD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.getAdminBreadcrumbsTemplate = getAdminBreadcrumbsTemplate;
|
|
4
|
+
/**
|
|
5
|
+
* Generates the admin breadcrumbs component template.
|
|
6
|
+
*
|
|
7
|
+
* This component provides:
|
|
8
|
+
* - Home icon for admin root
|
|
9
|
+
* - Chevron separators between items
|
|
10
|
+
* - Current page rendered as text (not a link)
|
|
11
|
+
* - Truncation for long paths
|
|
12
|
+
*
|
|
13
|
+
* @returns Template string for app/components/admin/breadcrumbs.tsx
|
|
14
|
+
*/
|
|
15
|
+
function getAdminBreadcrumbsTemplate() {
|
|
16
|
+
return `import { Link } from '@remix-run/react';
|
|
17
|
+
import { Home, ChevronRight } from 'lucide-react';
|
|
18
|
+
import { cn } from '~/lib/utils';
|
|
19
|
+
|
|
20
|
+
export interface BreadcrumbItem {
|
|
21
|
+
label: string;
|
|
22
|
+
href?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface BreadcrumbsProps {
|
|
26
|
+
items: BreadcrumbItem[];
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function Breadcrumbs({ items, className }: BreadcrumbsProps) {
|
|
31
|
+
return (
|
|
32
|
+
<nav
|
|
33
|
+
aria-label="Breadcrumb"
|
|
34
|
+
className={cn('flex items-center space-x-1 text-sm', className)}
|
|
35
|
+
>
|
|
36
|
+
{/* Home Link */}
|
|
37
|
+
<Link
|
|
38
|
+
to="/admin"
|
|
39
|
+
className="flex items-center text-muted-foreground hover:text-foreground transition-colors"
|
|
40
|
+
>
|
|
41
|
+
<Home className="h-4 w-4" />
|
|
42
|
+
<span className="sr-only">Admin Home</span>
|
|
43
|
+
</Link>
|
|
44
|
+
|
|
45
|
+
{items.map((item, index) => {
|
|
46
|
+
const isLast = index === items.length - 1;
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div key={item.label} className="flex items-center">
|
|
50
|
+
<ChevronRight className="h-4 w-4 text-muted-foreground" />
|
|
51
|
+
{isLast || !item.href ? (
|
|
52
|
+
<span
|
|
53
|
+
className={cn(
|
|
54
|
+
'ml-1 max-w-[200px] truncate',
|
|
55
|
+
isLast
|
|
56
|
+
? 'font-medium text-foreground'
|
|
57
|
+
: 'text-muted-foreground'
|
|
58
|
+
)}
|
|
59
|
+
title={item.label}
|
|
60
|
+
>
|
|
61
|
+
{item.label}
|
|
62
|
+
</span>
|
|
63
|
+
) : (
|
|
64
|
+
<Link
|
|
65
|
+
to={item.href}
|
|
66
|
+
className="ml-1 max-w-[200px] truncate text-muted-foreground hover:text-foreground transition-colors"
|
|
67
|
+
title={item.label}
|
|
68
|
+
>
|
|
69
|
+
{item.label}
|
|
70
|
+
</Link>
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
})}
|
|
75
|
+
</nav>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=admin-breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-breadcrumbs.js","sourceRoot":"","sources":["../../src/templates/admin-breadcrumbs.ts"],"names":[],"mappings":";;AAWA,kEAgEC;AA3ED;;;;;;;;;;GAUG;AACH,SAAgB,2BAA2B;IACzC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DR,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates the admin content index route template.
|
|
3
|
+
*
|
|
4
|
+
* This route serves as the content section layout/outlet
|
|
5
|
+
* that wraps all content-related routes.
|
|
6
|
+
*
|
|
7
|
+
* @returns Template string for app/routes/_admin.content.tsx
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAdminContentRouteTemplate(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Generates the admin content index page template.
|
|
12
|
+
*
|
|
13
|
+
* This shows an overview of all content when visiting /admin/content.
|
|
14
|
+
*
|
|
15
|
+
* @returns Template string for app/routes/_admin.content._index.tsx
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAdminContentIndexTemplate(): string;
|
|
18
|
+
//# sourceMappingURL=admin-content-route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-content-route.d.ts","sourceRoot":"","sources":["../../src/templates/admin-content-route.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAcrD;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAgErD"}
|