@elsapiens/cli 0.1.0 → 0.1.2
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/README.md +115 -54
- package/dist/index.js +109 -36
- package/dist/index.js.map +1 -1
- package/dist/templates/app/app.ejs +295 -13
- package/dist/templates/app/env-example.ejs +3 -0
- package/dist/templates/app/eslint-config.ejs +47 -0
- package/dist/templates/app/help-topics.ejs +135 -0
- package/dist/templates/app/husky-pre-commit.ejs +8 -0
- package/dist/templates/app/index-css.ejs +536 -1
- package/dist/templates/app/main.ejs +81 -4
- package/dist/templates/app/package.ejs +28 -3
- package/dist/templates/app/page-dashboard.ejs +99 -60
- package/dist/templates/app/page-settings.ejs +268 -91
- package/dist/templates/app/postcss-config.ejs +6 -0
- package/dist/templates/app/services-setup.ejs +158 -0
- package/dist/templates/app/tailwind-config.ejs +105 -0
- package/dist/templates/app/test-setup.ejs +1 -0
- package/dist/templates/app/translations-common-en.ejs +23 -0
- package/dist/templates/app/translations-common-index.ejs +18 -0
- package/dist/templates/app/translations-common.ejs +94 -0
- package/dist/templates/app/translations-settings-en.ejs +49 -0
- package/dist/templates/app/translations-settings-index.ejs +18 -0
- package/dist/templates/app/tsconfig-node.ejs +10 -0
- package/dist/templates/app/vite-env.ejs +13 -0
- package/dist/templates/app/vitest-config.ejs +30 -0
- package/dist/templates/pages/list.ejs +636 -165
- package/dist/templates/pages/settings.ejs +208 -136
- package/package.json +4 -2
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
1
3
|
import {
|
|
2
4
|
Button,
|
|
3
5
|
Input,
|
|
@@ -6,158 +8,228 @@ import {
|
|
|
6
8
|
Card,
|
|
7
9
|
CardHeader,
|
|
8
10
|
CardTitle,
|
|
11
|
+
CardDescription,
|
|
9
12
|
CardContent,
|
|
13
|
+
FormField,
|
|
14
|
+
Separator,
|
|
10
15
|
} from '@elsapiens/ui';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
16
|
+
import { PageHeaderWithBreadcrumbs } from '@elsapiens/layout';
|
|
17
|
+
import { usePageHeader } from '@elsapiens/providers';
|
|
18
|
+
import { User, Bell, Shield, Palette, Mail, Moon, Save } from 'lucide-react';
|
|
19
|
+
|
|
20
|
+
interface <%= pascalName %>PageProps {
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
13
23
|
|
|
14
|
-
export
|
|
24
|
+
export function <%= pascalName %>Page({ className }: <%= pascalName %>PageProps) {
|
|
15
25
|
const [notifications, setNotifications] = useState(true);
|
|
16
26
|
const [emailUpdates, setEmailUpdates] = useState(false);
|
|
17
27
|
|
|
28
|
+
// Set page header info
|
|
29
|
+
usePageHeader({
|
|
30
|
+
title: '<%= title %>',
|
|
31
|
+
description: '<%= description %>',
|
|
32
|
+
breadcrumbs: [
|
|
33
|
+
{ label: 'Home', href: '/', as: Link },
|
|
34
|
+
{ label: '<%= title %>' },
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Theme options
|
|
39
|
+
const themeOptions = [
|
|
40
|
+
{ value: 'light', label: 'Light' },
|
|
41
|
+
{ value: 'dark', label: 'Dark' },
|
|
42
|
+
{ value: 'system', label: 'System' },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// Language options
|
|
46
|
+
const languageOptions = [
|
|
47
|
+
{ value: 'en', label: 'English' },
|
|
48
|
+
{ value: 'es', label: 'Spanish' },
|
|
49
|
+
{ value: 'fr', label: 'French' },
|
|
50
|
+
];
|
|
51
|
+
|
|
18
52
|
return (
|
|
19
|
-
<div className="
|
|
20
|
-
|
|
21
|
-
<div className="mb-8 pl-6">
|
|
22
|
-
<h1 className="text-2xl font-bold text-foreground"><%= title %></h1>
|
|
23
|
-
<p className="text-muted-foreground"><%= description %></p>
|
|
24
|
-
</div>
|
|
53
|
+
<div className="flex flex-col">
|
|
54
|
+
<PageHeaderWithBreadcrumbs variant="card" linkComponent={Link} />
|
|
25
55
|
|
|
26
|
-
<div className="
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
56
|
+
<div className="el-p-lg" style={{ overflowX: 'clip' }}>
|
|
57
|
+
<div className="el-space-y-section max-w-3xl">
|
|
58
|
+
{/* Profile Section */}
|
|
59
|
+
<Card>
|
|
60
|
+
<CardHeader>
|
|
61
|
+
<div className="flex items-center el-gap-sm">
|
|
62
|
+
<div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
|
|
63
|
+
<User className="w-5 h-5 text-primary" />
|
|
64
|
+
</div>
|
|
65
|
+
<div>
|
|
66
|
+
<CardTitle>Profile</CardTitle>
|
|
67
|
+
<CardDescription>Manage your personal information</CardDescription>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</CardHeader>
|
|
71
|
+
<CardContent className="el-space-y-content">
|
|
72
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 el-gap-field">
|
|
73
|
+
<FormField label="First Name">
|
|
74
|
+
<Input defaultValue="John" />
|
|
75
|
+
</FormField>
|
|
76
|
+
<FormField label="Last Name">
|
|
77
|
+
<Input defaultValue="Doe" />
|
|
78
|
+
</FormField>
|
|
42
79
|
</div>
|
|
43
|
-
<div>
|
|
44
|
-
<label
|
|
45
|
-
|
|
46
|
-
</
|
|
47
|
-
<Input defaultValue="Doe" hideMessage />
|
|
80
|
+
<div className="el-gap-field">
|
|
81
|
+
<FormField label="Email">
|
|
82
|
+
<Input type="email" defaultValue="john.doe@example.com" />
|
|
83
|
+
</FormField>
|
|
48
84
|
</div>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</
|
|
56
|
-
|
|
57
|
-
<Button>Save Changes</Button>
|
|
58
|
-
</div>
|
|
59
|
-
</CardContent>
|
|
60
|
-
</Card>
|
|
85
|
+
<div className="el-gap-field flex justify-end">
|
|
86
|
+
<Button>
|
|
87
|
+
<Save className="w-4 h-4 el-mr-xs" />
|
|
88
|
+
Save Changes
|
|
89
|
+
</Button>
|
|
90
|
+
</div>
|
|
91
|
+
</CardContent>
|
|
92
|
+
</Card>
|
|
61
93
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<p className="font-medium text-foreground">Push Notifications</p>
|
|
74
|
-
<p className="text-sm text-muted-foreground">Receive push notifications for updates</p>
|
|
94
|
+
{/* Appearance Section */}
|
|
95
|
+
<Card>
|
|
96
|
+
<CardHeader>
|
|
97
|
+
<div className="flex items-center el-gap-sm">
|
|
98
|
+
<div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
|
|
99
|
+
<Palette className="w-5 h-5 text-primary" />
|
|
100
|
+
</div>
|
|
101
|
+
<div>
|
|
102
|
+
<CardTitle>Appearance</CardTitle>
|
|
103
|
+
<CardDescription>Customize your visual preferences</CardDescription>
|
|
104
|
+
</div>
|
|
75
105
|
</div>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<div>
|
|
80
|
-
<
|
|
81
|
-
|
|
106
|
+
</CardHeader>
|
|
107
|
+
<CardContent className="el-space-y-content">
|
|
108
|
+
{/* Theme Setting */}
|
|
109
|
+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between el-gap-md el-py-sm">
|
|
110
|
+
<div className="flex items-start el-gap-sm">
|
|
111
|
+
<Moon className="w-5 h-5 text-muted-foreground el-mt-xs flex-shrink-0" />
|
|
112
|
+
<div>
|
|
113
|
+
<p className="font-medium text-foreground">Theme</p>
|
|
114
|
+
<p className="text-sm text-muted-foreground">Choose your preferred color scheme</p>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
<div className="sm:w-48 flex-shrink-0">
|
|
118
|
+
<Select
|
|
119
|
+
options={themeOptions}
|
|
120
|
+
defaultValue="system"
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
82
123
|
</div>
|
|
83
|
-
<Toggle checked={emailUpdates} onChange={setEmailUpdates} />
|
|
84
|
-
</div>
|
|
85
|
-
</CardContent>
|
|
86
|
-
</Card>
|
|
87
124
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
hideMessage
|
|
109
|
-
/>
|
|
110
|
-
</div>
|
|
111
|
-
<div>
|
|
112
|
-
<label className="block text-sm font-medium text-foreground mb-1">
|
|
113
|
-
Language
|
|
114
|
-
</label>
|
|
115
|
-
<Select
|
|
116
|
-
options={[
|
|
117
|
-
{ value: 'en', label: 'English' },
|
|
118
|
-
{ value: 'es', label: 'Spanish' },
|
|
119
|
-
{ value: 'fr', label: 'French' },
|
|
120
|
-
]}
|
|
121
|
-
value="en"
|
|
122
|
-
hideMessage
|
|
123
|
-
/>
|
|
124
|
-
</div>
|
|
125
|
-
</CardContent>
|
|
126
|
-
</Card>
|
|
125
|
+
<Separator />
|
|
126
|
+
|
|
127
|
+
{/* Language Setting */}
|
|
128
|
+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between el-gap-md el-py-sm">
|
|
129
|
+
<div className="flex items-start el-gap-sm">
|
|
130
|
+
<Mail className="w-5 h-5 text-muted-foreground el-mt-xs flex-shrink-0" />
|
|
131
|
+
<div>
|
|
132
|
+
<p className="font-medium text-foreground">Language</p>
|
|
133
|
+
<p className="text-sm text-muted-foreground">Select your preferred language</p>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
<div className="sm:w-48 flex-shrink-0">
|
|
137
|
+
<Select
|
|
138
|
+
options={languageOptions}
|
|
139
|
+
defaultValue="en"
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</CardContent>
|
|
144
|
+
</Card>
|
|
127
145
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
<
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
146
|
+
{/* Notifications Section */}
|
|
147
|
+
<Card>
|
|
148
|
+
<CardHeader>
|
|
149
|
+
<div className="flex items-center el-gap-sm">
|
|
150
|
+
<div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
|
|
151
|
+
<Bell className="w-5 h-5 text-primary" />
|
|
152
|
+
</div>
|
|
153
|
+
<div>
|
|
154
|
+
<CardTitle>Notifications</CardTitle>
|
|
155
|
+
<CardDescription>Configure your notification preferences</CardDescription>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</CardHeader>
|
|
159
|
+
<CardContent className="el-space-y-content">
|
|
160
|
+
{/* Push Notifications */}
|
|
161
|
+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between el-gap-md el-py-sm">
|
|
162
|
+
<div className="flex items-start el-gap-sm">
|
|
163
|
+
<Bell className="w-5 h-5 text-muted-foreground el-mt-xs flex-shrink-0" />
|
|
164
|
+
<div>
|
|
165
|
+
<p className="font-medium text-foreground">Push Notifications</p>
|
|
166
|
+
<p className="text-sm text-muted-foreground">Receive push notifications for updates</p>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
<div className="flex-shrink-0">
|
|
170
|
+
<Toggle checked={notifications} onChange={setNotifications} />
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<Separator />
|
|
175
|
+
|
|
176
|
+
{/* Email Updates */}
|
|
177
|
+
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between el-gap-md el-py-sm">
|
|
178
|
+
<div className="flex items-start el-gap-sm">
|
|
179
|
+
<Mail className="w-5 h-5 text-muted-foreground el-mt-xs flex-shrink-0" />
|
|
180
|
+
<div>
|
|
181
|
+
<p className="font-medium text-foreground">Email Updates</p>
|
|
182
|
+
<p className="text-sm text-muted-foreground">Receive weekly email summaries</p>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
<div className="flex-shrink-0">
|
|
186
|
+
<Toggle checked={emailUpdates} onChange={setEmailUpdates} />
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
</CardContent>
|
|
190
|
+
</Card>
|
|
191
|
+
|
|
192
|
+
{/* Security Section */}
|
|
193
|
+
<Card>
|
|
194
|
+
<CardHeader>
|
|
195
|
+
<div className="flex items-center el-gap-sm">
|
|
196
|
+
<div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
|
|
197
|
+
<Shield className="w-5 h-5 text-primary" />
|
|
198
|
+
</div>
|
|
199
|
+
<div>
|
|
200
|
+
<CardTitle>Security</CardTitle>
|
|
201
|
+
<CardDescription>Manage your password and security settings</CardDescription>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
</CardHeader>
|
|
205
|
+
<CardContent className="el-space-y-content">
|
|
206
|
+
{/* Hidden username field for accessibility - helps password managers */}
|
|
207
|
+
<input type="text" name="username" autoComplete="username" className="sr-only" aria-hidden="true" tabIndex={-1} />
|
|
208
|
+
<div className="el-gap-field">
|
|
209
|
+
<FormField label="Current Password">
|
|
210
|
+
<Input type="password" placeholder="Enter current password" autoComplete="current-password" />
|
|
211
|
+
</FormField>
|
|
212
|
+
</div>
|
|
213
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 el-gap-field">
|
|
214
|
+
<FormField label="New Password">
|
|
215
|
+
<Input type="password" placeholder="Enter new password" autoComplete="new-password" />
|
|
216
|
+
</FormField>
|
|
217
|
+
<FormField label="Confirm Password">
|
|
218
|
+
<Input type="password" placeholder="Confirm new password" autoComplete="new-password" />
|
|
219
|
+
</FormField>
|
|
220
|
+
</div>
|
|
221
|
+
<div className="el-gap-field flex justify-end">
|
|
222
|
+
<Button>
|
|
223
|
+
<Shield className="w-4 h-4 el-mr-xs" />
|
|
224
|
+
Update Password
|
|
225
|
+
</Button>
|
|
226
|
+
</div>
|
|
227
|
+
</CardContent>
|
|
228
|
+
</Card>
|
|
229
|
+
</div>
|
|
160
230
|
</div>
|
|
161
231
|
</div>
|
|
162
232
|
);
|
|
163
233
|
}
|
|
234
|
+
|
|
235
|
+
export default <%= pascalName %>Page;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elsapiens/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "CLI scaffolding tool for elSapiens SDK projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -57,6 +57,8 @@
|
|
|
57
57
|
"build": "tsup",
|
|
58
58
|
"dev": "tsup --watch",
|
|
59
59
|
"clean": "rm -rf dist",
|
|
60
|
-
"typecheck": "tsc --noEmit"
|
|
60
|
+
"typecheck": "tsc --noEmit",
|
|
61
|
+
"setup:global": "./scripts/setup-global.sh",
|
|
62
|
+
"unlink:global": "pnpm unlink --global"
|
|
61
63
|
}
|
|
62
64
|
}
|