diff --git a/cli/templates.mjs b/cli/templates.mjs index 540dbd7031..f50ac8f053 100644 --- a/cli/templates.mjs +++ b/cli/templates.mjs @@ -213,6 +213,10 @@ navigation.badge: Soon ## Theme :component-theme${pro ? '{pro}' : ''} + +## Changelog + +:component-changelog ` } } diff --git a/docs/app/components/content/ComponentChangelog.vue b/docs/app/components/content/ComponentChangelog.vue new file mode 100644 index 0000000000..e145453ec3 --- /dev/null +++ b/docs/app/components/content/ComponentChangelog.vue @@ -0,0 +1,55 @@ + + + diff --git a/docs/content/3.components/accordion.md b/docs/content/3.components/accordion.md index e825bd3e1b..45d60743b0 100644 --- a/docs/content/3.components/accordion.md +++ b/docs/content/3.components/accordion.md @@ -321,3 +321,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/alert.md b/docs/content/3.components/alert.md index 3a5c566412..fc11269d6e 100644 --- a/docs/content/3.components/alert.md +++ b/docs/content/3.components/alert.md @@ -299,3 +299,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/avatar-group.md b/docs/content/3.components/avatar-group.md index fc19753af7..9e5017dda0 100644 --- a/docs/content/3.components/avatar-group.md +++ b/docs/content/3.components/avatar-group.md @@ -102,3 +102,7 @@ Wrap each avatar with a [Link](/components/link) to make them clickable. ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/avatar.md b/docs/content/3.components/avatar.md index 9675c96c9c..4d5a6c529e 100644 --- a/docs/content/3.components/avatar.md +++ b/docs/content/3.components/avatar.md @@ -107,3 +107,7 @@ You can use a [Chip](/components/chip) component to display a chip around the Av ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/badge.md b/docs/content/3.components/badge.md index d3693d8e94..96a21dc956 100644 --- a/docs/content/3.components/badge.md +++ b/docs/content/3.components/badge.md @@ -145,3 +145,7 @@ slots: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/breadcrumb.md b/docs/content/3.components/breadcrumb.md index d7aa63aa7c..f852b32365 100644 --- a/docs/content/3.components/breadcrumb.md +++ b/docs/content/3.components/breadcrumb.md @@ -123,3 +123,7 @@ You can also use the `#item`, `#item-leading`, `#item-label` and `#item-trailing ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/button-group.md b/docs/content/3.components/button-group.md index beb106b5a8..ec79c3e81d 100644 --- a/docs/content/3.components/button-group.md +++ b/docs/content/3.components/button-group.md @@ -114,3 +114,7 @@ You can use a [Badge](/components/badge) within a button group. ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/button.md b/docs/content/3.components/button.md index e30afa8e23..1568287014 100644 --- a/docs/content/3.components/button.md +++ b/docs/content/3.components/button.md @@ -355,3 +355,7 @@ The `Button` component extends the `Link` component. Check out the source code o ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/calendar.md b/docs/content/3.components/calendar.md index 7e1b6cdb4f..313a704e11 100644 --- a/docs/content/3.components/calendar.md +++ b/docs/content/3.components/calendar.md @@ -270,3 +270,7 @@ name: 'calendar-date-range-picker-example' ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/card.md b/docs/content/3.components/card.md index f4d20a8bde..510d912330 100644 --- a/docs/content/3.components/card.md +++ b/docs/content/3.components/card.md @@ -66,3 +66,7 @@ slots: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/carousel.md b/docs/content/3.components/carousel.md index 862c2a0444..512ac9c865 100644 --- a/docs/content/3.components/carousel.md +++ b/docs/content/3.components/carousel.md @@ -285,3 +285,7 @@ This will give you access to the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/checkbox-group.md b/docs/content/3.components/checkbox-group.md index 5e3d9f6bf8..e74b7eecde 100644 --- a/docs/content/3.components/checkbox-group.md +++ b/docs/content/3.components/checkbox-group.md @@ -352,3 +352,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/checkbox.md b/docs/content/3.components/checkbox.md index b64bd932f6..3aa9f19fb3 100644 --- a/docs/content/3.components/checkbox.md +++ b/docs/content/3.components/checkbox.md @@ -238,3 +238,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/chip.md b/docs/content/3.components/chip.md index ca56f0b588..3f1e54c158 100644 --- a/docs/content/3.components/chip.md +++ b/docs/content/3.components/chip.md @@ -149,3 +149,7 @@ In this example, the Chip has a color per status and is displayed when the statu ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/collapsible.md b/docs/content/3.components/collapsible.md index b7853aa5b5..253ead48b7 100644 --- a/docs/content/3.components/collapsible.md +++ b/docs/content/3.components/collapsible.md @@ -146,3 +146,7 @@ name: 'collapsible-icon-example' ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/color-picker.md b/docs/content/3.components/color-picker.md index 8873db85b4..a7c0e5985e 100644 --- a/docs/content/3.components/color-picker.md +++ b/docs/content/3.components/color-picker.md @@ -165,3 +165,7 @@ name: 'color-picker-chooser-example' ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/command-palette.md b/docs/content/3.components/command-palette.md index ab078c59ea..970f6b26e8 100644 --- a/docs/content/3.components/command-palette.md +++ b/docs/content/3.components/command-palette.md @@ -938,3 +938,7 @@ You can also use the `#item`, `#item-leading`, `#item-label` and `#item-trailing ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/container.md b/docs/content/3.components/container.md index 315d9f471c..ae3fffefb4 100644 --- a/docs/content/3.components/container.md +++ b/docs/content/3.components/container.md @@ -30,3 +30,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/context-menu.md b/docs/content/3.components/context-menu.md index 764252b45d..59663dfeae 100644 --- a/docs/content/3.components/context-menu.md +++ b/docs/content/3.components/context-menu.md @@ -322,3 +322,7 @@ In this example, :kbd{value="meta"} :kbd{value="S"}, :kbd{value="shift"} :kbd{va ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/drawer.md b/docs/content/3.components/drawer.md index 77646c363a..9a7ffa53dd 100644 --- a/docs/content/3.components/drawer.md +++ b/docs/content/3.components/drawer.md @@ -379,3 +379,7 @@ name: 'drawer-command-palette-example' ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/dropdown-menu.md b/docs/content/3.components/dropdown-menu.md index c10f030167..ae66631968 100644 --- a/docs/content/3.components/dropdown-menu.md +++ b/docs/content/3.components/dropdown-menu.md @@ -399,3 +399,7 @@ In this example, :kbd{value="meta"} :kbd{value="E"}, :kbd{value="meta"} :kbd{val ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/file-upload.md b/docs/content/3.components/file-upload.md index 36f0e22d72..ce56b1615d 100644 --- a/docs/content/3.components/file-upload.md +++ b/docs/content/3.components/file-upload.md @@ -344,3 +344,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/form-field.md b/docs/content/3.components/form-field.md index fe8be0a0c5..2c6b952072 100644 --- a/docs/content/3.components/form-field.md +++ b/docs/content/3.components/form-field.md @@ -183,3 +183,7 @@ slots: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/form.md b/docs/content/3.components/form.md index b3b5882433..690c4e2deb 100644 --- a/docs/content/3.components/form.md +++ b/docs/content/3.components/form.md @@ -214,3 +214,7 @@ This will give you access to the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/icon.md b/docs/content/3.components/icon.md index 266ff12681..cf5aaaf59e 100644 --- a/docs/content/3.components/icon.md +++ b/docs/content/3.components/icon.md @@ -32,3 +32,7 @@ It's highly recommended to install the icons collections you need, read more abo ### Props :component-props + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/input-menu.md b/docs/content/3.components/input-menu.md index 6521899f6a..0309af1d1b 100644 --- a/docs/content/3.components/input-menu.md +++ b/docs/content/3.components/input-menu.md @@ -820,3 +820,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/input-number.md b/docs/content/3.components/input-number.md index 03634862c7..eb0786d2e7 100644 --- a/docs/content/3.components/input-number.md +++ b/docs/content/3.components/input-number.md @@ -293,3 +293,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/input-tags.md b/docs/content/3.components/input-tags.md index 241b715638..0784768085 100644 --- a/docs/content/3.components/input-tags.md +++ b/docs/content/3.components/input-tags.md @@ -293,3 +293,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/input.md b/docs/content/3.components/input.md index f31fddb5c7..5d01f6407c 100644 --- a/docs/content/3.components/input.md +++ b/docs/content/3.components/input.md @@ -347,3 +347,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/kbd.md b/docs/content/3.components/kbd.md index 9b21ee8945..37a0104120 100644 --- a/docs/content/3.components/kbd.md +++ b/docs/content/3.components/kbd.md @@ -131,3 +131,7 @@ slots: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/link.md b/docs/content/3.components/link.md index 0aded5440f..f901022ca4 100644 --- a/docs/content/3.components/link.md +++ b/docs/content/3.components/link.md @@ -106,3 +106,7 @@ ignore: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/modal.md b/docs/content/3.components/modal.md index 3ff36f91aa..1717bbd133 100644 --- a/docs/content/3.components/modal.md +++ b/docs/content/3.components/modal.md @@ -385,3 +385,7 @@ name: 'modal-command-palette-example' ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/navigation-menu.md b/docs/content/3.components/navigation-menu.md index f0fb9c5f8e..248d77b5e1 100644 --- a/docs/content/3.components/navigation-menu.md +++ b/docs/content/3.components/navigation-menu.md @@ -1178,3 +1178,7 @@ In this example, we add the `sm:w-(--reka-navigation-menu-viewport-width)` class ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/pagination.md b/docs/content/3.components/pagination.md index 5ee082b8ce..7e8ce923e1 100644 --- a/docs/content/3.components/pagination.md +++ b/docs/content/3.components/pagination.md @@ -327,3 +327,7 @@ In this example we're adding the `#with-links` hash to avoid going to the top of ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/pin-input.md b/docs/content/3.components/pin-input.md index 77bfea7992..d2aa342c8d 100644 --- a/docs/content/3.components/pin-input.md +++ b/docs/content/3.components/pin-input.md @@ -191,3 +191,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/popover.md b/docs/content/3.components/popover.md index 644d640a1f..05a9e1055f 100644 --- a/docs/content/3.components/popover.md +++ b/docs/content/3.components/popover.md @@ -244,3 +244,7 @@ name: 'popover-anchor-slot-example' ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/progress.md b/docs/content/3.components/progress.md index 5156735bb7..5978b47bca 100644 --- a/docs/content/3.components/progress.md +++ b/docs/content/3.components/progress.md @@ -160,3 +160,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/radio-group.md b/docs/content/3.components/radio-group.md index 4f936246cd..6730c3a3c2 100644 --- a/docs/content/3.components/radio-group.md +++ b/docs/content/3.components/radio-group.md @@ -306,3 +306,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/select-menu.md b/docs/content/3.components/select-menu.md index 9baefc3673..6c4c53fbee 100644 --- a/docs/content/3.components/select-menu.md +++ b/docs/content/3.components/select-menu.md @@ -855,3 +855,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/select.md b/docs/content/3.components/select.md index 43016b4d24..1c7b6f64f2 100644 --- a/docs/content/3.components/select.md +++ b/docs/content/3.components/select.md @@ -747,3 +747,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/separator.md b/docs/content/3.components/separator.md index c73fa67dca..5949eff4bb 100644 --- a/docs/content/3.components/separator.md +++ b/docs/content/3.components/separator.md @@ -123,3 +123,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/skeleton.md b/docs/content/3.components/skeleton.md index e2bf17000b..6fb3c5cec3 100644 --- a/docs/content/3.components/skeleton.md +++ b/docs/content/3.components/skeleton.md @@ -24,3 +24,7 @@ links: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/slideover.md b/docs/content/3.components/slideover.md index c73acc1ac8..07e8231730 100644 --- a/docs/content/3.components/slideover.md +++ b/docs/content/3.components/slideover.md @@ -373,3 +373,7 @@ name: 'slideover-footer-slot-example' ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/slider.md b/docs/content/3.components/slider.md index 52296a3a34..f7d8721e8c 100644 --- a/docs/content/3.components/slider.md +++ b/docs/content/3.components/slider.md @@ -192,3 +192,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/stepper.md b/docs/content/3.components/stepper.md index 2f4cdcee72..3faf88cce3 100644 --- a/docs/content/3.components/stepper.md +++ b/docs/content/3.components/stepper.md @@ -246,3 +246,7 @@ This will give you access to the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/switch.md b/docs/content/3.components/switch.md index 6d96947e6c..940887b748 100644 --- a/docs/content/3.components/switch.md +++ b/docs/content/3.components/switch.md @@ -199,3 +199,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/table.md b/docs/content/3.components/table.md index 99a94a9d05..3f40b22086 100644 --- a/docs/content/3.components/table.md +++ b/docs/content/3.components/table.md @@ -631,3 +631,7 @@ This will give you access to the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/tabs.md b/docs/content/3.components/tabs.md index 026a5f9afd..5e0deb777e 100644 --- a/docs/content/3.components/tabs.md +++ b/docs/content/3.components/tabs.md @@ -254,3 +254,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/textarea.md b/docs/content/3.components/textarea.md index c3a3d3df33..c8c80b9410 100644 --- a/docs/content/3.components/textarea.md +++ b/docs/content/3.components/textarea.md @@ -259,3 +259,7 @@ When accessing the component via a template ref, you can use the following: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/timeline.md b/docs/content/3.components/timeline.md index 8f06773409..f720ab0985 100644 --- a/docs/content/3.components/timeline.md +++ b/docs/content/3.components/timeline.md @@ -266,3 +266,7 @@ Use the available slots to create a more complex Timeline. ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/toast.md b/docs/content/3.components/toast.md index ea270399f4..82be16ce14 100644 --- a/docs/content/3.components/toast.md +++ b/docs/content/3.components/toast.md @@ -263,3 +263,7 @@ In this example, we use the `AppConfig` to configure the `expand` prop of the `T ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/tooltip.md b/docs/content/3.components/tooltip.md index 645e4056c0..afb231a432 100644 --- a/docs/content/3.components/tooltip.md +++ b/docs/content/3.components/tooltip.md @@ -213,3 +213,7 @@ name: 'tooltip-cursor-example' ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/content/3.components/tree.md b/docs/content/3.components/tree.md index 93452397c3..9c8d770c1a 100644 --- a/docs/content/3.components/tree.md +++ b/docs/content/3.components/tree.md @@ -442,3 +442,7 @@ props: ## Theme :component-theme + +## Changelog + +:component-changelog diff --git a/docs/modules/changelog.ts b/docs/modules/changelog.ts new file mode 100644 index 0000000000..ec3f122356 --- /dev/null +++ b/docs/modules/changelog.ts @@ -0,0 +1,64 @@ +import { defineNuxtModule, addTemplate } from '@nuxt/kit' +import Git from 'simple-git' + +interface CommitInfo { + components?: string[] + version?: string + hash: string + date: string + message: string + refs?: string + body?: string + author_name: string + author_email: string +} + +export default defineNuxtModule({ + meta: { + name: 'changelog' + }, + async setup() { + const count = 1000 + const git = Git({ maxConcurrentProcesses: 200 }) + + const logs = (await git.log({ maxCount: count })).all.filter((i) => { + return i.message.includes('chore(release)') + || i.message.includes('!') + || i.message.startsWith('feat') + || i.message.startsWith('fix') + }) as CommitInfo[] + + for (const log of logs) { + if (log.message.includes('chore(release)')) { + log.version = log.message.split(' ')[1]?.trim() + continue + } + + const raw = await git.raw(['diff-tree', '--no-commit-id', '--name-only', '-r', log.hash]) + delete log.body + const files = raw.replace(/\\/g, '/').trim().split('\n') + + log.components = [...new Set(files.map(i => i.match(/^src\/runtime\/components\/(\w+)\.vue$/)?.[1]?.toLowerCase()).filter(Boolean) as string[])] + } + + const result = logs.filter(i => i.components?.length || i.version) + + addTemplate({ + filename: 'changelog.ts', + getContents: () => `export interface CommitInfo { + components?: string[] + version?: string + hash: string + date: string + message: string + refs?: string + body?: string + author_name: string + author_email: string +} + +export const changelog: CommitInfo[] = ${JSON.stringify(result, null, 2)}`, + write: true + }) + } +}) diff --git a/docs/package.json b/docs/package.json index d618c4c3b7..66731b0823 100644 --- a/docs/package.json +++ b/docs/package.json @@ -36,6 +36,7 @@ "nuxt-og-image": "^5.1.9", "prettier": "^3.6.2", "shiki-transformer-color-highlight": "^1.0.0", + "simple-git": "^3.28.0", "sortablejs": "^1.15.6", "superstruct": "^2.0.2", "ufo": "^1.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b1ceec225..68a8c003e6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -308,6 +308,9 @@ importers: shiki-transformer-color-highlight: specifier: ^1.0.0 version: 1.0.0 + simple-git: + specifier: ^3.28.0 + version: 3.28.0 sortablejs: specifier: ^1.15.6 version: 1.15.6