@bravemobile/react-native-code-push 12.0.2 → 12.1.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 (99) hide show
  1. package/README.md +1 -1
  2. package/android/app/src/debug/AndroidManifest.xml +9 -0
  3. package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +1 -52
  4. package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +4 -43
  5. package/bin/code-push.js +6 -0
  6. package/cli/commands/bundleCommand/{bundleCodePush.js → bundleCodePush.ts} +16 -24
  7. package/cli/commands/bundleCommand/{index.js → index.ts} +13 -14
  8. package/cli/commands/createHistoryCommand/{createReleaseHistory.js → createReleaseHistory.ts} +11 -28
  9. package/cli/commands/createHistoryCommand/{index.js → index.ts} +12 -13
  10. package/cli/commands/initCommand/{index.js → index.ts} +3 -3
  11. package/cli/commands/initCommand/{initAndroid.js → initAndroid.ts} +6 -11
  12. package/cli/commands/initCommand/initIos.ts +123 -0
  13. package/cli/commands/initCommand/test/initAndroid.test.ts +86 -0
  14. package/cli/commands/initCommand/test/initIos.test.ts +99 -0
  15. package/cli/commands/releaseCommand/{addToReleaseHistory.js → addToReleaseHistory.ts} +17 -45
  16. package/cli/commands/releaseCommand/{index.js → index.ts} +24 -25
  17. package/cli/commands/releaseCommand/release.ts +72 -0
  18. package/cli/commands/showHistoryCommand/{index.js → index.ts} +11 -12
  19. package/cli/commands/updateHistoryCommand/{index.js → index.ts} +17 -18
  20. package/cli/commands/updateHistoryCommand/{updateReleaseHistory.js → updateReleaseHistory.ts} +15 -41
  21. package/cli/constant.ts +4 -0
  22. package/cli/dist/commands/bundleCommand/bundleCodePush.js +34 -0
  23. package/cli/dist/commands/bundleCommand/index.js +14 -0
  24. package/cli/dist/commands/createHistoryCommand/createReleaseHistory.js +25 -0
  25. package/cli/dist/commands/createHistoryCommand/index.js +14 -0
  26. package/cli/dist/commands/initCommand/index.js +12 -0
  27. package/cli/dist/commands/initCommand/initAndroid.js +37 -0
  28. package/cli/{commands → dist/commands}/initCommand/initIos.js +13 -33
  29. package/cli/dist/commands/initCommand/test/initAndroid.test.js +75 -0
  30. package/cli/dist/commands/initCommand/test/initIos.test.js +95 -0
  31. package/cli/dist/commands/releaseCommand/addToReleaseHistory.js +32 -0
  32. package/cli/dist/commands/releaseCommand/index.js +38 -0
  33. package/cli/dist/commands/releaseCommand/release.js +36 -0
  34. package/cli/dist/commands/showHistoryCommand/index.js +14 -0
  35. package/cli/dist/commands/updateHistoryCommand/index.js +30 -0
  36. package/cli/dist/commands/updateHistoryCommand/updateReleaseHistory.js +26 -0
  37. package/cli/dist/constant.js +4 -0
  38. package/cli/dist/functions/getReactTempDir.js +10 -0
  39. package/cli/{functions → dist/functions}/makeCodePushBundle.js +5 -11
  40. package/cli/{functions → dist/functions}/prepareToBundleJS.js +2 -5
  41. package/cli/{functions → dist/functions}/runExpoBundleCommand.js +3 -21
  42. package/cli/{functions → dist/functions}/runHermesEmitBinaryCommand.js +12 -68
  43. package/cli/{functions → dist/functions}/runReactNativeBundleCommand.js +3 -23
  44. package/cli/dist/index.js +38 -0
  45. package/cli/dist/utils/file-utils.js +19 -0
  46. package/cli/dist/utils/fsUtils.js +37 -0
  47. package/cli/{utils → dist/utils}/hash-utils.js +19 -127
  48. package/cli/{utils → dist/utils}/promisfied-fs.js +5 -16
  49. package/cli/dist/utils/showLogo.js +21 -0
  50. package/cli/{utils → dist/utils}/zip.js +15 -51
  51. package/cli/functions/{getReactTempDir.js → getReactTempDir.ts} +2 -6
  52. package/cli/functions/makeCodePushBundle.ts +26 -0
  53. package/cli/functions/prepareToBundleJS.ts +10 -0
  54. package/cli/functions/runExpoBundleCommand.ts +45 -0
  55. package/cli/functions/runHermesEmitBinaryCommand.ts +186 -0
  56. package/cli/functions/runReactNativeBundleCommand.ts +51 -0
  57. package/cli/index.ts +48 -0
  58. package/cli/package.json +33 -0
  59. package/cli/utils/{file-utils.js → file-utils.ts} +4 -21
  60. package/cli/utils/{fsUtils.js → fsUtils.ts} +12 -19
  61. package/cli/utils/hash-utils.ts +146 -0
  62. package/cli/utils/promisfied-fs.ts +19 -0
  63. package/cli/utils/{showLogo.js → showLogo.ts} +1 -3
  64. package/cli/utils/zip.ts +65 -0
  65. package/package.json +42 -12
  66. package/{AlertAdapter.js → src/AlertAdapter.js} +5 -5
  67. package/AGENTS.md +0 -32
  68. package/CONTRIBUTING.md +0 -134
  69. package/SECURITY.md +0 -41
  70. package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +0 -17
  71. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  72. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  73. package/android/gradlew +0 -164
  74. package/android/gradlew.bat +0 -90
  75. package/babel.config.js +0 -3
  76. package/cli/commands/releaseCommand/release.js +0 -114
  77. package/cli/constant.js +0 -6
  78. package/cli/index.js +0 -49
  79. package/docs/api-android.md +0 -83
  80. package/docs/api-ios.md +0 -31
  81. package/docs/api-js.md +0 -592
  82. package/docs/multi-deployment-testing-android.md +0 -148
  83. package/docs/multi-deployment-testing-ios.md +0 -59
  84. package/eslint.config.mjs +0 -32
  85. package/scripts/generateBundledResourcesHash.js +0 -125
  86. package/scripts/getFilesInFolder.js +0 -19
  87. package/scripts/recordFilesBeforeBundleCommand.js +0 -41
  88. package/tsconfig.json +0 -18
  89. package/tslint.json +0 -32
  90. /package/{CodePush.js → src/CodePush.js} +0 -0
  91. /package/{logging.js → src/logging.js} +0 -0
  92. /package/{package-mixins.js → src/package-mixins.js} +0 -0
  93. /package/{versioning → src/versioning}/BaseVersioning.js +0 -0
  94. /package/{versioning → src/versioning}/BaseVersioning.test.js +0 -0
  95. /package/{versioning → src/versioning}/IncrementalVersioning.js +0 -0
  96. /package/{versioning → src/versioning}/IncrementalVersioning.test.js +0 -0
  97. /package/{versioning → src/versioning}/SemverVersioning.js +0 -0
  98. /package/{versioning → src/versioning}/SemverVersioning.test.js +0 -0
  99. /package/{versioning → src/versioning}/index.js +0 -0
