@momo-kits/native-kits 0.156.1-beta.13-debug → 0.156.1-beta.15-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.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.156.1-beta.13-debug"
43
+ version = "0.156.1-beta.15-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
package/gradle.properties CHANGED
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.156.1-beta.13
21
+ version=0.156.1-test.6
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.156.1-beta.13-debug",
3
+ "version": "0.156.1-beta.15-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},
package/publish.sh CHANGED
@@ -48,7 +48,7 @@ phase_check_version() {
48
48
  PACKAGE_NAME=$(node -p "require('./package.json').name")
49
49
 
50
50
  # ==============================================================
51
- # BETA MODE: Detect specific vs normal, format accordingly
51
+ # BETA MODE: Check format for tag, fail if exists
52
52
  # ==============================================================
53
53
  if [ "$MODE" == "beta" ]; then
54
54
  echo "🔍 Reading version from package.json..."
@@ -61,89 +61,32 @@ phase_check_version() {
61
61
 
62
62
  echo "📦 Version from package.json: $VERSION"
63
63
 
64
- # Detect version type: specific vs normal
65
- # Specific: has suffix but NOT "beta" (e.g., 0.156.2-test.1, 0.156.2-alpha.1)
66
- # Normal: has "beta" suffix OR no suffix (e.g., 0.156.2-beta.1, 0.156.2)
64
+ # Detect tag based on version format
65
+ # Has "beta" in version → tag beta
66
+ # No "beta" in version tag alpha
67
67
 
68
- if [[ "$VERSION" == *"-"* ]] && [[ "$VERSION" != *"-beta."* ]]; then
69
- # Has suffix but not beta → specific
70
- VERSION_TYPE="specific"
71
- NPM_TAG="alpha"
72
- echo "🏷️ Detected: SPECIFIC version (tag: alpha)"
73
- else
74
- # Has beta suffix or no suffix → normal
75
- VERSION_TYPE="normal"
68
+ if [[ "$VERSION" == *"beta"* ]]; then
76
69
  NPM_TAG="beta"
77
- echo "🏷️ Detected: NORMAL version (tag: beta)"
70
+ echo "🏷️ Detected: Version contains 'beta' → tag: beta"
71
+ else
72
+ NPM_TAG="alpha"
73
+ echo "🏷️ Detected: Version does not contain 'beta' → tag: alpha"
78
74
  fi
79
75
 
80
- # Format version based on type
81
- if [ "$VERSION_TYPE" == "specific" ]; then
82
- # Specific: Check existence, FAIL if exists
83
- echo "🔎 Checking if specific version $VERSION exists on npm..."
84
- NPM_VERSION_INFO=$(npm view "$PACKAGE_NAME@$VERSION" version 2>/dev/null || echo "")
85
-
86
- if [ -n "$NPM_VERSION_INFO" ]; then
87
- echo ""
88
- echo " ERROR: Specific version $VERSION already exists on npm!"
89
- echo ""
90
- echo "Please update the version in package.json before publishing."
91
- echo ""
92
- exit 1
93
- fi
94
-
95
- echo "✅ Specific version $VERSION does not exist on npm. Safe to publish."
96
- else
97
- # Normal: Auto-format and increment
98
- # If no beta suffix, add -beta.1
99
- if [[ "$VERSION" != *"-beta."* ]]; then
100
- echo "🔄 Adding beta suffix: $VERSION → ${VERSION}-beta.1"
101
- VERSION="${VERSION}-beta.1"
102
-
103
- # Update package.json with beta version
104
- ORIGINAL_VERSION=$(node -p "require('./package.json').version")
105
- if [[ "$OSTYPE" == "darwin"* ]]; then
106
- sed -i '' "s/\"version\": \"$ORIGINAL_VERSION\"/\"version\": \"$VERSION\"/" package.json
107
- else
108
- sed -i "s/\"version\": \"$ORIGINAL_VERSION\"/\"version\": \"$VERSION\"/" package.json
109
- fi
110
- fi
111
-
112
- # Check if version exists and auto-increment
113
- echo "🔎 Checking version $VERSION on npm..."
114
- while true; do
115
- NPM_VERSION_INFO=$(npm view "$PACKAGE_NAME@$VERSION" version 2>/dev/null || echo "")
116
-
117
- if [ -n "$NPM_VERSION_INFO" ]; then
118
- echo "⚠️ Version $VERSION already exists on npm. Auto-incrementing..."
119
-
120
- # Extract base version and beta number (e.g., 0.156.1-beta.5)
121
- BASE_VERSION=$(echo "$VERSION" | cut -d'-' -f1)
122
- BETA_NUMBER=$(echo "$VERSION" | grep -oE 'beta\.([0-9]+)' | cut -d'.' -f2)
123
-
124
- # Increment beta number
125
- NEW_BETA_NUMBER=$((BETA_NUMBER + 1))
126
- NEW_VERSION="${BASE_VERSION}-beta.${NEW_BETA_NUMBER}"
127
-
128
- echo " Version incremented: $VERSION → $NEW_VERSION"
129
- VERSION="$NEW_VERSION"
130
- else
131
- echo "✅ Version $VERSION does not exist on npm. Using this version."
132
- break
133
- fi
134
- done
135
-
136
- # Update package.json with final version
137
- CURRENT_VERSION=$(node -p "require('./package.json').version")
138
- if [ "$CURRENT_VERSION" != "$VERSION" ]; then
139
- if [[ "$OSTYPE" == "darwin"* ]]; then
140
- sed -i '' "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$VERSION\"/" package.json
141
- else
142
- sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$VERSION\"/" package.json
143
- fi
144
- echo "📝 Updated package.json: $CURRENT_VERSION → $VERSION"
145
- fi
76
+ # Check if version exists on npm
77
+ echo "🔎 Checking if version $VERSION exists on npm..."
78
+ NPM_VERSION_INFO=$(npm view "$PACKAGE_NAME@$VERSION" version 2>/dev/null || echo "")
79
+
80
+ if [ -n "$NPM_VERSION_INFO" ]; then
81
+ echo ""
82
+ echo "❌ ERROR: Version $VERSION already exists on npm!"
83
+ echo ""
84
+ echo "Please update the version in package.json before publishing."
85
+ echo ""
86
+ exit 1
146
87
  fi
88
+
89
+ echo "✅ Version $VERSION does not exist on npm. Safe to publish."
147
90
  fi
148
91
 
149
92
  # ==============================================================
@@ -260,18 +203,26 @@ phase_publish_npm() {
260
203
  VERSION=$(node -p "require('./package.json').version")
261
204
  export VERSION="$VERSION"
262
205
 
206
+ echo "📦 Version from package.json: $VERSION"
207
+
263
208
  # Determine NPM tag (should already be set from phase 1, but fallback just in case)
264
209
  if [ -z "$NPM_TAG" ]; then
210
+ echo "⚠️ NPM_TAG not set, re-detecting..."
265
211
  if [ "$MODE" == "beta" ]; then
266
- # Re-detect version type
267
- if [[ "$VERSION" == *"-"* ]] && [[ "$VERSION" != *"-beta."* ]]; then
268
- NPM_TAG="alpha"
269
- else
212
+ # Re-detect based on version format
213
+ if [[ "$VERSION" == *"beta"* ]]; then
270
214
  NPM_TAG="beta"
215
+ echo "🏷️ Detected: Version contains 'beta' → tag: beta"
216
+ else
217
+ NPM_TAG="alpha"
218
+ echo "🏷️ Detected: Version does not contain 'beta' → tag: alpha"
271
219
  fi
272
220
  else
273
221
  NPM_TAG="latest"
222
+ echo "🏷️ Release mode → tag: latest"
274
223
  fi
224
+ else
225
+ echo "✅ NPM_TAG already set: $NPM_TAG"
275
226
  fi
276
227
 
277
228
  echo "📦 Publishing version: $VERSION"
@@ -289,11 +240,14 @@ phase_publish_npm() {
289
240
  DEBUG_VERSION="${VERSION}-debug"
290
241
  echo "📦 Debug version: $DEBUG_VERSION"
291
242
 
243
+ # Get current version from package.json (in case it's different from $VERSION)
244
+ CURRENT_PKG_VERSION=$(node -p "require('./package.json').version")
245
+
292
246
  # Update package.json version to debug version
293
247
  if [[ "$OSTYPE" == "darwin"* ]]; then
294
- sed -i '' "s/\"version\": \"$VERSION\"/\"version\": \"$DEBUG_VERSION\"/" package.json
248
+ sed -i '' "s/\"version\": \"$CURRENT_PKG_VERSION\"/\"version\": \"$DEBUG_VERSION\"/" package.json
295
249
  else
296
- sed -i "s/\"version\": \"$VERSION\"/\"version\": \"$DEBUG_VERSION\"/" package.json
250
+ sed -i "s/\"version\": \"$CURRENT_PKG_VERSION\"/\"version\": \"$DEBUG_VERSION\"/" package.json
297
251
  fi
298
252
 
299
253
  # Backup compose/build.gradle.kts
@@ -363,14 +317,25 @@ EOF
363
317
  echo "✅ compose/build.gradle.kts restored"
364
318
 
365
319
  # Restore package.json version to original
366
- if [[ "$OSTYPE" == "darwin"* ]]; then
367
- sed -i '' "s/\"version\": \"$DEBUG_VERSION\"/\"version\": \"$VERSION\"/" package.json
320
+ # Verify current version is debug version before restoring
321
+ CURRENT_VERSION_CHECK=$(node -p "require('./package.json').version")
322
+ if [ "$CURRENT_VERSION_CHECK" == "$DEBUG_VERSION" ]; then
323
+ if [[ "$OSTYPE" == "darwin"* ]]; then
324
+ sed -i '' "s/\"version\": \"$DEBUG_VERSION\"/\"version\": \"$VERSION\"/" package.json
325
+ else
326
+ sed -i "s/\"version\": \"$DEBUG_VERSION\"/\"version\": \"$VERSION\"/" package.json
327
+ fi
328
+ echo "✅ package.json version restored: $DEBUG_VERSION → $VERSION"
368
329
  else
369
- sed -i "s/\"version\": \"$DEBUG_VERSION\"/\"version\": \"$VERSION\"/" package.json
330
+ echo "⚠️ Warning: package.json version is $CURRENT_VERSION_CHECK, expected $DEBUG_VERSION"
331
+ echo " Restoring to $VERSION anyway..."
332
+ if [[ "$OSTYPE" == "darwin"* ]]; then
333
+ sed -i '' "s/\"version\": \"$CURRENT_VERSION_CHECK\"/\"version\": \"$VERSION\"/" package.json
334
+ else
335
+ sed -i "s/\"version\": \"$CURRENT_VERSION_CHECK\"/\"version\": \"$VERSION\"/" package.json
336
+ fi
370
337
  fi
371
338
 
372
- echo "✅ package.json version restored"
373
-
374
339
  # ============================================================
375
340
  # SECOND PUBLISH: NORMAL VERSION (without compose)
376
341
  # ============================================================
package/local.properties DELETED
@@ -1,8 +0,0 @@
1
- ## This file must *NOT* be checked into Version Control Systems,
2
- # as it contains information specific to your local configuration.
3
- #
4
- # Location of the SDK. This is only used by Gradle.
5
- # For customization when using a Version Control System, please read the
6
- # header note.
7
- #Mon Dec 22 10:07:29 ICT 2025
8
- sdk.dir=/Users/phuc/Library/Android/sdk