Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(task): --recursive option not working #27183

Merged
merged 8 commits into from
Dec 5, 2024
Merged

Conversation

marvinhagemeister
Copy link
Contributor

@marvinhagemeister marvinhagemeister commented Dec 1, 2024

We didn't handle the --recursive option properly in deno task. This PR addresses that.

Fixes #27174

@marvinhagemeister marvinhagemeister marked this pull request as ready for review December 4, 2024 15:31
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still doesn't seem to work correctly, I have a repo like this:

- client/
   - deno.json
   - main.ts
- server/
   - deno.json
   - main.ts
- deno.json

Both client and server have a single dev task that runs deno run ./main.ts in respective packages. The root deno.json is:

{
    "workspace": [
        "./client", "./server"
    ]
}

then running:

../deno/target/debug/deno task --recursive dev
No matching task or script 'dev' found in selected packages.

or

../deno/target/debug/deno task --recursive --filter "*" dev
No matching task or script 'dev' found in selected packages.

./deno/target/debug/deno task --recursive --filter "client" dev
No matching task or script 'dev' found in selected packages.

@marvinhagemeister
Copy link
Contributor Author

Good point, missed that case when the deno.json has no package name.

@bartlomieju
Copy link
Member

@marvinhagemeister so now this works, but I think there's still some problems.

This looks okay, but maybe in a follow up we could improve the output to show tasks from workspace members?

../deno/target/debug/deno task
Available tasks:
  No tasks found in configuration file

This works fine:

Task dev deno run ./main.ts
Hello from client
Task dev deno run ./main.ts
Building server
Server finished

This seems to ignore the --filter argument:

../deno/target/debug/deno task --recursive --filter "client" dev
Task dev deno run ./main.ts
Hello from client
Task dev deno run ./main.ts
Building server
Server finished

../deno/target/debug/deno task --recursive --filter "./client" dev
Task dev deno run ./main.ts
Hello from client
Task dev deno run ./main.ts
Building server
Server finished

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that it now works correctly. LGTM

@marvinhagemeister marvinhagemeister merged commit f098dd0 into main Dec 5, 2024
17 checks passed
@marvinhagemeister marvinhagemeister deleted the fix-task-recursive branch December 5, 2024 18:00
bartlomieju pushed a commit that referenced this pull request Dec 5, 2024
We didn't handle the `--recursive` option properly in `deno task`. This
PR addresses that.

Fixes #27174
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 CLI fails to run recursive tasks
2 participants