@algocare/react-native-code-push 10.2.0 → 10.3.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.
@@ -4,8 +4,8 @@ const { addToPullRequestRelease } = require('./addToPullRequestRelease')
4
4
 
5
5
  async function createPullRequestRelease(
6
6
  bundleUploader,
7
- getReleaseHistory,
8
7
  setReleaseHistory,
8
+ getReleaseHistory,
9
9
  app,
10
10
  binaryVersion,
11
11
  prNumber,
@@ -0,0 +1,31 @@
1
+ const { program } = require('commander')
2
+ const { findAndReadConfigFile } = require('../../utils/fsUtils')
3
+ const { COMPILED_CONFIG_FILE_NAME } = require('../../constant')
4
+
5
+ program
6
+ .command('get-development-key')
7
+ .description('the development key for a specific app and platform.')
8
+ .option('-a, --app <string>', 'target app (user/device)')
9
+ .option('-p, --platform <string>', 'target platform (ios/android)')
10
+ .option('-b, --binary-version <string>', 'target binary version (x.y.z)')
11
+ .option('-r, --pr-number <number>', 'pull request number')
12
+ .option(
13
+ '-c, --config <path>',
14
+ 'configuration file name (JS/TS)',
15
+ COMPILED_CONFIG_FILE_NAME
16
+ )
17
+ .action(async (options) => {
18
+ const { getReleaseHistory } = await findAndReadConfigFile(
19
+ process.cwd(),
20
+ options.config
21
+ )
22
+
23
+ const releaseHistory = await getReleaseHistory(
24
+ options.app,
25
+ options.binaryVersion || options.prNumber,
26
+ options.platform
27
+ )
28
+
29
+ const latestReleaseVersion = Object.keys(releaseHistory).at(-1)
30
+ return releaseHistory[latestReleaseVersion].packageHash
31
+ })
package/cli/index.js CHANGED
@@ -40,4 +40,24 @@ require('./commands/releaseCommand')
40
40
  */
41
41
  require('./commands/showHistoryCommand')
42
42
 
43
+ /**
44
+ * npx code-push create-pr-history
45
+ */
46
+ require('./commands/createPullRequestHistoryCommand')
47
+
48
+ /**
49
+ * npx code-push create-pr-release
50
+ */
51
+ require('./commands/createPullRequestReleaseCommand')
52
+
53
+ /**
54
+ * npx code-push remove-pr-history
55
+ */
56
+ require('./commands/removePullRequestHistoryCommand')
57
+
58
+ /**
59
+ * npx code-push get-development-key
60
+ */
61
+ require('./commands/getDevelopmentKeyCommand')
62
+
43
63
  program.parse()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algocare/react-native-code-push",
3
- "version": "10.2.0",
3
+ "version": "10.3.1",
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",