Skip to content

Commit 6243b55

Browse files
authored
refactor: improve codes and update jsdoc (#668)
1 parent 2c4c5c9 commit 6243b55

340 files changed

Lines changed: 2550 additions & 3211 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ncurc.cjs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ module.exports = defineConfig({
1414
)
1515
return '@next'
1616

17+
if (name === '@types/node') return 'minor'
18+
1719
if (['vite'].includes(name)) return 'patch'
1820

1921
return 'latest'
2022
},
21-
reject: (name) => {
22-
if (name === '@types/node') return true
23-
24-
return false
25-
},
2623
})

AGENTS.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,25 +135,23 @@ All source files are in `src/`. Compiled output goes to `dist/` (git-ignored).
135135
136136
**JSDoc template:**
137137
138-
````typescript
138+
```typescript
139139
/**
140140
* English description
141141
*
142-
* 中文描述
142+
* (optional) English detailed description
143143
*
144-
* @description (optional) English detailed description
144+
* 中文描述
145145
*
146-
* 中文详细描述
146+
* (可选)中文详细描述
147147
*
148148
* @param paramName - English description / 中文描述
149149
*
150150
* @default defaultValue
151151
* @example
152-
* ```ts
153-
* // Example code in TypeScript
154-
* ```
152+
* // Example code in TypeScript
155153
*/
156-
````
154+
```
157155

158156
### Commit Messages
159157

docs/.vuepress/components/NpmBadge.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import { computed } from 'vue'
33
44
const { package: pkg, distTag = 'next' } = defineProps<{
5-
/** package name */
5+
/** Package name */
66
package: string
7-
/** dist tag */
7+
/** Dist tag */
88
distTag?: string
99
}>()
1010

docs/.vuepress/components/VPAutoLink.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ export interface AutoLinkConfigWithIcon extends AutoLinkConfig {
88
}
99
1010
const { config } = defineProps<{
11-
/**
12-
* The auto link config
13-
*/
11+
/** The auto link config */
1412
config: AutoLinkConfigWithIcon
1513
}>()
1614

docs/.vuepress/components/VPNavbarDropdown.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import VPAutoLink from '@theme/VPAutoLink.vue'
1111
import '@vuepress/helper/transition/fade-in-height-expand.css'
1212
1313
const { config } = defineProps<{
14-
/** dropdown config */
14+
/** Dropdown config */
1515
config: NavGroup<AutoLinkOptions | NavGroup<AutoLinkOptions>>
1616
}>()
1717
@@ -25,8 +25,8 @@ const isLastItemOfArray = (arrayItem: unknown, array: unknown[]): boolean =>
2525
/**
2626
* Open the dropdown when user tab and click from keyboard.
2727
*
28-
* Use event.detail to detect tab and click from keyboard.
29-
* The Tab + Click is UIEvent > KeyboardEvent, so the detail is 0.
28+
* Use event.detail to detect tab and click from keyboard. The Tab + Click is
29+
* UIEvent > KeyboardEvent, so the detail is 0.
3030
*
3131
* @see https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail
3232
*/

docs/.vuepress/components/VPSidebarItem.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@ import VPAutoLink from '@theme/VPAutoLink.vue'
1212
import VPDropdownTransition from '@theme/VPDropdownTransition.vue'
1313
1414
const { item, depth = 0 } = defineProps<{
15-
/**
16-
* The sidebar item to be rendered
17-
*/
15+
/** The sidebar item to be rendered */
1816
item: SidebarItem
19-
/**
20-
* The depth of the current sidebar item
21-
*/
17+
/** The depth of the current sidebar item */
2218
depth?: number
2319
}>()
2420

docs/.vuepress/theme.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export default defaultTheme({
1313
/**
1414
* English locale config
1515
*
16-
* As the default locale of `@vuepress/theme-default` is English,
17-
* we don't need to set all of the locale fields
16+
* As the default locale of `@vuepress/theme-default` is English, we don't
17+
* need to set all of the locale fields
1818
*/
1919
'/': {
2020
// navbar
@@ -25,9 +25,7 @@ export default defaultTheme({
2525
editLinkText: 'Edit this page on GitHub',
2626
},
2727

28-
/**
29-
* Chinese locale config
30-
*/
28+
/** Chinese locale config */
3129
'/zh/': {
3230
// navbar
3331
navbar: navbarZh,

docs/.vuepress/utils/resolveAutoLink.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import { resolveRoute } from 'vuepress/client'
44
/**
55
* Resolve AutoLink props from string
66
*
7-
* @param config AutoLink config string
8-
* @param currentPath current page path, used to resolve relative link
7+
* @example
8+
* - Input: '/README.md'
9+
* - Output: { text: 'Home', icon: 'home', link: '/' }
910
*
11+
* @param config AutoLink config string
12+
* @param currentPath Current page path, used to resolve relative link
1013
* @returns AutoLink options
11-
*
12-
* @example
13-
* - Input: '/README.md'
14-
* - Output: { text: 'Home', icon: 'home', link: '/' }
1514
*/
1615
export const resolveAutoLink = (
1716
config: string,

docs/plugins/blog/blog/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ interface BlogCategoryOptions {
166166
/**
167167
* The path pattern for the registered page
168168
*
169-
* @description `:key` will be replaced by the "slugify" result of the original key
169+
* `:key` will be replaced by the "slugify" result of the original key
170170
*
171171
* @default `/:key/`
172172
*/
@@ -187,7 +187,7 @@ interface BlogCategoryOptions {
187187
/**
188188
* The path pattern or custom function for the item page
189189
*
190-
* @description When providing a string, `:key` and `:name` will be replaced by the "slugify" result of the original key and name
190+
* When providing a string, `:key` and `:name` will be replaced by the "slugify" result of the original key and name
191191
*
192192
* @default `/:key/:name/`
193193
*/

docs/plugins/blog/blog/guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ interface BlogFrontmatterOptions {
148148
/**
149149
* Current category name
150150
*
151-
* @description Only available in category item page
151+
* Only available in category item page
152152
*/
153153
name?: string
154154
}

0 commit comments

Comments
 (0)