Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2cfe451

Browse files
committedJun 20, 2025··
one in all command
1 parent c7d0aad commit 2cfe451

File tree

4 files changed

+101
-20
lines changed

4 files changed

+101
-20
lines changed
 

‎cli.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,27 @@
5757
},
5858
"metaInfo": {
5959
"hasValue": true
60+
},
61+
"packageId": {
62+
"hasValue": true
63+
},
64+
"packageVersion": {
65+
"hasValue": true
66+
},
67+
"minPackageVersion": {
68+
"hasValue": true
69+
},
70+
"maxPackageVersion": {
71+
"hasValue": true
72+
},
73+
"packageVersionRange": {
74+
"hasValue": true
75+
},
76+
"rollout": {
77+
"hasValue": true
78+
},
79+
"dryRun": {
80+
"default": false
6081
}
6182
}
6283
},
@@ -175,6 +196,27 @@
175196
"metaInfo": {
176197
"hasValue": true,
177198
"description": "Meta information for publishing"
199+
},
200+
"packageId": {
201+
"hasValue": true
202+
},
203+
"packageVersion": {
204+
"hasValue": true
205+
},
206+
"minPackageVersion": {
207+
"hasValue": true
208+
},
209+
"maxPackageVersion": {
210+
"hasValue": true
211+
},
212+
"packageVersionRange": {
213+
"hasValue": true
214+
},
215+
"rollout": {
216+
"hasValue": true
217+
},
218+
"dryRun": {
219+
"default": false
178220
}
179221
}
180222
},

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-update-cli",
3-
"version": "1.45.6",
3+
"version": "1.46.0",
44
"description": "command line tool for react-native-update (remote updates for react native)",
55
"main": "index.js",
66
"bin": {

‎src/bundle.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { t } from './utils/i18n';
1919
import { tempDir } from './utils/constants';
2020
import { checkLockFiles } from './utils/check-lockfile';
2121
import { addGitIgnore } from './utils/add-gitignore';
22-
import { commands as versionCommands } from './versions';
22+
import { versionCommands } from './versions';
2323

2424
type Diff = (oldSource?: Buffer, newSource?: Buffer) => Buffer;
2525

@@ -926,6 +926,13 @@ export const commands = {
926926
name,
927927
description,
928928
metaInfo,
929+
packageId,
930+
packageVersion,
931+
minPackageVersion,
932+
maxPackageVersion,
933+
packageVersionRange,
934+
rollout,
935+
dryRun,
929936
} = translateOptions({
930937
...options,
931938
tempDir,
@@ -974,6 +981,13 @@ export const commands = {
974981
name,
975982
description,
976983
metaInfo,
984+
packageId,
985+
packageVersion,
986+
minPackageVersion,
987+
maxPackageVersion,
988+
packageVersionRange,
989+
rollout,
990+
dryRun: Boolean(dryRun),
977991
},
978992
});
979993

‎src/versions.ts

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import type { Package, Platform, Version } from 'types';
1010
import { satisfies } from 'compare-versions';
1111
import chalk from 'chalk';
1212

13-
interface CommandOptions {
13+
interface VersionCommandOptions {
14+
appId?: string;
1415
name?: string;
1516
description?: string;
1617
metaInfo?: string;
@@ -156,13 +157,13 @@ export const bindVersionToPackages = async ({
156157
console.log(t('operationComplete', { count: pkgs.length }));
157158
};
158159

159-
export const commands = {
160+
export const versionCommands = {
160161
publish: async function ({
161162
args,
162163
options,
163164
}: {
164165
args: string[];
165-
options: CommandOptions;
166+
options: VersionCommandOptions;
166167
}) {
167168
const fn = args[0];
168169
const { name, description, metaInfo } = options;
@@ -191,26 +192,52 @@ export const commands = {
191192
saveToLocal(fn, `${appId}/ppk/${id}.ppk`);
192193
console.log(t('packageUploadSuccess', { id }));
193194

194-
const v = await question(t('updateNativePackageQuestion'));
195-
if (v.toLowerCase() === 'y') {
196-
await this.update({ args: [], options: { versionId: id, platform } });
195+
const {
196+
packageId,
197+
packageVersion,
198+
packageVersionRange,
199+
minPackageVersion,
200+
maxPackageVersion,
201+
rollout,
202+
dryRun,
203+
} = options;
204+
205+
if (
206+
packageId ||
207+
packageVersion ||
208+
packageVersionRange ||
209+
minPackageVersion ||
210+
maxPackageVersion
211+
) {
212+
await this.update({
213+
options: {
214+
versionId: id,
215+
platform,
216+
packageId,
217+
packageVersion,
218+
packageVersionRange,
219+
minPackageVersion,
220+
maxPackageVersion,
221+
rollout,
222+
dryRun,
223+
},
224+
});
225+
} else {
226+
const q = await question(t('updateNativePackageQuestion'));
227+
if (q.toLowerCase() === 'y') {
228+
await this.update({ options: { versionId: id, platform } });
229+
}
197230
}
198231
return versionName;
199232
},
200-
versions: async ({ options }: { options: CommandOptions }) => {
233+
versions: async ({ options }: { options: VersionCommandOptions }) => {
201234
const platform = await getPlatform(options.platform);
202235
const { appId } = await getSelectedApp(platform);
203236
await listVersions(appId);
204237
},
205-
update: async ({
206-
args,
207-
options,
208-
}: {
209-
args: string[];
210-
options: CommandOptions;
211-
}) => {
238+
update: async ({ options }: { options: VersionCommandOptions }) => {
212239
const platform = await getPlatform(options.platform);
213-
const { appId } = await getSelectedApp(platform);
240+
const appId = options.appId || (await getSelectedApp(platform)).appId;
214241
let versionId = options.versionId || (await chooseVersion(appId)).id;
215242
if (versionId === 'null') {
216243
versionId = undefined;
@@ -309,11 +336,9 @@ export const commands = {
309336
});
310337
},
311338
updateVersionInfo: async ({
312-
args,
313339
options,
314340
}: {
315-
args: string[];
316-
options: CommandOptions;
341+
options: VersionCommandOptions;
317342
}) => {
318343
const platform = await getPlatform(options.platform);
319344
const { appId } = await getSelectedApp(platform);

0 commit comments

Comments
 (0)
Please sign in to comment.