Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

"deno task" should support JSDoc as task description #22786

Closed
bartlomieju opened this issue Mar 8, 2024 · 1 comment · Fixed by #23101
Closed

"deno task" should support JSDoc as task description #22786

bartlomieju opened this issue Mar 8, 2024 · 1 comment · Fixed by #23101
Labels
suggestion suggestions for new features (yet to be agreed) task runner related to deno task

Comments

@bartlomieju
Copy link
Member

It would be tremendously helpful if we could support this:

// deno.jsonc
{
  "tasks": {
    // Run a dev server
    "dev": "deno run ...",

    // Generate a new subcommand
    "cmd:generate": "deno run ...",
    
    // Some other comment, Lorem ipsum dolor sit amet, consectetur adipiscing 
    // elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
    // Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi 
    // ut aliquip ex ea commodo consequat.
    "cmd:update": "deno run ...",
  }
}

Currently deno task would output:

Available tasks:
- dev
    deno run ...
- cmd:generate
    deno run ...
- cmd:update
    deno run ...

But it could output:

Available tasks:
- dev
    // Run a dev server
    deno run ...

- cmd:generate
    // Generate a new subcommand
    deno run ...

- cmd:update
    // Some other comment, Lorem ipsum dolor sit amet, consectetur adipiscing 
    // elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
    // Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi 
    // ut aliquip ex ea commodo consequat.
    deno run ...

This would make discoverability in new projects a lot better and make coming to an older project a breeze.

@bartlomieju bartlomieju added suggestion suggestions for new features (yet to be agreed) task runner related to deno task labels Mar 8, 2024
@dsherret
Copy link
Member

dsherret commented Mar 8, 2024

Previous discussion on a similar proposal: #14949

nathanwhit added a commit that referenced this issue Mar 27, 2024
Closes #22786.

TLDR;
```jsonc
{
  "tasks": {
    // Some comment
    //
    // describing what the task does
    "dev": "deno run -A --watch main.ts"
  }
}
```
```bash
deno task
```
![Screenshot 2024-03-27 at 1 43
49 PM](https://github.com/denoland/deno/assets/17734409/7a14da8c-8e63-45ba-9bfb-590d250b56a9)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
suggestion suggestions for new features (yet to be agreed) task runner related to deno task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants