mangoose-xempp 1.0.0 → 1.0.2

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/cli.js +20 -3
  2. package/package.json +18 -12
package/bin/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const fs = require('fs-extra');
3
+ const fs = require('fs').promises;
4
4
  const path = require('path');
5
5
  const readline = require('readline');
6
6
 
@@ -32,6 +32,23 @@ function showMenu() {
32
32
  rl.question('Pick (1-5): ', handleSelection);
33
33
  }
34
34
 
35
+ // Copy directory recursively using built-in fs
36
+ async function copyDir(src, dest) {
37
+ await fs.mkdir(dest, { recursive: true });
38
+ const entries = await fs.readdir(src, { withFileTypes: true });
39
+
40
+ for (let entry of entries) {
41
+ const srcPath = path.join(src, entry.name);
42
+ const destPath = path.join(dest, entry.name);
43
+
44
+ if (entry.isDirectory()) {
45
+ await copyDir(srcPath, destPath);
46
+ } else {
47
+ await fs.copyFile(srcPath, destPath);
48
+ }
49
+ }
50
+ }
51
+
35
52
  async function handleSelection(choice) {
36
53
  const project = projects[choice];
37
54
 
@@ -58,7 +75,7 @@ async function handleSelection(choice) {
58
75
  const sourcePath = path.join(__dirname, '..', 'templates', project.folder);
59
76
  const targetPath = path.join(process.cwd(), `mangoose-${project.folder}`);
60
77
 
61
- await fs.copy(sourcePath, targetPath);
78
+ await copyDir(sourcePath, targetPath);
62
79
 
63
80
  await sleep(300);
64
81
 
@@ -70,7 +87,7 @@ async function handleSelection(choice) {
70
87
  console.log(' npm start\n');
71
88
 
72
89
  } catch (error) {
73
- console.error(`\n❌ Error: Template not found for ${project.name}`);
90
+ console.error(`\n❌ Error: ${error.message}`);
74
91
  console.log('Make sure templates are in the package\n');
75
92
  }
76
93
 
package/package.json CHANGED
@@ -1,16 +1,22 @@
1
1
  {
2
2
  "name": "mangoose-xempp",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "index.js",
3
+ "version": "1.0.2",
4
+ "description": "Install Mangoose projects instantly - No Git required",
5
+ "main": "bin/cli.js",
6
6
  "bin": {
7
- "mangoose-xempp": "bin/cli.js"
7
+ "mangoose-xempp": "./bin/cli.js"
8
8
  },
9
- "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
11
- },
12
- "keywords": [],
13
- "author": "",
14
- "license": "ISC",
15
- "type": "commonjs"
16
- }
9
+ "files": [
10
+ "bin/",
11
+ "templates/"
12
+ ],
13
+ "dependencies": {},
14
+ "keywords": [
15
+ "mangoose",
16
+ "xempp",
17
+ "installer",
18
+ "rwanda"
19
+ ],
20
+ "author": "Your Name",
21
+ "license": "MIT"
22
+ }