Skip to content

Commit

Permalink
fix(jd): 修复合并代码导致的京东小程序的编译问题
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Dec 31, 2019
1 parent e64e177 commit de78fe4
Show file tree
Hide file tree
Showing 3 changed files with 523 additions and 791 deletions.
54 changes: 38 additions & 16 deletions packages/taro-mini-runner/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ export const NODE_MODULES_REG = /(.*)node_modules/

export const enum BUILD_TYPES {
WEAPP = 'weapp',
SWAN ='swan',
ALIPAY ='alipay',
TT ='tt',
UI ='ui',
SWAN = 'swan',
ALIPAY = 'alipay',
TT = 'tt',
UI = 'ui',
PLUGIN = 'plugin',
QUICKAPP = 'quickapp',
QQ = 'qq'
QQ = 'qq',
JD = 'jd'
}

export const enum TEMPLATE_TYPES {
Expand All @@ -43,7 +44,8 @@ export const enum TEMPLATE_TYPES {
ALIPAY = '.axml',
TT = '.ttml',
QUICKAPP = '.ux',
QQ = '.qml'
QQ = '.qml',
JD = '.jxml'
}

export const enum STYLE_TYPES {
Expand All @@ -52,7 +54,8 @@ export const enum STYLE_TYPES {
ALIPAY = '.acss',
TT = '.ttss',
QUICKAPP = '.css',
QQ = '.qss'
QQ = '.qss',
JD = '.jxss'
}

export const enum SCRIPT_TYPES {
Expand All @@ -61,7 +64,8 @@ export const enum SCRIPT_TYPES {
ALIPAY = '.js',
TT = '.js',
QUICKAPP = '.js',
QQ = '.js'
QQ = '.js',
JD = '.js'
}

export const enum CONFIG_TYPES {
Expand All @@ -70,7 +74,8 @@ export const enum CONFIG_TYPES {
ALIPAY = '.json',
TT = '.json',
QUICKAPP = '.json',
QQ = '.json'
QQ = '.json',
JD = '.json'
}

export type IMINI_APP_FILE_TYPE = {
Expand Down Expand Up @@ -119,6 +124,12 @@ export const MINI_APP_FILES: IMINI_APP_FILES = {
STYLE: STYLE_TYPES.QQ,
SCRIPT: SCRIPT_TYPES.QQ,
CONFIG: CONFIG_TYPES.QQ
},
[BUILD_TYPES.JD]: {
TEMPL: TEMPLATE_TYPES.JD,
STYLE: STYLE_TYPES.JD,
SCRIPT: SCRIPT_TYPES.JD,
CONFIG: CONFIG_TYPES.JD
}
}

Expand Down Expand Up @@ -168,15 +179,16 @@ export const CONFIG_MAP = {
navigationBarBackgroundColor: 'titleBarBackgroundColor',
navigationBarTextStyle: 'titleBarTextColor',
pageOrientation: 'orientation',
list: 'list',
text: 'text',
iconPath: 'iconPath',
selectedIconPath: 'selectedIconPath',
backgroundTextStyle: false,
list: false,
text: false,
iconPath: false,
selectedIconPath: false,
onReachBottomDistance: false,
backgroundColorBottom: false,
backgroundColorTop: false,
navigationStyle: false
enablePullDownRefresh: false,
navigationStyle: 'navigationStyle'
},
[BUILD_TYPES.QQ]: {
navigationBarTitleText: 'navigationBarTitleText',
Expand All @@ -185,11 +197,21 @@ export const CONFIG_MAP = {
list: 'list',
text: 'text',
iconPath: 'iconPath',
selectedIconPath: 'selectedIconPath'
selectedIconPath: 'selectedIconPath',
color: 'color'
},
[BUILD_TYPES.JD]: {
navigationBarTitleText: 'navigationBarTitleText',
navigationBarBackgroundColor: 'navigationBarBackgroundColor',
enablePullDownRefresh: 'enablePullDownRefresh',
list: 'list',
text: 'text',
iconPath: 'iconPath',
selectedIconPath: 'selectedIconPath',
color: 'color'
}
}


export const taroJsComponents = '@tarojs/components'
export const taroJsQuickAppComponents = '@tarojs/components-qa'
export const taroJsFramework = '@tarojs/taro'
Expand Down
5 changes: 4 additions & 1 deletion packages/taro-mini-runner/src/utils/logHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ const LOG_MAP = {
OPEN: '请打开支付宝小程序开发者工具进行查看'
},
[BUILD_TYPES.QQ]: {
OPEN: '请打开QQ 小程序开发者工具进行查看'
OPEN: '请打开 QQ 小程序开发者工具进行查看'
},
[BUILD_TYPES.SWAN]: {
OPEN: '请打开百度智能小程序开发者工具进行查看'
},
[BUILD_TYPES.TT]: {
OPEN: '请打开字节跳动小程序开发者工具进行查看'
},
[BUILD_TYPES.JD]: {
OPEN: '请打开京东小程序开发者工具进行查看'
},
[BUILD_TYPES.QUICKAPP]: {
OPEN: '请按快应用端开发流程 https://taro-docs.jd.com/taro/docs/quick-app.html 进行查看'
}
Expand Down
Loading

0 comments on commit de78fe4

Please sign in to comment.