Skip to content

Commit

Permalink
Ignore merto config verification for expo application (#2040)
Browse files Browse the repository at this point in the history
  • Loading branch information
EzioLi01 committed Sep 20, 2023
1 parent 348153c commit 4ccd0d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/debugger/direct/directDebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { RNSession } from "../debugSessionWrapper";
import { SettingsHelper } from "../../extension/settingsHelper";
import { ReactNativeProjectHelper } from "../../common/reactNativeProjectHelper";
import { IWDPHelper } from "./IWDPHelper";
import { ExponentHelper } from "../../extension/exponent/exponentHelper";

nls.config({
messageFormat: nls.MessageFormat.bundle,
Expand Down Expand Up @@ -79,7 +80,9 @@ export class DirectDebugSession extends DebugSessionBase {

try {
try {
await ReactNativeProjectHelper.verifyMetroConfigFile(launchArgs.cwd);
if (launchArgs.platform != "exponent") {
await ReactNativeProjectHelper.verifyMetroConfigFile(launchArgs.cwd);
}
await this.initializeSettings(launchArgs);
logger.log("Launching the application");
logger.verbose(`Launching the application: ${JSON.stringify(launchArgs, null, 2)}`);
Expand Down Expand Up @@ -142,7 +145,11 @@ export class DirectDebugSession extends DebugSessionBase {

try {
if (attachArgs.request === "attach") {
await ReactNativeProjectHelper.verifyMetroConfigFile(attachArgs.cwd);
const expoHelper = new ExponentHelper(attachArgs.cwd, attachArgs.cwd);
const isExpo = await expoHelper.isExpoManagedApp(true);
if (!isExpo) {
await ReactNativeProjectHelper.verifyMetroConfigFile(attachArgs.cwd);
}
}
await this.initializeSettings(attachArgs);

Expand Down
11 changes: 9 additions & 2 deletions src/debugger/rnDebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from "./debugSessionBase";
import { JsDebugConfigAdapter } from "./jsDebugConfigAdapter";
import { RNSession } from "./debugSessionWrapper";
import { ExponentHelper } from "../extension/exponent/exponentHelper";

nls.config({
messageFormat: nls.MessageFormat.bundle,
Expand Down Expand Up @@ -57,7 +58,9 @@ export class RNDebugSession extends DebugSessionBase {
): Promise<void> {
try {
try {
await ReactNativeProjectHelper.verifyMetroConfigFile(launchArgs.cwd);
if (launchArgs.platform != "exponent") {
await ReactNativeProjectHelper.verifyMetroConfigFile(launchArgs.cwd);
}
await this.initializeSettings(launchArgs);
logger.log("Launching the application");
logger.verbose(`Launching the application: ${JSON.stringify(launchArgs, null, 2)}`);
Expand Down Expand Up @@ -101,7 +104,11 @@ export class RNDebugSession extends DebugSessionBase {
return new Promise<void>(async (resolve, reject) => {
try {
if (attachArgs.request === "attach") {
await ReactNativeProjectHelper.verifyMetroConfigFile(attachArgs.cwd);
const expoHelper = new ExponentHelper(attachArgs.cwd, attachArgs.cwd);
const isExpo = await expoHelper.isExpoManagedApp(true);
if (!isExpo) {
await ReactNativeProjectHelper.verifyMetroConfigFile(attachArgs.cwd);
}
}
await this.initializeSettings(attachArgs);
logger.log("Attaching to the application");
Expand Down

0 comments on commit 4ccd0d6

Please sign in to comment.