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

Assambar/47 ignore option #126

Merged
merged 8 commits into from
May 30, 2023
Merged

Assambar/47 ignore option #126

merged 8 commits into from
May 30, 2023

Conversation

assambar
Copy link
Contributor

@assambar assambar commented May 5, 2023

  • added --ignore option that accepts full glob patterns (one can exclude files as well as folders)
  • refactored router/files to remove dependency from Config, also added a few more unit tests

Here is an example run from the repo's main folder

alexandrov:~/work/wasm-workers-server 05.05 15:05:47\>target/debug/wws . --ignore "src/**/*;target/**/*;examples/**/*;docs/**/*;crates/**/*;kits/**/*"
⚙️  Loading routes from: .
🗺  Detected 4 routes:
    - http://127.0.0.1:8080/tests/data/params/sub/[id]
      => ./tests/data/params/sub/[id].wasm
    - http://127.0.0.1:8080/tests/data/params/fixed
      => ./tests/data/params/fixed.wasm
    - http://127.0.0.1:8080/tests/data/params/[id]
      => ./tests/data/params/[id].wasm
    - http://127.0.0.1:8080/tests/data/params/[id]/fixed
      => ./tests/data/params/[id]/fixed.wasm
🚀 Start serving requests at http://127.0.0.1:8080

alexandrov:~/work/wasm-workers-server 05.05 15:05:55target/debug/wws . --ignore "{src,target,examples,docs,crates,kits}/**/*;**/*fixed*"
⚙️  Loading routes from: .
🗺  Detected 2 routes:
    - http://127.0.0.1:8080/tests/data/params/sub/[id]
      => ./tests/data/params/sub/[id].wasm
    - http://127.0.0.1:8080/tests/data/params/[id]
      => ./tests/data/params/[id].wasm
🚀 Start serving requests at http://127.0.0.1:8080

It closes #47. It closes #103

@assambar assambar requested review from Angelmmiguel and ereslibre May 5, 2023 12:42
@assambar assambar marked this pull request as ready for review May 5, 2023 12:42
Copy link
Contributor

@Angelmmiguel Angelmmiguel left a comment

Choose a reason for hiding this comment

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

The overall changes LGTM. The refactor and new tests are great 😄. I added a few minor comments.

Thank you!

crates/router/src/files.rs Outdated Show resolved Hide resolved
crates/router/src/files.rs Outdated Show resolved Hide resolved
crates/router/src/files.rs Show resolved Hide resolved
crates/router/src/files.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@ereslibre ereslibre left a comment

Choose a reason for hiding this comment

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

LGTM besides @Angelmmiguel comments, neat contribution!

crates/router/src/files.rs Outdated Show resolved Hide resolved
crates/router/src/files.rs Outdated Show resolved Hide resolved
@Angelmmiguel
Copy link
Contributor

@assambar thank you for the update! Please, rebase the changes from main as you would need to configure the new source in the deny.toml file. Here you have some documentation about it: https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html.

assambar added 8 commits May 26, 2023 17:34
```
$$ target/debug/wws . --ignore 'src/**/*' --ignore 'target/**/*' --ignore 'docs/**/*' --ignore 'crates/**/*' | ts

May 26 08:49:33 ⚙️  Loading routes from: .
May 26 08:49:35 ⏳ Loading workers from 14 routes...
May 26 08:50:13 ✅ Workers loaded in 38.128146575s.
...
```
@assambar assambar force-pushed the assambar/47-ignore-option branch from 4449258 to ce0d458 Compare May 26, 2023 14:52
Copy link
Contributor

@Angelmmiguel Angelmmiguel left a comment

Choose a reason for hiding this comment

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

LGTM! Amazing contribution 😄

@assambar assambar merged commit 5098fa8 into main May 30, 2023
@assambar assambar deleted the assambar/47-ignore-option branch May 30, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants