feat: autogenerate port & showcase list in README (#1894)
parent
6314261943
commit
fca166b878
@ -0,0 +1,38 @@
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||
|
||||
name: Generate READMEs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
DENO_DIR: deno_cache
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Git Checkout Deno Module
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- name: Set up Deno
|
||||
uses: denoland/setup-deno@v1
|
||||
with:
|
||||
deno-version: v1.x
|
||||
- name: Cache Deno dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: ${{ hashFiles('resources/generate/deno.lock') }}
|
||||
path: ${{ env.DENO_DIR }}
|
||||
- name: Update READMEs
|
||||
working-directory: resources/generate
|
||||
run: ./main.ts
|
||||
- name: Push changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: "chore: re-generate README sections"
|
@ -1 +1,2 @@
|
||||
deno_cache/
|
||||
node_modules/
|
||||
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"lock": "deno.lock"
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
{
|
||||
"version": "2",
|
||||
"remote": {
|
||||
"https://deno.land/std@0.172.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462",
|
||||
"https://deno.land/std@0.172.0/_util/os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3",
|
||||
"https://deno.land/std@0.172.0/bytes/bytes_list.ts": "b4cbdfd2c263a13e8a904b12d082f6177ea97d9297274a4be134e989450dfa6a",
|
||||
"https://deno.land/std@0.172.0/bytes/concat.ts": "d26d6f3d7922e6d663dacfcd357563b7bf4a380ce5b9c2bbe0c8586662f25ce2",
|
||||
"https://deno.land/std@0.172.0/bytes/copy.ts": "939d89e302a9761dcf1d9c937c7711174ed74c59eef40a1e4569a05c9de88219",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/dumper/dumper.ts": "49053c293a2250b33f2efc0ce3973280c6dc3bc0b41397af3863b5f03340e01b",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/dumper/dumper_state.ts": "975a3702752a29251c5746206507dfebbfede60dd2c0dec161dc22633fbc6085",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/error.ts": "e60ab51d7c0253cf0d1cf7d445202e8e3da5c77aae0032071ba7400121c281b4",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/loader/loader.ts": "6c59f60faaf78d73db0e016293f4bfed19e6356d7064230d07d6b68a65a1df5d",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/loader/loader_state.ts": "fcc82fcdf167acb0e9e5e32b32682e58b45f2d44210bf685794797ccb5621232",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/mark.ts": "0027d6f62a70a6c64b85bd1751ddf1646ea97edcefbf5bea1706d5e519f4e34f",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/parse.ts": "63e79582e07145ca1d3205d1ac72b82bf5ce14159dabae195abe7e36de8111bd",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/schema.ts": "0833c75c59bf72c8a8f96f6c0615bcd98d23fdd9b076657f42b5c1a4f9d972b0",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/schema/core.ts": "366f56673336ba24f5723c04319efcc7471be5f55d5f8d95c9b4a38ec233d4c6",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/schema/default.ts": "96e9ed6ead36f53a0832c542fc9b8cca7f8b4a67c1c8424e1423a39ee7154db7",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/schema/extended.ts": "f9bd75c79ebdfb92a8e167488b6bde7113a31b8fabe20ad7eed0904fba11bcd2",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/schema/failsafe.ts": "cddcbf0258bbe0cd77ca10e2f5aec13439f50d4068f96aab08ca2d64496dabe8",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/schema/json.ts": "c86905dfb1b6c4633750bfbb5bd529a30be5c08287ab7eb6694390b40e276487",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/schema/mod.ts": "051f93dd97a15aaad2da62bd24627e8fd2f02fb026d21567d924b720d606f078",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/state.ts": "ef03d55ec235d48dcfbecc0ab3ade90bfae69a61094846e08003421c2cf5cfc6",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/stringify.ts": "426b73e4dbaeed26ed855add3862786d7e374bd4c59e5e1bd9a6fcd5082be3c7",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type.ts": "5ded5472a0f17a219ac3b0e90d96dc8472a68654a40258a31e03a6c6297b6788",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/binary.ts": "935d39794420ac3718d26716192239de6a53566c6f2ba5010e8ed26936b94a89",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/bool.ts": "1c99cfbaa94b022575b636a73e1549569b26fc6bbff2cd5e539aa77b49bdf303",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/float.ts": "f60ad19b27050add694bfc255b7efef27103f047861aa657823ff3f6853bad11",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/function.ts": "65a37f6bef43ef141854ee48a1058d9c9c4c80ed6eed6cd35608329a6957e27a",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/int.ts": "892f59bb7b2dbd64dd9b643c17441af95c0b962ad027e454cb84a68864787b86",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/map.ts": "92e647a6aec0dc184ea4b039a77a15883b54da754311189c595b43f6aaa50030",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/merge.ts": "8192bf3e4d637f32567917f48bb276043da9cf729cf594e5ec191f7cd229337e",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/mod.ts": "060e2b3d38725094b77ea3a3f05fc7e671fced8e67ca18e525be98c4aa8f4bbb",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/nil.ts": "606e8f0c44d73117c81abec822f89ef81e40f712258c74f186baa1af659b8887",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/omap.ts": "fbd5da9970c211335ff7c8fa11e9c5e9256e568d52418ac237d1538c5cb0d5e6",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/pairs.ts": "ea487a44c0ae64d8d952779fa1cb5fa0a12f32a0b5d3d1e8c1f06f446448427c",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/regexp.ts": "672000d22a1062d61577d30b218c28f5cb1d039a7a60079fdde6a4e558d5ca51",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/seq.ts": "39b28f7c7aa41263c5c42cab9d184f03555e9ba19493766afc0c0c325a9ac49f",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/set.ts": "0e30a9f750306b514c8ae9869d1ac2548d57beab55b33e85ea9673ca0a08264c",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/str.ts": "a67a3c6e429d95041399e964015511779b1130ea5889fa257c48457bd3446e31",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/timestamp.ts": "706ea80a76a73e48efaeb400ace087da1f927647b53ad6f754f4e06d51af087f",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/type/undefined.ts": "94a316ca450597ccbc6750cbd79097ad0d5f3a019797eed3c841a040c29540ba",
|
||||
"https://deno.land/std@0.172.0/encoding/_yaml/utils.ts": "26b311f0d42a7ce025060bd6320a68b50e52fd24a839581eb31734cd48e20393",
|
||||
"https://deno.land/std@0.172.0/encoding/yaml.ts": "02571d1bbbcfd7c5647789cee872ecf9c1c470e1b1a40948ed219fb661e19d87",
|
||||
"https://deno.land/std@0.172.0/io/buf_reader.ts": "90a7adcb3638d8e1361695cdf844d58bcd97c41711dc6f9f8acc0626ebe097f5",
|
||||
"https://deno.land/std@0.172.0/io/buf_writer.ts": "759c69d304b04d2909976f2a03a24a107276fbd81ed13593c5c2d43d104b52f3",
|
||||
"https://deno.land/std@0.172.0/io/buffer.ts": "24abd4a65403ca3fdffcb6d3f985b0285adfd785f1311ce681708a21126776ad",
|
||||
"https://deno.land/std@0.172.0/io/read_delim.ts": "7e102c66f00a118fa1e1ccd4abb080496f43766686907fd8b9522fdf85443586",
|
||||
"https://deno.land/std@0.172.0/io/read_lines.ts": "baee9e35034f2fdfccf63bc24b7e3cb45aa1c1c5de26d178f7bcbc572e87772f",
|
||||
"https://deno.land/std@0.172.0/io/read_string_delim.ts": "46eb0c9db3547caf8c759631effa200bbe48924f9b34f41edc627bde36cee52d",
|
||||
"https://deno.land/std@0.172.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0",
|
||||
"https://deno.land/std@0.172.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b",
|
||||
"https://deno.land/std@0.172.0/path/_util.ts": "86c2375a996c1931b2f2ac71fefd5ddf0cf0e579fa4ab12d3e4c552d4223b8d8",
|
||||
"https://deno.land/std@0.172.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000",
|
||||
"https://deno.land/std@0.172.0/path/glob.ts": "d479e0a695621c94d3fd7fe7abd4f9499caf32a8de13f25073451c6ef420a4e1",
|
||||
"https://deno.land/std@0.172.0/path/mod.ts": "4b83694ac500d7d31b0cdafc927080a53dc0c3027eb2895790fb155082b0d232",
|
||||
"https://deno.land/std@0.172.0/path/posix.ts": "0874b341c2c6968ca38d323338b8b295ea1dae10fa872a768d812e2e7d634789",
|
||||
"https://deno.land/std@0.172.0/path/separator.ts": "0fb679739d0d1d7bf45b68dacfb4ec7563597a902edbaf3c59b50d5bcadd93b1",
|
||||
"https://deno.land/std@0.172.0/path/win32.ts": "672942919dd66ce1b8c224e77d3447e2ad8254eaff13fe6946420a9f78fa141e",
|
||||
"https://deno.land/std@0.172.0/types.d.ts": "220ed56662a0bd393ba5d124aa6ae2ad36a00d2fcbc0e8666a65f4606aaa9784",
|
||||
"https://esm.sh/ajv@8.12.0": "594b01900aff1e27d4c419046dd09ac30290281839e784253f53b66f47898108",
|
||||
"https://esm.sh/v106/ajv@8.12.0/deno/ajv.js": "23854337afccdad144d7f2f1f165dc7361882a8cd5644e7e56ec311697f80cc6",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/ajv.d.ts": "e2efa41fff63778572ae1d04dc9d62048684aa8aad6edd0218e562402ea9e0ec",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/codegen/code.d.ts": "2d225e7bda2871c066a7079c88174340950fb604f624f2586d3ea27bb9e5f4ff",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/codegen/index.d.ts": "9785e1199bae7389a92831c1f732fa72fc6f34a9c3f8948a5acfc8451e72f833",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/codegen/scope.d.ts": "4ad65126bd23e1b8fe40f5375b812676694dccc232060a53bff52ac416aef059",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/errors.d.ts": "65c56e41c3ad2867c1c179e7cb8fd4fcbb4cdaa172e2cc5242fbbfab4be089c0",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/index.d.ts": "dc63e8445111329e56e443e63cc892632015ddbfa76170e4959b4d876535285e",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/ref_error.d.ts": "b5e33c3fb8302173827cb3ee68d45c9ff45d2e8ec2a9b347ede1f0b5e00ccdf3",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/resolve.d.ts": "23d18dca3d3b9b1c85cffc826914219e39db265aa3bd2eb1259cdce013a4a94a",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/rules.d.ts": "18e085a67ae0ea81f7d4539e8f682f0b9b150b12af9e66f7760a03356aec507f",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/util.d.ts": "3acaa483c7cf47fc5ced1473b830ec37a8f0d40238f3d96246657c970e13e6c7",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/validate/dataType.d.ts": "4f56c2ba7307d8d5749dd4b60fadab04dce7d69838e129d04c3837cb397ce5bf",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/validate/index.d.ts": "3e1bff49fa21ad6c11d06b5074fd623443dbd5db8fed3bd78411232401a0313e",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/compile/validate/subschema.d.ts": "79ae0a30e9f503b57d8c698e40f1141de1ff05d36dc9b08bc9b3ed6fe1074f9f",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/core.d.ts": "c0d24ae17225116e4895c1961a957acb2158c3ea3f2164ede7b726fc1112edf7",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/runtime/validation_error.d.ts": "515ba5900e0017f5512f442a31826d4210ac782b9b6fad6dbfcab61b5f8c881f",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/types/index.d.ts": "7fdb4bb0d8c9559e391d89e36061ffb02e30b8b7886c246cffeb793937a5f404",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/types/json-schema.d.ts": "6b6ed4aa017eb6867cef27257379cfe3e16caf628aceae3f0163dbafcaf891ff",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/types/jtd-schema.d.ts": "25f1159094dc0bf3a71313a74e0885426af21c5d6564a254004f2cadf9c5b052",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/additionalItems.d.ts": "810dc8272ea4023b647017ee4ff3ababce2a186c48a1e371e0fb631ed5bf9499",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/additionalProperties.d.ts": "93eafd639403aca489d2a2bd26fb89b46a855a271fa3685df23d3f3cfd6c7781",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/anyOf.d.ts": "3bcf9e93173ce018235392adf8ac6b9d4173b632d2fbd74e083f58c5e8dda50d",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/contains.d.ts": "e271ef23f0eecaa3bc3241429c25694aab4e47d96b8bd564d68e077ca2155251",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/dependencies.d.ts": "4da778139fb84dce56f1bb4ef757c17d891a9e3f0f5cff5b835ebde09ac1e956",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/if.d.ts": "48955ffe23bd06877c1bbc7f364a9e80f2dae56783fbfb79c16520375c376230",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/index.d.ts": "16bea08752cd2ca1eabbeb11ebddd265f4150cf171c1041e11a0501f35a49d4e",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/items2020.d.ts": "263fb5e5115873391f99a45bab2e975b0483e8a45da95bdecdbec6760c127aa4",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/not.d.ts": "869d7db4971ca299ff238ca0ea8b3d5cd752b449ccb6559790db0c8ad0c5dfbe",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/oneOf.d.ts": "385baa5077f5878b7506ec9192fd7ab686f7fda6276b71b877ecc0424c24badb",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/applicator/propertyNames.d.ts": "2b379d5bc77776abe065fab1e47f84929f6274e0e380c0c1c27a6965e7f4aabc",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/discriminator/index.d.ts": "d6f1fa129cf004b83f2913b3b3094d510e77b421f87ed6ee69f5f89b493fe91b",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/discriminator/types.d.ts": "cdcdcd676aa93fb9822b91569f06178c6cdcbb216f6dab289cc193ac99638838",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/errors.d.ts": "673f52fa2cc7f047ab6f369d12ed82088358174fd58474329d79fa999e3ce635",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/format/format.d.ts": "1fbffe88e41ab623cdd71ef300206298a6780ed9fd1abfd7d63f1892379c7e9a",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/unevaluated/unevaluatedItems.d.ts": "8b9b8c5189417cda763245be14d202e1a199091f1b0b3a0f4c957bdb85ffd044",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts": "4e10c976131382776b03ab8cee68e7764c9bf7db1ab9132066bb0d1f640c03fe",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/validation/const.d.ts": "90985bc6fed39fd595acab2f8f91ce2274b46c9ec7f68d9624d4a677fb206ae8",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/validation/dependentRequired.d.ts": "632b0af8992f86056e5571fbb148835d582332bb613c4e80fdf6719c501483c5",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/validation/enum.d.ts": "15663b84b4d935e1a282269a9ac1072c96d9351c941fa959469cd1ba2419b148",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/validation/index.d.ts": "d05ad2c8e4613c06e314105aaa7b43caa7a373e5f2671c51053bc9160803fbd5",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/validation/limitNumber.d.ts": "3b4220c15eacf28d3732f9df3a2ad0908b9a388dc9d13c35311233f11c28dd36",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/validation/multipleOf.d.ts": "a62b50d44d9c8d0e26b3b42eb90fe87ad1fad683122aa076e6f8d30fb056ad5f",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/validation/pattern.d.ts": "bc7f68367bbd6bdf9ed47aae8590770c7ec7ad6d44c0de11df696162038224b1",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/validation/required.d.ts": "7a14df7f7a58dd22ca4ca449f39cc0168eec566c95d9d7950e5b91da50bf4415",
|
||||
"https://esm.sh/v106/ajv@8.12.0/dist/vocabularies/validation/uniqueItems.d.ts": "9a9056c3705215ba3289f7ad913e92babeca6e53091aa8095ee85e66ee2bd089",
|
||||
"https://esm.sh/v106/fast-deep-equal@3.1.3/deno/fast-deep-equal.js": "4695b025e9a792678087d71f58e1fa07e8021b636d22fda8c0320fcff65a3c47",
|
||||
"https://esm.sh/v106/json-schema-traverse@1.0.0/deno/json-schema-traverse.js": "ff987aaea4950aa9c4eea3ca19c9ec2b3229434e22e711415aa77fb513689a9c",
|
||||
"https://esm.sh/v106/uri-js@4.4.1/deno/uri-js.js": "cb0fe68d76c29d62c7b79baf964e1b1c6623039faae892514776f0680711fc3e",
|
||||
"https://esm.sh/v106/uri-js@4.4.1/dist/es5/uri.all.d.ts": "9f3c5498245c38c9016a369795ec5ef1768d09db63643c8dba9656e5ab294825"
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
export { parse as parseYaml } from "https://deno.land/std@0.172.0/encoding/yaml.ts";
|
||||
|
||||
import Ajv from "https://esm.sh/ajv@8.12.0";
|
||||
import * as path from "https://deno.land/std@0.172.0/path/mod.ts";
|
||||
import schema from "../ports.schema.json" assert { type: "json" };
|
||||
|
||||
export { Ajv, path, schema };
|
@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env -S deno run --allow-env --allow-read --allow-write
|
||||
|
||||
import { Ajv, parseYaml, path, schema } from "./deps.ts";
|
||||
import type { Categories, Port, Ports, Showcases } from "./types.d.ts";
|
||||
|
||||
const root = new URL(".", import.meta.url).pathname;
|
||||
|
||||
type Metadata = {
|
||||
categories: Categories;
|
||||
ports: Ports;
|
||||
showcases: Showcases;
|
||||
};
|
||||
|
||||
const ajv = new Ajv();
|
||||
const validate = ajv.compile<Metadata>(schema);
|
||||
|
||||
const portsYaml = Deno.readTextFileSync(path.join(root, "../ports.yml"));
|
||||
const data = parseYaml(portsYaml) as Metadata;
|
||||
|
||||
// throw error if the YAML is invalid
|
||||
if (!validate(data)) {
|
||||
console.log(validate.errors);
|
||||
Deno.exit(1);
|
||||
}
|
||||
|
||||
export type MappedPort = Port & { html_url: string };
|
||||
|
||||
const categorized = Object.entries(data.ports).reduce((acc, [slug, port]) => {
|
||||
!acc[port.category] && (acc[port.category] = []);
|
||||
acc[port.category].push({
|
||||
html_url: `https://github.com/catppuccin/${slug}`,
|
||||
...port,
|
||||
});
|
||||
acc[port.category].sort((a, b) => a.name.localeCompare(b.name));
|
||||
return acc;
|
||||
}, {} as Record<string, MappedPort[]>);
|
||||
|
||||
const portListData = data.categories.map((category) => {
|
||||
return {
|
||||
meta: category,
|
||||
ports: categorized[category.key],
|
||||
};
|
||||
});
|
||||
|
||||
const updateReadme = ({
|
||||
readme,
|
||||
section,
|
||||
newContent,
|
||||
}: {
|
||||
readme: string;
|
||||
section: string;
|
||||
newContent: string;
|
||||
}): string => {
|
||||
const preamble =
|
||||
"<!-- the following section is auto-generated, do not edit -->";
|
||||
const markers = {
|
||||
start: `<!-- AUTOGEN:${section.toUpperCase()} START -->`,
|
||||
end: `<!-- AUTOGEN:${section.toUpperCase()} END -->`,
|
||||
};
|
||||
|
||||
const wrapped = markers.start + "\n" + preamble + "\n" + newContent + "\n" +
|
||||
markers.end;
|
||||
|
||||
if (
|
||||
!(
|
||||
readmeContent.includes(markers.start) &&
|
||||
readmeContent.includes(markers.end)
|
||||
)
|
||||
) {
|
||||
throw new Error("Markers not found in README.md");
|
||||
}
|
||||
|
||||
const pre = readme.split(markers.start)[0];
|
||||
const end = readme.split(markers.end)[1];
|
||||
|
||||
return pre + wrapped + end;
|
||||
};
|
||||
|
||||
const readmePath = path.join(root, "../../README.md");
|
||||
let readmeContent = Deno.readTextFileSync(readmePath);
|
||||
|
||||
const portContent = portListData.map((data) => {
|
||||
return `<details open>
|
||||
<summary>${data.meta.emoji} ${data.meta.name}</summary>
|
||||
|
||||
${data.ports.map((port) => `- [${port.name}](${port.html_url})`).join("\n")}
|
||||
|
||||
</details>`;
|
||||
}).join("\n");
|
||||
|
||||
const showcaseContent = data.showcases.map((showcase) => {
|
||||
return `- [${showcase.title}](${showcase.link}) - ${showcase.description}`;
|
||||
}).join("\n");
|
||||
|
||||
try {
|
||||
readmeContent = updateReadme({
|
||||
readme: readmeContent,
|
||||
section: "portlist",
|
||||
newContent: portContent,
|
||||
});
|
||||
readmeContent = updateReadme({
|
||||
readme: readmeContent,
|
||||
section: "showcase",
|
||||
newContent: showcaseContent,
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("Failed to update the README:", e);
|
||||
} finally {
|
||||
Deno.writeTextFileSync(readmePath, readmeContent);
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* This file was automatically generated by json-schema-to-typescript.
|
||||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
||||
* and run json-schema-to-typescript to regenerate this file.
|
||||
*/
|
||||
|
||||
export type Key =
|
||||
| "browser"
|
||||
| "browser_extension"
|
||||
| "cli"
|
||||
| "code_editor"
|
||||
| "development"
|
||||
| "game"
|
||||
| "leisure"
|
||||
| "library"
|
||||
| "messaging"
|
||||
| "note_taking"
|
||||
| "productivity"
|
||||
| "search_engine"
|
||||
| "social"
|
||||
| "system"
|
||||
| "terminal";
|
||||
export type Name = string;
|
||||
export type Emoji = string;
|
||||
/**
|
||||
* The categories listed in the README
|
||||
*/
|
||||
export type Categories = CategoryItem[];
|
||||
/**
|
||||
* The Name of the software the port is for.
|
||||
*/
|
||||
export type Name1 = string;
|
||||
/**
|
||||
* The category that fits the port the most
|
||||
*/
|
||||
export type Category =
|
||||
| "browser"
|
||||
| "browser_extension"
|
||||
| "cli"
|
||||
| "code_editor"
|
||||
| "development"
|
||||
| "game"
|
||||
| "leisure"
|
||||
| "library"
|
||||
| "messaging"
|
||||
| "note_taking"
|
||||
| "productivity"
|
||||
| "search_engine"
|
||||
| "social"
|
||||
| "system"
|
||||
| "terminal";
|
||||
/**
|
||||
* The platforms the port supports. Either an array of supported operating systems, "agnostic" (indicating support for all platforms), or "userstyle".
|
||||
*/
|
||||
export type Platform = OperatingSystems[] | ("agnostic" | "userstyle");
|
||||
export type OperatingSystems =
|
||||
| "android"
|
||||
| "ios"
|
||||
| "linux"
|
||||
| "macos"
|
||||
| "windows";
|
||||
/**
|
||||
* The fill color for the icon on the website.
|
||||
*/
|
||||
export type Color =
|
||||
| "rosewater"
|
||||
| "flamingo"
|
||||
| "pink"
|
||||
| "mauve"
|
||||
| "red"
|
||||
| "maroon"
|
||||
| "peach"
|
||||
| "yellow"
|
||||
| "green"
|
||||
| "teal"
|
||||
| "sky"
|
||||
| "sapphire"
|
||||
| "blue"
|
||||
| "lavender"
|
||||
| "text";
|
||||
/**
|
||||
* The icon to use on the website. This should be the same name as the SVG file on https://simpleicons.org/. If a `.svg` suffix is present, it's taken from the local website repository resources.
|
||||
*/
|
||||
export type Icon = string;
|
||||
/**
|
||||
* Whether the port is a userstyle
|
||||
*/
|
||||
export type Userstyle = boolean;
|
||||
export type Title = string;
|
||||
export type Link = string;
|
||||
export type Link1 = string;
|
||||
/**
|
||||
* Each showcase listed in the README
|
||||
*/
|
||||
export type Showcases = ShowcaseItem[];
|
||||
|
||||
export interface PortsSchema {
|
||||
categories?: Categories;
|
||||
ports?: Ports;
|
||||
showcases?: Showcases;
|
||||
}
|
||||
export interface CategoryItem {
|
||||
key: Key;
|
||||
name: Name;
|
||||
emoji: Emoji;
|
||||
}
|
||||
/**
|
||||
* All ports in the catppuccin org.
|
||||
*/
|
||||
export interface Ports {
|
||||
[k: string]: Port;
|
||||
}
|
||||
/**
|
||||
* The GitHub repository name of the port.
|
||||
*
|
||||
* This interface was referenced by `Ports`'s JSON-Schema definition
|
||||
* via the `patternProperty` "[A-Za-z0-9_\-]".
|
||||
*/
|
||||
export interface Port {
|
||||
name: Name1;
|
||||
category: Category;
|
||||
platform: Platform;
|
||||
color?: Color;
|
||||
icon?: Icon;
|
||||
userstyle?: Userstyle;
|
||||
}
|
||||
export interface ShowcaseItem {
|
||||
title: Title;
|
||||
link: Link;
|
||||
description: Link1;
|
||||
}
|
@ -1,117 +1,225 @@
|
||||
{
|
||||
"definitions": {},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://raw.githubusercontent.com/catppuccin/catppuccin/main/resources/ports.schema.json",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"categories": {
|
||||
"$id": "#categories",
|
||||
"title": "Categories",
|
||||
"description": "The categories listed in the README",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$id": "#categories/item",
|
||||
"title": "Category item",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"key",
|
||||
"name",
|
||||
"emoji"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"key": {
|
||||
"$id": "#categories/category/key",
|
||||
"title": "key",
|
||||
"type": "string",
|
||||
"$ref": "#/$defs/category"
|
||||
},
|
||||
"name": {
|
||||
"$id": "#categories/category/name",
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
"emoji": {
|
||||
"$id": "#categories/category/emoji",
|
||||
"title": "Emoji",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ports": {
|
||||
"$id": "#ports",
|
||||
"title": "Ports",
|
||||
"type": "object",
|
||||
"description": "All ports in the catppuccin org.",
|
||||
"patternProperties": {
|
||||
"[A-Za-z0-9_\\-]": {
|
||||
"$id": "#ports/port",
|
||||
"title": "Port",
|
||||
"type": "object",
|
||||
"description": "The GitHub repository name of the port.",
|
||||
"examples": ["nvim"],
|
||||
"required": ["category", "name", "platform"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"$id": "#ports/port/name",
|
||||
"title": "Name",
|
||||
"description": "The Name of the software the port is for",
|
||||
"type": "string",
|
||||
"examples": ["Neovim"]
|
||||
},
|
||||
"category": {
|
||||
"$id": "#ports/port/category",
|
||||
"title": "Category",
|
||||
"$id": "#ports/port",
|
||||
"title": "Port",
|
||||
"type": "object",
|
||||
"description": "The GitHub repository name of the port.",
|
||||
"examples": [
|
||||
"nvim"
|
||||
],
|
||||
"required": [
|
||||
"category",
|
||||
"name",
|
||||
"platform"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"$id": "#ports/port/name",
|
||||
"title": "Name",
|
||||
"description": "The Name of the software the port is for.",
|
||||
"type": "string",
|
||||
"examples": [
|
||||
"Neovim"
|
||||
]
|
||||
},
|
||||
"category": {
|
||||
"$id": "#ports/port/category",
|
||||
"title": "Category",
|
||||
"description": "The category that fits the port the most",
|
||||
"$ref": "#/$defs/category"
|
||||
},
|
||||
"platform": {
|
||||
"$id": "#ports/port/platform",
|
||||
"title": "Platform",
|
||||
"description": "The platforms the port supports. Either an array of supported operating systems, \"agnostic\" (indicating support for all platforms), or \"userstyle\".",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$id": "#ports/port/platform/os",
|
||||
"title": "Operating Systems",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"browser",
|
||||
"browser_extension",
|
||||
"cli",
|
||||
"code_editor",
|
||||
"development",
|
||||
"game",
|
||||
"leisure",
|
||||
"library",
|
||||
"messaging",
|
||||
"note_taking",
|
||||
"productivity",
|
||||
"search_engine",
|
||||
"social",
|
||||
"system",
|
||||
"terminal"
|
||||
"android",
|
||||
"ios",
|
||||
"linux",
|
||||
"macos",
|
||||
"windows"
|
||||
],
|
||||
"examples": ["editor"]
|
||||
},
|
||||
"platform": {
|
||||
"$id": "#ports/port/platform",
|
||||
"title": "Platform",
|
||||
"description": "The platforms the port supports. Either an array of supported operating systems, \"agnostic\" (indicating support for all platforms), or \"userstyle\".",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$id": "#ports/port/platform/os",
|
||||
"title": "Operating Systems",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"android",
|
||||
"ios",
|
||||
"linux",
|
||||
"macos",
|
||||
"windows"
|
||||
],
|
||||
"examples": [
|
||||
["linux", "macos", "windows"],
|
||||
["android", "ios"]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": ["agnostic", "userstyle"]
|
||||
}
|
||||
"examples": [
|
||||
[
|
||||
"linux",
|
||||
"macos",
|
||||
"windows"
|
||||
],
|
||||
[
|
||||
"android",
|
||||
"ios"
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"$id": "#ports/port/color",
|
||||
"title": "Color",
|
||||
"description": "The fill color for the icon on the website",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"rosewater",
|
||||
"flamingo",
|
||||
"pink",
|
||||
"mauve",
|
||||
"red",
|
||||
"maroon",
|
||||
"peach",
|
||||
"yellow",
|
||||
"green",
|
||||
"teal",
|
||||
"sky",
|
||||
"sapphire",
|
||||
"blue",
|
||||
"lavender",
|
||||
"text"
|
||||
],
|
||||
"examples": ["pink"]
|
||||
},
|
||||
"icon": {
|
||||
"$id": "#ports/port/icon",
|
||||
"title": "Icon",
|
||||
"description": "The icon to use on the website. This should be the same name as the SVG file on https://simpleicons.org/. If a `.svg` suffix is present, it's taken from the local website repository resources.",
|
||||
"type": "string",
|
||||
"examples": ["neovim", "neovim.svg"]
|
||||
},
|
||||
"userstyle": {
|
||||
"$id": "#ports/port/userstyle",
|
||||
"title": "Userstyle",
|
||||
"description": "Whether the port is a userstyle",
|
||||
"type": "boolean",
|
||||
"examples": [true]
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"agnostic",
|
||||
"userstyle"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"color": {
|
||||
"$id": "#ports/port/color",
|
||||
"title": "Color",
|
||||
"description": "The fill color for the icon on the website.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"rosewater",
|
||||
"flamingo",
|
||||
"pink",
|
||||
"mauve",
|
||||
"red",
|
||||
"maroon",
|
||||
"peach",
|
||||
"yellow",
|
||||
"green",
|
||||
"teal",
|
||||
"sky",
|
||||
"sapphire",
|
||||
"blue",
|
||||
"lavender",
|
||||
"text"
|
||||
],
|
||||
"examples": [
|
||||
"pink"
|
||||
]
|
||||
},
|
||||
"icon": {
|
||||
"$id": "#ports/port/icon",
|
||||
"title": "Icon",
|
||||
"description": "The icon to use on the website. This should be the same name as the SVG file on https://simpleicons.org/. If a `.svg` suffix is present, it's taken from the local website repository resources.",
|
||||
"type": "string",
|
||||
"examples": [
|
||||
"neovim",
|
||||
"neovim.svg"
|
||||
]
|
||||
},
|
||||
"userstyle": {
|
||||
"$id": "#ports/port/userstyle",
|
||||
"title": "Userstyle",
|
||||
"description": "Whether the port is a userstyle",
|
||||
"type": "boolean",
|
||||
"examples": [
|
||||
true,
|
||||
false
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"showcases": {
|
||||
"$id": "#showcases",
|
||||
"title": "Showcases",
|
||||
"type": "array",
|
||||
"description": "Each showcase listed in the README",
|
||||
"items": {
|
||||
"$id": "#showcase/item",
|
||||
"title": "Showcase item",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"title",
|
||||
"link",
|
||||
"description"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"title": {
|
||||
"$id": "#showcase/showcase/title",
|
||||
"title": "title",
|
||||
"type": "string"
|
||||
},
|
||||
"link": {
|
||||
"$id": "#showcase/showcase/link",
|
||||
"title": "Link",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"$id": "#showcase/showcase/description",
|
||||
"title": "Link",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"$defs": {
|
||||
"category": {
|
||||
"$id": "#category",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"browser",
|
||||
"browser_extension",
|
||||
"cli",
|
||||
"code_editor",
|
||||
"development",
|
||||
"game",
|
||||
"leisure",
|
||||
"library",
|
||||
"messaging",
|
||||
"note_taking",
|
||||
"productivity",
|
||||
"search_engine",
|
||||
"social",
|
||||
"system",
|
||||
"terminal"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue