fangge 1.0.3 → 1.0.4

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/cli.js +48 -50
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -76,7 +76,7 @@ var education = {
76
76
  from: "2014",
77
77
  to: "2018"
78
78
  };
79
- var musicUrl = "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3";
79
+ var musicUrl = "https://archive.org/download/f7db6af68ab12dfa9894e8f6fff5e370954f6395457a5c5c00b45874a49138ec9a4b3f145fcc5e88/Super%20Mario%20Bros%20Owld.mp3";
80
80
  var links = [
81
81
  { label: "ListenHub", href: "https://listenhub.ai", display: "listenhub.ai" },
82
82
  {
@@ -252,35 +252,38 @@ var MusicPlayer = ({ status }) => {
252
252
  // source/components/mascot.tsx
253
253
  import { Box as Box4, Text as Text5 } from "ink";
254
254
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
255
- var R = "#E60012";
256
- var W = "#FFFFFF";
257
- var S = "#FFDAB9";
258
- var K = "#000000";
259
- var Mascot = () => /* @__PURE__ */ jsxs5(Box4, { flexDirection: "column", width: 11, children: [
255
+ var R = "#CE2029";
256
+ var H = "#6B420C";
257
+ var S = "#E8A860";
258
+ var Mascot = () => /* @__PURE__ */ jsxs5(Box4, { flexDirection: "column", width: 12, children: [
260
259
  /* @__PURE__ */ jsxs5(Text5, { children: [
261
- " ",
262
- /* @__PURE__ */ jsx5(Text5, { color: R, children: "\u2584\u2584\u2588\u2588\u2588\u2584\u2584" }),
263
- " "
260
+ " ",
261
+ /* @__PURE__ */ jsx5(Text5, { color: R, children: "\u2584\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584" }),
262
+ " "
264
263
  ] }),
265
264
  /* @__PURE__ */ jsxs5(Text5, { children: [
266
- /* @__PURE__ */ jsx5(Text5, { color: R, children: "\u2584\u2588" }),
267
- /* @__PURE__ */ jsx5(Text5, { color: R, backgroundColor: R, children: "\u2580\u2580" }),
268
- /* @__PURE__ */ jsx5(Text5, { color: R, children: "\u2588\u2588\u2588" }),
269
- /* @__PURE__ */ jsx5(Text5, { color: R, backgroundColor: R, children: "\u2580\u2580" }),
270
- /* @__PURE__ */ jsx5(Text5, { color: R, children: "\u2588\u2584" })
265
+ /* @__PURE__ */ jsx5(Text5, { color: H, children: "\u2584" }),
266
+ /* @__PURE__ */ jsx5(Text5, { color: H, backgroundColor: S, children: "\u2580" }),
267
+ /* @__PURE__ */ jsx5(Text5, { color: H, children: "\u2588" }),
268
+ /* @__PURE__ */ jsx5(Text5, { color: H, backgroundColor: S, children: "\u2580" }),
269
+ /* @__PURE__ */ jsx5(Text5, { color: S, children: "\u2588\u2588" }),
270
+ /* @__PURE__ */ jsx5(Text5, { color: H, children: "\u2588" }),
271
+ /* @__PURE__ */ jsx5(Text5, { color: S, children: "\u2588\u2584\u2584" }),
272
+ " "
271
273
  ] }),
272
274
  /* @__PURE__ */ jsxs5(Text5, { children: [
273
- " ",
274
- /* @__PURE__ */ jsx5(Text5, { color: S, children: "\u2588" }),
275
- /* @__PURE__ */ jsx5(Text5, { color: W, backgroundColor: K, children: "\u2022" }),
276
- /* @__PURE__ */ jsx5(Text5, { color: S, children: "\u2588\u2588\u2588" }),
277
- /* @__PURE__ */ jsx5(Text5, { color: W, backgroundColor: K, children: "\u2022" }),
278
- /* @__PURE__ */ jsx5(Text5, { color: S, children: "\u2588" }),
279
- " "
275
+ /* @__PURE__ */ jsx5(Text5, { color: H, children: "\u2588" }),
276
+ /* @__PURE__ */ jsx5(Text5, { color: S, backgroundColor: H, children: "\u2580" }),
277
+ /* @__PURE__ */ jsx5(Text5, { color: H, backgroundColor: S, children: "\u2580\u2580" }),
278
+ /* @__PURE__ */ jsx5(Text5, { color: S, children: "\u2588\u2588" }),
279
+ /* @__PURE__ */ jsx5(Text5, { color: S, backgroundColor: H, children: "\u2580" }),
280
+ /* @__PURE__ */ jsx5(Text5, { color: H, children: "\u2588" }),
281
+ /* @__PURE__ */ jsx5(Text5, { color: S, backgroundColor: H, children: "\u2580\u2580" }),
282
+ /* @__PURE__ */ jsx5(Text5, { color: S, children: "\u2580" })
280
283
  ] }),
281
284
  /* @__PURE__ */ jsxs5(Text5, { children: [
282
285
  " ",
283
- /* @__PURE__ */ jsx5(Text5, { color: S, children: "\u2588\u2588\u2588\u2588\u2588\u2588\u2588" }),
286
+ /* @__PURE__ */ jsx5(Text5, { color: S, children: "\u2580\u2580\u2580\u2580\u2580\u2580\u2580" }),
284
287
  " "
285
288
  ] })
286
289
  ] });
@@ -311,35 +314,30 @@ function useAudioPlayer(url) {
311
314
  resolve(dest);
312
315
  return;
313
316
  }
314
- const getter = url.startsWith("https") ? httpsGet : httpGet;
315
317
  const file = createWriteStream(dest);
316
- const request = getter(url, (res) => {
317
- if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
318
- file.close();
319
- const redirectGet = res.headers.location.startsWith("https") ? httpsGet : httpGet;
320
- redirectGet(res.headers.location, (redirectRes) => {
321
- redirectRes.pipe(file);
322
- file.on("finish", () => {
323
- file.close();
324
- resolve(dest);
325
- });
326
- }).on("error", reject);
327
- return;
328
- }
329
- res.pipe(file);
330
- file.on("finish", () => {
318
+ const follow = (target, maxRedirects = 5) => {
319
+ const getter = target.startsWith("https") ? httpsGet : httpGet;
320
+ getter(target, (res) => {
321
+ if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location && maxRedirects > 0) {
322
+ res.resume();
323
+ follow(res.headers.location, maxRedirects - 1);
324
+ return;
325
+ }
326
+ res.pipe(file);
327
+ file.on("finish", () => {
328
+ file.close();
329
+ resolve(dest);
330
+ });
331
+ }).on("error", (err) => {
331
332
  file.close();
332
- resolve(dest);
333
+ try {
334
+ unlinkSync(dest);
335
+ } catch {
336
+ }
337
+ reject(err);
333
338
  });
334
- });
335
- request.on("error", (err) => {
336
- file.close();
337
- try {
338
- unlinkSync(dest);
339
- } catch {
340
- }
341
- reject(err);
342
- });
339
+ };
340
+ follow(url);
343
341
  }),
344
342
  [url]
345
343
  );
@@ -459,7 +457,6 @@ var App = () => {
459
457
  /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: profile.tagline })
460
458
  ] })
461
459
  ] }),
462
- /* @__PURE__ */ jsx6(MusicPlayer, { status: audio.status }),
463
460
  /* @__PURE__ */ jsx6(Experience, { experiences }),
464
461
  /* @__PURE__ */ jsx6(Projects, { projects }),
465
462
  /* @__PURE__ */ jsxs6(Box5, { flexDirection: "column", paddingTop: 1, children: [
@@ -475,7 +472,8 @@ var App = () => {
475
472
  ] })
476
473
  ] })
477
474
  ] }),
478
- /* @__PURE__ */ jsx6(Links, { links })
475
+ /* @__PURE__ */ jsx6(Links, { links }),
476
+ /* @__PURE__ */ jsx6(MusicPlayer, { status: audio.status })
479
477
  ]
480
478
  }
481
479
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fangge",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Fango's terminal business card — run npx fango",
5
5
  "type": "module",
6
6
  "bin": {