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(workspace): support wildcard packages #26568

Merged
merged 5 commits into from
Nov 4, 2024

Conversation

bartlomieju
Copy link
Member

This commit adds support for wildcard packages in workspace
configuration option in deno.json. This is now supported:

{
  "workspace": [
    "./packages/*"
  ]
}

Closes #25783

@bartlomieju
Copy link
Member Author

This probably doesn't solve the linked issue.

$ git clone [email protected]:histoire-dev/histoire.git
$ cd histoire
# migrate pnpm-workspace.yaml to deno.json
$ cat deno.json
{
    "workspace": [
        "packages/*",
        "examples/*",
        "docs"
    ]
}
$ ../deno/target/debug/deno install --allow-scripts
Warning The following packages are deprecated:
┠─ npm:[email protected] (Rimraf versions prior to v4 are no longer supported)
┠─ npm:[email protected] (Glob versions prior to v9 are no longer supported)
┖─ npm:[email protected] (This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.)
$ cd examples/vue2
$ ../../../deno/target/debug/deno install --allow-scripts
error: Config file must be a member of the workspace.
  Config: file:///Users/ib/dev/histoire/examples/vue2/package.json
  Workspace: file:///Users/ib/dev/histoire/

It appears the current change doesn't cover a mixes deno/npm members.

@dsherret could you advise?

@bartlomieju bartlomieju changed the title Workspace wildcard fix(workspace): support wildcard packages Oct 26, 2024
@dsherret
Copy link
Member

Can you add a failing test to this pr to demonstrate what you mean?

@dsherret
Copy link
Member

Or actually, adding one to deno_config would be better.

@bartlomieju
Copy link
Member Author

@dsherret sure, opened a PR with a test here: denoland/deno_config#132

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM.

To save on CI time you may want to consider deleting the test in favour of the one in deno_config (maybe)

@bartlomieju
Copy link
Member Author

To save on CI time you may want to consider deleting the test in favour of the one in deno_config (maybe)

I prefer to have end-to-end test for execution.

@bartlomieju bartlomieju merged commit 0515521 into denoland:main Nov 4, 2024
17 checks passed
@bartlomieju bartlomieju deleted the workspace_wildcard branch November 4, 2024 23:42
bartlomieju added a commit that referenced this pull request Nov 5, 2024
This commit adds support for wildcard packages in `workspace`
configuration option in `deno.json`. This is now supported:
```
{
  "workspace": [
    "./packages/*"
  ]
}
```

Closes #25783
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.json(workspace): allow wildcard ["packages/*"]
2 participants