@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,202 +0,0 @@
|
|
|
1
|
-
/* zip.h -- IO on .zip files using zlib
|
|
2
|
-
Version 1.1, February 14h, 2010
|
|
3
|
-
part of the MiniZip project
|
|
4
|
-
|
|
5
|
-
Copyright (C) 1998-2010 Gilles Vollant
|
|
6
|
-
http://www.winimage.com/zLibDll/minizip.html
|
|
7
|
-
Modifications for Zip64 support
|
|
8
|
-
Copyright (C) 2009-2010 Mathias Svensson
|
|
9
|
-
http://result42.com
|
|
10
|
-
|
|
11
|
-
This program is distributed under the terms of the same license as zlib.
|
|
12
|
-
See the accompanying LICENSE file for the full text of the license.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
#ifndef _ZIP_H
|
|
16
|
-
#define _ZIP_H
|
|
17
|
-
|
|
18
|
-
#define HAVE_AES
|
|
19
|
-
|
|
20
|
-
#ifdef __cplusplus
|
|
21
|
-
extern "C" {
|
|
22
|
-
#endif
|
|
23
|
-
|
|
24
|
-
#ifndef _ZLIB_H
|
|
25
|
-
# include "zlib.h"
|
|
26
|
-
#endif
|
|
27
|
-
|
|
28
|
-
#ifndef _ZLIBIOAPI_H
|
|
29
|
-
# include "ioapi.h"
|
|
30
|
-
#endif
|
|
31
|
-
|
|
32
|
-
#ifdef HAVE_BZIP2
|
|
33
|
-
# include "bzlib.h"
|
|
34
|
-
#endif
|
|
35
|
-
|
|
36
|
-
#define Z_BZIP2ED 12
|
|
37
|
-
|
|
38
|
-
#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
|
|
39
|
-
/* like the STRICT of WIN32, we define a pointer that cannot be converted
|
|
40
|
-
from (void*) without cast */
|
|
41
|
-
typedef struct TagzipFile__ { int unused; } zipFile__;
|
|
42
|
-
typedef zipFile__ *zipFile;
|
|
43
|
-
#else
|
|
44
|
-
typedef voidp zipFile;
|
|
45
|
-
#endif
|
|
46
|
-
|
|
47
|
-
#define ZIP_OK (0)
|
|
48
|
-
#define ZIP_EOF (0)
|
|
49
|
-
#define ZIP_ERRNO (Z_ERRNO)
|
|
50
|
-
#define ZIP_PARAMERROR (-102)
|
|
51
|
-
#define ZIP_BADZIPFILE (-103)
|
|
52
|
-
#define ZIP_INTERNALERROR (-104)
|
|
53
|
-
|
|
54
|
-
#ifndef DEF_MEM_LEVEL
|
|
55
|
-
# if MAX_MEM_LEVEL >= 8
|
|
56
|
-
# define DEF_MEM_LEVEL 8
|
|
57
|
-
# else
|
|
58
|
-
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
|
59
|
-
# endif
|
|
60
|
-
#endif
|
|
61
|
-
/* default memLevel */
|
|
62
|
-
|
|
63
|
-
/* tm_zip contain date/time info */
|
|
64
|
-
typedef struct tm_zip_s
|
|
65
|
-
{
|
|
66
|
-
uInt tm_sec; /* seconds after the minute - [0,59] */
|
|
67
|
-
uInt tm_min; /* minutes after the hour - [0,59] */
|
|
68
|
-
uInt tm_hour; /* hours since midnight - [0,23] */
|
|
69
|
-
uInt tm_mday; /* day of the month - [1,31] */
|
|
70
|
-
uInt tm_mon; /* months since January - [0,11] */
|
|
71
|
-
uInt tm_year; /* years - [1980..2044] */
|
|
72
|
-
} tm_zip;
|
|
73
|
-
|
|
74
|
-
typedef struct
|
|
75
|
-
{
|
|
76
|
-
tm_zip tmz_date; /* date in understandable format */
|
|
77
|
-
uLong dosDate; /* if dos_date == 0, tmu_date is used */
|
|
78
|
-
uLong internal_fa; /* internal file attributes 2 bytes */
|
|
79
|
-
uLong external_fa; /* external file attributes 4 bytes */
|
|
80
|
-
} zip_fileinfo;
|
|
81
|
-
|
|
82
|
-
typedef const char* zipcharpc;
|
|
83
|
-
|
|
84
|
-
#define APPEND_STATUS_CREATE (0)
|
|
85
|
-
#define APPEND_STATUS_CREATEAFTER (1)
|
|
86
|
-
#define APPEND_STATUS_ADDINZIP (2)
|
|
87
|
-
|
|
88
|
-
/***************************************************************************/
|
|
89
|
-
/* Writing a zip file */
|
|
90
|
-
|
|
91
|
-
extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
|
|
92
|
-
extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
|
|
93
|
-
/* Create a zipfile.
|
|
94
|
-
|
|
95
|
-
pathname should contain the full pathname (by example, on a Windows XP computer
|
|
96
|
-
"c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip".
|
|
97
|
-
|
|
98
|
-
return NULL if zipfile cannot be opened
|
|
99
|
-
return zipFile handle if no error
|
|
100
|
-
|
|
101
|
-
If the file pathname exist and append == APPEND_STATUS_CREATEAFTER, the zip
|
|
102
|
-
will be created at the end of the file. (useful if the file contain a self extractor code)
|
|
103
|
-
If the file pathname exist and append == APPEND_STATUS_ADDINZIP, we will add files in existing
|
|
104
|
-
zip (be sure you don't add file that doesn't exist)
|
|
105
|
-
|
|
106
|
-
NOTE: There is no delete function into a zipfile. If you want delete file into a zipfile,
|
|
107
|
-
you must open a zipfile, and create another. Of course, you can use RAW reading and writing to copy
|
|
108
|
-
the file you did not want delete. */
|
|
109
|
-
|
|
110
|
-
extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, int append, zipcharpc* globalcomment,
|
|
111
|
-
zlib_filefunc_def* pzlib_filefunc_def));
|
|
112
|
-
|
|
113
|
-
extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, int append, zipcharpc* globalcomment,
|
|
114
|
-
zlib_filefunc64_def* pzlib_filefunc_def));
|
|
115
|
-
|
|
116
|
-
extern zipFile ZEXPORT zipOpen3 OF((const char *pathname, int append, ZPOS64_T disk_size,
|
|
117
|
-
zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc_def));
|
|
118
|
-
/* Same as zipOpen2 but allows specification of spanned zip size */
|
|
119
|
-
|
|
120
|
-
extern zipFile ZEXPORT zipOpen3_64 OF((const void *pathname, int append, ZPOS64_T disk_size,
|
|
121
|
-
zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def));
|
|
122
|
-
|
|
123
|
-
extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
|
|
124
|
-
const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
|
|
125
|
-
uInt size_extrafield_global, const char* comment, int method, int level));
|
|
126
|
-
/* Open a file in the ZIP for writing.
|
|
127
|
-
|
|
128
|
-
filename : the filename in zip (if NULL, '-' without quote will be used
|
|
129
|
-
*zipfi contain supplemental information
|
|
130
|
-
extrafield_local buffer to store the local header extra field data, can be NULL
|
|
131
|
-
size_extrafield_local size of extrafield_local buffer
|
|
132
|
-
extrafield_global buffer to store the global header extra field data, can be NULL
|
|
133
|
-
size_extrafield_global size of extrafield_local buffer
|
|
134
|
-
comment buffer for comment string
|
|
135
|
-
method contain the compression method (0 for store, Z_DEFLATED for deflate)
|
|
136
|
-
level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
|
|
137
|
-
zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
|
|
138
|
-
this MUST be '1' if the uncompressed size is >= 0xffffffff. */
|
|
139
|
-
|
|
140
|
-
extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
|
|
141
|
-
const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
|
|
142
|
-
uInt size_extrafield_global, const char* comment, int method, int level, int zip64));
|
|
143
|
-
/* Same as zipOpenNewFileInZip with zip64 support */
|
|
144
|
-
|
|
145
|
-
extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
|
|
146
|
-
const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
|
|
147
|
-
uInt size_extrafield_global, const char* comment, int method, int level, int raw));
|
|
148
|
-
/* Same as zipOpenNewFileInZip, except if raw=1, we write raw file */
|
|
149
|
-
|
|
150
|
-
extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
|
|
151
|
-
const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
|
|
152
|
-
uInt size_extrafield_global, const char* comment, int method, int level, int raw, int zip64));
|
|
153
|
-
/* Same as zipOpenNewFileInZip3 with zip64 support */
|
|
154
|
-
|
|
155
|
-
extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
|
|
156
|
-
const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
|
|
157
|
-
uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel,
|
|
158
|
-
int strategy, const char* password, uLong crcForCrypting));
|
|
159
|
-
/* Same as zipOpenNewFileInZip2, except
|
|
160
|
-
windowBits, memLevel, strategy : see parameter strategy in deflateInit2
|
|
161
|
-
password : crypting password (NULL for no crypting)
|
|
162
|
-
crcForCrypting : crc of file to compress (needed for crypting) */
|
|
163
|
-
|
|
164
|
-
extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
|
|
165
|
-
const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
|
|
166
|
-
uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel,
|
|
167
|
-
int strategy, const char* password, uLong crcForCrypting, int zip64));
|
|
168
|
-
/* Same as zipOpenNewFileInZip3 with zip64 support */
|
|
169
|
-
|
|
170
|
-
extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
|
|
171
|
-
const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
|
|
172
|
-
uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel,
|
|
173
|
-
int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase));
|
|
174
|
-
/* Same as zipOpenNewFileInZip3 except versionMadeBy & flag fields */
|
|
175
|
-
|
|
176
|
-
extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi,
|
|
177
|
-
const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global,
|
|
178
|
-
uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel,
|
|
179
|
-
int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64));
|
|
180
|
-
/* Same as zipOpenNewFileInZip4 with zip64 support */
|
|
181
|
-
|
|
182
|
-
extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, const void* buf, unsigned len));
|
|
183
|
-
/* Write data in the zipfile */
|
|
184
|
-
|
|
185
|
-
extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
|
|
186
|
-
/* Close the current file in the zipfile */
|
|
187
|
-
|
|
188
|
-
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, uLong uncompressed_size, uLong crc32));
|
|
189
|
-
extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, ZPOS64_T uncompressed_size, uLong crc32));
|
|
190
|
-
/* Close the current file in the zipfile, for file opened with parameter raw=1 in zipOpenNewFileInZip2
|
|
191
|
-
uncompressed_size and crc32 are value for the uncompressed size */
|
|
192
|
-
|
|
193
|
-
extern int ZEXPORT zipClose OF((zipFile file, const char* global_comment));
|
|
194
|
-
/* Close the zipfile */
|
|
195
|
-
|
|
196
|
-
/***************************************************************************/
|
|
197
|
-
|
|
198
|
-
#ifdef __cplusplus
|
|
199
|
-
}
|
|
200
|
-
#endif
|
|
201
|
-
|
|
202
|
-
#endif /* _ZIP_H */
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This script generates a hash of all the React Native bundled assets and writes it into
|
|
3
|
-
* into the APK. The hash in "updateCheck" requests to prevent downloading an identical
|
|
4
|
-
* update to the one already present in the binary.
|
|
5
|
-
*
|
|
6
|
-
* It first creates a snapshot of the contents in the resource directory by creating
|
|
7
|
-
* a map with the modified time of all the files in the directory. It then compares this
|
|
8
|
-
* snapshot with the one saved earlier in "recordFilesBeforeBundleCommand.js" to figure
|
|
9
|
-
* out which files were generated by the "react-native bundle" command. It then computes
|
|
10
|
-
* the hash for each file to generate a manifest, and then computes a hash over the entire
|
|
11
|
-
* manifest to generate the final hash, which is saved to the APK's assets directory.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
var crypto = require("crypto");
|
|
15
|
-
var fs = require("fs");
|
|
16
|
-
var path = require("path");
|
|
17
|
-
|
|
18
|
-
var getFilesInFolder = require("./getFilesInFolder");
|
|
19
|
-
|
|
20
|
-
var CODE_PUSH_FOLDER_PREFIX = "CodePush";
|
|
21
|
-
var CODE_PUSH_HASH_FILE_NAME = "CodePushHash";
|
|
22
|
-
var CODE_PUSH_HASH_OLD_FILE_NAME = "CodePushHash.json";
|
|
23
|
-
var HASH_ALGORITHM = "sha256";
|
|
24
|
-
|
|
25
|
-
var resourcesDir = process.argv[2];
|
|
26
|
-
var jsBundleFilePath = process.argv[3];
|
|
27
|
-
var assetsDir = process.argv[4];
|
|
28
|
-
var tempFileName = process.argv[5];
|
|
29
|
-
|
|
30
|
-
var oldFileToModifiedTimeMap = {};
|
|
31
|
-
var tempFileLocalPath = null;
|
|
32
|
-
if (tempFileName) {
|
|
33
|
-
tempFileLocalPath = path.join(require("os").tmpdir(), tempFileName);
|
|
34
|
-
oldFileToModifiedTimeMap = require(tempFileLocalPath);
|
|
35
|
-
}
|
|
36
|
-
var resourceFiles = [];
|
|
37
|
-
|
|
38
|
-
getFilesInFolder(resourcesDir, resourceFiles);
|
|
39
|
-
|
|
40
|
-
var newFileToModifiedTimeMap = {};
|
|
41
|
-
|
|
42
|
-
resourceFiles.forEach(function(resourceFile) {
|
|
43
|
-
newFileToModifiedTimeMap[resourceFile.path.substring(resourcesDir.length)] = resourceFile.mtime;
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
var bundleGeneratedAssetFiles = [];
|
|
47
|
-
|
|
48
|
-
for (var newFilePath in newFileToModifiedTimeMap) {
|
|
49
|
-
if (!oldFileToModifiedTimeMap[newFilePath] || oldFileToModifiedTimeMap[newFilePath] < newFileToModifiedTimeMap[newFilePath].getTime()) {
|
|
50
|
-
bundleGeneratedAssetFiles.push(newFilePath);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var manifest = [];
|
|
55
|
-
|
|
56
|
-
if (bundleGeneratedAssetFiles.length) {
|
|
57
|
-
bundleGeneratedAssetFiles.forEach(function(assetFile) {
|
|
58
|
-
// Generate hash for each asset file
|
|
59
|
-
addFileToManifest(resourcesDir, assetFile, manifest, function() {
|
|
60
|
-
if (manifest.length === bundleGeneratedAssetFiles.length) {
|
|
61
|
-
addJsBundleAndMetaToManifest();
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
} else {
|
|
66
|
-
addJsBundleAndMetaToManifest();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function addJsBundleAndMetaToManifest() {
|
|
70
|
-
addFileToManifest(path.dirname(jsBundleFilePath), path.basename(jsBundleFilePath), manifest, function() {
|
|
71
|
-
var jsBundleMetaFilePath = jsBundleFilePath + ".meta";
|
|
72
|
-
addFileToManifest(path.dirname(jsBundleMetaFilePath), path.basename(jsBundleMetaFilePath), manifest, function() {
|
|
73
|
-
manifest = manifest.sort();
|
|
74
|
-
var finalHash = crypto.createHash(HASH_ALGORITHM)
|
|
75
|
-
.update(JSON.stringify(manifest))
|
|
76
|
-
.digest("hex");
|
|
77
|
-
|
|
78
|
-
console.log(finalHash);
|
|
79
|
-
|
|
80
|
-
var savedResourcesManifestPath = assetsDir + "/" + CODE_PUSH_HASH_FILE_NAME;
|
|
81
|
-
fs.writeFileSync(savedResourcesManifestPath, finalHash);
|
|
82
|
-
|
|
83
|
-
// "CodePushHash.json" file name breaks flow type checking.
|
|
84
|
-
// To fix the issue we need to delete "CodePushHash.json" file and
|
|
85
|
-
// use "CodePushHash" file name instead to store the hash value.
|
|
86
|
-
// Relates to https://github.com/microsoft/react-native-code-push/issues/577
|
|
87
|
-
var oldSavedResourcesManifestPath = assetsDir + "/" + CODE_PUSH_HASH_OLD_FILE_NAME;
|
|
88
|
-
if (fs.existsSync(oldSavedResourcesManifestPath)) {
|
|
89
|
-
fs.unlinkSync(oldSavedResourcesManifestPath);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function addFileToManifest(folder, assetFile, manifest, done) {
|
|
96
|
-
var fullFilePath = path.join(folder, assetFile);
|
|
97
|
-
if (!fileExists(fullFilePath)) {
|
|
98
|
-
done();
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
var readStream = fs.createReadStream(path.join(folder, assetFile));
|
|
103
|
-
var hashStream = crypto.createHash(HASH_ALGORITHM);
|
|
104
|
-
|
|
105
|
-
readStream.pipe(hashStream)
|
|
106
|
-
.on("error", function(error) {
|
|
107
|
-
throw error;
|
|
108
|
-
})
|
|
109
|
-
.on("finish", function() {
|
|
110
|
-
hashStream.end();
|
|
111
|
-
var buffer = hashStream.read();
|
|
112
|
-
var fileHash = buffer.toString("hex");
|
|
113
|
-
manifest.push(path.join(CODE_PUSH_FOLDER_PREFIX, assetFile).replace(/\\/g, "/") + ":" + fileHash);
|
|
114
|
-
done();
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function fileExists(file) {
|
|
119
|
-
try { return fs.statSync(file).isFile(); }
|
|
120
|
-
catch (e) { return false; }
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (tempFileLocalPath) {
|
|
124
|
-
fs.unlinkSync(tempFileLocalPath);
|
|
125
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var fs = require("fs");
|
|
2
|
-
var path = require("path");
|
|
3
|
-
|
|
4
|
-
// Utility function that collects the stats of every file in a directory
|
|
5
|
-
// as well as in its subdirectories.
|
|
6
|
-
function getFilesInFolder(folderName, fileList) {
|
|
7
|
-
var folderFiles = fs.readdirSync(folderName);
|
|
8
|
-
folderFiles.forEach(function(file) {
|
|
9
|
-
var fileStats = fs.statSync(path.join(folderName, file));
|
|
10
|
-
if (fileStats.isDirectory()) {
|
|
11
|
-
getFilesInFolder(path.join(folderName, file), fileList);
|
|
12
|
-
} else {
|
|
13
|
-
fileStats.path = path.join(folderName, file);
|
|
14
|
-
fileList.push(fileStats);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
module.exports = getFilesInFolder;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This script creates a snapshot of the contents in the resource directory
|
|
3
|
-
* by creating a map with the modified time of all the files in the directory
|
|
4
|
-
* and saving it to a temp file. This snapshot is later referenced in
|
|
5
|
-
* "generatePackageHash.js" to figure out which files have changed or were
|
|
6
|
-
* newly generated by the "react-native bundle" command.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
var fs = require("fs");
|
|
10
|
-
var path = require("path");
|
|
11
|
-
|
|
12
|
-
var getFilesInFolder = require("./getFilesInFolder");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var resourcesDir = process.argv[2];
|
|
16
|
-
var tempFileName = process.argv[3];
|
|
17
|
-
|
|
18
|
-
var tempFileLocalPath = path.join(require("os").tmpdir(), tempFileName);
|
|
19
|
-
var resourceFiles = [];
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
getFilesInFolder(resourcesDir, resourceFiles);
|
|
23
|
-
} catch(error) {
|
|
24
|
-
var targetPathNotFoundExceptionMessage = "\nResources directory path does not exist.\n";
|
|
25
|
-
targetPathNotFoundExceptionMessage += "Unable to find '" + resourcesDir;
|
|
26
|
-
targetPathNotFoundExceptionMessage += "' directory. Please check version of Android Plugin for Gradle.";
|
|
27
|
-
error.message += targetPathNotFoundExceptionMessage;
|
|
28
|
-
throw error;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
var fileToModifiedTimeMap = {};
|
|
32
|
-
|
|
33
|
-
resourceFiles.forEach(function(resourceFile) {
|
|
34
|
-
fileToModifiedTimeMap[resourceFile.path.substring(resourcesDir.length)] = resourceFile.mtime.getTime();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
fs.writeFile(tempFileLocalPath, JSON.stringify(fileToModifiedTimeMap), function(err) {
|
|
38
|
-
if (err) {
|
|
39
|
-
throw err;
|
|
40
|
-
}
|
|
41
|
-
});
|
package/scripts/release.sh
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# npm 배포 + GitHub Release 자동화
|
|
5
|
-
# 사용법: npm run release [-- patch|minor|major]
|
|
6
|
-
|
|
7
|
-
VERSION_TYPE="${1:-patch}"
|
|
8
|
-
VALID_TYPES=("patch" "minor" "major")
|
|
9
|
-
|
|
10
|
-
if [[ ! " ${VALID_TYPES[*]} " =~ " ${VERSION_TYPE} " ]]; then
|
|
11
|
-
echo "Error: Invalid version type '${VERSION_TYPE}'. Use: patch, minor, major"
|
|
12
|
-
exit 1
|
|
13
|
-
fi
|
|
14
|
-
|
|
15
|
-
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
16
|
-
|
|
17
|
-
# 1. npm 로그인 확인
|
|
18
|
-
if ! npm whoami &>/dev/null; then
|
|
19
|
-
echo "npm 로그인이 필요합니다."
|
|
20
|
-
echo "계정 정보: https://www.notion.so/algocare/npm-1d59954bcc7b8056b6b6c84612592266"
|
|
21
|
-
npm login --scope=@algocare
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
# 2. clean working tree 확인
|
|
25
|
-
if [[ -n "$(git status --porcelain)" ]]; then
|
|
26
|
-
echo "Error: Working tree is not clean. Commit or stash changes first."
|
|
27
|
-
exit 1
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
# 3. master 브랜치 확인
|
|
31
|
-
CURRENT_BRANCH=$(git branch --show-current)
|
|
32
|
-
if [[ "${CURRENT_BRANCH}" != "master" ]]; then
|
|
33
|
-
echo "Error: Must be on master branch. Current: ${CURRENT_BRANCH}"
|
|
34
|
-
exit 1
|
|
35
|
-
fi
|
|
36
|
-
|
|
37
|
-
# 4. 버전 bump
|
|
38
|
-
NEW_VERSION=$(npm version "${VERSION_TYPE}" --no-git-tag-version)
|
|
39
|
-
echo "Bumped to ${NEW_VERSION}"
|
|
40
|
-
|
|
41
|
-
# 5. commit + tag
|
|
42
|
-
git add package.json
|
|
43
|
-
git commit -m "${NEW_VERSION}"
|
|
44
|
-
git tag "${NEW_VERSION}"
|
|
45
|
-
|
|
46
|
-
# 6. npm publish (OTP/브라우저 인증 시 에러 코드 반환 후 백그라운드에서 성공할 수 있음)
|
|
47
|
-
echo "Publishing to npm..."
|
|
48
|
-
if ! npm publish --access public --ignore-scripts; then
|
|
49
|
-
echo "npm publish가 에러를 반환했습니다. 실제 배포 여부 확인 중..."
|
|
50
|
-
sleep 3
|
|
51
|
-
PUBLISHED=$(npm view "${PACKAGE_NAME}@${NEW_VERSION}" version 2>/dev/null || true)
|
|
52
|
-
if [[ "${PUBLISHED}" == "${NEW_VERSION#v}" ]]; then
|
|
53
|
-
echo "확인 완료: ${NEW_VERSION} 이미 배포되어 있습니다. 계속 진행합니다."
|
|
54
|
-
else
|
|
55
|
-
echo "Error: npm publish 실패. 수동으로 확인해주세요."
|
|
56
|
-
echo "복구: git tag -d ${NEW_VERSION} && git reset --soft HEAD~1"
|
|
57
|
-
exit 1
|
|
58
|
-
fi
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
# 7. git push
|
|
62
|
-
if ! git push || ! git push --tags; then
|
|
63
|
-
echo "Error: git push 실패. npm에는 이미 배포됨."
|
|
64
|
-
echo "수동으로 push해주세요: git push && git push --tags"
|
|
65
|
-
exit 1
|
|
66
|
-
fi
|
|
67
|
-
|
|
68
|
-
# 8. GitHub Release (최근 태그 이후 커밋 기반 노트 생성)
|
|
69
|
-
PREV_TAG=$(git tag --sort=-v:refname | sed -n '2p')
|
|
70
|
-
RELEASE_NOTES=""
|
|
71
|
-
|
|
72
|
-
if [[ -n "${PREV_TAG}" ]]; then
|
|
73
|
-
RELEASE_NOTES=$(git log "${PREV_TAG}..${NEW_VERSION}" --merges --pretty=format:"- %s" 2>/dev/null || true)
|
|
74
|
-
fi
|
|
75
|
-
|
|
76
|
-
if [[ -z "${RELEASE_NOTES}" ]]; then
|
|
77
|
-
RELEASE_NOTES=$(git log "${PREV_TAG:-HEAD~5}..${NEW_VERSION}" --no-merges --pretty=format:"- %s" 2>/dev/null | head -20)
|
|
78
|
-
fi
|
|
79
|
-
|
|
80
|
-
if ! gh release create "${NEW_VERSION}" --title "${NEW_VERSION#v}" --notes "${RELEASE_NOTES}"; then
|
|
81
|
-
echo "Warning: GitHub Release 생성 실패. 수동으로 생성해주세요:"
|
|
82
|
-
echo " gh release create ${NEW_VERSION} --title \"${NEW_VERSION#v}\""
|
|
83
|
-
fi
|
|
84
|
-
|
|
85
|
-
echo ""
|
|
86
|
-
echo "Done! ${NEW_VERSION} published and released."
|
package/tsconfig.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES5",
|
|
4
|
-
"module": "CommonJS",
|
|
5
|
-
"lib": ["es6"],
|
|
6
|
-
"noImplicitAny": true,
|
|
7
|
-
"noEmitOnError": true,
|
|
8
|
-
"moduleResolution": "node",
|
|
9
|
-
"sourceMap": true,
|
|
10
|
-
"rootDir": "test",
|
|
11
|
-
"outDir": "bin",
|
|
12
|
-
"removeComments": true,
|
|
13
|
-
"esModuleInterop": true
|
|
14
|
-
},
|
|
15
|
-
"ts-node": {
|
|
16
|
-
"compilerOptions": {
|
|
17
|
-
"module": "commonjs"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
package/tslint.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"defaultSeverity": "error",
|
|
3
|
-
"rules": {
|
|
4
|
-
"class-name": true,
|
|
5
|
-
"comment-format": [true,
|
|
6
|
-
"check-space"
|
|
7
|
-
],
|
|
8
|
-
"indent": [true,
|
|
9
|
-
"spaces"
|
|
10
|
-
],
|
|
11
|
-
"one-line": [true,
|
|
12
|
-
"check-open-brace"
|
|
13
|
-
],
|
|
14
|
-
"quotemark": [true,
|
|
15
|
-
"double"
|
|
16
|
-
],
|
|
17
|
-
"semicolon": true,
|
|
18
|
-
"whitespace": [true,
|
|
19
|
-
"check-branch",
|
|
20
|
-
"check-operator",
|
|
21
|
-
"check-separator",
|
|
22
|
-
"check-type"
|
|
23
|
-
],
|
|
24
|
-
"typedef-whitespace": [true, {
|
|
25
|
-
"call-signature": "nospace",
|
|
26
|
-
"index-signature": "nospace",
|
|
27
|
-
"parameter": "nospace",
|
|
28
|
-
"property-declaration": "nospace",
|
|
29
|
-
"variable-declaration": "nospace"
|
|
30
|
-
}]
|
|
31
|
-
}
|
|
32
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|