@imksh/create 1.0.5 → 1.0.9

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.5",
3
+ "version": "1.0.9",
4
4
  "description": "A production-ready create for scaffolding modern applications.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,9 +1,7 @@
1
- import { execa } from "execa";
2
- import { execSync } from "node:child_process";
1
+ import { execSync } from "child_process";
3
2
 
4
3
  export async function installPackages(targetDir) {
5
4
  let packageManager = "npm";
6
-
7
5
  const userAgent = process.env.npm_config_user_agent || "";
8
6
 
9
7
  if (userAgent.startsWith("pnpm")) {
@@ -12,14 +10,12 @@ export async function installPackages(targetDir) {
12
10
  packageManager = "yarn";
13
11
  }
14
12
 
15
- // Resolve absolute path to package manager
16
- const executable = execSync(`which ${packageManager}`)
17
- .toString()
18
- .trim();
19
-
20
- await execa(executable, ["install"], {
21
- cwd: targetDir,
22
- stdio: "inherit",
23
- env: process.env,
24
- });
13
+ try {
14
+ execSync(`${packageManager} install`, {
15
+ cwd: targetDir,
16
+ stdio: "inherit"
17
+ });
18
+ } catch (err) {
19
+ throw new Error(`Failed to run ${packageManager} install: ${err.message}`);
20
+ }
25
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: ${err.message}`);
10
10
  }
11
11
  }
12
12
 
13
+