transpile js before publishing

This commit is contained in:
perissology 2017-10-07 14:39:03 -07:00
parent c3fe341e57
commit 83faa0d78d
5 changed files with 20 additions and 7 deletions

3
.babelrc Normal file
View File

@ -0,0 +1,3 @@
{
"presets": ["env"]
}

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
lib/
node_modules/ node_modules/
.DS_Store .DS_Store

4
.npmignore Normal file
View File

@ -0,0 +1,4 @@
js
contracts
.babelrc
!build

View File

@ -1,5 +1,4 @@
exports.LiquidPledging = require('./lib/liquidPledging.js');
exports.LiquidPledging = require('./js/liquidPledging.js'); exports.LiquidPledgingMock = require('./lib/liquidPledgingMock.js');
exports.LiquidPledgingMock = require('./js/liquidPledgingMock.js'); exports.LiquidPledgingState = require('./lib/liquidPledgingState.js');
exports.LiquidPledgingState = require('./js/liquidPledgingState.js'); exports.Vault = require('./lib/vault.js');
exports.Vault = require('./js/vault.js');

View File

@ -4,11 +4,15 @@
"description": "Liquid Pledging Smart Contract", "description": "Liquid Pledging Smart Contract",
"main": "index.js", "main": "index.js",
"directories": { "directories": {
"lib": "lib",
"test": "test" "test": "test"
}, },
"scripts": { "scripts": {
"build": "solcpiler -i './contracts/**/*.sol'", "test": "npm run sol-compile; mocha --harmony",
"test": "npm run build; mocha --harmony" "sol-compile": "solcpiler -i './contracts/**/*.sol'",
"js-compile": "babel -d lib/ js/",
"compile": "npm run sol-compile; npm run js-compile",
"prepublish": "npm run js-compile"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -29,7 +33,9 @@
"url": "https://github.com/Giveth/liquidpledging/issues" "url": "https://github.com/Giveth/liquidpledging/issues"
}, },
"devDependencies": { "devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^7.2.3", "babel-eslint": "^7.2.3",
"babel-preset-env": "^1.6.0",
"eslint-config-airbnb": "^15.0.1", "eslint-config-airbnb": "^15.0.1",
"eslint-plugin-import": "^2.6.0", "eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^6.0.2", "eslint-plugin-jsx-a11y": "^6.0.2",