create-n8-app 0.1.1 → 0.2.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/dist/index.js +39 -28
- package/package.json +1 -1
- package/template/_package.json +35 -35
- package/template/app/globals.css +112 -14
- package/template/components.json +0 -21
package/dist/index.js
CHANGED
|
@@ -44,6 +44,21 @@ async function copyTemplate(targetDir, projectName) {
|
|
|
44
44
|
// src/utils/install-deps.ts
|
|
45
45
|
import { execa } from "execa";
|
|
46
46
|
|
|
47
|
+
// src/helpers/get-package-manager.ts
|
|
48
|
+
function getPackageManager() {
|
|
49
|
+
const userAgent = process.env.npm_config_user_agent || "";
|
|
50
|
+
if (userAgent.startsWith("pnpm")) {
|
|
51
|
+
return "pnpm";
|
|
52
|
+
}
|
|
53
|
+
if (userAgent.startsWith("yarn")) {
|
|
54
|
+
return "yarn";
|
|
55
|
+
}
|
|
56
|
+
if (userAgent.startsWith("bun")) {
|
|
57
|
+
return "bun";
|
|
58
|
+
}
|
|
59
|
+
return "npm";
|
|
60
|
+
}
|
|
61
|
+
|
|
47
62
|
// src/utils/logger.ts
|
|
48
63
|
import chalk from "chalk";
|
|
49
64
|
var logger = {
|
|
@@ -74,22 +89,27 @@ var logger = {
|
|
|
74
89
|
|
|
75
90
|
// src/utils/install-deps.ts
|
|
76
91
|
async function installDependencies(targetDir) {
|
|
77
|
-
|
|
92
|
+
const pm = getPackageManager();
|
|
93
|
+
logger.info(`Installing dependencies with ${pm}...`);
|
|
78
94
|
try {
|
|
79
|
-
await execa(
|
|
95
|
+
await execa(pm, ["install"], {
|
|
80
96
|
cwd: targetDir,
|
|
81
97
|
stdio: "inherit"
|
|
82
98
|
});
|
|
83
99
|
logger.success("Dependencies installed successfully");
|
|
84
100
|
} catch (error) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
101
|
+
if (pm !== "npm") {
|
|
102
|
+
logger.warn(`${pm} failed, trying npm...`);
|
|
103
|
+
try {
|
|
104
|
+
await execa("npm", ["install"], {
|
|
105
|
+
cwd: targetDir,
|
|
106
|
+
stdio: "inherit"
|
|
107
|
+
});
|
|
108
|
+
logger.success("Dependencies installed successfully with npm");
|
|
109
|
+
} catch {
|
|
110
|
+
throw new Error("Failed to install dependencies");
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
93
113
|
throw new Error("Failed to install dependencies");
|
|
94
114
|
}
|
|
95
115
|
}
|
|
@@ -101,9 +121,15 @@ async function runShadcnInit(targetDir) {
|
|
|
101
121
|
cwd: targetDir,
|
|
102
122
|
stdio: "inherit"
|
|
103
123
|
});
|
|
104
|
-
logger.
|
|
124
|
+
logger.info("Adding base Shadcn/ui components...");
|
|
125
|
+
const baseComponents = ["button", "card", "input", "label"];
|
|
126
|
+
await execa("npx", ["shadcn@latest", "add", ...baseComponents, "-y"], {
|
|
127
|
+
cwd: targetDir,
|
|
128
|
+
stdio: "inherit"
|
|
129
|
+
});
|
|
130
|
+
logger.success("Shadcn/ui initialized with base components");
|
|
105
131
|
} catch (error) {
|
|
106
|
-
logger.warn('Shadcn/ui
|
|
132
|
+
logger.warn('Shadcn/ui setup skipped - run "npx shadcn@latest init" later');
|
|
107
133
|
}
|
|
108
134
|
}
|
|
109
135
|
|
|
@@ -130,21 +156,6 @@ async function initGit(targetDir) {
|
|
|
130
156
|
}
|
|
131
157
|
}
|
|
132
158
|
|
|
133
|
-
// src/helpers/get-package-manager.ts
|
|
134
|
-
function getPackageManager() {
|
|
135
|
-
const userAgent = process.env.npm_config_user_agent || "";
|
|
136
|
-
if (userAgent.startsWith("pnpm")) {
|
|
137
|
-
return "pnpm";
|
|
138
|
-
}
|
|
139
|
-
if (userAgent.startsWith("yarn")) {
|
|
140
|
-
return "yarn";
|
|
141
|
-
}
|
|
142
|
-
if (userAgent.startsWith("bun")) {
|
|
143
|
-
return "bun";
|
|
144
|
-
}
|
|
145
|
-
return "npm";
|
|
146
|
-
}
|
|
147
|
-
|
|
148
159
|
// src/create-project.ts
|
|
149
160
|
async function createProject(options) {
|
|
150
161
|
logger.title("\u{1F680} Create N8 App");
|
|
@@ -221,7 +232,7 @@ async function createProject(options) {
|
|
|
221
232
|
|
|
222
233
|
// src/index.ts
|
|
223
234
|
var program = new Command();
|
|
224
|
-
program.name("create-n8-app").description("Create a new Next.js app with the N8 stack").version("0.
|
|
235
|
+
program.name("create-n8-app").description("Create a new Next.js app with the N8 stack").version("0.2.0").argument("[project-name]", "Name of the project").option("--skip-install", "Skip installing dependencies").option("--skip-git", "Skip initializing git repository").action(async (projectName, options) => {
|
|
225
236
|
try {
|
|
226
237
|
await createProject({
|
|
227
238
|
projectName,
|
package/package.json
CHANGED
package/template/_package.json
CHANGED
|
@@ -17,43 +17,43 @@
|
|
|
17
17
|
"db:studio": "drizzle-kit studio"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@trpc/
|
|
25
|
-
"@trpc/
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"drizzle-orm": "^0.36.4",
|
|
29
|
-
"next": "^15.1.0",
|
|
30
|
-
"next-auth": "^5.0.0-beta.25",
|
|
31
|
-
"react": "^19.0.0",
|
|
32
|
-
"react-dom": "^19.0.0",
|
|
33
|
-
"zod": "^3.23.8",
|
|
34
|
-
"zustand": "^5.0.2",
|
|
35
|
-
"superjson": "^2.2.2",
|
|
20
|
+
"@ai-sdk/openai": "^1.3.0",
|
|
21
|
+
"@auth/drizzle-adapter": "^1.11.0",
|
|
22
|
+
"@neondatabase/serverless": "^1.0.0",
|
|
23
|
+
"@tanstack/react-query": "^5.90.0",
|
|
24
|
+
"@trpc/client": "^11.8.0",
|
|
25
|
+
"@trpc/react-query": "^11.8.0",
|
|
26
|
+
"@trpc/server": "^11.8.0",
|
|
27
|
+
"ai": "^4.3.0",
|
|
36
28
|
"clsx": "^2.1.1",
|
|
37
|
-
"
|
|
38
|
-
"lucide-react": "^0.
|
|
29
|
+
"drizzle-orm": "^0.45.0",
|
|
30
|
+
"lucide-react": "^0.563.0",
|
|
31
|
+
"next": "^16.0.0",
|
|
32
|
+
"next-auth": "^5.0.0-beta.30",
|
|
33
|
+
"react": "^19.2.0",
|
|
34
|
+
"react-dom": "^19.2.0",
|
|
35
|
+
"superjson": "^2.2.6",
|
|
36
|
+
"tailwind-merge": "^3.4.0",
|
|
37
|
+
"zod": "^3.25.0",
|
|
38
|
+
"zustand": "^5.0.10"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@tailwindcss/postcss": "^4.
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@types/
|
|
45
|
-
"@
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
41
|
+
"@tailwindcss/postcss": "^4.1.0",
|
|
42
|
+
"@testing-library/jest-dom": "^6.9.0",
|
|
43
|
+
"@testing-library/react": "^16.3.0",
|
|
44
|
+
"@types/node": "^22.19.0",
|
|
45
|
+
"@types/react": "^19.2.0",
|
|
46
|
+
"@types/react-dom": "^19.2.0",
|
|
47
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
48
|
+
"drizzle-kit": "^0.31.0",
|
|
49
|
+
"eslint": "^9.39.0",
|
|
50
|
+
"eslint-config-next": "^16.0.0",
|
|
51
|
+
"jsdom": "^27.4.0",
|
|
52
|
+
"postcss": "^8.5.0",
|
|
53
|
+
"prettier": "^3.8.0",
|
|
54
|
+
"prettier-plugin-tailwindcss": "^0.7.0",
|
|
55
|
+
"tailwindcss": "^4.1.0",
|
|
56
|
+
"typescript": "^5.9.0",
|
|
57
|
+
"vitest": "^4.0.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/template/app/globals.css
CHANGED
|
@@ -1,25 +1,123 @@
|
|
|
1
1
|
@import 'tailwindcss';
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
|
|
3
|
+
@custom-variant dark (&:is(.dark *));
|
|
4
|
+
|
|
5
|
+
@theme inline {
|
|
6
|
+
/* Fonts */
|
|
5
7
|
--font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
|
|
6
8
|
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
|
|
7
9
|
|
|
8
|
-
/*
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
--color-
|
|
15
|
-
--color-
|
|
16
|
-
--color-
|
|
17
|
-
--color-
|
|
18
|
-
--color-
|
|
19
|
-
--color-
|
|
10
|
+
/* Border radius */
|
|
11
|
+
--radius-lg: 0.5rem;
|
|
12
|
+
--radius-md: calc(var(--radius-lg) - 2px);
|
|
13
|
+
--radius-sm: calc(var(--radius-lg) - 4px);
|
|
14
|
+
|
|
15
|
+
/* Shadcn/ui color tokens */
|
|
16
|
+
--color-background: hsl(var(--background));
|
|
17
|
+
--color-foreground: hsl(var(--foreground));
|
|
18
|
+
--color-card: hsl(var(--card));
|
|
19
|
+
--color-card-foreground: hsl(var(--card-foreground));
|
|
20
|
+
--color-popover: hsl(var(--popover));
|
|
21
|
+
--color-popover-foreground: hsl(var(--popover-foreground));
|
|
22
|
+
--color-primary: hsl(var(--primary));
|
|
23
|
+
--color-primary-foreground: hsl(var(--primary-foreground));
|
|
24
|
+
--color-secondary: hsl(var(--secondary));
|
|
25
|
+
--color-secondary-foreground: hsl(var(--secondary-foreground));
|
|
26
|
+
--color-muted: hsl(var(--muted));
|
|
27
|
+
--color-muted-foreground: hsl(var(--muted-foreground));
|
|
28
|
+
--color-accent: hsl(var(--accent));
|
|
29
|
+
--color-accent-foreground: hsl(var(--accent-foreground));
|
|
30
|
+
--color-destructive: hsl(var(--destructive));
|
|
31
|
+
--color-destructive-foreground: hsl(var(--destructive-foreground));
|
|
32
|
+
--color-border: hsl(var(--border));
|
|
33
|
+
--color-input: hsl(var(--input));
|
|
34
|
+
--color-ring: hsl(var(--ring));
|
|
35
|
+
--color-chart-1: hsl(var(--chart-1));
|
|
36
|
+
--color-chart-2: hsl(var(--chart-2));
|
|
37
|
+
--color-chart-3: hsl(var(--chart-3));
|
|
38
|
+
--color-chart-4: hsl(var(--chart-4));
|
|
39
|
+
--color-chart-5: hsl(var(--chart-5));
|
|
40
|
+
--color-sidebar: hsl(var(--sidebar-background));
|
|
41
|
+
--color-sidebar-foreground: hsl(var(--sidebar-foreground));
|
|
42
|
+
--color-sidebar-primary: hsl(var(--sidebar-primary));
|
|
43
|
+
--color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
|
|
44
|
+
--color-sidebar-accent: hsl(var(--sidebar-accent));
|
|
45
|
+
--color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
|
|
46
|
+
--color-sidebar-border: hsl(var(--sidebar-border));
|
|
47
|
+
--color-sidebar-ring: hsl(var(--sidebar-ring));
|
|
20
48
|
}
|
|
21
49
|
|
|
22
50
|
@layer base {
|
|
51
|
+
:root {
|
|
52
|
+
--background: 0 0% 100%;
|
|
53
|
+
--foreground: 222.2 84% 4.9%;
|
|
54
|
+
--card: 0 0% 100%;
|
|
55
|
+
--card-foreground: 222.2 84% 4.9%;
|
|
56
|
+
--popover: 0 0% 100%;
|
|
57
|
+
--popover-foreground: 222.2 84% 4.9%;
|
|
58
|
+
--primary: 222.2 47.4% 11.2%;
|
|
59
|
+
--primary-foreground: 210 40% 98%;
|
|
60
|
+
--secondary: 210 40% 96.1%;
|
|
61
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
62
|
+
--muted: 210 40% 96.1%;
|
|
63
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
64
|
+
--accent: 210 40% 96.1%;
|
|
65
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
66
|
+
--destructive: 0 84.2% 60.2%;
|
|
67
|
+
--destructive-foreground: 210 40% 98%;
|
|
68
|
+
--border: 214.3 31.8% 91.4%;
|
|
69
|
+
--input: 214.3 31.8% 91.4%;
|
|
70
|
+
--ring: 222.2 84% 4.9%;
|
|
71
|
+
--chart-1: 12 76% 61%;
|
|
72
|
+
--chart-2: 173 58% 39%;
|
|
73
|
+
--chart-3: 197 37% 24%;
|
|
74
|
+
--chart-4: 43 74% 66%;
|
|
75
|
+
--chart-5: 27 87% 67%;
|
|
76
|
+
--sidebar-background: 0 0% 98%;
|
|
77
|
+
--sidebar-foreground: 240 5.3% 26.1%;
|
|
78
|
+
--sidebar-primary: 240 5.9% 10%;
|
|
79
|
+
--sidebar-primary-foreground: 0 0% 98%;
|
|
80
|
+
--sidebar-accent: 240 4.8% 95.9%;
|
|
81
|
+
--sidebar-accent-foreground: 240 5.9% 10%;
|
|
82
|
+
--sidebar-border: 220 13% 91%;
|
|
83
|
+
--sidebar-ring: 217.2 91.2% 59.8%;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.dark {
|
|
87
|
+
--background: 222.2 84% 4.9%;
|
|
88
|
+
--foreground: 210 40% 98%;
|
|
89
|
+
--card: 222.2 84% 4.9%;
|
|
90
|
+
--card-foreground: 210 40% 98%;
|
|
91
|
+
--popover: 222.2 84% 4.9%;
|
|
92
|
+
--popover-foreground: 210 40% 98%;
|
|
93
|
+
--primary: 210 40% 98%;
|
|
94
|
+
--primary-foreground: 222.2 47.4% 11.2%;
|
|
95
|
+
--secondary: 217.2 32.6% 17.5%;
|
|
96
|
+
--secondary-foreground: 210 40% 98%;
|
|
97
|
+
--muted: 217.2 32.6% 17.5%;
|
|
98
|
+
--muted-foreground: 215 20.2% 65.1%;
|
|
99
|
+
--accent: 217.2 32.6% 17.5%;
|
|
100
|
+
--accent-foreground: 210 40% 98%;
|
|
101
|
+
--destructive: 0 62.8% 30.6%;
|
|
102
|
+
--destructive-foreground: 210 40% 98%;
|
|
103
|
+
--border: 217.2 32.6% 17.5%;
|
|
104
|
+
--input: 217.2 32.6% 17.5%;
|
|
105
|
+
--ring: 212.7 26.8% 83.9%;
|
|
106
|
+
--chart-1: 220 70% 50%;
|
|
107
|
+
--chart-2: 160 60% 45%;
|
|
108
|
+
--chart-3: 30 80% 55%;
|
|
109
|
+
--chart-4: 280 65% 60%;
|
|
110
|
+
--chart-5: 340 75% 55%;
|
|
111
|
+
--sidebar-background: 240 5.9% 10%;
|
|
112
|
+
--sidebar-foreground: 240 4.8% 95.9%;
|
|
113
|
+
--sidebar-primary: 224.3 76.3% 48%;
|
|
114
|
+
--sidebar-primary-foreground: 0 0% 100%;
|
|
115
|
+
--sidebar-accent: 240 3.7% 15.9%;
|
|
116
|
+
--sidebar-accent-foreground: 240 4.8% 95.9%;
|
|
117
|
+
--sidebar-border: 240 3.7% 15.9%;
|
|
118
|
+
--sidebar-ring: 217.2 91.2% 59.8%;
|
|
119
|
+
}
|
|
120
|
+
|
|
23
121
|
* {
|
|
24
122
|
@apply border-border;
|
|
25
123
|
}
|
package/template/components.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "new-york",
|
|
4
|
-
"rsc": true,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "",
|
|
8
|
-
"css": "app/globals.css",
|
|
9
|
-
"baseColor": "slate",
|
|
10
|
-
"cssVariables": true,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"aliases": {
|
|
14
|
-
"components": "@/components",
|
|
15
|
-
"utils": "@/lib/utils",
|
|
16
|
-
"ui": "@/components/ui",
|
|
17
|
-
"lib": "@/lib",
|
|
18
|
-
"hooks": "@/hooks"
|
|
19
|
-
},
|
|
20
|
-
"iconLibrary": "lucide"
|
|
21
|
-
}
|