@momo-kits/native-kits 0.156.2 → 0.156.3-beta.1-debug
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/PUBLISH_GUIDE.md +386 -255
- package/build.gradle.kts +11 -0
- package/compose/build.gradle.kts +180 -0
- package/compose/build.gradle.kts.backup +180 -0
- package/compose/compose.podspec +54 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +113 -0
- package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
- package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +57 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +95 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +201 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +222 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +305 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +715 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +121 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +405 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +83 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +340 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +348 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +94 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +136 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +543 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +148 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +116 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +447 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +172 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +244 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +231 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +234 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +254 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +241 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +364 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +92 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +352 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +103 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +70 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +96 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +96 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +92 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +130 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +214 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +177 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +205 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +239 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +191 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +306 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +13 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +189 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +285 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +35 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +59 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +68 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +14 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +239 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +119 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +98 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +163 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +331 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +497 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +162 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +226 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +187 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +274 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +80 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +306 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +31 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +370 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +132 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +42 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +62 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +88 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +152 -0
- package/gradle/libs.versions.toml +57 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/gradle.properties +26 -0
- package/gradlew +252 -0
- package/gradlew.bat +94 -0
- package/package.json +1 -1
- package/publish.sh +151 -156
- package/settings.gradle.kts +52 -0
- package/example/ios/Example.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -46
package/PUBLISH_GUIDE.md
CHANGED
|
@@ -8,13 +8,13 @@ Tài liệu này hướng dẫn cách sử dụng script publish cho `@momo-kits
|
|
|
8
8
|
|
|
9
9
|
Dự án sử dụng **`publish.sh`** - một script thống nhất hỗ trợ 2 modes:
|
|
10
10
|
|
|
11
|
-
- **`beta`**: Publish phiên bản beta cho testing
|
|
11
|
+
- **`beta`**: Publish phiên bản beta/alpha cho testing
|
|
12
12
|
- **`release`**: Publish phiên bản release chính thức
|
|
13
13
|
|
|
14
14
|
Script có 3 phases riêng biệt:
|
|
15
15
|
1. **Check Version**: Kiểm tra và chuẩn bị version
|
|
16
|
-
2. **Publish
|
|
17
|
-
3. **Publish
|
|
16
|
+
2. **Publish Maven**: Publish lên GitLab Maven repository
|
|
17
|
+
3. **Publish NPM**: Publish lên NPM registry
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
@@ -46,11 +46,11 @@ sh publish.sh beta
|
|
|
46
46
|
# Phase 1: Check version
|
|
47
47
|
sh publish.sh beta check
|
|
48
48
|
|
|
49
|
-
# Phase 2: Publish
|
|
50
|
-
sh publish.sh beta npm
|
|
51
|
-
|
|
52
|
-
# Phase 3: Publish Maven
|
|
49
|
+
# Phase 2: Publish Maven
|
|
53
50
|
sh publish.sh beta maven
|
|
51
|
+
|
|
52
|
+
# Phase 3: Publish NPM
|
|
53
|
+
sh publish.sh beta npm
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
#### **Quy Trình Beta Publishing**
|
|
@@ -72,92 +72,210 @@ sh publish.sh beta maven
|
|
|
72
72
|
sh publish.sh beta
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 📦 Version Types (Beta Mode)
|
|
78
|
+
|
|
79
|
+
Beta mode hỗ trợ 2 loại version:
|
|
80
|
+
|
|
81
|
+
### **1. Specific Version (Tag: alpha)**
|
|
82
|
+
|
|
83
|
+
**Định nghĩa:** Version có suffix KHÔNG phải "beta"
|
|
84
|
+
|
|
85
|
+
**Ví dụ:**
|
|
86
|
+
- `0.156.2-test.1`
|
|
87
|
+
- `0.156.2-alpha.1`
|
|
88
|
+
- `0.156.2-rc.1`
|
|
89
|
+
|
|
90
|
+
**Behavior:**
|
|
91
|
+
- NPM tag: `alpha`
|
|
92
|
+
- Check existence: ❌ **FAIL** nếu version đã tồn tại
|
|
93
|
+
- Không auto-increment
|
|
94
|
+
- Developer phải tự quản lý version
|
|
95
|
+
|
|
96
|
+
**Use case:** Testing specific features, hotfix testing
|
|
97
|
+
|
|
98
|
+
### **2. Normal Version (Tag: beta)**
|
|
99
|
+
|
|
100
|
+
**Định nghĩa:** Version có suffix "beta" HOẶC không có suffix
|
|
101
|
+
|
|
102
|
+
**Ví dụ:**
|
|
103
|
+
- `0.156.2` (no suffix)
|
|
104
|
+
- `0.156.2-beta.1`
|
|
105
|
+
- `0.156.2-beta.5`
|
|
106
|
+
|
|
107
|
+
**Behavior:**
|
|
108
|
+
- NPM tag: `beta`
|
|
109
|
+
- Auto-format: `0.156.2` → `0.156.2-beta.1`
|
|
110
|
+
- Auto-increment nếu tồn tại: `.beta.1` → `.beta.2` → `.beta.3`...
|
|
111
|
+
|
|
112
|
+
**Use case:** Regular beta testing, continuous development
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 🔍 Version Detection Examples
|
|
117
|
+
|
|
118
|
+
### **Example 1: Specific Version**
|
|
76
119
|
|
|
77
120
|
```bash
|
|
78
|
-
#
|
|
79
|
-
|
|
80
|
-
"version": "0.156.2"
|
|
121
|
+
# package.json
|
|
122
|
+
{
|
|
123
|
+
"version": "0.156.2-test.1"
|
|
124
|
+
}
|
|
81
125
|
|
|
82
|
-
#
|
|
126
|
+
# Run
|
|
83
127
|
$ sh publish.sh beta check
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
$ sh publish.sh beta
|
|
91
|
-
🚀 PUBLISH SCRIPT - MODE: BETA
|
|
92
|
-
Running ALL PHASES
|
|
93
|
-
[... Phase 1: Check version ...]
|
|
94
|
-
[... Phase 2: Publish NPM ...]
|
|
95
|
-
🐛 Debug version: 0.156.2-debug (with compose) - Published first
|
|
96
|
-
📦 Normal version: 0.156.2 (without compose) - Published second
|
|
97
|
-
🏷️ NPM Tag: beta
|
|
98
|
-
[... Phase 3: Publish Maven ...]
|
|
99
|
-
🎉 ALL PHASES COMPLETED SUCCESSFULLY!
|
|
128
|
+
|
|
129
|
+
# Output
|
|
130
|
+
🏷️ Detected: SPECIFIC version (tag: alpha)
|
|
131
|
+
🔎 Checking if specific version 0.156.2-test.1 exists on npm...
|
|
132
|
+
✅ Specific version 0.156.2-test.1 does not exist on npm. Safe to publish.
|
|
133
|
+
✅ NPM tag: alpha
|
|
100
134
|
```
|
|
101
135
|
|
|
102
|
-
|
|
136
|
+
**Kết quả trên NPM:**
|
|
137
|
+
- `@momo-kits/native-kits@0.156.2-test.1` (tag: **alpha**)
|
|
138
|
+
- `@momo-kits/native-kits@0.156.2-test.1-debug` (tag: **alpha**)
|
|
139
|
+
|
|
140
|
+
### **Example 2: Normal Version (No Suffix)**
|
|
103
141
|
|
|
104
142
|
```bash
|
|
143
|
+
# package.json
|
|
144
|
+
{
|
|
145
|
+
"version": "0.156.2"
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
# Run
|
|
105
149
|
$ sh publish.sh beta check
|
|
106
|
-
❌ ERROR: Version 0.156.1 already exists on npm!
|
|
107
150
|
|
|
108
|
-
|
|
151
|
+
# Output
|
|
152
|
+
🏷️ Detected: NORMAL version (tag: beta)
|
|
153
|
+
🔄 Adding beta suffix: 0.156.2 → 0.156.2-beta.1
|
|
154
|
+
🔎 Checking version 0.156.2-beta.1 on npm...
|
|
155
|
+
✅ Version 0.156.2-beta.1 does not exist on npm. Using this version.
|
|
156
|
+
✅ NPM tag: beta
|
|
109
157
|
```
|
|
110
158
|
|
|
111
|
-
**
|
|
159
|
+
**Kết quả trên NPM:**
|
|
160
|
+
- `@momo-kits/native-kits@0.156.2-beta.1` (tag: **beta**)
|
|
161
|
+
- `@momo-kits/native-kits@0.156.2-beta.1-debug` (tag: **beta**)
|
|
162
|
+
|
|
163
|
+
### **Example 3: Normal Version (With Beta Suffix)**
|
|
164
|
+
|
|
112
165
|
```bash
|
|
113
|
-
#
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
166
|
+
# package.json
|
|
167
|
+
{
|
|
168
|
+
"version": "0.156.2-beta.1"
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
# Giả sử npm đã có: beta.1, beta.2
|
|
117
172
|
|
|
118
|
-
#
|
|
173
|
+
# Run
|
|
174
|
+
$ sh publish.sh beta check
|
|
175
|
+
|
|
176
|
+
# Output
|
|
177
|
+
🏷️ Detected: NORMAL version (tag: beta)
|
|
178
|
+
🔎 Checking version 0.156.2-beta.1 on npm...
|
|
179
|
+
⚠️ Version 0.156.2-beta.1 already exists on npm. Auto-incrementing...
|
|
180
|
+
Version incremented: 0.156.2-beta.1 → 0.156.2-beta.2
|
|
181
|
+
⚠️ Version 0.156.2-beta.2 already exists on npm. Auto-incrementing...
|
|
182
|
+
Version incremented: 0.156.2-beta.2 → 0.156.2-beta.3
|
|
183
|
+
✅ Version 0.156.2-beta.3 does not exist on npm. Using this version.
|
|
184
|
+
✅ NPM tag: beta
|
|
119
185
|
```
|
|
120
186
|
|
|
121
|
-
|
|
187
|
+
**Kết quả trên NPM:**
|
|
188
|
+
- `@momo-kits/native-kits@0.156.2-beta.3` (tag: **beta**)
|
|
189
|
+
- `@momo-kits/native-kits@0.156.2-beta.3-debug` (tag: **beta**)
|
|
122
190
|
|
|
123
|
-
|
|
191
|
+
### **Example 4: Specific Version Already Exists (FAIL)**
|
|
124
192
|
|
|
125
193
|
```bash
|
|
126
|
-
|
|
194
|
+
# package.json
|
|
195
|
+
{
|
|
196
|
+
"version": "0.156.2-test.1"
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
# Version đã tồn tại trên npm
|
|
200
|
+
|
|
201
|
+
# Run
|
|
202
|
+
$ sh publish.sh beta check
|
|
203
|
+
|
|
204
|
+
# Output
|
|
205
|
+
🏷️ Detected: SPECIFIC version (tag: alpha)
|
|
206
|
+
🔎 Checking if specific version 0.156.2-test.1 exists on npm...
|
|
207
|
+
|
|
208
|
+
❌ ERROR: Specific version 0.156.2-test.1 already exists on npm!
|
|
209
|
+
|
|
210
|
+
Please update the version in package.json before publishing.
|
|
211
|
+
# Exit code: 1
|
|
127
212
|
```
|
|
128
213
|
|
|
129
|
-
|
|
214
|
+
---
|
|
130
215
|
|
|
131
|
-
|
|
132
|
-
# Phase 1: Check version
|
|
133
|
-
sh publish.sh release check
|
|
216
|
+
## 🟢 Publish Release Từ Local
|
|
134
217
|
|
|
135
|
-
|
|
136
|
-
sh publish.sh release npm
|
|
218
|
+
### **Đặc Điểm Quan Trọng**
|
|
137
219
|
|
|
138
|
-
|
|
220
|
+
⚠️ **Release mode KHÔNG đọc version từ `package.json`**
|
|
221
|
+
|
|
222
|
+
✅ **Release mode đọc version từ `npm@latest`**
|
|
223
|
+
|
|
224
|
+
### **Cách Publish**
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
# Publish tất cả phases
|
|
228
|
+
sh publish.sh release
|
|
229
|
+
|
|
230
|
+
# Hoặc từng phase
|
|
231
|
+
sh publish.sh release check
|
|
139
232
|
sh publish.sh release maven
|
|
233
|
+
sh publish.sh release npm
|
|
140
234
|
```
|
|
141
235
|
|
|
142
|
-
|
|
236
|
+
### **Quy Trình Release Publishing**
|
|
143
237
|
|
|
144
|
-
1. **
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
238
|
+
1. **Script đọc version từ npm@latest:**
|
|
239
|
+
```bash
|
|
240
|
+
npm view @momo-kits/native-kits@latest version
|
|
241
|
+
# Output: 0.156.2
|
|
149
242
|
```
|
|
150
243
|
|
|
151
|
-
2. **
|
|
152
|
-
```
|
|
153
|
-
|
|
244
|
+
2. **Auto-increment patch version:**
|
|
245
|
+
```
|
|
246
|
+
0.156.2 → 0.156.3
|
|
154
247
|
```
|
|
155
248
|
|
|
156
|
-
3. **
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
249
|
+
3. **Check existence và tiếp tục increment nếu cần:**
|
|
250
|
+
```
|
|
251
|
+
0.156.3 exists? → 0.156.4
|
|
252
|
+
0.156.4 exists? → 0.156.5
|
|
253
|
+
...
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
4. **Update `package.json` với version mới**
|
|
257
|
+
|
|
258
|
+
5. **Publish với tag `latest`**
|
|
259
|
+
|
|
260
|
+
### **Example: Release Publishing**
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
$ sh publish.sh release check
|
|
264
|
+
|
|
265
|
+
# Output
|
|
266
|
+
🔍 Reading latest version from npm@latest (NOT from package.json)...
|
|
267
|
+
📦 Current @latest version on npm: 0.156.2
|
|
268
|
+
🔼 Auto-incremented version: 0.156.2 → 0.156.3
|
|
269
|
+
🔎 Checking if version 0.156.3 exists on npm...
|
|
270
|
+
✅ Version 0.156.3 does not exist on npm. Using this version.
|
|
271
|
+
📝 Updated package.json: 0.156.2-beta.5 → 0.156.3
|
|
272
|
+
✅ Using version: 0.156.3
|
|
273
|
+
✅ NPM tag: latest
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Kết quả trên NPM:**
|
|
277
|
+
- `@momo-kits/native-kits@0.156.3` (tag: **latest**)
|
|
278
|
+
- `@momo-kits/native-kits@0.156.3-debug` (tag: **latest**)
|
|
161
279
|
|
|
162
280
|
---
|
|
163
281
|
|
|
@@ -165,18 +283,19 @@ sh publish.sh release maven
|
|
|
165
283
|
|
|
166
284
|
### 🔵 Beta Publishing (GitLab CI)
|
|
167
285
|
|
|
168
|
-
**Trigger:** Commit message chứa `[ci build]`
|
|
286
|
+
**Trigger:** Commit message chứa `[ci build]` (KHÔNG trên nhánh `main`)
|
|
169
287
|
|
|
170
288
|
```bash
|
|
289
|
+
git checkout develop
|
|
171
290
|
git add .
|
|
172
291
|
git commit -m "feat: add new feature [ci build]"
|
|
173
292
|
git push
|
|
174
293
|
```
|
|
175
294
|
|
|
176
295
|
**Pipeline sẽ chạy 3 stages:**
|
|
177
|
-
1. `beta_check_version`
|
|
178
|
-
2. `
|
|
179
|
-
3. `
|
|
296
|
+
1. `beta_check_version` (Phase 1)
|
|
297
|
+
2. `beta_publish_maven` (Phase 2)
|
|
298
|
+
3. `beta_publish_npm` (Phase 3)
|
|
180
299
|
|
|
181
300
|
### 🟢 Release Publishing (GitLab CI)
|
|
182
301
|
|
|
@@ -189,9 +308,9 @@ git push origin main
|
|
|
189
308
|
```
|
|
190
309
|
|
|
191
310
|
**Pipeline sẽ chạy 3 stages:**
|
|
192
|
-
1. `release_check_version`
|
|
193
|
-
2. `
|
|
194
|
-
3. `
|
|
311
|
+
1. `release_check_version` (Phase 1)
|
|
312
|
+
2. `release_publish_maven` (Phase 2)
|
|
313
|
+
3. `release_publish_npm` (Phase 3)
|
|
195
314
|
|
|
196
315
|
---
|
|
197
316
|
|
|
@@ -200,123 +319,100 @@ git push origin main
|
|
|
200
319
|
| Tiêu chí | Beta Mode | Release Mode |
|
|
201
320
|
|----------|-----------|--------------|
|
|
202
321
|
| **Script** | `sh publish.sh beta` | `sh publish.sh release` |
|
|
203
|
-
| **Trigger CI** | Commit có `[ci build]` | Push vào `main` |
|
|
204
|
-
| **Version
|
|
205
|
-
| **
|
|
206
|
-
| **NPM Tag** | `beta` | `latest` |
|
|
207
|
-
| **
|
|
322
|
+
| **Trigger CI** | Commit có `[ci build]` (không trên main) | Push vào `main` |
|
|
323
|
+
| **Read Version** | Từ `package.json` | Từ `npm@latest` |
|
|
324
|
+
| **Version Types** | Specific (alpha) / Normal (beta) | N/A |
|
|
325
|
+
| **NPM Tag** | `alpha` hoặc `beta` | `latest` |
|
|
326
|
+
| **If Exists** | Specific: FAIL / Normal: Auto-increment | Auto-increment |
|
|
327
|
+
| **Phase Order** | Check → Maven → NPM | Check → Maven → NPM |
|
|
208
328
|
|
|
209
329
|
---
|
|
210
330
|
|
|
211
|
-
##
|
|
212
|
-
|
|
213
|
-
### **Phase 1: Check Version**
|
|
331
|
+
## 🔧 NPM Tags Explained
|
|
214
332
|
|
|
215
|
-
**
|
|
216
|
-
- Đọc version từ `package.json`
|
|
217
|
-
- Check version trên npm
|
|
218
|
-
- ❌ **FAIL** nếu version đã tồn tại
|
|
219
|
-
- Update `gradle.properties`
|
|
333
|
+
### **Tag: alpha**
|
|
220
334
|
|
|
221
|
-
**
|
|
222
|
-
- Đọc version từ `package.json`
|
|
223
|
-
- Convert sang format `-beta.*` nếu cần
|
|
224
|
-
- Check version trên npm
|
|
225
|
-
- ✅ **Auto-increment** nếu đã tồn tại
|
|
226
|
-
- Update `gradle.properties`
|
|
335
|
+
**Khi nào:** Beta mode + Specific version
|
|
227
336
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
337
|
+
**Cài đặt:**
|
|
338
|
+
```bash
|
|
339
|
+
npm install @momo-kits/native-kits@alpha
|
|
340
|
+
npm install @momo-kits/native-kits@0.156.2-test.1
|
|
341
|
+
```
|
|
231
342
|
|
|
232
|
-
|
|
233
|
-
- Version: `X.Y.Z-debug`
|
|
234
|
-
- Bao gồm thư mục `compose/`
|
|
235
|
-
- Dành cho development/testing
|
|
343
|
+
**Use case:** Testing specific features, experimental builds
|
|
236
344
|
|
|
237
|
-
|
|
238
|
-
- Version: `X.Y.Z`
|
|
239
|
-
- Không bao gồm `compose/`
|
|
240
|
-
- Dành cho React Native apps
|
|
345
|
+
### **Tag: beta**
|
|
241
346
|
|
|
242
|
-
|
|
347
|
+
**Khi nào:** Beta mode + Normal version
|
|
243
348
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
349
|
+
**Cài đặt:**
|
|
350
|
+
```bash
|
|
351
|
+
npm install @momo-kits/native-kits@beta
|
|
352
|
+
npm install @momo-kits/native-kits@0.156.2-beta.1
|
|
353
|
+
```
|
|
247
354
|
|
|
248
|
-
|
|
355
|
+
**Use case:** Regular beta testing, pre-release versions
|
|
249
356
|
|
|
250
|
-
|
|
357
|
+
### **Tag: latest**
|
|
251
358
|
|
|
252
|
-
|
|
359
|
+
**Khi nào:** Release mode
|
|
253
360
|
|
|
361
|
+
**Cài đặt:**
|
|
254
362
|
```bash
|
|
255
|
-
|
|
363
|
+
npm install @momo-kits/native-kits@latest
|
|
364
|
+
npm install @momo-kits/native-kits
|
|
365
|
+
npm install @momo-kits/native-kits@0.156.3
|
|
366
|
+
```
|
|
256
367
|
|
|
257
|
-
|
|
258
|
-
🔎 Checking if version 0.156.2 already exists on npm...
|
|
259
|
-
✅ Version 0.156.2 does not exist on npm. Safe to publish.
|
|
368
|
+
**Use case:** Production releases, stable versions
|
|
260
369
|
|
|
261
|
-
|
|
262
|
-
🐛 Debug version: 0.156.2-debug (with compose) - Published first
|
|
263
|
-
📦 Normal version: 0.156.2 (without compose) - Published second
|
|
264
|
-
🏷️ NPM Tag: beta
|
|
265
|
-
```
|
|
370
|
+
---
|
|
266
371
|
|
|
267
|
-
|
|
268
|
-
- `@momo-kits/native-kits@0.156.2-debug` (tag: beta)
|
|
269
|
-
- `@momo-kits/native-kits@0.156.2` (tag: beta)
|
|
372
|
+
## 🔍 Chi Tiết Các Phases
|
|
270
373
|
|
|
271
|
-
### **
|
|
374
|
+
### **Phase 1: Check Version**
|
|
272
375
|
|
|
273
|
-
|
|
274
|
-
|
|
376
|
+
**Beta Mode:**
|
|
377
|
+
1. Đọc version từ `package.json`
|
|
378
|
+
2. Phát hiện version type (specific vs normal)
|
|
379
|
+
3. Set NPM tag (alpha vs beta)
|
|
380
|
+
4. Format version:
|
|
381
|
+
- Specific: Check existence, fail if exists
|
|
382
|
+
- Normal: Add beta suffix, auto-increment if exists
|
|
383
|
+
5. Update `gradle.properties`
|
|
275
384
|
|
|
276
|
-
|
|
277
|
-
|
|
385
|
+
**Release Mode:**
|
|
386
|
+
1. Đọc version từ `npm@latest` (KHÔNG từ package.json)
|
|
387
|
+
2. Increment patch version
|
|
388
|
+
3. Check existence, auto-increment if exists
|
|
389
|
+
4. Update `package.json` và `gradle.properties`
|
|
390
|
+
5. Set NPM tag = `latest`
|
|
278
391
|
|
|
279
|
-
|
|
392
|
+
### **Phase 2: Publish Maven**
|
|
280
393
|
|
|
281
|
-
|
|
282
|
-
# Exit code: 1
|
|
283
|
-
```
|
|
394
|
+
**Thứ tự:** Chạy SAU phase 1, TRƯỚC phase 3
|
|
284
395
|
|
|
285
|
-
|
|
396
|
+
**Hành động:**
|
|
397
|
+
- Publish Kotlin Multiplatform artifacts
|
|
398
|
+
- Lên GitLab Packages Repository
|
|
399
|
+
- Dành cho `compose` module
|
|
286
400
|
|
|
287
|
-
|
|
288
|
-
$ sh publish.sh release
|
|
289
|
-
|
|
290
|
-
📦 Version from package.json: 0.156.1-test.5
|
|
291
|
-
🔄 Converting to beta format: 0.156.1-test.5 → 0.156.1-beta.1
|
|
292
|
-
✅ Version updated to beta format: 0.156.1-beta.1
|
|
293
|
-
🔎 Checking if version 0.156.1-beta.1 already exists on npm...
|
|
294
|
-
⚠️ Version 0.156.1-beta.1 already exists on npm. Auto-incrementing...
|
|
295
|
-
Version incremented: 0.156.1-beta.1 → 0.156.1-beta.2
|
|
296
|
-
🔄 Checking version 0.156.1-beta.2 on npm...
|
|
297
|
-
✅ Version 0.156.1-beta.2 does not exist on npm. Using this version.
|
|
298
|
-
```
|
|
401
|
+
### **Phase 3: Publish NPM**
|
|
299
402
|
|
|
300
|
-
**
|
|
301
|
-
- `@momo-kits/native-kits@0.156.1-beta.2-debug` (tag: latest)
|
|
302
|
-
- `@momo-kits/native-kits@0.156.1-beta.2` (tag: latest)
|
|
403
|
+
**Thứ tự:** Chạy SAU phase 2 (Maven)
|
|
303
404
|
|
|
304
|
-
|
|
405
|
+
**Publish 2 versions theo thứ tự:**
|
|
305
406
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
Version incremented: 0.156.1-beta.6 → 0.156.1-beta.7
|
|
316
|
-
⚠️ Version 0.156.1-beta.7 already exists on npm...
|
|
317
|
-
Version incremented: 0.156.1-beta.7 → 0.156.1-beta.8
|
|
318
|
-
✅ Version 0.156.1-beta.8 does not exist on npm. Using this version.
|
|
319
|
-
```
|
|
407
|
+
1. **Debug version** (với compose) - FIRST
|
|
408
|
+
- Version: `X.Y.Z-debug`
|
|
409
|
+
- Bao gồm thư mục `compose/`
|
|
410
|
+
- Tag: `alpha` / `beta` / `latest`
|
|
411
|
+
|
|
412
|
+
2. **Normal version** (không compose) - SECOND
|
|
413
|
+
- Version: `X.Y.Z`
|
|
414
|
+
- Không bao gồm `compose/`
|
|
415
|
+
- Tag: `alpha` / `beta` / `latest`
|
|
320
416
|
|
|
321
417
|
---
|
|
322
418
|
|
|
@@ -328,20 +424,22 @@ $ sh publish.sh release
|
|
|
328
424
|
┌──────────────────────────────────────────────────┐
|
|
329
425
|
│ 1. Develop Feature │
|
|
330
426
|
│ - Code changes │
|
|
331
|
-
│ - Update version in package.json
|
|
427
|
+
│ - Update version in package.json (beta only) │
|
|
332
428
|
└─────────────────┬────────────────────────────────┘
|
|
333
429
|
↓
|
|
334
430
|
┌──────────────────────────────────────────────────┐
|
|
335
431
|
│ 2. Beta Testing │
|
|
336
432
|
│ Local: sh publish.sh beta │
|
|
337
433
|
│ CI: git commit -m "feat: xxx [ci build]" │
|
|
434
|
+
│ Tag: alpha (specific) or beta (normal) │
|
|
338
435
|
└─────────────────┬────────────────────────────────┘
|
|
339
436
|
↓
|
|
340
437
|
┌──────────────────────────────────────────────────┐
|
|
341
438
|
│ 3. Team Testing │
|
|
342
439
|
│ npm install @momo-kits/native-kits@beta │
|
|
440
|
+
│ npm install @momo-kits/native-kits@alpha │
|
|
343
441
|
└─────────────────┬────────────────────────────────┘
|
|
344
|
-
|
|
442
|
+
│
|
|
345
443
|
┌──────┴──────┐
|
|
346
444
|
│ Approved? │
|
|
347
445
|
└──────┬───────┘
|
|
@@ -351,6 +449,7 @@ $ sh publish.sh release
|
|
|
351
449
|
│ 4. Release Production │
|
|
352
450
|
│ Local: sh publish.sh release │
|
|
353
451
|
│ CI: merge to main │
|
|
452
|
+
│ Reads from npm@latest, auto-increment │
|
|
354
453
|
└─────────────────┬────────────────────────────────┘
|
|
355
454
|
↓
|
|
356
455
|
┌──────────────────────────────────────────────────┐
|
|
@@ -363,31 +462,38 @@ $ sh publish.sh release
|
|
|
363
462
|
|
|
364
463
|
## ⚠️ Lưu Ý Quan Trọng
|
|
365
464
|
|
|
366
|
-
### 1.
|
|
465
|
+
### 1. Version Management
|
|
466
|
+
|
|
467
|
+
**Beta Mode:**
|
|
468
|
+
- Specific version: Phải unique, fail nếu tồn tại
|
|
469
|
+
- Normal version: Auto-increment, không cần lo
|
|
470
|
+
- Version trong `package.json` được sử dụng
|
|
367
471
|
|
|
368
|
-
**
|
|
369
|
-
|
|
370
|
-
|
|
472
|
+
**Release Mode:**
|
|
473
|
+
- ⚠️ **KHÔNG đọc từ `package.json`**
|
|
474
|
+
- ✅ **Đọc từ `npm@latest`**
|
|
475
|
+
- Auto-increment patch version
|
|
476
|
+
- `package.json` được UPDATE với version mới
|
|
371
477
|
|
|
372
|
-
|
|
478
|
+
### 2. NPM Tags
|
|
373
479
|
|
|
374
|
-
|
|
480
|
+
**Cài đặt theo tag:**
|
|
481
|
+
```bash
|
|
482
|
+
npm install @momo-kits/native-kits@alpha # Specific versions
|
|
483
|
+
npm install @momo-kits/native-kits@beta # Normal beta versions
|
|
484
|
+
npm install @momo-kits/native-kits@latest # Release versions
|
|
485
|
+
```
|
|
375
486
|
|
|
376
|
-
|
|
377
|
-
- Giữ nguyên format trong `package.json`
|
|
378
|
-
- Fail nếu đã tồn tại trên npm
|
|
379
|
-
- ⚠️ Developer phải tự quản lý version
|
|
487
|
+
### 3. Phase Execution Order
|
|
380
488
|
|
|
381
|
-
**Release
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
- `0.156.1-rc.3` → `0.156.1-beta.1`
|
|
386
|
-
- Auto-increment nếu tồn tại:
|
|
387
|
-
- Beta: `-beta.5` → `-beta.6`
|
|
388
|
-
- Regular: `1.0.0` → `1.0.1`
|
|
489
|
+
**Cả Beta và Release:**
|
|
490
|
+
1. Check Version
|
|
491
|
+
2. ✅ **Publish Maven** (FIRST)
|
|
492
|
+
3. ✅ **Publish NPM** (SECOND)
|
|
389
493
|
|
|
390
|
-
|
|
494
|
+
**Lý do:** Maven artifacts cần được publish trước để NPM debug version có thể reference
|
|
495
|
+
|
|
496
|
+
### 4. File Modifications
|
|
391
497
|
|
|
392
498
|
Script tạm thời modify các file (restore sau publish):
|
|
393
499
|
- `package.json` (version)
|
|
@@ -395,93 +501,74 @@ Script tạm thời modify các file (restore sau publish):
|
|
|
395
501
|
- `.npmignore` (cho debug version)
|
|
396
502
|
- `compose/build.gradle.kts` (cho debug version)
|
|
397
503
|
|
|
398
|
-
### 4. NPM Permissions
|
|
399
|
-
|
|
400
|
-
```bash
|
|
401
|
-
# Check account hiện tại
|
|
402
|
-
npm whoami
|
|
403
|
-
|
|
404
|
-
# Login nếu cần
|
|
405
|
-
npm login
|
|
406
|
-
|
|
407
|
-
# Verify permissions
|
|
408
|
-
npm access ls-packages @momo-kits
|
|
409
|
-
```
|
|
410
|
-
|
|
411
504
|
---
|
|
412
505
|
|
|
413
506
|
## 🐛 Troubleshooting
|
|
414
507
|
|
|
415
|
-
### Lỗi: "
|
|
416
|
-
|
|
417
|
-
**Nguyên nhân:** File `package.json` không hợp lệ
|
|
418
|
-
|
|
419
|
-
**Giải pháp:**
|
|
420
|
-
```bash
|
|
421
|
-
# Kiểm tra syntax
|
|
422
|
-
cat package.json | jq .
|
|
423
|
-
|
|
424
|
-
# Kiểm tra version field
|
|
425
|
-
cat package.json | grep version
|
|
426
|
-
```
|
|
508
|
+
### Lỗi: "Specific version already exists on npm"
|
|
427
509
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
**Nguyên nhân:** Version đã được publish
|
|
510
|
+
**Nguyên nhân:** Specific version đã được publish
|
|
431
511
|
|
|
432
512
|
**Giải pháp:**
|
|
433
513
|
```bash
|
|
434
514
|
# Option 1: Tăng version thủ công
|
|
435
515
|
vim package.json
|
|
436
|
-
# "version": "0.156.1" → "0.156.2"
|
|
516
|
+
# "version": "0.156.2-test.1" → "0.156.2-test.2"
|
|
437
517
|
|
|
438
|
-
# Option 2:
|
|
439
|
-
|
|
518
|
+
# Option 2: Chuyển sang normal version
|
|
519
|
+
vim package.json
|
|
520
|
+
# "version": "0.156.2-test.1" → "0.156.2"
|
|
521
|
+
# Script sẽ auto-format thành 0.156.2-beta.1
|
|
440
522
|
```
|
|
441
523
|
|
|
442
|
-
### Lỗi: "
|
|
524
|
+
### Lỗi: "Could not read version from npm@latest"
|
|
443
525
|
|
|
444
|
-
**Nguyên nhân:**
|
|
526
|
+
**Nguyên nhân:** Package chưa tồn tại trên npm hoặc chưa có version @latest
|
|
445
527
|
|
|
446
528
|
**Giải pháp:**
|
|
447
529
|
```bash
|
|
448
|
-
#
|
|
449
|
-
npm
|
|
450
|
-
|
|
451
|
-
# 2. Login với account có quyền
|
|
452
|
-
npm login
|
|
530
|
+
# Kiểm tra package trên npm
|
|
531
|
+
npm view @momo-kits/native-kits
|
|
453
532
|
|
|
454
|
-
#
|
|
533
|
+
# Nếu chưa có, publish beta trước
|
|
534
|
+
sh publish.sh beta
|
|
455
535
|
```
|
|
456
536
|
|
|
457
|
-
###
|
|
537
|
+
### Beta không trigger trên GitLab CI
|
|
458
538
|
|
|
459
|
-
**
|
|
460
|
-
- ✅
|
|
461
|
-
- ✅
|
|
539
|
+
**Kiểm tra:**
|
|
540
|
+
- ✅ Commit message có `[ci build]`
|
|
541
|
+
- ✅ Branch KHÔNG phải `main`
|
|
542
|
+
- ✅ Branch KHÔNG match `engine/w*`
|
|
462
543
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
544
|
+
### Release không trigger trên GitLab CI
|
|
545
|
+
|
|
546
|
+
**Kiểm tra:**
|
|
547
|
+
- ✅ Đang push vào `main` branch
|
|
548
|
+
- ✅ GitLab CI settings enabled
|
|
466
549
|
|
|
467
550
|
---
|
|
468
551
|
|
|
469
552
|
## 📦 Sử Dụng Packages
|
|
470
553
|
|
|
471
|
-
### Cài Đặt Beta
|
|
554
|
+
### Cài Đặt Beta/Alpha Versions
|
|
472
555
|
|
|
473
556
|
```bash
|
|
474
|
-
# Latest
|
|
557
|
+
# Latest alpha (specific versions)
|
|
558
|
+
npm install @momo-kits/native-kits@alpha
|
|
559
|
+
|
|
560
|
+
# Latest beta (normal versions)
|
|
475
561
|
npm install @momo-kits/native-kits@beta
|
|
476
562
|
|
|
477
|
-
# Specific
|
|
478
|
-
npm install @momo-kits/native-kits@0.156.2
|
|
563
|
+
# Specific version
|
|
564
|
+
npm install @momo-kits/native-kits@0.156.2-beta.1
|
|
565
|
+
npm install @momo-kits/native-kits@0.156.2-test.1
|
|
479
566
|
|
|
480
567
|
# Debug version (with compose)
|
|
481
|
-
npm install @momo-kits/native-kits@0.156.2-debug
|
|
568
|
+
npm install @momo-kits/native-kits@0.156.2-beta.1-debug
|
|
482
569
|
```
|
|
483
570
|
|
|
484
|
-
### Cài Đặt Release
|
|
571
|
+
### Cài Đặt Release Versions
|
|
485
572
|
|
|
486
573
|
```bash
|
|
487
574
|
# Latest release
|
|
@@ -490,28 +577,41 @@ npm install @momo-kits/native-kits@latest
|
|
|
490
577
|
npm install @momo-kits/native-kits
|
|
491
578
|
|
|
492
579
|
# Specific release version
|
|
493
|
-
npm install @momo-kits/native-kits@0.156.
|
|
580
|
+
npm install @momo-kits/native-kits@0.156.3
|
|
494
581
|
```
|
|
495
582
|
|
|
496
583
|
---
|
|
497
584
|
|
|
498
585
|
## 🎓 Best Practices
|
|
499
586
|
|
|
500
|
-
1.
|
|
501
|
-
|
|
502
|
-
|
|
587
|
+
### 1. Beta Testing
|
|
588
|
+
|
|
589
|
+
**Specific versions (alpha tag):**
|
|
590
|
+
- Dùng cho testing features cụ thể
|
|
591
|
+
- Phải unique, không duplicate
|
|
592
|
+
- Ví dụ: `0.156.2-hotfix.1`, `0.156.2-experiment.1`
|
|
503
593
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
594
|
+
**Normal versions (beta tag):**
|
|
595
|
+
- Dùng cho continuous development
|
|
596
|
+
- Auto-increment, dễ quản lý
|
|
597
|
+
- Ví dụ: `0.156.2`, `0.156.2-beta.1`
|
|
507
598
|
|
|
508
|
-
|
|
509
|
-
- Chỉ release từ nhánh `main`
|
|
510
|
-
- Đảm bảo tất cả tests pass
|
|
599
|
+
### 2. Release
|
|
511
600
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
601
|
+
- Luôn merge vào `main` để trigger release
|
|
602
|
+
- Không cần lo version trong `package.json`
|
|
603
|
+
- Script tự động đọc từ npm@latest và increment
|
|
604
|
+
|
|
605
|
+
### 3. Version Naming
|
|
606
|
+
|
|
607
|
+
**Good:**
|
|
608
|
+
- `0.156.2-test.1` (specific, clear purpose)
|
|
609
|
+
- `0.156.2-beta.1` (normal, standard format)
|
|
610
|
+
- `0.156.2` (normal, will auto-format)
|
|
611
|
+
|
|
612
|
+
**Avoid:**
|
|
613
|
+
- `0.156.2-beta-test.1` (confusing)
|
|
614
|
+
- `0.156.2-v1` (unclear)
|
|
515
615
|
|
|
516
616
|
---
|
|
517
617
|
|
|
@@ -524,21 +624,52 @@ Nếu có vấn đề, liên hệ team hoặc tạo issue trên GitLab.
|
|
|
524
624
|
## 🔗 Quick Reference
|
|
525
625
|
|
|
526
626
|
```bash
|
|
527
|
-
# Beta - Local
|
|
528
|
-
|
|
529
|
-
sh publish.sh beta
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
sh publish.sh release
|
|
537
|
-
|
|
627
|
+
# Beta - Local (Specific version → alpha tag)
|
|
628
|
+
# package.json: "version": "0.156.2-test.1"
|
|
629
|
+
sh publish.sh beta
|
|
630
|
+
|
|
631
|
+
# Beta - Local (Normal version → beta tag)
|
|
632
|
+
# package.json: "version": "0.156.2"
|
|
633
|
+
sh publish.sh beta
|
|
634
|
+
|
|
635
|
+
# Release - Local (reads from npm@latest)
|
|
636
|
+
sh publish.sh release
|
|
637
|
+
|
|
638
|
+
# Individual phases
|
|
639
|
+
sh publish.sh beta check # Phase 1
|
|
640
|
+
sh publish.sh beta maven # Phase 2
|
|
641
|
+
sh publish.sh beta npm # Phase 3
|
|
538
642
|
|
|
539
643
|
# Beta - CI
|
|
540
|
-
git commit -m "feat: xxx [ci build]" # Trigger beta
|
|
644
|
+
git commit -m "feat: xxx [ci build]" # Trigger beta (not on main)
|
|
541
645
|
|
|
542
646
|
# Release - CI
|
|
543
647
|
git push origin main # Trigger release
|
|
544
648
|
```
|
|
649
|
+
|
|
650
|
+
---
|
|
651
|
+
|
|
652
|
+
## 📋 Version Type Decision Tree
|
|
653
|
+
|
|
654
|
+
```
|
|
655
|
+
Start: Publish Beta
|
|
656
|
+
↓
|
|
657
|
+
Check version in package.json
|
|
658
|
+
↓
|
|
659
|
+
Has suffix? (contains "-")
|
|
660
|
+
├─ No → Normal Version
|
|
661
|
+
│ ├─ Auto-add: 0.156.2 → 0.156.2-beta.1
|
|
662
|
+
│ ├─ Tag: beta
|
|
663
|
+
│ └─ Auto-increment if exists
|
|
664
|
+
│
|
|
665
|
+
└─ Yes → Check suffix type
|
|
666
|
+
├─ Contains "beta" → Normal Version
|
|
667
|
+
│ ├─ Keep format: 0.156.2-beta.1
|
|
668
|
+
│ ├─ Tag: beta
|
|
669
|
+
│ └─ Auto-increment if exists
|
|
670
|
+
│
|
|
671
|
+
└─ Other suffix → Specific Version
|
|
672
|
+
├─ Keep format: 0.156.2-test.1
|
|
673
|
+
├─ Tag: alpha
|
|
674
|
+
└─ FAIL if exists
|
|
675
|
+
```
|