@algocare/react-native-code-push 12.3.0 → 12.5.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.
@@ -31,7 +31,7 @@ program
31
31
  type: 'list',
32
32
  name: 'app',
33
33
  message: 'Select the target app',
34
- choices: ['user', 'device'],
34
+ choices: ['user', 'device', 'b2c-device', 'home-device', 'home-mobile'],
35
35
  },
36
36
  {
37
37
  type: 'list',
@@ -8,7 +8,7 @@ async function getAppValue() {
8
8
  type: 'list',
9
9
  name: 'app',
10
10
  message: 'Select the target app',
11
- choices: ['user', 'device', 'b2c-device'],
11
+ choices: ['user', 'device', 'b2c-device', 'home-device', 'home-mobile'],
12
12
  },
13
13
  ])
14
14
  return app
@@ -13,7 +13,7 @@ const {
13
13
  program
14
14
  .command('create-history')
15
15
  .description('Creates a new release history for the binary app.')
16
- .option('-a, --app <string>', 'target app (user/device/b2c-device)')
16
+ .option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
17
17
  .option('-p, --platform <string>', 'target platform (ios/android)')
18
18
  .option('-i, --identifier <string>', 'target env identifier (dev/stg/prd)')
19
19
  .option('-b, --binary-version <string>', 'target binary version (x.y.z)')
@@ -25,9 +25,9 @@ program
25
25
  .action(async (options) => {
26
26
  if (
27
27
  options.app &&
28
- !['user', 'device', 'b2c-device'].includes(options.app)
28
+ !['user', 'device', 'b2c-device', 'home-device', 'home-mobile'].includes(options.app)
29
29
  ) {
30
- throw new Error('App must be either "user" or "device" or "b2c-device"')
30
+ throw new Error('App must be either "user" or "device" or "b2c-device" or "home-device" or "home-mobile"')
31
31
  }
32
32
 
33
33
  if (options.platform && !['ios', 'android'].includes(options.platform)) {
@@ -6,7 +6,7 @@ const { createPullRequestHistory } = require('./createPullRequestHistory')
6
6
  program
7
7
  .command('create-pr-history')
8
8
  .description('Creates a new pull request history.')
9
- .option('-a, --app <string>', 'target app (user/device)')
9
+ .option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
10
10
  .option('-p, --platform <string>', 'target platform (ios/android)')
11
11
  .option('-b, --binary-version <string>', 'target binary version (x.y.z)')
12
12
  .option(
@@ -11,7 +11,7 @@ const { createPullRequestRelease } = require('./createPullRequestRelease')
11
11
  program
12
12
  .command('create-pr-release')
13
13
  .description('Creates a new pull request release.')
14
- .option('-a, --app <string>', 'target app (user/device)')
14
+ .option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
15
15
  .option('-p, --platform <string>', 'target platform (ios/android)')
16
16
  .option('-b, --binary-version <string>', 'target binary version (x.y.z)')
17
17
  .option('-r, --pr-number <number>', 'pull request number')
@@ -20,7 +20,7 @@ program
20
20
  .description(
21
21
  'Deploys a new CodePush update for a target binary app.\nAfter creating the CodePush bundle, it uploads the file and updates the ReleaseHistory information.\n`bundleUploader`, `getReleaseHistory`, and `setReleaseHistory` functions should be implemented in the config file.'
22
22
  )
23
- .option('-a, --app <string>', 'target app (user/device/b2c-device)')
23
+ .option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
24
24
  .option('-p, --platform <string>', 'target platform (ios/android)')
25
25
  .option('-i, --identifier <string>', 'target env identifier (dev/stg/prd)')
26
26
  .option('-b, --binary-version <string>', 'target binary version (x.y.z)')
@@ -57,16 +57,17 @@ program
57
57
  .action(async (options) => {
58
58
  if (
59
59
  options.app &&
60
- !['user', 'device', 'b2c-device'].includes(options.app)
60
+ !['user', 'device', 'b2c-device', 'home-device', 'home-mobile'].includes(options.app)
61
61
  ) {
62
- throw new Error('App must be either "user" or "device" or "b2c-device"')
62
+ throw new Error('App must be either "user" or "device" or "b2c-device" or "home-device" or "home-mobile"')
63
63
  }
64
64
 
65
65
  if (options.platform && !['ios', 'android'].includes(options.platform)) {
66
66
  throw new Error('Platform must be either "ios" or "android"')
67
67
  }
68
68
 
69
- if (options.app !== 'user' && options.platform === 'ios') {
69
+ // iOS는 'user' 'home-mobile' 앱만 지원
70
+ if (options.app !== 'user' && options.app !== 'home-mobile' && options.platform === 'ios') {
70
71
  throw new Error('Device app is not supported on iOS')
71
72
  }
72
73
 
@@ -6,7 +6,7 @@ const { removePullRequestHistory } = require('./removePullRequestHistory')
6
6
  program
7
7
  .command('remove-pr-history')
8
8
  .description('Removes a pull request history.')
9
- .option('-a, --app <string>', 'target app (user/device)')
9
+ .option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
10
10
  .option('-p, --platform <string>', 'target platform (ios/android)')
11
11
  .option('-r, --pr-number <number>', 'pull request number')
12
12
  .option(
@@ -13,7 +13,7 @@ program
13
13
  .description(
14
14
  'Retrieves and prints the release history of a specific binary version.\n`getReleaseHistory` function should be implemented in the config file.'
15
15
  )
16
- .option('-a, --app <string>', 'target app (user/device/b2c-device)')
16
+ .option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
17
17
  .option('-p, --platform <string>', 'target platform (ios/android)')
18
18
  .option('-i, --identifier <string>', 'target env identifier (dev/stg/prd)')
19
19
  .option('-b, --binary-version <string>', 'target binary version (x.y.z)')
@@ -25,9 +25,9 @@ program
25
25
  .action(async (options) => {
26
26
  if (
27
27
  options.app &&
28
- !['user', 'device', 'b2c-device'].includes(options.app)
28
+ !['user', 'device', 'b2c-device', 'home-device', 'home-mobile'].includes(options.app)
29
29
  ) {
30
- throw new Error('App must be either "user" or "device" or "b2c-device"')
30
+ throw new Error('App must be either "user" or "device" or "b2c-device" or "home-device" or "home-mobile"')
31
31
  }
32
32
 
33
33
  if (options.platform && !['ios', 'android'].includes(options.platform)) {
@@ -15,7 +15,7 @@ program
15
15
  .description(
16
16
  'Updates the release history for a specific binary version.\n`getReleaseHistory`, `setReleaseHistory` functions should be implemented in the config file.'
17
17
  )
18
- .option('-a, --app <string>', 'target app (user/device/b2c-device)')
18
+ .option('-a, --app <string>', 'target app (user/device/b2c-device/home-device/home-mobile)')
19
19
  .option('-p, --platform <string>', 'target platform (ios/android)')
20
20
  .option('-i, --identifier <string>', 'target env identifier (dev/stg/prd)')
21
21
  .option('-b, --binary-version <string>', 'target binary version (x.y.z)')
@@ -35,9 +35,9 @@ program
35
35
  .action(async (options) => {
36
36
  if (
37
37
  options.app &&
38
- !['user', 'device', 'b2c-device'].includes(options.app)
38
+ !['user', 'device', 'b2c-device', 'home-device'].includes(options.app)
39
39
  ) {
40
- throw new Error('App must be either "user" or "device" or "b2c-device"')
40
+ throw new Error('App must be either "user" or "device" or "b2c-device" or "home-device" or "home-mobile"')
41
41
  }
42
42
 
43
43
  if (options.platform && !['ios', 'android'].includes(options.platform)) {
@@ -31,25 +31,33 @@ function getCDNUrl(identifier: 'stg' | 'prd') {
31
31
  }
32
32
 
33
33
  function historyJsonFileRemotePath(
34
- app: 'user' | 'device',
34
+ app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
35
35
  platform: 'ios' | 'android',
36
36
  binaryVersion: string
37
37
  ) {
38
+ // home-mobile은 platform 구분 없이 단일 경로 사용
39
+ if (app === 'home-mobile') {
40
+ return `histories/${app}/${binaryVersion}.json`
41
+ }
38
42
  return `histories/${app}/${platform}/${binaryVersion}.json`
39
43
  }
40
44
 
41
45
  function bundleFileRemotePath(
42
- app: 'user' | 'device',
46
+ app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
43
47
  platform: 'ios' | 'android',
44
48
  fileName: string
45
49
  ) {
50
+ // home-mobile은 platform 구분 없이 단일 경로 사용
51
+ if (app === 'home-mobile') {
52
+ return `bundles/${app}/${fileName}`
53
+ }
46
54
  return `bundles/${app}/${platform}/${fileName}`
47
55
  }
48
56
 
49
57
  const Config: CliConfigInterface = {
50
58
  bundleUploader: async (
51
59
  source: string,
52
- app: 'user' | 'device',
60
+ app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
53
61
  platform: 'ios' | 'android',
54
62
  identifier: 'stg' | 'prd'
55
63
  ): Promise<{ downloadUrl: string }> => {
@@ -81,7 +89,7 @@ const Config: CliConfigInterface = {
81
89
  },
82
90
 
83
91
  getReleaseHistory: async (
84
- app: 'user' | 'device',
92
+ app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
85
93
  targetBinaryVersion: string,
86
94
  platform: 'ios' | 'android',
87
95
  identifier: 'stg' | 'prd'
@@ -101,7 +109,7 @@ const Config: CliConfigInterface = {
101
109
  targetBinaryVersion: string,
102
110
  jsonFilePath: string,
103
111
  releaseInfo: ReleaseHistoryInterface,
104
- app: 'user' | 'device',
112
+ app: 'user' | 'device' | 'b2c-device' | 'home-device' | 'home-mobile',
105
113
  platform: 'ios' | 'android',
106
114
  identifier: 'stg' | 'prd'
107
115
  ): Promise<void> => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algocare/react-native-code-push",
3
- "version": "12.3.0",
3
+ "version": "12.5.0",
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",