yehle 0.0.8 → 0.2.0

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 CHANGED
@@ -172,10 +172,10 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to report issu
172
172
 
173
173
  If you create a project with `yehle`, you can show support by adding this badge to your README:
174
174
 
175
- ![Made with Yehle](https://img.shields.io/badge/made_with-yehle-d52b79)
175
+ ![Made with Yehle](https://img.shields.io/badge/made_with-yehle-FEA624)
176
176
 
177
177
  ```html
178
- <a href="https://github.com/agrawal-rohit/yehle"><img alt="Made with Yehle" src="https://img.shields.io/badge/made_with-yehle-d52b79"></a>
178
+ <a href="https://github.com/agrawal-rohit/yehle"><img alt="Made with Yehle" src="https://img.shields.io/badge/made_with-yehle-FEA624"></a>
179
179
  ```
180
180
 
181
181
  ## License
package/bin/cli.js CHANGED
File without changes
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.animatedIntro = animatedIntro;
7
7
  const node_readline_1 = __importDefault(require("node:readline"));
8
8
  const chalk_1 = __importDefault(require("chalk"));
9
- const utils_1 = require("consola/utils");
10
- const utils_2 = require("../core/utils");
9
+ const utils_1 = require("../core/utils");
11
10
  const logger_1 = require("./logger");
12
11
  async function animatedIntro(msg = [], { title = "Yehle", stdout = process.stdout, frameDelayMs = 150, } = {}) {
13
12
  const messages = Array.isArray(msg) ? msg : [msg];
@@ -38,37 +37,8 @@ async function animatedIntro(msg = [], { title = "Yehle", stdout = process.stdou
38
37
  };
39
38
  /* ---------------- layout constants ---------------- */
40
39
  const label = chalk_1.default.bold((0, logger_1.primaryText)(`${title}`));
41
- const GAP = " ";
42
- const LEFT_WIDTH = 13;
43
- const TOP = "╭─────┬─────╮";
44
- const BOT = "╰─────┴─────╯";
45
40
  // fixed-height renderer
46
- const renderer = createFixedHeightRenderer(stdout, 4);
47
- /* ---------------- rune set (simple only) ---------------- */
48
- const RUNES = ["*", "+", "x", "o"]; // <— simplified set
49
- const COLORS = [chalk_1.default.cyan, chalk_1.default.red, chalk_1.default.yellow, chalk_1.default.green, chalk_1.default.blue];
50
- function randomRune() {
51
- // Math.random() is safe here as it's used for visual animation, not cryptographic purposes
52
- const r = RUNES[Math.floor(Math.random() * RUNES.length)];
53
- const c = COLORS[Math.floor(Math.random() * COLORS.length)];
54
- return c(r);
55
- }
56
- const center5 = (token) => {
57
- const raw = (0, utils_1.stripAnsi)(token);
58
- const t = raw.length > 5 ? raw.slice(0, 5) : raw;
59
- const pad = 5 - t.length;
60
- const left = Math.floor(pad / 2);
61
- const right = pad - left;
62
- return " ".repeat(left) + token + " ".repeat(right);
63
- };
64
- const makeMid = (leftToken, rightToken) => `│${center5(leftToken)}│${center5(rightToken)}│`; // 13 cols total
65
- function buildLines(l1, r1, l2, r2, rightTitle, rightMsg, rightWidth) {
66
- const left = [TOP, makeMid(l1, r1), makeMid(l2, r2), BOT];
67
- const paddedRight = ["", rightTitle, rightMsg, ""];
68
- const padLeft = (s) => s + " ".repeat(Math.max(0, LEFT_WIDTH - (0, utils_1.stripAnsi)(s).length));
69
- const padRight = (s) => s + " ".repeat(Math.max(0, rightWidth - (0, utils_1.stripAnsi)(s).length));
70
- return left.map((row, i) => padLeft(row) + GAP + padRight(paddedRight[i]));
71
- }
41
+ const renderer = createFixedHeightRenderer(stdout, 3);
72
42
  for (const message of messages) {
73
43
  const resolvedMessage = Array.isArray(message)
74
44
  ? await Promise.all(message)
@@ -78,28 +48,21 @@ async function animatedIntro(msg = [], { title = "Yehle", stdout = process.stdou
78
48
  : String(resolvedMessage).split(" ");
79
49
  const finalMsg = words.join(" ");
80
50
  const columns = Math.max(40, stdout.columns || 80);
81
- const maxRight = Math.max(10, columns - LEFT_WIDTH - GAP.length - 2);
82
- const rightTitle = (0, utils_2.truncate)(label, maxRight);
83
- const rightMsgFinal = (0, utils_2.truncate)(finalMsg, maxRight);
84
- const RIGHT_WIDTH = Math.max((0, utils_1.stripAnsi)(rightTitle).length, (0, utils_1.stripAnsi)(rightMsgFinal).length);
51
+ const rightTitle = (0, utils_1.truncate)(label, columns);
52
+ const rightMsgFinal = (0, utils_1.truncate)(finalMsg, columns);
85
53
  const spoken = [];
86
54
  for (const word of ["", ...words]) {
87
55
  if (word)
88
56
  spoken.push(word);
89
- // random, per-quadrant picks for a neutral, living feel
90
- const l1 = randomRune();
91
- const r1 = randomRune();
92
- const l2 = randomRune();
93
- const r2 = randomRune();
94
- const msgNow = (0, utils_2.truncate)(spoken.join(" "), maxRight);
95
- const lines = buildLines(l1, r1, l2, r2, rightTitle, msgNow, RIGHT_WIDTH);
57
+ const msgNow = (0, utils_1.truncate)(spoken.join(" "), columns);
58
+ const lines = ["", rightTitle, msgNow];
96
59
  renderer.paint(lines);
97
- await (0, utils_2.sleep)(frameDelayMs);
60
+ await (0, utils_1.sleep)(frameDelayMs);
98
61
  }
99
62
  // final calm frame: simple, balanced layout
100
- const lines = buildLines(chalk_1.default.cyanBright("*"), chalk_1.default.redBright("+"), chalk_1.default.yellowBright("x"), chalk_1.default.greenBright("o"), rightTitle, rightMsgFinal, RIGHT_WIDTH);
63
+ const lines = ["", rightTitle, rightMsgFinal];
101
64
  renderer.paint(lines);
102
- await (0, utils_2.sleep)(200);
65
+ await (0, utils_1.sleep)(200);
103
66
  }
104
67
  cleanup();
105
68
  }
@@ -7,7 +7,7 @@ exports.Logger = exports.dangerHighlight = exports.defaultText = exports.primary
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
8
  const animated_intro_1 = __importDefault(require("./animated-intro"));
9
9
  // Log colors
10
- const primaryText = (message) => chalk_1.default.hex("#d52b79")(message);
10
+ const primaryText = (message) => chalk_1.default.hex("#FEA624")(message);
11
11
  exports.primaryText = primaryText;
12
12
  const defaultText = (message) => chalk_1.default.grey(message);
13
13
  exports.defaultText = defaultText;
package/package.json CHANGED
@@ -1,63 +1,60 @@
1
1
  {
2
- "version": "0.0.8",
3
- "name": "yehle",
4
- "description": "An opinionated book of spells for the modern developer",
5
- "bin": "./bin/cli.js",
6
- "files": [
7
- "dist",
8
- "bin",
9
- "README.md",
10
- "LICENSE"
11
- ],
12
- "author": "Rohit Agrawal <https://github.com/agrawal-rohit>",
13
- "repository": "https://github.com/agrawal-rohit/yehle",
14
- "homepage": "https://github.com/agrawal-rohit/yehle#readme",
15
- "license": "MIT",
16
- "private": false,
17
- "bugs": "https://github.com/agrawal-rohit/yehle/issues",
18
- "scripts": {
19
- "test": "vitest",
20
- "test-mutations": "stryker run",
21
- "build": "tsc",
22
- "typecheck": "tsc --noEmit",
23
- "lint": "pnpm exec biome lint --write",
24
- "format": "pnpm exec biome format --write",
25
- "check": "pnpm run typecheck && pnpm exec biome check --write",
26
- "check:ci": "pnpm run typecheck && pnpm exec biome check",
27
- "cov": "vitest run --coverage --passWithNoTests",
28
- "prepack": "pnpm run build",
29
- "prepare": "husky"
30
- },
31
- "dependencies": {
32
- "cac": "^6.7.14",
33
- "chalk": "^5.6.2",
34
- "consola": "^3.2.3",
35
- "giget": "^2.0.0",
36
- "listr2": "^9.0.5",
37
- "log-update": "^7.0.2",
38
- "mustache": "^4.2.0",
39
- "spdx-license-list": "^6.10.0",
40
- "validate-npm-package-name": "7.0.1"
41
- },
42
- "devDependencies": {
43
- "@biomejs/biome": "2.2.3",
44
- "@commitlint/cli": "^19.8.1",
45
- "@commitlint/config-conventional": "^19.8.1",
46
- "@stryker-mutator/core": "^9.4.0",
47
- "@stryker-mutator/vitest-runner": "^9.4.0",
48
- "@stryker-mutator/typescript-checker": "^9.4.0",
49
- "@types/jest": "^30.0.0",
50
- "@types/mustache": "^4.2.5",
51
- "@types/node": "^24.3.1",
52
- "@types/validate-npm-package-name": "^4.0.2",
53
- "@vitest/coverage-v8": "3.2.4",
54
- "git-cliff": "^2.10.1",
55
- "glob": ">=10.5.0",
56
- "husky": "^9.1.7",
57
- "jest": "^30.1.3",
58
- "lint-staged": "^16.1.6",
59
- "typescript": "^5.9.2",
60
- "vitest": "^3.2.4"
61
- },
62
- "packageManager": "pnpm@10.15.1+sha512.34e538c329b5553014ca8e8f4535997f96180a1d0f614339357449935350d924e22f8614682191264ec33d1462ac21561aff97f6bb18065351c162c7e8f6de67"
63
- }
2
+ "version": "0.2.0",
3
+ "name": "yehle",
4
+ "description": "An opinionated scaffolding CLI for the modern developer",
5
+ "bin": "./bin/cli.js",
6
+ "files": [
7
+ "dist",
8
+ "bin",
9
+ "README.md",
10
+ "LICENSE"
11
+ ],
12
+ "author": "Rohit Agrawal <https://github.com/agrawal-rohit>",
13
+ "repository": "https://github.com/agrawal-rohit/yehle",
14
+ "homepage": "https://github.com/agrawal-rohit/yehle#readme",
15
+ "license": "MIT",
16
+ "private": false,
17
+ "bugs": "https://github.com/agrawal-rohit/yehle/issues",
18
+ "dependencies": {
19
+ "cac": "^6.7.14",
20
+ "chalk": "^5.6.2",
21
+ "consola": "^3.2.3",
22
+ "giget": "^2.0.0",
23
+ "listr2": "^9.0.5",
24
+ "log-update": "^7.0.2",
25
+ "mustache": "^4.2.0",
26
+ "spdx-license-list": "^6.10.0",
27
+ "validate-npm-package-name": "7.0.1"
28
+ },
29
+ "devDependencies": {
30
+ "@biomejs/biome": "2.2.3",
31
+ "@commitlint/cli": "^19.8.1",
32
+ "@commitlint/config-conventional": "^19.8.1",
33
+ "@stryker-mutator/core": "^9.4.0",
34
+ "@stryker-mutator/vitest-runner": "^9.4.0",
35
+ "@stryker-mutator/typescript-checker": "^9.4.0",
36
+ "@types/jest": "^30.0.0",
37
+ "@types/mustache": "^4.2.5",
38
+ "@types/node": "^24.3.1",
39
+ "@types/validate-npm-package-name": "^4.0.2",
40
+ "@vitest/coverage-v8": "3.2.4",
41
+ "git-cliff": "^2.10.1",
42
+ "glob": ">=10.5.0",
43
+ "husky": "^9.1.7",
44
+ "jest": "^30.1.3",
45
+ "lint-staged": "^16.1.6",
46
+ "typescript": "^5.9.2",
47
+ "vitest": "^3.2.4"
48
+ },
49
+ "scripts": {
50
+ "test": "vitest",
51
+ "test-mutations": "stryker run",
52
+ "build": "tsc",
53
+ "typecheck": "tsc --noEmit",
54
+ "lint": "pnpm exec biome lint --write",
55
+ "format": "pnpm exec biome format --write",
56
+ "check": "pnpm run typecheck && pnpm exec biome check --write",
57
+ "check:ci": "pnpm run typecheck && pnpm exec biome check",
58
+ "cov": "vitest run --coverage --passWithNoTests"
59
+ }
60
+ }