@imksh/create 1.0.4 → 1.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imksh/create",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "A production-ready create for scaffolding modern applications.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,34 +1,21 @@
1
- import { execa } from "execa";
2
- import ora from "ora";
1
+ import { execSync } from "child_process";
3
2
 
4
3
  export async function installPackages(targetDir) {
5
- const spinner = ora("Installing dependencies...").start();
4
+ let packageManager = "npm";
5
+ const userAgent = process.env.npm_config_user_agent || "";
6
6
 
7
- try {
8
- let packageManager = "npm";
9
-
10
- const userAgent = process.env.npm_config_user_agent || "";
11
-
12
- if (userAgent.startsWith("pnpm")) {
13
- packageManager = "pnpm";
14
- } else if (userAgent.startsWith("yarn")) {
15
- packageManager = "yarn";
16
- }
7
+ if (userAgent.startsWith("pnpm")) {
8
+ packageManager = "pnpm";
9
+ } else if (userAgent.startsWith("yarn")) {
10
+ packageManager = "yarn";
11
+ }
17
12
 
18
- await execa(packageManager, ["install"], {
13
+ try {
14
+ execSync(`${packageManager} install`, {
19
15
  cwd: targetDir,
20
- stdio: "inherit",
21
- env: process.env,
22
- preferLocal: false,
16
+ stdio: "inherit"
23
17
  });
24
-
25
- spinner.succeed("Dependencies installed successfully.");
26
- } catch (error) {
27
- spinner.fail("Failed to install dependencies.");
28
-
29
- console.error("\nInstallation Error:");
30
- console.error(error.shortMessage || error.message);
31
-
32
- throw error;
18
+ } catch (err) {
19
+ throw new Error(`Failed to run ${packageManager} install`);
33
20
  }
34
21
  }
@@ -1,12 +1,13 @@
1
- import { execa } from 'execa';
1
+ import { execSync } from "child_process";
2
2
 
3
3
  export async function runGit(targetDir) {
4
4
  try {
5
- await execa('git', ['init'], { cwd: targetDir, stdio: 'ignore' });
6
- await execa('git', ['add', '.'], { cwd: targetDir, stdio: 'ignore' });
7
- await execa('git', ['commit', '-m', 'Initial commit from @imksh/cli'], { cwd: targetDir, stdio: 'ignore' });
5
+ execSync("git init", { cwd: targetDir, stdio: "ignore" });
6
+ execSync("git add .", { cwd: targetDir, stdio: "ignore" });
7
+ execSync("git commit -m \"Initial commit from @imksh/cli\"", { cwd: targetDir, stdio: "ignore" });
8
8
  } catch (err) {
9
- throw new Error('Git initialization failed');
9
+ throw new Error("Git initialization failed");
10
10
  }
11
11
  }
12
12
 
13
+