@@ -0,0 +1,146 @@
1
+ /**
2
+ * code based on appcenter-cli
3
+ */
4
+
5
+ /**
6
+ * NOTE!!! This utility file is duplicated for use by the CodePush service (for server-driven hashing/
7
+ * integrity checks) and Management SDK (for end-to-end code signing), please keep them in sync.
8
+ */
9
+
10
+ import crypto from "crypto";
11
+ import fs from "fs";
12
+ import path from "path";
13
+ import { isDirectory } from "./file-utils.js";
14
+ import { walk } from "./promisfied-fs.js";
15
+
16
+ // Do not throw an exception if either of these modules are missing, as they may not be needed by the
17
+ // consumer of this file.
18
+ const HASH_ALGORITHM = 'sha256';
19
+ class PackageManifest {
20
+ private _map: Map<string, string>;
21
+
22
+ constructor(map?: Map<string, string>) {
23
+ if (map == null) {
24
+ map = new Map();
25
+ }
26
+ this._map = map;
27
+ }
28
+
29
+ toMap(): Map<string, string> {
30
+ return this._map;
31
+ }
32
+
33
+ computePackageHash(): string {
34
+ let entries: string[] = [];
35
+ this._map.forEach((hash, name) => {
36
+ entries.push(name + ':' + hash);
37
+ });
38
+
39
+ // Make sure this list is alphabetically ordered so that other clients
40
+ // can also compute this hash easily given the update contents.
41
+ entries = entries.sort();
42
+
43
+ return crypto.createHash(HASH_ALGORITHM).update(JSON.stringify(entries)).digest('hex');
44
+ }
45
+
46
+ serialize(): string {
47
+ const obj: Record<string, string> = {};
48
+
49
+ this._map.forEach(function (value, key) {
50
+ obj[key] = value;
51
+ });
52
+
53
+ return JSON.stringify(obj);
54
+ }
55
+
56
+ static normalizePath(filePath: string): string {
57
+ //replace all backslashes coming from cli running on windows machines by slashes
58
+ return filePath.replace(/\\/g, '/');
59
+ }
60
+
61
+ static isIgnored(relativeFilePath: string): boolean {
62
+ const __MACOSX = '__MACOSX/';
63
+ const DS_STORE = '.DS_Store';
64
+ const CODEPUSH_METADATA = '.codepushrelease';
65
+ return (
66
+ relativeFilePath.startsWith(__MACOSX) ||
67
+ relativeFilePath === DS_STORE ||
68
+ relativeFilePath.endsWith('/' + DS_STORE) ||
69
+ relativeFilePath === CODEPUSH_METADATA ||
70
+ relativeFilePath.endsWith('/' + CODEPUSH_METADATA)
71
+ );
72
+ }
73
+ }
74
+
75
+ export async function generatePackageHashFromDirectory(directoryPath: string, basePath: string) {
76
+ try {
77
+ if (!isDirectory(directoryPath)) {
78
+ throw new Error('Not a directory. Please either create a directory, or use hashFile().');
79
+ }
80
+ } catch (error) {
81
+ throw new Error('Directory does not exist. Please either create a directory, or use hashFile().');
82
+ }
83
+
84
+ /**
85
+ * @type {PackageManifest}
86
+ */
87
+ const manifest = await generatePackageManifestFromDirectory(directoryPath, basePath);
88
+ return manifest.computePackageHash();
89
+ }
90
+
91
+ function generatePackageManifestFromDirectory(directoryPath: string, basePath: string): Promise<PackageManifest> {
92
+ // eslint-disable-next-line no-async-promise-executor
93
+ return new Promise(async (resolve, reject) => {
94
+ const fileHashesMap = new Map<string, string>();
95
+
96
+ const files: string[] = await walk(directoryPath);
97
+
98
+ if (!files || files.length === 0) {
99
+ reject('Error: Cannot sign the release because no files were found.');
100
+ return;
101
+ }
102
+
103
+ // Hash the files sequentially, because streaming them in parallel is not necessarily faster
104
+ const generateManifestPromise = files.reduce<Promise<unknown>>((soFar, filePath) => {
105
+ return soFar.then(() => {
106
+ const relativePath: string = PackageManifest.normalizePath(path.relative(basePath, filePath));
107
+ if (!PackageManifest.isIgnored(relativePath)) {
108
+ return hashFile(filePath).then((hash) => {
109
+ fileHashesMap.set(relativePath, hash);
110
+ });
111
+ }
112
+ });
113
+ }, Promise.resolve(null));
114
+
115
+ generateManifestPromise.then(() => {
116
+ resolve(new PackageManifest(fileHashesMap));
117
+ }, reject);
118
+ });
119
+ }
120
+
121
+ function hashFile(filePath: string): Promise<string> {
122
+ const readStream: fs.ReadStream = fs.createReadStream(filePath);
123
+ return hashStream(readStream);
124
+ }
125
+
126
+ function hashStream(readStream: fs.ReadStream): Promise<string> {
127
+ return new Promise((resolve, reject) => {
128
+ const _hashStream = crypto.createHash(HASH_ALGORITHM)
129
+
130
+ readStream
131
+ .on('error', (error) => {
132
+ _hashStream.end();
133
+ reject(error);
134
+ })
135
+ .on('end', () => {
136
+ _hashStream.end();
137
+
138
+ const buffer = _hashStream.read();
139
+ const hash: string = buffer.toString('hex');
140
+
141
+ resolve(hash);
142
+ });
143
+
144
+ readStream.pipe(_hashStream);
145
+ });
146
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * code based on appcenter-cli
3
+ */
4
+
5
+ import { promises as fs } from "fs";
6
+ import path from "path";
7
+
8
+ export async function walk(dir: string): Promise<string[]> {
9
+ const stats = await fs.stat(dir);
10
+ if (stats.isDirectory()) {
11
+ let files: string[] = [];
12
+ for (const file of await fs.readdir(dir)) {
13
+ files = files.concat(await walk(path.join(dir, file)));
14
+ }
15
+ return files;
16
+ } else {
17
+ return [dir];
18
+ }
19
+ }
@@ -1,4 +1,4 @@
1
- function showLogo() {
1
+ export function showLogo() {
2
2
  const logo = `
3
3
 
4
4
  +------------------------------------------------------------------+
@@ -19,5 +19,3 @@ Please refer to help command for more information.
19
19
  `;
20
20
  console.log(logo);
21
21
  }
22
-
23
- module.exports = { showLogo };
@@ -0,0 +1,65 @@
1
+ /**
2
+ * code based on appcenter-cli
3
+ */
4
+
5
+ import fs from "fs";
6
+ import path from "path";
7
+ import yazl from "yazl";
8
+ import { generateRandomFilename, normalizePath, isDirectory } from "./file-utils.js";
9
+ import { walk } from "./promisfied-fs.js";
10
+
11
+ type ReleaseFile = { sourceLocation: string, targetLocation: string };
12
+
13
+ export function zip(updateContentsPath: string): Promise<string> {
14
+
15
+ // eslint-disable-next-line no-async-promise-executor
16
+ return new Promise(async (resolve, reject) => {
17
+ const releaseFiles: ReleaseFile[] = [];
18
+
19
+ try {
20
+ if (!isDirectory(updateContentsPath)) {
21
+ releaseFiles.push({
22
+ sourceLocation: updateContentsPath,
23
+ targetLocation: normalizePath(path.basename(updateContentsPath)), // Put the file in the root
24
+ });
25
+ }
26
+ } catch (error: unknown) {
27
+ if (error instanceof Error) {
28
+ error.message = error.message + " Make sure you have added the platform you are making a release to.`.";
29
+ }
30
+ reject(error);
31
+ }
32
+
33
+ const directoryPath = updateContentsPath;
34
+ const baseDirectoryPath = path.join(directoryPath, '..'); // For legacy reasons, put the root directory in the zip
35
+
36
+ const files: string[] = await walk(updateContentsPath);
37
+
38
+ files.forEach((filePath) => {
39
+ const relativePath = path.relative(baseDirectoryPath, filePath);
40
+ releaseFiles.push({
41
+ sourceLocation: filePath,
42
+ targetLocation: normalizePath(relativePath),
43
+ });
44
+ });
45
+
46
+ const packagePath = path.join(process.cwd(), generateRandomFilename(15) + '.zip');
47
+ const zipFile = new yazl.ZipFile();
48
+ const writeStream = fs.createWriteStream(packagePath);
49
+
50
+ zipFile.outputStream
51
+ .pipe(writeStream)
52
+ .on('error', (error: unknown) => {
53
+ reject(error);
54
+ })
55
+ .on('close', () => {
56
+ resolve(packagePath);
57
+ });
58
+
59
+ releaseFiles.forEach((releaseFile) => {
60
+ zipFile.addFile(releaseFile.sourceLocation, releaseFile.targetLocation);
61
+ });
62
+
63
+ zipFile.end();
64
+ });
65
+ }
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@bravemobile/react-native-code-push",
3
- "version": "12.0.2",
3
+ "version": "12.1.1",
4
4
  "description": "React Native plugin for the CodePush service",
5
- "main": "CodePush.js",
6
- "typings": "typings/react-native-code-push.d.ts",
5
+ "main": "src/CodePush.js",
6
+ "react-native": "src/CodePush.js",
7
+ "source": "src/CodePush.js",
8
+ "types": "typings/react-native-code-push.d.ts",
7
9
  "homepage": "https://microsoft.github.io/code-push",
8
10
  "keywords": [
9
11
  "react-native",
@@ -14,16 +16,42 @@
14
16
  "react-native-code-push",
15
17
  "expo-code-push"
16
18
  ],
19
+ "workspaces": [
20
+ "cli"
21
+ ],
17
22
  "author": "Soomgo Mobile Team (originally Microsoft Corporation)",
18
23
  "license": "MIT",
19
24
  "bin": {
20
- "code-push": "cli/index.js"
25
+ "code-push": "bin/code-push.js"
21
26
  },
27
+ "files": [
28
+ "src",
29
+ "bin/code-push.js",
30
+ "android",
31
+ "ios",
32
+ "cli/dist",
33
+ "cli/**/*.ts",
34
+ "!cli/node_modules",
35
+ "expo",
36
+ "typings",
37
+ "*.podspec",
38
+ "react-native.config.js",
39
+ "app.plugin.js",
40
+ "package.json",
41
+ "!ios/build",
42
+ "!android/build",
43
+ "!android/app/build",
44
+ "!android/gradle",
45
+ "!android/gradlew",
46
+ "!android/gradlew.bat",
47
+ "!android/local.properties",
48
+ "!**/__tests__",
49
+ "!**/__fixtures__",
50
+ "!**/__mocks__",
51
+ "!**/.*"
52
+ ],
22
53
  "scripts": {
23
- "clean": "shx rm -rf bin",
24
54
  "setup": "npm install --quiet --no-progress",
25
- "prebuild:tests": "npm run clean && npm run tslint",
26
- "build:tests": "tsc",
27
55
  "test": "npm run build:tests && npm run test:setup && npm run test:fast",
28
56
  "test:android": "npm run build:tests && npm run test:setup:android && npm run test:fast:android",
29
57
  "test:ios": "npm run build:tests && npm run test:setup:ios && npm run test:fast:ios",
@@ -36,9 +64,12 @@
36
64
  "test:debugger:android": "mocha --recursive --inspect-brk=0.0.0.0 bin/test --android",
37
65
  "test:debugger:ios": "mocha --recursive --inspect-brk=0.0.0.0 bin/test --ios",
38
66
  "tslint": "tslint -c tslint.json test/**/*.ts",
67
+ "type:cli": "npm run --workspace cli typecheck",
68
+ "build:cli": "npm run --workspace cli clean && npm run --workspace cli build",
69
+ "prepack": "npm run build:cli",
39
70
  "publish": "npm publish --access=public",
40
71
  "eslint": "eslint --quiet .",
41
- "jest": "jest versioning/*"
72
+ "jest": "jest src/versioning/* && npm run --workspace cli test"
42
73
  },
43
74
  "repository": {
44
75
  "type": "git",
@@ -48,7 +79,7 @@
48
79
  "commander": "^12.1.0",
49
80
  "hoist-non-react-statics": "^3.3.2",
50
81
  "semver": "^7.3.5",
51
- "shelljs": "^0.8.5",
82
+ "shelljs": "^0.10.0",
52
83
  "xcode": "^3.0.1",
53
84
  "yazl": "^3.3.1"
54
85
  },
@@ -64,11 +95,12 @@
64
95
  "devDependencies": {
65
96
  "@babel/core": "^7.26.0",
66
97
  "@babel/preset-env": "^7.26.0",
98
+ "@babel/preset-typescript": "^7.27.1",
67
99
  "@eslint/js": "^9.13.0",
68
100
  "@types/assert": "^1.5.2",
69
101
  "@types/mkdirp": "^1.0.1",
70
102
  "@types/mocha": "^9.0.0",
71
- "@types/node": "^14.0.27",
103
+ "@types/node": "^18.19.129",
72
104
  "@types/q": "^1.5.4",
73
105
  "@types/semver": "^7.5.8",
74
106
  "@types/shelljs": "^0.8.15",
@@ -76,7 +108,6 @@
76
108
  "babel-jest": "^29.7.0",
77
109
  "body-parser": "latest",
78
110
  "code-push-plugin-testing-framework": "file:./code-push-plugin-testing-framework",
79
- "del": "v6.0.0",
80
111
  "eslint": "^9.13.0",
81
112
  "eslint-plugin-react": "^7.37.2",
82
113
  "express": "latest",
@@ -85,7 +116,6 @@
85
116
  "mkdirp": "latest",
86
117
  "mocha": "^9.2.0",
87
118
  "q": "^1.5.1",
88
- "shx": "^0.3.4",
89
119
  "slash": "^3.0.0",
90
120
  "ts-node": "^10.9.2",
91
121
  "tslint": "^6.1.3",
@@ -3,22 +3,22 @@ let { Alert } = React;
3
3
 
4
4
  if (Platform.OS === "android") {
5
5
  const { NativeModules: { CodePushDialog } } = React;
6
-
6
+
7
7
  Alert = {
8
8
  alert(title, message, buttons) {
9
9
  if (buttons.length > 2) {
10
10
  throw "Can only show 2 buttons for Android dialog.";
11
11
  }
12
-
12
+
13
13
  const button1Text = buttons[0] ? buttons[0].text : null,
14
14
  button2Text = buttons[1] ? buttons[1].text : null;
15
-
15
+
16
16
  CodePushDialog.showDialog(
17
17
  title, message, button1Text, button2Text,
18
- (buttonId) => { buttons[buttonId].onPress && buttons[buttonId].onPress(); },
18
+ (buttonId) => { buttons[buttonId].onPress && buttons[buttonId].onPress(); },
19
19
  (error) => { throw error; });
20
20
  }
21
21
  };
22
22
  }
23
23
 
24
- module.exports = { Alert };
24
+ module.exports = { Alert };
package/AGENTS.md DELETED
@@ -1,32 +0,0 @@
1
- # Repository Guidelines
2
-
3
- ## Project Structure & Module Organization
4
- - `CodePush.js` and `package-mixins.js` expose the JavaScript API, with supporting utilities in `logging.js` and `AlertAdapter.js`.
5
- - Native bridges live in `android/` and `ios/`; keep platform-specific assets scoped there.
6
- - The Expo sample and reference implementations sit in `Examples/`, while CLI logic and packaging helpers live in `cli/` and `code-push-plugin-testing-framework/`.
7
- - Automated tests are authored in TypeScript under `test/` and emitted into `bin/test` after build; documentation and release notes remain in `docs/` and `Recipes/`.
8
-
9
- ## Build, Test, and Development Commands
10
- - `npm install` installs dependencies (Node >=18 is required).
11
- - `npm run build:tests` transpiles the TypeScript test harness into `bin/test`.
12
- - `npm run test` runs the full Mocha suite across Android and iOS adapters; use `npm run test:android` or `npm run test:ios` when iterating on a single platform.
13
- - `npm run test:fast` skips environment setup for quicker feedback once devices are ready.
14
- - `npm run eslint` checks JavaScript/TypeScript style; `npm run tslint` targets the legacy TypeScript specs; `npm run jest` covers the semver logic in `versioning/`.
15
- - `npm run clean` clears generated artifacts before rebuilding.
16
-
17
- ## Coding Style & Naming Conventions
18
- - Use 2-space indentation and double quotes in TypeScript tests (see `tslint.json`); match surrounding style elsewhere and let ESLint guide fixes.
19
- - Components and HOCs use PascalCase (`CodePush`), utilities camelCase, and CLI binaries kebab-case.
20
- - Keep platform guards explicit (`Platform.OS`) and annotate non-obvious flows with concise comments.
21
-
22
- ## Testing Guidelines
23
- - Place new specs alongside `test/test.ts`; share fixtures via `test/template/` or the helper utilities in `code-push-plugin-testing-framework/`.
24
- - Always run `npm run build:tests` before executing tests locally or in CI.
25
- - Document which device targets were used when running `npm run test`, and prefer `:android`/`:ios` variants during platform-specific debugging.
26
- - Extend `versioning/` tests when changing release or rollback logic and verify with `npm run jest`.
27
-
28
- ## Commit & Pull Request Guidelines
29
- - Follow conventional commits (`type(scope): summary`), mirroring history such as `chore(Example): update the example app to v12`.
30
- - Reference related issues in the body, summarize behavioral changes, and attach screenshots/logs for Example app updates.
31
- - Ensure lint, Mocha, and Jest suites pass before requesting review; include the commands executed in the PR description.
32
- - Rebase instead of merging from main when tidying feature branches to keep history linear.
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,17 +0,0 @@
1
- package com.microsoft.codepush.react;
2
-
3
- import com.facebook.react.ReactInstanceManager;
4
-
5
- /**
6
- * Provides access to a {@link ReactInstanceManager}.
7
- *
8
- * ReactNativeHost already implements this interface, if you make use of that react-native
9
- * component (just add `implements ReactInstanceHolder`).
10
- */
11
- public interface ReactInstanceHolder {
12
-
13
- /**
14
- * Get the current {@link ReactInstanceManager} instance. May return null.
15
- */
16
- ReactInstanceManager getReactInstanceManager();
17
- }
@@ -1,5 +0,0 @@
1
- distributionBase=GRADLE_USER_HOME
2
- distributionPath=wrapper/dists
3
- zipStoreBase=GRADLE_USER_HOME
4
- zipStorePath=wrapper/dists
5
- distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip