@movk/nuxt-docs 1.3.9 → 1.3.10
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.
|
@@ -25,6 +25,10 @@ const props = defineProps<{
|
|
|
25
25
|
* The name of the component or file to get the changelog for.
|
|
26
26
|
*/
|
|
27
27
|
name?: string
|
|
28
|
+
/**
|
|
29
|
+
* The author to filter commits by.
|
|
30
|
+
*/
|
|
31
|
+
author?: string
|
|
28
32
|
}>()
|
|
29
33
|
|
|
30
34
|
const SHA_SHORT_LENGTH = 5
|
|
@@ -50,8 +54,8 @@ const filePath = computed(() => {
|
|
|
50
54
|
})
|
|
51
55
|
|
|
52
56
|
const { data: commits } = await useLazyFetch<Commit[]>('/api/github/commits', {
|
|
53
|
-
key: `commit-changelog-${props.name ?? routeName.value}`,
|
|
54
|
-
query: { path: filePath.value }
|
|
57
|
+
key: `commit-changelog-${props.name ?? routeName.value}-${props.author ?? 'all'}`,
|
|
58
|
+
query: { path: filePath.value, author: props.author }
|
|
55
59
|
})
|
|
56
60
|
|
|
57
61
|
// 格式化提交消息
|
|
@@ -83,11 +87,7 @@ const formattedCommits = computed(() => {
|
|
|
83
87
|
<div v-else class="flex flex-col gap-1.5 relative">
|
|
84
88
|
<div class="bg-accented w-px h-full absolute left-[11px] z-[-1]" />
|
|
85
89
|
|
|
86
|
-
<div
|
|
87
|
-
v-for="commit of formattedCommits"
|
|
88
|
-
:key="commit.sha"
|
|
89
|
-
class="flex gap-1.5 items-center"
|
|
90
|
-
>
|
|
90
|
+
<div v-for="commit of formattedCommits" :key="commit.sha" class="flex gap-1.5 items-center">
|
|
91
91
|
<div class="bg-accented ring-2 ring-bg size-1.5 mx-[8.5px] rounded-full" />
|
|
92
92
|
<MDC :value="commit.formatted" class="text-sm *:py-0 *:my-0 [&_code]:text-xs" tag="div" />
|
|
93
93
|
</div>
|
package/app/types/index.d.ts
CHANGED
|
@@ -26,12 +26,17 @@ declare module 'nuxt/schema' {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
github: {
|
|
29
|
+
owner: string
|
|
30
|
+
name: string
|
|
29
31
|
url: string
|
|
30
32
|
branch: string
|
|
31
33
|
rootDir: string
|
|
32
34
|
commitPath: string
|
|
33
35
|
since: string
|
|
34
36
|
suffix: string
|
|
37
|
+
per_page: number
|
|
38
|
+
until: string
|
|
39
|
+
author?: string
|
|
35
40
|
} | false
|
|
36
41
|
}
|
|
37
42
|
}
|
package/modules/config.ts
CHANGED
|
@@ -52,7 +52,9 @@ export default defineNuxtModule({
|
|
|
52
52
|
commitPath: 'src',
|
|
53
53
|
suffix: 'vue',
|
|
54
54
|
since: '2025-01-31T04:00:00Z',
|
|
55
|
-
branch: getGitBranch()
|
|
55
|
+
branch: getGitBranch(),
|
|
56
|
+
per_page: 100,
|
|
57
|
+
until: new Date().toISOString()
|
|
56
58
|
})
|
|
57
59
|
|
|
58
60
|
const componentsPath = resolve('../app/components')
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@movk/nuxt-docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.10",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "An elegant documentation theme for Nuxt, powered by Nuxt UI and Nuxt Content.",
|
|
7
7
|
"author": "YiXuan <mhaibaraai@gmail.com>",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"README.md"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@iconify-json/lucide": "^1.2.
|
|
30
|
+
"@iconify-json/lucide": "^1.2.76",
|
|
31
31
|
"@iconify-json/simple-icons": "^1.2.60",
|
|
32
|
-
"@iconify-json/vscode-icons": "^1.2.
|
|
32
|
+
"@iconify-json/vscode-icons": "^1.2.37",
|
|
33
33
|
"@movk/core": "^1.0.2",
|
|
34
34
|
"@nuxt/content": "^3.8.2",
|
|
35
35
|
"@nuxt/image": "^2.0.0",
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
"@nuxt/ui": "^4.2.1",
|
|
38
38
|
"@nuxtjs/seo": "^3.2.2",
|
|
39
39
|
"@octokit/rest": "^22.0.1",
|
|
40
|
-
"@vueuse/core": "^14.
|
|
41
|
-
"@vueuse/nuxt": "^14.
|
|
40
|
+
"@vueuse/core": "^14.1.0",
|
|
41
|
+
"@vueuse/nuxt": "^14.1.0",
|
|
42
42
|
"defu": "^6.1.4",
|
|
43
43
|
"exsolve": "^1.0.8",
|
|
44
44
|
"git-url-parse": "^16.1.0",
|
|
45
45
|
"motion-v": "^1.7.4",
|
|
46
|
-
"nuxt-component-meta": "^0.
|
|
46
|
+
"nuxt-component-meta": "^0.15.0",
|
|
47
47
|
"nuxt-llms": "^0.1.3",
|
|
48
48
|
"ohash": "^2.0.11",
|
|
49
49
|
"pathe": "^2.0.3",
|
|
50
50
|
"pkg-types": "^2.3.0",
|
|
51
|
-
"prettier": "^3.
|
|
51
|
+
"prettier": "^3.7.1",
|
|
52
52
|
"scule": "^1.3.0",
|
|
53
53
|
"tailwindcss": "^4.1.17",
|
|
54
54
|
"ufo": "^1.6.1"
|
|
@@ -5,7 +5,7 @@ export default defineCachedEventHandler(async (event) => {
|
|
|
5
5
|
return []
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
const { path } = getQuery(event) as { path: string }
|
|
8
|
+
const { path, author } = getQuery(event) as { path: string, author?: string }
|
|
9
9
|
if (!path) {
|
|
10
10
|
throw createError({
|
|
11
11
|
statusCode: 400,
|
|
@@ -16,10 +16,14 @@ export default defineCachedEventHandler(async (event) => {
|
|
|
16
16
|
const { github } = useAppConfig()
|
|
17
17
|
const octokit = new Octokit({ auth: process.env.NUXT_GITHUB_TOKEN })
|
|
18
18
|
const commits = await octokit.paginate(octokit.rest.repos.listCommits, {
|
|
19
|
+
sha: github.branch,
|
|
19
20
|
owner: github.owner,
|
|
20
21
|
repo: github.name,
|
|
21
22
|
path,
|
|
22
|
-
since: github.since
|
|
23
|
+
since: github.since,
|
|
24
|
+
per_page: github.per_page,
|
|
25
|
+
until: github.until,
|
|
26
|
+
...(author && { author })
|
|
23
27
|
})
|
|
24
28
|
|
|
25
29
|
return commits.map(commit => ({
|
|
@@ -29,5 +33,8 @@ export default defineCachedEventHandler(async (event) => {
|
|
|
29
33
|
}))
|
|
30
34
|
}, {
|
|
31
35
|
maxAge: 60 * 60,
|
|
32
|
-
getKey: event =>
|
|
36
|
+
getKey: (event) => {
|
|
37
|
+
const { path, author } = getQuery(event)
|
|
38
|
+
return `commits-${path}${author ? `-${author}` : ''}`
|
|
39
|
+
}
|
|
33
40
|
})
|