@marvs13/marvinel-nextjs-supabase-starting-kit 1.0.4 → 1.0.6
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/cli.js +22 -29
- package/package.json +1 -1
- /package/template/{src/app → app}/(auth)/change-password/page.tsx +0 -0
- /package/template/{src/app → app}/(auth)/login/page.tsx +0 -0
- /package/template/{src/app → app}/(auth)/request-reset-password/page.tsx +0 -0
- /package/template/{src/app → app}/(auth)/reset-password/page.tsx +0 -0
- /package/template/{src/app → app}/(auth)/signup/page.tsx +0 -0
- /package/template/{src/app → app}/(auth)/signup-success/page.tsx +0 -0
- /package/template/{src/app → app}/favicon.ico +0 -0
- /package/template/{src/app → app}/globals.css +0 -0
- /package/template/{src/app → app}/home/page.tsx +0 -0
- /package/template/{src/app → app}/layout.tsx +0 -0
- /package/template/{src/app → app}/not-found.tsx +0 -0
- /package/template/{src/app → app}/page.tsx +0 -0
- /package/template/{src/components → components}/forms/change-password.tsx +0 -0
- /package/template/{src/components → components}/forms/login-form.tsx +0 -0
- /package/template/{src/components → components}/forms/request-reset-password-form.tsx +0 -0
- /package/template/{src/components → components}/forms/reset-password-form.tsx +0 -0
- /package/template/{src/components → components}/forms/signup-form.tsx +0 -0
- /package/template/{src/components → components}/hero.tsx +0 -0
- /package/template/{src/components → components}/logout-button.tsx +0 -0
- /package/template/{src/components → components}/page-not-found.tsx +0 -0
- /package/template/{src/components → components}/ui/button.tsx +0 -0
- /package/template/{src/components → components}/ui/card.tsx +0 -0
- /package/template/{src/components → components}/ui/field.tsx +0 -0
- /package/template/{src/components → components}/ui/input-group.tsx +0 -0
- /package/template/{src/components → components}/ui/input.tsx +0 -0
- /package/template/{src/components → components}/ui/label.tsx +0 -0
- /package/template/{src/components → components}/ui/separator.tsx +0 -0
- /package/template/{src/components → components}/ui/spinner.tsx +0 -0
- /package/template/{src/components → components}/ui/textarea.tsx +0 -0
- /package/template/{src/hooks → hooks}/use-auth-form.ts +0 -0
- /package/template/{src/lib → lib}/supabase/client.ts +0 -0
- /package/template/{src/lib → lib}/supabase/proxy.ts +0 -0
- /package/template/{src/lib → lib}/supabase/server.ts +0 -0
- /package/template/{src/lib → lib}/utils.ts +0 -0
- /package/template/{src/proxy.ts → proxy.ts} +0 -0
- /package/template/{src/schema → schema}/form-schema.ts +0 -0
package/cli.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
mkdirSync,
|
|
8
|
-
readdirSync,
|
|
9
|
-
lstatSync,
|
|
10
|
-
copyFileSync,
|
|
11
|
-
} from "fs";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
12
7
|
|
|
13
|
-
//
|
|
8
|
+
// In ES Modules, __dirname is not available by default, so we define it:
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
|
|
12
|
+
// Detect package manager
|
|
14
13
|
const userAgent = process.env.npm_config_user_agent || "";
|
|
15
14
|
let packageManager = "npm";
|
|
16
15
|
let execCommand = "npx";
|
|
@@ -24,14 +23,13 @@ if (userAgent.includes("bun")) {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
const projectName = process.argv[2] || "my-auth-app";
|
|
27
|
-
const projectPath = join(process.cwd(), projectName);
|
|
28
|
-
const templatePath = join(__dirname, "template");
|
|
26
|
+
const projectPath = path.join(process.cwd(), projectName);
|
|
27
|
+
const templatePath = path.join(__dirname, "template");
|
|
29
28
|
|
|
30
29
|
try {
|
|
31
30
|
console.log(`🚀 Using ${packageManager} to create: ${projectName}...`);
|
|
32
31
|
|
|
33
|
-
// 1. Run Next.js installer
|
|
34
|
-
// We pass --use-${packageManager} to force Next.js to use the same manager
|
|
32
|
+
// 1. Run Next.js installer
|
|
35
33
|
execSync(
|
|
36
34
|
`${execCommand} create-next-app@latest ${projectName} --ts --tailwind --eslint --app --src-dir --import-alias "@/*" --use-${packageManager} --yes`,
|
|
37
35
|
{ stdio: "inherit" },
|
|
@@ -40,9 +38,7 @@ try {
|
|
|
40
38
|
process.chdir(projectPath);
|
|
41
39
|
|
|
42
40
|
// 2. Install Dependencies
|
|
43
|
-
console.log(
|
|
44
|
-
`📦 Installing Supabase and Auth dependencies via ${packageManager}...`,
|
|
45
|
-
);
|
|
41
|
+
console.log(`📦 Installing Supabase and Auth dependencies...`);
|
|
46
42
|
const deps = [
|
|
47
43
|
"zod",
|
|
48
44
|
"react-hook-form",
|
|
@@ -54,11 +50,11 @@ try {
|
|
|
54
50
|
packageManager === "bun" ? "bun add" : `${packageManager} install`;
|
|
55
51
|
execSync(`${installCmd} ${deps.join(" ")}`, { stdio: "inherit" });
|
|
56
52
|
|
|
57
|
-
// 3. Initialize shadcn
|
|
53
|
+
// 3. Initialize shadcn
|
|
58
54
|
console.log("🎨 Initializing shadcn UI...");
|
|
59
55
|
execSync(`${execCommand} shadcn@latest init -d`, { stdio: "inherit" });
|
|
60
56
|
|
|
61
|
-
// 4.
|
|
57
|
+
// 4. Add components
|
|
62
58
|
console.log("🧩 Adding shadcn components...");
|
|
63
59
|
const components = [
|
|
64
60
|
"button",
|
|
@@ -75,26 +71,23 @@ try {
|
|
|
75
71
|
stdio: "inherit",
|
|
76
72
|
});
|
|
77
73
|
|
|
78
|
-
// 5.
|
|
79
|
-
console.log("
|
|
74
|
+
// 5. Copy Template Files
|
|
75
|
+
console.log("🛠️📂 Injecting Marvinel Template files...");
|
|
80
76
|
const copyFolderSync = (from, to) => {
|
|
81
|
-
if (!existsSync(to)) mkdirSync(to, { recursive: true });
|
|
82
|
-
readdirSync(from).forEach((element) => {
|
|
83
|
-
const stat = lstatSync(join(from, element));
|
|
77
|
+
if (!fs.existsSync(to)) fs.mkdirSync(to, { recursive: true });
|
|
78
|
+
fs.readdirSync(from).forEach((element) => {
|
|
79
|
+
const stat = fs.lstatSync(path.join(from, element));
|
|
84
80
|
if (stat.isFile()) {
|
|
85
|
-
copyFileSync(join(from, element), join(to, element));
|
|
81
|
+
fs.copyFileSync(path.join(from, element), path.join(to, element));
|
|
86
82
|
} else if (stat.isDirectory()) {
|
|
87
|
-
copyFolderSync(join(from, element), join(to, element));
|
|
83
|
+
copyFolderSync(path.join(from, element), path.join(to, element));
|
|
88
84
|
}
|
|
89
85
|
});
|
|
90
86
|
};
|
|
91
87
|
|
|
92
|
-
copyFolderSync(templatePath, join(projectPath, "src"));
|
|
88
|
+
copyFolderSync(templatePath, path.join(projectPath, "src"));
|
|
93
89
|
|
|
94
90
|
console.log(`\n✅ Setup complete! Project is ready.`);
|
|
95
|
-
console.log(
|
|
96
|
-
`\nNext steps:\ncd ${projectName}\n${packageManager === "bun" ? "bun dev" : "npm run dev"}`,
|
|
97
|
-
);
|
|
98
91
|
} catch (error) {
|
|
99
92
|
console.error("❌ Installation failed:", error);
|
|
100
93
|
process.exit(1);
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|