@algocare/react-native-code-push 12.6.3 → 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 +67 -41
- 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/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/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,68 +0,0 @@
|
|
|
1
|
-
const { program } = require('commander')
|
|
2
|
-
const {
|
|
3
|
-
OUTPUT_BUNDLE_DIR,
|
|
4
|
-
COMPILED_CONFIG_FILE_NAME,
|
|
5
|
-
ROOT_OUTPUT_DIR,
|
|
6
|
-
ENTRY_FILE,
|
|
7
|
-
} = require('../../constant')
|
|
8
|
-
const { findAndReadConfigFile } = require('../../utils/fsUtils')
|
|
9
|
-
const { createPullRequestRelease } = require('./createPullRequestRelease')
|
|
10
|
-
|
|
11
|
-
program
|
|
12
|
-
.command('create-pr-release')
|
|
13
|
-
.description('Creates a new pull request release.')
|
|
14
|
-
.option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
|
|
15
|
-
.option('-p, --platform <string>', 'target platform (ios/android)')
|
|
16
|
-
.option('-b, --binary-version <string>', 'target binary version (x.y.z)')
|
|
17
|
-
.option('-r, --pr-number <number>', 'pull request number')
|
|
18
|
-
.option(
|
|
19
|
-
'-c, --config <path>',
|
|
20
|
-
'set config file name (JS/TS)',
|
|
21
|
-
COMPILED_CONFIG_FILE_NAME
|
|
22
|
-
)
|
|
23
|
-
.option(
|
|
24
|
-
'-o, --output-path <string>',
|
|
25
|
-
'path to output root directory',
|
|
26
|
-
ROOT_OUTPUT_DIR
|
|
27
|
-
)
|
|
28
|
-
.option('-e, --entry-file <string>', 'path to JS/TS entry file', ENTRY_FILE)
|
|
29
|
-
.option(
|
|
30
|
-
'-j, --js-bundle-name <string>',
|
|
31
|
-
'JS bundle file name (default-ios: "main.jsbundle" / default-android: "index.android.bundle")'
|
|
32
|
-
)
|
|
33
|
-
.option('-m, --mandatory', 'make the release to be mandatory', false)
|
|
34
|
-
.option(
|
|
35
|
-
'--enable',
|
|
36
|
-
'make the release to be enabled (use --no-enable to disable)',
|
|
37
|
-
true
|
|
38
|
-
)
|
|
39
|
-
.option('--no-enable', 'make the release to be disabled')
|
|
40
|
-
.option('--skip-bundle', 'skip bundle process', false)
|
|
41
|
-
.option('--skip-cleanup', 'skip cleanup process', false)
|
|
42
|
-
.option(
|
|
43
|
-
'--output-bundle-dir <string>',
|
|
44
|
-
'name of directory containing the bundle file created by the "bundle" command',
|
|
45
|
-
OUTPUT_BUNDLE_DIR
|
|
46
|
-
)
|
|
47
|
-
.action(async (options) => {
|
|
48
|
-
const { bundleUploader, setReleaseHistory, getReleaseHistory } =
|
|
49
|
-
await findAndReadConfigFile(process.cwd(), options.config)
|
|
50
|
-
|
|
51
|
-
await createPullRequestRelease(
|
|
52
|
-
bundleUploader,
|
|
53
|
-
setReleaseHistory,
|
|
54
|
-
getReleaseHistory,
|
|
55
|
-
options.app,
|
|
56
|
-
options.binaryVersion,
|
|
57
|
-
options.prNumber,
|
|
58
|
-
options.platform,
|
|
59
|
-
options.outputPath,
|
|
60
|
-
options.entryFile,
|
|
61
|
-
options.jsBundleName,
|
|
62
|
-
options.mandatory,
|
|
63
|
-
options.enable,
|
|
64
|
-
options.skipBundle,
|
|
65
|
-
options.skipCleanup,
|
|
66
|
-
options.outputBundleDir
|
|
67
|
-
)
|
|
68
|
-
})
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const { program } = require('commander')
|
|
2
|
-
const { findAndReadConfigFile } = require('../../utils/fsUtils')
|
|
3
|
-
const { COMPILED_CONFIG_FILE_NAME } = require('../../constant')
|
|
4
|
-
|
|
5
|
-
program
|
|
6
|
-
.command('get-package-hash')
|
|
7
|
-
.description(
|
|
8
|
-
'Retrieves and prints the package hash of a specific binary version.\n`getReleaseHistory` function should be implemented in the config file.'
|
|
9
|
-
)
|
|
10
|
-
.option('-a, --app <string>', 'target app (user/device)')
|
|
11
|
-
.option('-p, --platform <string>', 'target platform (ios/android)')
|
|
12
|
-
.option('-b, --binary-version <string>', 'target binary version (x.y.z)')
|
|
13
|
-
.option('-r, --pr-number <number>', 'pull request number')
|
|
14
|
-
.option(
|
|
15
|
-
'-c, --config <path>',
|
|
16
|
-
'configuration file name (JS/TS)',
|
|
17
|
-
COMPILED_CONFIG_FILE_NAME
|
|
18
|
-
)
|
|
19
|
-
.action(async (options) => {
|
|
20
|
-
const { getReleaseHistory } = await findAndReadConfigFile(
|
|
21
|
-
process.cwd(),
|
|
22
|
-
options.config
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
const releaseHistory = await getReleaseHistory(
|
|
26
|
-
options.app,
|
|
27
|
-
options.binaryVersion,
|
|
28
|
-
options.platform
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
const filteredReleaseHistory = Object.entries(releaseHistory)
|
|
32
|
-
.filter(([key]) => key.includes(options.prNumber))
|
|
33
|
-
.reduce((acc, [key, value]) => {
|
|
34
|
-
acc[key] = value
|
|
35
|
-
return acc
|
|
36
|
-
}, {})
|
|
37
|
-
|
|
38
|
-
const latestReleaseVersion = Object.keys(filteredReleaseHistory).at(-1)
|
|
39
|
-
process.stdout.write(
|
|
40
|
-
filteredReleaseHistory[latestReleaseVersion].packageHash
|
|
41
|
-
)
|
|
42
|
-
})
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const fs = require('fs')
|
|
3
|
-
const { getTimestamp } = require('../../utils/datetime')
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @param app {"user" | "device"}
|
|
7
|
-
* @param appVersion {string}
|
|
8
|
-
* @param binaryVersion {string}
|
|
9
|
-
* @param bundleDownloadUrl {string}
|
|
10
|
-
* @param packageHash {string}
|
|
11
|
-
* @param getReleaseHistory {
|
|
12
|
-
* function(
|
|
13
|
-
* targetBinaryVersion: string,
|
|
14
|
-
* platform: string,
|
|
15
|
-
* identifier?: string
|
|
16
|
-
* ): Promise<ReleaseHistoryInterface>}
|
|
17
|
-
* @param setReleaseHistory {
|
|
18
|
-
* function(
|
|
19
|
-
* targetBinaryVersion: string,
|
|
20
|
-
* jsonFilePath: string,
|
|
21
|
-
* releaseInfo: ReleaseHistoryInterface,
|
|
22
|
-
* platform: string,
|
|
23
|
-
* ): Promise<void>}
|
|
24
|
-
* @param platform {"ios" | "android"}
|
|
25
|
-
* @param mandatory {boolean?}
|
|
26
|
-
* @param enable {boolean?}
|
|
27
|
-
* @returns {Promise<void>}
|
|
28
|
-
*/
|
|
29
|
-
async function addToReleaseHistory(
|
|
30
|
-
app,
|
|
31
|
-
appVersion,
|
|
32
|
-
binaryVersion,
|
|
33
|
-
bundleDownloadUrl,
|
|
34
|
-
packageHash,
|
|
35
|
-
getReleaseHistory,
|
|
36
|
-
setReleaseHistory,
|
|
37
|
-
platform,
|
|
38
|
-
mandatory,
|
|
39
|
-
enable
|
|
40
|
-
) {
|
|
41
|
-
const releaseHistory = await getReleaseHistory(app, binaryVersion, platform)
|
|
42
|
-
|
|
43
|
-
const updateInfo = releaseHistory[appVersion]
|
|
44
|
-
if (updateInfo) {
|
|
45
|
-
console.error(`v${appVersion} is already released`)
|
|
46
|
-
process.exit(1)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const newReleaseHistory = structuredClone(releaseHistory)
|
|
50
|
-
|
|
51
|
-
newReleaseHistory[appVersion] = {
|
|
52
|
-
enabled: enable,
|
|
53
|
-
mandatory: mandatory,
|
|
54
|
-
downloadUrl: bundleDownloadUrl,
|
|
55
|
-
packageHash: packageHash,
|
|
56
|
-
createdAt: getTimestamp(),
|
|
57
|
-
updatedAt: '-',
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
const JSON_FILE_NAME = `${binaryVersion}.json`
|
|
62
|
-
const JSON_FILE_PATH = path.resolve(process.cwd(), JSON_FILE_NAME)
|
|
63
|
-
|
|
64
|
-
console.log(
|
|
65
|
-
`log: creating JSON file... ("${JSON_FILE_NAME}")\n`,
|
|
66
|
-
JSON.stringify(newReleaseHistory, null, 2)
|
|
67
|
-
)
|
|
68
|
-
fs.writeFileSync(JSON_FILE_PATH, JSON.stringify(newReleaseHistory))
|
|
69
|
-
|
|
70
|
-
await setReleaseHistory(
|
|
71
|
-
binaryVersion,
|
|
72
|
-
JSON_FILE_PATH,
|
|
73
|
-
newReleaseHistory,
|
|
74
|
-
app,
|
|
75
|
-
platform
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
fs.unlinkSync(JSON_FILE_PATH)
|
|
79
|
-
} catch (error) {
|
|
80
|
-
console.error('Error occurred while updating history:', error)
|
|
81
|
-
process.exit(1)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
module.exports = { addToReleaseHistory: addToReleaseHistory }
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
const { program } = require('commander')
|
|
2
|
-
const { findAndReadConfigFile } = require('../../utils/fsUtils')
|
|
3
|
-
const { release } = require('./release')
|
|
4
|
-
const {
|
|
5
|
-
OUTPUT_BUNDLE_DIR,
|
|
6
|
-
COMPILED_CONFIG_FILE_NAME,
|
|
7
|
-
ROOT_OUTPUT_DIR,
|
|
8
|
-
ENTRY_FILE,
|
|
9
|
-
} = require('../../constant')
|
|
10
|
-
const {
|
|
11
|
-
getAppValue,
|
|
12
|
-
getPlatformValue,
|
|
13
|
-
getIdentifierValue,
|
|
14
|
-
getBinaryVersionValueFromInput,
|
|
15
|
-
getAppVersionValueFromInput,
|
|
16
|
-
} = require('../common')
|
|
17
|
-
|
|
18
|
-
program
|
|
19
|
-
.command('release')
|
|
20
|
-
.description(
|
|
21
|
-
'Deploys a new CodePush update for a target binary app.\nAfter creating the CodePush bundle, it uploads the file and updates the ReleaseHistory information.\n`bundleUploader`, `getReleaseHistory`, and `setReleaseHistory` functions should be implemented in the config file.'
|
|
22
|
-
)
|
|
23
|
-
.option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
|
|
24
|
-
.option('-p, --platform <string>', 'target platform (ios/android)')
|
|
25
|
-
.option('-i, --identifier <string>', 'target env identifier (dev/stg/prd)')
|
|
26
|
-
.option('-b, --binary-version <string>', 'target binary version (x.y.z)')
|
|
27
|
-
.option('-v, --app-version <string>', 'target codepush version (x.y.z)')
|
|
28
|
-
.option(
|
|
29
|
-
'-c, --config <path>',
|
|
30
|
-
'set config file name (JS/TS)',
|
|
31
|
-
COMPILED_CONFIG_FILE_NAME
|
|
32
|
-
)
|
|
33
|
-
.option(
|
|
34
|
-
'-o, --output-path <string>',
|
|
35
|
-
'path to output root directory',
|
|
36
|
-
ROOT_OUTPUT_DIR
|
|
37
|
-
)
|
|
38
|
-
.option('-e, --entry-file <string>', 'path to JS/TS entry file', ENTRY_FILE)
|
|
39
|
-
.option(
|
|
40
|
-
'-j, --js-bundle-name <string>',
|
|
41
|
-
'JS bundle file name (default-ios: "main.jsbundle" / default-android: "index.android.bundle")'
|
|
42
|
-
)
|
|
43
|
-
.option('-m, --mandatory', 'make the release to be mandatory', false)
|
|
44
|
-
.option(
|
|
45
|
-
'--enable',
|
|
46
|
-
'make the release to be enabled (use --no-enable to disable)',
|
|
47
|
-
true
|
|
48
|
-
)
|
|
49
|
-
.option('--no-enable', 'make the release to be disabled')
|
|
50
|
-
.option('--skip-bundle', 'skip bundle process', false)
|
|
51
|
-
.option('--skip-cleanup', 'skip cleanup process', false)
|
|
52
|
-
.option(
|
|
53
|
-
'--output-bundle-dir <string>',
|
|
54
|
-
'name of directory containing the bundle file created by the "bundle" command',
|
|
55
|
-
OUTPUT_BUNDLE_DIR
|
|
56
|
-
)
|
|
57
|
-
.action(async (options) => {
|
|
58
|
-
if (
|
|
59
|
-
options.app &&
|
|
60
|
-
!['user', 'device', 'b2c-device', 'home-device', 'home-mobile'].includes(options.app)
|
|
61
|
-
) {
|
|
62
|
-
throw new Error('App must be either "user" or "device" or "b2c-device" or "home-device" or "home-mobile"')
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (options.platform && !['ios', 'android'].includes(options.platform)) {
|
|
66
|
-
throw new Error('Platform must be either "ios" or "android"')
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// iOS는 'user'와 'home-mobile' 앱만 지원
|
|
70
|
-
if (options.app !== 'user' && options.app !== 'home-mobile' && options.platform === 'ios') {
|
|
71
|
-
throw new Error('Only user and home-mobile apps are supported on iOS')
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (
|
|
75
|
-
options.identifier &&
|
|
76
|
-
!['dev', 'stg', 'prd'].includes(options.identifier)
|
|
77
|
-
) {
|
|
78
|
-
throw new Error('Identifier must be either "dev" or "stg" or "prd"')
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const semverRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/
|
|
82
|
-
if (options.binaryVersion && !semverRegex.test(options.binaryVersion)) {
|
|
83
|
-
throw new Error('Binary version must be a valid semver format (x.y.z)')
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (options.appVersion && !semverRegex.test(options.appVersion)) {
|
|
87
|
-
throw new Error('App version must be a valid semver format (x.y.z)')
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const {
|
|
91
|
-
bundleUploader,
|
|
92
|
-
getReleaseHistory,
|
|
93
|
-
setReleaseHistory,
|
|
94
|
-
getBinaryVersionList,
|
|
95
|
-
} = await findAndReadConfigFile(process.cwd(), options.config)
|
|
96
|
-
|
|
97
|
-
const app = options.app || (await getAppValue())
|
|
98
|
-
|
|
99
|
-
const platform =
|
|
100
|
-
options.platform ||
|
|
101
|
-
(app !== 'user' && 'android') ||
|
|
102
|
-
(await getPlatformValue(app))
|
|
103
|
-
|
|
104
|
-
const identifier = options.identifier || (await getIdentifierValue())
|
|
105
|
-
|
|
106
|
-
const binaryVersion =
|
|
107
|
-
options.binaryVersion ||
|
|
108
|
-
(await getBinaryVersionValueFromInput(
|
|
109
|
-
getBinaryVersionList,
|
|
110
|
-
app,
|
|
111
|
-
platform,
|
|
112
|
-
identifier
|
|
113
|
-
))
|
|
114
|
-
|
|
115
|
-
const appVersion =
|
|
116
|
-
options.appVersion ||
|
|
117
|
-
(await getAppVersionValueFromInput(
|
|
118
|
-
getReleaseHistory,
|
|
119
|
-
binaryVersion,
|
|
120
|
-
app,
|
|
121
|
-
platform
|
|
122
|
-
))
|
|
123
|
-
|
|
124
|
-
const answers = {
|
|
125
|
-
app,
|
|
126
|
-
platform,
|
|
127
|
-
identifier,
|
|
128
|
-
binaryVersion,
|
|
129
|
-
appVersion,
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
await release(
|
|
133
|
-
bundleUploader,
|
|
134
|
-
getReleaseHistory,
|
|
135
|
-
setReleaseHistory,
|
|
136
|
-
answers.app,
|
|
137
|
-
answers.binaryVersion,
|
|
138
|
-
answers.appVersion,
|
|
139
|
-
answers.platform,
|
|
140
|
-
options.outputPath,
|
|
141
|
-
options.entryFile,
|
|
142
|
-
options.bundleName,
|
|
143
|
-
options.mandatory,
|
|
144
|
-
options.enable,
|
|
145
|
-
options.skipBundle,
|
|
146
|
-
options.skipCleanup,
|
|
147
|
-
`${options.outputPath}/${options.outputBundleDir}`
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
console.log('🚀 Release completed.')
|
|
151
|
-
})
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
const { bundleCodePush } = require('../bundleCommand/bundleCodePush')
|
|
3
|
-
const { addToReleaseHistory } = require('./addToReleaseHistory')
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @param bundleUploader {
|
|
7
|
-
* function(
|
|
8
|
-
* source: string,
|
|
9
|
-
* platform: "ios" | "android",
|
|
10
|
-
* ): Promise<{ downloadUrl: string }>}
|
|
11
|
-
* @param getReleaseHistory {
|
|
12
|
-
* function(
|
|
13
|
-
* targetBinaryVersion: string,
|
|
14
|
-
* platform: "ios" | "android",
|
|
15
|
-
* ): Promise<ReleaseHistoryInterface>}
|
|
16
|
-
* @param setReleaseHistory {
|
|
17
|
-
* function(
|
|
18
|
-
* targetBinaryVersion: string,
|
|
19
|
-
* jsonFilePath: string,
|
|
20
|
-
* releaseInfo: ReleaseHistoryInterface,
|
|
21
|
-
* platform: "ios" | "android",
|
|
22
|
-
* ): Promise<void>}
|
|
23
|
-
* @param app {"user" | "device"}
|
|
24
|
-
* @param binaryVersion {string}
|
|
25
|
-
* @param appVersion {string}
|
|
26
|
-
* @param platform {"ios" | "android"}
|
|
27
|
-
* @param outputPath {string}
|
|
28
|
-
* @param entryFile {string}
|
|
29
|
-
* @param jsBundleName {string}
|
|
30
|
-
* @param mandatory {boolean}
|
|
31
|
-
* @param enable {boolean}
|
|
32
|
-
* @param skipBundle {boolean}
|
|
33
|
-
* @param skipCleanup {boolean}
|
|
34
|
-
* @param bundleDirectory {string}
|
|
35
|
-
* @return {Promise<void>}
|
|
36
|
-
*/
|
|
37
|
-
async function release(
|
|
38
|
-
bundleUploader,
|
|
39
|
-
getReleaseHistory,
|
|
40
|
-
setReleaseHistory,
|
|
41
|
-
app,
|
|
42
|
-
binaryVersion,
|
|
43
|
-
appVersion,
|
|
44
|
-
platform,
|
|
45
|
-
outputPath,
|
|
46
|
-
entryFile,
|
|
47
|
-
jsBundleName,
|
|
48
|
-
mandatory,
|
|
49
|
-
enable,
|
|
50
|
-
skipBundle,
|
|
51
|
-
skipCleanup,
|
|
52
|
-
bundleDirectory
|
|
53
|
-
) {
|
|
54
|
-
const bundleFileName = skipBundle
|
|
55
|
-
? readBundleFileNameFrom(bundleDirectory)
|
|
56
|
-
: await bundleCodePush(
|
|
57
|
-
platform,
|
|
58
|
-
outputPath,
|
|
59
|
-
entryFile,
|
|
60
|
-
jsBundleName,
|
|
61
|
-
bundleDirectory
|
|
62
|
-
)
|
|
63
|
-
const bundleFilePath = `${bundleDirectory}/${bundleFileName}`
|
|
64
|
-
|
|
65
|
-
const downloadUrl = await (async () => {
|
|
66
|
-
try {
|
|
67
|
-
console.log('Uploading Bundle File...')
|
|
68
|
-
const { downloadUrl } = await bundleUploader(
|
|
69
|
-
bundleFilePath,
|
|
70
|
-
app,
|
|
71
|
-
platform
|
|
72
|
-
)
|
|
73
|
-
console.log('Bundle File uploaded:', downloadUrl)
|
|
74
|
-
return downloadUrl
|
|
75
|
-
} catch (error) {
|
|
76
|
-
console.error(
|
|
77
|
-
'Failed to upload the bundle file. Exiting the program.',
|
|
78
|
-
error
|
|
79
|
-
)
|
|
80
|
-
process.exit(1)
|
|
81
|
-
}
|
|
82
|
-
})()
|
|
83
|
-
|
|
84
|
-
await addToReleaseHistory(
|
|
85
|
-
app,
|
|
86
|
-
appVersion,
|
|
87
|
-
binaryVersion,
|
|
88
|
-
downloadUrl,
|
|
89
|
-
bundleFileName,
|
|
90
|
-
getReleaseHistory,
|
|
91
|
-
setReleaseHistory,
|
|
92
|
-
platform,
|
|
93
|
-
mandatory,
|
|
94
|
-
enable
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
if (!skipCleanup) {
|
|
98
|
-
cleanUpOutputs(outputPath)
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function cleanUpOutputs(dir) {
|
|
103
|
-
fs.rmSync(dir, { recursive: true })
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @param bundleDirectory {string}
|
|
108
|
-
* @return {string}
|
|
109
|
-
*/
|
|
110
|
-
function readBundleFileNameFrom(bundleDirectory) {
|
|
111
|
-
const files = fs.readdirSync(bundleDirectory)
|
|
112
|
-
if (files.length !== 1) {
|
|
113
|
-
console.error('The bundlePath must contain only one file.')
|
|
114
|
-
process.exit(1)
|
|
115
|
-
}
|
|
116
|
-
const path = require('path')
|
|
117
|
-
const bundleFilePath = path.join(bundleDirectory, files[0])
|
|
118
|
-
return path.basename(bundleFilePath)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
module.exports = { release: release }
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const { program } = require('commander')
|
|
2
|
-
const { COMPILED_CONFIG_FILE_NAME } = require('../../constant')
|
|
3
|
-
const { findAndReadConfigFile } = require('../../utils/fsUtils')
|
|
4
|
-
const { removePullRequestHistory } = require('./removePullRequestHistory')
|
|
5
|
-
|
|
6
|
-
program
|
|
7
|
-
.command('remove-pr-history')
|
|
8
|
-
.description('Removes a pull request history.')
|
|
9
|
-
.option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
|
|
10
|
-
.option('-p, --platform <string>', 'target platform (ios/android)')
|
|
11
|
-
.option('-r, --pr-number <number>', 'pull request number')
|
|
12
|
-
.option(
|
|
13
|
-
'-c, --config <path>',
|
|
14
|
-
'set config file name (JS/TS)',
|
|
15
|
-
COMPILED_CONFIG_FILE_NAME
|
|
16
|
-
)
|
|
17
|
-
.action(async (options) => {
|
|
18
|
-
const { getReleaseHistory, removeReleaseHistory } =
|
|
19
|
-
await findAndReadConfigFile(process.cwd(), options.config)
|
|
20
|
-
|
|
21
|
-
await removePullRequestHistory(
|
|
22
|
-
getReleaseHistory,
|
|
23
|
-
removeReleaseHistory,
|
|
24
|
-
options.app,
|
|
25
|
-
options.prNumber,
|
|
26
|
-
options.platform
|
|
27
|
-
)
|
|
28
|
-
})
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
async function removePullRequestHistory(
|
|
2
|
-
getReleaseHistory,
|
|
3
|
-
removeReleaseHistory,
|
|
4
|
-
app,
|
|
5
|
-
prNumber,
|
|
6
|
-
platform
|
|
7
|
-
) {
|
|
8
|
-
const releaseHistory = await getReleaseHistory(app, prNumber, platform)
|
|
9
|
-
|
|
10
|
-
if (!releaseHistory) {
|
|
11
|
-
console.error(`v${prNumber} is already removed or is not released.`)
|
|
12
|
-
process.exit(1)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
await removeReleaseHistory(app, prNumber, platform)
|
|
17
|
-
} catch (error) {
|
|
18
|
-
console.error('Error occurred while removing history:', error)
|
|
19
|
-
process.exit(1)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = { removePullRequestHistory }
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
const { program } = require('commander')
|
|
2
|
-
const { findAndReadConfigFile } = require('../../utils/fsUtils')
|
|
3
|
-
const { COMPILED_CONFIG_FILE_NAME } = require('../../constant')
|
|
4
|
-
const {
|
|
5
|
-
getAppValue,
|
|
6
|
-
getPlatformValue,
|
|
7
|
-
getIdentifierValue,
|
|
8
|
-
getBinaryVersionValueFromList,
|
|
9
|
-
} = require('../common')
|
|
10
|
-
|
|
11
|
-
program
|
|
12
|
-
.command('show-history')
|
|
13
|
-
.description(
|
|
14
|
-
'Retrieves and prints the release history of a specific binary version.\n`getReleaseHistory` function should be implemented in the config file.'
|
|
15
|
-
)
|
|
16
|
-
.option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
|
|
17
|
-
.option('-p, --platform <string>', 'target platform (ios/android)')
|
|
18
|
-
.option('-i, --identifier <string>', 'target env identifier (dev/stg/prd)')
|
|
19
|
-
.option('-b, --binary-version <string>', 'target binary version (x.y.z)')
|
|
20
|
-
.option(
|
|
21
|
-
'-c, --config <path>',
|
|
22
|
-
'configuration file name (JS/TS)',
|
|
23
|
-
COMPILED_CONFIG_FILE_NAME
|
|
24
|
-
)
|
|
25
|
-
.action(async (options) => {
|
|
26
|
-
if (
|
|
27
|
-
options.app &&
|
|
28
|
-
!['user', 'device', 'b2c-device', 'home-device', 'home-mobile'].includes(options.app)
|
|
29
|
-
) {
|
|
30
|
-
throw new Error('App must be either "user" or "device" or "b2c-device" or "home-device" or "home-mobile"')
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (options.platform && !['ios', 'android'].includes(options.platform)) {
|
|
34
|
-
throw new Error('Platform must be either "ios" or "android"')
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (options.app !== 'user' && options.app !== 'home-mobile' && options.platform === 'ios') {
|
|
38
|
-
throw new Error('Only user and home-mobile apps are supported on iOS')
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
options.identifier &&
|
|
43
|
-
!['dev', 'stg', 'prd'].includes(options.identifier)
|
|
44
|
-
) {
|
|
45
|
-
throw new Error('Identifier must be either "dev" or "stg" or "prd"')
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const semverRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/
|
|
49
|
-
if (options.binaryVersion && !semverRegex.test(options.binaryVersion)) {
|
|
50
|
-
throw new Error('Binary version must be a valid semver format (x.y.z)')
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const { getBinaryVersionList, getReleaseHistory } =
|
|
54
|
-
await findAndReadConfigFile(process.cwd(), options.config)
|
|
55
|
-
|
|
56
|
-
const app = options.app || (await getAppValue())
|
|
57
|
-
|
|
58
|
-
const platform =
|
|
59
|
-
options.platform ||
|
|
60
|
-
(app !== 'user' && 'android') ||
|
|
61
|
-
(await getPlatformValue(app))
|
|
62
|
-
|
|
63
|
-
const identifier = options.identifier || (await getIdentifierValue())
|
|
64
|
-
|
|
65
|
-
const binaryVersion =
|
|
66
|
-
options.binaryVersion ||
|
|
67
|
-
(await getBinaryVersionValueFromList(
|
|
68
|
-
getBinaryVersionList,
|
|
69
|
-
app,
|
|
70
|
-
platform,
|
|
71
|
-
identifier
|
|
72
|
-
))
|
|
73
|
-
|
|
74
|
-
const answers = {
|
|
75
|
-
app,
|
|
76
|
-
platform,
|
|
77
|
-
identifier,
|
|
78
|
-
binaryVersion,
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const releaseHistory = await getReleaseHistory(
|
|
82
|
-
answers.app,
|
|
83
|
-
answers.binaryVersion,
|
|
84
|
-
answers.platform
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
console.log(JSON.stringify(releaseHistory, null, 2))
|
|
88
|
-
})
|