@scalar/asyncapi-to-markdown 0.2.11 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @scalar/asyncapi-to-markdown
2
2
 
3
+ ## 0.2.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#11124](https://github.com/scalar/scalar/pull/11124): Share one copy of the Markdown parser stack
8
+
9
+ `@scalar/markdown` adds `parseMarkdown`, `mdastFromHtml` and `createMarkdownSerializer`. `@scalar/openapi-to-markdown` and `@scalar/asyncapi-to-markdown` use them instead of importing `unified`, `remark-*` and `rehype-*` themselves. `@scalar/markdown` bundles that stack, so a bundle that included both used to carry two copies of parse5, micromark and the mdast/hast utilities; the API Reference standalone build is about 330 KB smaller, 99 KB gzipped. Sharing the stack does not change the Markdown either package produces.
10
+
3
11
  ## 0.2.11
4
12
 
5
13
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"render-document.d.ts","sourceRoot":"","sources":["../src/render-document.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAIvD,kGAAkG;AAClG,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,wBAkIlE,CAAA"}
1
+ {"version":3,"file":"render-document.d.ts","sourceRoot":"","sources":["../src/render-document.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAIvD,kGAAkG;AAClG,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,wBAkIlE,CAAA"}
@@ -1,14 +1,12 @@
1
1
  import { getRaw } from '@scalar/json-magic/magic-proxy';
2
+ import { createMarkdownSerializer } from '@scalar/markdown';
2
3
  import { anchor, createDescriptionParser, createDocumentAnchors, describe, expandDescriptions, heading, item, link, list, paragraph, text, } from '@scalar/openapi-to-markdown/markdown';
3
4
  import { resolveTraits } from '@scalar/workspace-store/helpers/resolve-traits';
4
- import remarkGfm from 'remark-gfm';
5
- import remarkStringify from 'remark-stringify';
6
- import { unified } from 'unified';
7
5
  import { object, own, select, string } from './document.js';
8
6
  import { createContentRenderer } from './render-content.js';
9
7
  import { createSchemaRegistry } from './schema-references.js';
10
8
  import { createSchemaView } from './schema-view.js';
11
- const serializer = unified().use(remarkGfm).use(remarkStringify, { bullet: '-' }).freeze();
9
+ const serialize = createMarkdownSerializer({ bullet: '-' });
12
10
  /** Each render owns its selection, schema expansion state and description reference namespace. */
13
11
  export const createRenderer = (document) => {
14
12
  const descriptions = createDescriptionParser();
@@ -134,7 +132,7 @@ export const createRenderer = (document) => {
134
132
  blocks.splice(index + 1, 0, heading(2, text('Contents')), list(contents));
135
133
  }
136
134
  await expandDescriptions(blocks, descriptions());
137
- return serializer.stringify({ type: 'root', children: blocks });
135
+ return serialize({ type: 'root', children: blocks });
138
136
  },
139
137
  };
140
138
  };
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "markdown",
16
16
  "llm"
17
17
  ],
18
- "version": "0.2.11",
18
+ "version": "0.2.12",
19
19
  "engines": {
20
20
  "node": ">=22"
21
21
  },
@@ -39,18 +39,16 @@
39
39
  "CHANGELOG.md"
40
40
  ],
41
41
  "dependencies": {
42
- "@scalar/asyncapi-upgrader": "0.1.22",
43
- "@scalar/helpers": "0.18.1",
44
- "@scalar/json-magic": "0.21.0",
45
- "@scalar/openapi-to-markdown": "1.7.9",
46
- "@scalar/types": "0.30.0",
47
- "@scalar/workspace-store": "0.74.0",
48
- "remark-gfm": "^4.0.1",
49
- "remark-stringify": "^11.0.0",
50
- "unified": "^11.0.5"
42
+ "@scalar/asyncapi-upgrader": "0.1.23",
43
+ "@scalar/helpers": "0.19.0",
44
+ "@scalar/json-magic": "0.21.1",
45
+ "@scalar/markdown": "0.1.0",
46
+ "@scalar/openapi-to-markdown": "1.7.10",
47
+ "@scalar/types": "0.31.0",
48
+ "@scalar/workspace-store": "0.75.0"
51
49
  },
52
50
  "devDependencies": {
53
- "@scalar/components": "0.35.2",
51
+ "@scalar/components": "0.35.3",
54
52
  "@scalar/themes": "0.20.3",
55
53
  "@tailwindcss/vite": "^4.3.5",
56
54
  "@types/mdast": "^4.0.4",
@@ -61,6 +59,7 @@
61
59
  "rehype-stringify": "^10.0.1",
62
60
  "tailwindcss": "^4.3.5",
63
61
  "tsx": "4.23.15",
62
+ "unified": "^11.0.5",
64
63
  "vite": "8.3.8",
65
64
  "vitest": "5.1.0",
66
65
  "vue": "^3.5.45",