Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to solcjs, fix formatting unit test, update chalk dependency #28

Merged
merged 4 commits into from
Feb 11, 2018
Merged

switch to solcjs, fix formatting unit test, update chalk dependency #28

merged 4 commits into from
Feb 11, 2018

Conversation

linusnorton
Copy link
Contributor

@linusnorton linusnorton commented Feb 5, 2018

Unfortunately I also had to update chalk to get it to build correctly.

import { MalformedAbiError } from "./errors";

const { yellow } = chalk;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert. Why do you prefer object destruction instead doing this on one go while importing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately that format is no longer supported, see chalk/chalk#215 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhh, that's horrifying but I guess we need to roll with it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry about that. The maintainer of chalk seems quite adamant that it is the best way to do it :/

@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { readFileSync, writeFileSync } from "fs";
import { blue, red, green } from "chalk";
import chalk from "chalk";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@@ -11,6 +11,7 @@ import { parseArgs } from "./parseArgs";
import { copyRuntime } from "./copyRuntime";
import { extractAbi } from "./abiParser";

const { blue, red, green } = chalk;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@@ -31,12 +31,14 @@
"web3-typescript-typings": "^0.7.2"
},
"dependencies": {
"chalk": "^2.1.0",
"bignumber.js": "^5.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bignumber should be peer dependency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be both as the project needs it and downstream projects need. Is that how peerDependencies work? You've got web3 as both a dependency and a peerDependency so I guess so.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will revisit this in a separate PR. But I think web3, bignumber etc should be only peer dependency since we generate code directly to users codebase (thus not using our dependency but user project's dependencies)

@@ -2,7 +2,7 @@ import { expect } from "chai";
import { deployContract } from "./utils/web3Contracts";

import { web3 } from "./web3";
import { ContractWithOverloads } from "./abis/ContractWithOverloads";
import { __ContractWithOverloads_sol_ContractWithOverloads as ContractWithOverloads } from "./abis/__ContractWithOverloads_sol_ContractWithOverloads";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there a way to make solcjs generate more readable file names?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It pollutes a lot of code otherwise

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find one. I cd into that directory to stop it generating even more noise. I will dig a bit more and get back to you.

@linusnorton
Copy link
Contributor Author

@krzkaczor I think this is as ready as it's ever going to be. I didn't find a way to tidy up the contract filenames (apart from manually renaming them).

@krzkaczor
Copy link
Member

@linusnorton thanks! Sorry, i was busy. I will make a review of this and the other branch before monday!

@@ -31,12 +31,14 @@
"web3-typescript-typings": "^0.7.2"
},
"dependencies": {
"chalk": "^2.1.0",
"bignumber.js": "^5.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will revisit this in a separate PR. But I think web3, bignumber etc should be only peer dependency since we generate code directly to users codebase (thus not using our dependency but user project's dependencies)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants