@algocare/react-native-code-push 10.2.0 → 10.3.0
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.
|
@@ -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()
|