githate 1.0.0 → 1.0.1

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.
@@ -13,8 +13,13 @@ import {
13
13
  displayInfo,
14
14
  displayWarning,
15
15
  displayOutro,
16
+ displayHater,
16
17
  } from "../ui/display.js";
18
+ import { getHaterReveal } from "../ui/art.js";
17
19
  import color from "picocolors";
20
+ import chalk from "chalk";
21
+
22
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
18
23
 
19
24
  export const check = async () => {
20
25
  displayIntro();
@@ -74,13 +79,18 @@ export const check = async () => {
74
79
  }
75
80
 
76
81
  if (unfollowers.length > 0) {
77
- displayWarning(`Unfollowers (-${unfollowers.length}):`); // Using warning for "haters"
78
- unfollowers.forEach((login) =>
79
- console.log(` ${color.red("-")} ${login}`),
80
- );
82
+ console.log("\n");
83
+ console.log(getHaterReveal("THE HATERS"));
84
+ console.log("\n");
85
+
86
+ for (const login of unfollowers) {
87
+ await sleep(500); // Dramatic pause
88
+ displayHater(login);
89
+ }
90
+
81
91
  console.log("");
82
92
  displayInfo(
83
- 'Consider using "hater unfollow <username>" if you want to respond.',
93
+ 'Consider using "githate unfollow <username>" if you want to respond.',
84
94
  );
85
95
  } else {
86
96
  console.log(color.dim("No new unfollowers. Everyone still loves you!"));
package/lib/ui/art.js ADDED
@@ -0,0 +1,18 @@
1
+ import figlet from "figlet";
2
+ import gradient from "gradient-string";
3
+
4
+ export const getBanner = (text = "GITHATE") => {
5
+ const art = figlet.textSync(text, {
6
+ font: "ANSI Shadow",
7
+ horizontalLayout: "default",
8
+ verticalLayout: "default",
9
+ });
10
+ return gradient.retro(art);
11
+ };
12
+
13
+ export const getHaterReveal = (text) => {
14
+ const art = figlet.textSync(text, {
15
+ font: "Bloody", // or 'Ghost' if Bloody is not available, let's stick to standard if unsure, but let's try a spooky one
16
+ });
17
+ return gradient.atlas(art);
18
+ };
package/lib/ui/display.js CHANGED
@@ -1,28 +1,69 @@
1
1
  import { intro, outro, spinner, note, log } from "@clack/prompts";
2
2
  import color from "picocolors";
3
+ import boxen from "boxen";
4
+ import chalk from "chalk";
5
+ import { getBanner } from "./art.js";
6
+
7
+ const TIPS = [
8
+ "Run 'githate check' often to catch them red-handed.",
9
+ "Use 'githate login' to authenticate securely.",
10
+ "Don't take it personally, it's just business.",
11
+ "Haters gonna hate, creators gonna create.",
12
+ ];
13
+
14
+ const getRandomTip = () => TIPS[Math.floor(Math.random() * TIPS.length)];
3
15
 
4
16
  export const displayIntro = () => {
5
- intro(color.bgRed(color.white(" GITHATE CLI ")));
17
+ console.log(getBanner());
18
+ console.log(chalk.dim("Track who unfollowed you on GitHub\n"));
19
+
20
+ console.log(chalk.bold("Tips for getting started:"));
21
+ console.log(chalk.dim("1. Login with your GitHub PAT."));
22
+ console.log(chalk.dim("2. Run check to see your followers."));
23
+ console.log(chalk.dim(`3. ${getRandomTip()}\n`));
24
+
25
+ intro(chalk.bgHex("#2e2e2e").white(" ➜ GITHATE CLI "));
6
26
  };
7
27
 
8
28
  export const displayOutro = (message) => {
9
- outro(message);
29
+ outro(chalk.bold(message));
10
30
  };
11
31
 
12
32
  export const displayError = (message) => {
13
- log.error(color.red(message));
33
+ console.log(
34
+ boxen(chalk.red.bold(message), {
35
+ padding: 1,
36
+ margin: 1,
37
+ borderStyle: "round",
38
+ borderColor: "red",
39
+ title: "ERROR",
40
+ titleAlignment: "center",
41
+ }),
42
+ );
14
43
  };
15
44
 
16
45
  export const displaySuccess = (message) => {
17
- log.success(color.green(message));
46
+ console.log(` ${chalk.green("✔")} ${message}`);
18
47
  };
19
48
 
20
49
  export const displayInfo = (message) => {
21
- log.info(color.cyan(message));
50
+ console.log(` ${chalk.blue("✦")} ${chalk.dim(message)}`);
22
51
  };
23
52
 
24
53
  export const displayWarning = (message) => {
25
- log.warn(color.yellow(message));
54
+ console.log(` ${chalk.yellow("!")} ${chalk.yellow(message)}`);
55
+ };
56
+
57
+ export const displayHater = (username) => {
58
+ console.log(
59
+ boxen(chalk.red.bold(`💔 ${username} unfollowed you!`), {
60
+ padding: 1,
61
+ margin: 1,
62
+ borderStyle: "double",
63
+ borderColor: "red",
64
+ backgroundColor: "#330000",
65
+ }),
66
+ );
26
67
  };
27
68
 
28
69
  export const createSpinner = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githate",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A CLI tool to track who unfollowed you on GitHub.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,8 +21,13 @@
21
21
  "dependencies": {
22
22
  "@clack/prompts": "^1.0.0",
23
23
  "@octokit/rest": "^20.0.0",
24
+ "boxen": "^8.0.1",
25
+ "chalk": "^5.6.2",
24
26
  "commander": "^14.0.3",
25
27
  "conf": "^15.1.0",
28
+ "figlet": "^1.10.0",
29
+ "githate": "^1.0.0",
30
+ "gradient-string": "^3.0.0",
26
31
  "picocolors": "^1.1.1"
27
32
  }
28
33
  }