Skip to content

Commit 4814f9e

Browse files
authored
refactor: network impl & cli improvements (#3)
2 parents de58a71 + 84e023f commit 4814f9e

50 files changed

Lines changed: 6707 additions & 2578 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
## Description
2-
3-
<!-- Provide a brief description of the changes in this PR -->
4-
51
## Type of Change
62

73
<!-- Mark the relevant option with an "x" -->
@@ -13,73 +9,4 @@
139
- [ ] Performance improvement
1410
- [ ] Code refactoring (no functional changes)
1511

16-
## Related Issues
17-
18-
<!-- Link to related issues using "Fixes #123" or "Closes #123" -->
19-
20-
Fixes #
21-
22-
## Changes Made
23-
24-
<!-- List the specific changes made in this PR -->
25-
26-
-
27-
-
28-
-
29-
30-
## Testing
31-
32-
<!-- Describe the tests you ran and their results -->
33-
34-
- [ ] All existing tests pass
35-
- [ ] New tests added for new functionality
36-
- [ ] Manual testing performed
37-
- [ ] Tested on multiple platforms (Linux/macOS/Windows)
38-
39-
### Test Commands
40-
41-
```bash
42-
# Commands used to test the changes
43-
cargo test --all-features
44-
cargo fmt --all -- --check
45-
cargo clippy --all-targets --all-features -- -D warnings
46-
```
47-
48-
## Performance Impact
49-
50-
<!-- If applicable, describe any performance impact -->
51-
52-
- [ ] No performance impact
53-
- [ ] Performance improved
54-
- [ ] Performance impact acceptable for the feature
55-
- [ ] Performance benchmarks included
56-
57-
## Breaking Changes
58-
59-
<!-- If this is a breaking change, describe what breaks and how to migrate -->
60-
61-
## Documentation
62-
63-
- [ ] Documentation updated (if applicable)
64-
- [ ] README updated (if applicable)
65-
- [ ] Help text updated (if applicable)
66-
- [ ] Examples updated (if applicable)
67-
68-
## Checklist
69-
70-
- [ ] Code follows the project's style guidelines
71-
- [ ] Self-review of the code completed
72-
- [ ] Code is commented, particularly in hard-to-understand areas
73-
- [ ] Corresponding changes to documentation made
74-
- [ ] Changes generate no new warnings
75-
- [ ] New tests added that prove the fix is effective or the feature works
76-
- [ ] All new and existing tests pass locally
77-
- [ ] Any dependent changes have been merged
78-
79-
## Screenshots
80-
81-
<!-- If applicable, add screenshots to help explain your changes -->
82-
83-
## Additional Notes
84-
85-
<!-- Any additional information that reviewers should know -->
12+
## Description

.github/workflows/ci.yml

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
env:
1010
CARGO_TERM_COLOR: always
@@ -23,44 +23,44 @@ jobs:
2323
experimental: true
2424

2525
steps:
26-
- name: Checkout code
27-
uses: actions/checkout@v4
28-
29-
- name: Install Rust toolchain
30-
uses: dtolnay/rust-toolchain@master
31-
with:
32-
toolchain: ${{ matrix.rust }}
33-
components: rustfmt, clippy
34-
35-
- name: Cache dependencies
36-
uses: actions/cache@v3
37-
with:
38-
path: |
39-
~/.cargo/registry
40-
~/.cargo/git
41-
target
42-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
43-
44-
- name: Run clippy
45-
run: cargo clippy --all-features
46-
47-
- name: Run tests
48-
run: cargo test --all-features
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Install Rust toolchain
30+
uses: dtolnay/rust-toolchain@master
31+
with:
32+
toolchain: ${{ matrix.rust }}
33+
components: rustfmt, clippy
34+
35+
- name: Cache dependencies
36+
uses: actions/cache@v3
37+
with:
38+
path: |
39+
~/.cargo/registry
40+
~/.cargo/git
41+
target
42+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
43+
44+
- name: Run clippy
45+
run: cargo clippy --all-features
46+
47+
- name: Run tests
48+
run: cargo test --all-features
4949
security:
5050
name: Security Audit
5151
runs-on: ubuntu-latest
5252
steps:
53-
- name: Checkout code
54-
uses: actions/checkout@v4
55-
56-
- name: Install Rust toolchain
57-
uses: dtolnay/rust-toolchain@stable
53+
- name: Checkout code
54+
uses: actions/checkout@v4
5855

59-
- name: Install cargo-audit
60-
run: cargo install cargo-audit
56+
- name: Install Rust toolchain
57+
uses: dtolnay/rust-toolchain@stable
6158

62-
- name: Run security audit
63-
run: cargo audit
59+
- name: Install cargo-audit
60+
run: cargo install cargo-audit
61+
62+
- name: Run security audit
63+
run: cargo audit
6464

6565
build:
6666
name: Build Release
@@ -76,21 +76,21 @@ jobs:
7676
target: x86_64-apple-darwin
7777

7878
steps:
79-
- name: Checkout code
80-
uses: actions/checkout@v4
81-
82-
- name: Install Rust toolchain
83-
uses: dtolnay/rust-toolchain@stable
84-
with:
85-
targets: ${{ matrix.target }}
86-
87-
- name: Build release
88-
run: cargo build --release --target ${{ matrix.target }}
89-
90-
- name: Upload binary
91-
uses: actions/upload-artifact@v4
92-
with:
93-
name: bradar-${{ matrix.target }}
94-
path: |
95-
target/${{ matrix.target }}/release/bradar*
96-
!target/${{ matrix.target }}/release/bradar.d
79+
- name: Checkout code
80+
uses: actions/checkout@v4
81+
82+
- name: Install Rust toolchain
83+
uses: dtolnay/rust-toolchain@stable
84+
with:
85+
targets: ${{ matrix.target }}
86+
87+
- name: Build release
88+
run: cargo build --release --target ${{ matrix.target }}
89+
90+
- name: Upload binary
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: bradar-${{ matrix.target }}
94+
path: |
95+
target/${{ matrix.target }}/release/bradar*
96+
!target/${{ matrix.target }}/release/bradar.d

.github/workflows/release.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77

88
env:
99
CARGO_TERM_COLOR: always
@@ -40,50 +40,50 @@ jobs:
4040
binary_name: bradar
4141

4242
steps:
43-
- name: Checkout code
44-
uses: actions/checkout@v4
43+
- name: Checkout code
44+
uses: actions/checkout@v4
4545

46-
- name: Install Rust toolchain
47-
uses: dtolnay/rust-toolchain@stable
48-
with:
49-
targets: ${{ matrix.target }}
46+
- name: Install Rust toolchain
47+
uses: dtolnay/rust-toolchain@stable
48+
with:
49+
targets: ${{ matrix.target }}
5050

51-
- name: Install cross (for Linux ARM64)
52-
if: matrix.target == 'aarch64-unknown-linux-gnu'
53-
run: cargo install cross
51+
- name: Install cross (for Linux ARM64)
52+
if: matrix.target == 'aarch64-unknown-linux-gnu'
53+
run: cargo install cross
5454

55-
- name: Build release
56-
run: |
57-
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
58-
cross build --release --target ${{ matrix.target }}
59-
else
60-
cargo build --release --target ${{ matrix.target }}
61-
fi
62-
shell: bash
55+
- name: Build release
56+
run: |
57+
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
58+
cross build --release --target ${{ matrix.target }}
59+
else
60+
cargo build --release --target ${{ matrix.target }}
61+
fi
62+
shell: bash
6363

64-
- name: Rename binary for release
65-
run: |
66-
mkdir -p release-assets
67-
cp target/${{ matrix.target }}/release/${{ matrix.binary_name }} release-assets/${{ matrix.asset_name }}
68-
shell: bash
64+
- name: Rename binary for release
65+
run: |
66+
mkdir -p release-assets
67+
cp target/${{ matrix.target }}/release/${{ matrix.binary_name }} release-assets/${{ matrix.asset_name }}
68+
shell: bash
6969

70-
- name: Upload Release Asset
71-
uses: softprops/action-gh-release@v2
72-
with:
73-
files: release-assets/${{ matrix.asset_name }}
70+
- name: Upload Release Asset
71+
uses: softprops/action-gh-release@v2
72+
with:
73+
files: release-assets/${{ matrix.asset_name }}
7474

7575
publish-crate:
7676
name: Publish to crates.io
7777
needs: build-release
7878
runs-on: ubuntu-latest
7979
steps:
80-
- name: Checkout code
81-
uses: actions/checkout@v4
80+
- name: Checkout code
81+
uses: actions/checkout@v4
8282

83-
- name: Install Rust toolchain
84-
uses: dtolnay/rust-toolchain@stable
83+
- name: Install Rust toolchain
84+
uses: dtolnay/rust-toolchain@stable
8585

86-
- name: Publish to crates.io
87-
run: cargo publish
88-
env:
89-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
86+
- name: Publish to crates.io
87+
run: cargo publish
88+
env:
89+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ pkg/
1010

1111
node_modules/
1212
wasm/node_modules/
13-
server/.wrangler/
14-
server/node_modules/
13+
worker/.wrangler/
14+
worker/node_modules/

0 commit comments

Comments
 (0)