periderm-cli 0.1.24 → 0.1.25

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.
@@ -27,15 +27,22 @@ export async function checkUpdate() {
27
27
  const isUnix = process.platform !== "win32" && process.platform !== "android";
28
28
  const npmCmd = isUnix ? `sudo npm install -g ${name}` : `npm install -g ${name}`;
29
29
  const curlCmd = `curl -fsSL ${apiUrl}/install.sh | bash`;
30
- const header = "Update Available";
31
- console.log("");
32
- console.log(chalk.bold.cyan(header));
33
- console.log(chalk.white("─".repeat(header.length)));
34
- console.log(chalk.bold.green(`↑ v${latestVersion} is out now`) + chalk.white(` (you have v${currentVersion})`));
35
- console.log("");
36
- console.log(chalk.bold.white("NPM : ") + chalk.white(npmCmd));
37
- console.log(chalk.bold.white("cURL : ") + chalk.white(curlCmd));
38
- console.log("");
30
+ const title = `A new version of Periderm CLI is available: ${currentVersion} → ${latestVersion}`;
31
+ const textNpm = `Update via npm: ${npmCmd}`;
32
+ const textCurl = `Update via curl: ${curlCmd}`;
33
+ const width = Math.max(title.length, textNpm.length, textCurl.length) + 4;
34
+ const pad = (rawLen) => " ".repeat(Math.max(0, width - rawLen - 2));
35
+ const box = `
36
+ ╭${"─".repeat(width)}╮
37
+ │${" ".repeat(width)}│
38
+ │ A new version of Periderm CLI is available: ${chalk.dim(currentVersion)} → ${chalk.green(latestVersion)}${pad(title.length)}│
39
+ │${" ".repeat(width)}│
40
+ │ Update via npm: ${chalk.cyan(npmCmd)}${pad(textNpm.length)}│
41
+ │ Update via curl: ${chalk.cyan(curlCmd)}${pad(textCurl.length)}│
42
+ │${" ".repeat(width)}│
43
+ ╰${"─".repeat(width)}╯
44
+ `;
45
+ console.log(box);
39
46
  }
40
47
  }
41
48
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "periderm-cli",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "A pre-launch checklist for your codebase. Scan JS, TS, JSX, and TSX projects before you ship.",
5
5
  "type": "module",
6
6
  "bin": {