@turbopush/react-native-code-push 10.2.5 → 10.3.0-rc.1

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.
Files changed (87) hide show
  1. package/LICENSE.md +3 -1
  2. package/README.md +118 -39
  3. package/android/app/src/debug/AndroidManifest.xml +9 -0
  4. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +33 -21
  5. package/package.json +15 -12
  6. package/request-fetch-adapter.js +35 -15
  7. package/.azurepipelines/build-rn-code-push-1es.yml +0 -104
  8. package/.azurepipelines/test-rn-code-push.yml +0 -94
  9. package/.config/CredScanSuppressions.json +0 -14
  10. package/.gitconfig +0 -6
  11. package/CONTRIBUTING.md +0 -134
  12. package/SECURITY.md +0 -41
  13. package/docs/api-android.md +0 -52
  14. package/docs/api-ios.md +0 -31
  15. package/docs/api-js.md +0 -592
  16. package/docs/multi-deployment-testing-android.md +0 -55
  17. package/docs/multi-deployment-testing-ios.md +0 -59
  18. package/docs/setup-android.md +0 -92
  19. package/docs/setup-ios.md +0 -138
  20. package/docs/setup-windows.md +0 -121
  21. package/expo.js +0 -324
  22. package/tsconfig.json +0 -17
  23. package/tslint.json +0 -32
  24. package/windows/CodePush/CodePush.def +0 -3
  25. package/windows/CodePush/CodePush.vcxproj +0 -198
  26. package/windows/CodePush/CodePush.vcxproj.filters +0 -91
  27. package/windows/CodePush/CodePushConfig.cpp +0 -104
  28. package/windows/CodePush/CodePushConfig.h +0 -66
  29. package/windows/CodePush/CodePushConfig.idl +0 -12
  30. package/windows/CodePush/CodePushDownloadHandler.cpp +0 -73
  31. package/windows/CodePush/CodePushDownloadHandler.h +0 -32
  32. package/windows/CodePush/CodePushNativeModule.cpp +0 -934
  33. package/windows/CodePush/CodePushNativeModule.h +0 -247
  34. package/windows/CodePush/CodePushPackage.cpp +0 -456
  35. package/windows/CodePush/CodePushPackage.h +0 -49
  36. package/windows/CodePush/CodePushTelemetryManager.cpp +0 -213
  37. package/windows/CodePush/CodePushTelemetryManager.h +0 -29
  38. package/windows/CodePush/CodePushUpdateUtils.cpp +0 -86
  39. package/windows/CodePush/CodePushUpdateUtils.h +0 -38
  40. package/windows/CodePush/CodePushUtils.cpp +0 -29
  41. package/windows/CodePush/CodePushUtils.h +0 -18
  42. package/windows/CodePush/FileUtils.cpp +0 -131
  43. package/windows/CodePush/FileUtils.h +0 -28
  44. package/windows/CodePush/PropertySheet.props +0 -16
  45. package/windows/CodePush/ReactPackageProvider.cpp +0 -15
  46. package/windows/CodePush/ReactPackageProvider.h +0 -22
  47. package/windows/CodePush/ReactPackageProvider.idl +0 -9
  48. package/windows/CodePush/miniz/LICENSE +0 -22
  49. package/windows/CodePush/miniz/miniz.c +0 -7657
  50. package/windows/CodePush/miniz/miniz.h +0 -1338
  51. package/windows/CodePush/miniz/readme.md +0 -37
  52. package/windows/CodePush/packages.config +0 -4
  53. package/windows/CodePush/pch.cpp +0 -1
  54. package/windows/CodePush/pch.h +0 -4
  55. package/windows-legacy/CodePush/CodePush.csproj +0 -128
  56. package/windows-legacy/CodePush/CodePushUtils.cs +0 -47
  57. package/windows-legacy/CodePush/FileUtils.cs +0 -40
  58. package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +0 -29
  59. package/windows-legacy/CodePush/Properties/CodePush.rd.xml +0 -33
  60. package/windows-legacy/CodePush/UpdateManager.cs +0 -305
  61. package/windows-legacy/CodePush/UpdateUtils.cs +0 -46
  62. package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -28
  63. package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -106
  64. package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +0 -103
  65. package/windows-legacy/CodePush.Net46/CodePushUtils.cs +0 -158
  66. package/windows-legacy/CodePush.Net46/FileUtils.cs +0 -55
  67. package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +0 -36
  68. package/windows-legacy/CodePush.Net46/UpdateManager.cs +0 -330
  69. package/windows-legacy/CodePush.Net46/UpdateUtils.cs +0 -70
  70. package/windows-legacy/CodePush.Net46/packages.config +0 -5
  71. package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +0 -105
  72. package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +0 -137
  73. package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +0 -36
  74. package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +0 -117
  75. package/windows-legacy/CodePush.Net46.Test/app.config +0 -11
  76. package/windows-legacy/CodePush.Net46.Test/packages.config +0 -4
  77. package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +0 -22
  78. package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +0 -13
  79. package/windows-legacy/CodePush.Shared/CodePushConstants.cs +0 -35
  80. package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +0 -329
  81. package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +0 -235
  82. package/windows-legacy/CodePush.Shared/CodePushUtils.cs +0 -70
  83. package/windows-legacy/CodePush.Shared/InstallMode.cs +0 -9
  84. package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +0 -44
  85. package/windows-legacy/CodePush.Shared/SettingsManager.cs +0 -148
  86. package/windows-legacy/CodePush.Shared/TelemetryManager.cs +0 -250
  87. package/windows-legacy/CodePush.Shared/UpdateState.cs +0 -9
