-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfixes and extra tests before 0.3.0 (#139)
* Solved some hot fixes regarding the way the dependencies where handled if only the version was specified in the config. Resolved the fact that git revision was not always saved in the config, extra remappings tests
- Loading branch information
Showing
8 changed files
with
662 additions
and
131 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,50 +17,42 @@ This project was started to solve the following issues: | |
- npmjs was built for the js ecosystem not for solidity | ||
- github versioning of the releases is a pain and not all the projects are using it correctly | ||
|
||
## Version 0.2.19 | ||
## Version 0.3.0 | ||
|
||
### Version 0.2.19 introduces the following breaking changes | ||
|
||
Now you can use git to install a dependency. Supported platforms: github and gitlab. | ||
For now, we support only public repositories. | ||
|
||
The syntax is `soldeer install <dependency>~<version> git:<url>`. This will clone the repository and install the dependency in the `dependencies` folder. | ||
|
||
You can also use a certain commit as a dependency | ||
### Version 0.3.0 introduces the following breaking changes | ||
### Config file | ||
The config file (whichever has a `[dependencies]` table between `foundry.toml` and `soldeer.toml`) now has a `[soldeer]` section with the following format and defaults: | ||
|
||
```bash | ||
soldeer install <dependency>~<version> git:<url> <commit> | ||
``` | ||
```toml | ||
[soldeer] | ||
# whether soldeer manages remappings | ||
remappings_generated = true | ||
|
||
Some example | ||
# whether soldeer re-generates all remappings when installing, updating or uninstalling deps | ||
remappings_regenerate = false | ||
|
||
```bash | ||
soldeer install test-project~v1 [email protected]:test/test.git | ||
soldeer install test-project~v1 [email protected]:test/test.git | ||
``` | ||
# whether to suffix the remapping with the version: `name-a.b.c` | ||
remappings_version = true | ||
|
||
```bash | ||
soldeer install test-project~v1 https://github.com/test/test.git | ||
soldeer install test-project~v1 https://gitlab.com/test/test.git | ||
``` | ||
# a prefix to add to the remappings ("@" would give `@name`) | ||
remappings_prefix = "" | ||
|
||
Or using custom commit hashes | ||
# where to store the remappings ("txt" for `remappings.txt` or "config" for `foundry.toml`) | ||
# ignored when `soldeer.toml` is used as config (uses `remappings.txt`) | ||
remappings_location = "txt" | ||
|
||
```bash | ||
soldeer install test-project~v1 [email protected]:test/test.git --rev 345e611cd84bfb4e62c583fa1886c1928bc1a464 | ||
# whether to install sub-dependencies or not. If true this wil install the dependencies of dependencies 1 level down. | ||
recursive_deps = false | ||
``` | ||
|
||
### Version 0.2.7 introduces the following breaking changes | ||
|
||
Save the dependency key as the dependency name to respect the Cargo.toml format. For multiple versions for the same dependency an issue has been created to be added as a feature [#34](https://github.com/mario-eth/soldeer/issues/34). For now the dependency name is the key in the toml file. | ||
|
||
### Breaking Changes introduced in 0.2.6 | ||
### Remappings | ||
|
||
In 0.2.6 the `sdependencies` has been renamed to `dependencies`. Furthermore a dependency now stored in the toml respects Cargo toml format with `version` and `url` included. | ||
Fully configurable Remappings, check [Remappings](#remappings-1). | ||
|
||
### WARNING | ||
|
||
#### BETA VERSION - USE AT YOUR OWN RISK | ||
#### WARNING BETA VERSION - USE AT YOUR OWN RISK | ||
|
||
Soldeer has 3 parts: | ||
|
||
|
@@ -186,6 +178,58 @@ If you want to ignore certain files from the push you need to create a `.soldeer | |
|
||
If you want to dry run a push to inspect what files will be pushed to the central repository, use `soldeer push my-project~v1.0 [PATH_TO_DEPENDENCY] --dry-run true`. This will create a zip file that you can unzip and inspect what was pushed. We recommend everyone to run a dry-run before pushing a new dependency to avoid pushing unwanted files. | ||
|
||
#### Remappings | ||
The remappings are now fully configurable, the foundry/soldeer TOML files accept a | ||
`[soldeer]` field with the following options | ||
|
||
```toml | ||
[soldeer] | ||
# whether soldeer manages remappings | ||
remappings_generated = true | ||
|
||
# whether soldeer re-generates all remappings when installing, updating or uninstalling deps | ||
remappings_regenerate = false | ||
|
||
# whether to suffix the remapping with the version: `name-a.b.c` | ||
remappings_version = true | ||
|
||
# a prefix to add to the remappings ("@" would give `@name`) | ||
remappings_prefix = "" | ||
|
||
# where to store the remappings ("txt" for `remappings.txt` or "config" for `foundry.toml`) | ||
# ignored when `soldeer.toml` is used as config (uses `remappings.txt`) | ||
remappings_location = "txt" | ||
|
||
# whether to install sub-dependencies or not. If true this wil install the dependencies of dependencies 1 level down. | ||
recursive_deps = false | ||
``` | ||
|
||
#### Installing dependencies of dependencies | ||
Whenever you install a dependency, that dependency might have other dependencies it needs to install as well. Currently, you can either specify the `recursive_deps` field as `true` inside the `[soldeer]` section or pass the `--recursive-deps` argument when calling `install` or `update`. This will trigger the installation process to go inside the dependency after installation and run `git submodule update` and `soldeer install`. By executing these commands, the dependency will pull in all the necessary dependencies for it to function properly. | ||
|
||
##### Current issues with this | ||
The current issue with dependencies of dependencies is that, due to improper remappings, some dependencies might not function correctly. For example: | ||
|
||
We have a project called `my-project` with the following dependencies: | ||
- `dependency-1` | ||
- `openzeppelin-5.0.2` | ||
|
||
A contract inside `my-project` has the following import: | ||
```solidity | ||
@openzeppelin/contracts/token/ERC20/ERC20.sol | ||
``` | ||
|
||
However, `dependency-1` also requires `openzeppelin`, but it uses version 4.9.2. The contract inside `dependency-1` has the same import: | ||
```solidity | ||
@openzeppelin/contracts/token/ERC20/ERC20.sol | ||
``` | ||
|
||
Due to improper remappings in the contract files, this situation creates ambiguity, as described above. To resolve this, we should start using versioning within imports, for example: | ||
```solidity | ||
import from 'openzeppelin-4.9.2/token/ERC20/ERC20.sol'; | ||
``` | ||
This approach will allow us to handle multiple versions of various dependencies effectively. | ||
|
||
### Full list of commands | ||
|
||
For more commands use `soldeer help`. | ||
|
@@ -210,6 +254,42 @@ For those who want an extra layer of security, a SHA is generated in the `soldee | |
**For Project Maintainers** | ||
If you want to move your project from the Soldeer organization and take care of pushing the versions to Soldeer yourself, please open an issue or contact me on [X (formerly Twitter)](https://twitter.com/m4rio_eth). | ||
|
||
### Version 0.2.19 introduces the following breaking changes | ||
|
||
Now you can use git to install a dependency. Supported platforms: github and gitlab. | ||
For now, we support only public repositories. | ||
|
||
The syntax is `soldeer install <dependency>~<version> <git-url>`. This will clone the repository and install the dependency in the `dependencies` folder. | ||
|
||
You can also use a certain commit as a dependency | ||
|
||
```bash | ||
soldeer install <dependency>~<version> git:<url> <commit> | ||
``` | ||
|
||
Some example | ||
|
||
```bash | ||
soldeer install test-project~v1 [email protected]:test/test.git | ||
soldeer install test-project~v1 [email protected]:test/test.git | ||
``` | ||
|
||
```bash | ||
soldeer install test-project~v1 https://github.com/test/test.git | ||
soldeer install test-project~v1 https://gitlab.com/test/test.git | ||
``` | ||
|
||
Or using custom commit hashes | ||
|
||
```bash | ||
soldeer install test-project~v1 [email protected]:test/test.git --rev 345e611cd84bfb4e62c583fa1886c1928bc1a464 | ||
``` | ||
|
||
### Version 0.2.7 introduces the following breaking changes | ||
|
||
Save the dependency key as the dependency name to respect the Cargo.toml format. For multiple versions for the same dependency an issue has been created to be added as a feature [#34](https://github.com/mario-eth/soldeer/issues/34). For now the dependency name is the key in the toml file. | ||
|
||
### Breaking Changes introduced in 0.2.6 | ||
|
||
In 0.2.6 the `sdependencies` has been renamed to `dependencies`. Furthermore a dependency now stored in the toml respects Cargo toml format with `version` and `url` included. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.