Skip to content

Commit 51d2171

Browse files
bitzoicmatt-user
andauthored
Reorganize project directories (#783)
## Type of change <!--Delete points that do not apply--> - Improvement (refactoring, restructuring repository, cleaning tech debt, ...) ## Changes The following changes have been made: Changes the project structure for all projects to: ``` My_app ├── src/ │ └────── main.tsx ├── app-contract │ ├────── src/main.sw │ └────── tests/harness.rs ├── package.json ├── index.html ├── README.md └── SPECIFICATION.md ``` This should allow for quicker access to the project's source code and not be buried in a million directories. ## Notes - Some projects such as TicTacToe/NFT have been removed from "games"/"native-assets" and moved into the parent directory - This may break any other open pull requests that depend on this project structure - Empty UI folders have been removed --------- Co-authored-by: Matt Auer <[email protected]>
1 parent 39d1907 commit 51d2171

File tree

701 files changed

+1264
-2400
lines changed

Some content is hidden

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

701 files changed

+1264
-2400
lines changed
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"./contracts/NFT-contract",
4+
"./template-contract",
55
]
6+
File renamed without changes.

.devops/.template/Forc.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[workspace]
2+
members = ["./template-contract"]

.devops/.template/README.md

+11-17

.devops/.template/project/Cargo.toml

-6
This file was deleted.

.devops/.template/project/Forc.toml

-2
This file was deleted.

.devops/.template/project/README.md

-3
This file was deleted.
File renamed without changes.

.devops/.template/project/contracts/template-contract/tests/utils/setup.rs .devops/.template/template-contract/tests/utils/setup.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use fuels::prelude::*;
22

33
abigen!(Contract(
44
name = "Template",
5-
abi = "./contracts/template-contract/out/debug/template-contract-abi.json"
5+
abi = "./template-contract/out/debug/template-contract-abi.json"
66
));
77

88
const TEMPLATE_CONTRACT_BINARY_PATH: &str = "./out/debug/template-contract.bin";

.devops/.template/ui/README.md

-13
This file was deleted.

.devops/.template/ui/app/.gitkeep

Whitespace-only changes.

.devops/.template/ui/config/chainConfig.json

-56
This file was deleted.

.devops/.template/ui/scripts/start_node.sh

-3
This file was deleted.

.devops/aurora/apps.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ AMM
22
DAO
33
OTC-swap-predicate
44
airdrop
5-
auctions/english-auction
5+
english-auction
66
counter-script
77
escrow
88
fundraiser
9-
games/TicTacToe
9+
TicTacToe
1010
multisig-wallet
1111
name-registry
12-
native-assets/NFT
13-
native-assets/native-asset
14-
native-assets/fractional-NFT
12+
NFT
13+
native-asset
14+
fractional-NFT
1515
oracle
1616
timelock

