From d9eec42f04781f150728b008a8b13d4db12ca687 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 07:00:12 +0000 Subject: [PATCH 1/2] Update dependency @retorquere/bibtex-parser to v14 --- package-lock.json | 321 +--------------------------------------------- package.json | 2 +- 2 files changed, 6 insertions(+), 317 deletions(-) diff --git a/package-lock.json b/package-lock.json index d39ccf2..8a9a213 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "@astrojs/rss": "^4.0.19", "@fontsource/jetbrains-mono": "^5.3.0", "@fontsource/space-grotesk": "^5.3.0", - "@retorquere/bibtex-parser": "^13.0.0", + "@retorquere/bibtex-parser": "^14.0.0", "astro": "^7.3.5", "sharp": "^0.35.5", "yaml": "^2.9.1", @@ -1464,12 +1464,6 @@ "url": "https://github.com/sponsors/oxc-project" } }, - "node_modules/@pomgui/deep": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@pomgui/deep/-/deep-3.0.4.tgz", - "integrity": "sha512-XCAbJPSP+Y6SZiuhRAxjX29mlMMB9j1BQ9lCuXUMsJpgjj8odN7VIiWqOcQdmDu6iYFgcylHv6F9ZbACmyIFyQ==", - "license": "MIT" - }, "node_modules/@prettier/parse-srcset": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@prettier/parse-srcset/-/parse-srcset-3.1.0.tgz", @@ -1478,23 +1472,10 @@ "license": "MIT" }, "node_modules/@retorquere/bibtex-parser": { - "version": "13.0.15", - "resolved": "https://registry.npmjs.org/@retorquere/bibtex-parser/-/bibtex-parser-13.0.15.tgz", - "integrity": "sha512-MriwzL6O6NDBMZy6H5Et4Q2tZC0hFbgD+iMewxnGlBmuHQY4tmEeACe9vjLdjk7UeLzsoTZpsp5loz2N/KnQ8w==", - "license": "ISC", - "dependencies": { - "@unified-latex/unified-latex-util-pegjs": "^1.8.4", - "@unified-latex/unified-latex-util-print-raw": "^1.8.4", - "@unified-latex/unified-latex-util-replace": "^1.8.4", - "@unified-latex/unified-latex-util-visit": "^1.8.4", - "i": "^0.3.7", - "lodash.merge": "^4.6.2", - "moo": "^0.5.3", - "nearley": "^2.20.1", - "unicode2latex": "^7.0.38", - "wink-eng-lite-web-model": "^1.8.1", - "wink-nlp": "^2.4.0" - } + "version": "14.0.6", + "resolved": "https://registry.npmjs.org/@retorquere/bibtex-parser/-/bibtex-parser-14.0.6.tgz", + "integrity": "sha512-quitz4FbQ1VG3LjJymPkhKd37M0mhi6Cnl4dXSPmjXhn8gIz4xx1BCUNytbqRodk4E0U++LXEo6UGhyUQNcVgA==", + "license": "ISC" }, "node_modules/@rolldown/binding-android-arm-eabi": { "version": "1.2.18", @@ -1934,87 +1915,6 @@ "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", "license": "ISC" }, - "node_modules/@unified-latex/unified-latex-types": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@unified-latex/unified-latex-types/-/unified-latex-types-1.8.4.tgz", - "integrity": "sha512-nQ6YS4WYVOA89qdmxw57vl3KfmRGFHGTyLsw9LxCC7DSE6oma3rvXIGjBDUe7E3bgWocBqRITPcz25VqCRlFzA==", - "license": "MIT" - }, - "node_modules/@unified-latex/unified-latex-util-match": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@unified-latex/unified-latex-util-match/-/unified-latex-util-match-1.8.4.tgz", - "integrity": "sha512-wYhTER8i3THQcTYjSufCr8IC0TxguN3dj3h0EFAVneZQ/FIqi/kbvvtPaI0u8mtQLuBDGfhftBy7PvuK9TSG3w==", - "license": "MIT", - "dependencies": { - "@unified-latex/unified-latex-types": "^1.8.4", - "@unified-latex/unified-latex-util-print-raw": "^1.8.4" - } - }, - "node_modules/@unified-latex/unified-latex-util-pegjs": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@unified-latex/unified-latex-util-pegjs/-/unified-latex-util-pegjs-1.8.4.tgz", - "integrity": "sha512-5PTvl2zTK25+Dy8SMpqq6Nf9k1gvr89fS7rR3hB8vi/KjA9AfXGQbiYOcwTfN8O5lpoKJeOuXw6hhaSlTpRaMQ==", - "license": "MIT", - "dependencies": { - "@unified-latex/unified-latex-types": "^1.8.4", - "@unified-latex/unified-latex-util-match": "^1.8.4" - } - }, - "node_modules/@unified-latex/unified-latex-util-print-raw": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@unified-latex/unified-latex-util-print-raw/-/unified-latex-util-print-raw-1.8.4.tgz", - "integrity": "sha512-35hce9A8frQvEp5cM5avPpLMCUs8OIzhR3OZr4TjMJI/Lsj4wu6Tv9h2XQpxDmg8ofOtxn2UEWB19Wld9fgRvw==", - "license": "MIT", - "dependencies": { - "@unified-latex/unified-latex-types": "^1.8.4" - } - }, - "node_modules/@unified-latex/unified-latex-util-replace": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@unified-latex/unified-latex-util-replace/-/unified-latex-util-replace-1.8.4.tgz", - "integrity": "sha512-9T2U11L6gihcoCul+xxwQOQrG3b8y5EcXvNXAV5U4c9GkLesvEEQ7wgyVtYtEDHIzFFL6p0Bc60XyWTn8VD3Qw==", - "license": "MIT", - "dependencies": { - "@unified-latex/unified-latex-types": "^1.8.4", - "@unified-latex/unified-latex-util-match": "^1.8.4", - "@unified-latex/unified-latex-util-split": "^1.8.4", - "@unified-latex/unified-latex-util-trim": "^1.8.4", - "@unified-latex/unified-latex-util-visit": "^1.8.4", - "unified": "^10.1.2" - } - }, - "node_modules/@unified-latex/unified-latex-util-split": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@unified-latex/unified-latex-util-split/-/unified-latex-util-split-1.8.4.tgz", - "integrity": "sha512-EZm92GRiOLcJeH/HFfh1unH+BBBGHOlvgjzIvG5I5XofLWj/Y2lwX2aPbNfrT/nmjKrujcUqPVAQPS8U2ydnpg==", - "license": "MIT", - "dependencies": { - "@unified-latex/unified-latex-types": "^1.8.4", - "@unified-latex/unified-latex-util-match": "^1.8.4" - } - }, - "node_modules/@unified-latex/unified-latex-util-trim": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@unified-latex/unified-latex-util-trim/-/unified-latex-util-trim-1.8.4.tgz", - "integrity": "sha512-Da6vw1XyFxj1uk2p5cxOJXRMVhM/HEaf0SG8R+G1XUEJOmglicSoJOqRIAkpDrLOBZLebAiiXWmjbtIQzbhKkQ==", - "license": "MIT", - "dependencies": { - "@unified-latex/unified-latex-types": "^1.8.4", - "@unified-latex/unified-latex-util-match": "^1.8.4", - "@unified-latex/unified-latex-util-visit": "^1.8.4", - "unified": "^10.1.2" - } - }, - "node_modules/@unified-latex/unified-latex-util-visit": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/@unified-latex/unified-latex-util-visit/-/unified-latex-util-visit-1.8.4.tgz", - "integrity": "sha512-m5O9evxr/kiX1awZAcwUQL+8slVvlWlkbZoKFDP1agrp3dpk7+69npqyoapKKJEK0B4uRYmv93Ho31oHgNoJrg==", - "license": "MIT", - "dependencies": { - "@unified-latex/unified-latex-types": "^1.8.4", - "@unified-latex/unified-latex-util-match": "^1.8.4" - } - }, "node_modules/@volar/kit": { "version": "2.4.28", "resolved": "https://registry.npmjs.org/@volar/kit/-/kit-2.4.28.tgz", @@ -2466,12 +2366,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "license": "MIT" - }, "node_modules/common-ancestor-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-2.0.0.tgz", @@ -2644,12 +2538,6 @@ "node": ">=0.3.1" } }, - "node_modules/discontinuous-range": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", - "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==", - "license": "MIT" - }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", @@ -3045,14 +2933,6 @@ "integrity": "sha512-M5t5LlJpS1UHMjvwRQVdFHvPISGeLAxNcrWuJkeGh0KxsqCHZ1O3NXZU/8x7cD0BDcGW8kapxMKTvwlqrNkHkA==", "license": "BSD-2-Clause" }, - "node_modules/i": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/i/-/i-0.3.7.tgz", - "integrity": "sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q==", - "engines": { - "node": ">=0.4" - } - }, "node_modules/iron-webcrypto": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz", @@ -3062,29 +2942,6 @@ "url": "https://github.com/sponsors/brc-dd" } }, - "node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/is-docker": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-4.0.0.tgz", @@ -3137,12 +2994,6 @@ "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", "license": "MIT" }, - "node_modules/just-permutations": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/just-permutations/-/just-permutations-2.2.1.tgz", - "integrity": "sha512-J2W9djsAsl346A9H41H/S8VXfnPjxZSFfBbAsZRbtFUQTpfmGBGJLWNeZgoDtzBw+ZaN7WF/DOsAJ+V/e6P5cQ==", - "license": "MIT" - }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -3414,12 +3265,6 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "license": "MIT" - }, "node_modules/lru-cache": { "version": "11.5.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", @@ -3565,12 +3410,6 @@ ], "license": "MIT" }, - "node_modules/moo": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.3.tgz", - "integrity": "sha512-m2fmM2dDm7GZQsY7KK2cme8agi+AAljILjQnof7p1ZMDe6dQ4bdnSMx0cPppudoeNv5hEFQirN6u+O4fDE0IWA==", - "license": "BSD-3-Clause" - }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", @@ -3614,28 +3453,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/nearley": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz", - "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", - "license": "MIT", - "dependencies": { - "commander": "^2.19.0", - "moo": "^0.5.0", - "railroad-diagrams": "^1.0.0", - "randexp": "0.4.6" - }, - "bin": { - "nearley-railroad": "bin/nearley-railroad.js", - "nearley-test": "bin/nearley-test.js", - "nearley-unparse": "bin/nearley-unparse.js", - "nearleyc": "bin/nearleyc.js" - }, - "funding": { - "type": "individual", - "url": "https://nearley.js.org/#give-to-nearley" - } - }, "node_modules/neotraverse": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-1.0.1.tgz", @@ -3907,25 +3724,6 @@ "integrity": "sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==", "license": "MIT" }, - "node_modules/railroad-diagrams": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", - "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==", - "license": "CC0-1.0" - }, - "node_modules/randexp": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz", - "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", - "license": "MIT", - "dependencies": { - "discontinuous-range": "1.0.0", - "ret": "~0.1.10" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/readdirp": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz", @@ -3989,15 +3787,6 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "license": "MIT", - "engines": { - "node": ">=0.12" - } - }, "node_modules/retext-smartypants": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-6.2.0.tgz", @@ -4335,12 +4124,6 @@ "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", "license": "MIT" }, - "node_modules/tiny-merge-patch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tiny-merge-patch/-/tiny-merge-patch-1.0.0.tgz", - "integrity": "sha512-NR7dpqibfxA1uHaFJn5YXViH7REa0wPcZh8MLFrEn9OvDWyIY9YyyKHHmFBE66ER18CQwJ+VGknsQbgiBtL8Uw==", - "license": "MIT" - }, "node_modules/tinyclip": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tinyclip/-/tinyclip-1.0.3.tgz", @@ -4473,85 +4256,6 @@ "devOptional": true, "license": "MIT" }, - "node_modules/unicode2latex": { - "version": "7.0.38", - "resolved": "https://registry.npmjs.org/unicode2latex/-/unicode2latex-7.0.38.tgz", - "integrity": "sha512-PIpuGOESQul1e7Gk1D9D/N20f0KR7Tt3hsnJE+b4xbNIB73pmu2wpFSetyBD3VkDgrJ/uK40F7fuvaFAIuTpAA==", - "license": "ISC", - "dependencies": { - "@pomgui/deep": "^3.0.4", - "just-permutations": "^2.2.1", - "tiny-merge-patch": "^1.0.0" - } - }, - "node_modules/unified": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unified/node_modules/@types/unist": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", - "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", - "license": "MIT" - }, - "node_modules/unified/node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unified/node_modules/vfile": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", - "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unified/node_modules/vfile-message": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", - "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/unifont": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/unifont/-/unifont-1.0.3.tgz", @@ -5147,21 +4851,6 @@ "dev": true, "license": "MIT" }, - "node_modules/wink-eng-lite-web-model": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/wink-eng-lite-web-model/-/wink-eng-lite-web-model-1.8.1.tgz", - "integrity": "sha512-M2tSOU/rVNkDj8AS8IoKJaM7apJJjS0cN+hE8CPazfnB4A/ojyc9+7RMPk18UOiIdSyWk7MR6w8z9lWix2l5tA==", - "license": "MIT", - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/wink-nlp": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/wink-nlp/-/wink-nlp-2.4.0.tgz", - "integrity": "sha512-d02inlNJL0LLNTLoYfkxZYGrqnYDSZV4HI4WpeuyIEfpu7UcUqUW1ZYWr+JTFm4ZR6dQdzOW/FtHEQRO+o/zzA==", - "license": "MIT" - }, "node_modules/wrap-ansi": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", diff --git a/package.json b/package.json index efe3e94..6fff7c9 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@astrojs/rss": "^4.0.19", "@fontsource/jetbrains-mono": "^5.3.0", "@fontsource/space-grotesk": "^5.3.0", - "@retorquere/bibtex-parser": "^13.0.0", + "@retorquere/bibtex-parser": "^14.0.0", "astro": "^7.3.5", "sharp": "^0.35.5", "yaml": "^2.9.1", From 736afb22b9d8c40baa8e2bf92bb5eb6392592bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Fuch=C3=9F?= Date: Tue, 24 Nov 2026 09:15:37 +0100 Subject: [PATCH 2/2] Migrate bibtex loader to bibtex-parser v14 --- src/loaders/bibtex.ts | 80 +++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 45 deletions(-) diff --git a/src/loaders/bibtex.ts b/src/loaders/bibtex.ts index 1e07309..74917d8 100644 --- a/src/loaders/bibtex.ts +++ b/src/loaders/bibtex.ts @@ -1,9 +1,18 @@ import type { Loader } from 'astro/loaders'; -import { parse } from '@retorquere/bibtex-parser/js'; +import type { VerbatimEntry } from '@retorquere/bibtex-parser'; +import { initSync, parse, parseVerbatim } from '@retorquere/bibtex-parser'; import { readFile } from 'node:fs/promises'; -import { existsSync } from 'node:fs'; +import { existsSync, readFileSync } from 'node:fs'; +import { createRequire } from 'node:module'; import { fileURLToPath } from 'node:url'; +// The parser is a WASM build that must be initialized before the first parse. +initSync({ + module: readFileSync( + createRequire(import.meta.url).resolve('@retorquere/bibtex-parser/bibtex_parser_bg.wasm'), + ), +}); + /** * Fields stripped from the copyable BibTeX: al-folio bookkeeping, not * bibliography. `html` is ArDoCo's own repurposing of an al-folio field — it @@ -37,40 +46,25 @@ const num = (v: unknown): number | undefined => { return Number.isNaN(n) ? undefined : n; }; -/** A parsed BibTeX name. The parser hands these back even in `raw` mode. */ -type BibName = { lastName?: string; firstName?: string; prefix?: string; suffix?: string }; - -const isNameList = (v: unknown): v is BibName[] => - Array.isArray(v) && v.length > 0 && typeof v[0] === 'object' && v[0] !== null; - -/** - * `author` and `editor` come back as name objects, never as a string — so - * stringifying them naively yields "[object Object]". Rebuild the BibTeX form: - * "Last, First" joined by " and ", with the LaTeX escapes left untouched. - */ -const names = (list: BibName[]): string => - list - .map((n) => { - const last = (n.lastName ?? '').trim(); - const first = (n.firstName ?? '').trim(); - if (last && first) return `${last}, ${first}`; - return last || first; - }) - .filter(Boolean) - .join(' and '); - /** * Re-serialize one entry as public BibTeX, dropping the private fields. * - * Built from the RAW parse so LaTeX escapes and brace protection survive + * Built from the VERBATIM parse so LaTeX escapes and brace protection survive * verbatim — a reader pasting this into their own .bib gets what the source * file says, not a Unicode-normalized approximation. + * + * The parser returns fields in hash order, so they are sorted back into the + * order of the source entry (`input`). It also returns fields verbatim, so + * empty ones (`number = {}`) are dropped and alignment whitespace is collapsed. */ -function serialize(type: string, key: string, fields: Record): string { - const rows = Object.entries(fields) - .filter(([k]) => !PRIVATE_FIELDS.has(k.toLowerCase())) - .map(([k, v]) => ` ${k.padEnd(12)} = {${(isNameList(v) ? names(v) : str(v)) ?? ''}}`); - return `@${type}{${key},\n${rows.join(',\n')}\n}`; +function serialize(entry: VerbatimEntry): string { + const position = (field: string) => entry.input.search(new RegExp(`[,{]\\s*${field}\\s*=`, 'i')); + const rows = Object.entries(entry.fields) + .map(([k, v]) => [k, str(v)?.replace(/\s+/g, ' ')] as const) + .filter(([k, v]) => v !== undefined && !PRIVATE_FIELDS.has(k.toLowerCase())) + .sort(([a], [b]) => position(a) - position(b)) + .map(([k, v]) => ` ${k.padEnd(12)} = {${v}}`); + return `@${entry.type}{${entry.key},\n${rows.join(',\n')}\n}`; } export function bibtexLoader(opts: { file: string; conferenceRoot: string }): Loader { @@ -89,9 +83,10 @@ export function bibtexLoader(opts: { file: string; conferenceRoot: string }): Lo // Two passes: `cooked` gives LaTeX decoded to Unicode for display; // `raw` keeps the original escapes for the copyable BibTeX block. - // sentenceCase:false preserves brace-protected casing ({LiSSA}, {ExArch}). - const cooked = parse(source, { sentenceCase: false }); - const raw = parse(source, { sentenceCase: false, raw: true }); + // The parser sentence-cases titles of English entries; with no language + // counted as English, titles keep their casing ({LiSSA}, {ExArch}). + const cooked = parse(source, { english: [] }); + const raw = parseVerbatim(source); if (cooked.errors.length > 0) { for (const e of cooked.errors) logger.error(`${opts.file}: ${JSON.stringify(e)}`); @@ -102,9 +97,9 @@ export function bibtexLoader(opts: { file: string; conferenceRoot: string }): Lo store.clear(); for (const entry of cooked.entries) { - const f = entry.fields as Record; + const f = entry.fields; - const authors = (f.author as BibName[] | undefined) ?? []; + const authors = f.author ?? []; if (authors.length === 0) throw new Error(`${entry.key}: no authors parsed`); // ArDoCo has no `pdf` field; `html` is the equivalent load-bearing @@ -128,18 +123,16 @@ export function bibtexLoader(opts: { file: string; conferenceRoot: string }): Lo } const rawEntry = rawByKey.get(entry.key); - const bibtex = serialize( - entry.type, - entry.key, - (rawEntry?.fields as Record) ?? f, - ); + if (!rawEntry) throw new Error(`${entry.key}: missing from the verbatim parse`); + const bibtex = serialize(rawEntry); // The normalizing parse splits a nobiliary particle off into `prefix` // and a "Jr."-style tail into `suffix` (only "von Geisau, Johannes" is // affected today). Reading `lastName` alone printed "Johannes Geisau". + // A name the parser cannot split arrives whole in `name`. const people = authors.map((a) => ({ first: str(a.firstName) ?? '', - last: [str(a.prefix), str(a.lastName), str(a.suffix)].filter(Boolean).join(' '), + last: [str(a.prefix), str(a.lastName ?? a.name), str(a.suffix)].filter(Boolean).join(' '), })); const data = { @@ -164,10 +157,7 @@ export function bibtexLoader(opts: { file: string; conferenceRoot: string }): Lo location: str(f.location) ?? str(f.venue) ?? str(f.address), doi: unLatex(str(f.doi)), url: unLatex(str(f.url)), - keywords: (str(f.keywords) ?? '') - .split(',') - .map((k) => k.trim()) - .filter(Boolean), + keywords: f.keywords ?? [], googleScholarId: str(f.google_scholar_id), infoSlug, bibtex,