@turbopush/react-native-code-push 10.2.4 → 10.2.6

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 (85) hide show
  1. package/LICENSE.md +3 -1
  2. package/README.md +118 -38
  3. package/android/app/src/debug/AndroidManifest.xml +9 -0
  4. package/package.json +15 -12
  5. package/.azurepipelines/build-rn-code-push-1es.yml +0 -104
  6. package/.azurepipelines/test-rn-code-push.yml +0 -94
  7. package/.config/CredScanSuppressions.json +0 -14
  8. package/.gitconfig +0 -6
  9. package/CONTRIBUTING.md +0 -134
  10. package/SECURITY.md +0 -41
  11. package/docs/api-android.md +0 -52
  12. package/docs/api-ios.md +0 -31
  13. package/docs/api-js.md +0 -592
  14. package/docs/multi-deployment-testing-android.md +0 -55
  15. package/docs/multi-deployment-testing-ios.md +0 -59
  16. package/docs/setup-android.md +0 -92
  17. package/docs/setup-ios.md +0 -138
  18. package/docs/setup-windows.md +0 -121
  19. package/expo.js +0 -324
  20. package/tsconfig.json +0 -17
  21. package/tslint.json +0 -32
  22. package/windows/CodePush/CodePush.def +0 -3
  23. package/windows/CodePush/CodePush.vcxproj +0 -198
  24. package/windows/CodePush/CodePush.vcxproj.filters +0 -91
  25. package/windows/CodePush/CodePushConfig.cpp +0 -104
  26. package/windows/CodePush/CodePushConfig.h +0 -66
  27. package/windows/CodePush/CodePushConfig.idl +0 -12
  28. package/windows/CodePush/CodePushDownloadHandler.cpp +0 -73
  29. package/windows/CodePush/CodePushDownloadHandler.h +0 -32
  30. package/windows/CodePush/CodePushNativeModule.cpp +0 -934
  31. package/windows/CodePush/CodePushNativeModule.h +0 -247
  32. package/windows/CodePush/CodePushPackage.cpp +0 -456
  33. package/windows/CodePush/CodePushPackage.h +0 -49
  34. package/windows/CodePush/CodePushTelemetryManager.cpp +0 -213
  35. package/windows/CodePush/CodePushTelemetryManager.h +0 -29
  36. package/windows/CodePush/CodePushUpdateUtils.cpp +0 -86
  37. package/windows/CodePush/CodePushUpdateUtils.h +0 -38
  38. package/windows/CodePush/CodePushUtils.cpp +0 -29
  39. package/windows/CodePush/CodePushUtils.h +0 -18
  40. package/windows/CodePush/FileUtils.cpp +0 -131
  41. package/windows/CodePush/FileUtils.h +0 -28
  42. package/windows/CodePush/PropertySheet.props +0 -16
  43. package/windows/CodePush/ReactPackageProvider.cpp +0 -15
  44. package/windows/CodePush/ReactPackageProvider.h +0 -22
  45. package/windows/CodePush/ReactPackageProvider.idl +0 -9
  46. package/windows/CodePush/miniz/LICENSE +0 -22
  47. package/windows/CodePush/miniz/miniz.c +0 -7657
  48. package/windows/CodePush/miniz/miniz.h +0 -1338
  49. package/windows/CodePush/miniz/readme.md +0 -37
  50. package/windows/CodePush/packages.config +0 -4
  51. package/windows/CodePush/pch.cpp +0 -1
  52. package/windows/CodePush/pch.h +0 -4
  53. package/windows-legacy/CodePush/CodePush.csproj +0 -128
  54. package/windows-legacy/CodePush/CodePushUtils.cs +0 -47
  55. package/windows-legacy/CodePush/FileUtils.cs +0 -40
  56. package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +0 -29
  57. package/windows-legacy/CodePush/Properties/CodePush.rd.xml +0 -33
  58. package/windows-legacy/CodePush/UpdateManager.cs +0 -305
  59. package/windows-legacy/CodePush/UpdateUtils.cs +0 -46
  60. package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -28
  61. package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -106
  62. package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +0 -103
  63. package/windows-legacy/CodePush.Net46/CodePushUtils.cs +0 -158
  64. package/windows-legacy/CodePush.Net46/FileUtils.cs +0 -55
  65. package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +0 -36
  66. package/windows-legacy/CodePush.Net46/UpdateManager.cs +0 -330
  67. package/windows-legacy/CodePush.Net46/UpdateUtils.cs +0 -70
  68. package/windows-legacy/CodePush.Net46/packages.config +0 -5
  69. package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +0 -105
  70. package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +0 -137
  71. package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +0 -36
  72. package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +0 -117
  73. package/windows-legacy/CodePush.Net46.Test/app.config +0 -11
  74. package/windows-legacy/CodePush.Net46.Test/packages.config +0 -4
  75. package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +0 -22
  76. package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +0 -13
  77. package/windows-legacy/CodePush.Shared/CodePushConstants.cs +0 -35
  78. package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +0 -329
  79. package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +0 -235
  80. package/windows-legacy/CodePush.Shared/CodePushUtils.cs +0 -70
  81. package/windows-legacy/CodePush.Shared/InstallMode.cs +0 -9
  82. package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +0 -44
  83. package/windows-legacy/CodePush.Shared/SettingsManager.cs +0 -148
  84. package/windows-legacy/CodePush.Shared/TelemetryManager.cs +0 -250
  85. package/windows-legacy/CodePush.Shared/UpdateState.cs +0 -9
