Skip to content

Commit

Permalink
bundle unified
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebarkmin committed Jul 31, 2023
1 parent c6c7d1f commit 9851b21
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .changeset/rude-poets-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@hyperbook/next-watch": patch
"@hyperbook/markdown": patch
"hyperbook": patch
---

bundle unified to handle wrong import
3 changes: 3 additions & 0 deletions packages/markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"files": [
"dist"
],
"bundle": [
"unified"
],
"publishConfig": {
"access": "public"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/markdown/src/useRemarkSync.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Fragment, ReactElement, createElement } from "react";
import unified, { PluggableList } from "unified";
import { PluggableList, unified } from "unified";
import remarkParse from "remark-parse";
import { Options as RemarkRehypeOptions } from "mdast-util-to-hast";
import remarkToRehype from "remark-rehype";
Expand All @@ -23,8 +23,7 @@ export const useRemarkSync = (
rehypePlugins = [],
}: UseRemarkSyncOptions = {}
): ReactElement =>
unified
.unified()
unified()
.use(remarkParse)
.use(remarkPlugins)
.use(remarkToRehype, remarkToRehypeOptions)
Expand Down
5 changes: 2 additions & 3 deletions packages/markdown/src/useToc.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import remarkParse from "remark-parse";
import remarkStringify from "remark-stringify";
import unified from "unified";
import { unified } from "unified";
import { remarkCustomHeadingIds } from "./remarkCustomHeadingIds";
import { Heading, remarkHeadings } from "./remarkHeadings";

export const useToc = (markdown: string): Heading[] => {
return unified
.unified()
return unified()
.use(remarkCustomHeadingIds)
.use(remarkParse)
.use(remarkStringify)
Expand Down

1 comment on commit 9851b21

@vercel
Copy link

@vercel vercel bot commented on 9851b21 Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.