undocs 0.2.19 → 0.2.21

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.
@@ -48,6 +48,8 @@ export default defineNuxtModule({
48
48
  Object.assign(docsConfig, newConfig)
49
49
  const nitro = useNitro()
50
50
  nitro.updateConfig({
51
+ // @ts-expect-error TODO: temp fix for nitro
52
+ experimental: {},
51
53
  runtimeConfig: {
52
54
  ...nitro.options.runtimeConfig,
53
55
  __undocs__: { docsConfig },
@@ -144,23 +144,31 @@ function transformCodeGroups(currChildIdx: number, children: ContentNode[] = [])
144
144
  return
145
145
  }
146
146
 
147
- const group: ContentNode[] = []
147
+ const group: {
148
+ idx: number
149
+ node: ContentNode
150
+ }[] = []
148
151
 
149
152
  for (let i = currChildIdx; i < children.length; i++) {
150
153
  const nextNode = children[i]
151
154
  if (!_isNamedCodeBlock(nextNode)) {
152
155
  break
153
156
  }
154
- group.push(nextNode)
155
- children[i] = { type: 'text', value: '' }
157
+ group.push({ idx: i, node: nextNode })
156
158
  }
157
159
 
158
160
  // Replace current children with the new code group if it has two or more code blocks
159
161
  if (group.length > 1) {
162
+ // Only reset children if we have more than one code block
163
+ // Code here is to avoid empty text nodes in the markdown AST
164
+ for (const { idx } of group) {
165
+ children[idx] = { type: 'text', value: '' }
166
+ }
167
+
160
168
  children[currChildIdx] = {
161
169
  type: 'element',
162
170
  tag: 'CodeGroup',
163
- children: [...group],
171
+ children: group.map((g) => g.node),
164
172
  }
165
173
  }
166
174
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undocs",
3
- "version": "0.2.19",
3
+ "version": "0.2.21",
4
4
  "repository": "unjs/undocs",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,23 +32,24 @@
32
32
  "dependencies": {
33
33
  "@headlessui/vue": "^1.7.19",
34
34
  "@nuxt/content": "^2.12.1",
35
- "@nuxt/fonts": "^0.3.0",
36
- "@nuxt/ui-pro": "^1.0.2",
35
+ "@nuxt/fonts": "^0.5.1",
36
+ "@nuxt/ui-pro": "^1.1.0",
37
37
  "@nuxtjs/plausible": "^0.2.4",
38
38
  "@nuxtjs/tailwindcss": "^6.11.4",
39
- "@resvg/resvg-js": "^2.6.0",
40
- "automd": "^0.3.6",
39
+ "@resvg/resvg-js": "^2.6.2",
40
+ "automd": "^0.3.7",
41
41
  "c12": "^1.10.0",
42
42
  "citty": "^0.1.6",
43
43
  "consola": "^3.2.3",
44
44
  "defu": "^6.1.4",
45
45
  "is-buffer": "^2.0.5",
46
- "nuxi": "^3.10.1",
47
- "nuxt": "^3.11.0",
46
+ "nuxi": "^3.11.1",
47
+ "nuxt": "^3.11.1",
48
+ "nitropack": "^2.9.5",
48
49
  "nuxt-build-cache": "^0.1.1",
49
50
  "pkg-types": "^1.0.3",
50
51
  "scule": "^1.3.0",
51
- "tailwindcss": "^3.4.1",
52
+ "tailwindcss": "^3.4.3",
52
53
  "unctx": "^2.3.1",
53
54
  "unstorage": "^1.10.2",
54
55
  "vue": "^3.4.21",
@@ -56,14 +57,14 @@
56
57
  },
57
58
  "devDependencies": {
58
59
  "@nuxt/eslint-config": "^0.2.0",
59
- "@types/node": "^20.11.28",
60
+ "@types/node": "^20.12.2",
60
61
  "changelogen": "^0.5.5",
61
62
  "eslint": "^8.57.0",
62
63
  "eslint-config-unjs": "^0.2.1",
63
64
  "jiti": "^1.21.0",
64
65
  "prettier": "^3.2.5",
65
- "typescript": "^5.4.2",
66
- "vue-tsc": "^2.0.6"
66
+ "typescript": "^5.4.3",
67
+ "vue-tsc": "^2.0.7"
67
68
  },
68
69
  "packageManager": "bun@1.0.26"
69
70
  }