@supercheck/cli 0.1.0-beta.2 → 0.1.0-beta.4
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/README.md +147 -37
- package/dist/bin/supercheck.js +500 -405
- package/dist/bin/supercheck.js.map +1 -1
- package/dist/chunk-W54DX2I7.js +21 -0
- package/dist/chunk-W54DX2I7.js.map +1 -0
- package/dist/prompt-BPDPYRS7.js +8 -0
- package/dist/prompt-BPDPYRS7.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/utils/prompt.ts
|
|
4
|
+
async function confirmPrompt(message, opts = {}) {
|
|
5
|
+
const defaultYes = opts.default === true;
|
|
6
|
+
const hint = defaultYes ? "(yes/no) [yes]" : "(yes/no) [no]";
|
|
7
|
+
const { createInterface } = await import("readline");
|
|
8
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
9
|
+
const answer = await new Promise((resolve) => {
|
|
10
|
+
rl.question(`${message} ${hint} `, resolve);
|
|
11
|
+
});
|
|
12
|
+
rl.close();
|
|
13
|
+
const normalized = answer.trim().toLowerCase();
|
|
14
|
+
if (normalized === "") return defaultYes;
|
|
15
|
+
return normalized === "yes" || normalized === "y";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
confirmPrompt
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-W54DX2I7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/prompt.ts"],"sourcesContent":["/**\n * Shared confirmation prompt utility.\n * Standardizes all CLI prompts to use `(yes/no)` format.\n */\n\n/**\n * Prompt the user for a yes/no confirmation.\n *\n * @param message - The question to ask (e.g. \"Delete resource X?\")\n * @param opts.default - What pressing Enter (empty input) means.\n * `true` = default yes, `false` = default no (default: false)\n * @returns true if the user confirmed, false otherwise\n */\nexport async function confirmPrompt(\n message: string,\n opts: { default?: boolean } = {},\n): Promise<boolean> {\n const defaultYes = opts.default === true\n const hint = defaultYes ? '(yes/no) [yes]' : '(yes/no) [no]'\n\n const { createInterface } = await import('node:readline')\n const rl = createInterface({ input: process.stdin, output: process.stdout })\n\n const answer = await new Promise<string>((resolve) => {\n rl.question(`${message} ${hint} `, resolve)\n })\n rl.close()\n\n const normalized = answer.trim().toLowerCase()\n\n // Empty input → use default\n if (normalized === '') return defaultYes\n\n // Accept yes/y and no/n\n return normalized === 'yes' || normalized === 'y'\n}\n"],"mappings":";;;AAaA,eAAsB,cACpB,SACA,OAA8B,CAAC,GACb;AAClB,QAAM,aAAa,KAAK,YAAY;AACpC,QAAM,OAAO,aAAa,mBAAmB;AAE7C,QAAM,EAAE,gBAAgB,IAAI,MAAM,OAAO,UAAe;AACxD,QAAM,KAAK,gBAAgB,EAAE,OAAO,QAAQ,OAAO,QAAQ,QAAQ,OAAO,CAAC;AAE3E,QAAM,SAAS,MAAM,IAAI,QAAgB,CAAC,YAAY;AACpD,OAAG,SAAS,GAAG,OAAO,IAAI,IAAI,KAAK,OAAO;AAAA,EAC5C,CAAC;AACD,KAAG,MAAM;AAET,QAAM,aAAa,OAAO,KAAK,EAAE,YAAY;AAG7C,MAAI,eAAe,GAAI,QAAO;AAG9B,SAAO,eAAe,SAAS,eAAe;AAChD;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supercheck/cli",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.4",
|
|
4
4
|
"description": "Open-Source Testing, Monitoring, and Reliability — as Code",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"monitoring",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"author": "Supercheck <hello@supercheck.io>",
|
|
24
24
|
"type": "module",
|
|
25
|
-
"license": "
|
|
25
|
+
"license": "Supercheck Community License",
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|