diff --git a/CHANGELOG.md b/CHANGELOG.md index f4172bda3..c9140a166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Update `recommendedEdition` in `edition.ts to `edition-store@5.x` + - Make Chrome debugger an opt-in instead of a default open port. ## [3.0.0] - 2021-10-20 diff --git a/src/api/clients/IOClients/infra/Runtime.ts b/src/api/clients/IOClients/infra/Runtime.ts index b81d4176e..db2f6f423 100644 --- a/src/api/clients/IOClients/infra/Runtime.ts +++ b/src/api/clients/IOClients/infra/Runtime.ts @@ -24,7 +24,7 @@ export class Runtime { } public async debugDotnetApp(appName: string, appVendor: string, appMajor: string, debugInst: string) { - const host = 'app.io.vtex.com' + const host = 'ws.io.vtex.com' const path = `/${appVendor}.${appName}/v${appMajor}/${this.account}/${this.workspace}/_debug/dotnet` const clusterHeader = cluster() ? { [Headers.VTEX_UPSTREAM_TARGET]: cluster() } : null diff --git a/src/api/modules/workspace/common/edition.ts b/src/api/modules/workspace/common/edition.ts index 477f1809d..41ca55a0f 100644 --- a/src/api/modules/workspace/common/edition.ts +++ b/src/api/modules/workspace/common/edition.ts @@ -33,7 +33,11 @@ const promptSwitchEdition = (currEditionId: string) => { recommendedEdition )}.` ) - log.warn(`For more information about editions, check ${chalk.blue('https://developers.vtex.com/vtex-developer-docs/docs/vtex-io-documentation-edition-app')}`) + log.warn( + `For more information about editions, check ${chalk.blue( + 'https://developers.vtex.com/vtex-developer-docs/docs/vtex-io-documentation-edition-app' + )}` + ) return promptConfirm(`Would you like to change the edition to ${chalk.blue(recommendedEdition)} now?`, false) } diff --git a/src/commands/link.ts b/src/commands/link.ts index 89a22cee4..c69dbe93d 100644 --- a/src/commands/link.ts +++ b/src/commands/link.ts @@ -39,6 +39,11 @@ export default class Link extends CustomCommand { description: 'Allows linking the app despite Typescript errors.', default: false, }), + 'with-debugger': oclifFlags.boolean({ + char: 'd', + description: 'Start the chrome debugger tunnel after the app is linked.', + default: false, + }), workspace: oclifFlags.string({ char: 'w', description: `Starts a development session in the specified ${ColorifyConstants.ID( @@ -54,10 +59,8 @@ export default class Link extends CustomCommand { async run() { const { - flags, - flags: { account, setup, clean, unsafe, workspace }, + flags: { account, setup, clean, unsafe, workspace, 'no-watch': noWatch, 'with-debugger': withDebugger }, } = this.parse(Link) - const noWatch = flags['no-watch'] - await appLink({ account, workspace, setup, clean, unsafe, noWatch }) + await appLink({ account, workspace, setup, clean, unsafe, noWatch, withDebugger }) } } diff --git a/src/modules/apps/debugger.ts b/src/modules/apps/debugger.ts index de5efbfe9..43a1081e0 100644 --- a/src/modules/apps/debugger.ts +++ b/src/modules/apps/debugger.ts @@ -108,7 +108,7 @@ export default function startDebuggerTunnel( const { account, workspace } = SessionManager.getSingleton() const appMajor = versionMajor(version) - const host = 'app.io.vtex.com' + const host = 'ws.io.vtex.com' const path = `/${vendor}.${name}/v${appMajor}/${account}/${workspace}/_debug/attach` return new Promise((resolve, reject) => { diff --git a/src/modules/apps/link.ts b/src/modules/apps/link.ts index d37978007..dfc03021a 100644 --- a/src/modules/apps/link.ts +++ b/src/modules/apps/link.ts @@ -54,6 +54,7 @@ interface LinkOptions { clean?: boolean setup?: boolean noWatch?: boolean + withDebugger?: boolean } const DELETE_SIGN = chalk.red('D') @@ -319,6 +320,10 @@ export async function appLink(options: LinkOptions) { if (debuggerStarted) { return } + if (!options.withDebugger) { + log.info('Debugger flag not set. To open a chrome debugger server, link your app using the --with-debugger flag.') + return + } const startDebugger = async () => { const port = await startDebuggerTunnel(manifest) if (!port) {