Commit graph

67 commits

Author SHA1 Message Date
Brian Donovan
a025617db3
refactor(cli): use more semantic Instant::elapsed (#1307)
Plus, one of these was incorrectly subtracting the end time from the start time.
2023-08-07 11:08:51 -05:00
Jonathan Kelley
56c3dcc437
Merge pull request #1301 from eventualbuddha/chore/cli/remove-unused-fn
chore(cli): remove unused function
2023-08-06 23:09:28 -07:00
Brian Donovan
03e02591ec
fix(cli): allows extracting files without separate directory entries
Some zip files do not list directories separately from files. For example, a zip might contain `dir/file.txt` without a corresponding entry for just `dir/`. This should be okay, so we just create the leading paths for the files we extract as necessary.

Also adds tests for the expected and dangerous path cases of `extract_zip`.
2023-08-04 21:28:09 -07:00
Brian Donovan
14e7c50478
fix(cli): prevent "zip slip" vulnerability in tool extract
Using the name directly from a zip archive's entry and writing to it is a potential security vulnerability. More information about the vulnerability can be found here: https://security.snyk.io/research/zip-slip-vulnerability and here https://docs.rs/zip/latest/zip/read/struct.ZipFile.html#warnings.

It looks like the previous version maybe tried to remove `\` characters to prevent this, but only in directory paths?
2023-08-04 20:02:07 -07:00
Brian Donovan
7a7397bbb4
chore(cli): remove unused module (#1302)
It seems this was replaced by the `plugin.rs` module in 6cce4b9f4d.
2023-08-04 17:01:04 -05:00
Brian Donovan
a77ff1c820
docs(cli): update subcommand comments (#1303)
A bunch of these were copy-pasted from `build`. This commit updates them to be the same as what their `dx help` string is.
2023-08-04 17:00:41 -05:00
Brian Donovan
5c62947835
refactor(cli): move check module alongside others (#1304)
There was no reason for `check` to be defined as `check/mod.rs` when all the others were at the top level e.g. `serve.rs`.
2023-08-04 17:00:19 -05:00
Brian Donovan
63bb5cc758
chore(cli): remove unused function
I believe that technically this function is part of the public API via `dioxus_cli::cli::cfg::parse_public_url`. However, I don't see any evidence that this function is actually used inside or outside this crate. The last use within the crate was removed in January 2022 (9bb10c65a3).
2023-08-04 13:52:49 -07:00
Brian Donovan
6d154b5072
Minor Proxy Improvements (#1289)
* fix(serve): provide a clear error with pathless proxy URLs

Without this, `dx serve` panics with this message:

```
Paths must start with a `/`. Use "/" for
 root routes
 ```

 That's not very clear. Instead, we can detect this situation and provide a better error message:

```
Error: 🚫 Serving project failed: Failed to establish proxy: Proxy backend URL must have a non-empty path, e.g. http://localhost:8080/api instead of http://localhost:8080
```

* docs(config): correct format for `web.proxy`
2023-08-04 13:44:56 -05:00
Brian Donovan
ab1d64bc4a
docs(cli): fix typo (#1294)
"tripple" should be "triple".
2023-08-04 12:49:31 -05:00
Jonathan Kelley
39e89c1fac
Bump crate versions, fix any publish errors 2023-07-31 18:49:54 -07:00
Jonathan Kelley
8a875acdd2
Adjust versions, add authors, move server macro to top level 2023-07-31 17:59:36 -07:00
Jonathan Kelley
418c03e2cd
Merge pull request #1252 from Demonthos/non-generic-link
Remove autogenerated functions/components from the routable macro
2023-07-26 18:11:32 -07:00
Evan Almloff
7bf0926938 use tauri bundle 1.2 2023-07-26 12:53:00 -07:00
Evan Almloff
489338d642 create cli bundle command 2023-07-26 12:40:50 -07:00
Evan Almloff
e7a9161066 fix link component 2023-07-26 10:18:39 -07:00
Jonathan Kelley
6751d5941b
Merge pull request #1215 from eventualbuddha/feat/check/rules-of-hooks
feat(check): adds `dx check`
2023-07-25 11:57:02 -07:00
Brian Donovan
dc7e1a5f13
docs(clean): fix copy-paste docs from build (#1240) 2023-07-24 11:32:13 -05:00
Brian Donovan
420bc39ecc
docs(cli): re-sync dx --help output 2023-07-23 18:57:23 -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
Jonathan Kelley
91d4207fa7
Merge branch 'master' into feature/use-shared-state-better-diagnostics 2023-07-20 10:51:10 -07:00
Jonathan Kelley
f0289068a2
Merge pull request #1219 from Demonthos/improve-build-times
Halve Build Times
2023-07-20 10:50:15 -07:00
Andrea Frigido
dccad58f1d Update license field following SPDX 2.1 license expression standard 2023-07-20 18:00:07 +01:00
Evan Almloff
beb56b93a0 more clippy fixes 2023-07-20 09:06:12 -07:00
Jonathan Kelley
1ed277154a
Merge pull request #1210 from Demonthos/desktop-serve-cli
Move desktop hot reload into the CLI
2023-07-19 19:48:09 -07:00
Evan Almloff
b6ea722d94 fix some edge cases around multiline attributes 2023-07-19 16:59:20 -07:00
Jonathan Kelley
90d23714da
Fix clippy around pathbuf 2023-07-19 13:44:38 -07:00
Jonathan Kelley
9185afdba8
Merge branch 'master' into desktop-serve-cli 2023-07-19 13:33:02 -07:00
Evan Almloff
3d8d8a1b6f half-build-times 2023-07-19 10:19:23 -07:00
Jonathan Kelley
31a68a9743
Rename dioxus to dx 2023-07-18 18:33:14 -07:00
Jonathan Kelley
cd30b42e2d
Merge branch 'master' into jk/remove-dioxus-bin 2023-07-18 18:31:48 -07:00
Evan Almloff
f3b3c0698b fix clippy 2023-07-18 12:43:02 -07:00
Evan Almloff
4a0869de7b cargo fix 2023-07-18 12:41:48 -07:00
Evan Almloff
98e2b4acbd fix normal desktop serve 2023-07-18 12:40:47 -07:00
Evan Almloff
2c1c147828 fix desktop hot reloading 2023-07-18 11:55:56 -07:00
Evan Almloff
0c5025ffa0 WIP desktop serve hot reload 2023-07-18 10:24:29 -07:00
Evan Almloff
f2c4233ef4 Merge branch 'master' into router-typesafe 2023-07-17 17:24:42 -07:00
Miles Murgaw
056effb87c feat: --bin docs 2023-07-17 18:24:03 -04:00
Evan Almloff
7453486448 fix formatting 2023-07-17 15:12:57 -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
Miles Murgaw
41fd7a1040 feat: bin flag for serve and build 2023-07-14 20:06:54 -04:00
Miles Murgaw
9d259b6073 revision: remove nestedness 2023-07-14 18:30:27 -04:00
Jonathan Kelley
9d2b44aa0f
Merge branch 'master' into feature/use-shared-state-better-diagnostics 2023-07-14 15:07:53 -07:00
Jonathan Kelley
df23c3c651
Update more docs 2023-07-14 13:58:49 -07:00
Jonathan Kelley
16763c065b
Rename dioxus to dx in examples and fullstack 2023-07-14 13:53:06 -07:00
Jonathan Kelley
d27af03e3f
Remove the dioxus bin from the cli 2023-07-14 13:52:54 -07:00
Miles Murgaw
120fccc53d fix: full & hot reload 2023-07-12 02:09:13 -04:00