create-prodkit 1.0.0 → 1.0.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/package.json +1 -1
  2. package/src/cli.js +19 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prodkit",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "CLI for scaffolding production-ready Next.js applications with TypeScript, Tailwind CSS, ESLint, Prettier and modern project tooling.",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -20,16 +20,28 @@ export async function run() {
20
20
  console.log(pc.bold(pc.cyan(" >> create-prodkit")));
21
21
  console.log(pc.dim(" A production-ready project scaffold\n"));
22
22
 
23
- const options = await getProjectOptions(projectName); // ← add this
23
+ try {
24
+ const options = await getProjectOptions(projectName);
24
25
 
25
- if (!options.confirmed) {
26
- // ← add this
27
- console.log(pc.dim("\n Cancelled.\n"));
28
- process.exit(0);
29
- }
26
+ if (!options.confirmed) {
27
+ console.log(pc.dim("\n Cancelled.\n"));
28
+ process.exit(0);
29
+ }
30
30
 
31
- await createProject(options); // ← pass full options now
31
+ await createProject(options);
32
+ } catch (error) {
33
+ if (err.name === "ExitPromptError") {
34
+ console.log(pc.dim("\n\n Cancelled.\n"));
35
+ process.exit(0);
36
+ }
37
+ throw err;
38
+ }
32
39
  });
33
40
 
41
+ process.on("SIGINT", () => {
42
+ console.log(pc.dim("\n\n Cancelled.\n"));
43
+ process.exit(0);
44
+ });
45
+
34
46
  program.parse();
35
47
  }