heyq02 0.2.1 → 0.2.3
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/dist/cli.js +102 -23
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
var version = "0.2.
|
|
2
|
+
// package.json
|
|
3
|
+
var version = "0.2.3";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/** Shared intro SSOT from `static/data/intro.json` for site, cli, and readme. */
|
|
8
|
-
const intro = {
|
|
5
|
+
// ../../packages/profile/dist/index.js
|
|
6
|
+
var intro_default = {
|
|
9
7
|
name: "Ari He",
|
|
10
8
|
names: ["Ari He", "Developer"],
|
|
11
9
|
degree: "Bachelor",
|
|
@@ -139,6 +137,87 @@ const intro = {
|
|
|
139
137
|
"forks": 0
|
|
140
138
|
}]
|
|
141
139
|
};
|
|
140
|
+
var intro_zh_default = {
|
|
141
|
+
alias: "开发者",
|
|
142
|
+
degree: "学士",
|
|
143
|
+
city: "中国",
|
|
144
|
+
bio: "全栈工程师 / 开源爱好者 / 职业向视频创作者。专注于能加速研发并落地到真实产品中的 AI",
|
|
145
|
+
kicker: "简介",
|
|
146
|
+
description: "Ari He。全栈工程师、开源爱好者、职业向视频创作者。专注于能加速研发并落地到真实产品中的 AI。",
|
|
147
|
+
sections: {
|
|
148
|
+
"experience": "经历",
|
|
149
|
+
"skills": "技能",
|
|
150
|
+
"openSource": "开源"
|
|
151
|
+
},
|
|
152
|
+
places: [
|
|
153
|
+
{ "detail": "heyq02" },
|
|
154
|
+
{ "detail": "heyq02.com" },
|
|
155
|
+
{ "detail": "全栈糕手Ari" },
|
|
156
|
+
{ "detail": "编程糕手Ari" },
|
|
157
|
+
{ "detail": "扫码添加" }
|
|
158
|
+
],
|
|
159
|
+
experiences: [{
|
|
160
|
+
"company": "京东集团",
|
|
161
|
+
"end": "至今",
|
|
162
|
+
"points": [
|
|
163
|
+
"负责京东外卖小程序、H5 与管理后台的迭代交付",
|
|
164
|
+
"推动管理后台脱离旧架构升级,并提升 TP95",
|
|
165
|
+
"搭建本地生活产研 C3 级 AI Infra,提升研发效率"
|
|
166
|
+
]
|
|
167
|
+
}],
|
|
168
|
+
skills: [
|
|
169
|
+
{ "summary": "渐进式 JavaScript 框架,用于构建 Web 界面" },
|
|
170
|
+
{ "summary": "用于构建 Web 与原生用户界面的库" },
|
|
171
|
+
{ "summary": "面向 Web 的 React 框架" },
|
|
172
|
+
{ "summary": "兼容 Rollup API 的 Rust 版 JavaScript 打包器" },
|
|
173
|
+
{ "summary": "面向 Web 的前端构建工具" },
|
|
174
|
+
{ "summary": "用 Rust 编写的高性能 JavaScript 工具集" },
|
|
175
|
+
{ "summary": "用于构建 Java 企业应用的框架" },
|
|
176
|
+
{ "summary": "内存数据库,可用于缓存与消息" },
|
|
177
|
+
{ "summary": "开源消息与流式代理" },
|
|
178
|
+
{ "summary": "HTTP 服务器、反向代理与负载均衡器" },
|
|
179
|
+
{ "summary": "构建、交付与运行应用的开放平台" }
|
|
180
|
+
],
|
|
181
|
+
projects: [{ "summary": "一款基于 Taro 框架开发的多端 UI 组件库" }, { "summary": "轻松在 GitHub README 或简历中展示你的技能图标。" }]
|
|
182
|
+
};
|
|
183
|
+
/** Shared intro SSOT from `static/data/intro.json` for site, cli, and readme. */
|
|
184
|
+
const intro = intro_default;
|
|
185
|
+
const chinese = intro_zh_default;
|
|
186
|
+
function zip(label, base, overlay, merge) {
|
|
187
|
+
if (base.length !== overlay.length) throw new Error(`Chinese ${label} (${overlay.length}) must match English (${base.length})`);
|
|
188
|
+
return base.map((item, index) => merge(item, overlay[index]));
|
|
189
|
+
}
|
|
190
|
+
function mergeIntro(english, overlay) {
|
|
191
|
+
return {
|
|
192
|
+
...english,
|
|
193
|
+
names: [english.name, overlay.alias],
|
|
194
|
+
degree: overlay.degree,
|
|
195
|
+
city: overlay.city,
|
|
196
|
+
bio: overlay.bio,
|
|
197
|
+
kicker: overlay.kicker,
|
|
198
|
+
description: overlay.description,
|
|
199
|
+
sections: overlay.sections,
|
|
200
|
+
places: zip("places", english.places, overlay.places, (place, extra) => ({
|
|
201
|
+
...place,
|
|
202
|
+
detail: extra.detail
|
|
203
|
+
})),
|
|
204
|
+
experiences: zip("experiences", english.experiences, overlay.experiences, (job, extra) => ({
|
|
205
|
+
...job,
|
|
206
|
+
company: extra.company,
|
|
207
|
+
end: extra.end,
|
|
208
|
+
points: extra.points
|
|
209
|
+
})),
|
|
210
|
+
skills: zip("skills", english.skills, overlay.skills, (skill, extra) => ({
|
|
211
|
+
...skill,
|
|
212
|
+
summary: extra.summary
|
|
213
|
+
})),
|
|
214
|
+
projects: zip("projects", english.projects, overlay.projects, (project, extra) => ({
|
|
215
|
+
...project,
|
|
216
|
+
summary: extra.summary
|
|
217
|
+
}))
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const introZh = mergeIntro(intro, chinese);
|
|
142
221
|
function absoluteHref(href, site = intro.site) {
|
|
143
222
|
if (href.startsWith("/")) return `${site}${href}`;
|
|
144
223
|
return href;
|
|
@@ -152,9 +231,6 @@ const skills = intro.skills.map((skill) => ({
|
|
|
152
231
|
href: absoluteHref(skill.href)
|
|
153
232
|
}));
|
|
154
233
|
const { name, names, degree, city, bio, kaomoji, avatar, site, kicker, title, description, contact, sections, experiences, projects } = intro;
|
|
155
|
-
function fullName(role = "") {
|
|
156
|
-
return `${intro.name}${role}`;
|
|
157
|
-
}
|
|
158
234
|
/** Terminal-oriented view of the same intro. */
|
|
159
235
|
const profile = {
|
|
160
236
|
name: intro.name,
|
|
@@ -170,23 +246,28 @@ const profile = {
|
|
|
170
246
|
projects: intro.projects.map(({ languageColor: _languageColor, ...project }) => project)
|
|
171
247
|
};
|
|
172
248
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
/** Same shape as the profile README: greeting, Experience, Skills. */
|
|
176
|
-
function renderIntro() {
|
|
249
|
+
// src/intro.ts
|
|
250
|
+
function renderBlock(source, greeting, includeSkills) {
|
|
177
251
|
const lines = [
|
|
178
|
-
|
|
252
|
+
`${greeting} ${source.name}`,
|
|
179
253
|
"",
|
|
180
|
-
|
|
254
|
+
source.sections.experience,
|
|
181
255
|
""
|
|
182
256
|
];
|
|
183
|
-
for (const job of experiences) lines.push(`${job.company} · ${job.start} – ${job.end}`, ...job.points.map((point) => `- ${point}`), "");
|
|
184
|
-
lines.push(
|
|
185
|
-
|
|
257
|
+
for (const job of source.experiences) lines.push(`${job.company} · ${job.start} – ${job.end}`, ...job.points.map((point) => `- ${point}`), "");
|
|
258
|
+
if (includeSkills) lines.push(source.sections.skills, "", source.skills.map((skill) => skill.name).join(" · "));
|
|
259
|
+
if (lines.at(-1) === "") lines.pop();
|
|
260
|
+
return lines;
|
|
261
|
+
}
|
|
262
|
+
function renderIntro() {
|
|
263
|
+
return [
|
|
264
|
+
...renderBlock(introZh, "你好,我是", true),
|
|
265
|
+
"",
|
|
266
|
+
...renderBlock(intro, "Hello, I'm", false)
|
|
267
|
+
].join("\n");
|
|
186
268
|
}
|
|
187
269
|
|
|
188
|
-
|
|
189
|
-
//#region src/main.ts
|
|
270
|
+
// src/main.ts
|
|
190
271
|
const help = `Usage: heyq02
|
|
191
272
|
|
|
192
273
|
Print Ari He's profile introduction.
|
|
@@ -213,8 +294,7 @@ function main(argv = process.argv.slice(2)) {
|
|
|
213
294
|
process.stdout.write(`${renderIntro()}\n`);
|
|
214
295
|
}
|
|
215
296
|
|
|
216
|
-
|
|
217
|
-
//#region src/cli.ts
|
|
297
|
+
// src/cli.ts
|
|
218
298
|
try {
|
|
219
299
|
main();
|
|
220
300
|
} catch (error) {
|
|
@@ -223,5 +303,4 @@ try {
|
|
|
223
303
|
process.exitCode = 1;
|
|
224
304
|
}
|
|
225
305
|
|
|
226
|
-
//#endregion
|
|
227
306
|
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heyq02",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Ari He. A terminal introduction.",
|
|
5
5
|
"homepage": "https://heyq02.com",
|
|
6
6
|
"bugs": {
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@heyq02/profile": "0.2.
|
|
31
|
+
"@heyq02/profile": "0.2.3",
|
|
32
32
|
"@liangmi/vp-config": "^1.0.0",
|
|
33
33
|
"@types/node": "^26.6.5",
|
|
34
34
|
"typescript": "7.0.2",
|
|
35
|
-
"vite-plus": "1.
|
|
35
|
+
"vite-plus": "1.4.0"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=22.12.0"
|