package/LICENSE.md CHANGED
@@ -1,5 +1,7 @@
1
- Microsoft CodePush Plugin for React Native
1
+ Turbopush React Native Plugin for CodePush
2
+ Copyright (c) Turbopush
2
3
 
4
+ Based on Microsoft CodePush Plugin for React Native
3
5
  Copyright (c) Microsoft Corporation
4
6
 
5
7
  All rights reserved.
package/README.md CHANGED
@@ -1,43 +1,86 @@
1
- # React Native Module for CodePush
2
- ## 🚀 [Sign up](https://accounts.turbopush.org/sign-up) to use Turbopush
3
- ## 📚 [Documentation](https://docs.turbopush.org) to get started
1
+ # Turbopush — React Native Plugin for CodePush
4
2
 
5
- This plugin provides client-side integration for the [Turbopush service](https://turbopush.org/), allowing you to easily add a dynamic update experience to your React Native or Expo app(s).
3
+ [![npm version](https://img.shields.io/npm/v/@turbopush/react-native-code-push.svg)](https://www.npmjs.com/package/@turbopush/react-native-code-push)
4
+ [![license](https://img.shields.io/npm/l/@turbopush/react-native-code-push.svg)](LICENSE.md)
5
+
6
+ ## [Sign up](https://accounts.turbopush.org/sign-up?utm_source=readme) to use Turbopush | [Documentation](https://turbopush.org/docs?utm_source=readme) to get started
7
+
8
+ This plugin provides client-side integration for the [Turbopush service](https://turbopush.org/?utm_source=readme), allowing you to easily add a dynamic update experience to your React Native or Expo app(s).
9
+
10
+ ---
11
+
12
+ ## Table of Contents
13
+
14
+ - [How does it work?](#how-does-it-work)
15
+ - [Key Features](#key-features)
16
+ - [Requirements](#requirements)
17
+ - [React Native Setup](#react-native-setup)
18
+ - [Expo Setup](#expo-setup)
19
+ - [Basic Usage](#basic-usage)
20
+ - [Store Guideline Compliance](#store-guideline-compliance)
21
+ - [Contributing](#contributing)
22
+ - [License](#license)
23
+
24
+ ---
6
25
 
7
26
  ## How does it work?
8
27
 
9
28
  A React Native app is composed of JavaScript files and any accompanying [images](https://reactnative.dev/docs/image), which are bundled together by the [metro bundler](https://github.com/facebook/metro) and distributed as part of a platform-specific binary (i.e. an `.ipa` or `.apk` file). Once the app is released, updating either the JavaScript code (e.g. making bug fixes, adding new features) or image assets, requires you to recompile and redistribute the entire binary, which of course, includes any review time associated with the store(s) you are publishing to.
10
29
 
11
- The Turbopush plugin helps get product improvements in front of your end users instantly, by keeping your JavaScript and images synchronized with updates you release to the Turbopush server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available. It's a win-win!
30
+ The Turbopush plugin helps get product improvements in front of your end users instantly, by keeping your JavaScript and images synchronized with updates you release to the Turbopush server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available.
31
+
32
+ In order to ensure that your end users always have a functioning version of your app, the Turbopush plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to roll back on the server.
33
+
34
+ > **Note:** Any product changes which touch native code (e.g. modifying your `AppDelegate.mm`/`MainActivity.java`/`MainActivity.kt`/`AppDelegate.swift` file, adding a new plugin) cannot be distributed via Turbopush, and therefore, must be updated via the appropriate store(s).
35
+
36
+ ---
37
+
38
+ ## Key Features
39
+
40
+ - **Automatic Rollback**: If an update causes a crash, the plugin automatically rolls back to the previous working version.
41
+ - **Multiple Platforms**: Supports Android and iOS.
42
+ - **Multiple Channels**: Release updates to different groups of users via separate channels.
43
+ - **Multiple Environments**: Test updates in staging before releasing to all users.
44
+ - **Expo Support**: First-class support via our [Expo plugin](https://turbopush.org/docs/setup/expo-setup?utm_source=readme).
45
+ - **New Architecture**: Supports both React Native old and new architecture (Fabric/TurboModules).
46
+
47
+ ---
12
48
 
13
- In order to ensure that your end users always have a functioning version of your app, the Turbopush plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to roll back on the server. It's a win-win-win!
49
+ ## Requirements
14
50
 
15
- *Note: Any product changes which touch native code (e.g. modifying your `AppDelegate.mm`/`MainActivity.java`/`MainActivity.kt`/`AppDelegate.swift` file, adding a new plugin) cannot be distributed via Turbopush, and therefore, must be updated via the appropriate store(s).*
51
+ - **React Native**: 0.70 or higher
52
+ - **iOS**: 15.5 or higher
53
+ - **Android**: API level 21 (Android 5.0) or higher
54
+ - **Node**: 16 or higher
55
+
56
+ ---
16
57
 
17
58
  ## React Native Setup
18
59
 
19
- Yarn:
60
+ NPM:
20
61
  ```bash
21
- yarn add @turbopush/react-native-code-push
62
+ npm install --save @turbopush/react-native-code-push
22
63
  ```
23
64
 
24
- NPM:
65
+ Yarn:
25
66
  ```bash
26
- npm install --save @turbopush/react-native-code-push
67
+ yarn add @turbopush/react-native-code-push
27
68
  ```
28
69
 
29
- Follow the [Getting Started](https://docs.turbopush.org/?platform=react-native) guide to configure your app.
70
+ Follow the [Getting Started](https://turbopush.org/docs/?platform=react-native&utm_source=readme) guide to configure your app.
71
+
72
+ ---
30
73
 
31
74
  ## Expo Setup
32
75
 
33
- Yarn:
76
+ NPM:
34
77
  ```bash
35
- yarn add @turbopush/react-native-code-push @turbopush/turbopush-expo-plugin expo-build-properties
78
+ npm install --save @turbopush/react-native-code-push @turbopush/turbopush-expo-plugin expo-build-properties
36
79
  ```
37
80
 
38
- NPM:
81
+ Yarn:
39
82
  ```bash
40
- npm install --save @turbopush/react-native-code-push @turbopush/turbopush-expo-plugin expo-build-properties
83
+ yarn add @turbopush/react-native-code-push @turbopush/turbopush-expo-plugin expo-build-properties
41
84
  ```
42
85
 
43
86
  Add the following to your `app.json` or `app.config.ts` file:
@@ -49,57 +92,94 @@ Add the following to your `app.json` or `app.config.ts` file:
49
92
  "expo-build-properties",
50
93
  {
51
94
  "ios": {
52
- "deploymentTarget": "15.5",
53
- },
54
- },
95
+ "deploymentTarget": "15.5"
96
+ }
97
+ }
55
98
  ],
56
99
  [
57
100
  "@turbopush/turbopush-expo-plugin",
58
101
  {
59
102
  "android": {
60
- "CodePushDeploymentKey": "YOUR_ANDROID_CODE_PUSH_KEY",
103
+ "CodePushDeploymentKey": "YOUR_ANDROID_CODE_PUSH_KEY"
61
104
  },
62
105
  "ios": {
63
- "CodePushDeploymentKey": "YOUR_IOS_CODE_PUSH_KEY",
64
- },
106
+ "CodePushDeploymentKey": "YOUR_IOS_CODE_PUSH_KEY"
107
+ }
65
108
  }
66
109
  ]
67
110
  ]
68
111
  }
69
112
  ```
70
113
 
71
- For more information, see the [Getting Started](https://docs.turbopush.org/?platform=expo) guide.
114
+ For more information, see the [Getting Started](https://turbopush.org/docs/?platform=expo&utm_source=readme) guide.
72
115
 
73
- ## Key Features
116
+ ---
74
117
 
75
- - **Rollback**: If an update causes a crash, the plugin can automatically roll back to the previous version.
76
- - **Multiple Platforms**: Supports Android and iOS.
77
- - **Multiple Channels**: You can create multiple channels to release updates to different groups of users.
78
- - **Multiple Environments**: You can create multiple environments to test your updates before releasing them to all users.
79
- - **Expo Support**: You can use our [Expo plugin](https://docs.turbopush.org/setup/expo-setup) for Expo apps.
118
+ ## Basic Usage
119
+
120
+ The simplest way to integrate Turbopush is to wrap your root component with the `codePush` HOC. This will automatically check for and apply updates on each app launch.
121
+
122
+ ```tsx
123
+ import React from 'react';
124
+ import { View, Text } from 'react-native';
125
+ import codePush from '@turbopush/react-native-code-push';
126
+
127
+ function App() {
128
+ return (
129
+ <View>
130
+ <Text>My App</Text>
131
+ </View>
132
+ );
133
+ }
134
+
135
+ export default codePush(App);
136
+ ```
137
+
138
+ You can also trigger a manual update check at any point:
139
+
140
+ ```tsx
141
+ import codePush from '@turbopush/react-native-code-push';
142
+
143
+ async function checkForUpdate() {
144
+ const update = await codePush.checkForUpdate();
145
+ if (update) {
146
+ await codePush.sync();
147
+ }
148
+ }
149
+ ```
150
+
151
+ For advanced configuration options (update dialogs, install modes, rollback handling), see the [full documentation](https://turbopush.org/docs?utm_source=readme).
152
+
153
+ ---
80
154
 
81
155
  ## Store Guideline Compliance
82
156
 
83
- Android Google Play and iOS App Store have corresponding guidelines that have rules you should be aware of before integrating the CodePush solution within your application.
157
+ ### Google Play
84
158
 
85
- ### Google play
159
+ The third paragraph of [Device and Network Abuse](https://support.google.com/googleplay/android-developer/answer/9888379?hl=en) states that updating source code by any method other than Google Play's update mechanism is restricted. However, this restriction does not apply to updating JavaScript bundles:
86
160
 
87
- Third paragraph of [Device and Network Abuse](https://support.google.com/googleplay/android-developer/answer/9888379?hl=en) topic describe that updating source code by any method other than Google Play's update mechanism is restricted. But this restriction does not apply to updating javascript bundles.
88
161
  > This restriction does not apply to code that runs in a virtual machine and has limited access to Android APIs (such as JavaScript in a webview or browser).
89
162
 
90
- That fully allow CodePush as it updates just JS bundles and can't update native code part.
163
+ Turbopush only updates JS bundles and cannot update native code, so it is fully compliant.
91
164
 
92
165
  ### App Store
93
166
 
94
- Paragraph **3.3.2**, since back in 2015's [Apple Developer Program License Agreement](https://developer.apple.com/programs/ios/information/) fully allowed performing over-the-air updates of JavaScript and assets - and in its latest version (20170605) [downloadable here](https://developer.apple.com/terms/) this ruling is even broader:
167
+ Paragraph **3.3.2** of the [Apple Developer Program License Agreement](https://developer.apple.com/terms/) allows over-the-air updates of JavaScript and assets:
95
168
 
96
169
  > Interpreted code may be downloaded to an Application but only so long as such code: (a) does not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store, (b) does not create a store or storefront for other code or applications, and (c) does not bypass signing, sandbox, or other security features of the OS.
97
170
 
98
- CodePush allows you to follow these rules in full compliance so long as the update you push does not significantly deviate your product from its original App Store approved intent.
171
+ Turbopush allows you to follow these rules in full compliance as long as the update you push does not significantly deviate your product from its original App Store approved intent.
172
+
173
+ > **Tip:** For App Store-distributed apps, we suggest not enabling the `updateDialog` option when calling `sync`, as Apple's [App Store Review Guidelines](https://developer.apple.com/app-store/review/guidelines/) discourage prompts that require user action to access app functionality.
174
+
175
+ ---
176
+
177
+ ## Contributing
99
178
 
100
- To further remain in compliance with Apple's guidelines we suggest that App Store-distributed apps don't enable the `updateDialog` option when calling `sync`, since in the [App Store Review Guidelines](https://developer.apple.com/app-store/review/guidelines/) it is written that:
179
+ Bug reports and feature requests are welcome via [GitHub Issues](https://github.com/turbopushdev/react-native-code-push/issues).
101
180
 
102
- > Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.
181
+ ---
103
182
 
104
- This is not necessarily the case for `updateDialog`, since it won't force the user to download the new version, but at least you should be aware of that ruling if you decide to show it.
183
+ ## License
105
184
 
185
+ MIT — see [LICENSE.md](LICENSE.md) for details.
@@ -0,0 +1,9 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <uses-permission android:name="android.permission.INTERNET" />
4
+
5
+ <application>
6
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
7
+ </application>
8
+
9
+ </manifest>
package/package.json CHANGED
@@ -1,9 +1,22 @@
1
1
  {
2
2
  "name": "@turbopush/react-native-code-push",
3
- "version": "10.2.4",
3
+ "version": "10.2.6",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "main": "CodePush.js",
6
6
  "typings": "typings/react-native-code-push.d.ts",
7
+ "files": [
8
+ "android/",
9
+ "ios/",
10
+ "scripts/",
11
+ "typings/",
12
+ "AlertAdapter.js",
13
+ "CodePush.js",
14
+ "CodePush.podspec",
15
+ "logging.js",
16
+ "package-mixins.js",
17
+ "react-native.config.js",
18
+ "request-fetch-adapter.js"
19
+ ],
7
20
  "homepage": "https://turbopush.org",
8
21
  "keywords": [
9
22
  "react-native",
@@ -72,17 +85,7 @@
72
85
  "tslint": "^6.1.3",
73
86
  "typescript": "^4.4.3"
74
87
  },
75
- "rnpm": {
76
- "android": {
77
- "packageInstance": "new CodePush(getResources().getString(R.string.CodePushDeploymentKey), getApplicationContext(), BuildConfig.DEBUG)"
78
- },
79
- "ios": {
80
- "sharedLibraries": [
81
- "libz"
82
- ]
83
- }
84
- },
85
88
  "bugs": {
86
89
  "url": "https://github.com/turbopushdev/react-native-code-push/issues"
87
90
  }
88
- }
91
+ }
@@ -1,104 +0,0 @@
1
- trigger:
2
- - master
3
-
4
- pr:
5
- - master
6
-
7
- resources:
8
- repositories:
9
- - repository: 1ESPipelineTemplates
10
- type: git
11
- name: 1ESPipelineTemplates/1ESPipelineTemplates
12
- ref: refs/tags/release
13
- name: $(Build.SourceBranchName)_$(date:yyyyMMdd)$(rev:.r)
14
-
15
- extends:
16
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}:
17
- template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
18
- ${{ else }}:
19
- template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
20
- parameters:
21
- pool:
22
- name: 1ES-PT-CBL-Mariner-2.0-Gen2
23
- os: linux
24
- customBuildTags:
25
- - ES365AIMigrationTooling-BulkMigrated
26
- sdl:
27
- sourceAnalysisPool: 1ES-PT-Windows-2022
28
- credscan:
29
- suppressionsFile: $(Build.SourcesDirectory)/.config/CredScanSuppressions.json
30
- stages:
31
- - stage: Stage
32
- jobs:
33
- - job: HostJob
34
- templateContext:
35
- outputs:
36
- - output: pipelineArtifact
37
- displayName: "Publish Artifact: artifacts"
38
- path: '$(Build.ArtifactStagingDirectory)/npm'
39
- artifactName: npm
40
-
41
- steps:
42
- - task: NodeTool@0
43
- inputs:
44
- versionSpec: '14.x'
45
- displayName: 'Install Node.js'
46
-
47
- - script: |
48
- npm pack
49
- npm install -g react-native-code-push*.tgz
50
- displayName: 'Package react-native-code-push'
51
- workingDirectory: $(Build.SourcesDirectory)
52
-
53
- - task: DeleteFiles@1
54
- inputs:
55
- contents: node_modules
56
- displayName: 'Delete node_modules'
57
-
58
- - task: ArchiveFiles@2
59
- inputs:
60
- rootFolderOrFile: '$(Build.SourcesDirectory)'
61
- includeRootFolder: false
62
- archiveType: 'tar'
63
- archiveFile: '$(Build.ArtifactStagingDirectory)/npm/$(Build.BuildId).tgz'
64
- replaceExistingArchive: true
65
- verbose: true
66
- displayName: 'Prepare npm artifact'
67
-
68
- - stage: APIScan
69
- dependsOn: Stage
70
- pool:
71
- name: 1ES-PT-Windows-2022
72
- os: windows
73
- variables:
74
- "agent.source.skip": true
75
- jobs:
76
- - job: APIScan
77
- steps:
78
- - task: DownloadPipelineArtifact@2
79
- displayName: Download Build Artifacts for APIScan
80
- inputs:
81
- artifactName: npm
82
- targetPath: '$(Agent.BuildDirectory)/npm'
83
- - task: ExtractFiles@1
84
- inputs:
85
- archiveFilePatterns: '$(Agent.BuildDirectory)/npm/*.tgz'
86
- destinationFolder: '$(Agent.BuildDirectory)/npm_extracted'
87
- - task: AzureKeyVault@2
88
- inputs:
89
- azureSubscription: 'AC - Dev Infra & Build Pool'
90
- KeyVaultName: 'mobile-center-sdk'
91
- SecretsFilter: 'appcenter-sdk-managed-identity-clientid'
92
- RunAsPreJob: false
93
- - task: APIScan@2
94
- displayName: 'Run APIScan'
95
- inputs:
96
- softwareFolder: '$(Agent.BuildDirectory)\npm_extracted'
97
- softwareName: 'react-native-code-push'
98
- softwareVersionNum: '$(Build.BuildId)'
99
- isLargeApp: false
100
- toolVersion: 'Latest'
101
- verbosityLevel: verbose
102
- condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
103
- env:
104
- AzureServicesAuthConnectionString: 'runAs=App;AppId=$(appcenter-sdk-managed-identity-clientid)'
@@ -1,94 +0,0 @@
1
- trigger:
2
- - master
3
-
4
- pr:
5
- - master
6
-
7
- variables:
8
- - name: api-level
9
- value: '27'
10
-
11
- pool:
12
- vmImage: 'macOS-12'
13
-
14
- stages:
15
- - stage: RunTests
16
- displayName: 'Run Android & IOS tests'
17
- jobs:
18
- - job: TestAndroid
19
- timeoutInMinutes: 120
20
- displayName: 'Test android'
21
- steps:
22
-
23
- - script: |
24
- adb devices
25
- displayName: 'Start adb server'
26
-
27
- - script: |
28
- $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-$(api-level);google_apis;x86"
29
- displayName: 'Download system image'
30
-
31
- - script: |
32
- $ANDROID_HOME/tools/bin/avdmanager create avd --force --name TestEmulator --abi google_apis/x86 --package 'system-images;android-$(api-level);google_apis;x86' --device "Nexus 6P"
33
- displayName: 'Creating Android emulator'
34
-
35
- - script: |
36
- $ANDROID_HOME/emulator/emulator -avd TestEmulator -noaudio -no-window -no-snapshot-save -no-boot-anim -memory 6144 &
37
- displayName: 'Start Android emulator'
38
-
39
- - script: |
40
- $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done'
41
- displayName: 'Wait for emulator to boot'
42
-
43
- - script: |
44
- adb shell settings put global window_animation_scale 0.0
45
- displayName: 'Disable animations and transitions'
46
-
47
- - script: |
48
- adb shell settings put global transition_animation_scale 0.0
49
- displayName: 'Disable animations and transitions'
50
-
51
- - script: |
52
- adb shell settings put global animator_duration_scale 0.0
53
- displayName: 'Disable animations and transitions'
54
-
55
-
56
- - task: JavaToolInstaller@0
57
- inputs:
58
- versionSpec: '11'
59
- jdkArchitectureOption: 'x64'
60
- jdkSourceOption: 'PreInstalled'
61
- displayName: 'Change Java version'
62
-
63
- - script: |
64
- npm install
65
- displayName: 'Package Installation'
66
-
67
- - script: |
68
- npm run build:tests && npm run test:setup:android
69
- displayName: 'Setup Android tests'
70
-
71
- - script: |
72
- npm run test:fast:android
73
- displayName: 'Run Android test'
74
-
75
- - job: TestIOS
76
- timeoutInMinutes: 120
77
- displayName: 'Test IOS'
78
- steps:
79
-
80
- - script: |
81
- npm install
82
- displayName: 'Install dependencies'
83
-
84
- - script: |
85
- npm run build:tests && npm run test:setup:ios
86
- displayName: 'Setup iOS tests'
87
-
88
- - script: |
89
- npm run test:fast:ios
90
- displayName: 'Run tests'
91
-
92
-
93
-
94
-
@@ -1,14 +0,0 @@
1
- {
2
- "tool": "Credential Scanner",
3
- "suppressions": [
4
- {
5
- "file": "/Examples/CodePushDemoApp/android/app/debug.keystore",
6
- "_justification": "Used only in DemoApp"
7
- },
8
- {
9
- "file": "/Examples/CodePushDemoAppCpp/windows/CodePushDemoAppCpp/CodePushDemoAppCpp_TemporaryKey.pfx",
10
- "_justification": "Used only in DemoApp"
11
- }
12
- ]
13
- }
14
-
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!