diff --git a/.github/workflows/examples.yml b/.github/workflows/ci.yml similarity index 74% rename from .github/workflows/examples.yml rename to .github/workflows/ci.yml index 01f328bc..cf6fe021 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,10 @@ -name: Origami Examples CI +name: Origami CI on: [push, pull_request] env: - DOJO_VERSION: v0.3.4 + DOJO_VERSION: v0.3.6 SCARB_VERSION: v2.3.1 - WORKING_DIRECTORY: examples jobs: check: @@ -17,7 +16,6 @@ jobs: with: scarb-version: ${{ env.SCARB_VERSION }} - name: Format - working-directory: ${{ env.WORKING_DIRECTORY }} run: scarb fmt --check shell: bash @@ -29,30 +27,39 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - name: Build - working-directory: ${{ env.WORKING_DIRECTORY }} run: sozo build shell: bash + origami: + needs: [check, build] + runs-on: ubuntu-latest + name: Test crates + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup + - name: Test + run: sozo test -f origami + shell: bash + + market: needs: [check, build] runs-on: ubuntu-latest - name: Test market + name: Test example market steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - name: Test - working-directory: ${{ env.WORKING_DIRECTORY }} run: sozo test -f market shell: bash projectile: needs: [check, build] runs-on: ubuntu-latest - name: Test projectile + name: Test example projectile steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - name: Test - working-directory: ${{ env.WORKING_DIRECTORY }} run: sozo test -f projectile shell: bash \ No newline at end of file diff --git a/.github/workflows/origami.yml b/.github/workflows/origami.yml deleted file mode 100644 index 6fd0beab..00000000 --- a/.github/workflows/origami.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Origami CI - -on: [push, pull_request] - -env: - DOJO_VERSION: v0.3.4 - SCARB_VERSION: v2.3.1 - -jobs: - check: - runs-on: ubuntu-latest - name: Check format - steps: - - uses: actions/checkout@v4 - - uses: software-mansion/setup-scarb@v1 - with: - scarb-version: ${{ env.SCARB_VERSION }} - - name: Format - run: scarb fmt --check - shell: bash - - build: - needs: check - runs-on: ubuntu-latest - name: Build package - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup - - name: Build - run: sozo build - shell: bash - - origami: - needs: [check, build] - runs-on: ubuntu-latest - name: Test crates - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup - - name: Test - run: sozo test - shell: bash \ No newline at end of file diff --git a/Scarb.lock b/Scarb.lock index 626ac004..e34f75bd 100644 --- a/Scarb.lock +++ b/Scarb.lock @@ -8,15 +8,23 @@ source = "git+https://github.com/influenceth/cubit?rev=b459053#b4590530d5aeae9aa [[package]] name = "dojo" -version = "0.3.4" -source = "git+https://github.com/dojoengine/dojo?tag=v0.3.4#a3140d88b08b79c5ff2261c1db81bafe80b5cc91" +version = "0.3.6" +source = "git+https://github.com/dojoengine/dojo?tag=v0.3.6#08f1eba55b53de56b08221ae093a00f799fa60c1" dependencies = [ "dojo_plugin", ] [[package]] name = "dojo_plugin" -version = "0.3.4" +version = "0.3.6" + +[[package]] +name = "market" +version = "0.0.0" +dependencies = [ + "cubit", + "dojo", +] [[package]] name = "origami" @@ -25,3 +33,12 @@ dependencies = [ "cubit", "dojo", ] + +[[package]] +name = "projectile" +version = "0.0.0" +dependencies = [ + "cubit", + "dojo", + "origami", +] diff --git a/Scarb.toml b/Scarb.toml index c9e3027a..c111c3f8 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -1,11 +1,18 @@ -[package] -name = "origami" +[workspace] +members = [ + "crates", + "examples/*", +] + +[workspace.package] version = "0.0.0" description = "Community-maintained libraries for Cairo" homepage = "https://github.com/dojoengine/origami" +authors = [ + "bal7hazar@proton.me", +] -[lib] - -[dependencies] +[workspace.dependencies] cubit = { git = "https://github.com/influenceth/cubit", rev = "b459053" } -dojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.4" } +dojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.6" } +origami = { path = "crates" } diff --git a/crates/Scarb.lock b/crates/Scarb.lock new file mode 100644 index 00000000..00d24f94 --- /dev/null +++ b/crates/Scarb.lock @@ -0,0 +1,2 @@ +# Code generated by scarb DO NOT EDIT. +version = 1 diff --git a/crates/Scarb.toml b/crates/Scarb.toml new file mode 100644 index 00000000..8b2cb66d --- /dev/null +++ b/crates/Scarb.toml @@ -0,0 +1,10 @@ +[package] +name = "origami" +version.workspace = true +authors.workspace = true +description.workspace = true +homepage = "https://github.com/dojoengine/origami/tree/main/crates" + +[dependencies] +cubit.workspace = true +dojo.workspace = true diff --git a/src/algebra/matrix.cairo b/crates/src/algebra/matrix.cairo similarity index 100% rename from src/algebra/matrix.cairo rename to crates/src/algebra/matrix.cairo diff --git a/src/algebra/vec2.cairo b/crates/src/algebra/vec2.cairo similarity index 100% rename from src/algebra/vec2.cairo rename to crates/src/algebra/vec2.cairo diff --git a/src/algebra/vector.cairo b/crates/src/algebra/vector.cairo similarity index 100% rename from src/algebra/vector.cairo rename to crates/src/algebra/vector.cairo diff --git a/src/defi/README.md b/crates/src/defi/README.md similarity index 100% rename from src/defi/README.md rename to crates/src/defi/README.md diff --git a/src/defi/auction/gda.cairo b/crates/src/defi/auction/gda.cairo similarity index 100% rename from src/defi/auction/gda.cairo rename to crates/src/defi/auction/gda.cairo diff --git a/src/defi/auction/helpers.cairo b/crates/src/defi/auction/helpers.cairo similarity index 100% rename from src/defi/auction/helpers.cairo rename to crates/src/defi/auction/helpers.cairo diff --git a/src/defi/auction/vrgda.cairo b/crates/src/defi/auction/vrgda.cairo similarity index 100% rename from src/defi/auction/vrgda.cairo rename to crates/src/defi/auction/vrgda.cairo diff --git a/src/lib.cairo b/crates/src/lib.cairo similarity index 100% rename from src/lib.cairo rename to crates/src/lib.cairo diff --git a/src/random/deck.cairo b/crates/src/random/deck.cairo similarity index 100% rename from src/random/deck.cairo rename to crates/src/random/deck.cairo diff --git a/src/random/dice.cairo b/crates/src/random/dice.cairo similarity index 100% rename from src/random/dice.cairo rename to crates/src/random/dice.cairo diff --git a/src/security/commitment.cairo b/crates/src/security/commitment.cairo similarity index 100% rename from src/security/commitment.cairo rename to crates/src/security/commitment.cairo diff --git a/examples/Scarb.lock b/examples/Scarb.lock deleted file mode 100644 index 0134c213..00000000 --- a/examples/Scarb.lock +++ /dev/null @@ -1,43 +0,0 @@ -# Code generated by scarb DO NOT EDIT. -version = 1 - -[[package]] -name = "cubit" -version = "1.2.0" -source = "git+https://github.com/influenceth/cubit?rev=b459053#b4590530d5aeae9aabd36740cc2a3d9e6adc5fde" - -[[package]] -name = "dojo" -version = "0.3.4" -source = "git+https://github.com/dojoengine/dojo?tag=v0.3.4#a3140d88b08b79c5ff2261c1db81bafe80b5cc91" -dependencies = [ - "dojo_plugin", -] - -[[package]] -name = "dojo_plugin" -version = "0.3.4" - -[[package]] -name = "market" -version = "0.0.0" -dependencies = [ - "cubit", - "dojo", -] - -[[package]] -name = "origami" -version = "0.0.0" -dependencies = [ - "cubit", - "dojo", -] - -[[package]] -name = "projectile" -version = "0.0.0" -dependencies = [ - "cubit", - "origami", -] diff --git a/examples/Scarb.toml b/examples/Scarb.toml deleted file mode 100644 index a49faf61..00000000 --- a/examples/Scarb.toml +++ /dev/null @@ -1,13 +0,0 @@ -[workspace] -name = "origami_examples" -version = "0.0.0" -description = "Community-maintained libraries for Cairo" -homepage = "https://github.com/dojoengine/origami" -members = [ - "market", - "projectile", -] - -[workspace.dependencies] -dojo = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.4" } -origami = { path = "../../origami" } \ No newline at end of file diff --git a/examples/market/Scarb.toml b/examples/market/Scarb.toml index 5fc2f482..f785542e 100644 --- a/examples/market/Scarb.toml +++ b/examples/market/Scarb.toml @@ -5,5 +5,5 @@ description = "Example of defi crate usage." homepage = "https://github.com/dojoengine/origami/tree/examples/market" [dependencies] -cubit = { git = "https://github.com/influenceth/cubit", rev = "b459053" } +cubit.workspace = true dojo.workspace = true \ No newline at end of file diff --git a/examples/projectile/Scarb.toml b/examples/projectile/Scarb.toml index 750a488b..295e39c4 100644 --- a/examples/projectile/Scarb.toml +++ b/examples/projectile/Scarb.toml @@ -5,5 +5,6 @@ description = "Example of algebria crate usage." homepage = "https://github.com/dojoengine/origami/tree/examples/projectile" [dependencies] -cubit = { git = "https://github.com/influenceth/cubit", rev = "b459053" } +cubit.workspace = true +dojo.workspace = true origami.workspace = true \ No newline at end of file diff --git a/examples/.gitignore b/presets/.gitignore similarity index 100% rename from examples/.gitignore rename to presets/.gitignore diff --git a/src/tokens/Scarb.lock b/presets/Scarb.lock similarity index 100% rename from src/tokens/Scarb.lock rename to presets/Scarb.lock diff --git a/src/tokens/Scarb.toml b/presets/Scarb.toml similarity index 100% rename from src/tokens/Scarb.toml rename to presets/Scarb.toml diff --git a/src/tokens/src/erc1155/erc1155.cairo b/presets/src/erc1155/erc1155.cairo similarity index 100% rename from src/tokens/src/erc1155/erc1155.cairo rename to presets/src/erc1155/erc1155.cairo diff --git a/src/tokens/src/erc1155/erc1155/erc1155.cairo b/presets/src/erc1155/erc1155/erc1155.cairo similarity index 100% rename from src/tokens/src/erc1155/erc1155/erc1155.cairo rename to presets/src/erc1155/erc1155/erc1155.cairo diff --git a/src/tokens/src/erc1155/erc1155/interface.cairo b/presets/src/erc1155/erc1155/interface.cairo similarity index 100% rename from src/tokens/src/erc1155/erc1155/interface.cairo rename to presets/src/erc1155/erc1155/interface.cairo diff --git a/src/tokens/src/erc1155/erc1155/models.cairo b/presets/src/erc1155/erc1155/models.cairo similarity index 100% rename from src/tokens/src/erc1155/erc1155/models.cairo rename to presets/src/erc1155/erc1155/models.cairo diff --git a/src/tokens/src/erc1155/tests.cairo b/presets/src/erc1155/tests.cairo similarity index 100% rename from src/tokens/src/erc1155/tests.cairo rename to presets/src/erc1155/tests.cairo diff --git a/src/tokens/src/erc20/erc20.cairo b/presets/src/erc20/erc20.cairo similarity index 100% rename from src/tokens/src/erc20/erc20.cairo rename to presets/src/erc20/erc20.cairo diff --git a/src/tokens/src/erc20/models.cairo b/presets/src/erc20/models.cairo similarity index 100% rename from src/tokens/src/erc20/models.cairo rename to presets/src/erc20/models.cairo diff --git a/src/tokens/src/erc20/tests.cairo b/presets/src/erc20/tests.cairo similarity index 100% rename from src/tokens/src/erc20/tests.cairo rename to presets/src/erc20/tests.cairo diff --git a/src/tokens/src/erc721/erc721.cairo b/presets/src/erc721/erc721.cairo similarity index 100% rename from src/tokens/src/erc721/erc721.cairo rename to presets/src/erc721/erc721.cairo diff --git a/src/tokens/src/erc721/models.cairo b/presets/src/erc721/models.cairo similarity index 100% rename from src/tokens/src/erc721/models.cairo rename to presets/src/erc721/models.cairo diff --git a/src/tokens/src/erc721/tests.cairo b/presets/src/erc721/tests.cairo similarity index 100% rename from src/tokens/src/erc721/tests.cairo rename to presets/src/erc721/tests.cairo diff --git a/src/tokens/src/lib.cairo b/presets/src/lib.cairo similarity index 100% rename from src/tokens/src/lib.cairo rename to presets/src/lib.cairo diff --git a/src/tokens/src/tests/constants.cairo b/presets/src/tests/constants.cairo similarity index 100% rename from src/tokens/src/tests/constants.cairo rename to presets/src/tests/constants.cairo diff --git a/src/tokens/src/tests/test_erc1155.cairo b/presets/src/tests/test_erc1155.cairo similarity index 100% rename from src/tokens/src/tests/test_erc1155.cairo rename to presets/src/tests/test_erc1155.cairo diff --git a/src/tokens/src/tests/test_erc721.cairo b/presets/src/tests/test_erc721.cairo similarity index 100% rename from src/tokens/src/tests/test_erc721.cairo rename to presets/src/tests/test_erc721.cairo diff --git a/src/tokens/src/tests/utils.cairo b/presets/src/tests/utils.cairo similarity index 100% rename from src/tokens/src/tests/utils.cairo rename to presets/src/tests/utils.cairo diff --git a/src/tokens/.gitignore b/src/tokens/.gitignore deleted file mode 100644 index 1de56593..00000000 --- a/src/tokens/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target \ No newline at end of file