fix(desktop): discover deno.json in the project dir for deno desktop .#35660
Merged
Merged
Conversation
`deno desktop .` uses "." as the entrypoint to trigger framework detection on the current directory. Config discovery shared the run/compile logic which pops the entrypoint's last path component to get its containing directory — correct for a file entrypoint, but for "." it moved up to the project's parent, so the project's deno.json (and its `desktop` config block) was never found. Output dir, app name/window title, etc. were all silently ignored. Give the desktop subcommand its own discovery arm: use the entrypoint directly when it's a directory, only pop when it's a file. Closes denoland#35653
littledivy
approved these changes
Jul 1, 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.
Fixes #35653.
Problem
deno desktop .(and baredeno desktop) silently ignored thedesktopconfig block in the project'sdeno.json: the build went to the default output directory instead of the configuredoutput, the window kept the default title instead ofapp.name, etc.Root cause
The
desktopsubcommand shared its config-file discovery logic withrun/compileinFlags::config_path_args. That code resolves the entrypoint and then pops the last path component to get the containing directory — correct when the entrypoint is a file likemain.ts.But
deno desktop .uses"."as the entrypoint to trigger framework detection on the current directory. Resolving"."yields the project directory, and popping then moved up to its parent — so config discovery started one level above the project and never found itsdeno.json.Fix
Give the
desktopsubcommand its own discovery arm: when the resolved entrypoint is a directory (thedeno desktop ./ baredeno desktopcase), use it directly as the config-discovery start dir; only pop to the parent when the entrypoint is an actual file.run/compilebehavior is unchanged.Added unit tests covering
deno desktop ., baredeno desktop, anddeno desktop sub/main.ts.