From e18f2df0209d19c257993c9c7e7c4a6e9be29f81 Mon Sep 17 00:00:00 2001 From: Sanath Kumar Ramesh Date: Thu, 10 Aug 2017 23:44:21 -0700 Subject: [PATCH] Compile to ES6 --- .gitignore | 1 + .npmignore | 3 +++ example/package.json | 3 ++- package.json | 12 +++++++++--- {bin => src}/index.js | 1 - 5 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .npmignore rename {bin => src}/index.js (99%) diff --git a/.gitignore b/.gitignore index 7a1537b..c3834c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea node_modules +bin diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..d33e8d7 --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +.idea +node_modules +src diff --git a/example/package.json b/example/package.json index 4e8311b..9ce7932 100644 --- a/example/package.json +++ b/example/package.json @@ -4,7 +4,8 @@ "description": "Example App", "main": "index.js", "scripts": { - "install": "go-npm" + "postinstall": "go-npm install", + "preuninstall": "go-npm uninstall" }, "goBinary": { "name": "myBinaryName", diff --git a/package.json b/package.json index e60b6f8..ad0f1b3 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { "name": "go-npm", - "version": "0.1.7", + "version": "0.1.8", "description": "Distribute and install Go binaries via NPM", "main": "index.js", "bin": { "go-npm": "./bin/index.js" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "prepublish": "node_modules/babel-cli/bin/babel.js src --out-dir bin --presets es2015" }, "author": "Sanath Kumar Ramesh ", "license": "Apache-2.0", @@ -20,5 +21,10 @@ "type": "git", "url": "https://github.com/sanathkr/go-npm.git" }, - "homepage": "https://github.com/sanathkr/go-npm" + "homepage": "https://github.com/sanathkr/go-npm", + "devDependencies": { + "babel-cli": "^6.24.1", + "babel-core": "^6.25.0", + "babel-preset-es2015": "^6.24.1" + } } diff --git a/bin/index.js b/src/index.js similarity index 99% rename from bin/index.js rename to src/index.js index 1e6be44..d69394a 100644 --- a/bin/index.js +++ b/src/index.js @@ -206,7 +206,6 @@ if (argv && argv.length > 2) { if (!actions[cmd]) { console.log("Invalid command to go-npm. `install` and `uninstall` are the only supported commands"); process.exit(1); - return; } actions[cmd](function(err) {