Skip to content

fix(desktop): discover deno.json in the project dir for deno desktop .#35660

Merged
crowlKats merged 1 commit into
denoland:mainfrom
crowlKats:fix/desktop-config-discovery
Jul 1, 2026
Merged

fix(desktop): discover deno.json in the project dir for deno desktop .#35660
crowlKats merged 1 commit into
denoland:mainfrom
crowlKats:fix/desktop-config-discovery

Conversation

@crowlKats

Copy link
Copy Markdown
Member

Fixes #35653.

Problem

deno desktop . (and bare deno desktop) silently ignored the desktop config block in the project's deno.json: the build went to the default output directory instead of the configured output, the window kept the default title instead of app.name, etc.

Root cause

The desktop subcommand shared its config-file discovery logic with run/compile in Flags::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 like main.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 its deno.json.

Fix

Give the desktop subcommand its own discovery arm: when the resolved entrypoint is a directory (the deno desktop . / bare deno desktop case), use it directly as the config-discovery start dir; only pop to the parent when the entrypoint is an actual file. run/compile behavior is unchanged.

Added unit tests covering deno desktop ., bare deno desktop, and deno desktop sub/main.ts.

`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
@crowlKats
crowlKats merged commit e2fedd4 into denoland:main Jul 1, 2026
135 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deno desktop seems to ignore deno.json in framework directory

2 participants