Skip to content

Commit

Permalink
docs: add changelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ksem committed Jul 3, 2024
1 parent 93670c6 commit 9f5992f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
20 changes: 16 additions & 4 deletions packages/docs/modules/page-config/blocks/change-log/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ import { resolve, join } from 'pathe'
const changelogs = () => glob(join(resolve(''), '..', 'ui/src/**/CHANGELOG.md'))

const sortObjectKeys = <T extends Record<string, any>>(obj: T) => {
return Object.keys(obj).sort().reverse().reduce((acc, key) => {
acc[key as keyof T] = obj[key] as T[keyof T]
return acc
}, {} as T)
return Object
.keys(obj)
.sort((a, b) => {
return a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' })
})
.reverse()
.reduce((acc, key) => {
acc[key as keyof T] = obj[key] as T[keyof T]
return acc
}, {} as T)
}

export const render = async () => {
Expand All @@ -26,6 +32,8 @@ export const render = async () => {
const mergedChangelog = logEntries
.reduce((acc, [path, changelog]) => {
const componentName = path.match(/components\/(.*)\/CHANGELOG.md/)?.[1]
const serviceName = path.match(/services\/(.*)\/CHANGELOG.md/)?.[1]
const composableName = path.match(/composables\/(.*)\/CHANGELOG.md/)?.[1]

const spilledByVersion = changelog.split(/# ([0-9]*\.[0-9]*\.[0-9]*)/).filter(Boolean)

Expand All @@ -37,6 +45,10 @@ export const render = async () => {

if (componentName) {
acc[version][componentName] = content.split('\n').filter(Boolean)
} else if (serviceName) {
acc[version][serviceName] = content.split('\n').filter(Boolean)
} else if (composableName) {
acc[version][composableName] = content.split('\n').filter(Boolean)
}
}
return acc
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/src/components/va-input/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.10.0
- Remove cleave.js and reduced bundle size
- Remove `mask` prop. Prefer useInputMask composable

# 1.9.0
- Fix style issues without vuestic/css or in web-components build
- Fix empty value when model value initially set
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/services/color/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 1.10.0

- Removed colortranslator and reduced bundle size
4 changes: 4 additions & 0 deletions packages/ui/src/services/i18n/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 1.10.0

- Now i18n config uses `vuestic` key in `vue-i18n` automatically
- Custom strings can be added to i18n

0 comments on commit 9f5992f

Please sign in to comment.