create-zhx-monorepo 0.1.0 → 0.1.1

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 +14 -5
  2. package/package.json +2 -2
package/bin/index.js CHANGED
@@ -10,13 +10,22 @@ const __filename = fileURLToPath(import.meta.url);
10
10
  const __dirname = path.dirname(__filename);
11
11
 
12
12
  async function main() {
13
- const targetDir = process.argv[2];
13
+ let targetDir = process.argv[2];
14
14
 
15
15
  if (!targetDir) {
16
- console.log(red("❌ Please provide a project name"));
17
- console.log("Example:");
18
- console.log(" pnpm create zhx-monorepo my-app");
19
- process.exit(1);
16
+ const response = await prompts({
17
+ type: "text",
18
+ name: "targetDir",
19
+ message: "Project name:",
20
+ validate: (value) => (value ? true : "Project name cannot be empty"),
21
+ });
22
+ targetDir = response.targetDir;
23
+
24
+ if (!targetDir) {
25
+ console.log(red("❌ No project name provided."));
26
+ console.log(red("Exiting..."));
27
+ process.exit(1);
28
+ }
20
29
  }
21
30
 
22
31
  const projectPath = path.resolve(process.cwd(), targetDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-zhx-monorepo",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Create a ZHX monorepo with one command",
5
5
  "bin": {
6
6
  "create-zhx-monorepo": "bin/index.js"
@@ -15,4 +15,4 @@
15
15
  "prompts": "^2.4.2",
16
16
  "kolorist": "^1.8.0"
17
17
  }
18
- }
18
+ }