periderm-cli 0.1.18 → 0.1.19

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.
@@ -3,6 +3,7 @@ import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { readConfig } from "./config.js";
6
+ import { PERIDERM_ASCII } from "./constants.js";
6
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
8
  const pkgPath = path.join(__dirname, "..", "package.json");
8
9
  export async function checkUpdate() {
@@ -27,22 +28,19 @@ export async function checkUpdate() {
27
28
  const isUnix = process.platform !== "win32" && process.platform !== "android";
28
29
  const npmCmd = isUnix ? `sudo npm install -g ${name}` : `npm install -g ${name}`;
29
30
  const curlCmd = `curl -fsSL ${apiUrl}/install.sh | bash`;
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);
31
+ const actualLogoLines = PERIDERM_ASCII.split("\n");
32
+ console.info("");
33
+ for (const line of actualLogoLines) {
34
+ console.info(chalk.hex("#FF4D00")(line));
35
+ }
36
+ console.info("");
37
+ console.info(chalk.bold.cyan("Update Available!"));
38
+ console.info(chalk.white("───────────────────────────────────"));
39
+ console.info(chalk.bold.green(`✓ New version: ${chalk.dim(currentVersion)} → ${chalk.green(latestVersion)}`));
40
+ console.info("");
41
+ console.info(chalk.bold.white("NPM : ") + chalk.cyan(npmCmd));
42
+ console.info(chalk.bold.white("Curl : ") + chalk.cyan(curlCmd));
43
+ console.info("");
46
44
  }
47
45
  }
48
46
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "periderm-cli",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
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": {