Skip to content

Commit

Permalink
[BREAKING] feat: invert the --reverse-port CLI option (#825)
Browse files Browse the repository at this point in the history
* feat: invert the reverse port flag

* chore: add changeset

* fix: rely only on revertPort flag
  • Loading branch information
jbroma authored Dec 16, 2024
1 parent 8cf7cc3 commit 18f2eef
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-ants-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@callstack/repack": major
---

Removed `--reverse-port` CLI option and replaced it with `--no-reverse-port` CLI option.
5 changes: 3 additions & 2 deletions packages/repack/src/commands/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export const startCommandOptions = [
'Run the dev server for the specified platform only. By default, the dev server will bundle for all platforms.',
},
{
name: '--reverse-port',
description: 'ADB reverse port on starting devServers only for Android',
name: '--no-reverse-port',
description:
'Disables running ADB reverse automatically when bundling for Android',
},
{
name: '--verbose',
Expand Down
6 changes: 1 addition & 5 deletions packages/repack/src/commands/rspack/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,7 @@ export async function start(
);
}

if (
reversePort ||
args.platform === undefined ||
args.platform === 'android'
) {
if (reversePort) {
void runAdbReverse({ port: serverPort, logger: ctx.log });
}

Expand Down
6 changes: 1 addition & 5 deletions packages/repack/src/commands/webpack/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ export async function start(_: string[], config: Config, args: StartArguments) {
);
}

if (
reversePort ||
args.platform === undefined ||
args.platform === 'android'
) {
if (reversePort) {
void runAdbReverse({ port: serverPort, logger: ctx.log });
}

Expand Down

0 comments on commit 18f2eef

Please sign in to comment.