From f6b628d6b3baeefe8129ed256d13337fe0cfd163 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 25 Aug 2023 14:51:06 +0200 Subject: [PATCH] Update `unified`, `unified-args`, `@types/hast`, etc --- package.json | 14 +- packages/rehype-cli/cli.js | 2 +- packages/rehype-cli/package.json | 2 +- packages/rehype-parse/lib/errors.js | 278 ------------------ packages/rehype-parse/lib/index.js | 132 ++------- packages/rehype-parse/package.json | 7 +- packages/rehype-parse/readme.md | 65 +--- packages/rehype-stringify/lib/index.js | 4 +- packages/rehype-stringify/package.json | 6 +- packages/rehype/package.json | 4 +- script/parse-error.js | 83 ------ test/api.js | 60 ++-- test/cli.js | 35 +-- test/fixtures/adoption/index.json | 4 +- .../element-loose-close-document/index.json | 6 +- test/fixtures/html-in-svg-in-html/index.json | 4 +- test/fixtures/svg-in-html/index.json | 12 +- test/fixtures/verbose/index.json | 10 +- test/fixtures/xhtml/index.json | 12 +- test/parse-error.js | 54 ++-- .../messages.json | 15 +- .../messages.json | 32 +- .../messages.json | 31 +- .../messages.json | 31 +- .../messages.json | 32 +- .../cdata-in-html-content/messages.json | 16 +- .../messages.json | 32 +- .../messages.json | 15 +- .../messages.json | 16 +- .../control-character-reference/messages.json | 16 +- .../messages.json | 15 +- .../duplicate-attribute/messages.json | 16 +- .../end-tag-with-attributes/messages.json | 16 +- .../messages.json | 16 +- .../messages.json | 15 +- .../eof-before-tag-name/messages.json | 16 +- test/parse-error/eof-in-cdata/messages.json | 16 +- test/parse-error/eof-in-comment/messages.json | 16 +- test/parse-error/eof-in-doctype/messages.json | 31 +- .../messages.json | 15 +- .../messages.json | 31 +- test/parse-error/eof-in-tag/messages.json | 16 +- .../incorrectly-closed-comment/messages.json | 16 +- .../incorrectly-opened-comment/messages.json | 38 +-- .../messages.json | 16 +- .../messages.json | 32 +- .../misplaced-doctype/messages.json | 15 +- .../messages.json | 15 +- .../missing-attribute-value/messages.json | 16 +- .../missing-doctype-name/messages.json | 31 +- .../messages.json | 16 +- .../messages.json | 16 +- .../parse-error/missing-doctype/messages.json | 15 +- .../missing-end-tag-name/messages.json | 16 +- .../messages.json | 16 +- .../messages.json | 16 +- .../messages.json | 16 +- .../messages.json | 31 +- .../messages.json | 31 +- .../messages.json | 16 +- .../messages.json | 16 +- .../messages.json | 31 +- test/parse-error/nested-comment/messages.json | 16 +- .../nested-noscript-in-head/messages.json | 30 +- .../non-conforming-doctype/messages.json | 31 +- .../messages.json | 16 +- .../messages.json | 16 +- .../messages.json | 16 +- .../null-character-reference/messages.json | 16 +- .../messages.json | 15 +- .../messages.json | 16 +- .../messages.json | 16 +- .../messages.json | 48 +-- .../messages.json | 16 +- .../messages.json | 48 +-- .../unexpected-null-character/messages.json | 16 +- .../messages.json | 16 +- .../unexpected-solidus-in-tag/messages.json | 16 +- .../messages.json | 16 +- 79 files changed, 761 insertions(+), 1267 deletions(-) delete mode 100644 packages/rehype-parse/lib/errors.js delete mode 100644 script/parse-error.js diff --git a/package.json b/package.json index 33ed9938..f3d0ad28 100644 --- a/package.json +++ b/package.json @@ -20,19 +20,18 @@ "@types/tape": "^5.0.0", "bail": "^2.0.0", "c8": "^8.0.0", - "hast-util-assert": "^3.0.0", - "mdast-zone": "^5.0.0", + "hast-util-assert": "^4.0.0", "prettier": "^3.0.0", "remark-cli": "^11.0.0", "remark-preset-wooorm": "^9.0.0", "tape": "^5.0.0", - "to-vfile": "^7.0.0", + "to-vfile": "^8.0.0", "type-coverage": "^2.0.0", "type-fest": "^4.0.0", "typescript": "^5.0.0", - "unified": "^10.0.0", - "unist-builder": "^3.0.0", - "unist-util-remove-position": "^4.0.0", + "unified": "^11.0.0", + "unist-builder": "^4.0.0", + "unist-util-remove-position": "^5.0.0", "xo": "^0.56.0" }, "scripts": { @@ -62,8 +61,7 @@ }, "remarkConfig": { "plugins": [ - "preset-wooorm", - "./script/parse-error.js" + "preset-wooorm" ] }, "typeCoverage": { diff --git a/packages/rehype-cli/cli.js b/packages/rehype-cli/cli.js index 597fdd2f..8e1d6c2d 100755 --- a/packages/rehype-cli/cli.js +++ b/packages/rehype-cli/cli.js @@ -10,7 +10,7 @@ const proc = require('rehype/package.json') const cli = require('./package.json') args({ - processor: rehype(), + processor: rehype, name: proc.name, description: cli.description, version: [ diff --git a/packages/rehype-cli/package.json b/packages/rehype-cli/package.json index 7ce64c3a..f711c278 100644 --- a/packages/rehype-cli/package.json +++ b/packages/rehype-cli/package.json @@ -30,7 +30,7 @@ ], "dependencies": { "rehype": "^12.0.0", - "unified-args": "^9.0.0" + "unified-args": "^11.0.0" }, "scripts": { "build": "tsc --build --clean && tsc --build && type-coverage" diff --git a/packages/rehype-parse/lib/errors.js b/packages/rehype-parse/lib/errors.js deleted file mode 100644 index 5c777395..00000000 --- a/packages/rehype-parse/lib/errors.js +++ /dev/null @@ -1,278 +0,0 @@ -export const errors = { - abandonedHeadElementChild: { - reason: 'Unexpected metadata element after head', - description: - 'Unexpected element after head. Expected the element before ``', - url: false - }, - abruptClosingOfEmptyComment: { - reason: 'Unexpected abruptly closed empty comment', - description: 'Unexpected `>` or `->`. Expected `-->` to close comments' - }, - abruptDoctypePublicIdentifier: { - reason: 'Unexpected abruptly closed public identifier', - description: - 'Unexpected `>`. Expected a closing `"` or `\'` after the public identifier' - }, - abruptDoctypeSystemIdentifier: { - reason: 'Unexpected abruptly closed system identifier', - description: - 'Unexpected `>`. Expected a closing `"` or `\'` after the identifier identifier' - }, - absenceOfDigitsInNumericCharacterReference: { - reason: 'Unexpected non-digit at start of numeric character reference', - description: - 'Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references' - }, - cdataInHtmlContent: { - reason: 'Unexpected CDATA section in HTML', - description: - 'Unexpected `` in ``', - description: - 'Unexpected text character `%c`. Only use text in `