Fixed sorting in artifact generation

This commit is contained in:
Greg Hysen 2019-08-21 16:17:10 -07:00
parent 697e5df52d
commit c0acc8dfdf
3 changed files with 11 additions and 2 deletions

View File

@ -50,7 +50,7 @@
"homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md", "homepage": "https://github.com/0xProject/0x-monorepo/contracts/tokens/README.md",
"devDependencies": { "devDependencies": {
"@0x/abi-gen": "^4.1.0", "@0x/abi-gen": "^4.1.0",
"@0x/contracts-gen": "^1.0.8", "@0x/contracts-gen": "^1.0.13",
"@0x/contracts-test-utils": "^3.1.2", "@0x/contracts-test-utils": "^3.1.2",
"@0x/dev-utils": "^2.2.1", "@0x/dev-utils": "^2.2.1",
"@0x/sol-compiler": "^3.1.6", "@0x/sol-compiler": "^3.1.6",

View File

@ -1,4 +1,13 @@
[ [
{
"version": "1.1.1",
"changes": [
{
"note": "Fixed sorting in artifact generation",
"pr": 1910
}
]
},
{ {
"version": "1.1.0", "version": "1.1.0",
"changes": [ "changes": [

View File

@ -79,7 +79,7 @@ function generateArtifactsTs(contracts: string[], artifactsDir: string, prettier
const importPath = path.join('..', artifactsDir, `${contractName}.json`); const importPath = path.join('..', artifactsDir, `${contractName}.json`);
return `import * as ${contractName} from '${importPath}';`; return `import * as ${contractName} from '${importPath}';`;
}); });
const sortedImports = _.sortBy(imports); const sortedImports = _.sortBy(imports, _import => _import.toLowerCase());
const artifacts = _.map(contracts, contract => { const artifacts = _.map(contracts, contract => {
const contractName = path.basename(contract, SOLIDITY_EXTENSION); const contractName = path.basename(contract, SOLIDITY_EXTENSION);
if (contractName === 'ZRXToken') { if (contractName === 'ZRXToken') {