@tioelvis/next-template 2.4.6 → 2.4.8
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tioelvis/next-template",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.8",
|
|
4
4
|
"description": "CLI to scaffold a Next.js + Tailwind project using shadcn/ui components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -74,7 +74,6 @@
|
|
|
74
74
|
"input-otp": "^1.4.2",
|
|
75
75
|
"lucide-react": "^0.532.0",
|
|
76
76
|
"next": "^15.4.4",
|
|
77
|
-
"next-auth": "^4.24.11",
|
|
78
77
|
"next-themes": "^0.4.6",
|
|
79
78
|
"react": "^19.1.0",
|
|
80
79
|
"react-day-picker": "^9.8.1",
|
|
@@ -9,8 +9,7 @@ const buttonVariants = cva(
|
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default:
|
|
13
|
-
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
12
|
+
default: "bg-primary text-white shadow-xs hover:bg-primary/90",
|
|
14
13
|
destructive:
|
|
15
14
|
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
16
15
|
outline:
|
package/src/constants.js
CHANGED
package/src/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
copy_components,
|
|
@@ -176,24 +176,20 @@ process.on("SIGINT", () => on_cancel());
|
|
|
176
176
|
return { title: e, value: e };
|
|
177
177
|
}),
|
|
178
178
|
},
|
|
179
|
+
{
|
|
180
|
+
type: "select",
|
|
181
|
+
name: "package_manager",
|
|
182
|
+
message: "Which package manager would you want to use?",
|
|
183
|
+
choices: [
|
|
184
|
+
{ title: "npm", value: "npm" },
|
|
185
|
+
{ title: "pnpm", value: "pnpm" },
|
|
186
|
+
],
|
|
187
|
+
},
|
|
179
188
|
],
|
|
180
189
|
{ onCancel: on_cancel }
|
|
181
190
|
);
|
|
182
191
|
|
|
183
|
-
const { components } = responses;
|
|
184
|
-
|
|
185
|
-
// Set package manager
|
|
186
|
-
if (fs.existsSync(path.join(CWD, "package-lock.json")) === true) {
|
|
187
|
-
package_manager = "npm";
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (fs.existsSync(path.join(CWD, "pnpm-lock.yaml")) === true) {
|
|
191
|
-
package_manager = "pnpm";
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (package_manager === undefined) {
|
|
195
|
-
throw new Error("Not package_manager found");
|
|
196
|
-
}
|
|
192
|
+
const { components, package_manager } = responses;
|
|
197
193
|
|
|
198
194
|
// Copying files
|
|
199
195
|
DEST = path.resolve(CWD);
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { API } from "@/lib/constants";
|
|
2
|
+
import axios, { isAxiosError } from "axios";
|
|
3
|
+
|
|
4
|
+
export const axios_instance = axios.create({
|
|
5
|
+
baseURL: API,
|
|
6
|
+
withCredentials: true,
|
|
7
|
+
});
|
|
2
8
|
|
|
3
9
|
export class CustomAxiosError extends Error {
|
|
10
|
+
status: number;
|
|
11
|
+
|
|
4
12
|
constructor(error: unknown) {
|
|
5
13
|
let message = "";
|
|
14
|
+
let status = 500;
|
|
6
15
|
|
|
7
16
|
if (isAxiosError(error) === true) {
|
|
8
|
-
|
|
17
|
+
status = error.response?.status ?? 500;
|
|
9
18
|
const p = error.response?.data?.message;
|
|
10
19
|
|
|
11
20
|
if (status === 401 || status === 403) {
|
|
@@ -24,6 +33,7 @@ export class CustomAxiosError extends Error {
|
|
|
24
33
|
|
|
25
34
|
super(message);
|
|
26
35
|
this.name = "CustomAxiosError";
|
|
36
|
+
this.status = status;
|
|
27
37
|
Object.setPrototypeOf(this, CustomAxiosError.prototype);
|
|
28
38
|
}
|
|
29
39
|
}
|