create-deesse-app 0.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/README.md +14 -0
- package/bin/index.js +63 -0
- package/package.json +16 -0
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# create-deesse-app
|
|
2
|
+
|
|
3
|
+
Bootstrap a new [DeesseJS](https://github.com/DevelopersSecrets/DeesseJS) project in seconds.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx create-deesse-app my-app
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This will:
|
|
12
|
+
1. Clone the official DeesseJS template
|
|
13
|
+
2. Install all dependencies.
|
|
14
|
+
3. Set up a ready-to-run fullstack app.
|
package/bin/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
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);
|
|
63
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-deesse-app",
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"description": "CLI to bootstrap a new DeesseJS project",
|
|
5
|
+
"bin": {
|
|
6
|
+
"create-deesse-app": "bin/index.js"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"bin"
|
|
11
|
+
],
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"prompts": "^2.4.2",
|
|
14
|
+
"execa": "^8.0.1"
|
|
15
|
+
}
|
|
16
|
+
}
|