ai-project-boilerplate 1.3.1 → 1.3.2

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.
Files changed (2) hide show
  1. package/bin/cli.js +29 -16
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -110,24 +110,37 @@ async function checkForUpdate() {
110
110
  const bold = (s) => `\x1b[1m${s}\x1b[0m`;
111
111
  const dim = (s) => `\x1b[2m${s}\x1b[0m`;
112
112
 
113
- const tag = bold(yellow("UPDATE AVAILABLE"));
114
- const from = dim(CURRENT_VERSION);
115
- const arrow = "";
116
- const to = bold(cyan(latest));
117
- const cmd = bold(cyan("npm install -g ai-project-boilerplate"));
118
- const url = cyan(`https://github.com/${REPO}/releases/tag/v${latest}`);
119
- const line1 = ` ${tag} ${from} ${arrow} ${to}`;
120
- const line2 = ` Run ${cmd} to update`;
121
- const line3 = ` See what's changed: ${url}`;
122
-
123
- const strip = (s) => s.replace(/\x1b\[[0-9;]*m/g, "");
124
- const width = Math.max(strip(line1).length, strip(line2).length, strip(line3).length) + 2;
125
- const border = yellow("─".repeat(width));
113
+ const strip = (s) => s.replace(/\x1b\[[0-9;]*m/g, "");
114
+
115
+ const isPnpm = __filename.includes("pnpm");
116
+ const prefs = loadPrefs();
117
+
118
+ const updateCmd = (isPnpm || !prefs.suppressPnpmWarning)
119
+ ? bold(cyan("pnpm add -g ai-project-boilerplate"))
120
+ : bold(cyan("npm install -g ai-project-boilerplate"));
121
+
122
+ const tag = bold(yellow("UPDATE AVAILABLE"));
123
+ const from = dim(CURRENT_VERSION);
124
+ const to = bold(cyan(latest));
125
+ const url = cyan(`https://github.com/${REPO}/releases/tag/v${latest}`);
126
+
127
+ const lines = [
128
+ ` ${tag} ${from} → ${to}`,
129
+ ` Run ${updateCmd} to update`,
130
+ ` See what's changed: ${url}`,
131
+ ];
132
+
133
+ if (!isPnpm && !prefs.suppressPnpmWarning) {
134
+ lines.push(` To suppress pnpm suggestion: ${bold(cyan("ai-project --no-pnpm-warning"))}`);
135
+ }
136
+
137
+ const width = Math.max(...lines.map(l => strip(l).length)) + 2;
138
+ const border = yellow("─".repeat(width));
126
139
 
127
140
  console.error(`\n${yellow("┌")}${border}${yellow("┐")}`);
128
- console.error(`${yellow("│")} ${line1.padEnd(line1.length + width - strip(line1).length - 1)}${yellow("│")}`);
129
- console.error(`${yellow("│")} ${line2.padEnd(line2.length + width - strip(line2).length - 1)}${yellow("│")}`);
130
- console.error(`${yellow("│")} ${line3.padEnd(line3.length + width - strip(line3).length - 1)}${yellow("│")}`);
141
+ for (const line of lines) {
142
+ console.error(`${yellow("│")} ${line.padEnd(line.length + width - strip(line).length - 1)}${yellow("│")}`);
143
+ }
131
144
  console.error(`${yellow("└")}${border}${yellow("┘")}\n`);
132
145
  return true;
133
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-project-boilerplate",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "CLI to scaffold AI-collaborated projects with stage-based AI instruction files",
5
5
  "bin": {
6
6
  "ai-project": "bin/cli.js"