From 18f2eef7dbb2a79e709c1810c69a34b0a0fe9004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Roma=C5=84czyk?= Date: Mon, 16 Dec 2024 14:38:30 +0100 Subject: [PATCH] [BREAKING] feat: invert the `--reverse-port` CLI option (#825) * feat: invert the reverse port flag * chore: add changeset * fix: rely only on revertPort flag --- .changeset/dull-ants-change.md | 5 +++++ packages/repack/src/commands/options.ts | 5 +++-- packages/repack/src/commands/rspack/start.ts | 6 +----- packages/repack/src/commands/webpack/start.ts | 6 +----- 4 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 .changeset/dull-ants-change.md diff --git a/.changeset/dull-ants-change.md b/.changeset/dull-ants-change.md new file mode 100644 index 000000000..6446f553e --- /dev/null +++ b/.changeset/dull-ants-change.md @@ -0,0 +1,5 @@ +--- +"@callstack/repack": major +--- + +Removed `--reverse-port` CLI option and replaced it with `--no-reverse-port` CLI option. diff --git a/packages/repack/src/commands/options.ts b/packages/repack/src/commands/options.ts index a0219d96b..560d09ad7 100644 --- a/packages/repack/src/commands/options.ts +++ b/packages/repack/src/commands/options.ts @@ -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', diff --git a/packages/repack/src/commands/rspack/start.ts b/packages/repack/src/commands/rspack/start.ts index abcb98ba4..0cdf455db 100644 --- a/packages/repack/src/commands/rspack/start.ts +++ b/packages/repack/src/commands/rspack/start.ts @@ -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 }); } diff --git a/packages/repack/src/commands/webpack/start.ts b/packages/repack/src/commands/webpack/start.ts index 5c5ecd85c..4c3ee07a8 100644 --- a/packages/repack/src/commands/webpack/start.ts +++ b/packages/repack/src/commands/webpack/start.ts @@ -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 }); }