create-deesse-app 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/bin/index.js +48 -62
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -1,63 +1,49 @@
1
- #!/usr/bin/env node
2
- import prompts from "prompts";
3
- import { execa } from "execa";
4
- import { existsSync } from "fs";
5
-
6
- async function main() {
7
- // Demander le nom du projet
8
- const response = await prompts({
9
- type: "text",
10
- name: "projectName",
11
- message: "Project name:",
12
- initial: "deesse-app"
13
- });
14
-
15
- const projectName = response.projectName.trim();
16
- if (!projectName) {
17
- console.error(" Project name is required.");
18
- process.exit(1);
19
- }
20
-
21
- if (existsSync(projectName)) {
22
- console.error(`❌ Folder "${projectName}" already exists.`);
23
- process.exit(1);
24
- }
25
-
26
- console.log(`📦 Creating project "${projectName}"...`);
27
-
28
- // Clone depuis GitHub
29
- await execa("git", [
30
- "clone",
31
- "--depth=1",
32
- "https://github.com/DevelopersSecrets/DeesseJS.git",
33
- projectName
34
- ], { stdio: "inherit" });
35
-
36
- // Supprimer le .git du template pour ne pas polluer l'user
37
- await execa("rm", ["-rf", `${projectName}/.git`]);
38
-
39
- // Installer les dépendances
40
- console.log("📥 Installing dependencies...");
41
- try {
42
- await execa("pnpm", ["install"], { cwd: projectName, stdio: "inherit" });
43
- } catch {
44
- console.log("⚠️ pnpm not found, trying npm...");
45
- await execa("npm", ["install"], { cwd: projectName, stdio: "inherit" });
46
- }
47
-
48
- console.log(`
49
- ✅ Project ready!
50
-
51
- Next steps:
52
- cd ${projectName}
53
- cp .env.example .env
54
- pnpm dev
55
-
56
- 👉 Admin available at http://localhost:3000/admin
57
- `);
58
- }
59
-
60
- main().catch((err) => {
61
- console.error("❌ Error:", err);
62
- process.exit(1);
1
+ #!/usr/bin/env node
2
+ import prompts from "prompts";
3
+ import path from "node:path";
4
+
5
+ async function main() {
6
+ console.log("Create Deesse App · initial setup");
7
+
8
+ const { appPath } = await prompts({
9
+ type: "text",
10
+ name: "appPath",
11
+ message: "App name (relative path, '.' for current dir):",
12
+ initial: ".",
13
+ validate: (val) => (typeof val === "string" && val.trim().length > 0 ? true : "Please provide a valid path"),
14
+ });
15
+
16
+ if (appPath === undefined) {
17
+ console.log("Operation cancelled.");
18
+ process.exit(0);
19
+ }
20
+
21
+ const resolvedPath = path.resolve(process.cwd(), String(appPath).trim());
22
+
23
+ const { template } = await prompts({
24
+ type: "select",
25
+ name: "template",
26
+ message: "Choose a template:",
27
+ choices: [
28
+ { title: "base", value: "base" },
29
+ { title: "docs", value: "docs" },
30
+ { title: "saas", value: "saas" },
31
+ ],
32
+ initial: 0,
33
+ });
34
+
35
+ if (template === undefined) {
36
+ console.log("Operation cancelled.");
37
+ process.exit(0);
38
+ }
39
+
40
+ console.log("\nProject preparation (simulation):");
41
+ console.log("- Destination:", resolvedPath);
42
+ console.log("- Template:", template);
43
+ console.log("\nNo action performed yet. Next step: implement template copy.");
44
+ }
45
+
46
+ main().catch((err) => {
47
+ console.error("Error:", err);
48
+ process.exit(1);
63
49
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-deesse-app",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "CLI to bootstrap a new DeesseJS project",
5
5
  "bin": {
6
6
  "create-deesse-app": "bin/index.js"