undocs 0.2.21 → 0.2.22

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.
Files changed (64) hide show
  1. package/README.md +8 -2
  2. package/app/{app.vue → base/app.vue} +11 -0
  3. package/app/{components → base/components}/AppHeader.vue +3 -3
  4. package/app/{components → base/components}/SocialButtons.vue +2 -1
  5. package/app/{components → base/components}/global/Alert.vue +4 -4
  6. package/app/{components → base/components}/global/ProseCodeIcon.vue +1 -0
  7. package/app/{components → base/components}/global/ReadMore.vue +1 -0
  8. package/app/{components → base/components}/global/Steps.vue +1 -1
  9. package/app/{layouts → base/layouts}/docs.vue +1 -1
  10. package/app/{modules → base/modules}/content/runtime/landing.mjs +0 -2
  11. package/app/base/nuxt.config.ts +76 -0
  12. package/app/{pages → base/pages}/[...slug].vue +2 -3
  13. package/app/{pages → base/pages}/index.vue +2 -0
  14. package/app/{server → base/server}/plugins/content.ts +96 -0
  15. package/app/base/tailwind.config.ts +27 -0
  16. package/app/{utils → base/utils}/seo.ts +1 -1
  17. package/app/nuxt.config.ts +1 -74
  18. package/app/{.unjs → unjs}/components/OrgLogo.vue +3 -3
  19. package/cli/setup.mjs +2 -2
  20. package/package.json +31 -28
  21. package/schema/config.d.ts +1 -1
  22. package/schema/config.schema.ts +1 -1
  23. package/app/tailwind.config.ts +0 -48
  24. /package/app/{app.config.ts → base/app.config.ts} +0 -0
  25. /package/app/{components → base/components}/AppFooter.vue +0 -0
  26. /package/app/{components → base/components}/AppFooterNotesBase.vue +0 -0
  27. /package/app/{components → base/components}/DocsCollapsable.vue +0 -0
  28. /package/app/{components → base/components}/LandingBackground.vue +0 -0
  29. /package/app/{components → base/components}/OrgLogoBase.vue +0 -0
  30. /package/app/{components → base/components}/color-picker/ColorPicker.vue +0 -0
  31. /package/app/{components → base/components}/color-picker/ColorPickerPill.vue +0 -0
  32. /package/app/{components → base/components}/global/Caution.vue +0 -0
  33. /package/app/{components → base/components}/global/Important.vue +0 -0
  34. /package/app/{components → base/components}/global/Note.vue +0 -0
  35. /package/app/{components → base/components}/global/Pm-Install.vue +0 -0
  36. /package/app/{components → base/components}/global/Pm-Run.vue +0 -0
  37. /package/app/{components → base/components}/global/Pm-x.vue +0 -0
  38. /package/app/{components → base/components}/global/Tip.vue +0 -0
  39. /package/app/{components → base/components}/global/Warning.vue +0 -0
  40. /package/app/{error.vue → base/error.vue} +0 -0
  41. /package/app/{modules → base/modules}/content/index.ts +0 -0
  42. /package/app/{modules → base/modules}/content/runtime/nitro.mjs +0 -0
  43. /package/app/{modules → base/modules}/content/runtime/unstorage.mjs +0 -0
  44. /package/app/{modules → base/modules}/og-image/index.ts +0 -0
  45. /package/app/{modules → base/modules}/og-image/runtime/assets/nunito.ttf +0 -0
  46. /package/app/{modules → base/modules}/og-image/runtime/assets/template.svg +0 -0
  47. /package/app/{modules → base/modules}/og-image/runtime/handler.ts +0 -0
  48. /package/app/{modules → base/modules}/theme.ts +0 -0
  49. /package/app/{public → base/public}/fonts/nunito-latin-400-italic-Daxm5UzsKq.woff2 +0 -0
  50. /package/app/{public → base/public}/fonts/nunito-latin-400-normal-nPlM7mbm0W.woff2 +0 -0
  51. /package/app/{public → base/public}/fonts/nunito-latin-500-italic-IlVtAGJo00.woff2 +0 -0
  52. /package/app/{public → base/public}/fonts/nunito-latin-500-normal-zkQUyo5lvz.woff2 +0 -0
  53. /package/app/{public → base/public}/fonts/nunito-latin-600-normal-IMulf98v4m.woff2 +0 -0
  54. /package/app/{public → base/public}/fonts/nunito-latin-700-normal-irPkzGnT0r.woff2 +0 -0
  55. /package/app/{server → base/server}/api/search.json.get.ts +0 -0
  56. /package/app/{utils → base/utils}/nav.ts +0 -0
  57. /package/app/{utils → base/utils}/numbers.ts +0 -0
  58. /package/app/{utils → base/utils}/package-manager.ts +0 -0
  59. /package/app/{utils → base/utils}/title.ts +0 -0
  60. /package/app/{.unjs → unjs}/app.config.ts +0 -0
  61. /package/app/{.unjs → unjs}/components/AppFooterNotes.vue +0 -0
  62. /package/app/{.unjs → unjs}/nuxt.config.ts +0 -0
  63. /package/app/{.unjs → unjs}/public/icon.svg +0 -0
  64. /package/app/{.unjs → unjs}/public/unjs.svg +0 -0
