@alexkroman1/aai-cli 1.0.2 → 1.0.4

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.
@@ -21,7 +21,10 @@ function resolveLocalTemplatesDir() {
21
21
  async function resolveTemplatesDir() {
22
22
  if (process.env.AAI_TEMPLATES_DIR) return process.env.AAI_TEMPLATES_DIR;
23
23
  if (isDevMode()) return resolveLocalTemplatesDir();
24
- const { dir } = await downloadTemplate(`${GIGET_SOURCE}#${GIGET_REF}`, { force: true });
24
+ const { dir } = await downloadTemplate(`${GIGET_SOURCE}#${GIGET_REF}`, {
25
+ force: true,
26
+ forceClean: true
27
+ });
25
28
  return dir;
26
29
  }
27
30
  /**
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-BoEnTX4U.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) {
@@ -97,7 +119,7 @@ async function tryDeploy(cwd, server, monorepoRoot) {
97
119
  }
98
120
  /** Scaffold the project, optionally showing a spinner. */
99
121
  async function scaffoldProject(dir, cwd, template, silent) {
100
- const { runInit } = await import("./_init-DhX1a2Zb.mjs");
122
+ const { runInit } = await import("./_init-B1ES0Off.mjs");
101
123
  if (silent) {
102
124
  await runInit({
103
125
  targetDir: cwd,
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.4",
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.4"
27
27
  },
28
28
  "devDependencies": {
29
29
  "get-port": "^7.2.0",