@algocare/react-native-code-push 12.6.4 → 13.0.0-rc.0
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/CodePush.podspec +6 -8
- package/README.md +343 -586
- package/android/app/build.gradle +2 -1
- package/android/app/proguard-rules.pro +14 -0
- package/android/app/src/debug/AndroidManifest.xml +9 -0
- package/android/app/src/main/AndroidManifest.xml +1 -2
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +14 -139
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +0 -3
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +108 -63
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +2 -33
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +13 -109
- package/android/build.gradle +3 -0
- package/app.plugin.js +1 -0
- package/bin/code-push.js +6 -0
- package/cli/commands/bundleCommand/bundleCodePush.ts +118 -0
- package/cli/commands/bundleCommand/index.ts +34 -0
- package/cli/commands/createHistoryCommand/createReleaseHistory.ts +37 -0
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.ts +40 -0
- package/cli/commands/createHistoryCommand/index.ts +44 -0
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.ts +33 -0
- package/cli/commands/createPullRequestHistoryCommand/index.ts +31 -0
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.ts +71 -0
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.ts +75 -0
- package/cli/commands/createPullRequestReleaseCommand/index.ts +74 -0
- package/cli/commands/getPackageHashCommand/index.ts +45 -0
- package/cli/commands/initCommand/index.ts +14 -0
- package/cli/commands/initCommand/initAndroid.ts +91 -0
- package/cli/commands/initCommand/initIos.ts +123 -0
- package/cli/commands/initCommand/test/initAndroid.test.ts +128 -0
- package/cli/commands/initCommand/test/initIos.test.ts +99 -0
- package/cli/commands/releaseCommand/addToReleaseHistory.ts +57 -0
- package/cli/commands/releaseCommand/index.ts +90 -0
- package/cli/commands/releaseCommand/release.ts +105 -0
- package/cli/commands/removePullRequestHistoryCommand/index.ts +37 -0
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.ts +28 -0
- package/cli/commands/showHistoryCommand/index.ts +31 -0
- package/cli/commands/updateHistoryCommand/index.ts +55 -0
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.ts +42 -0
- package/cli/constant.ts +4 -0
- package/cli/dist/commands/bundleCommand/bundleCodePush.js +65 -0
- package/cli/dist/commands/bundleCommand/index.js +15 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistory.js +25 -0
- package/cli/dist/commands/createHistoryCommand/createReleaseHistoryList.js +27 -0
- package/cli/dist/commands/createHistoryCommand/index.js +20 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +23 -0
- package/cli/dist/commands/createPullRequestHistoryCommand/index.js +15 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +51 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +39 -0
- package/cli/dist/commands/createPullRequestReleaseCommand/index.js +35 -0
- package/cli/dist/commands/getPackageHashCommand/index.js +26 -0
- package/cli/dist/commands/initCommand/index.js +12 -0
- package/cli/dist/commands/initCommand/initAndroid.js +73 -0
- package/cli/dist/commands/initCommand/initIos.js +108 -0
- package/cli/dist/commands/initCommand/test/initAndroid.test.js +113 -0
- package/cli/dist/commands/initCommand/test/initIos.test.js +95 -0
- package/cli/dist/commands/releaseCommand/addToReleaseHistory.js +35 -0
- package/cli/dist/commands/releaseCommand/index.js +45 -0
- package/cli/dist/commands/releaseCommand/release.js +62 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/index.js +19 -0
- package/cli/dist/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +18 -0
- package/cli/dist/commands/showHistoryCommand/index.js +15 -0
- package/cli/dist/commands/updateHistoryCommand/index.js +31 -0
- package/cli/dist/commands/updateHistoryCommand/updateReleaseHistory.js +28 -0
- package/cli/dist/constant.js +4 -0
- package/cli/dist/functions/getReactTempDir.js +10 -0
- package/cli/{functions → dist/functions}/makeCodePushBundle.js +5 -11
- package/cli/{functions → dist/functions}/prepareToBundleJS.js +2 -5
- package/cli/dist/functions/runExpoBundleCommand.js +35 -0
- package/cli/{functions → dist/functions}/runHermesEmitBinaryCommand.js +36 -71
- package/cli/{functions → dist/functions}/runReactNativeBundleCommand.js +19 -24
- package/cli/dist/index.js +54 -0
- package/cli/dist/utils/datetime.js +17 -0
- package/cli/dist/utils/file-utils.js +19 -0
- package/cli/dist/utils/fsUtils.js +44 -0
- package/cli/{utils → dist/utils}/hash-utils.js +19 -130
- package/cli/{utils → dist/utils}/promisfied-fs.js +5 -16
- package/cli/dist/utils/showLogo.js +21 -0
- package/cli/dist/utils/unzip.js +41 -0
- package/cli/{utils → dist/utils}/zip.js +15 -51
- package/cli/functions/{getReactTempDir.js → getReactTempDir.ts} +2 -6
- package/cli/functions/makeCodePushBundle.ts +26 -0
- package/cli/functions/prepareToBundleJS.ts +10 -0
- package/cli/functions/runExpoBundleCommand.ts +45 -0
- package/cli/functions/runHermesEmitBinaryCommand.ts +203 -0
- package/cli/functions/runReactNativeBundleCommand.ts +67 -0
- package/cli/index.ts +68 -0
- package/cli/package.json +35 -0
- package/cli/utils/datetime.ts +19 -0
- package/cli/utils/{file-utils.js → file-utils.ts} +4 -21
- package/cli/utils/fsUtils.ts +50 -0
- package/cli/utils/hash-utils.ts +143 -0
- package/cli/utils/promisfied-fs.ts +19 -0
- package/cli/utils/{showLogo.js → showLogo.ts} +4 -6
- package/cli/utils/unzip.ts +46 -0
- package/cli/utils/zip.ts +65 -0
- package/expo/plugin/withCodePush.js +14 -0
- package/expo/plugin/withCodePushAndroid.js +92 -0
- package/expo/plugin/withCodePushIos.js +143 -0
- package/ios/CodePush/CodePush.h +0 -16
- package/ios/CodePush/CodePush.m +30 -20
- package/ios/CodePush/CodePushConfig.m +1 -11
- package/ios/CodePush/CodePushPackage.m +12 -69
- package/ios/CodePush/CodePushUpdateUtils.m +1 -91
- package/ios/CodePush/SSZipArchive/Info.plist +26 -0
- package/ios/CodePush/SSZipArchive/README.md +1 -1
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +129 -27
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +1119 -314
- package/ios/CodePush/SSZipArchive/SSZipCommon.h +71 -0
- package/ios/CodePush/SSZipArchive/Supporting Files/PrivacyInfo.xcprivacy +23 -0
- package/ios/CodePush/SSZipArchive/include/ZipArchive.h +25 -0
- package/ios/CodePush/SSZipArchive/minizip/LICENSE +17 -0
- package/ios/CodePush/SSZipArchive/minizip/mz.h +273 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.c +1306 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_compat.h +346 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.c +187 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt.h +65 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_crypt_apple.c +526 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.c +348 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os.h +176 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_os_posix.c +350 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.c +556 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm.h +132 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.c +383 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_buf.h +42 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.c +269 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_mem.h +48 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os.h +40 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_os_posix.c +203 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.c +334 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_pkcrypt.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.c +429 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_split.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.c +360 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_wzaes.h +46 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.c +389 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_strm_zlib.h +43 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.c +2782 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip.h +262 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.c +1942 -0
- package/ios/CodePush/SSZipArchive/minizip/mz_zip_rw.h +285 -0
- package/ios/CodePush.xcodeproj/project.pbxproj +244 -453
- package/ios/PrivacyInfo.xcprivacy +31 -0
- package/package.json +68 -42
- package/react-native.config.js +1 -1
- package/{AlertAdapter.js → src/AlertAdapter.js} +5 -5
- package/src/CodePush.js +947 -0
- package/{package-mixins.js → src/package-mixins.js} +1 -1
- package/{versioning → src/versioning}/BaseVersioning.js +12 -1
- package/{versioning → src/versioning}/SemverVersioning.test.js +78 -0
- package/typings/react-native-code-push.d.ts +559 -495
- package/.claude/commands/release.md +0 -78
- package/.claude/skills/npm-release/SKILL.md +0 -89
- package/CLAUDE.md +0 -83
- package/CONTRIBUTING.md +0 -134
- package/CodePush.js +0 -972
- package/SECURITY.md +0 -41
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +0 -37
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +0 -12
- package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +0 -17
- package/android/codepush.gradle +0 -162
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -164
- package/android/gradlew.bat +0 -90
- package/babel.config.js +0 -3
- package/cli/commands/bundleCommand/bundleCodePush.js +0 -57
- package/cli/commands/bundleCommand/index.js +0 -55
- package/cli/commands/common.js +0 -245
- package/cli/commands/createHistoryCommand/createReleaseHistory.js +0 -42
- package/cli/commands/createHistoryCommand/createReleaseHistoryList.js +0 -52
- package/cli/commands/createHistoryCommand/index.js +0 -95
- package/cli/commands/createPullRequestHistoryCommand/createPullRequestHistory.js +0 -34
- package/cli/commands/createPullRequestHistoryCommand/index.js +0 -29
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +0 -74
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +0 -91
- package/cli/commands/createPullRequestReleaseCommand/index.js +0 -68
- package/cli/commands/getPackageHashCommand/index.js +0 -42
- package/cli/commands/releaseCommand/addToReleaseHistory.js +0 -85
- package/cli/commands/releaseCommand/index.js +0 -151
- package/cli/commands/releaseCommand/release.js +0 -121
- package/cli/commands/removePullRequestHistoryCommand/index.js +0 -28
- package/cli/commands/removePullRequestHistoryCommand/removePullRequestHistory.js +0 -23
- package/cli/commands/showHistoryCommand/index.js +0 -88
- package/cli/commands/updateHistoryCommand/index.js +0 -123
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.js +0 -69
- package/cli/constant.js +0 -8
- package/cli/index.js +0 -63
- package/cli/utils/datetime.js +0 -22
- package/cli/utils/fsUtils.js +0 -64
- package/cli/utils/version.js +0 -26
- package/code-push.config.example.supabase.ts +0 -114
- package/code-push.config.js +0 -229
- package/code-push.config.ts +0 -175
- package/docs/api-android.md +0 -83
- package/docs/api-ios.md +0 -31
- package/docs/api-js.md +0 -592
- package/docs/multi-deployment-testing-android.md +0 -148
- package/docs/multi-deployment-testing-ios.md +0 -59
- package/docs/setup-android.md +0 -482
- package/docs/setup-ios.md +0 -280
- package/eslint.config.mjs +0 -32
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +0 -34
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +0 -252
- package/ios/CodePush/Base64/README.md +0 -47
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +0 -69
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +0 -16
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +0 -51
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +0 -15
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +0 -55
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +0 -24
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +0 -41
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +0 -28
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +0 -205
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +0 -103
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +0 -322
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +0 -37
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +0 -145
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +0 -35
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +0 -551
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +0 -23
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +0 -43
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +0 -230
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +0 -31
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +0 -113
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +0 -38
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +0 -500
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +0 -214
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +0 -23
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +0 -29
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +0 -19
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +0 -68
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +0 -18
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +0 -72
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +0 -67
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +0 -111
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +0 -119
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +0 -307
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +0 -94
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +0 -619
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +0 -164
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +0 -514
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +0 -24
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +0 -11
- package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +0 -52
- package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +0 -5
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +0 -28
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +0 -70
- package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +0 -22
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +0 -34
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +0 -73
- package/ios/CodePush/JWT/LICENSE +0 -19
- package/ios/CodePush/JWT/README.md +0 -489
- package/ios/CodePush/SSZipArchive/Common.h +0 -81
- package/ios/CodePush/SSZipArchive/aes/aes.h +0 -198
- package/ios/CodePush/SSZipArchive/aes/aes_via_ace.h +0 -541
- package/ios/CodePush/SSZipArchive/aes/aescrypt.c +0 -294
- package/ios/CodePush/SSZipArchive/aes/aeskey.c +0 -548
- package/ios/CodePush/SSZipArchive/aes/aesopt.h +0 -739
- package/ios/CodePush/SSZipArchive/aes/aestab.c +0 -391
- package/ios/CodePush/SSZipArchive/aes/aestab.h +0 -173
- package/ios/CodePush/SSZipArchive/aes/brg_endian.h +0 -126
- package/ios/CodePush/SSZipArchive/aes/brg_types.h +0 -219
- package/ios/CodePush/SSZipArchive/aes/entropy.c +0 -54
- package/ios/CodePush/SSZipArchive/aes/entropy.h +0 -16
- package/ios/CodePush/SSZipArchive/aes/fileenc.c +0 -144
- package/ios/CodePush/SSZipArchive/aes/fileenc.h +0 -121
- package/ios/CodePush/SSZipArchive/aes/hmac.c +0 -145
- package/ios/CodePush/SSZipArchive/aes/hmac.h +0 -103
- package/ios/CodePush/SSZipArchive/aes/prng.c +0 -155
- package/ios/CodePush/SSZipArchive/aes/prng.h +0 -82
- package/ios/CodePush/SSZipArchive/aes/pwd2key.c +0 -103
- package/ios/CodePush/SSZipArchive/aes/pwd2key.h +0 -57
- package/ios/CodePush/SSZipArchive/aes/sha1.c +0 -258
- package/ios/CodePush/SSZipArchive/aes/sha1.h +0 -73
- package/ios/CodePush/SSZipArchive/minizip/crypt.h +0 -130
- package/ios/CodePush/SSZipArchive/minizip/ioapi.c +0 -369
- package/ios/CodePush/SSZipArchive/minizip/ioapi.h +0 -175
- package/ios/CodePush/SSZipArchive/minizip/mztools.c +0 -284
- package/ios/CodePush/SSZipArchive/minizip/mztools.h +0 -31
- package/ios/CodePush/SSZipArchive/minizip/unzip.c +0 -1839
- package/ios/CodePush/SSZipArchive/minizip/unzip.h +0 -248
- package/ios/CodePush/SSZipArchive/minizip/zip.c +0 -1910
- package/ios/CodePush/SSZipArchive/minizip/zip.h +0 -202
- package/scripts/generateBundledResourcesHash.js +0 -125
- package/scripts/getFilesInFolder.js +0 -19
- package/scripts/recordFilesBeforeBundleCommand.js +0 -41
- package/scripts/release.sh +0 -86
- package/tsconfig.json +0 -20
- package/tslint.json +0 -32
- /package/{logging.js → src/logging.js} +0 -0
- /package/{versioning → src/versioning}/BaseVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.js +0 -0
- /package/{versioning → src/versioning}/IncrementalVersioning.test.js +0 -0
- /package/{versioning → src/versioning}/SemverVersioning.js +0 -0
- /package/{versioning → src/versioning}/index.js +0 -0
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
const { program } = require('commander')
|
|
2
|
-
const { findAndReadConfigFile } = require('../../utils/fsUtils')
|
|
3
|
-
const { updateReleaseHistory } = require('./updateReleaseHistory')
|
|
4
|
-
const { COMPILED_CONFIG_FILE_NAME } = require('../../constant')
|
|
5
|
-
const {
|
|
6
|
-
getAppValue,
|
|
7
|
-
getPlatformValue,
|
|
8
|
-
getIdentifierValue,
|
|
9
|
-
getBinaryVersionValueFromList,
|
|
10
|
-
getAppVersionValueFromList,
|
|
11
|
-
} = require('../common')
|
|
12
|
-
|
|
13
|
-
program
|
|
14
|
-
.command('update-history')
|
|
15
|
-
.description(
|
|
16
|
-
'Updates the release history for a specific binary version.\n`getReleaseHistory`, `setReleaseHistory` functions should be implemented in the config file.'
|
|
17
|
-
)
|
|
18
|
-
.option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
|
|
19
|
-
.option('-p, --platform <string>', 'target platform (ios/android)')
|
|
20
|
-
.option('-i, --identifier <string>', 'target env identifier (dev/stg/prd)')
|
|
21
|
-
.option('-b, --binary-version <string>', 'target binary version (x.y.z)')
|
|
22
|
-
.option('-v, --app-version <string>', 'target codepush version (x.y.z)')
|
|
23
|
-
.option(
|
|
24
|
-
'-c, --config <path>',
|
|
25
|
-
'set config file name (JS/TS)',
|
|
26
|
-
COMPILED_CONFIG_FILE_NAME
|
|
27
|
-
)
|
|
28
|
-
.option('-m, --mandatory', 'make the release to be mandatory', false)
|
|
29
|
-
.option(
|
|
30
|
-
'-e, --enable',
|
|
31
|
-
'make the release to be enabled (use --no-enable to disable)',
|
|
32
|
-
true
|
|
33
|
-
)
|
|
34
|
-
.option('--no-enable', 'make the release to be disabled')
|
|
35
|
-
.action(async (options) => {
|
|
36
|
-
if (
|
|
37
|
-
options.app &&
|
|
38
|
-
!['user', 'device', 'b2c-device', 'home-device'].includes(options.app)
|
|
39
|
-
) {
|
|
40
|
-
throw new Error('App must be either "user" or "device" or "b2c-device" or "home-device" or "home-mobile"')
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (options.platform && !['ios', 'android'].includes(options.platform)) {
|
|
44
|
-
throw new Error('Platform must be either "ios" or "android"')
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (options.app !== 'user' && options.app !== 'home-mobile' && options.platform === 'ios') {
|
|
48
|
-
throw new Error('Only user and home-mobile apps are supported on iOS')
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (
|
|
52
|
-
options.identifier &&
|
|
53
|
-
!['dev', 'stg', 'prd'].includes(options.identifier)
|
|
54
|
-
) {
|
|
55
|
-
throw new Error('Identifier must be either "dev" or "stg" or "prd"')
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const semverRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/
|
|
59
|
-
if (options.binaryVersion && !semverRegex.test(options.binaryVersion)) {
|
|
60
|
-
throw new Error('Binary version must be a valid semver format (x.y.z)')
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (options.appVersion && !semverRegex.test(options.appVersion)) {
|
|
64
|
-
throw new Error('App version must be a valid semver format (x.y.z)')
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const { getBinaryVersionList, getReleaseHistory, setReleaseHistory } =
|
|
68
|
-
await findAndReadConfigFile(process.cwd(), options.config)
|
|
69
|
-
|
|
70
|
-
const app = options.app || (await getAppValue())
|
|
71
|
-
|
|
72
|
-
const platform =
|
|
73
|
-
options.platform ||
|
|
74
|
-
(app !== 'user' && 'android') ||
|
|
75
|
-
(await getPlatformValue(app))
|
|
76
|
-
|
|
77
|
-
const identifier = options.identifier || (await getIdentifierValue())
|
|
78
|
-
|
|
79
|
-
const binaryVersion =
|
|
80
|
-
options.binaryVersion ||
|
|
81
|
-
(await getBinaryVersionValueFromList(
|
|
82
|
-
getBinaryVersionList,
|
|
83
|
-
app,
|
|
84
|
-
platform,
|
|
85
|
-
identifier
|
|
86
|
-
))
|
|
87
|
-
|
|
88
|
-
const appVersion =
|
|
89
|
-
options.appVersion ||
|
|
90
|
-
(await getAppVersionValueFromList(
|
|
91
|
-
getReleaseHistory,
|
|
92
|
-
binaryVersion,
|
|
93
|
-
app,
|
|
94
|
-
platform
|
|
95
|
-
))
|
|
96
|
-
|
|
97
|
-
const answers = {
|
|
98
|
-
app,
|
|
99
|
-
platform,
|
|
100
|
-
identifier,
|
|
101
|
-
binaryVersion,
|
|
102
|
-
appVersion,
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
typeof options.mandatory !== 'boolean' &&
|
|
107
|
-
typeof options.enable !== 'boolean'
|
|
108
|
-
) {
|
|
109
|
-
console.error('No options specified. Exiting the program.')
|
|
110
|
-
process.exit(1)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
await updateReleaseHistory(
|
|
114
|
-
answers.app,
|
|
115
|
-
answers.appVersion,
|
|
116
|
-
answers.binaryVersion,
|
|
117
|
-
getReleaseHistory,
|
|
118
|
-
setReleaseHistory,
|
|
119
|
-
answers.platform,
|
|
120
|
-
options.mandatory,
|
|
121
|
-
options.enable
|
|
122
|
-
)
|
|
123
|
-
})
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
const { getTimestamp } = require('../../utils/datetime')
|
|
4
|
-
/**
|
|
5
|
-
* @param app {"user" | "device"}
|
|
6
|
-
* @param appVersion {string}
|
|
7
|
-
* @param binaryVersion {string}
|
|
8
|
-
* @param getReleaseHistory {
|
|
9
|
-
* function(
|
|
10
|
-
* targetBinaryVersion: string,
|
|
11
|
-
* platform: string,
|
|
12
|
-
* ): Promise<ReleaseHistoryInterface>}
|
|
13
|
-
* @param setReleaseHistory {
|
|
14
|
-
* function(
|
|
15
|
-
* targetBinaryVersion: string,
|
|
16
|
-
* jsonFilePath: string,
|
|
17
|
-
* releaseInfo: ReleaseHistoryInterface,
|
|
18
|
-
* platform: string,
|
|
19
|
-
* ): Promise<void>}
|
|
20
|
-
* @param platform {"ios" | "android"}
|
|
21
|
-
* @param mandatory {boolean?}
|
|
22
|
-
* @param enable {boolean?}
|
|
23
|
-
* @returns {Promise<void>}
|
|
24
|
-
*/
|
|
25
|
-
async function updateReleaseHistory(
|
|
26
|
-
app,
|
|
27
|
-
appVersion,
|
|
28
|
-
binaryVersion,
|
|
29
|
-
getReleaseHistory,
|
|
30
|
-
setReleaseHistory,
|
|
31
|
-
platform,
|
|
32
|
-
mandatory,
|
|
33
|
-
enable
|
|
34
|
-
) {
|
|
35
|
-
const releaseHistory = await getReleaseHistory(app, binaryVersion, platform)
|
|
36
|
-
|
|
37
|
-
const updateInfo = releaseHistory[appVersion]
|
|
38
|
-
if (!updateInfo) throw new Error(`${appVersion} is not released`)
|
|
39
|
-
|
|
40
|
-
if (typeof mandatory === 'boolean') updateInfo.mandatory = mandatory
|
|
41
|
-
if (typeof enable === 'boolean') updateInfo.enabled = enable
|
|
42
|
-
updateInfo.updatedAt = getTimestamp()
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
const JSON_FILE_NAME = `${binaryVersion}.json`
|
|
46
|
-
const JSON_FILE_PATH = path.resolve(process.cwd(), JSON_FILE_NAME)
|
|
47
|
-
|
|
48
|
-
console.log(
|
|
49
|
-
`log: creating JSON file... ("${JSON_FILE_NAME}")\n`,
|
|
50
|
-
JSON.stringify(releaseHistory, null, 2)
|
|
51
|
-
)
|
|
52
|
-
fs.writeFileSync(JSON_FILE_PATH, JSON.stringify(releaseHistory))
|
|
53
|
-
|
|
54
|
-
await setReleaseHistory(
|
|
55
|
-
binaryVersion,
|
|
56
|
-
JSON_FILE_PATH,
|
|
57
|
-
releaseHistory,
|
|
58
|
-
app,
|
|
59
|
-
platform
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
fs.unlinkSync(JSON_FILE_PATH)
|
|
63
|
-
} catch (error) {
|
|
64
|
-
console.error('Error occurred while updating history:', error)
|
|
65
|
-
process.exit(1)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
module.exports = { updateReleaseHistory: updateReleaseHistory }
|
package/cli/constant.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
CONFIG_FILE_NAME: 'code-push.config.ts',
|
|
3
|
-
OUTPUT_BUNDLE_DIR: 'bundleOutput',
|
|
4
|
-
ROOT_OUTPUT_DIR: 'build',
|
|
5
|
-
ENTRY_FILE: 'index.js',
|
|
6
|
-
COMPILED_CONFIG_FILE_NAME: 'code-push.config.js',
|
|
7
|
-
PACKAGE_PATH: '/node_modules/@algocare/react-native-code-push/',
|
|
8
|
-
}
|
package/cli/index.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { program } = require('commander')
|
|
4
|
-
const shell = require('shelljs')
|
|
5
|
-
const { showLogo } = require('./utils/showLogo')
|
|
6
|
-
|
|
7
|
-
shell.set('-e')
|
|
8
|
-
shell.set('+v')
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.name('npx code-push')
|
|
12
|
-
.description('Command line interface for @algocare/react-native-code-push')
|
|
13
|
-
.version('1.0.0')
|
|
14
|
-
.action(() => {
|
|
15
|
-
showLogo()
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* npx code-push bundle
|
|
20
|
-
*/
|
|
21
|
-
require('./commands/bundleCommand')
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* npx code-push create-history
|
|
25
|
-
*/
|
|
26
|
-
require('./commands/createHistoryCommand')
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* npx code-push update-history
|
|
30
|
-
*/
|
|
31
|
-
require('./commands/updateHistoryCommand')
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* npx code-push release
|
|
35
|
-
*/
|
|
36
|
-
require('./commands/releaseCommand')
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* npx code-push show-history
|
|
40
|
-
*/
|
|
41
|
-
require('./commands/showHistoryCommand')
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* npx code-push create-pr-history
|
|
45
|
-
*/
|
|
46
|
-
require('./commands/createPullRequestHistoryCommand')
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* npx code-push create-pr-release
|
|
50
|
-
*/
|
|
51
|
-
require('./commands/createPullRequestReleaseCommand')
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* npx code-push remove-pr-history
|
|
55
|
-
*/
|
|
56
|
-
require('./commands/removePullRequestHistoryCommand')
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* npx code-push get-package-hash
|
|
60
|
-
*/
|
|
61
|
-
require('./commands/getPackageHashCommand')
|
|
62
|
-
|
|
63
|
-
program.parse()
|
package/cli/utils/datetime.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const getTimestamp = () => {
|
|
2
|
-
const date = new Date()
|
|
3
|
-
const year = date.getFullYear()
|
|
4
|
-
const month = padWithZero(date.getMonth() + 1)
|
|
5
|
-
const day = padWithZero(date.getDate())
|
|
6
|
-
const hour = padWithZero(date.getHours())
|
|
7
|
-
const minute = padWithZero(date.getMinutes())
|
|
8
|
-
const second = padWithZero(date.getSeconds())
|
|
9
|
-
|
|
10
|
-
return `${year}-${month}-${day} ${hour}:${minute}:${second}`
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const padWithZero = (value) => {
|
|
14
|
-
if (value < 10) {
|
|
15
|
-
return `0${value}`
|
|
16
|
-
}
|
|
17
|
-
return value
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
module.exports = {
|
|
21
|
-
getTimestamp,
|
|
22
|
-
}
|
package/cli/utils/fsUtils.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
const { PACKAGE_PATH } = require('../constant')
|
|
4
|
-
/**
|
|
5
|
-
* allows to require a config file with .ts extension
|
|
6
|
-
* @param filePath {string}
|
|
7
|
-
* @returns {*} FIXME type
|
|
8
|
-
*/
|
|
9
|
-
async function requireConfig(filePath) {
|
|
10
|
-
const ext = path.extname(filePath)
|
|
11
|
-
|
|
12
|
-
if (ext === '.ts') {
|
|
13
|
-
try {
|
|
14
|
-
require('ts-node').register({
|
|
15
|
-
transpileOnly: true,
|
|
16
|
-
compilerOptions: {
|
|
17
|
-
module: 'CommonJS',
|
|
18
|
-
esModuleInterop: true,
|
|
19
|
-
allowJs: true,
|
|
20
|
-
resolveJsonModule: true,
|
|
21
|
-
experimentalDecorators: true,
|
|
22
|
-
emitDecoratorMetadata: true,
|
|
23
|
-
},
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
const config = await import(filePath)
|
|
27
|
-
return config.default || config
|
|
28
|
-
} catch {
|
|
29
|
-
console.error(
|
|
30
|
-
'ts-node not found. Please install ts-node as a devDependency.'
|
|
31
|
-
)
|
|
32
|
-
process.exit(1)
|
|
33
|
-
}
|
|
34
|
-
} else if (ext === '.js') {
|
|
35
|
-
// do nothing
|
|
36
|
-
} else {
|
|
37
|
-
throw new Error(`Unsupported file extension: ${ext}`)
|
|
38
|
-
}
|
|
39
|
-
return require(filePath)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @param startDir {string}
|
|
44
|
-
* @param configFileName {string}
|
|
45
|
-
* @returns {*|null} FIXME type
|
|
46
|
-
*/
|
|
47
|
-
async function findAndReadConfigFile(startDir, configFileName) {
|
|
48
|
-
let dir = `${startDir}${PACKAGE_PATH}`
|
|
49
|
-
|
|
50
|
-
while (dir !== path.parse(dir).root) {
|
|
51
|
-
const configPath = path.join(dir, configFileName)
|
|
52
|
-
|
|
53
|
-
if (fs.existsSync(configPath)) {
|
|
54
|
-
const config = await requireConfig(configPath)
|
|
55
|
-
return config
|
|
56
|
-
}
|
|
57
|
-
dir = path.dirname(dir)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
console.error(`${configFileName} not found.`)
|
|
61
|
-
return null
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
module.exports = { findAndReadConfigFile }
|
package/cli/utils/version.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
async function getBinaryVersions(
|
|
2
|
-
getBinaryVersionList,
|
|
3
|
-
app,
|
|
4
|
-
platform,
|
|
5
|
-
identifier
|
|
6
|
-
) {
|
|
7
|
-
const currentVersionList = await getBinaryVersionList(
|
|
8
|
-
app,
|
|
9
|
-
platform,
|
|
10
|
-
identifier
|
|
11
|
-
)
|
|
12
|
-
return [
|
|
13
|
-
Object.keys(currentVersionList),
|
|
14
|
-
Object.keys(currentVersionList).pop(),
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async function getAppVersions(getReleaseHistory, binaryVersion, app, platform) {
|
|
19
|
-
const releaseHistory = await getReleaseHistory(app, binaryVersion, platform)
|
|
20
|
-
return [Object.keys(releaseHistory), Object.keys(releaseHistory).pop()]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
getBinaryVersions,
|
|
25
|
-
getAppVersions,
|
|
26
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
CliConfigInterface,
|
|
6
|
-
ReleaseHistoryInterface,
|
|
7
|
-
} from "@bravemobile/react-native-code-push";
|
|
8
|
-
import * as fs from "fs";
|
|
9
|
-
import axios from "axios"; // install as devDependency
|
|
10
|
-
import * as SupabaseSDK from "@supabase/supabase-js"; // install as devDependency
|
|
11
|
-
|
|
12
|
-
const SUPABASE_URL = process.env.SUPABASE_URL;
|
|
13
|
-
const SUPABASE_KEY = process.env.SUPABASE_KEY;
|
|
14
|
-
const supabase = SupabaseSDK.createClient(SUPABASE_URL!, SUPABASE_KEY!);
|
|
15
|
-
const BUCKET_NAME = "codePush";
|
|
16
|
-
const STORAGE_HOST = `${SUPABASE_URL}/storage/v1/object/public`;
|
|
17
|
-
|
|
18
|
-
function historyJsonFileRemotePath(
|
|
19
|
-
platform: "ios" | "android",
|
|
20
|
-
identifier: string,
|
|
21
|
-
binaryVersion: string,
|
|
22
|
-
) {
|
|
23
|
-
return `histories/${platform}/${identifier}/${binaryVersion}.json`;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function bundleFileRemotePath(
|
|
27
|
-
platform: "ios" | "android",
|
|
28
|
-
identifier: string,
|
|
29
|
-
fileName: string,
|
|
30
|
-
) {
|
|
31
|
-
return `bundles/${platform}/${identifier}/${fileName}`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const Config: CliConfigInterface = {
|
|
35
|
-
bundleUploader: async (
|
|
36
|
-
source: string,
|
|
37
|
-
platform: "ios" | "android",
|
|
38
|
-
identifier = "staging",
|
|
39
|
-
): Promise<{downloadUrl: string}> => {
|
|
40
|
-
const fileName = source.split("/").pop();
|
|
41
|
-
const fileStream = fs.createReadStream(source);
|
|
42
|
-
const remotePath = bundleFileRemotePath(platform, identifier, fileName!);
|
|
43
|
-
|
|
44
|
-
const {data, error} = await supabase.storage
|
|
45
|
-
.from(BUCKET_NAME)
|
|
46
|
-
.upload(remotePath, fileStream, {
|
|
47
|
-
contentType: "application/zip",
|
|
48
|
-
duplex: "half",
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
if (error) {
|
|
52
|
-
console.error("Error uploading file:", error.message);
|
|
53
|
-
throw error;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
console.log("Bundle File uploaded:", `${STORAGE_HOST}/${data.fullPath}`);
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
downloadUrl: `${STORAGE_HOST}/${data.fullPath}`,
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
getReleaseHistory: async (
|
|
64
|
-
targetBinaryVersion: string,
|
|
65
|
-
platform: "ios" | "android",
|
|
66
|
-
identifier = "staging",
|
|
67
|
-
): Promise<ReleaseHistoryInterface> => {
|
|
68
|
-
const remoteJsonPath = historyJsonFileRemotePath(
|
|
69
|
-
platform,
|
|
70
|
-
identifier,
|
|
71
|
-
targetBinaryVersion,
|
|
72
|
-
);
|
|
73
|
-
const {data} = await axios.get(
|
|
74
|
-
`${STORAGE_HOST}/${BUCKET_NAME}/${remoteJsonPath}`,
|
|
75
|
-
);
|
|
76
|
-
return data as ReleaseHistoryInterface;
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
setReleaseHistory: async (
|
|
80
|
-
targetBinaryVersion: string,
|
|
81
|
-
jsonFilePath: string,
|
|
82
|
-
releaseInfo: ReleaseHistoryInterface,
|
|
83
|
-
platform: "ios" | "android",
|
|
84
|
-
identifier = "staging",
|
|
85
|
-
): Promise<void> => {
|
|
86
|
-
// upload JSON file or call API using `releaseInfo` metadata.
|
|
87
|
-
|
|
88
|
-
const fileContent = fs.readFileSync(jsonFilePath, "utf8");
|
|
89
|
-
const remoteJsonPath = historyJsonFileRemotePath(
|
|
90
|
-
platform,
|
|
91
|
-
identifier,
|
|
92
|
-
targetBinaryVersion,
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
const {data, error} = await supabase.storage
|
|
96
|
-
.from(BUCKET_NAME)
|
|
97
|
-
.upload(remoteJsonPath, Buffer.from(fileContent), {
|
|
98
|
-
contentType: "application/json",
|
|
99
|
-
cacheControl: "5",
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
if (error) {
|
|
103
|
-
console.error("Error uploading file:", error.message);
|
|
104
|
-
throw error;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
console.log(
|
|
108
|
-
"Release history File uploaded:",
|
|
109
|
-
`${STORAGE_HOST}/${data.fullPath}`,
|
|
110
|
-
);
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
module.exports = Config;
|