From adf3467bb9a6aa584bf48f67892f8427f3a950fd Mon Sep 17 00:00:00 2001 From: Jonny Buchanan Date: Tue, 4 Jul 2017 14:54:34 +1000 Subject: [PATCH] =?UTF-8?q?Update=20nwb:=200.9.x=20=E2=86=92=200.17.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 +++-- .npmrc | 1 + .travis.yml | 4 ++-- nwb.config.js | 36 +++++++++++++++++++++++++++--------- package.json | 41 ++++++++++++++++++++--------------------- 5 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 .npmrc diff --git a/.gitignore b/.gitignore index 4994ab3..e51faa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ /coverage /demo/dist -/es6 +/es /lib /node_modules /umd -npm-debug.log +npm-debug.log* +package-lock.json diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..e9c04d1 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +save=false diff --git a/.travis.yml b/.travis.yml index 5c036ab..2f3cfa5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: - - "4" - - "5" + - 4 + - 6 script: npm test diff --git a/nwb.config.js b/nwb.config.js index 43398c0..cf8a314 100644 --- a/nwb.config.js +++ b/nwb.config.js @@ -1,11 +1,29 @@ -module.exports = { - type: 'react-component', - build: { - externals: { - 'react': 'React' - }, - global: 'MaskedInput', - jsNext: true, - umd: true +module.exports = function(build) { + var config = { + type: 'react-component', + npm: { + umd: { + externals: { + 'react': 'React' + }, + global: 'MaskedInput' + } + } } + + if (/^build/.test(build.command)) { + // Don't include default polyfills in the demo build + config.polyfill = false + // Prevent React 15.x triggering inclusion of the Node.js process shim in the + // demo build. + config.webpack = { + extra: { + node: { + process: false + } + } + } + } + + return config } diff --git a/package.json b/package.json index ec99991..a6d06be 100644 --- a/package.json +++ b/package.json @@ -1,32 +1,22 @@ { "name": "react-maskedinput", - "description": "Masked React component", "version": "3.3.4", - "main": "./lib/index.js", - "jsnext:main": "es6/index.js", - "standalone": "MaskedInput", - "homepage": "https://github.com/insin/react-maskedinput", - "license": "MIT", - "author": "Jonny Buchanan ", - "keywords": [ - "react", - "masked", - "input", - "react-component" - ], + "description": "Masked React component", + "main": "lib/index.js", + "module": "es/index.js", "files": [ - "es6", + "es", "lib", "umd" ], "scripts": { - "build": "nwb build", - "clean": "nwb clean", + "build": "nwb build-react-component --no-polyfill", + "clean": "nwb clean-module && nwb clean-demo", "lint": "eslint src tests", - "start": "nwb serve", - "test": "nwb test", + "start": "nwb serve-react-demo", + "test": "nwb test-react", "posttest": "npm run lint", - "test:watch": "nwb test --server" + "test:watch": "nwb test-react --server" }, "dependencies": { "inputmask-core": "^2.1.1", @@ -37,12 +27,21 @@ }, "devDependencies": { "eslint-config-jonnybuchanan": "5.0.x", - "nwb": "0.9.x", + "nwb": "0.17.x", "react": "15.x", "react-dom": "15.x" }, + "author": "Jonny Buchanan ", + "homepage": "https://github.com/insin/react-maskedinput", + "license": "MIT", "repository": { "type": "git", "url": "http://github.com/insin/react-maskedinput.git" - } + }, + "keywords": [ + "react", + "masked", + "input", + "react-component" + ] }