Fix sol-compiler binary so it can be called directly from packages

This commit is contained in:
Fabio Berger 2018-05-14 19:32:32 +02:00
parent 5f678acf46
commit a6773b85d2
5 changed files with 6 additions and 4 deletions

View File

@ -16,7 +16,7 @@
"test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov", "test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov",
"run_mocha": "mocha 'lib/test/**/*.js' --timeout 100000 --bail --exit", "run_mocha": "mocha 'lib/test/**/*.js' --timeout 100000 --bail --exit",
"compile:comment": "Yarn workspaces do not link binaries correctly so we need to reference them directly https://github.com/yarnpkg/yarn/issues/3846", "compile:comment": "Yarn workspaces do not link binaries correctly so we need to reference them directly https://github.com/yarnpkg/yarn/issues/3846",
"compile": "node ../sol-compiler/lib/src/cli.js", "compile": "sol-compiler",
"clean": "shx rm -rf lib src/contract_wrappers/generated", "clean": "shx rm -rf lib src/contract_wrappers/generated",
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'",
"lint": "tslint --project .", "lint": "tslint --project .",

View File

@ -18,7 +18,7 @@
"coverage:report:html": "istanbul report html && open coverage/index.html", "coverage:report:html": "istanbul report html && open coverage/index.html",
"coverage:report:lcov": "istanbul report lcov", "coverage:report:lcov": "istanbul report lcov",
"test:circleci": "yarn test:coverage", "test:circleci": "yarn test:coverage",
"compile": "node ../sol-compiler/lib/src/cli.js compile" "compile": "sol-compiler compile"
}, },
"author": "", "author": "",
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../lib/src/cli.js')

View File

@ -33,7 +33,7 @@
} }
}, },
"bin": { "bin": {
"sol-compiler": "lib/src/cli.js" "sol-compiler": "bin/sol-compiler.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -14,7 +14,7 @@
"run_mocha": "mocha lib/test/**/*_test.js --exit", "run_mocha": "mocha lib/test/**/*_test.js --exit",
"clean": "shx rm -rf lib scripts test/fixtures/artifacts src/artifacts", "clean": "shx rm -rf lib scripts test/fixtures/artifacts src/artifacts",
"build": "copyfiles 'test/fixtures/**/*' ./lib && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "build": "copyfiles 'test/fixtures/**/*' ./lib && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"compile_test": "node ../sol-compiler/lib/src/cli.js compile", "compile_test": "sol-compiler compile",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js", "manual:postpublish": "yarn build; node ./scripts/postpublish.js",
"docs:stage": "node scripts/stage_docs.js", "docs:stage": "node scripts/stage_docs.js",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES",