@turbopush/react-native-code-push 10.2.5 → 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.
- package/LICENSE.md +3 -1
- package/README.md +118 -39
- package/android/app/src/debug/AndroidManifest.xml +9 -0
- package/package.json +15 -12
- package/.azurepipelines/build-rn-code-push-1es.yml +0 -104
- package/.azurepipelines/test-rn-code-push.yml +0 -94
- package/.config/CredScanSuppressions.json +0 -14
- package/.gitconfig +0 -6
- package/CONTRIBUTING.md +0 -134
- package/SECURITY.md +0 -41
- package/docs/api-android.md +0 -52
- package/docs/api-ios.md +0 -31
- package/docs/api-js.md +0 -592
- package/docs/multi-deployment-testing-android.md +0 -55
- package/docs/multi-deployment-testing-ios.md +0 -59
- package/docs/setup-android.md +0 -92
- package/docs/setup-ios.md +0 -138
- package/docs/setup-windows.md +0 -121
- package/expo.js +0 -324
- package/tsconfig.json +0 -17
- package/tslint.json +0 -32
- package/windows/CodePush/CodePush.def +0 -3
- package/windows/CodePush/CodePush.vcxproj +0 -198
- package/windows/CodePush/CodePush.vcxproj.filters +0 -91
- package/windows/CodePush/CodePushConfig.cpp +0 -104
- package/windows/CodePush/CodePushConfig.h +0 -66
- package/windows/CodePush/CodePushConfig.idl +0 -12
- package/windows/CodePush/CodePushDownloadHandler.cpp +0 -73
- package/windows/CodePush/CodePushDownloadHandler.h +0 -32
- package/windows/CodePush/CodePushNativeModule.cpp +0 -934
- package/windows/CodePush/CodePushNativeModule.h +0 -247
- package/windows/CodePush/CodePushPackage.cpp +0 -456
- package/windows/CodePush/CodePushPackage.h +0 -49
- package/windows/CodePush/CodePushTelemetryManager.cpp +0 -213
- package/windows/CodePush/CodePushTelemetryManager.h +0 -29
- package/windows/CodePush/CodePushUpdateUtils.cpp +0 -86
- package/windows/CodePush/CodePushUpdateUtils.h +0 -38
- package/windows/CodePush/CodePushUtils.cpp +0 -29
- package/windows/CodePush/CodePushUtils.h +0 -18
- package/windows/CodePush/FileUtils.cpp +0 -131
- package/windows/CodePush/FileUtils.h +0 -28
- package/windows/CodePush/PropertySheet.props +0 -16
- package/windows/CodePush/ReactPackageProvider.cpp +0 -15
- package/windows/CodePush/ReactPackageProvider.h +0 -22
- package/windows/CodePush/ReactPackageProvider.idl +0 -9
- package/windows/CodePush/miniz/LICENSE +0 -22
- package/windows/CodePush/miniz/miniz.c +0 -7657
- package/windows/CodePush/miniz/miniz.h +0 -1338
- package/windows/CodePush/miniz/readme.md +0 -37
- package/windows/CodePush/packages.config +0 -4
- package/windows/CodePush/pch.cpp +0 -1
- package/windows/CodePush/pch.h +0 -4
- package/windows-legacy/CodePush/CodePush.csproj +0 -128
- package/windows-legacy/CodePush/CodePushUtils.cs +0 -47
- package/windows-legacy/CodePush/FileUtils.cs +0 -40
- package/windows-legacy/CodePush/Properties/AssemblyInfo.cs +0 -29
- package/windows-legacy/CodePush/Properties/CodePush.rd.xml +0 -33
- package/windows-legacy/CodePush/UpdateManager.cs +0 -305
- package/windows-legacy/CodePush/UpdateUtils.cs +0 -46
- package/windows-legacy/CodePush.Net46/Adapters/Http/HttpProgress.cs +0 -28
- package/windows-legacy/CodePush.Net46/Adapters/Storage/ApplicationDataContainer.cs +0 -106
- package/windows-legacy/CodePush.Net46/CodePush.Net46.csproj +0 -103
- package/windows-legacy/CodePush.Net46/CodePushUtils.cs +0 -158
- package/windows-legacy/CodePush.Net46/FileUtils.cs +0 -55
- package/windows-legacy/CodePush.Net46/Properties/AssemblyInfo.cs +0 -36
- package/windows-legacy/CodePush.Net46/UpdateManager.cs +0 -330
- package/windows-legacy/CodePush.Net46/UpdateUtils.cs +0 -70
- package/windows-legacy/CodePush.Net46/packages.config +0 -5
- package/windows-legacy/CodePush.Net46.Test/ApplicationDataContainerTest.cs +0 -105
- package/windows-legacy/CodePush.Net46.Test/CodePush.Net46.Test.csproj +0 -137
- package/windows-legacy/CodePush.Net46.Test/Properties/AssemblyInfo.cs +0 -36
- package/windows-legacy/CodePush.Net46.Test/TelemetryManagerTest.cs +0 -117
- package/windows-legacy/CodePush.Net46.Test/app.config +0 -11
- package/windows-legacy/CodePush.Net46.Test/packages.config +0 -4
- package/windows-legacy/CodePush.Shared/CodePush.Shared.projitems +0 -22
- package/windows-legacy/CodePush.Shared/CodePush.Shared.shproj +0 -13
- package/windows-legacy/CodePush.Shared/CodePushConstants.cs +0 -35
- package/windows-legacy/CodePush.Shared/CodePushNativeModule.cs +0 -329
- package/windows-legacy/CodePush.Shared/CodePushReactPackage.cs +0 -235
- package/windows-legacy/CodePush.Shared/CodePushUtils.cs +0 -70
- package/windows-legacy/CodePush.Shared/InstallMode.cs +0 -9
- package/windows-legacy/CodePush.Shared/MinimumBackgroundListener.cs +0 -44
- package/windows-legacy/CodePush.Shared/SettingsManager.cs +0 -148
- package/windows-legacy/CodePush.Shared/TelemetryManager.cs +0 -250
- package/windows-legacy/CodePush.Shared/UpdateState.cs +0 -9
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,44 +1,86 @@
|
|
|
1
|
-
# React Native
|
|
2
|
-
## 🌐 [Turbopush](https://turbopush.org)
|
|
3
|
-
## 🚀 [Sign up](https://accounts.turbopush.org/sign-up) to use Turbopush
|
|
4
|
-
## 📚 [Documentation](https://docs.turbopush.org) to get started
|
|
1
|
+
# Turbopush — React Native Plugin for CodePush
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@turbopush/react-native-code-push)
|
|
4
|
+
[](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
|
+
---
|
|
7
25
|
|
|
8
26
|
## How does it work?
|
|
9
27
|
|
|
10
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.
|
|
11
29
|
|
|
12
|
-
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.
|
|
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
|
+
---
|
|
13
48
|
|
|
14
|
-
|
|
49
|
+
## Requirements
|
|
15
50
|
|
|
16
|
-
|
|
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
|
+
---
|
|
17
57
|
|
|
18
58
|
## React Native Setup
|
|
19
59
|
|
|
20
|
-
|
|
60
|
+
NPM:
|
|
21
61
|
```bash
|
|
22
|
-
|
|
62
|
+
npm install --save @turbopush/react-native-code-push
|
|
23
63
|
```
|
|
24
64
|
|
|
25
|
-
|
|
65
|
+
Yarn:
|
|
26
66
|
```bash
|
|
27
|
-
|
|
67
|
+
yarn add @turbopush/react-native-code-push
|
|
28
68
|
```
|
|
29
69
|
|
|
30
|
-
Follow the [Getting Started](https://
|
|
70
|
+
Follow the [Getting Started](https://turbopush.org/docs/?platform=react-native&utm_source=readme) guide to configure your app.
|
|
71
|
+
|
|
72
|
+
---
|
|
31
73
|
|
|
32
74
|
## Expo Setup
|
|
33
75
|
|
|
34
|
-
|
|
76
|
+
NPM:
|
|
35
77
|
```bash
|
|
36
|
-
|
|
78
|
+
npm install --save @turbopush/react-native-code-push @turbopush/turbopush-expo-plugin expo-build-properties
|
|
37
79
|
```
|
|
38
80
|
|
|
39
|
-
|
|
81
|
+
Yarn:
|
|
40
82
|
```bash
|
|
41
|
-
|
|
83
|
+
yarn add @turbopush/react-native-code-push @turbopush/turbopush-expo-plugin expo-build-properties
|
|
42
84
|
```
|
|
43
85
|
|
|
44
86
|
Add the following to your `app.json` or `app.config.ts` file:
|
|
@@ -50,57 +92,94 @@ Add the following to your `app.json` or `app.config.ts` file:
|
|
|
50
92
|
"expo-build-properties",
|
|
51
93
|
{
|
|
52
94
|
"ios": {
|
|
53
|
-
"deploymentTarget": "15.5"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
95
|
+
"deploymentTarget": "15.5"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
56
98
|
],
|
|
57
99
|
[
|
|
58
100
|
"@turbopush/turbopush-expo-plugin",
|
|
59
101
|
{
|
|
60
102
|
"android": {
|
|
61
|
-
"CodePushDeploymentKey": "YOUR_ANDROID_CODE_PUSH_KEY"
|
|
103
|
+
"CodePushDeploymentKey": "YOUR_ANDROID_CODE_PUSH_KEY"
|
|
62
104
|
},
|
|
63
105
|
"ios": {
|
|
64
|
-
"CodePushDeploymentKey": "YOUR_IOS_CODE_PUSH_KEY"
|
|
65
|
-
}
|
|
106
|
+
"CodePushDeploymentKey": "YOUR_IOS_CODE_PUSH_KEY"
|
|
107
|
+
}
|
|
66
108
|
}
|
|
67
109
|
]
|
|
68
110
|
]
|
|
69
111
|
}
|
|
70
112
|
```
|
|
71
113
|
|
|
72
|
-
For more information, see the [Getting Started](https://
|
|
114
|
+
For more information, see the [Getting Started](https://turbopush.org/docs/?platform=expo&utm_source=readme) guide.
|
|
73
115
|
|
|
74
|
-
|
|
116
|
+
---
|
|
75
117
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
+
---
|
|
81
154
|
|
|
82
155
|
## Store Guideline Compliance
|
|
83
156
|
|
|
84
|
-
|
|
157
|
+
### Google Play
|
|
85
158
|
|
|
86
|
-
|
|
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:
|
|
87
160
|
|
|
88
|
-
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.
|
|
89
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).
|
|
90
162
|
|
|
91
|
-
|
|
163
|
+
Turbopush only updates JS bundles and cannot update native code, so it is fully compliant.
|
|
92
164
|
|
|
93
165
|
### App Store
|
|
94
166
|
|
|
95
|
-
Paragraph **3.3.2
|
|
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:
|
|
96
168
|
|
|
97
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.
|
|
98
170
|
|
|
99
|
-
|
|
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
|
|
100
178
|
|
|
101
|
-
|
|
179
|
+
Bug reports and feature requests are welcome via [GitHub Issues](https://github.com/turbopushdev/react-native-code-push/issues).
|
|
102
180
|
|
|
103
|
-
|
|
181
|
+
---
|
|
104
182
|
|
|
105
|
-
|
|
183
|
+
## License
|
|
106
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.
|
|
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
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!
|