mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 09:41:38 +08:00
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:
14
cli.json
14
cli.json
@@ -118,7 +118,7 @@
|
|||||||
"description": "Bundle javascript and copy assets."
|
"description": "Bundle javascript and copy assets."
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"description": "Bundle javascript code only.",
|
"description": "Bundle javascript code only and optionally publish.",
|
||||||
"options": {
|
"options": {
|
||||||
"dev": {
|
"dev": {
|
||||||
"default": "false",
|
"default": "false",
|
||||||
@@ -157,6 +157,18 @@
|
|||||||
},
|
},
|
||||||
"disableHermes": {
|
"disableHermes": {
|
||||||
"default": false
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -19,6 +19,7 @@ import { t } from './utils/i18n';
|
|||||||
import { tempDir } from './utils/constants';
|
import { tempDir } from './utils/constants';
|
||||||
import { checkLockFiles } from './utils/check-lockfile';
|
import { checkLockFiles } from './utils/check-lockfile';
|
||||||
import { addGitIgnore } from './utils/add-gitignore';
|
import { addGitIgnore } from './utils/add-gitignore';
|
||||||
|
import { commands as versionCommands } from './versions';
|
||||||
|
|
||||||
type Diff = (oldSource?: Buffer, newSource?: Buffer) => Buffer;
|
type Diff = (oldSource?: Buffer, newSource?: Buffer) => Buffer;
|
||||||
|
|
||||||
@@ -916,6 +917,9 @@ export const commands = {
|
|||||||
expo,
|
expo,
|
||||||
rncli,
|
rncli,
|
||||||
disableHermes,
|
disableHermes,
|
||||||
|
name,
|
||||||
|
description,
|
||||||
|
metaInfo,
|
||||||
} = translateOptions({
|
} = translateOptions({
|
||||||
...options,
|
...options,
|
||||||
tempDir,
|
tempDir,
|
||||||
@@ -956,14 +960,17 @@ export const commands = {
|
|||||||
|
|
||||||
await pack(path.resolve(intermediaDir), realOutput);
|
await pack(path.resolve(intermediaDir), realOutput);
|
||||||
|
|
||||||
const v = await question(t('uploadBundlePrompt'));
|
if (name) {
|
||||||
if (v.toLowerCase() === 'y') {
|
const versionName = await versionCommands.publish({
|
||||||
const versionName = await this.publish({
|
|
||||||
args: [realOutput],
|
args: [realOutput],
|
||||||
options: {
|
options: {
|
||||||
platform,
|
platform,
|
||||||
|
name,
|
||||||
|
description,
|
||||||
|
metaInfo,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isSentry) {
|
if (isSentry) {
|
||||||
await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput);
|
await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput);
|
||||||
await uploadSourcemapForSentry(
|
await uploadSourcemapForSentry(
|
||||||
@@ -973,6 +980,25 @@ export const commands = {
|
|||||||
versionName,
|
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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user