Browse Source

fix type errors by hast-util-select

Yuki Takei 2 years ago
parent
commit
119e786e74

+ 1 - 1
apps/app/package.json

@@ -115,7 +115,7 @@
     "extensible-custom-error": "^0.0.7",
     "extensible-custom-error": "^0.0.7",
     "form-data": "^4.0.0",
     "form-data": "^4.0.0",
     "graceful-fs": "^4.1.11",
     "graceful-fs": "^4.1.11",
-    "hast-util-select": "^5.0.2",
+    "hast-util-select": "^5.0.5",
     "helmet": "^4.6.0",
     "helmet": "^4.6.0",
     "http-errors": "^2.0.0",
     "http-errors": "^2.0.0",
     "i18next": "^22.4.10",
     "i18next": "^22.4.10",

+ 2 - 1
apps/app/src/services/renderer/rehype-plugins/add-class.ts

@@ -1,6 +1,7 @@
 // See: https://github.com/martypdx/rehype-add-classes for the original implementation.
 // See: https://github.com/martypdx/rehype-add-classes for the original implementation.
 // Re-implemeted in TypeScript.
 // Re-implemeted in TypeScript.
-import { selectAll, HastNode, Element } from 'hast-util-select';
+import { selectAll } from 'hast-util-select';
+import type { Node as HastNode, Element } from 'hast-util-select/lib/types';
 import { Properties } from 'hast-util-select/lib/types';
 import { Properties } from 'hast-util-select/lib/types';
 import { Plugin } from 'unified';
 import { Plugin } from 'unified';
 
 

+ 2 - 2
apps/app/src/services/renderer/rehype-plugins/add-line-number-attribute.ts

@@ -1,6 +1,6 @@
 import { Schema as SanitizeOption } from 'hast-util-sanitize';
 import { Schema as SanitizeOption } from 'hast-util-sanitize';
-import { Element } from 'hast-util-select';
-import { Plugin } from 'unified';
+import type { Element } from 'hast-util-select/lib/types';
+import type { Plugin } from 'unified';
 import { visit } from 'unist-util-visit';
 import { visit } from 'unist-util-visit';
 
 
 import { addClassToProperties } from './add-class';
 import { addClassToProperties } from './add-class';

+ 2 - 1
apps/app/src/services/renderer/rehype-plugins/relative-links-by-pukiwiki-like-linker.spec.ts

@@ -1,4 +1,5 @@
-import { type HastNode, select } from 'hast-util-select';
+import { select } from 'hast-util-select';
+import type { Node as HastNode } from 'hast-util-select/lib/types';
 import parse from 'remark-parse';
 import parse from 'remark-parse';
 import rehype from 'remark-rehype';
 import rehype from 'remark-rehype';
 import { unified } from 'unified';
 import { unified } from 'unified';

+ 2 - 1
apps/app/src/services/renderer/rehype-plugins/relative-links.spec.ts

@@ -1,5 +1,6 @@
 
 
-import { select, type HastNode } from 'hast-util-select';
+import { select } from 'hast-util-select';
+import type { Node as HastNode } from 'hast-util-select/lib/types';
 import parse from 'remark-parse';
 import parse from 'remark-parse';
 import remarkRehype from 'remark-rehype';
 import remarkRehype from 'remark-rehype';
 import { unified } from 'unified';
 import { unified } from 'unified';

+ 2 - 1
apps/app/src/services/renderer/rehype-plugins/relative-links.ts

@@ -1,6 +1,7 @@
 import assert from 'assert';
 import assert from 'assert';
 
 
-import { selectAll, type HastNode, type Element } from 'hast-util-select';
+import { selectAll } from 'hast-util-select';
+import type { Node as HastNode, Element } from 'hast-util-select/lib/types';
 import isAbsolute from 'is-absolute-url';
 import isAbsolute from 'is-absolute-url';
 import type { Plugin } from 'unified';
 import type { Plugin } from 'unified';
 
 

+ 1 - 0
packages/remark-attachment-refs/package.json

@@ -34,6 +34,7 @@
     "@growi/remark-growi-directive": "link:../remark-growi-directive",
     "@growi/remark-growi-directive": "link:../remark-growi-directive",
     "@growi/ui": "link:../ui",
     "@growi/ui": "link:../ui",
     "bunyan": "^1.8.15",
     "bunyan": "^1.8.15",
+    "hast-util-select": "^5.0.5",
     "universal-bunyan": "^0.9.2"
     "universal-bunyan": "^0.9.2"
   },
   },
   "devDependencies": {
   "devDependencies": {

+ 1 - 1
yarn.lock

@@ -9426,7 +9426,7 @@ hast-util-sanitize@^4.1.0:
   dependencies:
   dependencies:
     "@types/hast" "^2.0.0"
     "@types/hast" "^2.0.0"
 
 
-hast-util-select@^5.0.2, hast-util-select@^5.0.5, hast-util-select@~5.0.1:
+hast-util-select@^5.0.5, hast-util-select@~5.0.1:
   version "5.0.5"
   version "5.0.5"
   resolved "https://registry.yarnpkg.com/hast-util-select/-/hast-util-select-5.0.5.tgz#be9ccb71d2278681ca024727f12abd4f93b3e9bc"
   resolved "https://registry.yarnpkg.com/hast-util-select/-/hast-util-select-5.0.5.tgz#be9ccb71d2278681ca024727f12abd4f93b3e9bc"
   integrity sha512-QQhWMhgTFRhCaQdgTKzZ5g31GLQ9qRb1hZtDPMqQaOhpLBziWcshUS0uCR5IJ0U1jrK/mxg35fmcq+Dp/Cy2Aw==
   integrity sha512-QQhWMhgTFRhCaQdgTKzZ5g31GLQ9qRb1hZtDPMqQaOhpLBziWcshUS0uCR5IJ0U1jrK/mxg35fmcq+Dp/Cy2Aw==