cf-keys 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/dist/index.js +40 -23
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -15,37 +15,54 @@ const boxen_1 = __importDefault(require("boxen"));
15
15
  const chalk_1 = __importDefault(require("chalk"));
16
16
  const program = new commander_1.Command();
17
17
  const logo = chalk_1.default.cyan.bold(`
18
- ______ ______ __ __ ______ __ __ _____
19
- / ____// ____/ / / / // ____/ \\ \\ / / / ___/
20
- / / / /__ / /_/ // __/ \\ \\_/ / \\__ \\
21
- / /___ / ___/ / __ // /___ \\ / ___/ /
22
- \\____//_/ /_/ /_//_____/ /_/ /____/
18
+ ______ ______ __ __ ______ __ __ _____
19
+ / ____// ____/ / / / // ____/ \\ \\ / / / ___/
20
+ / / / /__ / /_/ // __/ \\ \\_/ / \\__ \\
21
+ / /___ / ___/ / __ // /___ \\ / ___/ /
22
+ \\____//_/ /_/ /_//_____/ /_/ /____/
23
23
  `);
24
- const welcomeBanner = (0, boxen_1.default)(`${logo}\n` +
25
- chalk_1.default.blueBright.bold(" Security & Utility Suite for Systems Engineering ") +
26
- "\n" +
27
- chalk_1.default.dim("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━") +
28
- "\n" +
29
- chalk_1.default.white(" Author: ") +
30
- chalk_1.default.cyan("@tu_usuario") +
31
- chalk_1.default.gray(" | ") +
32
- chalk_1.default.white("Version: ") +
33
- chalk_1.default.green("1.0.0"), {
34
- padding: 1,
35
- margin: { top: 1, bottom: 1, right: 0, left: 0 },
36
- borderStyle: "round",
37
- borderColor: "cyan",
38
- backgroundColor: "#1e1e1e",
39
- });
24
+ /**
25
+ * Función que genera y muestra el banner de bienvenida.
26
+ * Útil para el comando base, 'welcome' y el postinstall de NPM.
27
+ */
28
+ const showWelcomeBanner = (clear = true) => {
29
+ if (clear)
30
+ console.clear();
31
+ const bannerContent = `${logo}\n` +
32
+ chalk_1.default.blueBright.bold(" ➔ Security & Utility Suite for Systems Engineering ") +
33
+ "\n" +
34
+ chalk_1.default.dim("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━") +
35
+ "\n" +
36
+ chalk_1.default.white(" Author: ") +
37
+ chalk_1.default.cyan("@tu_usuario") +
38
+ chalk_1.default.gray(" | ") +
39
+ chalk_1.default.white("Version: ") +
40
+ chalk_1.default.green("1.0.0") +
41
+ "\n" +
42
+ chalk_1.default.gray(" Projects: ") +
43
+ chalk_1.default.white("ChocoFactory.dev | Kiwi Chan");
44
+ console.log((0, boxen_1.default)(bannerContent, {
45
+ padding: 1,
46
+ margin: { top: 1, bottom: 1, right: 0, left: 0 },
47
+ borderStyle: "round",
48
+ borderColor: "cyan",
49
+ backgroundColor: "#1e1e1e",
50
+ }));
51
+ };
40
52
  program
41
53
  .name("cf-keys")
42
54
  .description("A CLI tool to manage Cloudflare API keys and security tokens")
43
55
  .version("1.0.0")
44
56
  .action(() => {
45
- console.clear();
46
- console.log(welcomeBanner);
57
+ showWelcomeBanner();
47
58
  program.help();
48
59
  });
60
+ program
61
+ .command("welcome")
62
+ .description("Show the professional suite welcome banner")
63
+ .action(() => {
64
+ showWelcomeBanner();
65
+ });
49
66
  program
50
67
  .command("ping")
51
68
  .description("Ping the Cloudflare API to check connectivity")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf-keys",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Suite global de generación de claves y credenciales",
5
5
  "main": "dist/lib.js",
6
6
  "types": "dist/lib.d.ts",
@@ -8,7 +8,8 @@
8
8
  "build": "tsc",
9
9
  "start": "node dist/index.js",
10
10
  "dev": "tsc --watch",
11
- "prepublishOnly": "npm run build"
11
+ "prepublishOnly": "npm run build",
12
+ "postinstall": "node dist/index.js --version"
12
13
  },
13
14
  "keywords": [
14
15
  "security",