From bfd7065c0ea453175ffd2a2644a4c859eab480d5 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Fri, 2 Dec 2022 20:59:51 -0500 Subject: [PATCH] [O] Use yaml instead of json5 --- package.json | 1 - people/GLaDOSister/info.json5 | 11 ----------- people/GLaDOSister/info.yml | 7 +++++++ people/MioCardMeow/info.json5 | 11 ----------- people/MioCardMeow/info.yml | 7 +++++++ people/MizuharaNagisa/info.json5 | 11 ----------- people/MizuharaNagisa/info.yml | 7 +++++++ people/SevenBird/info.json5 | 11 ----------- people/SevenBird/info.yml | 7 +++++++ people/Uekawakuyuurei/info.json5 | 12 ------------ people/Uekawakuyuurei/info.yml | 8 ++++++++ people/donotexist_A/info.json5 | 11 ----------- people/donotexist_A/info.yml | 7 +++++++ people/gaoyanger/info.json5 | 12 ------------ people/gaoyanger/info.yml | 8 ++++++++ people/homoyamakaze/info.json5 | 11 ----------- people/homoyamakaze/info.yml | 7 +++++++ people/lintong/info.json5 | 11 ----------- people/lintong/info.yml | 7 +++++++ people/noname/info.json5 | 7 ------- people/noname/info.yml | 4 ++++ scripts/build.ts | 8 +++++--- yarn.lock | 5 ----- 23 files changed, 74 insertions(+), 117 deletions(-) delete mode 100644 people/GLaDOSister/info.json5 create mode 100644 people/GLaDOSister/info.yml delete mode 100644 people/MioCardMeow/info.json5 create mode 100644 people/MioCardMeow/info.yml delete mode 100644 people/MizuharaNagisa/info.json5 create mode 100644 people/MizuharaNagisa/info.yml delete mode 100644 people/SevenBird/info.json5 create mode 100644 people/SevenBird/info.yml delete mode 100644 people/Uekawakuyuurei/info.json5 create mode 100644 people/Uekawakuyuurei/info.yml delete mode 100644 people/donotexist_A/info.json5 create mode 100644 people/donotexist_A/info.yml delete mode 100644 people/gaoyanger/info.json5 create mode 100644 people/gaoyanger/info.yml delete mode 100644 people/homoyamakaze/info.json5 create mode 100644 people/homoyamakaze/info.yml delete mode 100644 people/lintong/info.json5 create mode 100644 people/lintong/info.yml delete mode 100644 people/noname/info.json5 create mode 100644 people/noname/info.yml diff --git a/package.json b/package.json index 4748d311..09a7c63e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "esbuild": "^0.15.14", "fs-extra": "^10.1.0", "js-yaml": "^4.1.0", - "json5": "^2.2.1", "markdown-yaml-metadata-parser": "^3.0.0", "ts-node": "^10.9.1", "typescript": "^4.9.3", diff --git a/people/GLaDOSister/info.json5 b/people/GLaDOSister/info.json5 deleted file mode 100644 index ad0d9738..00000000 --- a/people/GLaDOSister/info.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - id: 'GLaDOSister', - profileUrl: '${path}/photos/profile.jpg', - info: { - born: "1997-01-13", - died: "2019-12-03" - }, - websites: [ - ['zhihu', 'https://www.zhihu.com/people/gmjyxx'], - ], -} diff --git a/people/GLaDOSister/info.yml b/people/GLaDOSister/info.yml new file mode 100644 index 00000000..f00d8acf --- /dev/null +++ b/people/GLaDOSister/info.yml @@ -0,0 +1,7 @@ +id: GLaDOSister +profileUrl: ${path}/photos/profile.jpg +info: + born: '1997-01-13' + died: '2019-12-03' +websites: + zhihu: https://www.zhihu.com/people/gmjyxx diff --git a/people/MioCardMeow/info.json5 b/people/MioCardMeow/info.json5 deleted file mode 100644 index 9d6c877a..00000000 --- a/people/MioCardMeow/info.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - id: 'MioCardMeow', - profileUrl: '${path}/photos/profile.jpg', - info: { - born: "2005-04-02", - died: "2022-01-31" - }, - websites: [ - ['twitter', 'https://twitter.com/MiocardMeow'], - ], -} diff --git a/people/MioCardMeow/info.yml b/people/MioCardMeow/info.yml new file mode 100644 index 00000000..951b8ee3 --- /dev/null +++ b/people/MioCardMeow/info.yml @@ -0,0 +1,7 @@ +id: MioCardMeow +profileUrl: ${path}/photos/profile.jpg +info: + born: '2005-04-02' + died: '2022-01-31' +websites: + twitter: https://twitter.com/MiocardMeow diff --git a/people/MizuharaNagisa/info.json5 b/people/MizuharaNagisa/info.json5 deleted file mode 100644 index f42a0f09..00000000 --- a/people/MizuharaNagisa/info.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - id: 'MizuharaNagisa', - profileUrl: '${path}/photos/profile.png', - info: { - born: "2002-04-19", - died: "2021-07-21" - }, - websites: [ - ['twitter', 'https://twitter.com/MizuharaNagisa'], - ], -} diff --git a/people/MizuharaNagisa/info.yml b/people/MizuharaNagisa/info.yml new file mode 100644 index 00000000..5fe8fda9 --- /dev/null +++ b/people/MizuharaNagisa/info.yml @@ -0,0 +1,7 @@ +id: MizuharaNagisa +profileUrl: ${path}/photos/profile.png +info: + born: '2002-04-19' + died: '2021-07-21' +websites: + twitter: https://twitter.com/MizuharaNagisa diff --git a/people/SevenBird/info.json5 b/people/SevenBird/info.json5 deleted file mode 100644 index 1409952d..00000000 --- a/people/SevenBird/info.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - id: 'SevenBird', - profileUrl: '${path}/photos/profile.jpg', - info: { - born: "2005-02-26", - died: "2022-08-12" - }, - websites: [ - ['twitter', 'https://twitter.com/Selrayer'], - ], -} diff --git a/people/SevenBird/info.yml b/people/SevenBird/info.yml new file mode 100644 index 00000000..c12b1a2b --- /dev/null +++ b/people/SevenBird/info.yml @@ -0,0 +1,7 @@ +id: SevenBird +profileUrl: ${path}/photos/profile.jpg +info: + born: '2005-02-26' + died: '2022-08-12' +websites: + twitter: https://twitter.com/Selrayer diff --git a/people/Uekawakuyuurei/info.json5 b/people/Uekawakuyuurei/info.json5 deleted file mode 100644 index e2d5c114..00000000 --- a/people/Uekawakuyuurei/info.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - id: 'Uekawakuyuurei', - profileUrl: '${path}/photos/profile.jpg', - info: { - born: "2000-12-04", - died: "2021-09-07" - }, - websites: [ - ['twitter', 'https://twitter.com/Uekawakuyuurei'], - ['telegram', 'https://t.me/joinchat/65vSQ6ELb3YxN2I9'], - ], -} diff --git a/people/Uekawakuyuurei/info.yml b/people/Uekawakuyuurei/info.yml new file mode 100644 index 00000000..536d6ef4 --- /dev/null +++ b/people/Uekawakuyuurei/info.yml @@ -0,0 +1,8 @@ +id: Uekawakuyuurei +profileUrl: ${path}/photos/profile.jpg +info: + born: '2000-12-04' + died: '2021-09-07' +websites: + twitter: https://twitter.com/Uekawakuyuurei + telegram: https://t.me/joinchat/65vSQ6ELb3YxN2I9 diff --git a/people/donotexist_A/info.json5 b/people/donotexist_A/info.json5 deleted file mode 100644 index 32937496..00000000 --- a/people/donotexist_A/info.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - id: 'donotexist_A', - profileUrl: '${path}/photos/profile.jpg', - info: { - born: "2002-05-07", - died: "2021-05-13" - }, - websites: [ - ['twitter', 'https://twitter.com/donotexist_A'], - ], -} diff --git a/people/donotexist_A/info.yml b/people/donotexist_A/info.yml new file mode 100644 index 00000000..98d9cb38 --- /dev/null +++ b/people/donotexist_A/info.yml @@ -0,0 +1,7 @@ +id: donotexist_A +profileUrl: ${path}/photos/profile.jpg +info: + born: '2002-05-07' + died: '2021-05-13' +websites: + twitter: https://twitter.com/donotexist_A diff --git a/people/gaoyanger/info.json5 b/people/gaoyanger/info.json5 deleted file mode 100644 index 881481ab..00000000 --- a/people/gaoyanger/info.json5 +++ /dev/null @@ -1,12 +0,0 @@ -{ - id: 'gaoyanger', - profileUrl: '${path}/photos/profile.jpg', - info: { - born: "2002-04-12", - died: "2020-08-27", - }, - websites: [ - ['twitter', 'https://twitter.com/gaoyanger'], - ['zhihu', 'https://www.zhihu.com/people/chen-ru-32-42'], - ], -} diff --git a/people/gaoyanger/info.yml b/people/gaoyanger/info.yml new file mode 100644 index 00000000..bd773b9d --- /dev/null +++ b/people/gaoyanger/info.yml @@ -0,0 +1,8 @@ +id: gaoyanger +profileUrl: ${path}/photos/profile.jpg +info: + born: '2002-04-12' + died: '2020-08-27' +websites: + twitter: https://twitter.com/gaoyanger + zhihu: https://www.zhihu.com/people/chen-ru-32-42 diff --git a/people/homoyamakaze/info.json5 b/people/homoyamakaze/info.json5 deleted file mode 100644 index 8032a60c..00000000 --- a/people/homoyamakaze/info.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - id: 'homoyamakaze', - profileUrl: '${path}/photos/profile.jpg', - info: { - born: "1999-11-03", - died: "2022-11-09" - }, - websites: [ - ['twitter', 'https://twitter.com/homoyamakaze'], - ], -} diff --git a/people/homoyamakaze/info.yml b/people/homoyamakaze/info.yml new file mode 100644 index 00000000..f2c98090 --- /dev/null +++ b/people/homoyamakaze/info.yml @@ -0,0 +1,7 @@ +id: homoyamakaze +profileUrl: ${path}/photos/profile.jpg +info: + born: '1999-11-03' + died: '2022-11-09' +websites: + twitter: https://twitter.com/homoyamakaze diff --git a/people/lintong/info.json5 b/people/lintong/info.json5 deleted file mode 100644 index 9ad1b8f3..00000000 --- a/people/lintong/info.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - id: 'lintong', - profileUrl: '${path}/photos/profile.jpg', - info: { - born: "2000.06.01", - died: "2022.06.06" - }, - websites: [ - ['QQ', 'https://304915994.qzone.qq.com/'], - ], -} diff --git a/people/lintong/info.yml b/people/lintong/info.yml new file mode 100644 index 00000000..06ca9775 --- /dev/null +++ b/people/lintong/info.yml @@ -0,0 +1,7 @@ +id: lintong +profileUrl: ${path}/photos/profile.jpg +info: + born: 2000.06.01 + died: 2022.06.06 +websites: + QQ: https://304915994.qzone.qq.com/ diff --git a/people/noname/info.json5 b/people/noname/info.json5 deleted file mode 100644 index 755358ff..00000000 --- a/people/noname/info.json5 +++ /dev/null @@ -1,7 +0,0 @@ -{ - id: 'noname', - profileUrl: '${path}/photos/profile.png', - websites: [ - ['one-among-us', 'https://one-among.us'], - ], -} diff --git a/people/noname/info.yml b/people/noname/info.yml new file mode 100644 index 00000000..064df98d --- /dev/null +++ b/people/noname/info.yml @@ -0,0 +1,4 @@ +id: noname +profileUrl: ${path}/photos/profile.png +websites: + one-among-us: https://one-among.us diff --git a/scripts/build.ts b/scripts/build.ts index 13a9cc13..fb0c53c0 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -2,7 +2,6 @@ import url from "url"; import path from "path"; import fs from "fs-extra"; -import json5 from "json5"; import YAML from 'js-yaml'; import metadataParser from 'markdown-yaml-metadata-parser'; @@ -40,8 +39,8 @@ function buildPeopleInfoAndList() { // For each person for (const { dirname, srcPath, distPath } of people) { - const infoFile = fs.readFileSync(path.join(srcPath, `info.json5`), "utf-8"); - const info = json5.parse(infoFile); + const infoFile = fs.readFileSync(path.join(srcPath, `info.yml`), "utf-8"); + const info = YAML.load(infoFile); // Read the page.md of that language const markdown = fs.readFileSync(path.join(srcPath, `page${lang}.md`), "utf-8"); @@ -50,6 +49,9 @@ function buildPeopleInfoAndList() { const mdMeta = metadataParser(markdown).metadata info.name = mdMeta.name + // Convert website dict into entries [[k, v], ...] + info.websites = Object.entries(info.websites ?? {}) + // Convert info dict to [[key, value], ...] // And add info k-v pairs from markdown to the info object in json5 info.info = [...Object.entries(mdMeta.info ?? {}), ...Object.entries(info.info ?? {})] diff --git a/yarn.lock b/yarn.lock index 7b8d1b83..b4d0426e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -670,11 +670,6 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -json5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== - jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"