diff --git a/.babelrc b/.babelrc index c67f333..65904e8 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,4 @@ { - "presets": [ "@babel/preset-env" ], - "plugins": ["istanbul"] + "presets": [ "@babel/preset-env" ] } \ No newline at end of file diff --git a/package.json b/package.json index 9f0d7ef..720e492 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@wiotp/sdk", - "version": "0.6.0", + "version": "0.6.1", "description": "SDK for developing device, gateway, and application clients for IBM Watson IoT Platform", - "main": "index.js", + "main": "dist/index.js", "files": [ "src", "index.js", @@ -16,6 +16,7 @@ "dependencies": { "axios": "^0.19.0", "bluebird": "^3.5.4", + "browserify": "^16.5.0", "btoa": "^1.2.1", "concat-stream": "^2.0.0", "events": "^3.0.0", @@ -35,18 +36,22 @@ "@cloudant/cloudant": "^2.1.0", "@istanbuljs/nyc-config-babel": "^2.1.1", "babel-plugin-istanbul": "^5.1.4", + "browserify": "16.5.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "coveralls": "3.0.3", "mocha": "6.1.4", "mocha-steps": "^1.3.0", "nyc": "14.1.1", - "rimraf": "2.6.3" + "rimraf": "2.6.3", + "terser": "^4.4.3" }, "scripts": { "clean": "rimraf dist/*", - "build:commonjs": "babel src --out-dir dist --modules umd", - "build": "npm run clean && npm run build:commonjs", + "build": "npm run clean && npm run build:commonjs && npm run build:bundle && npm run build:min", + "build:commonjs": "babel src --out-dir dist", + "build:bundle": "browserify dist/index.js --outfile dist/bundled/wiotp-bundle.js", + "build:min": "terser dist/bundled/wiotp-bundle.js -o dist/bundled/wiotp-bundle.min.js", "test": "mocha --require @babel/register --require mocha-steps", "test-cov": "nyc --reporter=lcov --reporter=text-summary mocha --require mocha-steps", "test:watch": "mocha --require @babel/register --require mocha-steps --watch" diff --git a/index.js b/src/index.js similarity index 51% rename from index.js rename to src/index.js index 3693fdc..157e552 100644 --- a/index.js +++ b/src/index.js @@ -9,11 +9,11 @@ * */ -export { default as ApplicationClient } from './src/application/ApplicationClient'; -export { default as DeviceClient } from './src/device/DeviceClient'; -export { default as GatewayClient } from './src/gateway/GatewayClient'; +export { default as ApplicationClient } from './application/ApplicationClient'; +export { default as DeviceClient } from './device/DeviceClient'; +export { default as GatewayClient } from './gateway/GatewayClient'; -export { default as ApplicationConfig } from './src/application/ApplicationConfig'; -export { default as DeviceConfig } from './src/device/DeviceConfig'; +export { default as ApplicationConfig } from './application/ApplicationConfig'; +export { default as DeviceConfig } from './device/DeviceConfig'; -export {default as ApiErrors} from './src/api/ApiErrors'; \ No newline at end of file +export {default as ApiErrors} from './api/ApiErrors'; \ No newline at end of file