periderm-cli 0.1.3 → 0.1.5

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/bin.js ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import { checkUpdate } from "./update-notifier.js";
3
+ const updatePromise = checkUpdate();
4
+ process.on("uncaughtException", async (err) => {
5
+ console.error(err);
6
+ await updatePromise;
7
+ process.exit(1);
8
+ });
9
+ process.on("unhandledRejection", async (err) => {
10
+ console.error(err);
11
+ await updatePromise;
12
+ process.exit(1);
13
+ });
14
+ try {
15
+ await import("./index.js");
16
+ }
17
+ catch (err) {
18
+ console.error(err);
19
+ await updatePromise;
20
+ process.exit(1);
21
+ }
package/dist/config.js CHANGED
@@ -1,13 +1,9 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import os from "node:os";
4
- import dotenv from "dotenv";
5
- // Try to load .env from the current working directory (useful for local development)
6
- dotenv.config({ path: path.resolve(process.cwd(), ".env") });
7
4
  const CONFIG_DIR = path.join(os.homedir(), ".periderm");
8
5
  const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
9
- // Read API URL purely from environment variables (local .env or Vercel config)
10
- const DEFAULT_API_URL = process.env.PERIDERM_API_URL;
6
+ const DEFAULT_API_URL = process.env.PERIDERM_API_URL || "https://periderm-cli.vercel.app";
11
7
  export function readConfig() {
12
8
  try {
13
9
  if (fs.existsSync(CONFIG_FILE)) {
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  import { Command } from "commander";
3
2
  import chalk from "chalk";
4
3
  import fs from "node:fs/promises";
@@ -15,8 +14,6 @@ import ora from "ora";
15
14
  import { PERIDERM_ASCII } from "./constants.js";
16
15
  import { PRE_SCAN_MESSAGES, UPLOAD_MESSAGES, startRotatingMessages, finishRotatingMessages } from "./loading-messages.js";
17
16
  import { formatScanPath } from "./scanner/progress.js";
18
- import { checkUpdate } from "./update-notifier.js";
19
- const updatePromise = checkUpdate();
20
17
  const program = new Command();
21
18
  program
22
19
  .name("periderm")
@@ -133,7 +130,6 @@ program
133
130
  }
134
131
  }
135
132
  }
136
- await updatePromise;
137
133
  });
138
134
  program
139
135
  .command("review")
@@ -188,7 +184,6 @@ program
188
184
  await fs.writeFile(reportPath, JSON.stringify(scanResult, null, 2), "utf8");
189
185
  reviewSpinner.succeed(`Deep review complete · ${findings.length} additional finding${findings.length === 1 ? "" : "s"}`);
190
186
  console.info(chalk.white(`\nAppended to ${mdPath}\n`));
191
- await updatePromise;
192
187
  });
193
188
  program
194
189
  .command("watch")
@@ -352,7 +347,6 @@ program
352
347
  console.info(`user: ${r.user_id}`);
353
348
  console.info(`plan: ${r.plan}`);
354
349
  console.info(`quota: ${r.scans_remaining} scans remaining`);
355
- await updatePromise;
356
350
  });
357
351
  program
358
352
  .command("logout")
@@ -367,7 +361,6 @@ program
367
361
  console.info("");
368
362
  console.info(chalk.white("Run ") + chalk.white("$ periderm login") + chalk.white(" to re-authenticate."));
369
363
  console.info("");
370
- await updatePromise;
371
364
  });
372
365
  if (process.argv.length === 2) {
373
366
  console.info("");
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "periderm-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "A pre-launch checklist for your codebase.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "periderm": "./dist/index.js"
7
+ "periderm": "./dist/bin.js"
8
8
  },
9
9
  "files": [
10
10
  "dist",
11
11
  "README.md"
12
12
  ],
13
13
  "scripts": {
14
- "build": "tsc -p tsconfig.json && chmod +x dist/index.js",
14
+ "build": "tsc -p tsconfig.json && chmod +x dist/bin.js",
15
15
  "dev": "tsx src/index.ts",
16
16
  "start": "node dist/index.js"
17
17
  },