File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
import type { CommitInfo } from ' #build/changelog'
3
- import { camelCase } from ' scule'
4
3
import { changelog } from ' #build/changelog'
5
4
6
5
const route = useRoute ()
7
- const camelName = camelCase (( route .path .split (' /' ).pop () ?? ' ' ). replace ( / - / g , ' ' ) )
6
+ const name = route .path .split (' /' ).pop ()
8
7
9
8
const commits = computed (() => {
10
- const related = changelog .filter (c => c .version || c .components ?.some (i => i . includes ( camelName ) ))
9
+ const related = changelog .filter (c => c .version || c .components ?.some (i => i === name ))
11
10
return related .filter ((i , idx ) => ! (i .version && (! related [idx + 1 ] || related [idx + 1 ]?.version )))
12
11
})
13
12
Original file line number Diff line number Diff line change 1
1
import { defineNuxtModule , addTemplate } from '@nuxt/kit'
2
2
import Git from 'simple-git'
3
+ import { kebabCase } from 'scule'
3
4
4
5
interface CommitInfo {
5
6
components ?: string [ ]
@@ -38,7 +39,7 @@ export default defineNuxtModule({
38
39
delete log . body
39
40
const files = raw . replace ( / \\ / g, '/' ) . trim ( ) . split ( '\n' )
40
41
41
- log . components = [ ...new Set ( files . map ( i => i . match ( / ^ s r c \/ r u n t i m e \/ c o m p o n e n t s \/ ( \w + ) \. v u e $ / ) ?. [ 1 ] ?. toLowerCase ( ) ) . filter ( Boolean ) as string [ ] ) ]
42
+ log . components = [ ...new Set ( files . map ( i => kebabCase ( i . match ( / ^ s r c \/ r u n t i m e \/ c o m p o n e n t s \/ ( \w + ) \. v u e $ / ) ?. [ 1 ] ?? '' ) ) . filter ( Boolean ) as string [ ] ) ]
42
43
}
43
44
44
45
const result = logs . filter ( i => i . components ?. length || i . version )
You can’t perform that action at this time.
0 commit comments