joshuakgoldberg 0.2.3 → 0.3.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.
- package/README.md +1 -1
- package/bin/joshuakgoldberg.js +115 -0
- package/package.json +27 -27
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Fun fact: the entirety of this README.md is auto-generated!
|
|
|
5
5
|
See https://github.com/JoshuaKGoldberg/JoshuaKGoldberg.
|
|
6
6
|
-->
|
|
7
7
|
|
|
8
|
-
[](https://
|
|
8
|
+
[](https://bsky.app/profile/joshuakgoldberg.com)
|
|
9
9
|
[](https://fosstodon.org/@JoshuaKGoldberg)
|
|
10
10
|
[](https://twitch.tv/JoshuaKGoldberg)
|
|
11
11
|
[](https://twitter.com/JoshuaKGoldberg)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
|
|
4
|
+
const socialRows = [
|
|
5
|
+
[
|
|
6
|
+
"#0085ff",
|
|
7
|
+
"⛅️",
|
|
8
|
+
"Bluesky ",
|
|
9
|
+
"https://bsky.app/profile/joshuakgoldberg.com",
|
|
10
|
+
2,
|
|
11
|
+
],
|
|
12
|
+
["#6cc644", "🐙", "GitHub ", "https://github.com/JoshuaKGoldberg", 3],
|
|
13
|
+
["#6364ff", "🐘", "Mastodon", "https://fosstodon.org/@JoshuaKGoldberg", 3],
|
|
14
|
+
["#6441a5", "💬", "Twitch ", "https://twitch.tv/JoshuaKGoldberg", 3],
|
|
15
|
+
["#00acee", "🐦", "Twitter ", "https://twitter.com/JoshuaKGoldberg", 2],
|
|
16
|
+
["#FF0000", "🎥", "YouTube ", "https://youtube.com/@JoshuaKGoldberg", 0],
|
|
17
|
+
["#1170d0", "🌐", "www ", "https://joshuakgoldberg.com", 3],
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const longestLink = socialRows.reduce(
|
|
21
|
+
(max, row) => Math.max(max, row[3].length),
|
|
22
|
+
0,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
drawTable({
|
|
26
|
+
footer: chalk.green(
|
|
27
|
+
"💚 I'd greatly appreciate it if you could sponsor me on GitHub. 💚",
|
|
28
|
+
),
|
|
29
|
+
header: "👋 Hi! I'm Josh. 👋",
|
|
30
|
+
rows: [
|
|
31
|
+
"🙂 I'm an open source maintainer in the TypeScript ecosystem. 🙂",
|
|
32
|
+
"",
|
|
33
|
+
{
|
|
34
|
+
extra: "🖥️ ".length,
|
|
35
|
+
text: "🖥️ I work to make web development better, most notably on typescript-eslint: 🖥️",
|
|
36
|
+
},
|
|
37
|
+
"the tooling that enables ESLint and Prettier to run on TypeScript code.",
|
|
38
|
+
"",
|
|
39
|
+
"🏆 I'm the author of Learning TypeScript (O'Reilly), a Microsoft MVP, an 🏆",
|
|
40
|
+
"international conference speaker, a mentor, and a live code streamer.",
|
|
41
|
+
"",
|
|
42
|
+
{
|
|
43
|
+
extra: " ".length - 1,
|
|
44
|
+
text: "Find me on:",
|
|
45
|
+
},
|
|
46
|
+
"",
|
|
47
|
+
...socialRows.map(([color, emoji, label, link, extra]) => ({
|
|
48
|
+
extra: 20 + extra,
|
|
49
|
+
text: chalk.hex(color)(
|
|
50
|
+
[
|
|
51
|
+
" ",
|
|
52
|
+
emoji,
|
|
53
|
+
" ",
|
|
54
|
+
label,
|
|
55
|
+
" ".repeat(longestLink - link.length + 1),
|
|
56
|
+
link,
|
|
57
|
+
].join(""),
|
|
58
|
+
),
|
|
59
|
+
})),
|
|
60
|
+
],
|
|
61
|
+
width: 87,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
function drawTable({ footer, header, rows, width }) {
|
|
65
|
+
let totalLines = rows.length + 12;
|
|
66
|
+
let drawnLines = 0;
|
|
67
|
+
|
|
68
|
+
rows = rows.map((line) =>
|
|
69
|
+
typeof line === "string" ? { extra: 0, text: line } : line,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
drawOverlay(`┌`, `┐`, header);
|
|
73
|
+
drawLine("│", "│", " ", width, "");
|
|
74
|
+
|
|
75
|
+
for (const { extra, text } of rows) {
|
|
76
|
+
const padding = width - text.length + extra - 3;
|
|
77
|
+
drawLine(`│ `, ` │`, " ", padding, text);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
drawLine("│", "│", " ", width, "");
|
|
81
|
+
drawOverlay(`└`, `┘`, footer, 10);
|
|
82
|
+
|
|
83
|
+
function hexPercentage(value) {
|
|
84
|
+
return Math.max(Math.min(value, 0.95), 0)
|
|
85
|
+
.toString(16)
|
|
86
|
+
.replace(/^.+\./, "")
|
|
87
|
+
.repeat(2)
|
|
88
|
+
.slice(0, 2);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function drawLine(before, after, horizontal, padding, text = "") {
|
|
92
|
+
const colorize = chalk.hex(
|
|
93
|
+
[
|
|
94
|
+
"#",
|
|
95
|
+
hexPercentage(Math.min((totalLines - drawnLines) / totalLines, 0.5)),
|
|
96
|
+
hexPercentage((totalLines - drawnLines) ** 1.5 / totalLines),
|
|
97
|
+
hexPercentage(Math.max((totalLines - drawnLines) / totalLines, 0.65)),
|
|
98
|
+
].join(""),
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
console.log(
|
|
102
|
+
[
|
|
103
|
+
colorize(before + horizontal.repeat(Math.ceil(padding / 2))),
|
|
104
|
+
colorize(text),
|
|
105
|
+
colorize(horizontal.repeat(Math.floor(padding / 2)) + after),
|
|
106
|
+
].join(""),
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
drawnLines += 1;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function drawOverlay(before, after, text, extra = 0) {
|
|
113
|
+
drawLine(before, after, "─", width - text.length + extra - 2, ` ${text} `);
|
|
114
|
+
}
|
|
115
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joshuakgoldberg",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Packaged projects and personal GitHub README for JoshuaKGoldberg. 👋",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
15
|
"main": "./lib/index.js",
|
|
16
|
+
"bin": "./bin/joshuakgoldberg.js",
|
|
16
17
|
"files": [
|
|
18
|
+
"bin/",
|
|
17
19
|
"lib/",
|
|
18
20
|
"package.json",
|
|
19
21
|
"LICENSE.md",
|
|
@@ -22,7 +24,6 @@
|
|
|
22
24
|
"scripts": {
|
|
23
25
|
"build": "tsup",
|
|
24
26
|
"format": "prettier \"**/*\" --ignore-unknown",
|
|
25
|
-
"format:write": "pnpm format --write",
|
|
26
27
|
"lint": "eslint . .*js --max-warnings 0 --report-unused-disable-directives",
|
|
27
28
|
"lint:knip": "knip",
|
|
28
29
|
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line",
|
|
@@ -43,51 +44,50 @@
|
|
|
43
44
|
"chalk": "^5.3.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@
|
|
47
|
+
"@release-it/conventional-changelog": "^8.0.0",
|
|
48
|
+
"@types/eslint": "^8.44.3",
|
|
47
49
|
"@types/node": "^20.5.9",
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
49
|
-
"@typescript-eslint/parser": "^6.
|
|
50
|
-
"@vitest/coverage-v8": "^0.34.
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
|
51
|
+
"@typescript-eslint/parser": "^6.7.3",
|
|
52
|
+
"@vitest/coverage-v8": "^0.34.6",
|
|
51
53
|
"console-fail-test": "^0.2.3",
|
|
52
|
-
"cspell": "^
|
|
53
|
-
"eslint": "^8.
|
|
54
|
-
"eslint-
|
|
55
|
-
"eslint-plugin-deprecation": "^1.5.0",
|
|
54
|
+
"cspell": "^8.0.0",
|
|
55
|
+
"eslint": "^8.50.0",
|
|
56
|
+
"eslint-plugin-deprecation": "^2.0.0",
|
|
56
57
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
57
|
-
"eslint-plugin-
|
|
58
|
-
"eslint-plugin-jsdoc": "^46.5.1",
|
|
58
|
+
"eslint-plugin-jsdoc": "^46.8.2",
|
|
59
59
|
"eslint-plugin-jsonc": "^2.9.0",
|
|
60
60
|
"eslint-plugin-markdown": "^3.0.1",
|
|
61
|
-
"eslint-plugin-n": "^16.0
|
|
61
|
+
"eslint-plugin-n": "^16.1.0",
|
|
62
62
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
63
|
-
"eslint-plugin-perfectionist": "^1.
|
|
64
|
-
"eslint-plugin-regexp": "^
|
|
63
|
+
"eslint-plugin-perfectionist": "^2.1.0",
|
|
64
|
+
"eslint-plugin-regexp": "^2.0.0",
|
|
65
65
|
"eslint-plugin-vitest": "^0.3.1",
|
|
66
|
-
"eslint-plugin-yml": "^1.
|
|
66
|
+
"eslint-plugin-yml": "^1.9.0",
|
|
67
67
|
"github-sponsors-to-markdown": "^0.1.1",
|
|
68
68
|
"husky": "^8.0.3",
|
|
69
69
|
"jsonc-eslint-parser": "^2.3.0",
|
|
70
|
-
"knip": "2.
|
|
71
|
-
"lint-staged": "^
|
|
72
|
-
"markdownlint": "^0.
|
|
73
|
-
"markdownlint-cli": "^0.
|
|
70
|
+
"knip": "2.41.1",
|
|
71
|
+
"lint-staged": "^15.0.0",
|
|
72
|
+
"markdownlint": "^0.31.1",
|
|
73
|
+
"markdownlint-cli": "^0.37.0",
|
|
74
74
|
"node-emoji": "^2.1.0",
|
|
75
75
|
"npm-package-json-lint": "^7.0.0",
|
|
76
76
|
"npm-package-json-lint-config-default": "^6.0.0",
|
|
77
77
|
"octokit": "^3.1.0",
|
|
78
78
|
"prettier": "^3.0.3",
|
|
79
|
-
"prettier-plugin-curly": "^0.1.
|
|
80
|
-
"prettier-plugin-packagejson": "^2.4.
|
|
81
|
-
"release-it": "^
|
|
79
|
+
"prettier-plugin-curly": "^0.1.3",
|
|
80
|
+
"prettier-plugin-packagejson": "^2.4.6",
|
|
81
|
+
"release-it": "^17.0.0",
|
|
82
82
|
"sentences-per-line": "^0.2.1",
|
|
83
|
-
"should-semantic-release": "^0.
|
|
83
|
+
"should-semantic-release": "^0.2.1",
|
|
84
84
|
"tsup": "^7.2.0",
|
|
85
|
-
"tsx": "^
|
|
85
|
+
"tsx": "^4.0.0",
|
|
86
86
|
"typescript": "^5.2.2",
|
|
87
|
-
"vitest": "^0.34.
|
|
87
|
+
"vitest": "^0.34.6",
|
|
88
88
|
"yaml-eslint-parser": "^1.2.2"
|
|
89
89
|
},
|
|
90
|
-
"packageManager": "pnpm@8.
|
|
90
|
+
"packageManager": "pnpm@8.10.3",
|
|
91
91
|
"engines": {
|
|
92
92
|
"node": ">=18"
|
|
93
93
|
},
|