Skip to content

Commit a401bd5

Browse files
Use snforge_std version from mdbook variable (#3617)
<!-- Reference any GitHub issues resolved by this PR --> Closes #3500 ## Introduced changes Display latest version of `snforge_std` in docs ## Checklist <!-- Make sure all of these are complete --> - [x] Linked relevant issue - [x] Updated relevant documentation - [x] Added relevant tests - [x] Performed self-review of the code - [x] Added changes to `CHANGELOG.md`
1 parent 28f57d1 commit a401bd5

File tree

11 files changed

+16
-8
lines changed

11 files changed

+16
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ jobs:
337337
- name: Install mdBook
338338
run: |
339339
cargo install --version ${MDBOOK_VERSION} mdbook
340+
cargo install mdbook-variables
340341
- name: Install mdBook Link-Check
341342
run: |
342343
cargo install mdbook-linkcheck

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
- name: Install mdBook
4545
run: |
4646
cargo install --version ${MDBOOK_VERSION} mdbook
47+
cargo install mdbook-variables
4748
- name: Install mdBook Link-Check
4849
run: |
4950
cargo install mdbook-linkcheck

docs/book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ runnable = false
2727
[output.html.fold]
2828
enable = true
2929
level = 0
30+
31+
[preprocessor.variables.variables]
32+
snforge_std_version = "0.48.0"

docs/src/appendix/cheatcodes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,5 @@
166166
>
167167
> ```toml
168168
> [dev-dependencies]
169-
> snforge_std = "0.33.0"
169+
> snforge_std = "{{snforge_std_version}}"
170170
> ```

docs/src/appendix/scarb-toml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ edition = "2023_11"
218218
starknet = "2.8.2"
219219

220220
[dev-dependencies]
221-
snforge_std = "0.33.0"
221+
snforge_std = "{{snforge_std_version}}"
222222
starknet = ">=2.8.2"
223223
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", branch = "cairo-2" }
224224

docs/src/appendix/snforge-library.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
> using the appropriate version.
1818
> ```toml
1919
> [dev-dependencies]
20-
> snforge_std = "0.33.0"
20+
> snforge_std = "{{snforge_std_version}}"
2121
> ```

docs/src/getting-started/0-48-0-migration-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ In your `Scarb.toml` file, update the dependency:
1717

1818
```toml
1919
[dev-dependencies]
20-
snforge_std = "0.48.0"
20+
snforge_std = "{{snforge_std_version}}"
2121
```
2222

2323
No further action is required.
@@ -40,7 +40,7 @@ First, in your `Scarb.toml`, remove the `snforge_std` dependency and add `snforg
4040
```diff
4141
[dev-dependencies]
4242
- snforge_std = "0.47.0"
43-
+ snforge_std_deprecated = "0.48.0"
43+
+ snforge_std_deprecated = "{{snforge_std_version}}"
4444
```
4545

4646
Next, replace all kinds of imports in your code from `snforge_std` to `snforge_std_deprecated`:

docs/src/getting-started/first-steps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Add the following line under `[dev-dependencies]` section in the `Scarb.toml` fi
7373
# ...
7474

7575
[dev-dependencies]
76-
snforge_std = "0.33.0"
76+
snforge_std = "{{snforge_std_version}}"
7777
```
7878

7979
Make sure that the above version matches the installed `snforge` version. You can check the currently installed version with

docs/src/testing/contracts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
> using the appropriate version.
99
>```toml
1010
> [dev-dependencies]
11-
> snforge_std = "0.37.0"
11+
> snforge_std = "{{snforge_std_version}}"
1212
> ```
1313
1414
Using unit testing as much as possible is a good practice, as it makes your test suites run faster. However, when

docs/src/testing/using-cheatcodes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
>
88
> ```toml
99
> [dev-dependencies]
10-
> snforge_std = "0.33.0"
10+
> snforge_std = "{{snforge_std_version}}"
1111
> ```
1212
1313
When testing smart contracts, often there are parts of code that are dependent on a specific blockchain state.

0 commit comments

Comments
 (0)