Commit fb1947ddfd4cd54baebc3768dbad7869a8f53b3f

Authored by fengwotao
1 parent 97579852

fix(src/packages/): 修复之前未移动组件路径的项目导入问题

@@ -78,6 +78,10 @@ export const compatibleConfig = [ @@ -78,6 +78,10 @@ export const compatibleConfig = [
78 }, 78 },
79 { 79 {
80 key: 'OverrideTextCommon', //自定义文字 80 key: 'OverrideTextCommon', //自定义文字
  81 + oldChartKey: 'ExternalVCOverrideTextCommon',
  82 + newChartKey: 'ExternalVCOverrideTextCommon',
  83 + oldConKey: 'ExternalVCCOverrideTextCommon',
  84 + newConKey: 'ExternalVCCOverrideTextCommon',
81 oldPackage: 'Informations', //之前的包名 85 oldPackage: 'Informations', //之前的包名
82 newPackage: 'Informations', //现在的包名 86 newPackage: 'Informations', //现在的包名
83 oldCategory: 'Mores', //之前的目录 87 oldCategory: 'Mores', //之前的目录
@@ -106,6 +110,10 @@ export const compatibleConfig = [ @@ -106,6 +110,10 @@ export const compatibleConfig = [
106 { 110 {
107 key: 'LeftCenterRightHead', //大标题1 111 key: 'LeftCenterRightHead', //大标题1
108 newKey: 'Headline1', //新的key 112 newKey: 'Headline1', //新的key
  113 + oldChartKey: 'ExternalVCLeftCenterRightHead',
  114 + newChartKey: 'ExternalVCHeadline1',
  115 + oldConKey: 'ExternalVCCLeftCenterRightHead',
  116 + newConKey: 'ExternalVCCHeadline1',
109 oldPackage: 'Composes', //之前的包名 117 oldPackage: 'Composes', //之前的包名
110 newPackage: 'Decorates', //现在的包名 118 newPackage: 'Decorates', //现在的包名
111 oldCategory: 'HeadCombinations', //之前的目录 119 oldCategory: 'HeadCombinations', //之前的目录
@@ -116,6 +124,10 @@ export const compatibleConfig = [ @@ -116,6 +124,10 @@ export const compatibleConfig = [
116 { 124 {
117 key: 'LeftCenterRightHeadAnimat', //大标题2 125 key: 'LeftCenterRightHeadAnimat', //大标题2
118 newKey: 'Headline2', //新的key 126 newKey: 'Headline2', //新的key
  127 + oldChartKey: 'ExternalVCLeftCenterRightHeadAnimat',
  128 + newChartKey: 'ExternalVCHeadline2',
  129 + oldConKey: 'ExternalVCCLeftCenterRightHeadAnimat',
  130 + newConKey: 'ExternalVCCHeadline2',
119 oldPackage: 'Composes', //之前的包名 131 oldPackage: 'Composes', //之前的包名
120 newPackage: 'Decorates', //现在的包名 132 newPackage: 'Decorates', //现在的包名
121 oldCategory: 'HeadCombinations', //之前的目录 133 oldCategory: 'HeadCombinations', //之前的目录
@@ -126,6 +138,10 @@ export const compatibleConfig = [ @@ -126,6 +138,10 @@ export const compatibleConfig = [
126 { 138 {
127 key: 'Title1', //小标题1 139 key: 'Title1', //小标题1
128 newKey: 'Subtitle1', //新的key 140 newKey: 'Subtitle1', //新的key
  141 + oldChartKey: 'ExternalVCTitle1',
  142 + newChartKey: 'ExternalVCSubtitle1',
  143 + oldConKey: 'ExternalVCCTitle1',
  144 + newConKey: 'ExternalVCCSubtitle1',
129 oldPackage: 'Composes', //之前的包名 145 oldPackage: 'Composes', //之前的包名
130 newPackage: 'Decorates', //现在的包名 146 newPackage: 'Decorates', //现在的包名
131 oldCategory: 'Mores', //之前的目录 147 oldCategory: 'Mores', //之前的目录
@@ -135,6 +151,10 @@ export const compatibleConfig = [ @@ -135,6 +151,10 @@ export const compatibleConfig = [
135 }, 151 },
136 { 152 {
137 key: 'Title2', //小标题2 153 key: 'Title2', //小标题2
  154 + oldChartKey: 'ExternalVCTitle2',
  155 + newChartKey: 'ExternalVCSubtitle2',
  156 + oldConKey: 'ExternalVCCTitle2',
  157 + newConKey: 'ExternalVCCSubtitle2',
138 newKey: 'Subtitle2', //新的key 158 newKey: 'Subtitle2', //新的key
139 oldPackage: 'Composes', //之前的包名 159 oldPackage: 'Composes', //之前的包名
140 newPackage: 'Decorates', //现在的包名 160 newPackage: 'Decorates', //现在的包名
@@ -145,6 +165,10 @@ export const compatibleConfig = [ @@ -145,6 +165,10 @@ export const compatibleConfig = [
145 }, 165 },
146 { 166 {
147 key: 'Title3', //小标题3 167 key: 'Title3', //小标题3
  168 + oldChartKey: 'ExternalVCTitle3',
  169 + newChartKey: 'ExternalVCSubtitle3',
  170 + oldConKey: 'ExternalVCCTitle3',
  171 + newConKey: 'ExternalVCCSubtitle3',
148 newKey: 'Subtitle3', //新的key 172 newKey: 'Subtitle3', //新的key
149 oldPackage: 'Composes', //之前的包名 173 oldPackage: 'Composes', //之前的包名
150 newPackage: 'Decorates', //现在的包名 174 newPackage: 'Decorates', //现在的包名
@@ -152,6 +176,15 @@ export const compatibleConfig = [ @@ -152,6 +176,15 @@ export const compatibleConfig = [
152 newCategory: 'Subtitle', //新的目录 176 newCategory: 'Subtitle', //新的目录
153 oldCategoryName: '更多', //之前的目录名 177 oldCategoryName: '更多', //之前的目录名
154 newCategoryName: '小标题' //新的目录名 178 newCategoryName: '小标题' //新的目录名
  179 + },
  180 + {
  181 + key: 'OverrideImage', //自定义图片
  182 + oldPackage: 'Informations', //之前的包名
  183 + newPackage: 'Informations', //现在的包名
  184 + oldCategory: 'Mores', //之前的目录
  185 + newCategory: 'Mores', //新的目录
  186 + oldCategoryName: '更多', //之前的目录名
  187 + newCategoryName: '更多' //新的目录名
155 } 188 }
156 ] 189 ]
157 // 190 //
@@ -14,7 +14,7 @@ const getChartConfigFile = async (path: string) => { @@ -14,7 +14,7 @@ const getChartConfigFile = async (path: string) => {
14 14
15 export const createComponent = async (configType: ConfigType) => { 15 export const createComponent = async (configType: ConfigType) => {
16 // eslint-disable-next-line prefer-const 16 // eslint-disable-next-line prefer-const
17 - let { key, chartKey, category, package: packageName, redirectComponent, categoryName } = configType 17 + let { key, chartKey, category, package: packageName, redirectComponent, categoryName , conKey} = configType
18 // redirectComponent 是给图片组件库和图标组件库使用的 18 // redirectComponent 是给图片组件库和图标组件库使用的
19 if (redirectComponent) { 19 if (redirectComponent) {
20 const [packageName, categoryName, keyName] = redirectComponent.split('/') 20 const [packageName, categoryName, keyName] = redirectComponent.split('/')
@@ -25,13 +25,17 @@ export const createComponent = async (configType: ConfigType) => { @@ -25,13 +25,17 @@ export const createComponent = async (configType: ConfigType) => {
25 /** 25 /**
26 * 兼容之前导入错误的补丁 26 * 兼容之前导入错误的补丁
27 */ 27 */
  28 + const includeOldTitleKeys=['LeftCenterRightHead','LeftCenterRightHeadAnimat','Title1','Title2','Title3']
28 compatibleConfig?.forEach(item => { 29 compatibleConfig?.forEach(item => {
29 if (item?.key === key) { 30 if (item?.key === key) {
30 - key = item?.key as string 31 + key = includeOldTitleKeys.includes(item?.key)?item?.newKey:item?.key as any
31 packageName = item?.newPackage as string 32 packageName = item?.newPackage as string
32 category = item?.newCategory as string 33 category = item?.newCategory as string
33 // eslint-disable-next-line @typescript-eslint/no-unused-vars 34 // eslint-disable-next-line @typescript-eslint/no-unused-vars
34 categoryName = item?.newCategoryName as string 35 categoryName = item?.newCategoryName as string
  36 + chartKey = includeOldTitleKeys.includes(item?.key)?item?.newChartKey:chartKey as any
  37 + // eslint-disable-next-line @typescript-eslint/no-unused-vars
  38 + conKey = includeOldTitleKeys.includes(item?.key)?item?.newConKey:conKey as any
35 } 39 }
36 }) 40 })
37 // 41 //