1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-09-16 01:41:37 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Refactor command exports to use specific command groups for app, bundle, package, user, and version modules

This commit is contained in:
sunnylqm
2025-06-23 11:30:36 +08:00
parent 2cfe451db5
commit 91a602979d
6 changed files with 15 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-update-cli",
"version": "1.46.0",
"version": "1.46.1",
"description": "command line tool for react-native-update (remote updates for react native)",
"main": "index.js",
"bin": {

View File

@@ -66,7 +66,7 @@ export async function chooseApp(platform: Platform) {
}
}
export const commands = {
export const appCommands = {
createApp: async function ({
options,
}: {

View File

@@ -908,7 +908,7 @@ function diffArgsCheck(args: string[], options: any, diffFn: string) {
};
}
export const commands = {
export const bundleCommands = {
bundle: async ({ options }) => {
const platform = await getPlatform(options.platform);

View File

@@ -3,6 +3,11 @@
import { loadSession } from './api';
import { printVersionCommand } from './utils';
import { t } from './utils/i18n';
import { bundleCommands } from './bundle';
import { versionCommands } from './versions';
import { userCommands } from './user';
import { appCommands } from './app';
import { packageCommands } from './package';
function printUsage() {
// const commandName = args[0];
@@ -15,11 +20,11 @@ function printUsage() {
}
const commands = {
...require('./user').commands,
...require('./bundle').commands,
...require('./app').commands,
...require('./package').commands,
...require('./versions').commands,
...userCommands,
...bundleCommands,
...appCommands,
...packageCommands,
...versionCommands,
help: printUsage,
};

View File

@@ -52,7 +52,7 @@ export async function choosePackage(appId: string) {
}
}
export const commands = {
export const packageCommands = {
uploadIpa: async ({ args }: { args: string[] }) => {
const fn = args[0];
if (!fn || !fn.endsWith('.ipa')) {

View File

@@ -7,7 +7,7 @@ function md5(str: string) {
return crypto.createHash('md5').update(str).digest('hex');
}
export const commands = {
export const userCommands = {
login: async ({ args }: { args: string[] }) => {
const email = args[0] || (await question('email:'));
const pwd = args[1] || (await question('password:', true));