Skip to content

Commit

Permalink
chore: update templates (#24)
Browse files Browse the repository at this point in the history
* feat: add base workspace template

* fix: workspace members link

* fix: add profile to workspace root in base-workspace template

* fix: failing tests on github action

* fix: script warning

* fix: skip checks on empty workspace with no packages

* chore: update schema example file to point to correct directory

* chore: remove default template, update cw721 template with one fix missing

* chore: update versions on cw721 with a pending fix

* chore: updated cargo toml

* chore: fix escrow template

* chore: update cw20 base and the workspace templates

* fix: small fixes for tests

* fix: github workflow

* chore: update minimal version message and selector

* fix: version minimal
  • Loading branch information
eliasmpw authored Aug 22, 2023
1 parent beed066 commit 7b8c793
Show file tree
Hide file tree
Showing 97 changed files with 981 additions and 4,161 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/test_generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function test-template() {
GIT_BRANCH=$(git -C "$REPO_ROOT" branch --show-current)

echo "Generating project from local repository (branch $GIT_BRANCH) ..."
cargo generate --path "$REPO_ROOT" --name "$PROJECT_NAME" -d minimal=false "$TEMPLATE"
cargo generate --path "$REPO_ROOT" --name "$PROJECT_NAME" -d version=full "$TEMPLATE"

(
cd "$PROJECT_NAME"
Expand Down
4 changes: 2 additions & 2 deletions base-workspace/.cargo/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm = "build --release --lib --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --example schema"
schema = "run --bin schema"
17 changes: 0 additions & 17 deletions base-workspace/.gitpod.Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions base-workspace/.gitpod.yml

This file was deleted.

12 changes: 8 additions & 4 deletions base-workspace/Developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ produce an extremely small build output in a consistent manner. The suggest way
to run it is this:

```sh
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.11.4
docker run --rm \
-e CARGO_TERM_COLOR=always \
-v "$(pwd)":/code
-v "$(basename "$(pwd)")_cache":/code/target \
-v "$(basename "$(pwd)")_registry_cache":/usr/local/cargo/registry \
-v "$(basename "$(pwd)")_cosmwasm_sccache":/root/.cache/sccache \
--name "$(basename "$(pwd)")" \
cosmwasm/rust-optimizer:0.14.0
```

We must mount the contract code to `/code`. You can use a absolute path instead
Expand Down
4 changes: 2 additions & 2 deletions cw20/base/.cargo/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm = "build --release --lib --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --example schema"
schema = "run --bin schema"
17 changes: 0 additions & 17 deletions cw20/base/.gitpod.Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions cw20/base/.gitpod.yml

This file was deleted.

38 changes: 22 additions & 16 deletions cw20/base/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "{{project-name}}"
version = "0.1.0"
version = "0.0.1"
authors = ["{{authors}}"]
edition = "2018"
edition = "2021"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
Expand Down Expand Up @@ -32,23 +32,29 @@ backtraces = ["cosmwasm-std/backtraces"]
library = []

[package.metadata.scripts]
optimize = """docker run --rm -v "$(pwd)":/code \
optimize = """docker run --rm \
-e CARGO_TERM_COLOR=always \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.5
-v "$(pwd)":/code \
-v "$(basename "$(pwd)")_cache":/code/target \
-v "$(basename "$(pwd)")_registry_cache":/usr/local/cargo/registry \
-v "$(basename "$(pwd)")_cosmwasm_sccache":/root/.cache/sccache \
--name "$(basename "$(pwd)")" \
cosmwasm/rust-optimizer:0.14.0
"""

[dependencies]
cosmwasm-std = "=1.0.0"
cosmwasm-storage = "=1.0.0"
cw-storage-plus = "0.12"
cw0 = "0.10"
cw2 = "0.12"
cw20 = "0.12"
schemars = "0.8"
serde = { version = "1.0", default-features = false, features = ["derive"] }
thiserror = "1.0"
cosmwasm-schema = "1.3.1"
cosmwasm-std = "1.3.1"
cosmwasm-storage = "1.3.1"
cw-storage-plus = "1.1.0"
cw-utils = "1.0.1"
cw0 = "0.10.3"
cw2 = "1.1.0"
cw20 = "1.1.0"
schemars = "0.8.12"
semver = "1"
serde = { version = "1.0.183", default-features = false, features = ["derive"] }
thiserror = "1.0.44"

[dev-dependencies]
cosmwasm-schema = "=1.0.0"
cw-multi-test = "0.16.5"
12 changes: 8 additions & 4 deletions cw20/base/Developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ produce an extremely small build output in a consistent manner. The suggest way
to run it is this:

```sh
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.11.4
docker run --rm \
-e CARGO_TERM_COLOR=always \
-v "$(pwd)":/code
-v "$(basename "$(pwd)")_cache":/code/target \
-v "$(basename "$(pwd)")_registry_cache":/usr/local/cargo/registry \
-v "$(basename "$(pwd)")_cosmwasm_sccache":/root/.cache/sccache \
--name "$(basename "$(pwd)")" \
cosmwasm/rust-optimizer:0.14.0
```

We must mount the contract code to `/code`. You can use a absolute path instead
Expand Down
16 changes: 0 additions & 16 deletions cw20/base/schema/all_accounts_response.json

This file was deleted.

99 changes: 0 additions & 99 deletions cw20/base/schema/all_allowances_response.json

This file was deleted.

81 changes: 0 additions & 81 deletions cw20/base/schema/allowance_response.json

This file was deleted.

19 changes: 0 additions & 19 deletions cw20/base/schema/balance_response.json

This file was deleted.

Loading

0 comments on commit 7b8c793

Please sign in to comment.