.devops/aurora/src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub(crate) fn repo_root() -> String {
4141

4242
pub(crate) fn project_path(app: String, root: String) -> anyhow::Result<PathBuf> {
4343
Ok(
44-
std::fs::canonicalize(format!("{}/{}/project", root, app)).map_err(|error| {
44+
std::fs::canonicalize(format!("{}/{}/", root, app)).map_err(|error| {
4545
anyhow!(
4646
"Failed to canonicalize path to project for app '{}': {}",
4747
app,

.github/workflows/ci.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ jobs:
4242
[
4343
"airdrop",
4444
"AMM",
45-
"auctions/english-auction",
45+
"english-auction",
4646
"counter-script",
4747
"DAO",
4848
"escrow",
4949
"fundraiser",
50-
"games/TicTacToe",
50+
"TicTacToe",
5151
"multisig-wallet",
5252
"name-registry",
53-
"native-assets/NFT",
54-
"native-assets/native-asset",
55-
"native-assets/fractional-NFT",
53+
"NFT",
54+
"native-asset",
55+
"fractional-NFT",
5656
"oracle",
5757
"OTC-swap-predicate",
5858
".devops/.template",
@@ -80,37 +80,37 @@ jobs:
8080

8181
- name: Check Sway formatting
8282
run: |
83-
cd ${{ matrix.project }}/project
83+
cd ${{ matrix.project }}
8484
forc fmt --check
8585
8686
- name: Check Rust formatting
8787
run: |
88-
cd ${{ matrix.project }}/project
88+
cd ${{ matrix.project }}
8989
cargo fmt --verbose --check
9090
9191
- name: Build Sway
9292
run: |
93-
cd ${{ matrix.project }}/project
93+
cd ${{ matrix.project }}
9494
forc build --locked
9595
9696
- name: Build Rust files
9797
run: |
98-
cd ${{ matrix.project }}/project
98+
cd ${{ matrix.project }}
9999
cargo build --locked
100100
101101
- name: Check Clippy Linter
102102
run: |
103-
cd ${{ matrix.project }}/project
103+
cd ${{ matrix.project }}
104104
cargo clippy --all-features --all-targets -- -D warnings
105105
106106
- name: Run Rust tests
107107
run: |
108-
cd ${{ matrix.project }}/project
108+
cd ${{ matrix.project }}
109109
cargo test --locked
110110
111111
- name: Run Sway tests
112112
run: |
113-
cd ${{ matrix.project }}/project
113+
cd ${{ matrix.project }}
114114
forc test
115115
116116
contributing-book:

AMM/.gitignore

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
target
2-
project/contracts/AMM-contract/out
3-
project/contracts/exchange-contract/out
4-
project/contracts/test-artifacts/malicious-implementation/out
5-
project/scripts/atomic-add-liquidity/out
6-
project/scripts/swap-exact-input/out
7-
project/scripts/swap-exact-output/out
2+
out

AMM/project/contracts/AMM-contract/Cargo.toml AMM/AMM-contract/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "Apache-2.0"
77

88
[dependencies]
99
fuels = { version = "0.55.0", features = ["fuel-core-lib"] }
10-
test-utils = { path = "../../test-utils" }
10+
test-utils = { path = "../test-utils" }
1111
tokio = { version = "1.21.0", features = ["rt", "macros"] }
1212

1313
[[test]]

AMM/project/contracts/AMM-contract/Forc.toml AMM/AMM-contract/Forc.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ license = "Apache-2.0"
55
name = "AMM-contract"
66

77
[dependencies]
8-
libraries = { path = "../../libraries" }
8+
libraries = { path = "../libraries" }
File renamed without changes.
File renamed without changes.

AMM/Cargo.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[workspace]
2+
resolver = "2"
3+
members = [
4+
"./AMM-contract",
5+
"./exchange-contract",
6+
"./atomic-add-liquidity",
7+
"./swap-exact-input",
8+
"./swap-exact-output",
9+
"./test-utils",
10+
]
File renamed without changes.

AMM/Forc.toml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[workspace]
2+
members = [
3+
"./AMM-contract",
4+
"./exchange-contract",
5+
"./test-utils/test-artifacts/malicious-implementation",
6+
"./atomic-add-liquidity",
7+
"./swap-exact-input",
8+
"./swap-exact-output",
9+
]

AMM/README.md

+11-18

AMM/project/scripts/atomic-add-liquidity/Cargo.toml AMM/atomic-add-liquidity/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "Apache-2.0"
77

88
[dev-dependencies]
99
fuels = { version = "0.55.0", features = ["fuel-core-lib"] }
10-
test-utils = { path = "../../test-utils" }
10+
test-utils = { path = "../test-utils" }
1111
tokio = { version = "1.12", features = ["rt", "macros"] }
1212

1313
[[test]]

AMM/project/scripts/atomic-add-liquidity/Forc.toml AMM/atomic-add-liquidity/Forc.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ license = "Apache-2.0"
55
name = "atomic-add-liquidity"
66

77
[dependencies]
8-
libraries = { path = "../../libraries" }
8+
libraries = { path = "../libraries" }

AMM/project/contracts/exchange-contract/Cargo.toml AMM/exchange-contract/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "Apache-2.0"
77

88
[dependencies]
99
fuels = { version = "0.55.0", features = ["fuel-core-lib"] }
10-
test-utils = { path = "../../test-utils" }
10+
test-utils = { path = "../test-utils" }
1111
tokio = { version = "1.21.0", features = ["rt", "macros"] }
1212

1313
[[test]]

AMM/project/contracts/exchange-contract/Forc.toml AMM/exchange-contract/Forc.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ license = "Apache-2.0"
55
name = "exchange-contract"
66

77
[dependencies]
8-
libraries = { path = "../../libraries" }
8+
libraries = { path = "../libraries" }
File renamed without changes.
File renamed without changes.
File renamed without changes.

AMM/project/Cargo.toml

-10
This file was deleted.

AMM/project/Forc.toml

-9
This file was deleted.

AMM/project/README.md

-6
This file was deleted.

0 commit comments

Comments
 (0)