@momo-kits/foundation 0.81.43 → 0.81.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Application/BottomTab.tsx +29 -12
- package/Application/Components.tsx +178 -174
- package/Application/ModalScreen.tsx +4 -17
- package/Application/NavigationContainer.tsx +9 -30
- package/Application/Navigator.ts +14 -9
- package/Application/StackScreen.tsx +25 -28
- package/Application/index.ts +10 -1
- package/Application/types.ts +30 -17
- package/Application/utils.tsx +14 -0
- package/Assets/icon.json +83 -5
- package/Assets/icon_bank.json +506 -0
- package/Badge/Badge.tsx +1 -1
- package/Badge/BadgeRibbon.tsx +2 -2
- package/Badge/styles.ts +5 -2
- package/Button/index.tsx +4 -5
- package/CheckBox/index.tsx +1 -2
- package/Icon/index.tsx +7 -2
- package/Icon/types.ts +1 -1
- package/IconButton/index.tsx +0 -1
- package/Input/Input.tsx +26 -7
- package/Input/InputDropDown.tsx +1 -6
- package/Input/InputMoney.tsx +14 -6
- package/Input/InputOTP.tsx +12 -9
- package/Input/InputSearch.tsx +8 -12
- package/Input/InputTextArea.tsx +4 -6
- package/Input/common.tsx +5 -3
- package/Input/index.tsx +2 -6
- package/Input/styles.ts +1 -3
- package/Layout/Card.tsx +8 -9
- package/Layout/Item.tsx +0 -1
- package/Layout/ItemList.tsx +39 -33
- package/Layout/Screen.tsx +1 -3
- package/Layout/Section.tsx +4 -4
- package/Pagination/PaginationNumber.tsx +1 -1
- package/Pagination/PaginationScroll.tsx +0 -1
- package/Popup/PopupNotify.tsx +28 -32
- package/Popup/PopupPromotion.tsx +24 -28
- package/Radio/index.tsx +1 -2
- package/Skeleton/index.tsx +1 -1
- package/Switch/index.tsx +0 -1
- package/Tag/index.tsx +2 -4
- package/Text/index.tsx +2 -2
- package/Text/styles.ts +38 -0
- package/Text/types.ts +18 -24
- package/Title/index.tsx +2 -2
- package/package.json +2 -2
- package/publish.sh +1 -1
- package/verify.js +37 -39
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import {PopupNotifyProps} from './types';
|
|
|
4
4
|
import {Radius, Spacing, Styles} from '../Consts';
|
|
5
5
|
import {Image} from '../Image';
|
|
6
6
|
import {Text} from '../Text';
|
|
7
|
-
import {ApplicationContext} from '../Application';
|
|
7
|
+
import {ApplicationContext, MiniAppContext} from '../Application';
|
|
8
8
|
import {Button} from '../Button';
|
|
9
9
|
import {Icon} from '../Icon';
|
|
10
10
|
|
|
@@ -19,6 +19,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
19
19
|
buttonDirection = 'row',
|
|
20
20
|
onIconClose,
|
|
21
21
|
}) => {
|
|
22
|
+
const context = useContext(MiniAppContext);
|
|
22
23
|
const {theme, navigator, translate} = useContext(ApplicationContext);
|
|
23
24
|
const [scrollContent, setScrollContent] = useState(false);
|
|
24
25
|
const closeAction = useRef('touch_outside');
|
|
@@ -34,35 +35,31 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
34
35
|
* tracking
|
|
35
36
|
*/
|
|
36
37
|
useEffect(() => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
const routes = navigator?.ref.current?.getRootState()?.routes || [];
|
|
39
|
+
const routesLength = routes.length;
|
|
40
|
+
let screen_name = routes?.[0]?.params?.screen?.name;
|
|
41
|
+
if (routesLength > 1) {
|
|
42
|
+
screen_name = routes[routesLength - 2]?.params?.screen?.name;
|
|
43
|
+
}
|
|
44
|
+
const tracking = {
|
|
45
|
+
...context,
|
|
46
|
+
screen_name,
|
|
47
|
+
component_type: 'popup',
|
|
48
|
+
component_name: id,
|
|
49
|
+
error_code: error ? error : undefined,
|
|
50
|
+
};
|
|
51
|
+
navigator?.maxApi?.trackEvent?.('service_component_displayed', {
|
|
52
|
+
...tracking,
|
|
53
|
+
trigger_id: '111012100000000000',
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return () => {
|
|
57
|
+
navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
|
|
55
58
|
...tracking,
|
|
56
|
-
trigger_id: '
|
|
59
|
+
trigger_id: '111154100000000001',
|
|
60
|
+
action_type: closeAction.current,
|
|
57
61
|
});
|
|
58
|
-
|
|
59
|
-
navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
|
|
60
|
-
...tracking,
|
|
61
|
-
trigger_id: '111154100000000001',
|
|
62
|
-
action_type: closeAction.current,
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
}
|
|
62
|
+
};
|
|
66
63
|
}, []);
|
|
67
64
|
|
|
68
65
|
/**
|
|
@@ -185,19 +182,18 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
185
182
|
|
|
186
183
|
return (
|
|
187
184
|
<View
|
|
188
|
-
accessibilityLabel={'PopupNotify'}
|
|
189
185
|
style={[
|
|
190
186
|
styles.container,
|
|
191
187
|
{backgroundColor: theme.colors.background.surface},
|
|
192
188
|
]}>
|
|
193
189
|
{!!image && <Image source={{uri: image}} style={styles.image} />}
|
|
194
190
|
<View style={styles.content}>
|
|
195
|
-
<Text typography={'
|
|
191
|
+
<Text typography={'header_default_bold'} numberOfLines={1}>
|
|
196
192
|
{title}
|
|
197
193
|
</Text>
|
|
198
194
|
<Description style={[styles.description, descriptionStyle]}>
|
|
199
195
|
<Text
|
|
200
|
-
typography={'
|
|
196
|
+
typography={'body_default_regular'}
|
|
201
197
|
onTextLayout={({nativeEvent: {lines}}) => {
|
|
202
198
|
const enableScroll = lines.length > 3;
|
|
203
199
|
if (enableScroll != scrollContent) {
|
|
@@ -210,7 +206,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
210
206
|
{!!error && (
|
|
211
207
|
<View style={styles.information}>
|
|
212
208
|
<Text
|
|
213
|
-
typography={'
|
|
209
|
+
typography={'description_xs_regular'}
|
|
214
210
|
color={theme.colors.text.hint}
|
|
215
211
|
numberOfLines={1}>
|
|
216
212
|
{translate?.('errorCode')}
|
package/Popup/PopupPromotion.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, {useContext, useEffect, useRef} from 'react';
|
|
2
2
|
import {StyleSheet, TouchableOpacity, View} from 'react-native';
|
|
3
3
|
import {PopupPromotionProps} from './types';
|
|
4
|
-
import {ApplicationContext} from '../Application';
|
|
4
|
+
import {ApplicationContext, MiniAppContext} from '../Application';
|
|
5
5
|
import {Image} from '../Image';
|
|
6
6
|
import {Radius, Spacing} from '../Consts';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
@@ -11,6 +11,7 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
|
11
11
|
image,
|
|
12
12
|
onIconClose,
|
|
13
13
|
}) => {
|
|
14
|
+
const context = useContext(MiniAppContext);
|
|
14
15
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
15
16
|
const closeAction = useRef('touch_outside');
|
|
16
17
|
|
|
@@ -18,34 +19,29 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
|
18
19
|
* tracking
|
|
19
20
|
*/
|
|
20
21
|
useEffect(() => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
const routes = navigator?.ref.current?.getRootState()?.routes || [];
|
|
23
|
+
const routesLength = routes.length;
|
|
24
|
+
let screen_name = routes?.[0]?.params?.screen?.name;
|
|
25
|
+
if (routesLength > 1) {
|
|
26
|
+
screen_name = routes[routesLength - 2]?.params?.screen?.name;
|
|
27
|
+
}
|
|
28
|
+
const tracking = {
|
|
29
|
+
...context,
|
|
30
|
+
screen_name,
|
|
31
|
+
component_type: 'popup',
|
|
32
|
+
component_name: id,
|
|
33
|
+
};
|
|
34
|
+
navigator?.maxApi?.trackEvent?.('service_component_displayed', {
|
|
35
|
+
...tracking,
|
|
36
|
+
trigger_id: '111012100000000000',
|
|
37
|
+
});
|
|
38
|
+
return () => {
|
|
39
|
+
navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
|
|
38
40
|
...tracking,
|
|
39
|
-
trigger_id: '
|
|
41
|
+
trigger_id: '111154100000000001',
|
|
42
|
+
action_type: closeAction.current,
|
|
40
43
|
});
|
|
41
|
-
|
|
42
|
-
navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
|
|
43
|
-
...tracking,
|
|
44
|
-
trigger_id: '111154100000000001',
|
|
45
|
-
action_type: closeAction.current,
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
}
|
|
44
|
+
};
|
|
49
45
|
}, []);
|
|
50
46
|
|
|
51
47
|
/**
|
|
@@ -81,7 +77,7 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
|
81
77
|
};
|
|
82
78
|
|
|
83
79
|
return (
|
|
84
|
-
<View
|
|
80
|
+
<View>
|
|
85
81
|
<Image
|
|
86
82
|
source={{
|
|
87
83
|
uri: image,
|
package/Radio/index.tsx
CHANGED
|
@@ -39,7 +39,6 @@ const Radio: FC<RadioProps> = ({
|
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<TouchableOpacity
|
|
42
|
-
accessibilityLabel={`Radio/${label}/${value}`}
|
|
43
42
|
onPress={onChange}
|
|
44
43
|
disabled={disabled}
|
|
45
44
|
style={[
|
|
@@ -57,7 +56,7 @@ const Radio: FC<RadioProps> = ({
|
|
|
57
56
|
{marginRight: label ? Spacing.XS : 0},
|
|
58
57
|
]}
|
|
59
58
|
/>
|
|
60
|
-
{!!label && <Text typography={'
|
|
59
|
+
{!!label && <Text typography={'body_default_regular'}>{label}</Text>}
|
|
61
60
|
</TouchableOpacity>
|
|
62
61
|
);
|
|
63
62
|
};
|
package/Skeleton/index.tsx
CHANGED
|
@@ -41,7 +41,7 @@ const Skeleton: React.FC<SkeletonTypes> = ({style}) => {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
return (
|
|
44
|
-
<View style={[styles.container, style]}
|
|
44
|
+
<View style={[styles.container, style]}>
|
|
45
45
|
<View
|
|
46
46
|
onLayout={e => onLayout(e.nativeEvent.layout.width)}
|
|
47
47
|
style={[Styles.flex, {backgroundColor: PRIMARY_COLOR}]}>
|
package/Switch/index.tsx
CHANGED
package/Tag/index.tsx
CHANGED
|
@@ -60,9 +60,7 @@ const Tag: FC<TagProps> = ({
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
|
-
<View
|
|
64
|
-
style={[style, sizeStyle, {backgroundColor: tagColor}]}
|
|
65
|
-
accessibilityLabel={`Tag/${label}`}>
|
|
63
|
+
<View style={[style, sizeStyle, {backgroundColor: tagColor}]}>
|
|
66
64
|
{!!icon && (
|
|
67
65
|
<Icon
|
|
68
66
|
style={styles.icon}
|
|
@@ -71,7 +69,7 @@ const Tag: FC<TagProps> = ({
|
|
|
71
69
|
color={labelColor}
|
|
72
70
|
/>
|
|
73
71
|
)}
|
|
74
|
-
<Text color={labelColor} typography={'
|
|
72
|
+
<Text color={labelColor} typography={'label_s_medium'}>
|
|
75
73
|
{label}
|
|
76
74
|
</Text>
|
|
77
75
|
</View>
|
package/Text/index.tsx
CHANGED
|
@@ -84,6 +84,7 @@ const Text: React.FC<TextProps> = ({
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
return {
|
|
87
|
+
...typoStyle,
|
|
87
88
|
fontFamily,
|
|
88
89
|
fontSize: scaleSize(fontSize),
|
|
89
90
|
lineHeight: scaleSize(lineHeight),
|
|
@@ -96,7 +97,6 @@ const Text: React.FC<TextProps> = ({
|
|
|
96
97
|
return (
|
|
97
98
|
<RNText
|
|
98
99
|
{...rest}
|
|
99
|
-
accessibilityLabel={`Text/${children}`}
|
|
100
100
|
style={[style, textStyle, {color: color ?? theme.colors.text.default}]}>
|
|
101
101
|
{children ?? ''}
|
|
102
102
|
</RNText>
|
|
@@ -104,7 +104,7 @@ const Text: React.FC<TextProps> = ({
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
Text.defaultProps = {
|
|
107
|
-
typography: '
|
|
107
|
+
typography: 'body_default_regular',
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
export {Text, scaleSize};
|
package/Text/styles.ts
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
export default {
|
|
2
|
+
headline_default_bold: {fontSize: 24, lineHeight: 32, fontWeight: '700'},
|
|
3
|
+
header_m_bold: {fontSize: 18, lineHeight: 28, fontWeight: '700'},
|
|
4
|
+
header_default_bold: {fontSize: 16, lineHeight: 22, fontWeight: '700'},
|
|
5
|
+
header_s_semibold: {fontSize: 14, lineHeight: 20, fontWeight: '600'},
|
|
6
|
+
header_xs_semibold: {fontSize: 12, lineHeight: 16, fontWeight: '600'},
|
|
7
|
+
body_default_regular: {fontSize: 14, lineHeight: 20, fontWeight: '400'},
|
|
8
|
+
body_regularstrikethrought: {
|
|
9
|
+
fontSize: 14,
|
|
10
|
+
lineHeight: 20,
|
|
11
|
+
fontWeight: '400',
|
|
12
|
+
textDecorationLine: 'line-through',
|
|
13
|
+
},
|
|
14
|
+
description_default_regular: {
|
|
15
|
+
fontSize: 12,
|
|
16
|
+
lineHeight: 16,
|
|
17
|
+
fontWeight: '400',
|
|
18
|
+
},
|
|
19
|
+
description_default_regularstrikethrought: {
|
|
20
|
+
fontSize: 12,
|
|
21
|
+
lineHeight: 16,
|
|
22
|
+
fontWeight: '400',
|
|
23
|
+
textDecorationLine: 'line-through',
|
|
24
|
+
},
|
|
25
|
+
description_xs_regular: {fontSize: 10, lineHeight: 14, fontWeight: '400'},
|
|
26
|
+
description_xs_regularstrikethrought: {
|
|
27
|
+
fontSize: 10,
|
|
28
|
+
lineHeight: 14,
|
|
29
|
+
fontWeight: '400',
|
|
30
|
+
textDecorationLine: 'line-through',
|
|
31
|
+
},
|
|
32
|
+
label_default_medium: {fontSize: 14, lineHeight: 20, fontWeight: '500'},
|
|
33
|
+
label_s_medium: {fontSize: 12, lineHeight: 16, fontWeight: '500'},
|
|
34
|
+
label_xs_medium: {fontSize: 10, lineHeight: 14, fontWeight: '500'},
|
|
35
|
+
action_default_bold: {fontSize: 16, lineHeight: 22, fontWeight: '700'},
|
|
36
|
+
action_s_bold: {fontSize: 14, lineHeight: 20, fontWeight: '700'},
|
|
37
|
+
action_xs_bold: {fontSize: 12, lineHeight: 16, fontWeight: '700'},
|
|
38
|
+
action_xxs_bold: {fontSize: 10, lineHeight: 14, fontWeight: '700'},
|
|
39
|
+
/**non-support**/
|
|
2
40
|
headline_default: {
|
|
3
41
|
fontSize: 28,
|
|
4
42
|
lineHeight: 34,
|
package/Text/types.ts
CHANGED
|
@@ -14,27 +14,21 @@ export type TypographyWeight = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export type Typography =
|
|
17
|
-
| '
|
|
18
|
-
| '
|
|
19
|
-
| '
|
|
20
|
-
| '
|
|
21
|
-
| '
|
|
22
|
-
| '
|
|
23
|
-
| '
|
|
24
|
-
| '
|
|
25
|
-
| '
|
|
26
|
-
| '
|
|
27
|
-
| '
|
|
28
|
-
| '
|
|
29
|
-
| '
|
|
30
|
-
| '
|
|
31
|
-
| '
|
|
32
|
-
| '
|
|
33
|
-
| '
|
|
34
|
-
| '
|
|
35
|
-
| 'label_xs'
|
|
36
|
-
| 'label_s'
|
|
37
|
-
| 'action_default'
|
|
38
|
-
| 'action_xxs'
|
|
39
|
-
| 'action_xs'
|
|
40
|
-
| 'action_s';
|
|
17
|
+
| 'headline_default_bold'
|
|
18
|
+
| 'header_m_bold'
|
|
19
|
+
| 'header_default_bold'
|
|
20
|
+
| 'header_s_semibold'
|
|
21
|
+
| 'header_xs_semibold'
|
|
22
|
+
| 'body_default_regular'
|
|
23
|
+
| 'body_regularstrikethrought'
|
|
24
|
+
| 'description_default_regular'
|
|
25
|
+
| 'description_default_regularstrikethrought'
|
|
26
|
+
| 'description_xs_regular'
|
|
27
|
+
| 'description_xs_regularstrikethrought'
|
|
28
|
+
| 'label_default_medium'
|
|
29
|
+
| 'label_s_medium'
|
|
30
|
+
| 'label_xs_medium'
|
|
31
|
+
| 'action_default_bold'
|
|
32
|
+
| 'action_s_bold'
|
|
33
|
+
| 'action_xs_bold'
|
|
34
|
+
| 'action_xxs_bold';
|
package/Title/index.tsx
CHANGED
|
@@ -39,7 +39,7 @@ const Title: FC<TitleProps> = ({
|
|
|
39
39
|
const renderAction = () => {
|
|
40
40
|
return !!actionTitle && titleFlex ? (
|
|
41
41
|
<TouchableOpacity onPress={onPressAction}>
|
|
42
|
-
<Text typography={'
|
|
42
|
+
<Text typography={'action_s_bold'} color={theme.colors.primary}>
|
|
43
43
|
{actionTitle}
|
|
44
44
|
</Text>
|
|
45
45
|
</TouchableOpacity>
|
|
@@ -116,7 +116,7 @@ const Title: FC<TitleProps> = ({
|
|
|
116
116
|
{!!description && type !== 'screen' && (
|
|
117
117
|
<Text
|
|
118
118
|
numberOfLines={1}
|
|
119
|
-
typography={'
|
|
119
|
+
typography={'description_default_regular'}
|
|
120
120
|
color={theme.colors.text.secondary}>
|
|
121
121
|
{description}
|
|
122
122
|
</Text>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.49",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
},
|
|
44
44
|
"author": "@momo-kits/foundation",
|
|
45
45
|
"license": "ISC"
|
|
46
|
-
}
|
|
46
|
+
}
|
package/publish.sh
CHANGED
|
@@ -13,7 +13,7 @@ echo VERSION: $VERSION
|
|
|
13
13
|
rsync -r --verbose --exclude '*.mdx' --exclude '*Demo.js' --exclude 'props-type.js' --exclude 'prop-types.js' ./* dist
|
|
14
14
|
|
|
15
15
|
cd dist
|
|
16
|
-
npm publish --tag
|
|
16
|
+
npm publish --tag beta --access=public
|
|
17
17
|
|
|
18
18
|
#clear dist and package json
|
|
19
19
|
cd ..
|
package/verify.js
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
console.error(`Installation failed: ${error.message}`);
|
|
42
|
-
process.exit(1);
|
|
4
|
+
const packageInfo = JSON.parse(
|
|
5
|
+
fs.readFileSync(path.join(`${__dirname}`, 'package.json'), 'utf8')
|
|
6
|
+
);
|
|
7
|
+
const packageVersion = parseInt(packageInfo?.version.split('.')?.[1]);
|
|
8
|
+
|
|
9
|
+
const app = path.join(`${__dirname}/../../../`, 'app.json');
|
|
10
|
+
const miniJson = path.join(`${__dirname}/../../../`, 'package.json');
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(app) || !fs.existsSync(miniJson)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const appInfo = JSON.parse(fs.readFileSync(app, 'utf8'));
|
|
17
|
+
const miniInfo = JSON.parse(fs.readFileSync(miniJson, 'utf8'));
|
|
18
|
+
|
|
19
|
+
const iOSAppTarget = appInfo?.client?.ios.deploymentTarget;
|
|
20
|
+
const androidAppTarget = appInfo?.client?.android.deploymentTarget;
|
|
21
|
+
|
|
22
|
+
if (
|
|
23
|
+
miniInfo?.dependencies?.['@momo-platform/momo-core']?.includes('optimize')
|
|
24
|
+
) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (packageVersion > iOSAppTarget || packageVersion > androidAppTarget) {
|
|
29
|
+
throw new Error(
|
|
30
|
+
`\x1b[41m Package ${packageInfo.name} version: ${packageInfo.version} require deploymentTarget ${packageVersion}`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (
|
|
35
|
+
miniInfo?.dependencies?.['@momo-platform/momo-core'] &&
|
|
36
|
+
miniInfo?.dependencies?.['@momo-platform/momo-core'] !== packageInfo?.version
|
|
37
|
+
) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
`\x1b[41m Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`
|
|
40
|
+
);
|
|
43
41
|
}
|