Commit Graph
10 Commits
Author SHA1 Message Date
YuKun Liu 695bf009d1 fix: dx create not work (#1709) 2023-12-11 13:27:55 -06:00
Raman Hafiyatulin 098689083d Related to #1547: use dioxus-cli within a workspace (wildcard-members, real package names) (#1642)
* Related to #1547: use `dioxus-cli` within a workspace

Although the `dx` CLI allows to specify a package name to chose from workspace members,
it does not support workspace members specified as glob-wildcards.
Neither it respects the effective package name, specified in the crate's `Cargo.toml`.

This PR addresses that issue:
- upon `dx build ...`, if the `--bin` CLI-argument is provided, treat the current dir as a workspace;
- search through the workspace's `members`: resolve each of them with `glob`;
- assume that any workspace member has a `Cargo.toml` in it (cargo does it, so it's okay);
- read said manifest, and check the package name in it;
- if found — there we have our sought package.

* Use cargo-metadata to find out the workspace structure

* glob is unused
2023-11-15 15:14:16 -06:00
Evan Almloff 489338d642 create cli bundle command 2023-07-26 12:40:50 -07:00
Brian Donovan 2c2534d1cc feat(check): adds dx check
At the moment this only checks the Rules of Hooks, ensuring that hook functions (i.e. `use_*`) are being called as expected.

https://dioxuslabs.com/docs/0.3/guide/en/interactivity/hooks.html

Closes #1202
2023-07-23 16:06:55 -07:00
Miles Murgaw 4b70b1ce96 revision: find bin from workspace Cargo.toml 2023-07-17 14:30:05 -04:00
Miles Murgaw 9fab3cf4e3 Merge branch 'master' into cli-stuff 2023-07-15 12:40:23 -04:00
Brian Donovan 9cef71b6b9 fix(cli): improve error message for invalid config (#1200)
Previously an invalid `Dioxus.toml` file would yield this error when running e.g. `dx serve`:

```
Error: Failed to load `Dioxus.toml` because: Dioxus.toml parse failed
```

This doesn't give any indication why it failed to parse. This commit updates it to include why the parsing failed, e.g.:

```
Error: Failed to load Dioxus config because: Dioxus.toml missing field `name` for key `application` at line 38 column 1
```

I initially had it format the message to include `Dioxus.toml:38:1` to be clickable in some terminals, but the location specified didn't always seem particularly relevant to the actual problem so I left it as-is.

This also fixes what I believe would be an issue on case-sensitive file systems where if `dioxus.toml` existed it would try to read `Dioxus.toml`.

I'm still fairly new to Rust, so the `.as_path()` calls may not be the best way to deal with the fact that the borrow checker wouldn't let me re-use `crate_dir` and `dioxus_conf_file`. I'm open to suggestions!
2023-07-15 11:13:22 -05:00
Miles Murgaw d710b92696 fix: do it correctly 2023-07-14 20:41:27 -04:00
Jonathan Kelley 3f74b10e7c Feat: add dx as a package and move plugin to feature 2023-07-07 18:17:42 -07:00
Jonathan Kelley a9d7b4d32a Prepare CLI for move into mainline 2023-06-28 17:21:23 -07:00