@momo-kits/native-kits 0.156.1-test.5-debug → 0.156.1-test.6-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.
@@ -1,190 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -e # Exit on error
4
-
5
- echo "🔍 Reading version from local package.json..."
6
-
7
- # Get the version from local package.json
8
- VERSION=$(node -p "require('./package.json').version")
9
-
10
- if [ -z "$VERSION" ]; then
11
- echo "❌ Error: Could not read version from package.json"
12
- exit 1
13
- fi
14
-
15
- echo "📦 Version from package.json: $VERSION"
16
-
17
- # Check if this version already exists on npm
18
- PACKAGE_NAME=$(node -p "require('./package.json').name")
19
- echo "🔎 Checking if version $VERSION already exists on npm for package $PACKAGE_NAME..."
20
-
21
- # Try to get the version info from npm
22
- NPM_VERSION_INFO=$(npm view "$PACKAGE_NAME@$VERSION" version 2>/dev/null || echo "")
23
-
24
- if [ -n "$NPM_VERSION_INFO" ]; then
25
- echo "⚠️ Version $VERSION already exists on npm. Auto-incrementing patch version..."
26
-
27
- # Split version into parts (e.g., 1.2.0 -> 1.2.0)
28
- # Extract major.minor.patch
29
- MAJOR=$(echo "$VERSION" | cut -d'.' -f1)
30
- MINOR=$(echo "$VERSION" | cut -d'.' -f2)
31
- PATCH=$(echo "$VERSION" | cut -d'.' -f3 | cut -d'-' -f1)
32
-
33
- # Increment patch version
34
- NEW_PATCH=$((PATCH + 1))
35
- NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
36
-
37
- echo " Version incremented: $VERSION → $NEW_VERSION"
38
-
39
- # Update package.json with new version
40
- if [[ "$OSTYPE" == "darwin"* ]]; then
41
- # macOS
42
- sed -i '' "s/\"version\": \"$VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json
43
- else
44
- # Linux
45
- sed -i "s/\"version\": \"$VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json
46
- fi
47
-
48
- VERSION="$NEW_VERSION"
49
- echo "✅ Version updated to: $VERSION"
50
- else
51
- echo "✅ Version $VERSION does not exist on npm. Using current version."
52
- fi
53
-
54
- # Update gradle.properties with the same version
55
- echo "📝 Updating gradle.properties..."
56
- # Get current gradle version
57
- CURRENT_GRADLE_VERSION=$(grep "^version=" gradle.properties | cut -d'=' -f2 | tr -d '"')
58
-
59
- # Update version in gradle.properties using sed
60
- if [[ "$OSTYPE" == "darwin"* ]]; then
61
- # macOS
62
- sed -i '' "s/^version=.*/version=$VERSION/" gradle.properties
63
- else
64
- # Linux
65
- sed -i "s/^version=.*/version=$VERSION/" gradle.properties
66
- fi
67
-
68
- echo " Gradle version updated: $CURRENT_GRADLE_VERSION → $VERSION"
69
-
70
- export VERSION="$VERSION"
71
-
72
- echo "✅ Using version: $VERSION"
73
- echo "📦 Publishing KMP artifacts to Maven (version ${VERSION})..."
74
-
75
- ./gradlew clean
76
-
77
- # First publish: normal version (compose/ is excluded via .npmignore)
78
- echo "📤 Publishing normal version (without compose)..."
79
- npm publish --tag latest --access=public
80
-
81
- ./gradlew :compose:publishAllPublicationsToGitLabPackagesRepository
82
-
83
- echo "✅ Normal version published successfully!"
84
-
85
- # Second publish: debug version with compose kits included
86
- echo ""
87
- echo "🔧 Preparing debug version with compose kits..."
88
-
89
- # Create debug version
90
- DEBUG_VERSION="${VERSION}-debug"
91
- echo "📦 Debug version: $DEBUG_VERSION"
92
-
93
- # Update package.json version to debug version
94
- if [[ "$OSTYPE" == "darwin"* ]]; then
95
- # macOS
96
- sed -i '' "s/\"version\": \"$VERSION\"/\"version\": \"$DEBUG_VERSION\"/" package.json
97
- else
98
- # Linux
99
- sed -i "s/\"version\": \"$VERSION\"/\"version\": \"$DEBUG_VERSION\"/" package.json
100
- fi
101
-
102
- # Backup compose/build.gradle.kts
103
- echo "📦 Backing up compose/build.gradle.kts..."
104
- cp compose/build.gradle.kts compose/build.gradle.kts.backup
105
-
106
- # Comment out maven publish in compose/build.gradle.kts
107
- echo "💬 Commenting out maven publish in compose/build.gradle.kts..."
108
- if [[ "$OSTYPE" == "darwin"* ]]; then
109
- # macOS - Comment out imports
110
- sed -i '' 's/^import com\.vanniktech\.maven\.publish\.JavadocJar$/\/\/ &/' compose/build.gradle.kts
111
- sed -i '' 's/^import com\.vanniktech\.maven\.publish\.KotlinMultiplatform$/\/\/ &/' compose/build.gradle.kts
112
- # Comment out plugin
113
- sed -i '' 's/^ alias(libs\.plugins\.vanniktech\.mavenPublish)$/\/\/ &/' compose/build.gradle.kts
114
- # Comment out publishing block
115
- sed -i '' '/^publishing {$/,/^}$/s/^/\/\/ /' compose/build.gradle.kts
116
- # Comment out entire mavenPublishing block (lines starting from mavenPublishing { to its closing })
117
- sed -i '' '/^mavenPublishing {$/,/^}$/s/^/\/\/ /' compose/build.gradle.kts
118
- else
119
- # Linux - Comment out imports
120
- sed -i 's/^import com\.vanniktech\.maven\.publish\.JavadocJar$/\/\/ &/' compose/build.gradle.kts
121
- sed -i 's/^import com\.vanniktech\.maven\.publish\.KotlinMultiplatform$/\/\/ &/' compose/build.gradle.kts
122
- # Comment out plugin
123
- sed -i 's/^ alias(libs\.plugins\.vanniktech\.mavenPublish)$/\/\/ &/' compose/build.gradle.kts
124
- # Comment out publishing block
125
- sed -i '/^publishing {$/,/^}$/s/^/\/\/ /' compose/build.gradle.kts
126
- # Comment out entire mavenPublishing block
127
- sed -i '/^mavenPublishing {$/,/^}$/s/^/\/\/ /' compose/build.gradle.kts
128
- fi
129
-
130
- # Modify android configuration for debug version
131
- echo "🔧 Modifying android configuration for debug version..."
132
- if [[ "$OSTYPE" == "darwin"* ]]; then
133
- # macOS
134
- sed -i '' 's/namespace = "\$gitlabGroup\.\$gitlabArtifactId"/namespace = "vn.momo.kits.kits"/' compose/build.gradle.kts
135
- sed -i '' 's/compileSdk = libs\.versions\.android\.compileSdk\.get()\.toInt()/compileSdk = 35/' compose/build.gradle.kts
136
- sed -i '' 's/minSdk = libs\.versions\.android\.minSdk\.get()\.toInt()/minSdk = 24/' compose/build.gradle.kts
137
- sed -i '' "s/version = gitlabVersion/version = \"$DEBUG_VERSION\"/" compose/build.gradle.kts
138
- else
139
- # Linux
140
- sed -i 's/namespace = "\$gitlabGroup\.\$gitlabArtifactId"/namespace = "vn.momo.kits.kits"/' compose/build.gradle.kts
141
- sed -i 's/compileSdk = libs\.versions\.android\.compileSdk\.get()\.toInt()/compileSdk = 35/' compose/build.gradle.kts
142
- sed -i 's/minSdk = libs\.versions\.android\.minSdk\.get()\.toInt()/minSdk = 24/' compose/build.gradle.kts
143
- sed -i "s/version = gitlabVersion/version = \"$DEBUG_VERSION\"/" compose/build.gradle.kts
144
- fi
145
-
146
- # Backup .npmignore
147
- cp .npmignore .npmignore.backup
148
-
149
- # Create minimal .npmignore for debug version (only exclude build artifacts and IDE configs)
150
- cat > .npmignore << 'EOF'
151
- sample/
152
- build/
153
-
154
- .fleet
155
- .gradle
156
- .idea
157
- .kotlin
158
- .run
159
-
160
- .gitattributes
161
- .gitlab-ci.yml
162
- .npmignore.backup
163
- EOF
164
-
165
- echo "📤 Publishing debug version (with compose)..."
166
- npm publish --tag latest --access=public
167
-
168
- # Restore .npmignore
169
- mv .npmignore.backup .npmignore
170
- echo "✅ .npmignore restored"
171
-
172
- # Restore compose/build.gradle.kts
173
- mv compose/build.gradle.kts.backup compose/build.gradle.kts
174
- echo "✅ compose/build.gradle.kts restored"
175
-
176
- # Restore package.json version to original
177
- if [[ "$OSTYPE" == "darwin"* ]]; then
178
- # macOS
179
- sed -i '' "s/\"version\": \"$DEBUG_VERSION\"/\"version\": \"$VERSION\"/" package.json
180
- else
181
- # Linux
182
- sed -i "s/\"version\": \"$DEBUG_VERSION\"/\"version\": \"$VERSION\"/" package.json
183
- fi
184
-
185
- echo "✅ package.json version restored"
186
-
187
- echo ""
188
- echo "🎉 Publishing completed successfully!"
189
- echo " 📦 Normal version: $VERSION (without compose)"
190
- echo " 🐛 Debug version: $DEBUG_VERSION (with compose)"