Skip to content

Commit 280b126

Browse files
committed
build: update API generator
1 parent 222d77d commit 280b126

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/docs/build/api.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const escapeMarkdown = (text) => {
111111
*/
112112
const getRelativeFilename = (file) => {
113113
let relativePath = file.includes('node_modules')
114-
? path.relative(path.join(__dirname, '..', '..'), file).replace('coreui-', '')
114+
? file.split('node_modules/@coreui/')[1]
115115
: path.relative(GLOBBY_OPTIONS.cwd, file).replace('coreui-', '')
116116

117117
// Remove '-pro' from the filename if not a pro component
@@ -284,14 +284,14 @@ const createMdx = async (file, component) => {
284284
? 'ReactElement'
285285
: propInfo.type.name
286286
: ''
287-
const defaultValue = propInfo.defaultValue ? `\`${propInfo.defaultValue.value}\`` : `undefined`
287+
const defaultValue = propInfo.defaultValue ? `\`${propInfo.defaultValue.value}\`` : '-'
288288
const example = propInfo.tags?.example
289289
? replaceText(component.displayName, 'example', propInfo.tags.example)
290290
: false
291291

292292
// Format types as inline code
293293
const types = splitOutsideBracesAndParentheses(type)
294-
.map((_type) => `\`${_type.trim()}\``)
294+
.map((_type) => `\`${_type.trim().replaceAll('"', "'")}\``)
295295
.join(', ')
296296

297297
const id = `${component.displayName.toLowerCase()}-${propName.replaceAll(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()}`

0 commit comments

Comments
 (0)