From 971bcff180c06266416f118a02cb9aa36c4c1887 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 19 May 2024 16:34:25 +0100 Subject: [PATCH] docs: update pretty-ms & do dynamic import 'cause 11ty is dumb --- .docs/lib/FileFetcher.js | 4 +- .docs/lib/HTMLPicture.js | 3 +- .docs/package-lock.json | 175 +++++++++++++++++++++++---------------- .docs/package.json | 10 +-- 4 files changed, 114 insertions(+), 78 deletions(-) diff --git a/.docs/lib/FileFetcher.js b/.docs/lib/FileFetcher.js index a79dbf7..7ed82fc 100644 --- a/.docs/lib/FileFetcher.js +++ b/.docs/lib/FileFetcher.js @@ -7,7 +7,7 @@ const os = require("os"); const phin = require("phin"); const a = require("./Ansi.js"); -const pretty_ms = require("pretty-ms"); +var pretty_ms = null; class FileFetcher { #cache = []; @@ -32,6 +32,8 @@ class FileFetcher { async download_file(url) { const time_start = new Date(); + if(pretty_ms === null) + pretty_ms = (await import("pretty-ms")).default; if(this.#pkg_obj === null) { this.#pkg_obj = JSON.parse(await fs.promises.readFile( diff --git a/.docs/lib/HTMLPicture.js b/.docs/lib/HTMLPicture.js index f3fffbd..5401fa8 100644 --- a/.docs/lib/HTMLPicture.js +++ b/.docs/lib/HTMLPicture.js @@ -4,7 +4,6 @@ const os = require(`os`); const fs = require("fs"); const path = require("path"); -const pretty_ms = require("pretty-ms"); const debug = require("debug")("image"); const imagickal = require("imagickal"); const htmlentities = require("html-entities"); @@ -144,6 +143,7 @@ async function picture(source_image, alt, target_dir, urlpath, formats = "__AUTO } var picture_memoize = null; +var pretty_ms; async function setup_memoize() { const pMemoize = (await import("p-memoize")).default; @@ -152,5 +152,6 @@ async function setup_memoize() { module.exports = async function(...args) { if(picture_memoize === null) await setup_memoize(); + pretty_ms = (await import("pretty-ms")).default; return await picture_memoize(...args); }; diff --git a/.docs/package-lock.json b/.docs/package-lock.json index 39e39f8..7f4b81f 100644 --- a/.docs/package-lock.json +++ b/.docs/package-lock.json @@ -14,18 +14,18 @@ "clean-css": "^5.3.2", "columnify": "^1.6.0", "debug": "^4.3.4", - "html-entities": "^2.4.0", + "html-entities": "^2.5.2", "html-minifier-terser": "^7.0.0-beta.0", "imagickal": "^5.0.1", "keen-slider": "^6.8.6", - "markdown-it-github-alerts": "^0.2.0", + "markdown-it-github-alerts": "^0.3.0", "markdown-it-prism": "^2.3.0", "moondoc": "^1.1.0", "p-memoize": "^7.1.1", - "p-queue": "^7.3.4", - "phin": "^3.7.0", + "p-queue": "^8.0.1", + "phin": "^3.7.1", "photoswipe": "^5.4.3", - "pretty-ms": "^7.0.1" + "pretty-ms": "^9.0.0" } }, "node_modules/@11ty/dependency-tree": { @@ -626,9 +626,12 @@ } }, "node_modules/centra": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/centra/-/centra-2.6.0.tgz", - "integrity": "sha512-dgh+YleemrT8u85QL11Z6tYhegAs3MMxsaWAq/oXeAmYJ7VxL3SI9TZtnfaEvNDMAPolj25FXIb3S+HCI4wQaQ==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/centra/-/centra-2.7.0.tgz", + "integrity": "sha512-PbFMgMSrmgx6uxCdm57RUos9Tc3fclMvhLSATYN39XsDV29B89zZ3KA89jmY0vwSGazyU+uerqwa6t+KaodPcg==", + "dependencies": { + "follow-redirects": "^1.15.6" + } }, "node_modules/chalk": { "version": "4.1.2", @@ -978,9 +981,9 @@ } }, "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, "node_modules/extend-shallow": { "version": "2.0.1", @@ -1084,6 +1087,25 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/foreground-child": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", @@ -1262,9 +1284,9 @@ } }, "node_modules/html-entities": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz", - "integrity": "sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", "funding": [ { "type": "github", @@ -1714,9 +1736,9 @@ } }, "node_modules/markdown-it-github-alerts": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/markdown-it-github-alerts/-/markdown-it-github-alerts-0.2.0.tgz", - "integrity": "sha512-B9zpYBQBW0EmSMqYKl7k+SgkraN/tfT+ruS3pGDpElfDed/y37QgQIP4q/qW0Qgv07zGqoqFdTnzJiDUWCf2oQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/markdown-it-github-alerts/-/markdown-it-github-alerts-0.3.0.tgz", + "integrity": "sha512-qyIuDyfdrVGHhY+E/44yMyNA3ZnayaT/KKT2VgkIz1nmrgiuPkdgPUh4YBZwgJ9VKEGJvGd82Ndrc4oGftrJWg==", "funding": { "url": "https://github.com/sponsors/antfu" }, @@ -2145,26 +2167,26 @@ } }, "node_modules/p-queue": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.4.tgz", - "integrity": "sha512-esox8CWt0j9EZECFvkFl2WNPat8LN4t7WWeXq73D9ha0V96qPRufApZi4ZhPwXAln1uVVal429HVVKPa2X0yQg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", "dependencies": { - "eventemitter3": "^4.0.7", - "p-timeout": "^5.0.2" + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-timeout": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.0.2.tgz", - "integrity": "sha512-sEmji9Yaq+Tw+STwsGAE56hf7gMy9p0tQfJojIAamB7WHJYJKf1qlsg9jqBWG8q9VCxKPhZaP/AcXwEoBcYQhQ==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==", "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2180,11 +2202,14 @@ } }, "node_modules/parse-ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", - "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", + "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==", "engines": { - "node": ">=6" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/parse-path": { @@ -2283,11 +2308,11 @@ "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" }, "node_modules/phin": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/phin/-/phin-3.7.0.tgz", - "integrity": "sha512-DqnVNrpYhKGBZppNKprD+UJylMeEKOZxHgPB+ZP6mGzf3uA2uox4Ep9tUm+rUc8WLIdHT3HcAE4X8fhwQA9JKg==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/phin/-/phin-3.7.1.tgz", + "integrity": "sha512-GEazpTWwTZaEQ9RhL7Nyz0WwqilbqgLahDM3D0hxWwmVDI52nXEybHqiN6/elwpkJBhcuj+WbBu+QfT0uhPGfQ==", "dependencies": { - "centra": "^2.6.0" + "centra": "^2.7.0" }, "engines": { "node": ">= 8" @@ -2409,14 +2434,14 @@ } }, "node_modules/pretty-ms": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", - "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.0.0.tgz", + "integrity": "sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==", "dependencies": { - "parse-ms": "^2.1.0" + "parse-ms": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3731,9 +3756,12 @@ } }, "centra": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/centra/-/centra-2.6.0.tgz", - "integrity": "sha512-dgh+YleemrT8u85QL11Z6tYhegAs3MMxsaWAq/oXeAmYJ7VxL3SI9TZtnfaEvNDMAPolj25FXIb3S+HCI4wQaQ==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/centra/-/centra-2.7.0.tgz", + "integrity": "sha512-PbFMgMSrmgx6uxCdm57RUos9Tc3fclMvhLSATYN39XsDV29B89zZ3KA89jmY0vwSGazyU+uerqwa6t+KaodPcg==", + "requires": { + "follow-redirects": "^1.15.6" + } }, "chalk": { "version": "4.1.2", @@ -3978,9 +4006,9 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, "extend-shallow": { "version": "2.0.1", @@ -4073,6 +4101,11 @@ } } }, + "follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" + }, "foreground-child": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", @@ -4203,9 +4236,9 @@ "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==" }, "html-entities": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz", - "integrity": "sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==" + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==" }, "html-minifier-terser": { "version": "7.2.0", @@ -4543,9 +4576,9 @@ } }, "markdown-it-github-alerts": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/markdown-it-github-alerts/-/markdown-it-github-alerts-0.2.0.tgz", - "integrity": "sha512-B9zpYBQBW0EmSMqYKl7k+SgkraN/tfT+ruS3pGDpElfDed/y37QgQIP4q/qW0Qgv07zGqoqFdTnzJiDUWCf2oQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/markdown-it-github-alerts/-/markdown-it-github-alerts-0.3.0.tgz", + "integrity": "sha512-qyIuDyfdrVGHhY+E/44yMyNA3ZnayaT/KKT2VgkIz1nmrgiuPkdgPUh4YBZwgJ9VKEGJvGd82Ndrc4oGftrJWg==", "requires": {} }, "markdown-it-prism": { @@ -4822,18 +4855,18 @@ } }, "p-queue": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.4.tgz", - "integrity": "sha512-esox8CWt0j9EZECFvkFl2WNPat8LN4t7WWeXq73D9ha0V96qPRufApZi4ZhPwXAln1uVVal429HVVKPa2X0yQg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", "requires": { - "eventemitter3": "^4.0.7", - "p-timeout": "^5.0.2" + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" } }, "p-timeout": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.0.2.tgz", - "integrity": "sha512-sEmji9Yaq+Tw+STwsGAE56hf7gMy9p0tQfJojIAamB7WHJYJKf1qlsg9jqBWG8q9VCxKPhZaP/AcXwEoBcYQhQ==" + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.2.tgz", + "integrity": "sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==" }, "param-case": { "version": "3.0.4", @@ -4845,9 +4878,9 @@ } }, "parse-ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", - "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", + "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==" }, "parse-path": { "version": "7.0.0", @@ -4926,11 +4959,11 @@ "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" }, "phin": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/phin/-/phin-3.7.0.tgz", - "integrity": "sha512-DqnVNrpYhKGBZppNKprD+UJylMeEKOZxHgPB+ZP6mGzf3uA2uox4Ep9tUm+rUc8WLIdHT3HcAE4X8fhwQA9JKg==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/phin/-/phin-3.7.1.tgz", + "integrity": "sha512-GEazpTWwTZaEQ9RhL7Nyz0WwqilbqgLahDM3D0hxWwmVDI52nXEybHqiN6/elwpkJBhcuj+WbBu+QfT0uhPGfQ==", "requires": { - "centra": "^2.6.0" + "centra": "^2.7.0" } }, "photoswipe": { @@ -5008,11 +5041,11 @@ } }, "pretty-ms": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", - "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.0.0.tgz", + "integrity": "sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==", "requires": { - "parse-ms": "^2.1.0" + "parse-ms": "^4.0.0" } }, "printable-characters": { diff --git a/.docs/package.json b/.docs/package.json index a7a3c54..7b43e13 100644 --- a/.docs/package.json +++ b/.docs/package.json @@ -25,17 +25,17 @@ "clean-css": "^5.3.2", "columnify": "^1.6.0", "debug": "^4.3.4", - "html-entities": "^2.4.0", + "html-entities": "^2.5.2", "html-minifier-terser": "^7.0.0-beta.0", "imagickal": "^5.0.1", "keen-slider": "^6.8.6", - "markdown-it-github-alerts": "^0.2.0", + "markdown-it-github-alerts": "^0.3.0", "markdown-it-prism": "^2.3.0", "moondoc": "^1.1.0", "p-memoize": "^7.1.1", - "p-queue": "^7.3.4", - "phin": "^3.7.0", + "p-queue": "^8.0.1", + "phin": "^3.7.1", "photoswipe": "^5.4.3", - "pretty-ms": "^7.0.1" + "pretty-ms": "^9.0.0" } }