@alexkroman1/aai-cli 1.2.1 → 1.3.0

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-DiJBl3es.mjs");
116
+ const { executeInit } = await import("./init-DsqJBro6.mjs");
117
117
  return executeInit({
118
118
  dir: args.dir,
119
119
  force: args.force,
@@ -72,28 +72,29 @@ async function runPnpmInstall(cwd) {
72
72
  const pnpmArgs = isDevMode() ? ["install"] : ["install", "--ignore-workspace"];
73
73
  await execFileAsync(cmd, [...args, ...pnpmArgs], { cwd });
74
74
  }
75
- /** Install deps with pnpm (scaffold declares packageManager: pnpm). */
75
+ /** Install deps with pnpm. Returns true on success (or no deps to install). */
76
76
  async function installDeps(cwd, silent) {
77
- if (!await hasDeps(cwd)) return;
77
+ if (!await hasDeps(cwd)) return true;
78
78
  await ensurePnpm();
79
- if (silent) {
80
- try {
81
- await runPnpmInstall(cwd);
82
- } catch (err) {
83
- log$1.warn(`pnpm install failed: ${errorMessage(err)}`);
84
- log$1.warn("Run `corepack enable && pnpm install` manually in the project directory.");
85
- }
86
- return;
79
+ if (silent) try {
80
+ await runPnpmInstall(cwd);
81
+ return true;
82
+ } catch (err) {
83
+ log$1.warn(`pnpm install failed: ${errorMessage(err)}`);
84
+ log$1.warn("Run `corepack enable && pnpm install` manually in the project directory.");
85
+ return false;
87
86
  }
88
87
  const s = p.spinner();
89
88
  s.start("Installing dependencies with pnpm");
90
89
  try {
91
90
  await runPnpmInstall(cwd);
92
91
  s.stop("Dependencies installed");
92
+ return true;
93
93
  } catch (err) {
94
94
  s.stop("Dependency install failed");
95
95
  log$1.warn(`pnpm install failed: ${errorMessage(err)}`);
96
96
  log$1.warn("Run `corepack enable && pnpm install` manually in the project directory.");
97
+ return false;
97
98
  }
98
99
  }
99
100
  /** Resolve target directory relative to the user's current directory. */
@@ -150,11 +151,12 @@ async function executeInit(opts, extra) {
150
151
  if (!opts.force && await fileExists(path.join(cwd, "agent.ts"))) throw new Error(`agent.ts already exists in this directory. Use ${colorize("cyanBright", "--force")} to overwrite.`);
151
152
  const template = opts.template ?? "simple";
152
153
  await scaffoldProject(dir, cwd, template, suppressUi);
153
- await installDeps(cwd, suppressUi);
154
+ const installed = await installDeps(cwd, suppressUi);
154
155
  let deployed = false;
155
156
  let slug;
156
157
  let url;
157
- if (!(opts.skipDeploy || extra?.quiet)) {
158
+ if (!installed) log$1.warn("Skipping deploy because dependencies were not installed.");
159
+ else if (!(opts.skipDeploy || extra?.quiet)) {
158
160
  const deployInfo = await tryDeploy(cwd, opts.server, monorepoRoot);
159
161
  if (deployInfo) {
160
162
  deployed = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexkroman1/aai-cli",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "aai": "dist/cli.mjs"
@@ -18,13 +18,13 @@
18
18
  "@clack/prompts": "^1.2.0",
19
19
  "citty": "^0.2.2",
20
20
  "consola": "^3.4.2",
21
- "dotenv": "^17.4.1",
21
+ "dotenv": "^17.4.2",
22
22
  "giget": "^3.2.0",
23
23
  "p-debounce": "^5.1.0",
24
- "vite": "^8.0.3",
24
+ "vite": "^8.0.8",
25
25
  "zod": "^4.3.6",
26
- "@alexkroman1/aai": "1.2.1",
27
- "@alexkroman1/aai-ui": "1.2.1"
26
+ "@alexkroman1/aai": "1.3.0",
27
+ "@alexkroman1/aai-ui": "1.3.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "get-port": "^7.2.0",