The Trans Directory
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore(deps): replace `chalk` and `rimraf` with builtin functions (#1879)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

authored by

fl0werpowers
Copilot
and committed by
GitHub
951d1dec 51b43a21

+94 -475
-407
package-lock.json
··· 17 17 "@webgpu/types": "^0.1.60", 18 18 "ansi-truncate": "^1.2.0", 19 19 "async-mutex": "^0.5.0", 20 - "chalk": "^5.4.1", 21 20 "chokidar": "^4.0.3", 22 21 "cli-spinner": "^0.2.10", 23 22 "d3": "^7.9.0", ··· 59 58 "remark-rehype": "^11.1.2", 60 59 "remark-smartypants": "^3.0.2", 61 60 "rfdc": "^1.4.1", 62 - "rimraf": "^6.0.1", 63 61 "satori": "^0.12.2", 64 62 "serve-handler": "^6.1.6", 65 63 "sharp": "^0.34.1", ··· 1011 1009 "url": "https://opencollective.com/libvips" 1012 1010 } 1013 1011 }, 1014 - "node_modules/@isaacs/cliui": { 1015 - "version": "8.0.2", 1016 - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", 1017 - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", 1018 - "dependencies": { 1019 - "string-width": "^5.1.2", 1020 - "string-width-cjs": "npm:string-width@^4.2.0", 1021 - "strip-ansi": "^7.0.1", 1022 - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", 1023 - "wrap-ansi": "^8.1.0", 1024 - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" 1025 - }, 1026 - "engines": { 1027 - "node": ">=12" 1028 - } 1029 - }, 1030 1012 "node_modules/@myriaddreamin/rehype-typst": { 1031 1013 "version": "0.6.0", 1032 1014 "resolved": "https://registry.npmjs.org/@myriaddreamin/rehype-typst/-/rehype-typst-0.6.0.tgz", ··· 1516 1498 "integrity": "sha512-nezytU2pw587fQstUu1AsJZDVEynjskwOL+kibwcdxsMBFqPsFFNA7xl0ii/gXuDi6M0xj3mfRJj8pBSc2jCfA==", 1517 1499 "license": "MIT" 1518 1500 }, 1519 - "node_modules/@pkgjs/parseargs": { 1520 - "version": "0.11.0", 1521 - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", 1522 - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", 1523 - "optional": true, 1524 - "engines": { 1525 - "node": ">=14" 1526 - } 1527 - }, 1528 1501 "node_modules/@shikijs/core": { 1529 1502 "version": "1.26.2", 1530 1503 "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.26.2.tgz", ··· 2043 2016 "node": ">= 14" 2044 2017 } 2045 2018 }, 2046 - "node_modules/ansi-regex": { 2047 - "version": "6.0.1", 2048 - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", 2049 - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", 2050 - "engines": { 2051 - "node": ">=12" 2052 - }, 2053 - "funding": { 2054 - "url": "https://github.com/chalk/ansi-regex?sponsor=1" 2055 - } 2056 - }, 2057 2019 "node_modules/ansi-styles": { 2058 2020 "version": "4.3.0", 2059 2021 "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", ··· 2210 2172 "funding": { 2211 2173 "type": "github", 2212 2174 "url": "https://github.com/sponsors/wooorm" 2213 - } 2214 - }, 2215 - "node_modules/chalk": { 2216 - "version": "5.4.1", 2217 - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", 2218 - "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", 2219 - "engines": { 2220 - "node": "^12.17.0 || ^14.13 || >=16.0.0" 2221 - }, 2222 - "funding": { 2223 - "url": "https://github.com/chalk/chalk?sponsor=1" 2224 2175 } 2225 2176 }, 2226 2177 "node_modules/character-entities": { ··· 2435 2386 "node-fetch": "^2.6.12" 2436 2387 } 2437 2388 }, 2438 - "node_modules/cross-spawn": { 2439 - "version": "7.0.6", 2440 - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", 2441 - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", 2442 - "license": "MIT", 2443 - "dependencies": { 2444 - "path-key": "^3.1.0", 2445 - "shebang-command": "^2.0.0", 2446 - "which": "^2.0.1" 2447 - }, 2448 - "engines": { 2449 - "node": ">= 8" 2450 - } 2451 - }, 2452 2389 "node_modules/css-background-parser": { 2453 2390 "version": "0.1.0", 2454 2391 "resolved": "https://registry.npmjs.org/css-background-parser/-/css-background-parser-0.1.0.tgz", ··· 2931 2868 "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==", 2932 2869 "license": "ISC" 2933 2870 }, 2934 - "node_modules/eastasianwidth": { 2935 - "version": "0.2.0", 2936 - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", 2937 - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" 2938 - }, 2939 - "node_modules/emoji-regex": { 2940 - "version": "9.2.2", 2941 - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", 2942 - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" 2943 - }, 2944 2871 "node_modules/emoji-regex-xs": { 2945 2872 "version": "1.0.0", 2946 2873 "resolved": "https://registry.npmjs.org/emoji-regex-xs/-/emoji-regex-xs-1.0.0.tgz", ··· 3199 3126 "resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.7.43.tgz", 3200 3127 "integrity": "sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg==" 3201 3128 }, 3202 - "node_modules/foreground-child": { 3203 - "version": "3.2.1", 3204 - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", 3205 - "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", 3206 - "dependencies": { 3207 - "cross-spawn": "^7.0.0", 3208 - "signal-exit": "^4.0.1" 3209 - }, 3210 - "engines": { 3211 - "node": ">=14" 3212 - }, 3213 - "funding": { 3214 - "url": "https://github.com/sponsors/isaacs" 3215 - } 3216 - }, 3217 3129 "node_modules/format": { 3218 3130 "version": "0.2.2", 3219 3131 "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", ··· 3278 3190 "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", 3279 3191 "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==" 3280 3192 }, 3281 - "node_modules/glob": { 3282 - "version": "11.0.0", 3283 - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", 3284 - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", 3285 - "dependencies": { 3286 - "foreground-child": "^3.1.0", 3287 - "jackspeak": "^4.0.1", 3288 - "minimatch": "^10.0.0", 3289 - "minipass": "^7.1.2", 3290 - "package-json-from-dist": "^1.0.0", 3291 - "path-scurry": "^2.0.0" 3292 - }, 3293 - "bin": { 3294 - "glob": "dist/esm/bin.mjs" 3295 - }, 3296 - "engines": { 3297 - "node": "20 || >=22" 3298 - }, 3299 - "funding": { 3300 - "url": "https://github.com/sponsors/isaacs" 3301 - } 3302 - }, 3303 3193 "node_modules/glob-parent": { 3304 3194 "version": "5.1.2", 3305 3195 "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", ··· 3950 3840 "url": "https://github.com/sponsors/sindresorhus" 3951 3841 } 3952 3842 }, 3953 - "node_modules/isexe": { 3954 - "version": "2.0.0", 3955 - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 3956 - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" 3957 - }, 3958 3843 "node_modules/ismobilejs": { 3959 3844 "version": "1.1.1", 3960 3845 "resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-1.1.1.tgz", 3961 3846 "integrity": "sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw==", 3962 3847 "license": "MIT" 3963 3848 }, 3964 - "node_modules/jackspeak": { 3965 - "version": "4.0.1", 3966 - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", 3967 - "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", 3968 - "dependencies": { 3969 - "@isaacs/cliui": "^8.0.2" 3970 - }, 3971 - "engines": { 3972 - "node": "20 || >=22" 3973 - }, 3974 - "funding": { 3975 - "url": "https://github.com/sponsors/isaacs" 3976 - }, 3977 - "optionalDependencies": { 3978 - "@pkgjs/parseargs": "^0.11.0" 3979 - } 3980 - }, 3981 3849 "node_modules/js-binary-schema-parser": { 3982 3850 "version": "2.0.3", 3983 3851 "resolved": "https://registry.npmjs.org/js-binary-schema-parser/-/js-binary-schema-parser-2.0.3.tgz", ··· 4281 4149 "funding": { 4282 4150 "type": "github", 4283 4151 "url": "https://github.com/sponsors/wooorm" 4284 - } 4285 - }, 4286 - "node_modules/lru-cache": { 4287 - "version": "11.0.0", 4288 - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", 4289 - "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", 4290 - "engines": { 4291 - "node": "20 || >=22" 4292 4152 } 4293 4153 }, 4294 4154 "node_modules/markdown-table": { ··· 5300 5160 "url": "https://github.com/sponsors/isaacs" 5301 5161 } 5302 5162 }, 5303 - "node_modules/minipass": { 5304 - "version": "7.1.2", 5305 - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", 5306 - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", 5307 - "engines": { 5308 - "node": ">=16 || 14 >=14.17" 5309 - } 5310 - }, 5311 5163 "node_modules/mj-context-menu": { 5312 5164 "version": "0.6.1", 5313 5165 "resolved": "https://registry.npmjs.org/mj-context-menu/-/mj-context-menu-0.6.1.tgz", ··· 5383 5235 "regex": "^5.1.1", 5384 5236 "regex-recursion": "^5.1.1" 5385 5237 } 5386 - }, 5387 - "node_modules/package-json-from-dist": { 5388 - "version": "1.0.0", 5389 - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", 5390 - "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==" 5391 5238 }, 5392 5239 "node_modules/pako": { 5393 5240 "version": "0.2.9", ··· 5473 5320 "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", 5474 5321 "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==" 5475 5322 }, 5476 - "node_modules/path-key": { 5477 - "version": "3.1.1", 5478 - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 5479 - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 5480 - "engines": { 5481 - "node": ">=8" 5482 - } 5483 - }, 5484 5323 "node_modules/path-parse": { 5485 5324 "version": "1.0.7", 5486 5325 "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 5487 5326 "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" 5488 - }, 5489 - "node_modules/path-scurry": { 5490 - "version": "2.0.0", 5491 - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", 5492 - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", 5493 - "dependencies": { 5494 - "lru-cache": "^11.0.0", 5495 - "minipass": "^7.1.2" 5496 - }, 5497 - "engines": { 5498 - "node": "20 || >=22" 5499 - }, 5500 - "funding": { 5501 - "url": "https://github.com/sponsors/isaacs" 5502 - } 5503 5327 }, 5504 5328 "node_modules/path-to-regexp": { 5505 5329 "version": "3.3.0", ··· 6090 5914 "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", 6091 5915 "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==" 6092 5916 }, 6093 - "node_modules/rimraf": { 6094 - "version": "6.0.1", 6095 - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", 6096 - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", 6097 - "dependencies": { 6098 - "glob": "^11.0.0", 6099 - "package-json-from-dist": "^1.0.0" 6100 - }, 6101 - "bin": { 6102 - "rimraf": "dist/esm/bin.mjs" 6103 - }, 6104 - "engines": { 6105 - "node": "20 || >=22" 6106 - }, 6107 - "funding": { 6108 - "url": "https://github.com/sponsors/isaacs" 6109 - } 6110 - }, 6111 5917 "node_modules/robust-predicates": { 6112 5918 "version": "3.0.2", 6113 5919 "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", ··· 6665 6471 "@img/sharp-win32-x64": "0.34.1" 6666 6472 } 6667 6473 }, 6668 - "node_modules/shebang-command": { 6669 - "version": "2.0.0", 6670 - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 6671 - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 6672 - "dependencies": { 6673 - "shebang-regex": "^3.0.0" 6674 - }, 6675 - "engines": { 6676 - "node": ">=8" 6677 - } 6678 - }, 6679 - "node_modules/shebang-regex": { 6680 - "version": "3.0.0", 6681 - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 6682 - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 6683 - "engines": { 6684 - "node": ">=8" 6685 - } 6686 - }, 6687 6474 "node_modules/shiki": { 6688 6475 "version": "1.26.2", 6689 6476 "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.26.2.tgz", ··· 6697 6484 "@shikijs/types": "1.26.2", 6698 6485 "@shikijs/vscode-textmate": "^10.0.1", 6699 6486 "@types/hast": "^3.0.4" 6700 - } 6701 - }, 6702 - "node_modules/signal-exit": { 6703 - "version": "4.1.0", 6704 - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", 6705 - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", 6706 - "engines": { 6707 - "node": ">=14" 6708 - }, 6709 - "funding": { 6710 - "url": "https://github.com/sponsors/isaacs" 6711 6487 } 6712 6488 }, 6713 6489 "node_modules/simple-swizzle": { ··· 6796 6572 "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 6797 6573 "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" 6798 6574 }, 6799 - "node_modules/string-width": { 6800 - "version": "5.1.2", 6801 - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", 6802 - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", 6803 - "dependencies": { 6804 - "eastasianwidth": "^0.2.0", 6805 - "emoji-regex": "^9.2.2", 6806 - "strip-ansi": "^7.0.1" 6807 - }, 6808 - "engines": { 6809 - "node": ">=12" 6810 - }, 6811 - "funding": { 6812 - "url": "https://github.com/sponsors/sindresorhus" 6813 - } 6814 - }, 6815 - "node_modules/string-width-cjs": { 6816 - "name": "string-width", 6817 - "version": "4.2.3", 6818 - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 6819 - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 6820 - "dependencies": { 6821 - "emoji-regex": "^8.0.0", 6822 - "is-fullwidth-code-point": "^3.0.0", 6823 - "strip-ansi": "^6.0.1" 6824 - }, 6825 - "engines": { 6826 - "node": ">=8" 6827 - } 6828 - }, 6829 - "node_modules/string-width-cjs/node_modules/ansi-regex": { 6830 - "version": "5.0.1", 6831 - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 6832 - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 6833 - "engines": { 6834 - "node": ">=8" 6835 - } 6836 - }, 6837 - "node_modules/string-width-cjs/node_modules/emoji-regex": { 6838 - "version": "8.0.0", 6839 - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 6840 - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" 6841 - }, 6842 - "node_modules/string-width-cjs/node_modules/strip-ansi": { 6843 - "version": "6.0.1", 6844 - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 6845 - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 6846 - "dependencies": { 6847 - "ansi-regex": "^5.0.1" 6848 - }, 6849 - "engines": { 6850 - "node": ">=8" 6851 - } 6852 - }, 6853 6575 "node_modules/string.prototype.codepointat": { 6854 6576 "version": "0.2.1", 6855 6577 "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz", ··· 6867 6589 "funding": { 6868 6590 "type": "github", 6869 6591 "url": "https://github.com/sponsors/wooorm" 6870 - } 6871 - }, 6872 - "node_modules/strip-ansi": { 6873 - "version": "7.1.0", 6874 - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", 6875 - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", 6876 - "dependencies": { 6877 - "ansi-regex": "^6.0.1" 6878 - }, 6879 - "engines": { 6880 - "node": ">=12" 6881 - }, 6882 - "funding": { 6883 - "url": "https://github.com/chalk/strip-ansi?sponsor=1" 6884 - } 6885 - }, 6886 - "node_modules/strip-ansi-cjs": { 6887 - "name": "strip-ansi", 6888 - "version": "6.0.1", 6889 - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 6890 - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 6891 - "dependencies": { 6892 - "ansi-regex": "^5.0.1" 6893 - }, 6894 - "engines": { 6895 - "node": ">=8" 6896 - } 6897 - }, 6898 - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { 6899 - "version": "5.0.1", 6900 - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 6901 - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 6902 - "engines": { 6903 - "node": ">=8" 6904 6592 } 6905 6593 }, 6906 6594 "node_modules/strip-bom-string": { ··· 7333 7021 "url": "https://github.com/sponsors/wooorm" 7334 7022 } 7335 7023 }, 7336 - "node_modules/which": { 7337 - "version": "2.0.2", 7338 - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 7339 - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 7340 - "dependencies": { 7341 - "isexe": "^2.0.0" 7342 - }, 7343 - "bin": { 7344 - "node-which": "bin/node-which" 7345 - }, 7346 - "engines": { 7347 - "node": ">= 8" 7348 - } 7349 - }, 7350 7024 "node_modules/wicked-good-xpath": { 7351 7025 "version": "1.3.0", 7352 7026 "resolved": "https://registry.npmjs.org/wicked-good-xpath/-/wicked-good-xpath-1.3.0.tgz", ··· 7356 7030 "version": "9.2.0", 7357 7031 "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.2.0.tgz", 7358 7032 "integrity": "sha512-PKZqBOCo6CYkVOwAxWxQaSF2Fvb5Iv2fCeTP7buyWI2GiynWr46NcXSgK/idoV6e60dgCBfgYc+Un3HMvmqP8w==" 7359 - }, 7360 - "node_modules/wrap-ansi": { 7361 - "version": "8.1.0", 7362 - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", 7363 - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", 7364 - "dependencies": { 7365 - "ansi-styles": "^6.1.0", 7366 - "string-width": "^5.0.1", 7367 - "strip-ansi": "^7.0.1" 7368 - }, 7369 - "engines": { 7370 - "node": ">=12" 7371 - }, 7372 - "funding": { 7373 - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 7374 - } 7375 - }, 7376 - "node_modules/wrap-ansi-cjs": { 7377 - "name": "wrap-ansi", 7378 - "version": "7.0.0", 7379 - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 7380 - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 7381 - "dependencies": { 7382 - "ansi-styles": "^4.0.0", 7383 - "string-width": "^4.1.0", 7384 - "strip-ansi": "^6.0.0" 7385 - }, 7386 - "engines": { 7387 - "node": ">=10" 7388 - }, 7389 - "funding": { 7390 - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" 7391 - } 7392 - }, 7393 - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { 7394 - "version": "5.0.1", 7395 - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", 7396 - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 7397 - "engines": { 7398 - "node": ">=8" 7399 - } 7400 - }, 7401 - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { 7402 - "version": "8.0.0", 7403 - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 7404 - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" 7405 - }, 7406 - "node_modules/wrap-ansi-cjs/node_modules/string-width": { 7407 - "version": "4.2.3", 7408 - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", 7409 - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", 7410 - "dependencies": { 7411 - "emoji-regex": "^8.0.0", 7412 - "is-fullwidth-code-point": "^3.0.0", 7413 - "strip-ansi": "^6.0.1" 7414 - }, 7415 - "engines": { 7416 - "node": ">=8" 7417 - } 7418 - }, 7419 - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { 7420 - "version": "6.0.1", 7421 - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", 7422 - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 7423 - "dependencies": { 7424 - "ansi-regex": "^5.0.1" 7425 - }, 7426 - "engines": { 7427 - "node": ">=8" 7428 - } 7429 - }, 7430 - "node_modules/wrap-ansi/node_modules/ansi-styles": { 7431 - "version": "6.2.1", 7432 - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", 7433 - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", 7434 - "engines": { 7435 - "node": ">=12" 7436 - }, 7437 - "funding": { 7438 - "url": "https://github.com/chalk/ansi-styles?sponsor=1" 7439 - } 7440 7033 }, 7441 7034 "node_modules/ws": { 7442 7035 "version": "8.18.2",
-2
package.json
··· 43 43 "@webgpu/types": "^0.1.60", 44 44 "ansi-truncate": "^1.2.0", 45 45 "async-mutex": "^0.5.0", 46 - "chalk": "^5.4.1", 47 46 "chokidar": "^4.0.3", 48 47 "cli-spinner": "^0.2.10", 49 48 "d3": "^7.9.0", ··· 85 84 "remark-rehype": "^11.1.2", 86 85 "remark-smartypants": "^3.0.2", 87 86 "rfdc": "^1.4.1", 88 - "rimraf": "^6.0.1", 89 87 "satori": "^0.12.2", 90 88 "serve-handler": "^6.1.6", 91 89 "sharp": "^0.34.1",
+8 -6
quartz/build.ts
··· 2 2 sourceMapSupport.install(options) 3 3 import path from "path" 4 4 import { PerfTimer } from "./util/perf" 5 - import { rimraf } from "rimraf" 5 + import { rm } from "fs/promises" 6 6 import { GlobbyFilterFunction, isGitIgnored } from "globby" 7 - import chalk from "chalk" 7 + import { styleText } from "util" 8 8 import { parseMarkdown } from "./processors/parse" 9 9 import { filterContent } from "./processors/filter" 10 10 import { emitContent } from "./processors/emit" ··· 67 67 68 68 const release = await mut.acquire() 69 69 perf.addEvent("clean") 70 - await rimraf(path.join(output, "*"), { glob: true }) 70 + await rm(output, { recursive: true, force: true }) 71 71 console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`) 72 72 73 73 perf.addEvent("glob") ··· 85 85 const filteredContent = filterContent(ctx, parsedFiles) 86 86 87 87 await emitContent(ctx, filteredContent) 88 - console.log(chalk.green(`Done processing ${markdownPaths.length} files in ${perf.timeSince()}`)) 88 + console.log( 89 + styleText("green", `Done processing ${markdownPaths.length} files in ${perf.timeSince()}`), 90 + ) 89 91 release() 90 92 91 93 if (argv.watch) { ··· 186 188 187 189 const perf = new PerfTimer() 188 190 perf.addEvent("rebuild") 189 - console.log(chalk.yellow("Detected change, rebuilding...")) 191 + console.log(styleText("yellow", "Detected change, rebuilding...")) 190 192 191 193 // update changesSinceLastBuild 192 194 for (const change of changes) { ··· 281 283 } 282 284 283 285 console.log(`Emitted ${emittedFiles} files to \`${argv.output}\` in ${perf.timeSince("rebuild")}`) 284 - console.log(chalk.green(`Done rebuilding in ${perf.timeSince()}`)) 286 + console.log(styleText("green", `Done rebuilding in ${perf.timeSince()}`)) 285 287 changes.splice(0, numChangesInBuild) 286 288 clientRefresh() 287 289 release()
+50 -33
quartz/cli/handlers.js
··· 1 1 import { promises } from "fs" 2 2 import path from "path" 3 3 import esbuild from "esbuild" 4 - import chalk from "chalk" 4 + import { styleText } from "util" 5 5 import { sassPlugin } from "esbuild-sass-plugin" 6 6 import fs from "fs" 7 7 import { intro, outro, select, text } from "@clack/prompts" 8 - import { rimraf } from "rimraf" 8 + import { rm } from "fs/promises" 9 9 import chokidar from "chokidar" 10 10 import prettyBytes from "pretty-bytes" 11 11 import { execSync, spawnSync } from "child_process" ··· 48 48 */ 49 49 export async function handleCreate(argv) { 50 50 console.log() 51 - intro(chalk.bgGreen.black(` Quartz v${version} `)) 51 + intro(styleText(["bgGreen", "black"], ` Quartz v${version} `)) 52 52 const contentFolder = resolveContentPath(argv.directory) 53 53 let setupStrategy = argv.strategy?.toLowerCase() 54 54 let linkResolutionStrategy = argv.links?.toLowerCase() ··· 61 61 // Error handling 62 62 if (!sourceDirectory) { 63 63 outro( 64 - chalk.red( 65 - `Setup strategies (arg '${chalk.yellow( 64 + styleText( 65 + "red", 66 + `Setup strategies (arg '${styleText( 67 + "yellow", 66 68 `-${CreateArgv.strategy.alias[0]}`, 67 - )}') other than '${chalk.yellow( 69 + )}') other than '${styleText( 70 + "yellow", 68 71 "new", 69 - )}' require content folder argument ('${chalk.yellow( 72 + )}' require content folder argument ('${styleText( 73 + "yellow", 70 74 `-${CreateArgv.source.alias[0]}`, 71 75 )}') to be set`, 72 76 ), ··· 75 79 } else { 76 80 if (!fs.existsSync(sourceDirectory)) { 77 81 outro( 78 - chalk.red( 79 - `Input directory to copy/symlink 'content' from not found ('${chalk.yellow( 82 + styleText( 83 + "red", 84 + `Input directory to copy/symlink 'content' from not found ('${styleText( 85 + "yellow", 80 86 sourceDirectory, 81 - )}', invalid argument "${chalk.yellow(`-${CreateArgv.source.alias[0]}`)})`, 87 + )}', invalid argument "${styleText("yellow", `-${CreateArgv.source.alias[0]}`)})`, 82 88 ), 83 89 ) 84 90 process.exit(1) 85 91 } else if (!fs.lstatSync(sourceDirectory).isDirectory()) { 86 92 outro( 87 - chalk.red( 88 - `Source directory to copy/symlink 'content' from is not a directory (found file at '${chalk.yellow( 93 + styleText( 94 + "red", 95 + `Source directory to copy/symlink 'content' from is not a directory (found file at '${styleText( 96 + "yellow", 89 97 sourceDirectory, 90 - )}', invalid argument ${chalk.yellow(`-${CreateArgv.source.alias[0]}`)}")`, 98 + )}', invalid argument ${styleText("yellow", `-${CreateArgv.source.alias[0]}`)}")`, 91 99 ), 92 100 ) 93 101 process.exit(1) ··· 119 127 if (contentStat.isSymbolicLink()) { 120 128 await fs.promises.unlink(contentFolder) 121 129 } else { 122 - await rimraf(contentFolder) 130 + await rm(contentFolder, { recursive: true, force: true }) 123 131 } 124 132 } 125 133 ··· 229 237 argv.watch = true 230 238 } 231 239 232 - console.log(chalk.bgGreen.black(`\n Quartz v${version} \n`)) 240 + console.log(`\n${styleText(["bgGreen", "black"], ` Quartz v${version} `)} \n`) 233 241 const ctx = await esbuild.context({ 234 242 entryPoints: [fp], 235 243 outfile: cacheFile, ··· 304 312 } 305 313 306 314 if (cleanupBuild) { 307 - console.log(chalk.yellow("Detected a source code change, doing a hard rebuild...")) 315 + console.log(styleText("yellow", "Detected a source code change, doing a hard rebuild...")) 308 316 await cleanupBuild() 309 317 } 310 318 311 319 const result = await ctx.rebuild().catch((err) => { 312 - console.error(`${chalk.red("Couldn't parse Quartz configuration:")} ${fp}`) 313 - console.log(`Reason: ${chalk.grey(err)}`) 320 + console.error(`${styleText("red", "Couldn't parse Quartz configuration:")} ${fp}`) 321 + console.log(`Reason: ${styleText("grey", err)}`) 314 322 process.exit(1) 315 323 }) 316 324 release() ··· 348 356 const server = http.createServer(async (req, res) => { 349 357 if (argv.baseDir && !req.url?.startsWith(argv.baseDir)) { 350 358 console.log( 351 - chalk.red( 359 + styleText( 360 + "red", 352 361 `[404] ${req.url} (warning: link outside of site, this is likely a Quartz bug)`, 353 362 ), 354 363 ) ··· 383 392 }) 384 393 const status = res.statusCode 385 394 const statusString = 386 - status >= 200 && status < 300 ? chalk.green(`[${status}]`) : chalk.red(`[${status}]`) 387 - console.log(statusString + chalk.grey(` ${argv.baseDir}${req.url}`)) 395 + status >= 200 && status < 300 396 + ? styleText("green", `[${status}]`) 397 + : styleText("red", `[${status}]`) 398 + console.log(statusString + styleText("grey", ` ${argv.baseDir}${req.url}`)) 388 399 release() 389 400 } 390 401 ··· 393 404 res.writeHead(302, { 394 405 Location: newFp, 395 406 }) 396 - console.log(chalk.yellow("[302]") + chalk.grey(` ${argv.baseDir}${req.url} -> ${newFp}`)) 407 + console.log( 408 + styleText("yellow", "[302]") + 409 + styleText("grey", ` ${argv.baseDir}${req.url} -> ${newFp}`), 410 + ) 397 411 res.end() 398 412 } 399 413 ··· 443 457 const wss = new WebSocketServer({ port: argv.wsPort }) 444 458 wss.on("connection", (ws) => connections.push(ws)) 445 459 console.log( 446 - chalk.cyan( 460 + styleText( 461 + "cyan", 447 462 `Started a Quartz server listening at http://localhost:${argv.port}${argv.baseDir}`, 448 463 ), 449 464 ) ··· 467 482 .on("change", () => build(clientRefresh)) 468 483 .on("unlink", () => build(clientRefresh)) 469 484 470 - console.log(chalk.grey("hint: exit with ctrl+c")) 485 + console.log(styleText("grey", "hint: exit with ctrl+c")) 471 486 } 472 487 } 473 488 ··· 477 492 */ 478 493 export async function handleUpdate(argv) { 479 494 const contentFolder = resolveContentPath(argv.directory) 480 - console.log(chalk.bgGreen.black(`\n Quartz v${version} \n`)) 495 + console.log(`\n${styleText(["bgGreen", "black"], ` Quartz v${version} `)} \n`) 481 496 console.log("Backing up your content") 482 497 execSync( 483 498 `git remote show upstream || git remote add upstream https://github.com/jackyzha0/quartz.git`, ··· 490 505 try { 491 506 gitPull(UPSTREAM_NAME, QUARTZ_SOURCE_BRANCH) 492 507 } catch { 493 - console.log(chalk.red("An error occurred above while pulling updates.")) 508 + console.log(styleText("red", "An error occurred above while pulling updates.")) 494 509 await popContentFolder(contentFolder) 495 510 return 496 511 } ··· 517 532 518 533 const res = spawnSync("npm", ["i"], opts) 519 534 if (res.status === 0) { 520 - console.log(chalk.green("Done!")) 535 + console.log(styleText("green", "Done!")) 521 536 } else { 522 - console.log(chalk.red("An error occurred above while installing dependencies.")) 537 + console.log(styleText("red", "An error occurred above while installing dependencies.")) 523 538 } 524 539 } 525 540 ··· 538 553 */ 539 554 export async function handleSync(argv) { 540 555 const contentFolder = resolveContentPath(argv.directory) 541 - console.log(chalk.bgGreen.black(`\n Quartz v${version} \n`)) 556 + console.log(`\n${styleText(["bgGreen", "black"], ` Quartz v${version} `)}\n`) 542 557 console.log("Backing up your content") 543 558 544 559 if (argv.commit) { 545 560 const contentStat = await fs.promises.lstat(contentFolder) 546 561 if (contentStat.isSymbolicLink()) { 547 562 const linkTarg = await fs.promises.readlink(contentFolder) 548 - console.log(chalk.yellow("Detected symlink, trying to dereference before committing")) 563 + console.log(styleText("yellow", "Detected symlink, trying to dereference before committing")) 549 564 550 565 // stash symlink file 551 566 await stashContentFolder(contentFolder) ··· 580 595 try { 581 596 gitPull(ORIGIN_NAME, QUARTZ_SOURCE_BRANCH) 582 597 } catch { 583 - console.log(chalk.red("An error occurred above while pulling updates.")) 598 + console.log(styleText("red", "An error occurred above while pulling updates.")) 584 599 await popContentFolder(contentFolder) 585 600 return 586 601 } ··· 594 609 stdio: "inherit", 595 610 }) 596 611 if (res.status !== 0) { 597 - console.log(chalk.red(`An error occurred above while pushing to remote ${ORIGIN_NAME}.`)) 612 + console.log( 613 + styleText("red", `An error occurred above while pushing to remote ${ORIGIN_NAME}.`), 614 + ) 598 615 return 599 616 } 600 617 } 601 618 602 - console.log(chalk.green("Done!")) 619 + console.log(styleText("green", "Done!")) 603 620 }
+4 -4
quartz/cli/helpers.js
··· 1 1 import { isCancel, outro } from "@clack/prompts" 2 - import chalk from "chalk" 2 + import { styleText } from "util" 3 3 import { contentCacheFolder } from "./constants.js" 4 4 import { spawnSync } from "child_process" 5 5 import fs from "fs" ··· 14 14 15 15 export function exitIfCancel(val) { 16 16 if (isCancel(val)) { 17 - outro(chalk.red("Exiting")) 17 + outro(styleText("red", "Exiting")) 18 18 process.exit(0) 19 19 } else { 20 20 return val ··· 36 36 const flags = ["--no-rebase", "--autostash", "-s", "recursive", "-X", "ours", "--no-edit"] 37 37 const out = spawnSync("git", ["pull", ...flags, origin, branch], { stdio: "inherit" }) 38 38 if (out.stderr) { 39 - throw new Error(chalk.red(`Error while pulling updates: ${out.stderr}`)) 39 + throw new Error(styleText("red", `Error while pulling updates: ${out.stderr}`)) 40 40 } else if (out.status !== 0) { 41 - throw new Error(chalk.red("Error while pulling updates")) 41 + throw new Error(styleText("red", "Error while pulling updates")) 42 42 } 43 43 } 44 44
+4 -2
quartz/plugins/emitters/cname.ts
··· 1 1 import { FilePath, joinSegments } from "../../util/path" 2 2 import { QuartzEmitterPlugin } from "../types" 3 3 import fs from "fs" 4 - import chalk from "chalk" 4 + import { styleText } from "util" 5 5 6 6 export function extractDomainFromBaseUrl(baseUrl: string) { 7 7 const url = new URL(`https://${baseUrl}`) ··· 12 12 name: "CNAME", 13 13 async emit({ argv, cfg }) { 14 14 if (!cfg.configuration.baseUrl) { 15 - console.warn(chalk.yellow("CNAME emitter requires `baseUrl` to be set in your configuration")) 15 + console.warn( 16 + styleText("yellow", "CNAME emitter requires `baseUrl` to be set in your configuration"), 17 + ) 16 18 return [] 17 19 } 18 20 const path = joinSegments(argv.output, "CNAME")
+3 -2
quartz/plugins/emitters/contentPage.tsx
··· 8 8 import { pathToRoot } from "../../util/path" 9 9 import { defaultContentPageLayout, sharedPageComponents } from "../../../quartz.layout" 10 10 import { Content } from "../../components" 11 - import chalk from "chalk" 11 + import { styleText } from "util" 12 12 import { write } from "./helpers" 13 13 import { BuildCtx } from "../../util/ctx" 14 14 import { Node } from "unist" ··· 90 90 91 91 if (!containsIndex) { 92 92 console.log( 93 - chalk.yellow( 93 + styleText( 94 + "yellow", 94 95 `\nWarning: you seem to be missing an \`index.md\` home page file at the root of your \`${ctx.argv.directory}\` folder (\`${path.join(ctx.argv.directory, "index.md")} does not exist\`). This may cause errors when deploying.`, 95 96 ), 96 97 )
+2 -2
quartz/plugins/emitters/ogImage.tsx
··· 11 11 import { BuildCtx } from "../../util/ctx" 12 12 import { QuartzPluginData } from "../vfile" 13 13 import fs from "node:fs/promises" 14 - import chalk from "chalk" 14 + import { styleText } from "util" 15 15 16 16 const defaultOptions: SocialImageOptions = { 17 17 colorScheme: "lightMode", ··· 36 36 const iconData = await fs.readFile(iconPath) 37 37 iconBase64 = `data:image/png;base64,${iconData.toString("base64")}` 38 38 } catch (err) { 39 - console.warn(chalk.yellow(`Warning: Could not find icon at ${iconPath}`)) 39 + console.warn(styleText("yellow", `Warning: Could not find icon at ${iconPath}`)) 40 40 } 41 41 42 42 const imageComponent = userOpts.imageStructure({
+9 -4
quartz/plugins/transformers/lastmod.ts
··· 1 1 import fs from "fs" 2 2 import { Repository } from "@napi-rs/simple-git" 3 3 import { QuartzTransformerPlugin } from "../types" 4 - import chalk from "chalk" 5 4 import path from "path" 5 + import { styleText } from "util" 6 6 7 7 export interface Options { 8 8 priority: ("frontmatter" | "git" | "filesystem")[] ··· 17 17 const invalidDate = isNaN(dt.getTime()) || dt.getTime() === 0 18 18 if (invalidDate && d !== undefined) { 19 19 console.log( 20 - chalk.yellow( 20 + styleText( 21 + "yellow", 21 22 `\nWarning: found invalid date "${d}" in \`${fp}\`. Supported formats: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format`, 22 23 ), 23 24 ) ··· 42 43 repositoryWorkdir = repo.workdir() ?? ctx.argv.directory 43 44 } catch (e) { 44 45 console.log( 45 - chalk.yellow(`\nWarning: couldn't find git repository for ${ctx.argv.directory}`), 46 + styleText( 47 + "yellow", 48 + `\nWarning: couldn't find git repository for ${ctx.argv.directory}`, 49 + ), 46 50 ) 47 51 } 48 52 } ··· 69 73 modified ||= await repo.getFileLatestModifiedDateAsync(relativePath) 70 74 } catch { 71 75 console.log( 72 - chalk.yellow( 76 + styleText( 77 + "yellow", 73 78 `\nWarning: ${file.data.filePath!} isn't yet tracked by git, dates will be inaccurate`, 74 79 ), 75 80 )
+3 -3
quartz/processors/emit.ts
··· 4 4 import { QuartzLogger } from "../util/log" 5 5 import { trace } from "../util/trace" 6 6 import { BuildCtx } from "../util/ctx" 7 - import chalk from "chalk" 7 + import { styleText } from "util" 8 8 9 9 export async function emitContent(ctx: BuildCtx, content: ProcessedContent[]) { 10 10 const { argv, cfg } = ctx ··· 26 26 if (ctx.argv.verbose) { 27 27 console.log(`[emit:${emitter.name}] ${file}`) 28 28 } else { 29 - log.updateText(`${emitter.name} -> ${chalk.gray(file)}`) 29 + log.updateText(`${emitter.name} -> ${styleText("gray", file)}`) 30 30 } 31 31 } 32 32 } else { ··· 36 36 if (ctx.argv.verbose) { 37 37 console.log(`[emit:${emitter.name}] ${file}`) 38 38 } else { 39 - log.updateText(`${emitter.name} -> ${chalk.gray(file)}`) 39 + log.updateText(`${emitter.name} -> ${styleText("gray", file)}`) 40 40 } 41 41 } 42 42 }
+3 -3
quartz/processors/parse.ts
··· 13 13 import { QuartzLogger } from "../util/log" 14 14 import { trace } from "../util/trace" 15 15 import { BuildCtx, WorkerSerializableBuildCtx } from "../util/ctx" 16 - import chalk from "chalk" 16 + import { styleText } from "util" 17 17 18 18 export type QuartzMdProcessor = Processor<MDRoot, MDRoot, MDRoot> 19 19 export type QuartzHtmlProcessor = Processor<undefined, MDRoot, HTMLRoot> ··· 194 194 textToMarkdownPromises.map(async (promise) => { 195 195 const result = await promise 196 196 processedFiles += result.length 197 - log.updateText(`text->markdown ${chalk.gray(`${processedFiles}/${fps.length}`)}`) 197 + log.updateText(`text->markdown ${styleText("gray", `${processedFiles}/${fps.length}`)}`) 198 198 return result 199 199 }), 200 200 ).catch(errorHandler) ··· 208 208 markdownToHtmlPromises.map(async (promise) => { 209 209 const result = await promise 210 210 processedFiles += result.length 211 - log.updateText(`markdown->html ${chalk.gray(`${processedFiles}/${fps.length}`)}`) 211 + log.updateText(`markdown->html ${styleText("gray", `${processedFiles}/${fps.length}`)}`) 212 212 return result 213 213 }), 214 214 ).catch(errorHandler)
+3 -2
quartz/util/og.tsx
··· 9 9 import { formatDate, getDate } from "../components/Date" 10 10 import readingTime from "reading-time" 11 11 import { i18n } from "../i18n" 12 - import chalk from "chalk" 12 + import { styleText } from "util" 13 13 14 14 const defaultHeaderWeight = [700] 15 15 const defaultBodyWeight = [400] ··· 100 100 101 101 if (!match) { 102 102 console.log( 103 - chalk.yellow( 103 + styleText( 104 + "yellow", 104 105 `\nWarning: Failed to fetch font ${rawFontName} with weight ${weight}, got ${cssResponse.statusText}`, 105 106 ), 106 107 )
+2 -2
quartz/util/perf.ts
··· 1 - import chalk from "chalk" 2 1 import pretty from "pretty-time" 2 + import { styleText } from "util" 3 3 4 4 export class PerfTimer { 5 5 evts: { [key: string]: [number, number] } ··· 14 14 } 15 15 16 16 timeSince(evtName?: string): string { 17 - return chalk.yellow(pretty(process.hrtime(this.evts[evtName ?? "start"]))) 17 + return styleText("yellow", pretty(process.hrtime(this.evts[evtName ?? "start"]))) 18 18 } 19 19 }
+3 -3
quartz/util/trace.ts
··· 1 - import chalk from "chalk" 1 + import { styleText } from "util" 2 2 import process from "process" 3 3 import { isMainThread } from "workerpool" 4 4 ··· 11 11 lines.push("") 12 12 lines.push( 13 13 "\n" + 14 - chalk.bgRed.black.bold(" ERROR ") + 14 + styleText(["bgRed", "black", "bold"], " ERROR ") + 15 15 "\n\n" + 16 - chalk.red(` ${msg}`) + 16 + styleText("red", ` ${msg}`) + 17 17 (err.message.length > 0 ? `: ${err.message}` : ""), 18 18 ) 19 19