@scalar/openapi-to-markdown 0.2.45 → 0.3.1

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,33 @@
1
1
  # @scalar/openapi-to-markdown
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @scalar/oas-utils@0.6.1
9
+ - @scalar/components@0.16.1
10
+
11
+ ## 0.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#7121](https://github.com/scalar/scalar/pull/7121) [`9661e81`](https://github.com/scalar/scalar/commit/9661e81907d1a9b74ba30f270f2d6c8e49834cd5) Thanks [@marcalexiei](https://github.com/marcalexiei)! - feat(oas-utils): make `dereference` synchronous
16
+
17
+ - [#7199](https://github.com/scalar/scalar/pull/7199) [`0d9c945`](https://github.com/scalar/scalar/commit/0d9c945a696ea8b826d86f7b48ec6de4d85e64f0) Thanks [@marcalexiei](https://github.com/marcalexiei)! - feat: update vue to 3.5.21
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [[`eb022f2`](https://github.com/scalar/scalar/commit/eb022f2c8f93c84a04c0093fefe8a1e05d6ec80d), [`348f8f6`](https://github.com/scalar/scalar/commit/348f8f6292ef41844fda1fdd3089a55d97adbc0e), [`11a6e64`](https://github.com/scalar/scalar/commit/11a6e6405d4f30f001a16d6afda4d2b759c0ed09), [`c22fc4e`](https://github.com/scalar/scalar/commit/c22fc4e5acb49d648014a6100c724a5b33c59cde), [`2239843`](https://github.com/scalar/scalar/commit/2239843150ed16d1ca35b0b1f8e90cd3e35be7ce), [`6ec8c29`](https://github.com/scalar/scalar/commit/6ec8c299d912111b029e8058979d00968b70691a), [`9661e81`](https://github.com/scalar/scalar/commit/9661e81907d1a9b74ba30f270f2d6c8e49834cd5), [`134ff5f`](https://github.com/scalar/scalar/commit/134ff5f32aa6842696bf146c7e0817b1662905eb), [`134ff5f`](https://github.com/scalar/scalar/commit/134ff5f32aa6842696bf146c7e0817b1662905eb), [`81b0a7a`](https://github.com/scalar/scalar/commit/81b0a7a4245619f03161eae639dc5834b77432b6), [`8a5a6a0`](https://github.com/scalar/scalar/commit/8a5a6a052cc05b0902b05052c80cc429ebc5a730), [`704fa30`](https://github.com/scalar/scalar/commit/704fa302b2cdbb17b19ca2d742537ca163d58c1c), [`c84b7c5`](https://github.com/scalar/scalar/commit/c84b7c5e81be83dacbdfcbf9cb1e558dfdc3faa1), [`0319b8a`](https://github.com/scalar/scalar/commit/0319b8a8652a50667776b2e9fd27c3e15b34f765), [`da7ab2f`](https://github.com/scalar/scalar/commit/da7ab2fb2e422b9cec2de5faba58ea83dd774808), [`a26ced6`](https://github.com/scalar/scalar/commit/a26ced6f2897074f0c102d5ccbff55c6fd520e12), [`134ff5f`](https://github.com/scalar/scalar/commit/134ff5f32aa6842696bf146c7e0817b1662905eb), [`6a090a2`](https://github.com/scalar/scalar/commit/6a090a2e07ef961c56041c85ee9786180437593a), [`592533f`](https://github.com/scalar/scalar/commit/592533faf60b6a5ba27909a4ca0847ca9f04a96d), [`eba18d0`](https://github.com/scalar/scalar/commit/eba18d06267a163a8f91396a66f817100ee59461), [`a821986`](https://github.com/scalar/scalar/commit/a821986332141e69d26885b2d2b32eb0c49f416c), [`c72a2c5`](https://github.com/scalar/scalar/commit/c72a2c59eb80e1f5e216c687229ff90bea88f554), [`0d9c945`](https://github.com/scalar/scalar/commit/0d9c945a696ea8b826d86f7b48ec6de4d85e64f0), [`e23229d`](https://github.com/scalar/scalar/commit/e23229dfbd9613b5047b28b57901f2fc5a6e33e6)]:
22
+ - @scalar/types@0.4.0
23
+ - @scalar/components@0.16.0
24
+ - @scalar/openapi-upgrader@0.1.4
25
+ - @scalar/openapi-parser@0.23.0
26
+ - @scalar/openapi-types@0.5.1
27
+ - @scalar/helpers@0.0.13
28
+ - @scalar/oas-utils@0.6.0
29
+ - @scalar/snippetz@0.5.2
30
+
3
31
  ## 0.2.45
4
32
 
5
33
  ### Patch Changes
@@ -15,12 +15,12 @@ const C = { key: 1 }, E = { key: 0 }, w = { key: 1 }, D = { key: 2 }, M = { key:
15
15
  l("ul", null, [
16
16
  l("li", null, [
17
17
  n[0] || (n[0] = l("strong", null, "OpenAPI Version:", -1)),
18
- n[1] || (n[1] = d(" ")),
18
+ n[1] || (n[1] = d(" ", -1)),
19
19
  l("code", null, u(k.content?.openapi), 1)
20
20
  ]),
21
21
  l("li", null, [
22
22
  n[2] || (n[2] = l("strong", null, "API Version:", -1)),
23
- n[3] || (n[3] = d(" ")),
23
+ n[3] || (n[3] = d(" ", -1)),
24
24
  l("code", null, u(k.content?.info?.version), 1)
25
25
  ])
26
26
  ])
@@ -36,7 +36,7 @@ const C = { key: 1 }, E = { key: 0 }, w = { key: 1 }, D = { key: 2 }, M = { key:
36
36
  key: o.url
37
37
  }, [
38
38
  n[8] || (n[8] = l("strong", null, "URL:", -1)),
39
- n[9] || (n[9] = d(" ")),
39
+ n[9] || (n[9] = d(" ", -1)),
40
40
  l("code", null, u(o.url), 1),
41
41
  l("ul", null, [
42
42
  o.description ? (t(), e("li", E, [
@@ -48,9 +48,9 @@ const C = { key: 1 }, E = { key: 0 }, w = { key: 1 }, D = { key: 2 }, M = { key:
48
48
  l("ul", null, [
49
49
  (t(!0), e(r, null, m(o.variables, (s, y) => (t(), e("li", { key: y }, [
50
50
  l("code", null, u(y), 1),
51
- n[5] || (n[5] = d(" (default: ")),
51
+ n[5] || (n[5] = d(" (default: ", -1)),
52
52
  l("code", null, u(s.default), 1),
53
- n[6] || (n[6] = d(")")),
53
+ n[6] || (n[6] = d(")", -1)),
54
54
  s.description ? (t(), e(r, { key: 0 }, [
55
55
  d(": " + u(s.description), 1)
56
56
  ], 64)) : i("", !0)
@@ -82,12 +82,12 @@ const C = { key: 1 }, E = { key: 0 }, w = { key: 1 }, D = { key: 2 }, M = { key:
82
82
  l("ul", null, [
83
83
  l("li", null, [
84
84
  n[11] || (n[11] = l("strong", null, "Method:", -1)),
85
- n[12] || (n[12] = d(" ")),
85
+ n[12] || (n[12] = d(" ", -1)),
86
86
  l("code", null, u(y.toString().toUpperCase()), 1)
87
87
  ]),
88
88
  l("li", null, [
89
89
  n[13] || (n[13] = l("strong", null, "Path:", -1)),
90
- n[14] || (n[14] = d(" ")),
90
+ n[14] || (n[14] = d(" ", -1)),
91
91
  l("code", null, u(o), 1)
92
92
  ]),
93
93
  s.tags ? (t(), e("li", M, [
@@ -182,9 +182,9 @@ const C = { key: 1 }, E = { key: 0 }, w = { key: 1 }, D = { key: 2 }, M = { key:
182
182
  n[24] || (n[24] = l("strong", null, "Tags:", -1)),
183
183
  d(" " + u(y.tags.join(", ")), 1)
184
184
  ])) : i("", !0),
185
- y.deprecated ? (t(), e("li", I, n[25] || (n[25] = [
185
+ y.deprecated ? (t(), e("li", I, [...n[25] || (n[25] = [
186
186
  l("strong", null, "Deprecated", -1)
187
- ]))) : i("", !0)
187
+ ])])) : i("", !0)
188
188
  ]),
189
189
  f(b(j), {
190
190
  value: y.description
@@ -58,15 +58,15 @@ const j = { key: 0 }, v = { key: 0 }, I = { key: 1 }, b = { key: 2 }, q = { key:
58
58
  o("p", null, [
59
59
  o("code", null, u(Array.isArray(l.type) ? l.type.join(" | ") : l.type || "object"), 1),
60
60
  l.format ? (n(), t("span", B, [
61
- s[4] || (s[4] = d(", format: ")),
61
+ s[4] || (s[4] = d(", format: ", -1)),
62
62
  o("code", null, u(l.format), 1)
63
63
  ])) : i("", !0),
64
64
  l.enum ? (n(), t("span", C, [
65
- s[5] || (s[5] = d(", possible values: ")),
65
+ s[5] || (s[5] = d(", possible values: ", -1)),
66
66
  o("code", null, u(l.enum.map((y) => JSON.stringify(y)).join(", ")), 1)
67
67
  ])) : i("", !0),
68
68
  l.default !== void 0 ? (n(), t("span", J, [
69
- s[6] || (s[6] = d(", default: ")),
69
+ s[6] || (s[6] = d(", default: ", -1)),
70
70
  o("code", null, u(JSON.stringify(l.default)), 1)
71
71
  ])) : i("", !0),
72
72
  l.description ? (n(), t("span", V, " — " + u(l.description), 1)) : i("", !0)
@@ -96,31 +96,31 @@ const j = { key: 0 }, v = { key: 0 }, I = { key: 1 }, b = { key: 2 }, q = { key:
96
96
  ]),
97
97
  e.schema.minItems !== void 0 || e.schema.maxItems !== void 0 || e.schema.uniqueItems ? (n(), t("ul", R, [
98
98
  e.schema.minItems !== void 0 ? (n(), t("li", D, [
99
- s[8] || (s[8] = d(" Min items: ")),
99
+ s[8] || (s[8] = d(" Min items: ", -1)),
100
100
  o("code", null, u(e.schema.minItems), 1)
101
101
  ])) : i("", !0),
102
102
  e.schema.maxItems !== void 0 ? (n(), t("li", F, [
103
- s[9] || (s[9] = d(" Max items: ")),
103
+ s[9] || (s[9] = d(" Max items: ", -1)),
104
104
  o("code", null, u(e.schema.maxItems), 1)
105
105
  ])) : i("", !0),
106
- e.schema.uniqueItems ? (n(), t("li", L, s[10] || (s[10] = [
107
- d("Unique items: "),
106
+ e.schema.uniqueItems ? (n(), t("li", L, [...s[10] || (s[10] = [
107
+ d("Unique items: ", -1),
108
108
  o("code", null, "true", -1)
109
- ]))) : i("", !0)
109
+ ])])) : i("", !0)
110
110
  ])) : i("", !0)
111
111
  ])) : (n(), t("section", P, [
112
112
  o("p", null, [
113
113
  o("code", null, u(e.schema.type), 1),
114
114
  e.schema.format ? (n(), t("span", T, [
115
- s[12] || (s[12] = d(", format: ")),
115
+ s[12] || (s[12] = d(", format: ", -1)),
116
116
  o("code", null, u(e.schema.format), 1)
117
117
  ])) : i("", !0),
118
118
  e.schema.enum ? (n(), t("span", U, [
119
- s[13] || (s[13] = d(", possible values: ")),
119
+ s[13] || (s[13] = d(", possible values: ", -1)),
120
120
  o("code", null, u(e.schema.enum.map((l) => JSON.stringify(l)).join(", ")), 1)
121
121
  ])) : i("", !0),
122
122
  e.schema.default !== void 0 ? (n(), t("span", w, [
123
- s[14] || (s[14] = d(", default: ")),
123
+ s[14] || (s[14] = d(", default: ", -1)),
124
124
  o("code", null, u(JSON.stringify(e.schema.default)), 1)
125
125
  ])) : i("", !0),
126
126
  e.schema.description ? (n(), t("span", z, " — " + u(e.schema.description), 1)) : i("", !0)
@@ -1,6 +1,6 @@
1
1
  import { normalize as n, dereference as i } from "@scalar/openapi-parser";
2
- import { upgrade as a } from "@scalar/openapi-upgrader";
3
- import { minify as p } from "html-minifier-terser";
2
+ import { upgrade as p } from "@scalar/openapi-upgrader";
3
+ import { minify as a } from "html-minifier-terser";
4
4
  import s from "rehype-parse";
5
5
  import u from "rehype-remark";
6
6
  import c from "rehype-sanitize";
@@ -10,11 +10,11 @@ import { unified as y } from "unified";
10
10
  import { createSSRApp as d } from "vue";
11
11
  import { renderToString as g } from "vue/server-renderer";
12
12
  import h from "./components/MarkdownReference.vue.js";
13
- async function w(e) {
14
- const r = a(n(e), "3.1"), { schema: t } = await i(r), o = d(h, {
13
+ async function S(e) {
14
+ const r = p(n(e), "3.1"), { schema: t } = i(r), o = d(h, {
15
15
  content: t
16
16
  }), m = await g(o);
17
- return p(m, {
17
+ return a(m, {
18
18
  removeComments: !0,
19
19
  removeEmptyElements: !0,
20
20
  collapseWhitespace: !0,
@@ -27,16 +27,16 @@ async function w(e) {
27
27
  });
28
28
  }
29
29
  async function R(e) {
30
- return S(await w(e));
30
+ return k(await S(e));
31
31
  }
32
- async function S(e) {
32
+ async function k(e) {
33
33
  const r = await y().use(s, { fragment: !0 }).use(f).use(c).use(u).use(l, {
34
34
  bullet: "-"
35
35
  }).process(e);
36
36
  return String(r);
37
37
  }
38
38
  export {
39
- w as createHtmlFromOpenApi,
39
+ S as createHtmlFromOpenApi,
40
40
  R as createMarkdownFromOpenApi,
41
- S as markdownFromHtml
41
+ k as markdownFromHtml
42
42
  };
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "llm",
17
17
  "swagger"
18
18
  ],
19
- "version": "0.2.45",
19
+ "version": "0.3.1",
20
20
  "engines": {
21
21
  "node": ">=20"
22
22
  },
@@ -53,25 +53,25 @@
53
53
  "remark-gfm": "^4.0.0",
54
54
  "remark-stringify": "^11.0.0",
55
55
  "unified": "^11.0.4",
56
- "vue": "^3.5.17",
57
- "@scalar/components": "0.15.1",
58
- "@scalar/helpers": "0.0.12",
59
- "@scalar/oas-utils": "0.5.2",
60
- "@scalar/openapi-parser": "0.22.3",
61
- "@scalar/openapi-upgrader": "0.1.3",
62
- "@scalar/openapi-types": "0.5.0",
63
- "@scalar/snippetz": "0.5.1",
64
- "@scalar/types": "0.3.2"
56
+ "vue": "^3.5.21",
57
+ "@scalar/components": "0.16.1",
58
+ "@scalar/helpers": "0.0.13",
59
+ "@scalar/oas-utils": "0.6.1",
60
+ "@scalar/openapi-types": "0.5.1",
61
+ "@scalar/snippetz": "0.5.2",
62
+ "@scalar/openapi-parser": "0.23.0",
63
+ "@scalar/types": "0.4.0",
64
+ "@scalar/openapi-upgrader": "0.1.4"
65
65
  },
66
66
  "devDependencies": {
67
- "@hono/node-server": "^1.11.0",
67
+ "@hono/node-server": "1.19.5",
68
68
  "@types/html-minifier-terser": "^7.0.2",
69
69
  "@vitejs/plugin-vue": "6.0.1",
70
- "@vue/test-utils": "^2.4.1",
71
- "hono": "4.9.7",
72
- "vite": "7.1.5",
73
- "vue": "^3.5.17",
74
- "@scalar/build-tooling": "0.2.7",
70
+ "@vue/test-utils": "2.4.6",
71
+ "hono": "4.10.2",
72
+ "vite": "7.1.11",
73
+ "vue": "^3.5.21",
74
+ "@scalar/build-tooling": "0.2.8",
75
75
  "@scalar/galaxy": "0.5.9"
76
76
  },
77
77
  "scripts": {