periderm-cli 0.1.7 → 0.1.9

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/index.js CHANGED
@@ -134,7 +134,7 @@ program
134
134
  console.info("");
135
135
  console.info(`${chalk.white("Quota:")} ${chalk.bold.white(`${remaining} scans remaining`)}`);
136
136
  if (remaining <= 3) {
137
- console.info(chalk.yellow(`⚠️ Almost exhausted! Renew or upgrade at `) + chalk.underline.cyan(`${cfg.apiUrl}/dashboard/billing`));
137
+ console.info(chalk.yellow(`⚠ Almost exhausted! Renew or upgrade at `) + chalk.underline.cyan(`${cfg.apiUrl}/dashboard/billing`));
138
138
  }
139
139
  }
140
140
  }
@@ -386,7 +386,7 @@ else {
386
386
  try {
387
387
  const formData = new FormData();
388
388
  formData.append("name", "Periderm CLI Crash Reporter");
389
- let userEmail = "support@periderm.dev";
389
+ let userEmail = "princejaphethjj@gmail.com";
390
390
  try {
391
391
  const cfg = readConfig();
392
392
  if (cfg.token) {
@@ -400,7 +400,7 @@ else {
400
400
  // ignore token verification errors during crash
401
401
  }
402
402
  formData.append("_replyto", userEmail);
403
- const marker = `\n\n---\n[System Info: Sent from Periderm CLI]\n[User Email: ${userEmail === "support@periderm.dev" ? "Unknown" : userEmail}]`;
403
+ const marker = `\n\n---\n[System Info: Sent from Periderm CLI]\n[User Email: ${userEmail === "princejaphethjj@gmail.com" ? "Unknown" : userEmail}]`;
404
404
  const errMsg = e instanceof Error ? `${e.message}\n${e.stack}` : String(e);
405
405
  formData.append("message", `CLI Crash:\n\n${errMsg}${marker}`);
406
406
  await fetch("https://formspree.io/f/mqakppnn", {
@@ -23,16 +23,24 @@ export async function checkUpdate() {
23
23
  const latestVersion = data.version;
24
24
  if (latestVersion && latestVersion !== currentVersion) {
25
25
  const cfg = readConfig();
26
- const apiUrl = cfg?.apiUrl || "https://periderm.dev";
27
- const isWin = process.platform === "win32";
28
- const updateCmd = isWin ? `npm install -g ${name}` : `curl -fsSL ${apiUrl}/install.sh | bash`;
26
+ const apiUrl = cfg?.apiUrl;
27
+ const isUnix = process.platform !== "win32" && process.platform !== "android";
28
+ const npmCmd = isUnix ? `sudo npm install -g ${name}` : `npm install -g ${name}`;
29
+ 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));
29
35
  const box = `
30
- ╭──────────────────────────────────────────────────────────────╮
31
-
32
- A new version of Periderm CLI is available: ${chalk.dim(currentVersion)} → ${chalk.green(latestVersion)}
33
- │ Run ${chalk.cyan(updateCmd)} to update.
34
-
35
- ╰──────────────────────────────────────────────────────────────╯
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)}╯
36
44
  `;
37
45
  console.log(box);
38
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "periderm-cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "A pre-launch checklist for your codebase.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "scripts": {
14
14
  "build": "tsc -p tsconfig.json && chmod +x dist/bin.js",
15
- "postpublish": "cd ../../ && tsx scripts/broadcast-update.ts",
15
+ "postpublish": "cd ../../ && tsx --env-file=.env scripts/broadcast-update.ts",
16
16
  "dev": "tsx src/index.ts",
17
17
  "start": "node dist/index.js"
18
18
  },