mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
feat(theme): add collection breaking change log
This commit is contained in:
parent
2a8385f3aa
commit
b37af47dca
@ -26,17 +26,17 @@ export function detectBreakingChange(options: ThemeOptions): void {
|
||||
* @description 博客和笔记已经被删除,迁移到 collections 实现
|
||||
*/
|
||||
function withBlogAndNotesHaveBeenDelete(options: ThemeOptions): void {
|
||||
if ('blog' in options && options.collections?.length === 0) {
|
||||
if ('blog' in options && (!options.collections || options.collections.length === 0)) {
|
||||
logger.warn(t('blog'))
|
||||
}
|
||||
|
||||
let shouldMigrateNotes = false
|
||||
if ((options.notes as any)?.length && options.collections?.length === 0) {
|
||||
if ((options.notes as any)?.length && (!options.collections || options.collections.length === 0)) {
|
||||
shouldMigrateNotes = true
|
||||
}
|
||||
|
||||
for (const locale of Object.values(options.locales || {})) {
|
||||
if ((locale.notes as any)?.length && locale.collections?.length === 0) {
|
||||
if ((locale.notes as any)?.length && (!locale.collections || locale.collections.length === 0)) {
|
||||
shouldMigrateNotes = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
export * from './breakingChange.js'
|
||||
export * from './fields.js'
|
||||
export * from './options.js'
|
||||
export * from './versions.js'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user