Skip to content

Commit

Permalink
build(charts): compatible with the old version of charts chart introd…
Browse files Browse the repository at this point in the history
…uction method (#2327)
  • Loading branch information
zzcr authored Oct 21, 2024
1 parent c829765 commit 2042709
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
18 changes: 16 additions & 2 deletions internals/cli/src/commands/build/build-entry-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,24 @@ const buildFullRuntime = (mode: RunTimeModeType) => {
include: includeTemplate.join(endOfLine),
components: componentsTemplate.join(',' + endOfLine),
exportComponents: componentsTemplate
.map((component) => `${component}${joinStr}${component} as Tiny${component.trim()}`)
.map((component) => {
if (component.includes('Hui')) {
return `${component}${joinStr}${component} as ${component
.replace('Huicharts', 'Charts')
.trim()}${joinStr}${component} as Tiny${component.trim()}`
}
return `${component}${joinStr}${component} as Tiny${component.trim()}`
})
.join(joinStr),
defaultComponents: componentsTemplate
.map((component) => `${component}${joinStr}Tiny${component.trim()}: ${component}`)
.map((component) => {
if (component.includes('Hui')) {
return `${component}${joinStr}${component
.replace('Huicharts', 'Charts')
.trim()}: ${component}${joinStr}Tiny${component.trim()}: ${component}`
}
return `${component}${joinStr}Tiny${component.trim()}: ${component}`
})
.join(joinStr)
}
})
Expand Down
18 changes: 16 additions & 2 deletions internals/cli/src/commands/build/build-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,24 @@ const createEntry = (mode) => {
include: includeTemplate.join(endOfLine),
components: componentsTemplate.join(joinStr),
exportComponents: componentsTemplate
.map((component) => `${component}${joinStr}${component} as Tiny${component.trim()}`)
.map((component) => {
if (component.includes('Hui')) {
return `${component}${joinStr}${component} as ${component
.replace('Huicharts', 'Charts')
.trim()}${joinStr}${component} as Tiny${component.trim()}`
}
return `${component}${joinStr}${component} as Tiny${component.trim()}`
})
.join(joinStr),
defaultComponents: componentsTemplate
.map((component) => `${component}${joinStr}Tiny${component.trim()}: ${component}`)
.map((component) => {
if (component.includes('Hui')) {
return `${component}${joinStr}${component
.replace('Huicharts', 'Charts')
.trim()}: ${component}${joinStr}Tiny${component.trim()}: ${component}`
}
return `${component}${joinStr}Tiny${component.trim()}: ${component}`
})
.join(joinStr)
}
})
Expand Down

0 comments on commit 2042709

Please sign in to comment.