@tioelvis/next-template 2.4.8 → 3.0.0
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 +42 -42
- package/package.json +44 -92
- package/src/actions/configure-package-json.js +32 -0
- package/src/actions/init-project.js +40 -0
- package/src/actions/init-shadcn-ui.js +48 -0
- package/src/actions/init-theme.js +28 -0
- package/src/actions/init-tioelvis-components.js +42 -0
- package/src/actions/install-main-packages.js +51 -0
- package/src/constants.js +234 -97
- package/src/lib/exception.js +9 -0
- package/src/lib/utils.js +55 -0
- package/src/main.js +158 -229
- package/src/template/eslint.config.mjs +15 -13
- package/src/template/postcss.config.mjs +3 -1
- package/src/template/src/app/globals.css +0 -122
- package/src/template/src/app/layout.tsx +7 -15
- package/src/template/src/app/page.tsx +6 -2
- package/src/template/tsconfig.json +9 -2
- package/src/themes/blue.css +141 -0
- package/src/themes/default.css +141 -0
- package/src/themes/green.css +141 -0
- package/src/themes/orange.css +141 -0
- package/src/themes/red.css +141 -0
- package/src/themes/rose.css +141 -0
- package/src/themes/violet.css +141 -0
- package/src/themes/yellow.css +141 -0
- package/src/tioelvis-components/max-width-wrapper.tsx +21 -0
- package/src/app/components/ui/accordion.json +0 -6
- package/src/app/components/ui/accordion.tsx +0 -64
- package/src/app/components/ui/alert-dialog.json +0 -6
- package/src/app/components/ui/alert-dialog.tsx +0 -157
- package/src/app/components/ui/alert.json +0 -6
- package/src/app/components/ui/alert.tsx +0 -66
- package/src/app/components/ui/aspect-ratio.json +0 -6
- package/src/app/components/ui/aspect-ratio.tsx +0 -11
- package/src/app/components/ui/avatar.json +0 -6
- package/src/app/components/ui/avatar.tsx +0 -53
- package/src/app/components/ui/badge.json +0 -6
- package/src/app/components/ui/badge.tsx +0 -46
- package/src/app/components/ui/breadcrumb.json +0 -6
- package/src/app/components/ui/breadcrumb.tsx +0 -107
- package/src/app/components/ui/button.json +0 -6
- package/src/app/components/ui/button.tsx +0 -58
- package/src/app/components/ui/calendar.json +0 -6
- package/src/app/components/ui/calendar.tsx +0 -213
- package/src/app/components/ui/card.json +0 -6
- package/src/app/components/ui/card.tsx +0 -92
- package/src/app/components/ui/carousel.json +0 -6
- package/src/app/components/ui/carousel.tsx +0 -236
- package/src/app/components/ui/chart.json +0 -6
- package/src/app/components/ui/chart.tsx +0 -347
- package/src/app/components/ui/checkbox.json +0 -6
- package/src/app/components/ui/checkbox.tsx +0 -30
- package/src/app/components/ui/collapsible.json +0 -6
- package/src/app/components/ui/collapsible.tsx +0 -33
- package/src/app/components/ui/command.json +0 -6
- package/src/app/components/ui/command.tsx +0 -182
- package/src/app/components/ui/context-menu.json +0 -6
- package/src/app/components/ui/context-menu.tsx +0 -249
- package/src/app/components/ui/dialog.json +0 -6
- package/src/app/components/ui/dialog.tsx +0 -141
- package/src/app/components/ui/drawer.json +0 -6
- package/src/app/components/ui/drawer.tsx +0 -134
- package/src/app/components/ui/dropdown-menu.json +0 -6
- package/src/app/components/ui/dropdown-menu.tsx +0 -256
- package/src/app/components/ui/form.json +0 -12
- package/src/app/components/ui/form.tsx +0 -167
- package/src/app/components/ui/hover-card.json +0 -6
- package/src/app/components/ui/hover-card.tsx +0 -49
- package/src/app/components/ui/input-otp.json +0 -6
- package/src/app/components/ui/input-otp.tsx +0 -76
- package/src/app/components/ui/input.json +0 -6
- package/src/app/components/ui/input.tsx +0 -21
- package/src/app/components/ui/label.json +0 -6
- package/src/app/components/ui/label.tsx +0 -24
- package/src/app/components/ui/menubar.json +0 -6
- package/src/app/components/ui/menubar.tsx +0 -273
- package/src/app/components/ui/navigation-menu.json +0 -6
- package/src/app/components/ui/navigation-menu.tsx +0 -164
- package/src/app/components/ui/pagination.json +0 -6
- package/src/app/components/ui/pagination.tsx +0 -124
- package/src/app/components/ui/popover.json +0 -6
- package/src/app/components/ui/popover.tsx +0 -55
- package/src/app/components/ui/progress.json +0 -6
- package/src/app/components/ui/progress.tsx +0 -30
- package/src/app/components/ui/radio-group.json +0 -6
- package/src/app/components/ui/radio-group.tsx +0 -43
- package/src/app/components/ui/resizable.json +0 -6
- package/src/app/components/ui/resizable.tsx +0 -55
- package/src/app/components/ui/scroll-area.json +0 -6
- package/src/app/components/ui/scroll-area.tsx +0 -55
- package/src/app/components/ui/select.json +0 -6
- package/src/app/components/ui/select.tsx +0 -179
- package/src/app/components/ui/separator.json +0 -6
- package/src/app/components/ui/separator.tsx +0 -28
- package/src/app/components/ui/sheet.json +0 -6
- package/src/app/components/ui/sheet.tsx +0 -145
- package/src/app/components/ui/sidebar.json +0 -6
- package/src/app/components/ui/sidebar.tsx +0 -718
- package/src/app/components/ui/skeleton.json +0 -6
- package/src/app/components/ui/skeleton.tsx +0 -13
- package/src/app/components/ui/slider.json +0 -6
- package/src/app/components/ui/slider.tsx +0 -61
- package/src/app/components/ui/sonner.json +0 -6
- package/src/app/components/ui/sonner.tsx +0 -25
- package/src/app/components/ui/switch.json +0 -6
- package/src/app/components/ui/switch.tsx +0 -30
- package/src/app/components/ui/table.json +0 -6
- package/src/app/components/ui/table.tsx +0 -115
- package/src/app/components/ui/tabs.json +0 -6
- package/src/app/components/ui/tabs.tsx +0 -66
- package/src/app/components/ui/textarea.json +0 -6
- package/src/app/components/ui/textarea.tsx +0 -18
- package/src/app/components/ui/toggle-group.json +0 -6
- package/src/app/components/ui/toggle-group.tsx +0 -71
- package/src/app/components/ui/toggle.json +0 -6
- package/src/app/components/ui/toggle.tsx +0 -47
- package/src/app/components/ui/tooltip.json +0 -6
- package/src/app/components/ui/tooltip.tsx +0 -60
- package/src/app/hooks/use-mobile.ts +0 -21
- package/src/app/lib/utils.ts +0 -6
- package/src/app/tsconfig.json +0 -27
- package/src/template/components.json +0 -21
- package/src/template/next-env.d.ts +0 -5
- package/src/template/public/.gitkeep +0 -0
- package/src/template/src/lib/axios.ts +0 -39
- package/src/template/src/lib/constants.ts +0 -1
- package/src/template/src/lib/utils.ts +0 -6
- package/src/template/src/providers/query.provider.tsx +0 -12
- package/src/template/src/providers/theme.provider.tsx +0 -8
- package/src/utils.js +0 -113
- /package/src/template/{src/app → public}/favicon.ico +0 -0
package/src/constants.js
CHANGED
|
@@ -1,97 +1,234 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
|
|
4
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
-
const __dirname = path.dirname(__filename);
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
|
|
4
|
+
export const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
export const __dirname = path.dirname(__filename);
|
|
6
|
+
|
|
7
|
+
export const CWD = path.resolve(process.cwd());
|
|
8
|
+
|
|
9
|
+
export const TEMPLATE_FOLDER_PATH = path.join(__dirname, "template");
|
|
10
|
+
export const THEME_FOLDER_PATH = path.join(__dirname, "themes");
|
|
11
|
+
export const TIOELVIS_COMPONENTS_FOLDER_PATH = path.join(
|
|
12
|
+
__dirname,
|
|
13
|
+
"tioelvis-components"
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export const MAIN_DEPENDENCIES = [
|
|
17
|
+
"next@latest",
|
|
18
|
+
"react@latest",
|
|
19
|
+
"react-dom@latest",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export const MAIN_DEV_DEPENDENCIES = [
|
|
23
|
+
"@tailwindcss/postcss@latest",
|
|
24
|
+
"@types/node@latest",
|
|
25
|
+
"@types/react@latest",
|
|
26
|
+
"@types/react-dom@latest",
|
|
27
|
+
"eslint@latest",
|
|
28
|
+
"eslint-config-next@latest",
|
|
29
|
+
"tailwindcss@latest",
|
|
30
|
+
"typescript@latest",
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export const context = {
|
|
34
|
+
dest: "",
|
|
35
|
+
projectName: null,
|
|
36
|
+
packageManager: null,
|
|
37
|
+
isNewProject: true,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const SHADCN_COMPONENTS = [
|
|
41
|
+
{
|
|
42
|
+
title: "Accordion",
|
|
43
|
+
value: "accordion",
|
|
44
|
+
description: "Collapsible content panels",
|
|
45
|
+
},
|
|
46
|
+
{ title: "Alert", value: "alert", description: "Display important messages" },
|
|
47
|
+
{
|
|
48
|
+
title: "Alert Dialog",
|
|
49
|
+
value: "alert-dialog",
|
|
50
|
+
description: "Modal dialog for critical actions",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: "Aspect Ratio",
|
|
54
|
+
value: "aspect-ratio",
|
|
55
|
+
description: "Maintain consistent aspect ratios",
|
|
56
|
+
},
|
|
57
|
+
{ title: "Avatar", value: "avatar", description: "User profile images" },
|
|
58
|
+
{ title: "Badge", value: "badge", description: "Small labels and tags" },
|
|
59
|
+
{
|
|
60
|
+
title: "Breadcrumb",
|
|
61
|
+
value: "breadcrumb",
|
|
62
|
+
description: "Navigation path indicator",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
title: "Button",
|
|
66
|
+
value: "button",
|
|
67
|
+
description: "Interactive clickable elements",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
title: "Calendar",
|
|
71
|
+
value: "calendar",
|
|
72
|
+
description: "Date selection component",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
title: "Card",
|
|
76
|
+
value: "card",
|
|
77
|
+
description: "Container for grouped content",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: "Carousel",
|
|
81
|
+
value: "carousel",
|
|
82
|
+
description: "Image and content slider",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: "Chart",
|
|
86
|
+
value: "chart",
|
|
87
|
+
description: "Data visualization component",
|
|
88
|
+
},
|
|
89
|
+
{ title: "Checkbox", value: "checkbox", description: "Multi-select input" },
|
|
90
|
+
{
|
|
91
|
+
title: "Collapsible",
|
|
92
|
+
value: "collapsible",
|
|
93
|
+
description: "Toggle expandable sections",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
title: "Command",
|
|
97
|
+
value: "command",
|
|
98
|
+
description: "Command palette interface",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
title: "Context Menu",
|
|
102
|
+
value: "context-menu",
|
|
103
|
+
description: "Right-click menu",
|
|
104
|
+
},
|
|
105
|
+
{ title: "Dialog", value: "dialog", description: "Modal dialog box" },
|
|
106
|
+
{ title: "Drawer", value: "drawer", description: "Side panel overlay" },
|
|
107
|
+
{
|
|
108
|
+
title: "Dropdown Menu",
|
|
109
|
+
value: "dropdown-menu",
|
|
110
|
+
description: "Dropdown action menu",
|
|
111
|
+
},
|
|
112
|
+
{ title: "Form", value: "form", description: "Form input wrapper" },
|
|
113
|
+
{ title: "Hover Card", value: "hover-card", description: "Tooltip on hover" },
|
|
114
|
+
{ title: "Input", value: "input", description: "Text input field" },
|
|
115
|
+
{
|
|
116
|
+
title: "Input OTP",
|
|
117
|
+
value: "input-otp",
|
|
118
|
+
description: "One-time password input",
|
|
119
|
+
},
|
|
120
|
+
{ title: "Label", value: "label", description: "Form field label" },
|
|
121
|
+
{ title: "Menubar", value: "menubar", description: "Application menu bar" },
|
|
122
|
+
{
|
|
123
|
+
title: "Navigation Menu",
|
|
124
|
+
value: "navigation-menu",
|
|
125
|
+
description: "Horizontal navigation",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
title: "Pagination",
|
|
129
|
+
value: "pagination",
|
|
130
|
+
description: "Page navigation controls",
|
|
131
|
+
},
|
|
132
|
+
{ title: "Popover", value: "popover", description: "Floating content box" },
|
|
133
|
+
{
|
|
134
|
+
title: "Progress",
|
|
135
|
+
value: "progress",
|
|
136
|
+
description: "Progress bar indicator",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
title: "Radio Group",
|
|
140
|
+
value: "radio-group",
|
|
141
|
+
description: "Single-select option group",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
title: "Resizable",
|
|
145
|
+
value: "resizable",
|
|
146
|
+
description: "Resizable panel container",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
title: "Scroll Area",
|
|
150
|
+
value: "scroll-area",
|
|
151
|
+
description: "Custom scrollable container",
|
|
152
|
+
},
|
|
153
|
+
{ title: "Select", value: "select", description: "Dropdown select field" },
|
|
154
|
+
{
|
|
155
|
+
title: "Separator",
|
|
156
|
+
value: "separator",
|
|
157
|
+
description: "Visual divider line",
|
|
158
|
+
},
|
|
159
|
+
{ title: "Sheet", value: "sheet", description: "Modal sheet panel" },
|
|
160
|
+
{ title: "Sidebar", value: "sidebar", description: "Side navigation panel" },
|
|
161
|
+
{ title: "Skeleton", value: "skeleton", description: "Loading placeholder" },
|
|
162
|
+
{ title: "Slider", value: "slider", description: "Range slider input" },
|
|
163
|
+
{
|
|
164
|
+
title: "Sonner",
|
|
165
|
+
value: "sonner",
|
|
166
|
+
description: "Toast notification system",
|
|
167
|
+
},
|
|
168
|
+
{ title: "Switch", value: "switch", description: "Toggle switch control" },
|
|
169
|
+
{ title: "Table", value: "table", description: "Data table component" },
|
|
170
|
+
{ title: "Tabs", value: "tabs", description: "Tabbed content sections" },
|
|
171
|
+
{
|
|
172
|
+
title: "Textarea",
|
|
173
|
+
value: "textarea",
|
|
174
|
+
description: "Multi-line text input",
|
|
175
|
+
},
|
|
176
|
+
{ title: "Toggle", value: "toggle", description: "Toggle button control" },
|
|
177
|
+
{
|
|
178
|
+
title: "Toggle Group",
|
|
179
|
+
value: "toggle-group",
|
|
180
|
+
description: "Group of toggle buttons",
|
|
181
|
+
},
|
|
182
|
+
{ title: "Tooltip", value: "tooltip", description: "Informative hover text" },
|
|
183
|
+
];
|
|
184
|
+
|
|
185
|
+
export const THEME_COLORS = [
|
|
186
|
+
{
|
|
187
|
+
title: "Default",
|
|
188
|
+
value: "default",
|
|
189
|
+
hex: "#171717",
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
title: "Blue",
|
|
193
|
+
value: "blue",
|
|
194
|
+
hex: "#1447e6",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
title: "Green",
|
|
198
|
+
value: "green",
|
|
199
|
+
hex: "#5ea500",
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
title: "Orange",
|
|
203
|
+
value: "orange",
|
|
204
|
+
hex: "#f54a00",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
title: "Red",
|
|
208
|
+
value: "red",
|
|
209
|
+
hex: "#e7000b",
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
title: "Rose",
|
|
213
|
+
value: "rose",
|
|
214
|
+
hex: "#ec003f",
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
title: "Violet",
|
|
218
|
+
value: "violet",
|
|
219
|
+
hex: "#7f22fe",
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
title: "Yellow",
|
|
223
|
+
value: "yellow",
|
|
224
|
+
hex: "#fcc800",
|
|
225
|
+
},
|
|
226
|
+
];
|
|
227
|
+
|
|
228
|
+
export const TIOELVIS_COMPONENTS = [
|
|
229
|
+
{
|
|
230
|
+
title: "Max Width Wrapper",
|
|
231
|
+
value: "max-width-wrapper",
|
|
232
|
+
description: "A responsive max-width wrapper component.",
|
|
233
|
+
},
|
|
234
|
+
];
|
package/src/lib/utils.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { context } from "../constants.js";
|
|
4
|
+
import { spawn } from "node:child_process";
|
|
5
|
+
|
|
6
|
+
const activeProcesses = new Set();
|
|
7
|
+
|
|
8
|
+
export function onCancel() {
|
|
9
|
+
console.log(chalk.yellow("\n\nExiting..."));
|
|
10
|
+
|
|
11
|
+
if (activeProcesses.size > 0) {
|
|
12
|
+
activeProcesses.forEach((child) => {
|
|
13
|
+
try {
|
|
14
|
+
child.kill("SIGTERM");
|
|
15
|
+
} catch (e) {
|
|
16
|
+
/* Ignore errors */
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
activeProcesses.clear();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
if (context.dest && fs.existsSync(context.dest)) {
|
|
24
|
+
try {
|
|
25
|
+
fs.rmSync(context.dest, { recursive: true, force: true });
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.log(chalk.red(`Could not delete folder: ${error.message}`));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}, 500);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function runCommand(command, args, cwd) {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
const child = spawn(command, args, {
|
|
37
|
+
cwd,
|
|
38
|
+
stdio: "ignore",
|
|
39
|
+
shell: process.platform === "win32",
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
activeProcesses.add(child);
|
|
43
|
+
|
|
44
|
+
child.on("error", (error) => {
|
|
45
|
+
activeProcesses.delete(child);
|
|
46
|
+
reject(error);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
child.on("close", (code) => {
|
|
50
|
+
activeProcesses.delete(child);
|
|
51
|
+
if (code === 0) resolve();
|
|
52
|
+
else reject(new Error(`${command} exited with code ${code}`));
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|