create-hanni 0.3.0 → 0.4.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.
Files changed (2) hide show
  1. package/index.js +7 -9
  2. package/package.json +8 -4
package/index.js CHANGED
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env bun
2
- const fs = require("fs");
3
- const path = require("path");
4
-
5
- const __dirname = path.dirname(process.argv[1]);
2
+ import fs from "fs";
3
+ import path from "path";
6
4
 
5
+ const __dirname = path.dirname(import.meta.url.replace("file://", ""));
7
6
  const args = process.argv.slice(2);
8
7
  if (!args[0]) process.exit(1);
9
8
 
@@ -30,8 +29,7 @@ async function copyDir(src, dest) {
30
29
  }
31
30
  }
32
31
 
33
- copyDir(templateDir, path.join(process.cwd(), projectName)).then(() => {
34
- console.log(`Project "${projectName}" created successfully.`);
35
- console.log(`cd ${projectName} && bun install`);
36
- console.log(`bun start`);
37
- });
32
+ await copyDir(templateDir, path.join(process.cwd(), projectName));
33
+ console.log(`Project "${projectName}" created successfully.`);
34
+ console.log(`cd ${projectName} && bun install`);
35
+ console.log(`bun start`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-hanni",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Bun project template for Hanni.js framework",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -11,7 +11,11 @@
11
11
  "keywords": ["bun", "template", "hanni", "framework"],
12
12
  "author": "2matheww",
13
13
  "license": "MIT",
14
+ "dependencies": {
15
+ "minimist": "^1.2.8",
16
+ "prompts": "^2.4.2"
17
+ },
14
18
  "engines": {
15
- "bun": ">=1.0.0"
16
- }
17
- }
19
+ "bun": ">=1.0.0"
20
+ }
21
+ }