periderm-cli 0.1.5 → 0.1.6
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 +13 -4
- package/dist/update-notifier.js +7 -5
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -14,6 +14,17 @@ import ora from "ora";
|
|
|
14
14
|
import { PERIDERM_ASCII } from "./constants.js";
|
|
15
15
|
import { PRE_SCAN_MESSAGES, UPLOAD_MESSAGES, startRotatingMessages, finishRotatingMessages } from "./loading-messages.js";
|
|
16
16
|
import { formatScanPath } from "./scanner/progress.js";
|
|
17
|
+
function requireAuth() {
|
|
18
|
+
console.info("");
|
|
19
|
+
console.info(chalk.bold.hex("#FF4D00")("▸_ Periderm CLI"));
|
|
20
|
+
console.info(chalk.white("──────────────────────────────────────────"));
|
|
21
|
+
console.info(chalk.bold.red("✖ Authentication Required"));
|
|
22
|
+
console.info("");
|
|
23
|
+
console.info(chalk.white("You must be logged in to run this command."));
|
|
24
|
+
console.info(chalk.white("Run ") + chalk.bold.cyan("$ periderm login") + chalk.white(" to securely authenticate."));
|
|
25
|
+
console.info("");
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
17
28
|
const program = new Command();
|
|
18
29
|
program
|
|
19
30
|
.name("periderm")
|
|
@@ -28,8 +39,7 @@ program
|
|
|
28
39
|
const root = path.resolve(opts.cwd);
|
|
29
40
|
const cfg = readConfig();
|
|
30
41
|
if (!cfg.token) {
|
|
31
|
-
|
|
32
|
-
process.exit(1);
|
|
42
|
+
requireAuth();
|
|
33
43
|
}
|
|
34
44
|
const verifySpinner = ora({ text: PRE_SCAN_MESSAGES[0], color: "cyan" }).start();
|
|
35
45
|
const verifyStarted = Date.now();
|
|
@@ -144,8 +154,7 @@ program
|
|
|
144
154
|
const root = path.resolve(opts.cwd);
|
|
145
155
|
const cfg = readConfig();
|
|
146
156
|
if (!cfg.token) {
|
|
147
|
-
|
|
148
|
-
process.exit(1);
|
|
157
|
+
requireAuth();
|
|
149
158
|
}
|
|
150
159
|
const reportPath = path.join(root, ".periderm", "last-report.json");
|
|
151
160
|
let scanResult;
|
package/dist/update-notifier.js
CHANGED
|
@@ -24,13 +24,15 @@ export async function checkUpdate() {
|
|
|
24
24
|
// Basic semver check (only notifies if latest > current simply by string comparison or simple parsing)
|
|
25
25
|
// Since it's x.y.z, simple comparison works for basic stuff, but a strict semver check is better.
|
|
26
26
|
// We will just check if they are not equal, since latest is usually higher.
|
|
27
|
+
const isWin = process.platform === "win32";
|
|
28
|
+
const updateCmd = isWin ? `npm install -g ${name}` : `curl -fsSL https://periderm.dev/install.sh | bash`;
|
|
27
29
|
const box = `
|
|
28
|
-
|
|
29
|
-
│
|
|
30
|
+
╭──────────────────────────────────────────────────────────────╮
|
|
31
|
+
│ │
|
|
30
32
|
│ A new version of Periderm CLI is available: ${chalk.dim(currentVersion)} → ${chalk.green(latestVersion)} │
|
|
31
|
-
│ Run ${chalk.cyan(
|
|
32
|
-
│
|
|
33
|
-
|
|
33
|
+
│ Run ${chalk.cyan(updateCmd)} to update.
|
|
34
|
+
│ │
|
|
35
|
+
╰──────────────────────────────────────────────────────────────╯
|
|
34
36
|
`;
|
|
35
37
|
console.log(box);
|
|
36
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "periderm-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "A pre-launch checklist for your codebase.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,6 +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
16
|
"dev": "tsx src/index.ts",
|
|
16
17
|
"start": "node dist/index.js"
|
|
17
18
|
},
|