diff --git a/.ncurc.js b/.ncurc.js new file mode 100644 index 0000000..4e5939d --- /dev/null +++ b/.ncurc.js @@ -0,0 +1,2 @@ +const { createConfig } = require('@rollup-umd/ncu'); +module.exports = createConfig(); diff --git a/.npmignore b/.npmignore index 3e43747..0a7f9a7 100644 --- a/.npmignore +++ b/.npmignore @@ -21,3 +21,4 @@ coverage/ docs/ reports/ /styleguide +.ncurc.js diff --git a/package.json b/package.json index 8c7ca2f..a94de4d 100644 --- a/package.json +++ b/package.json @@ -115,64 +115,53 @@ } }, "devDependencies": { - "@babel/cli": "^7.2.3", - "@babel/core": "^7.2.2", + "@babel/cli": "^7.4.4", + "@babel/core": "^7.4.5", "@babel/plugin-external-helpers": "^7.2.0", - "@babel/plugin-proposal-class-properties": "^7.2.3", - "@babel/plugin-proposal-decorators": "^7.2.3", + "@babel/plugin-proposal-class-properties": "^7.4.4", + "@babel/plugin-proposal-decorators": "^7.4.4", "@babel/plugin-proposal-json-strings": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.2.0", + "@babel/plugin-proposal-object-rest-spread": "^7.4.4", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/plugin-syntax-import-meta": "^7.2.0", - "@babel/plugin-transform-modules-commonjs": "^7.2.0", - "@babel/preset-env": "^7.2.3", - "@bootstrap-styled/documentation": "^1.2.0", - "@rollup-umd/documentation": "^1.3.1", - "@semantic-release/changelog": "^3.0.1", - "@semantic-release/git": "^7.0.6", - "@semantic-release/github": "^5.2.7", - "@semantic-release/npm": "^5.1.2", - "babel-core": "^7.0.0-bridge.0", - "babel-eslint": "^10.0.1", - "babel-jest": "^23.6.0", - "babel-loader": "^8.0.4", - "babel-plugin-add-module-exports": "^1.0.0", + "@babel/plugin-transform-modules-commonjs": "^7.4.4", + "@babel/preset-env": "^7.4.5", + "@bootstrap-styled/documentation": "^2.0.0", + "@rollup-umd/documentation": "^2.0.5", + "@rollup-umd/ncu": "^1.0.9", + "@rollup-umd/rollup": "^1.0.13", + "@semantic-release/changelog": "^3.0.4", + "@semantic-release/git": "^7.0.12", + "@semantic-release/github": "^5.4.0", + "@semantic-release/npm": "^5.1.9", + "babel-eslint": "^10.0.2", + "babel-jest": "^24.8.0", + "babel-loader": "^8.0.6", + "babel-plugin-add-module-exports": "^1.0.2", "babel-plugin-array-includes": "^2.0.3", "babel-plugin-dynamic-import-node": "^2.2.0", "cz-conventional-changelog": "^2.1.0", - "enzyme": "^3.8.0", - "enzyme-adapter-react-16": "^1.7.1", - "eslint": "^5.10.0", + "enzyme": "^3.10.0", + "enzyme-adapter-react-16": "^1.14.0", + "eslint": "^5.16.0", "eslint-config-airbnb": "^17.1.0", "eslint-config-airbnb-base": "^13.1.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-jsx-a11y": "^6.1.2", - "eslint-plugin-react": "^7.11.1", + "eslint-plugin-import": "^2.17.3", + "eslint-plugin-jsx-a11y": "^6.2.1", + "eslint-plugin-react": "^7.13.0", "immutable": "^4.0.0-rc.12", - "jest-cli": "^23.6.0", + "jest-cli": "^24.8.0", "jest-sonar-reporter": "^2.0.0", - "lint-staged": "^8.1.0", + "lint-staged": "^8.2.1", "pre-commit": "^1.2.2", - "react": "^16.7.0", - "react-dom": "^16.7.0", - "react-styleguidist": "^8.0.6", - "rimraf": "^2.6.2", - "rollup": "^0.68.1", - "rollup-plugin-babel": "^4.1.0", - "rollup-plugin-cleanup": "^3.0.0", - "rollup-plugin-commonjs": "^9.2.0", - "rollup-plugin-inject": "^2.2.0", - "rollup-plugin-json": "^3.1.0", - "rollup-plugin-node-builtins": "^2.1.2", - "rollup-plugin-node-resolve": "^4.0.0", - "rollup-plugin-replace": "^2.1.0", - "rollup-plugin-terser": "^3.0.0", - "rollup-plugin-visualizer": "^0.9.2", - "rollup-watch": "^4.3.1", - "semantic-release": "^15.13.1", - "sinon": "^7.2.2", + "react": "^16.8.6", + "react-dom": "^16.8.6", + "react-styleguidist": "^9.1.7", + "rimraf": "^2.6.3", + "rollup": "^1.15.6", + "semantic-release": "^15.13.16", "toctoc": "^0.3.2", - "webpack": "^4.28.1" + "webpack": "^4.34.0" }, "jest": { "roots": [ @@ -182,7 +171,13 @@ "raf/polyfill" ], "testURL": "http://localhost/", - "setupTestFrameworkScriptFile": "/internals/testing/test-bundler.js", + "setupFilesAfterEnv": [ + "/internals/testing/test-bundler.js" + ], + "transformIgnorePatterns": [ + "/node_modules", + "/internals" + ], "testPathIgnorePatterns": [ "/dist/", "/lib/" @@ -221,7 +216,7 @@ "build:readme" ], "dependencies": { - "@bootstrap-styled/css-mixins": "^2.0.3", + "@bootstrap-styled/css-mixins": "^2.0.6", "@bootstrap-styled/utils": "^1.7.1" }, "publishConfig": { diff --git a/rollup.config.js b/rollup.config.js index 0325ecf..044e445 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,80 +1,2 @@ -/* eslint-disable flowtype-errors/show-errors, no-console, import/extensions */ -import nodeResolve from 'rollup-plugin-node-resolve'; -import replace from 'rollup-plugin-replace'; -import commonjs from 'rollup-plugin-commonjs'; -import inject from 'rollup-plugin-inject'; -import babel from 'rollup-plugin-babel'; -import json from 'rollup-plugin-json'; -import { terser } from 'rollup-plugin-terser'; -import cleanup from 'rollup-plugin-cleanup'; -import visualizer from 'rollup-plugin-visualizer'; -import pkg from './package.json'; -import declination from './declination.json'; -const processShim = '\0process-shim'; -const prod = process.env.PRODUCTION; -const mode = prod ? 'production' : 'development'; -const { external, globals } = declination; - -console.log(`Creating ${mode} bundle...`); - -const output = prod ? [ - { - name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.min.js`, format: 'umd', sourcemap: true, - }, - { - name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.cjs.min.js`, format: 'cjs', sourcemap: true, - }, - { - name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.esm.js`, format: 'es', sourcemap: true, - }, -] : [ - { - name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.js`, format: 'umd', sourcemap: true, - }, - { - name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.cjs.js`, format: 'cjs', sourcemap: true, - }, - { - name: pkg.name, exports: 'named', globals, file: `dist/${pkg.name}.esm.js`, format: 'es', sourcemap: true, - }, -]; -const plugins = [ - // Unlike Webpack and Browserify, Rollup doesn't automatically shim Node - // builtins like `process`. This ad-hoc plugin creates a 'virtual module' - // which includes a shim containing just the parts the bundle needs. - { - resolveId(importee) { - if (importee === processShim) return importee; - return null; - }, - load(id) { - if (id === processShim) return 'export default { argv: [], env: {} }'; - return null; - }, - }, - nodeResolve({ - browser: true, - }), - commonjs({ - include: 'node_modules/**', - }), - replace({ - 'process.env.NODE_ENV': JSON.stringify(prod ? 'production' : 'development'), - }), - inject({ - process: processShim, - }), - babel({ - babelrc: false, - exclude: 'node_modules/**', - }), - json(), - cleanup(), -]; - -export default output.map((o) => ({ - input: 'src/index.js', - external, - output: o, - plugins: prod ? plugins.concat([terser(), visualizer({ filename: './bundle-stats.html' })]) : plugins, -})); +const { createConfig } = require('@rollup-umd/rollup'); +module.exports = createConfig();