@alexkroman1/aai-cli 1.0.2 → 1.0.3

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/dist/cli.mjs CHANGED
@@ -113,7 +113,7 @@ const init = defineCommand({
113
113
  },
114
114
  async run({ args }) {
115
115
  await runCommand(args, async (mode) => {
116
- const { executeInit } = await import("./init-DJQVk0Gw.mjs");
116
+ const { executeInit } = await import("./init-CCmNsa90.mjs");
117
117
  return executeInit({
118
118
  dir: args.dir,
119
119
  force: args.force,
@@ -46,9 +46,31 @@ async function hasDeps(cwd) {
46
46
  const devDeps = Object.keys(pkgJson.devDependencies ?? {});
47
47
  return deps.length > 0 || devDeps.length > 0;
48
48
  }
49
+ /** Check whether the safe-chain binary is on PATH. */
50
+ async function hasSafeChain() {
51
+ try {
52
+ await execFileAsync("safe-chain", ["--version"]);
53
+ return true;
54
+ } catch {
55
+ return false;
56
+ }
57
+ }
58
+ /** Build the command + args for running pnpm, routing through safe-chain when available. */
59
+ async function resolvePnpmCommand(checkSafeChain = hasSafeChain) {
60
+ if (await checkSafeChain()) return {
61
+ cmd: "safe-chain",
62
+ args: ["pnpm", "--safe-chain-skip-minimum-package-age"]
63
+ };
64
+ return {
65
+ cmd: "pnpm",
66
+ args: []
67
+ };
68
+ }
49
69
  /** Run pnpm install and warn on failure. */
50
70
  async function runPnpmInstall(cwd) {
51
- await execFileAsync("pnpm", isDevMode() ? ["install"] : ["install", "--ignore-workspace"], { cwd });
71
+ const { cmd, args } = await resolvePnpmCommand();
72
+ const pnpmArgs = isDevMode() ? ["install"] : ["install", "--ignore-workspace"];
73
+ await execFileAsync(cmd, [...args, ...pnpmArgs], { cwd });
52
74
  }
53
75
  /** Install deps with pnpm (scaffold declares packageManager: pnpm). */
54
76
  async function installDeps(cwd, silent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexkroman1/aai-cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "aai": "dist/cli.mjs"
@@ -23,7 +23,7 @@
23
23
  "p-debounce": "^5.1.0",
24
24
  "vite": "^8.0.3",
25
25
  "zod": "^4.3.6",
26
- "@alexkroman1/aai": "1.0.2"
26
+ "@alexkroman1/aai": "1.0.3"
27
27
  },
28
28
  "devDependencies": {
29
29
  "get-port": "^7.2.0",