Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
},
Expand Down
32 changes: 29 additions & 3 deletions src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -916,6 +917,9 @@ export const commands = {
expo,
rncli,
disableHermes,
name,
description,
metaInfo,
} = translateOptions({
...options,
tempDir,
Expand Down Expand Up @@ -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(
Expand All @@ -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,
);
}
}
}
},

Expand Down