Repository navigation
feat!: migrate debugger to js-debug and modernize tooling - #301
Merged
Merged
Conversation
Inline debug adapter starts ns debug, reads the debug port from CLI output and attaches VS Code's built-in JavaScript debugger (pwa-node) over WebSocket. DebugManager reattaches the child session on LiveSync restarts. Also: engine ^1.109, strict TS targeting es2022, prettier, nsPath setting, modern launch/tasks configs.
…me and Vite
Debugging
- Each debug session owns its ns process; the Run command no longer kills it.
- Stopping during the build or iOS team picker no longer leaks the ns process.
- Child js-debug sessions are matched via a parent id in their config instead of
activeDebugSession; orphaned children started after a stop are stopped.
- Wait up to 60s for the app to reconnect after a LiveSync restart drops the socket.
- Fail the session with an error when the initial attach fails.
- Register the debug adapter before checking the CLI; CLI check is async and
honors nativescript.nsPath.
- Remove supportsRestartRequest so Restart relaunches the session.
- Source maps: allow any map location (inline, device file://, nsruntime://) and
add fallbacks mapping device paths to the local platforms/ copy.
- Read webpack output settings out of process, only when customized.
- Vite: debug with --no-hmr; refuse launchTests for Vitest projects.
Manifest
- Debugger schema: add address, resolveSourceMapLocations, skipFiles,
smartStep, trace; drop tnsOutput/noDebug; use ${workspaceFolder}.
- @types/vscode pinned to engines (~1.109); min CLI 8.0.0.
Analytics
- Replace universal-analytics with the GA4 Measurement Protocol (same approach
as the CLI); config injected at package time; respects VS Code telemetry.
Tooling
- TypeScript 6.0, ESLint flat config with typescript-eslint, Vitest replacing
mocha/sinon, prettier checks; drop tslint, lodash, uuid, cpx, proxyquire.
- GitHub Actions CI: lint, format, typecheck, test, package and upload the vsix.
…Path - Children are started with lifecycleManagedByParent, so vscode.debug.stopDebugging(child) is routed to the NativeScript parent and ended the whole session (e.g. replacing the child on a LiveSync restart) while never stopping the child itself. Detach children with a DAP disconnect sent straight to js-debug instead. - Wait for the ns process to exit (SIGKILL after 5s) before answering terminate/disconnect and before reporting self-termination, so Restart can't overlap the old CLI. - Send TerminatedEvent at most once. - Resolve the iOS team picker when dismissed instead of hanging the session. - Android --debug-brk: don't announce a port that was never printed. - Activation CLI check resolves a relative nsPath against the workspace. - Keep nativescript.tnsPath as a deprecated fallback for nativescript.nsPath.
- release-please keeps a release PR with the version bump and a CHANGELOG generated from conventional commits since 0.12.5; merging it tags the release and publishes the stable .vsix. - Other pushes to master (and manual runs) publish a Marketplace pre-release numbered <major>.<minor>.<1000 + run>, plus a GitHub pre-release. - Publishing uses Marketplace Trusted Publishing (vsce publish --oidc) from the `release` environment and stays off until ENABLE_RELEASE is true. - Drop the hand-written Unreleased CHANGELOG section; document the process in RELEASING.md. - Keep *.local.* and .env files out of the packaged extension.
- New launch attributes runtimeExecutable, runtimeArgs, cwd and env (js-debug naming). With runtimeExecutable set the command runs exactly as given, e.g. `npx nx debug my-app --platform=ios`; the extension adds no flags and only watches its output for the debug port. cwd and env also apply to plain ns. - Without nativescript.nsPath, use node_modules/.bin/ns from the app or any parent folder before falling back to the global ns. - Start commands in their own process group and signal the whole group, so Stop/Restart reach wrapped CLIs (npx -> nx -> ns -> bundler). - Quote arguments for the shell, including zsh's leading `=`. - Move the shared debug/attach command building into Project.
edusperoni
marked this pull request as ready for review
November 9, 2026 17:15
edusperoni
added a commit
that referenced
this pull request
Nov 9, 2026
BREAKING CHANGE: requires VS Code 1.109+ and NativeScript CLI 8.0+; the tnsOutput and noDebug launch attributes were removed. feat: reattach the debugger automatically when the app restarts feat: load source maps from inline data:, the runtime's nsruntime:// scheme, or the local platforms/ copy feat: support Vite projects (debug sessions run with --no-hmr) feat: custom launch commands (runtimeExecutable, runtimeArgs, cwd, env) feat: use a project-local ns CLI before the global one feat: new launch attributes address, resolveSourceMapLocations, skipFiles, smartStep and trace feat: nativescript.nsPath setting; tnsPath is deprecated fix: no ns process is left running when a session stops during the build fix: the Run command no longer kills a debug session's ns process fix: Restart relaunches the session after the old CLI exits fix: show an error instead of failing to activate without the CLI
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernizes the extension around VS Code's built-in JavaScript debugger and fixes debug session lifecycle issues (restarts, stops, leaked
nsprocesses).Debugger
vscode-chrome-debug-corewith an inline debug adapter that runsns debugand attaches a js-debug (pwa-node) child session over the CLI's debug port.nsprocess. Stopping during the build or the iOS team picker no longer leaks it, the Run command no longer kills a debug session's CLI, and Restart waits for the old CLI to exit.disconnectsent straight to js-debug.vscode.debug.stopDebugging(child)is routed to the parent forlifecycleManagedByParentchildren, so calling it ended the whole session.Source maps
resolveSourceMapLocations: null): inlinedata:, devicefile://paths, andnsruntime://URLs that newer runtimes serve throughNetwork.loadNetworkResource./app/...on iOS,/data/*/files/app/...on Android) to the localplatforms/copy, for older runtimes.webpack.config.jsis evaluated in a separate process, and only when it setsdevtoolNamespace/library.Vite
--no-hmr, because HMR serves app code without source maps. Pass--hmrintnsArgsto opt out.launchTestsis refused for Vitest projects, since the CLI doesn't support debugging them.Settings / manifest
address,resolveSourceMapLocations,skipFiles,smartStep,trace.tnsOutputandnoDebug.diagnosticLoggingis deprecated in favor oftrace.nativescript.nsPathsetting.nativescript.tnsPathis deprecated but still honored whennsPathisn't set.Analytics
universal-analytics(shut down) is replaced with the GA4 Measurement Protocol, the same approach as the CLI.GA_MEASUREMENT_ID/GA_API_SECRETare set at packaging time, and only if the user opted in and VS Code telemetry is on. Without them nothing is sent, which matches the current published extension.Tooling
.vsixas an artifact. Actions are pinned to commit SHAs.Not done yet
Testing
Unit tests, lint, typecheck and
vsce packagepass locally. Not yet tested on a device or simulator. Before merging:nsruntime://maps (new runtimes),file://device maps (older runtimes), a Vite projectnsprocess or orphaned js-debug session behind