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

add paramaters for bundle command to auto publish (#12)

* add paramaters for bundle command to auto publish

* Update bundle.ts

---------

Co-authored-by: Sunny Luo <sunnylqm@gmail.com>
This commit is contained in:
波仔糕
2025-04-23 11:19:26 +08:00
committed by GitHub
parent 573ab60e44
commit b22c598ca4
2 changed files with 42 additions and 4 deletions

View File

@@ -118,7 +118,7 @@
"description": "Bundle javascript and copy assets."
},
"bundle": {
"description": "Bundle javascript code only.",
"description": "Bundle javascript code only and optionally publish.",
"options": {
"dev": {
"default": "false",
@@ -157,6 +157,18 @@
},
"disableHermes": {
"default": false
},
"name": {
"hasValue": true,
"description": "Version name for publishing"
},
"description": {
"hasValue": true,
"description": "Version description for publishing"
},
"metaInfo": {
"hasValue": true,
"description": "Meta information for publishing"
}
}
},

View File

@@ -19,6 +19,7 @@ import { t } from './utils/i18n';
import { tempDir } from './utils/constants';
import { checkLockFiles } from './utils/check-lockfile';
import { addGitIgnore } from './utils/add-gitignore';
import { commands as versionCommands } from './versions';
type Diff = (oldSource?: Buffer, newSource?: Buffer) => Buffer;
@@ -916,6 +917,9 @@ export const commands = {
expo,
rncli,
disableHermes,
name,
description,
metaInfo,
} = translateOptions({
...options,
tempDir,
@@ -956,14 +960,17 @@ export const commands = {
await pack(path.resolve(intermediaDir), realOutput);
const v = await question(t('uploadBundlePrompt'));
if (v.toLowerCase() === 'y') {
const versionName = await this.publish({
if (name) {
const versionName = await versionCommands.publish({
args: [realOutput],
options: {
platform,
name,
description,
metaInfo,
},
});
if (isSentry) {
await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput);
await uploadSourcemapForSentry(
@@ -973,6 +980,25 @@ export const commands = {
versionName,
);
}
} else if (!options['no-interactive']) {
const v = await question(t('uploadBundlePrompt'));
if (v.toLowerCase() === 'y') {
const versionName = await versionCommands.publish({
args: [realOutput],
options: {
platform,
},
});
if (isSentry) {
await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput);
await uploadSourcemapForSentry(
bundleName,
intermediaDir,
sourcemapOutput,
versionName,
);
}
}
}
},