From 0c3ee9f50b762c7317f58df85ec1e9e380a9030b Mon Sep 17 00:00:00 2001 From: psychobolt Date: Fri, 1 Dec 2017 21:04:47 -0800 Subject: [PATCH 1/3] Make React and React DOM peer dependencies --- .eslintignore | 5 +++-- .eslintrc => .eslintrc.json | 2 +- .npmignore | 5 ++--- package.json | 9 +++++---- yarn.lock | 12 ++++++------ 5 files changed, 17 insertions(+), 16 deletions(-) rename .eslintrc => .eslintrc.json (89%) diff --git a/.eslintignore b/.eslintignore index 3ddc9277..67ea0ca2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ -/dist/* -/flow-typed/npm/* \ No newline at end of file +/dist +/stories/node_modules +/flow-typed/npm \ No newline at end of file diff --git a/.eslintrc b/.eslintrc.json similarity index 89% rename from .eslintrc rename to .eslintrc.json index f7eef060..400612bb 100644 --- a/.eslintrc +++ b/.eslintrc.json @@ -5,7 +5,7 @@ "rules": { "import/no-extraneous-dependencies": 0, "no-confusing-arrow": ["error", {"allowParens": true}], - "arrow-parens": 0, + "arrow-parens": ["error", "as-needed"], "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], "import/prefer-default-export": 0, "object-curly-newline": ["error", { "consistent": true }] diff --git a/.npmignore b/.npmignore index 4b03951a..31c4bf63 100644 --- a/.npmignore +++ b/.npmignore @@ -3,16 +3,15 @@ __mocks__ .vscode coverage stories -!dist/* +!dist flow-typed .babelrc .eslintignore -.eslintrc +.eslintrc.json .flowconfig .travis.yml jsconfig.json rollup.config.*.js test-config.js yarn.lock -package-lock.json *.log \ No newline at end of file diff --git a/package.json b/package.json index 2e5a68a9..5348e0c8 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "build": "rimraf dist/index.*.* dist/*.css && npm run build:dev && npm run build:prod", "start": "npm run build:dev -- -w", "test": "cross-env BABEL_ENV=commonjs jest", - "lint": "eslint src stories", + "lint": "eslint src stories *.js", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" }, @@ -77,8 +77,9 @@ "rollup-plugin-uglify": "^2.0.1", "uglify-es": "^3.1.9" }, - "dependencies": { - "react": "^16.1.1", - "react-dom": "^16.1.1" + "dependencies": {}, + "peerDependencies": { + "react": "^16.2.0", + "react-dom": "^16.2.0" } } diff --git a/yarn.lock b/yarn.lock index fc0dfd4e..f6c33dd1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6114,9 +6114,9 @@ react-docgen@^2.15.0: node-dir "^0.1.10" recast "^0.12.6" -react-dom@^16.1.1: - version "16.1.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.1.1.tgz#b2e331b6d752faf1a2d31399969399a41d8d45f8" +react-dom@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.0.tgz#69003178601c0ca19b709b33a83369fe6124c044" dependencies: fbjs "^0.8.16" loose-envify "^1.1.0" @@ -6230,9 +6230,9 @@ react-treebeard@^2.0.3: shallowequal "^0.2.2" velocity-react "^1.3.1" -react@^16.1.1: - version "16.1.1" - resolved "https://registry.yarnpkg.com/react/-/react-16.1.1.tgz#d5c4ef795507e3012282dd51261ff9c0e824fe1f" +react@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba" dependencies: fbjs "^0.8.16" loose-envify "^1.1.0" From afffad567a36191e869c4565297c0dfdaa844584 Mon Sep 17 00:00:00 2001 From: psychobolt Date: Fri, 1 Dec 2017 21:22:40 -0800 Subject: [PATCH 2/3] Include React and React DOM in dev dependencies --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 5348e0c8..e9357631 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,8 @@ "flow-typed": "2.2.3", "jest": "^21.2.1", "raf": "^3.4.0", + "react": "^16.2.0", + "react-dom": "^16.2.0", "rimraf": "^2.6.2", "rollup": "^0.51.5", "rollup-plugin-babel": "^3.0.2", From b7b3b4dbf71a0ef0e6f3d6994dafb1368a15e004 Mon Sep 17 00:00:00 2001 From: psychobolt Date: Fri, 1 Dec 2017 21:28:31 -0800 Subject: [PATCH 3/3] Add dev and peer dependencies badges --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 54844e65..68035918 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # React Rollup Boilerplate -[![Build Status](https://travis-ci.org/psychobolt/react-rollup-boilerplate.svg?branch=master)](https://travis-ci.org/psychobolt/react-rollup-boilerplate) [![Dependencies Status](https://david-dm.org/psychobolt/react-rollup-boilerplate.svg)](https://david-dm.org/psychobolt/react-rollup-boilerplate) +[![Dev Dependencies Status](https://david-dm.org/psychobolt/react-rollup-boilerplate/dev-status.svg)](https://david-dm.org/psychobolt/react-rollup-boilerplate?type=dev) +[![Peer Dependencies Status](https://david-dm.org/psychobolt/react-rollup-boilerplate/peer-status.svg)](https://david-dm.org/psychobolt/react-rollup-boilerplate?type=peer) + +[![Build Status](https://travis-ci.org/psychobolt/react-rollup-boilerplate.svg?branch=master)](https://travis-ci.org/psychobolt/react-rollup-boilerplate) [![codecov](https://codecov.io/gh/psychobolt/react-rollup-boilerplate/branch/master/graph/badge.svg)](https://codecov.io/gh/psychobolt/react-rollup-boilerplate) A boilerplate for building React libraries