Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat(cli): Added inspect-brk flag" #643

Merged
merged 1 commit into from
Mar 27, 2020
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
23 changes: 9 additions & 14 deletions actions/start.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ export class StartAction extends BuildAction {
);

const binaryToRunOption = options.find(option => option.name === 'exec');
const debugModeOption = options.find(option =>
['debug', 'debug-brk'].includes(option.name),
);
const debugModeOption = options.find(option => option.name === 'debug');
const watchModeOption = options.find(option => option.name === 'watch');
const isWatchEnabled = !!(watchModeOption && watchModeOption.value);
const watchAssetsModeOption = options.find(
Expand All @@ -39,6 +37,7 @@ export class StartAction extends BuildAction {
const isWatchAssetsEnabled = !!(
watchAssetsModeOption && watchAssetsModeOption.value
);
const debugFlag = debugModeOption && debugModeOption.value;
const binaryToRun =
binaryToRunOption && (binaryToRunOption.value as string | undefined);

Expand All @@ -49,7 +48,7 @@ export class StartAction extends BuildAction {
const onSuccess = this.createOnSuccessHook(
configuration,
appName,
debugModeOption,
debugFlag,
outDir,
binaryToRun,
);
Expand All @@ -59,7 +58,7 @@ export class StartAction extends BuildAction {
options,
isWatchEnabled,
isWatchAssetsEnabled,
!!debugModeOption,
!!debugFlag,
onSuccess,
);
} catch (err) {
Expand All @@ -74,7 +73,7 @@ export class StartAction extends BuildAction {
public createOnSuccessHook(
configuration: Required<Configuration>,
appName: string,
debugFlag: Input | undefined,
debugFlag: boolean | string | undefined,
outDirName: string,
binaryToRun = 'node',
) {
Expand Down Expand Up @@ -119,7 +118,7 @@ export class StartAction extends BuildAction {
private spawnChildProcess(
entryFile: string,
sourceRoot: string,
debug: Input | undefined,
debug: boolean | string | undefined,
outDirName: string,
binaryToRun: string,
) {
Expand All @@ -138,13 +137,9 @@ export class StartAction extends BuildAction {

const processArgs = [outputFilePath, ...childProcessArgs];
if (debug) {
const inspectFlag = debug.name === 'debug' ? 'inspect' : 'inspect-brk';
const debugFlag =
typeof debug.value === 'string'
? `--${inspectFlag}=${debug}`
: `--${inspectFlag}`;

processArgs.unshift(debugFlag);
const inspectFlag =
typeof debug === 'string' ? `--inspect=${debug}` : '--inspect';
processArgs.unshift(inspectFlag);
}
return spawn(binaryToRun, processArgs, {
stdio: 'inherit',
Expand Down
4 changes: 0 additions & 4 deletions commands/start.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ export class StartCommand extends AbstractCommand {
'-d, --debug [hostport] ',
'Run in debug mode (with --inspect flag).',
)
.option(
'--debug-brk [hostport] ',
'Run in debug mode (with --inspect-brk flag).',
)
.option('--webpack', 'Use webpack for compilation.')
.option('--webpackPath [path]', 'Path to webpack configuration.')
.option('--tsc', 'Use tsc for compilation.')
Expand Down