package/.gitconfig DELETED
@@ -1,6 +0,0 @@
1
- [user]
2
- email = 220655984+dreamer-turbopush@users.noreply.github.com
3
- name = dreamer-turbopush
4
-
5
- [core]
6
- sshCommand = ssh -i ~/.ssh/id_rsa_tp
package/CONTRIBUTING.md DELETED
@@ -1,134 +0,0 @@
1
- # Contributing
2
-
3
- ## Using the plugin
4
-
5
- ### Environment setup
6
-
7
- `node.js` and `npm` are needed for using this project. `npm` comes bundled with the `node.js` installer. You can download the `node.js` installer here: https://nodejs.org/download/.
8
-
9
- Once you have installed `node.js` and `npm`, install the dev dependencies for the project.
10
-
11
- ```
12
- npm install
13
- ```
14
-
15
- ### Using the plugin manually
16
-
17
- Follow these steps to test your modifications to the plugin manually:
18
- - clone this repository
19
- - install the dependencies
20
-
21
- Navigate to the root folder from your command line console and run:
22
- ```
23
- npm install
24
- ```
25
- - install the plugin in a React-Native project
26
-
27
- Navigate to the root folder of your React-Native project from your command line console and run:
28
- ```
29
- npm install local_path_to_your_clone_of_this_repo
30
- ```
31
- - configure the plugin using the steps in the README.md
32
- - build and run your app on an emulator or device
33
-
34
- ## Test
35
-
36
- ### Environment setup
37
-
38
- First, make sure you have installed the dependencies for the plugin by following the steps above.
39
-
40
- Then, make sure you have installed `react-native`.
41
-
42
- ```
43
- npm install -g react-native
44
- ```
45
-
46
- To run Android tests, make sure you have `sdk\tools`, `sdk\emulator` and `sdk\platform-tools` in your PATH.
47
-
48
- To run iOS tests, make sure you've installed CocoaPods and have `.gem/bin` in your PATH.
49
-
50
- ### Supported platforms
51
-
52
- The plugin has end to end tests for Android and iOS. Depending on your development machine OS, you can run some or all the tests.
53
-
54
- OS | Supported tests
55
- ------------- | -------------
56
- OS X | Android, iOS
57
- Windows | Android
58
-
59
- ### Test descriptions
60
-
61
- The tests first build the app.
62
-
63
- They then check if the required emulators are currently running.
64
-
65
- If an Android emulator is not running, it attempts to boot the latest Android emulator. You can specify an emulator by adding env variable `ANDROID_EMU=yourEmulatorNameHere` to the npm command. For example: `ANDROID_EMU=yourEmulatorNameHere npm run test:android`.
66
-
67
- If an iOS simulator is not running, it attempts to boot the latest iOS iPhone simulator. You can specify a simulator by adding env variable `IOS_EMU=yourSimulatorNameHere` to the npm command. For example: `IOS_EMU="iPhone 8 (0567DFF8-329E-41A3-BD6D-E48E9DD5EF39)" npm run test:ios`.
68
-
69
- If all the required emulators are not running and the tests fail to boot them, the tests will fail.
70
-
71
- If you would like the tests to always restart the necessary emulators (killing them if they are currently running), setup a env variable `CLEAN=true` to the command. For example: `CLEAN=true npm run test`.
72
-
73
- The desired unit tests are then run.
74
-
75
- If you would like to skip building, add a `:fast` in the command you'd like to run. For example, `npm run test:ios` becomes `npm run test:fast:ios` or `npm run test:android` becomes `npm run test:fast:android`.
76
-
77
- There is a both a full unit test suite and a "core" set of unit tests that you may run. If you would like to run only the core tests, setup a env variable `CORE=true` to the command. For example: `CORE=true npm run test:android`.
78
-
79
- If you would like to pull the plugin from NPM rather than running the tests on the local version, setup a env variable `NPM=true` to the command. For example: `NPM=true npm run test:ios`.
80
-
81
- #### Default
82
-
83
- To run all of the unit tests on Android and iOS:
84
- ```
85
- npm run test
86
- ```
87
-
88
- #### iOS
89
-
90
- To run all of the unit tests on iOS:
91
- ```
92
- npm run test:ios
93
- ```
94
-
95
- #### Android
96
-
97
- To run all of the unit tests on Android:
98
- ```
99
- npm run test:android
100
- ```
101
-
102
- #### More examples
103
-
104
- All possible testing configurations have tasks!
105
-
106
- The platforms are ordered as follows, and ran in that order:
107
- android, ios
108
-
109
- To run the core unit tests on Android:
110
- ```
111
- CORE=true npm run test:android
112
- ```
113
-
114
- To run all of the unit tests on iOS and pull the plugin from NPM:
115
- ```
116
- NPM=true npm run test:ios
117
- ```
118
-
119
- To run all of the unit tests on Android and iOS without building first:
120
- ```
121
- npm run test:fast
122
- ```
123
-
124
- To run all of the unit tests on iOS and restart the emulators:
125
- ```
126
- CLEAN=true npm run test:ios
127
- ```
128
-
129
- To run the core unit tests on Android and pull the plugin from NPM:
130
- ```
131
- NPM=true CORE=true npm run test:android
132
- ```
133
-
134
- ...and so on!
package/SECURITY.md DELETED
@@ -1,41 +0,0 @@
1
- <!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
2
-
3
- ## Security
4
-
5
- Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6
-
7
- If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8
-
9
- ## Reporting Security Issues
10
-
11
- **Please do not report security vulnerabilities through public GitHub issues.**
12
-
13
- Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14
-
15
- If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16
-
17
- You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18
-
19
- Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
-
21
- * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22
- * Full paths of source file(s) related to the manifestation of the issue
23
- * The location of the affected source code (tag/branch/commit or direct URL)
24
- * Any special configuration required to reproduce the issue
25
- * Step-by-step instructions to reproduce the issue
26
- * Proof-of-concept or exploit code (if possible)
27
- * Impact of the issue, including how an attacker might exploit the issue
28
-
29
- This information will help us triage your report more quickly.
30
-
31
- If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32
-
33
- ## Preferred Languages
34
-
35
- We prefer all communications to be in English.
36
-
37
- ## Policy
38
-
39
- Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40
-
41
- <!-- END MICROSOFT SECURITY.MD BLOCK -->
@@ -1,52 +0,0 @@
1
- ### Resource Configuration
2
-
3
- Since `autolinking` uses `react-native.config.js` to link plugins, constructors are specified in that file. But you can override custom variables to manage the CodePush plugin by placing these values in string resources.
4
-
5
- - **Public Key** - used for bundle verification in the Code Signing Feature. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more details about the Code Signing Feature.
6
- To set the public key, you should add the content of the public key to `strings.xml` with name `CodePushPublicKey`. CodePush automatically gets this property and enables the Code Signing feature. For example:
7
-
8
- ```xml
9
- <string moduleConfig="true" name="CodePushPublicKey">your-public-key</string>
10
- ```
11
-
12
- - **Server Url** - used for specifying CodePush Server Url.
13
- The Default value: "https://codepush.appcenter.ms/" is overridden by adding your path to `strings.xml` with name `CodePushServerUrl`. CodePush automatically gets this property and will use this path to send requests. For example:
14
- ```xml
15
- <string moduleConfig="true" name="CodePushServerUrl">https://yourcodepush.server.com</string>
16
- ```
17
-
18
- The Java API is made available by importing the `com.microsoft.codepush.react.CodePush` class into your `MainActivity.java` file, and consists of a single public class named `CodePush`.
19
-
20
- ### Java API Reference (Android)
21
-
22
- #### CodePush
23
-
24
- Constructs the CodePush client runtime and represents the `ReactPackage` instance that you add to you app's list of packages.
25
-
26
- ##### Constructors
27
-
28
- - **CodePush(String deploymentKey, Activity mainActivity)** - Creates a new instance of the CodePush runtime, that will be used to query the service for updates via the provided deployment key. The `mainActivity` parameter should always be set to `this` when configuring your React packages list inside the `MainActivity` class. This constructor puts the CodePush runtime into "release mode", so if you want to enable debugging behavior, use the following constructor instead.
29
-
30
- - **CodePush(String deploymentKey, Activity mainActivity, bool isDebugMode)** - Equivalent to the previous constructor but allows you to specify whether you want the CodePush runtime to be in debug mode or not. When using this constructor, the `isDebugMode` parameter should always be set to `BuildConfig.DEBUG` in order to stay synchronized with your build type. When putting CodePush into debug mode, the following behaviors are enabled:
31
-
32
- 1. Old CodePush updates aren't deleted from storage whenever a new binary is deployed to the emulator/device. This behavior enables you to deploy new binaries, without bumping the version during development, and without continuously getting the same update every time your app calls `sync`.
33
-
34
- 2. The local cache that the React Native runtime maintains in debug mode is deleted whenever a CodePush update is installed. This ensures that when the app is restarted after an update is applied, you will see the expected changes. As soon as [this PR](https://github.com/facebook/react-native/pull/4738) is merged, we won't need to do this anymore.
35
-
36
- - **CodePush(String deploymentKey, Context context, boolean isDebugMode, Integer publicKeyResourceDescriptor)** - Equivalent to the previous constructor, but allows you to specify the public key resource descriptor needed to read public key content. Please refer to [Code Signing](setup-android.md#code-signing-setup) section for more details about the Code Signing Feature.
37
-
38
- - **CodePush(String deploymentKey, Context context, boolean isDebugMode, String serverUrl)** Constructor allows you to specify CodePush Server Url. The Default value: `"https://codepush.appcenter.ms/"` is overridden by value specified in `serverUrl`.
39
-
40
- ##### Public Methods
41
-
42
- - **setDeploymentKey(String deploymentKey)** - Sets the deployment key that the app should use when querying for updates. This is a dynamic alternative to setting the deployment key in Codepush constructor/builder and/or specifying a deployment key in JS when calling `checkForUpdate` or `sync`.
43
-
44
- ##### Static Methods
45
-
46
- - **getBundleUrl()** - Returns the path to the most recent version of your app's JS bundle file, assuming that the resource name is `index.android.bundle`. If your app is using a different bundle name, then use the overloaded version of this method which allows specifying it. This method has the same resolution behavior as the Objective-C equivalent described above.
47
-
48
- - **getBundleUrl(String bundleName)** - Returns the path to the most recent version of your app's JS bundle file, using the specified resource name (like `index.android.bundle`). This method has the same resolution behavior as the Objective-C equivalent described above.
49
-
50
- - **getPackageFolder()** - Returns the path to the current update folder.
51
-
52
- - **overrideAppVersion(String appVersionOverride)** - Sets the version of the application's binary interface, which would otherwise default to the Play Store version specified as the `versionName` in the `build.gradle`. This should be called a single time, before the CodePush instance is constructed.
package/docs/api-ios.md DELETED
@@ -1,31 +0,0 @@
1
- ### Objective-C API Reference (iOS)
2
-
3
- The Objective-C API is made available by importing the `CodePush.h` header into your `AppDelegate.m` file, and consists of a single public class named `CodePush`.
4
-
5
- #### CodePush
6
-
7
- Contains static methods for retreiving the `NSURL` that represents the most recent JavaScript bundle file, and can be passed to the `RCTRootView`'s `initWithBundleURL` method when bootstrapping your app in the `AppDelegate.m` file.
8
-
9
- The `CodePush` class' methods can be thought of as composite resolvers which always load the appropriate bundle, in order to accommodate the following scenarios:
10
-
11
- 1. When an end-user installs your app from the store (like `1.0.0`), they will get the JS bundle that is contained within the binary. This is the behavior you would get without using CodePush, but we make sure it doesn't break :)
12
-
13
- 2. As soon as you begin releasing CodePush updates, your end-users will get the JS bundle that represents the latest release for the configured deployment. This is the behavior that allows you to iterate beyond what you shipped to the store.
14
-
15
- 3. As soon as you release an update to the app store (like `1.1.0`), and your end-users update it, they will once again get the JS bundle that is contained within the binary. This behavior ensures that CodePush updates that targetted a previous binary version aren't used (since we don't know if they would work), and your end-users always have a working version of your app.
16
-
17
- 4. Repeat #2 and #3 as the CodePush releases and app store releases continue on into infinity (and beyond?)
18
-
19
- Because of this behavior, you can safely deploy updates to both the app store(s) and CodePush as necesary, and rest assured that your end-users will always get the most recent version.
20
-
21
- ##### Methods
22
-
23
- - __(NSURL \*)bundleURL__ - Returns the most recent JS bundle `NSURL` as described above. This method assumes that the name of the JS bundle contained within your app binary is `main.jsbundle`.
24
-
25
- - __(NSURL \*)bundleURLForResource:(NSString \*)resourceName__ - Equivalent to the `bundleURL` method, but also allows customizing the name of the JS bundle that is looked for within the app binary. This is useful if you aren't naming this file `main` (which is the default convention). This method assumes that the JS bundle's extension is `*.jsbundle`.
26
-
27
- - __(NSURL \*)bundleURLForResource:(NSString \*)resourceName withExtension:(NSString \*)resourceExtension__: Equivalent to the `bundleURLForResource:` method, but also allows customizing the extension used by the JS bundle that is looked for within the app binary. This is useful if you aren't naming this file `*.jsbundle` (which is the default convention).
28
-
29
- - __(void)overrideAppVersion:(NSString \*)appVersionOverride__ - Sets the version of the application's binary interface, which would otherwise default to the App Store version specified as the `CFBundleShortVersionString` in the `Info.plist`. This should be called a single time, before the bundle URL is loaded.
30
-
31
- - __(void)setDeploymentKey:(NSString \*)deploymentKey__ - Sets the deployment key that the app should use when querying for updates. This is a dynamic alternative to setting the deployment key in your `Info.plist` and/or specifying a deployment key in JS when calling `checkForUpdate` or `sync`.