package/README.md CHANGED
@@ -2,9 +2,15 @@
2
2
 
3
3
  Minimal Documentation Theme and CLI for shared usage across UnJS projects.
4
4
 
5
- Made with [Nuxt](https://nuxt.com/), [Nuxt Content](https://content.nuxt.com) and [Nuxt UI Pro](https://ui.nuxt.com/pro).
5
+ <!-- automd:file src="./docs/.partials/warn.md" -->
6
6
 
7
- 👉 Docs: https://undocs.pages.dev/
7
+ > [!IMPORTANT]
8
+ > Undocs is currently intended for UnJS docs only and is not fully customizable yet. <br>
9
+ > Contributions are more than welcome but please consider that this project is not ready yet to be used. <br>
10
+ > Make sure to use [Bun](https://bun.sh/) and [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) for Windows.
11
+ > We don't guarantee stability yet and it is expected that it doesn't work time to time.
12
+
13
+ <!-- /automd -->
8
14
 
9
15
  ## Contribution
10
16
 
@@ -12,10 +12,21 @@ const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
12
12
 
13
13
  const twitterSite = appConfig.docs.socials?.twitter || appConfig.docs.socials?.x || undefined
14
14
 
15
+ const browserTabIcon = appConfig.docs?.logo || undefined
16
+
15
17
  useSeoMeta({
16
18
  twitterSite: twitterSite ? `@${twitterSite}` : undefined,
17
19
  })
18
20
 
21
+ useHead({
22
+ link: [
23
+ {
24
+ rel: 'icon',
25
+ href: browserTabIcon,
26
+ },
27
+ ],
28
+ })
29
+
19
30
  provide('navigation', navigation)
20
31
  </script>
21
32
 
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
- import type { NavItem } from '@nuxt/content/dist/runtime/types'
2
+ // import type { NavItem } from '@nuxt/content/dist/runtime/types'
3
3
 
4
- const navigation = inject<NavItem[]>('navigation', [])
4
+ // const navigation = inject<NavItem[]>('navigation', [])
5
5
 
6
6
  const appConfig = useAppConfig()
7
7
 
@@ -41,7 +41,7 @@ const headerLinks = computed(() => {
41
41
  </template> -->
42
42
 
43
43
  <template #right>
44
- <UHeaderLinks :links="headerLinks" class="hidden md:flex mr-4" v-if="docsNav.links.length > 1" />
44
+ <UHeaderLinks v-if="docsNav.links.length > 1" :links="headerLinks" class="hidden md:flex mr-4" />
45
45
 
46
46
  <UTooltip class="lg:hidden" text="Search" :shortcuts="[metaSymbol, 'K']">
47
47
  <UContentSearchButton :label="null" />
@@ -5,6 +5,7 @@ const props = defineProps({
5
5
  socials: {
6
6
  type: Array,
7
7
  required: false,
8
+ default: () => ['github', 'twitter', 'discord'],
8
9
  },
9
10
  })
10
11
 
@@ -40,5 +41,5 @@ const socialLinks = computed(() => {
40
41
  rel="noopener noreferrer"
41
42
  color="gray"
42
43
  variant="ghost"
43
- ></UButton>
44
+ />
44
45
  </template>
@@ -11,10 +11,10 @@
11
11
  import type uiColors from '#ui-colors'
12
12
 
13
13
  const props = defineProps({
14
- title: { type: String },
15
- icon: { type: String },
16
- color: { type: String as PropType<(typeof uiColors)[number]> },
17
- to: { type: String },
14
+ title: { type: String, default: '' },
15
+ icon: { type: String, default: '' },
16
+ color: { type: String as PropType<(typeof uiColors)[number]>, default: '' },
17
+ to: { type: String, default: '' },
18
18
  })
19
19
 
20
20
  const target = computed(() => (props.to?.startsWith('https://') ? '_blank' : ''))
@@ -75,6 +75,7 @@ const icon = computed(() => {
75
75
  if (ui.value[extName]) {
76
76
  return ui.value[extName]
77
77
  }
78
+ return ''
78
79
  })
79
80
  </script>
80
81
 
@@ -17,6 +17,7 @@ const props = defineProps({
17
17
  to: {
18
18
  type: String,
19
19
  required: false,
20
+ default: '',
20
21
  },
21
22
  title: {
22
23
  type: String,
@@ -25,7 +25,7 @@ defineOptions({
25
25
  :class="{
26
26
  hidden: idx === steps.length - 1,
27
27
  }"
28
- ></div>
28
+ />
29
29
  <div class="absolute ml-[-14px] py-2">
30
30
  <UBadge variant="soft" size="lg" color="gray">
31
31
  {{ step.idx }}
@@ -7,7 +7,7 @@ const docsNav = useDocsNav()
7
7
  <UPage>
8
8
  <template #left>
9
9
  <UAside :links="docsNav.links">
10
- <UDivider type="dashed" class="mb-6" v-if="docsNav.activeLinks?.length" />
10
+ <UDivider v-if="docsNav.activeLinks?.length" type="dashed" class="mb-6" />
11
11
  <UNavigationTree :links="docsNav.activeLinks" />
12
12
  </UAside>
13
13
  </template>
@@ -21,7 +21,6 @@ export function genLanding(docsConfig) {
21
21
  label: 'Get Started',
22
22
  icon: 'i-heroicons-rocket-launch',
23
23
  to: '/guide',
24
- size: 'lg',
25
24
  order: 0,
26
25
  },
27
26
  github: {
@@ -30,7 +29,6 @@ export function genLanding(docsConfig) {
30
29
  color: 'white',
31
30
  to: `https://github.com/${docsConfig.github}`,
32
31
  target: '_blank',
33
- size: 'lg',
34
32
  order: 100,
35
33
  },
36
34
  },
@@ -0,0 +1,76 @@
1
+ import { defineNuxtConfig } from 'nuxt/config'
2
+
3
+ // Flag enabled when developing docs theme
4
+ const dev = !!process.env.NUXT_DOCS_DEV
5
+
6
+ // SSR enabled only for production build to save life (at least until our stack will be little bit lighter)
7
+ const isProd = process.env.NODE_ENV === 'production'
8
+ const ssr = Boolean(isProd || process.env.NUXT_DOCS_SSR)
9
+
10
+ export default defineNuxtConfig({
11
+ ssr,
12
+ modules: ['@nuxt/fonts', '@nuxt/content', isProd && '@nuxtjs/plausible', '@nuxt/ui'],
13
+ ui: {},
14
+ fonts: {
15
+ families: [{ name: 'Nunito', provider: 'local' }],
16
+ defaults: {
17
+ weights: [400, 500, 600, 700],
18
+ },
19
+ },
20
+ app: {
21
+ head: {
22
+ htmlAttrs: {
23
+ dir: 'ltr',
24
+ class: 'scroll-smooth',
25
+ },
26
+ templateParams: {
27
+ separator: '·',
28
+ },
29
+ },
30
+ },
31
+ content: {
32
+ // .* and -* are ignored by default
33
+ ignores: [
34
+ 'package.json',
35
+ 'dist',
36
+ 'package-lock.json',
37
+ 'yarn.lock',
38
+ 'bun.lockb',
39
+ 'node_modules',
40
+ 'pnpm-lock.yaml',
41
+ 'pnpm-workspace.yaml',
42
+ 'docs.config.json',
43
+ '\\.(js|mjs|ts)$',
44
+ ],
45
+ highlight: {
46
+ langs: ['json5', 'jsonc', 'toml', 'yaml', 'html', 'sh', 'shell', 'bash', 'mdc', 'markdown', 'md'],
47
+ },
48
+ },
49
+ routeRules: {
50
+ '/api/search.json': { prerender: true },
51
+ },
52
+ nitro: {
53
+ prerender: {
54
+ autoSubfolderIndex: false,
55
+ failOnError: false,
56
+ },
57
+ },
58
+ devtools: {
59
+ enabled: dev,
60
+ },
61
+ uiPro: {
62
+ license: process.env.NUXT_UI_PRO_LICENSE || 'oss',
63
+ },
64
+ tailwindcss: {
65
+ viewer: dev,
66
+ quiet: !dev,
67
+ },
68
+ typescript: {
69
+ strict: false,
70
+ includeWorkspace: true,
71
+ },
72
+ colorMode: {
73
+ preference: 'dark',
74
+ fallback: 'dark',
75
+ },
76
+ })
@@ -51,18 +51,17 @@ onMounted(() => {
51
51
 
52
52
  <template>
53
53
  <UPage v-if="page">
54
- <UPageHeader :title="page.title" :description="page.description" :links="page.links" :headline="headline">
55
- </UPageHeader>
54
+ <UPageHeader :title="page.title" :description="page.description" :links="page.links" :headline="headline" />
56
55
 
57
56
  <div
58
57
  v-if="tocLinks.length > 1"
59
58
  class="float-right mt-4 top-[calc(var(--header-height)_+_0.5rem)] z-10 flex justify-end sticky"
60
59
  >
61
60
  <UDropdown
61
+ v-model:open="tocOpen"
62
62
  :items="[[{ label: 'Return to top', click: scrollToTop }], tocLinks]"
63
63
  :popper="{ placement: 'bottom-end' }"
64
64
  :mode="isMobile ? 'click' : 'hover'"
65
- v-model:open="tocOpen"
66
65
  >
67
66
  <UButton
68
67
  color="white"
@@ -34,6 +34,7 @@ function nornalizeHeroLinks(links: LandingConfig['heroLinks']) {
34
34
  return {
35
35
  label: titleCase(key),
36
36
  order,
37
+ size: 'lg',
37
38
  target: link.to?.startsWith('https') ? '_blank' : undefined,
38
39
  ...link,
39
40
  }
@@ -83,6 +84,7 @@ const hero = computed(() => {
83
84
  <ULandingCard v-for="(item, index) of page.features" :key="index" v-bind="item" />
84
85
  </div>
85
86
  </ULandingHero>
87
+
86
88
  <template v-if="page.features?.length > 0 && !hero.withFeatures">
87
89
  <ULandingSection :title="page.featuresTitle">
88
90
  <UPageGrid>
@@ -13,6 +13,7 @@ export default defineNitroPlugin((nitroApp) => {
13
13
  transformGithubAlert(node)
14
14
  transformStepsList(node)
15
15
  transformCodeGroups(idx, file.body?.children)
16
+ transformJSDocs(idx, file.body?.children)
16
17
  }
17
18
  })
18
19
  })
@@ -177,6 +178,97 @@ function _isNamedCodeBlock(children: ContentNode): boolean {
177
178
  return children?.tag === 'pre' && children?.children?.[0]?.tag === 'code' && children?.props?.filename
178
179
  }
179
180
 
181
+ // --- transform automd jsdocs ---
182
+
183
+ function transformJSDocs(currChildIdx: number, children: ContentNode[] = []) {
184
+ if (!children?.length || !_isJSDocBlock(children[currChildIdx])) {
185
+ return
186
+ }
187
+
188
+ const fields: ContentNode[] = []
189
+
190
+ const generateFields = (i: number): ContentNode => {
191
+ const name = _parseJSDocName(children[i])
192
+ const type = _parseJSDocType(children[i + 1])
193
+
194
+ const props: {
195
+ name: string
196
+ type: string | false
197
+ } = {
198
+ name,
199
+ type,
200
+ }
201
+
202
+ const content: ContentNode[] = []
203
+
204
+ i++
205
+
206
+ if (type !== '') {
207
+ children[i] = _emptyASTNode()
208
+ i++
209
+ }
210
+
211
+ while (i < children.length && children[i].tag !== 'h3' && children[i].tag === 'p') {
212
+ content.push(children[i])
213
+ children[i] = _emptyASTNode()
214
+ i++
215
+ }
216
+
217
+ return {
218
+ type: 'element',
219
+ tag: 'field',
220
+ props,
221
+ children: content,
222
+ }
223
+ }
224
+
225
+ // Go through we find the correct match for all h3
226
+ for (let i = currChildIdx; i < children.length; i++) {
227
+ // Make sure it's a JSDoc block before generating fields
228
+ if (_isJSDocBlock(children[i])) {
229
+ const field = generateFields(i)
230
+ // Double check if has description or a type to avoid empty fields
231
+ if ((field?.children || [])?.length > 0 || field?.props?.type !== '') {
232
+ fields.push(field)
233
+ } else {
234
+ // set blank text node to avoid empty text nodes in the markdown AST
235
+ children[i] = _emptyASTNode()
236
+ }
237
+ }
238
+ }
239
+
240
+ // If no fields were generated, return early
241
+ if (fields.length <= 0) {
242
+ return
243
+ }
244
+
245
+ // Replace current children with the new field group
246
+ children[currChildIdx] = {
247
+ type: 'element',
248
+ tag: 'field-group',
249
+ children: [...fields],
250
+ }
251
+ }
252
+
253
+ function _isJSDocBlock(children: ContentNode): boolean {
254
+ return (
255
+ children?.tag === 'h3' && children?.children?.[0]?.tag === 'code' && children?.children?.[0]?.type === 'element'
256
+ )
257
+ }
258
+
259
+ function _parseJSDocName(node: ContentNode): string {
260
+ // Code block || id prop || empty string
261
+ return node.children?.[0]?.children?.[0]?.value || node?.props?.id || ''
262
+ }
263
+ function _parseJSDocType(node: ContentNode): string {
264
+ const hasType = !!node?.children?.[0]?.children?.[0]?.children?.[0]?.value
265
+ if (!hasType) {
266
+ return ''
267
+ }
268
+
269
+ return node?.children?.[0]?.children?.[2]?.children?.[0]?.value || ''
270
+ }
271
+
180
272
  // --- internal utils ---
181
273
 
182
274
  function _getTextContents(children: ContentNode[] = []): string {
@@ -190,6 +282,10 @@ function _getTextContents(children: ContentNode[] = []): string {
190
282
  .join('')
191
283
  }
192
284
 
285
+ function _emptyASTNode() {
286
+ return { type: 'text', value: '' }
287
+ }
288
+
193
289
  // --- types ---
194
290
 
195
291
  // TODO: @nuxt/content runtimes seems both not well typed and also crashes my TS server or might be doing it wrong.
@@ -0,0 +1,27 @@
1
+ import type { Config } from 'tailwindcss'
2
+ import defaultTheme from 'tailwindcss/defaultTheme'
3
+
4
+ export default <Partial<Config>>{
5
+ theme: {
6
+ extend: {
7
+ fontFamily: {
8
+ sans: ['Nunito', 'sans-serif', ...defaultTheme.fontFamily.sans],
9
+ },
10
+ colors: {
11
+ yellow: {
12
+ 50: '#FEFDF7',
13
+ 100: '#FDFCEF',
14
+ 200: '#FAF6D6',
15
+ 300: '#F7F1BD',
16
+ 400: '#F2E78C',
17
+ 500: '#ECDC5A',
18
+ 600: '#D4C651',
19
+ 700: '#8E8436',
20
+ 800: '#6A6329',
21
+ 900: '#47421B',
22
+ 950: '#2F2C12',
23
+ },
24
+ },
25
+ },
26
+ },
27
+ }
@@ -5,7 +5,7 @@ export interface PageMeta {
5
5
  }
6
6
 
7
7
  export function usePageSEO(page: PageMeta) {
8
- if (!process.server && !import.meta.dev) {
8
+ if (!import.meta.server && !import.meta.dev) {
9
9
  return
10
10
  }
11
11
 
@@ -1,78 +1,5 @@
1
1
  import { defineNuxtConfig } from 'nuxt/config'
2
2
 
3
- // Flag enabled when developing docs theme
4
- const dev = !!process.env.NUXT_DOCS_DEV
5
-
6
- // SSR enabled only for production build to save life (at least until our stack will be little bit lighter)
7
- const isProd = process.env.NODE_ENV === 'production'
8
- const ssr = Boolean(isProd || process.env.NUXT_DOCS_SSR)
9
-
10
3
  export default defineNuxtConfig({
11
- ssr,
12
- modules: ['@nuxt/fonts', '@nuxt/content', isProd && '@nuxtjs/plausible', '@nuxt/ui'],
13
- ui: {
14
- icons: [],
15
- },
16
- fonts: {
17
- families: [{ name: 'Nunito', provider: 'local' }],
18
- defaults: {
19
- weights: [400, 500, 600, 700],
20
- },
21
- },
22
- app: {
23
- head: {
24
- htmlAttrs: {
25
- dir: 'ltr',
26
- class: 'scroll-smooth',
27
- },
28
- templateParams: {
29
- separator: '·',
30
- },
31
- },
32
- },
33
- content: {
34
- // .* and -* are ignored by default
35
- ignores: [
36
- 'package.json',
37
- 'dist',
38
- 'package-lock.json',
39
- 'yarn.lock',
40
- 'bun.lockb',
41
- 'node_modules',
42
- 'pnpm-lock.yaml',
43
- 'pnpm-workspace.yaml',
44
- 'docs.config.json',
45
- '\\.(js|mjs|ts)$',
46
- ],
47
- highlight: {
48
- langs: ['json5', 'jsonc', 'toml', 'yaml', 'html', 'sh', 'shell', 'bash', 'mdc', 'markdown', 'md'],
49
- },
50
- },
51
- routeRules: {
52
- '/api/search.json': { prerender: true },
53
- },
54
- nitro: {
55
- prerender: {
56
- autoSubfolderIndex: false,
57
- failOnError: false,
58
- },
59
- },
60
- devtools: {
61
- enabled: dev,
62
- },
63
- uiPro: {
64
- license: process.env.NUXT_UI_PRO_LICENSE || 'oss',
65
- },
66
- tailwindcss: {
67
- viewer: dev,
68
- quiet: !dev,
69
- },
70
- typescript: {
71
- strict: false,
72
- includeWorkspace: true,
73
- },
74
- colorMode: {
75
- preference: 'dark',
76
- fallback: 'dark',
77
- },
4
+ extends: ['./unjs', './base'],
78
5
  })
@@ -4,15 +4,15 @@
4
4
  <path
5
5
  d="M69.8123 70.0485C46.5425 70.0485 23.2983 70.0485 0.0540217 70.0485C0.0521683 70.0422 0.0486903 70.036 0.0486903 70.0298C0.0484606 46.7047 0.0484619 23.3797 0.0484619 0.0515747C23.3795 0.0515747 46.7106 0.0515747 70.0451 0.0515747C70.0451 23.3793 70.0451 46.7101 70.0451 70.0485C69.9783 70.0485 69.9081 70.0485 69.8123 70.0485ZM57.7765 45.794C57.6648 45.6665 57.5592 45.5332 57.4406 45.4125C56.1262 44.0761 54.4711 43.7975 52.709 43.9566C51.1807 44.0947 49.8716 44.7674 48.74 45.7939C48.6789 45.8493 48.6121 45.8986 48.524 45.9702C48.524 45.8272 48.5298 45.7228 48.5231 45.6192C48.4902 45.1114 48.2516 44.7265 47.7999 44.4951C47.3572 44.2684 46.9046 44.29 46.487 44.5568C46.0227 44.8534 45.8642 45.3094 45.8647 45.8453C45.868 49.8601 45.8665 53.8748 45.8665 57.8896C45.8665 58.14 45.8615 58.3906 45.8676 58.6409C45.8831 59.2854 46.2248 59.7959 46.7437 59.9593C47.6541 60.2459 48.5225 59.6147 48.5238 58.6545C48.5274 55.8999 48.5267 53.1453 48.524 50.3907C48.5233 49.6149 48.7195 48.9035 49.2143 48.2979C50.3673 46.8867 51.8603 46.2907 53.6664 46.4964C54.546 46.5967 55.2568 47.0049 55.7444 47.7588C56.2019 48.4663 56.3586 49.2649 56.3649 50.0872C56.3821 52.3569 56.3755 54.6268 56.3779 56.8966C56.3786 57.5186 56.3683 58.1408 56.3804 58.7626C56.3994 59.7352 57.4448 60.3372 58.3009 59.8751C58.8453 59.5813 59.0387 59.1008 59.038 58.5074C59.0347 55.9305 59.0422 53.3536 59.0324 50.7767C59.0301 50.1648 59.0095 49.549 58.9384 48.9419C58.8066 47.8161 58.494 46.746 57.7765 45.794ZM41.0198 44.3552C40.8599 44.3666 40.6934 44.3533 40.5412 44.3937C39.9072 44.5624 39.5577 45.0664 39.5573 45.7984C39.5557 48.4239 39.5611 51.0495 39.5523 53.675C39.5508 54.1091 39.5281 54.5498 39.4515 54.9759C39.2493 56.1006 38.6462 56.943 37.5641 57.3698C36.5098 57.7856 35.4244 57.8 34.3328 57.5037C33.5048 57.279 32.87 56.8039 32.4554 56.0491C32.1582 55.508 32.0135 54.918 32.0027 54.3079C31.981 53.0723 31.9884 51.8361 31.987 50.6001C31.9852 49.0006 31.9891 47.401 31.9854 45.8015C31.9836 45.0138 31.4604 44.3951 30.7759 44.3551C29.928 44.3055 29.3302 44.8829 29.3292 45.7669C29.3263 48.4651 29.3228 51.1633 29.3311 53.8615C29.3341 54.8261 29.4377 55.7775 29.805 56.6855C30.5016 58.4082 31.8017 59.4481 33.546 59.9542C34.6439 60.2727 35.7748 60.292 36.9079 60.1587C37.7833 60.0557 38.6202 59.8168 39.3826 59.3737C41.1831 58.3274 42.0991 56.7004 42.1572 54.6688C42.2424 51.6903 42.2076 48.7081 42.2108 45.7275C42.2117 44.9795 41.7718 44.4833 41.0198 44.3552Z"
6
6
  fill="currentColor"
7
- ></path>
7
+ />
8
8
  <path
9
9
  d="M57.786 45.8084C58.494 46.746 58.8067 47.8161 58.9384 48.9419C59.0095 49.5491 59.0301 50.1648 59.0325 50.7768C59.0423 53.3536 59.0348 55.9305 59.038 58.5074C59.0388 59.1008 58.8454 59.5813 58.3009 59.8752C57.4449 60.3372 56.3994 59.7352 56.3805 58.7626C56.3683 58.1408 56.3786 57.5186 56.378 56.8966C56.3755 54.6268 56.3821 52.3569 56.3649 50.0872C56.3587 49.2649 56.202 48.4663 55.7444 47.7588C55.2569 47.0049 54.5461 46.5967 53.6664 46.4965C51.8604 46.2907 50.3673 46.8867 49.2143 48.2979C48.7196 48.9036 48.5233 49.6149 48.5241 50.3907C48.5267 53.1453 48.5274 55.8999 48.5238 58.6545C48.5226 59.6147 47.6542 60.2459 46.7438 59.9593C46.2248 59.7959 45.8832 59.2854 45.8676 58.6409C45.8616 58.3906 45.8666 58.1401 45.8666 57.8896C45.8666 53.8749 45.8681 49.8601 45.8647 45.8453C45.8643 45.3094 46.0228 44.8534 46.487 44.5568C46.9047 44.29 47.3573 44.2684 47.7999 44.4951C48.2516 44.7265 48.4902 45.1114 48.5231 45.6192C48.5298 45.7228 48.5241 45.8272 48.5241 45.9702C48.6122 45.8986 48.6789 45.8493 48.74 45.7939C49.8716 44.7674 51.1808 44.0947 52.709 43.9567C54.4711 43.7975 56.1263 44.0761 57.4406 45.4126C57.5592 45.5332 57.6648 45.6666 57.786 45.8084Z"
10
10
  class="logo-text"
11
- ></path>
11
+ />
12
12
  <path
13
13
  d="M41.0414 44.3563C41.7718 44.4833 42.2117 44.9795 42.2108 45.7275C42.2076 48.7082 42.2424 51.6903 42.1572 54.6688C42.0991 56.7005 41.1831 58.3274 39.3826 59.3737C38.6202 59.8168 37.7833 60.0557 36.9079 60.1587C35.7748 60.292 34.6439 60.2727 33.546 59.9542C31.8017 59.4481 30.5016 58.4082 29.805 56.6856C29.4377 55.7775 29.3341 54.8262 29.3311 53.8615C29.3228 51.1633 29.3263 48.4651 29.3292 45.7669C29.3302 44.8829 29.928 44.3055 30.7759 44.3551C31.4604 44.3952 31.9836 45.0138 31.9854 45.8015C31.9891 47.401 31.9852 49.0006 31.987 50.6001C31.9884 51.8361 31.981 53.0723 32.0027 54.3079C32.0135 54.918 32.1582 55.5081 32.4554 56.0491C32.87 56.804 33.5048 57.279 34.3328 57.5038C35.4243 57.8001 36.5098 57.7857 37.5641 57.3698C38.6462 56.9431 39.2493 56.1006 39.4515 54.976C39.5281 54.5498 39.5508 54.1092 39.5523 53.675C39.5611 51.0495 39.5557 48.424 39.5573 45.7985C39.5577 45.0665 39.9072 44.5624 40.5412 44.3938C40.6934 44.3533 40.8599 44.3667 41.0414 44.3563Z"
14
14
  class="logo-text"
15
- ></path>
15
+ />
16
16
  </svg>
17
17
  </template>
18
18
 
package/cli/setup.mjs CHANGED
@@ -3,7 +3,6 @@ import { resolve } from 'node:path'
3
3
  import { loadConfig, watchConfig } from 'c12'
4
4
 
5
5
  const appDir = fileURLToPath(new URL('../app', import.meta.url))
6
- const appDirUnjs = fileURLToPath(new URL('../app/.unjs', import.meta.url))
7
6
 
8
7
  const pkgDir = fileURLToPath(new URL('..', import.meta.url))
9
8
 
@@ -29,9 +28,10 @@ export async function setupDocs(docsDir, opts = {}) {
29
28
 
30
29
  // Prepare loadNuxt overrides
31
30
  const nuxtConfig = {
31
+ compatibilityDate: '2024-08-16',
32
32
  rootDir: resolve(docsDir, '.docs'),
33
33
  srcDir: resolve(docsDir, '.docs'),
34
- extends: [...(opts.extends || []), appDirUnjs, appDir, '@nuxt/ui-pro'],
34
+ extends: [...(opts.extends || []), appDir, '@nuxt/ui-pro'],
35
35
  modulesDir: [resolve(pkgDir, 'node_modules'), resolve(docsDir, 'node_modules')],
36
36
  build: {
37
37
  transpile: [appDir],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undocs",
3
- "version": "0.2.21",
3
+ "version": "0.2.22",
4
4
  "repository": "unjs/undocs",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,8 +19,8 @@
19
19
  "dev": "bun run docs:dev",
20
20
  "docs:build": "bun run undocs build docs",
21
21
  "docs:dev": "NUXT_DOCS_DEV=1 bun run undocs dev docs",
22
- "lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c app cli schema",
23
- "lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c -w app cli schema",
22
+ "lint": "eslint --cache . && prettier -c app cli schema",
23
+ "lint:fix": "eslint --cache . --fix && prettier -c -w app cli schema",
24
24
  "prepack": "bun run build",
25
25
  "profile:0x": "bunx 0x -o cli/main.mjs dev docs",
26
26
  "profile:0x-kernel": "bun run profile:0x --kernel-tracing",
@@ -30,41 +30,44 @@
30
30
  "undocs": "./cli/main.mjs"
31
31
  },
32
32
  "dependencies": {
33
- "@headlessui/vue": "^1.7.19",
34
- "@nuxt/content": "^2.12.1",
35
- "@nuxt/fonts": "^0.5.1",
36
- "@nuxt/ui-pro": "^1.1.0",
37
- "@nuxtjs/plausible": "^0.2.4",
38
- "@nuxtjs/tailwindcss": "^6.11.4",
33
+ "@headlessui/vue": "^1.7.22",
34
+ "@iconify-json/logos": "^1.1.44",
35
+ "@iconify-json/simple-icons": "^1.1.113",
36
+ "@nuxt/content": "^2.13.2",
37
+ "@nuxt/fonts": "^0.7.2",
38
+ "@nuxt/ui-pro": "^1.4.1",
39
+ "@nuxtjs/plausible": "^1.0.2",
40
+ "@nuxtjs/tailwindcss": "^6.12.1",
39
41
  "@resvg/resvg-js": "^2.6.2",
40
- "automd": "^0.3.7",
41
- "c12": "^1.10.0",
42
+ "automd": "^0.3.8",
43
+ "c12": "^1.11.1",
42
44
  "citty": "^0.1.6",
43
45
  "consola": "^3.2.3",
44
46
  "defu": "^6.1.4",
45
47
  "is-buffer": "^2.0.5",
46
- "nuxi": "^3.11.1",
47
- "nuxt": "^3.11.1",
48
- "nitropack": "^2.9.5",
48
+ "nitropack": "^2.9.7",
49
+ "nuxi": "^3.12.0",
50
+ "nuxt": "^3.12.4",
49
51
  "nuxt-build-cache": "^0.1.1",
50
- "pkg-types": "^1.0.3",
52
+ "pkg-types": "^1.1.3",
51
53
  "scule": "^1.3.0",
52
- "tailwindcss": "^3.4.3",
54
+ "tailwindcss": "^3.4.10",
53
55
  "unctx": "^2.3.1",
54
56
  "unstorage": "^1.10.2",
55
- "vue": "^3.4.21",
56
- "vue-router": "^4.3.0"
57
+ "vue": "^3.4.38",
58
+ "vue-router": "^4.4.3"
57
59
  },
58
60
  "devDependencies": {
59
- "@nuxt/eslint-config": "^0.2.0",
60
- "@types/node": "^20.12.2",
61
+ "@nuxt/eslint-config": "^0.5.0",
62
+ "@nuxt/image": "^1.7.0",
63
+ "@types/node": "^22.3.0",
61
64
  "changelogen": "^0.5.5",
62
- "eslint": "^8.57.0",
63
- "eslint-config-unjs": "^0.2.1",
64
- "jiti": "^1.21.0",
65
- "prettier": "^3.2.5",
66
- "typescript": "^5.4.3",
67
- "vue-tsc": "^2.0.7"
65
+ "eslint": "^9.9.0",
66
+ "eslint-config-unjs": "^0.3.2",
67
+ "jiti": "^1.21.6",
68
+ "prettier": "^3.3.3",
69
+ "typescript": "^5.5.4",
70
+ "vue-tsc": "^2.0.29"
68
71
  },
69
- "packageManager": "bun@1.0.26"
70
- }
72
+ "packageManager": "bun@1.1.24"
73
+ }
@@ -7,7 +7,7 @@ export interface DocsConfig {
7
7
  github?: string
8
8
  themeColor?: string
9
9
  redirects?: Record<string, string>
10
- automd?: any
10
+ automd?: unknown
11
11
  buildCache?: boolean
12
12
  landing?:
13
13
  | false
@@ -1,4 +1,4 @@
1
- // @ts-ignore
1
+ // @ts-expect-error
2
2
  import $schema from './config.json'
3
3
 
4
4
  export default {
@@ -1,48 +0,0 @@
1
- import { resolve, join } from 'node:path'
2
- import type { Config } from 'tailwindcss'
3
- import defaultTheme from 'tailwindcss/defaultTheme'
4
-
5
- // eslint-disable-next-line unicorn/prefer-module
6
- const uiDir = resolve(require.resolve('@nuxt/ui'), '..')
7
-
8
- // eslint-disable-next-line unicorn/prefer-module
9
- const uiProDir = resolve(require.resolve('@nuxt/ui-pro'), '..')
10
-
11
- // eslint-disable-next-line unicorn/prefer-module
12
- const appDir = __dirname
13
-
14
- const contentFiles = [
15
- join(appDir, '{components,pages,layouts}/**/*.{vue,mjs,js,cjs,ts}'),
16
- join(appDir, '.unjs/{components,pages,layouts}/**/*.{vue,mjs,js,cjs,ts}'),
17
- join(uiDir, 'runtime/**/*.{vue,mjs,js,cjs,ts}'),
18
- join(uiProDir, 'components/**/*.{vue,mjs,js,cjs,ts}'),
19
- join(uiProDir, 'modules/pro/runtime/**/*.{vue,mjs,js,cjs,ts}'),
20
- ]
21
-
22
- export default <Partial<Config>>{
23
- content: {
24
- files: contentFiles,
25
- },
26
- theme: {
27
- extend: {
28
- fontFamily: {
29
- sans: ['Nunito', 'sans-serif', ...defaultTheme.fontFamily.sans],
30
- },
31
- colors: {
32
- yellow: {
33
- 50: '#FEFDF7',
34
- 100: '#FDFCEF',
35
- 200: '#FAF6D6',
36
- 300: '#F7F1BD',
37
- 400: '#F2E78C',
38
- 500: '#ECDC5A',
39
- 600: '#D4C651',
40
- 700: '#8E8436',
41
- 800: '#6A6329',
42
- 900: '#47421B',
43
- 950: '#2F2C12',
44
- },
45
- },
46
- },
47
- },
48
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes