Skip to content

Commit

Permalink
chore: update babel, rollup, prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
wuweiweiwu committed Dec 10, 2018
1 parent 0b25780 commit 0e3a8a0
Show file tree
Hide file tree
Showing 5 changed files with 1,333 additions and 2,386 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
21 changes: 0 additions & 21 deletions .babelrc.js

This file was deleted.

76 changes: 33 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,46 @@
"react-split-pane",
"es6"
],
"scripts": {
"prebuild": "npm run clean",
"build": "rollup -c",
"build:watch": "rollup -c --watch",
"clean": "rimraf dist",
"test": "mochify -R spec --transform babelify",
"test:watch": "mochify -R spec --watch --transform babelify",
"test:coverage": "mochify --plugin [ mochify-istanbul --exclude '**/test/**' --report lcovonly ] --transform babelify && cat lcov.info | coveralls && rm lcov.info",
"website:start": "npm run start --prefix website",
"website:deploy": "npm run deploy --prefix website",
"prettier": "prettier --write '{src,test}/**/*.js'",
"lint": "eslint src test",
"release:patch": "npm test && npm run build && npm version patch && git push && npm publish",
"precommit": "lint-staged"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"dependencies": {
"inline-style-prefixer": "^3.0.6",
"prop-types": "^15.5.10",
"react": "^16.6.3",
"react-dom": "^16.6.3",

This comment has been minimized.

Copy link
@vladar

vladar Dec 25, 2018

Why adding directly to dependencies vs peerDeps? It causes duplicate react versions in projects using a lower version of react and breaks semver in a very unexpected ways (which just happened with my storybook installation).

This comment has been minimized.

Copy link
@JabbyPanda

JabbyPanda Feb 6, 2019

@vladar I agree with you, this react dependency shall be placed into peerDependencies section

"react-lifecycles-compat": "^3.0.4",
"react-style-proptype": "^3.0.0"
},
"devDependencies": {
"@types/inline-style-prefixer": "^3.0.1",
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@babel/preset-react": "^7.0.0",
"@types/react": "^16.0.36",
"babel-cli": "^6.24.1",
"babel-eslint": "^8.2.3",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babelify": "^7.3.0",
"babel-eslint": "^10.0.1",
"babelify": "^10.0.0",
"chai": "^4.0.2",
"chai-spies": "^0.7.1",
"coveralls": "^2.13.1",
"cross-env": "^5.2.0",
"eslint": "^4.19.1",
"eslint-config-fbjs": "^2.0.1",
"eslint-config-fbjs": "^2.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-config-react": "^1.1.7",
"eslint-plugin-babel": "^5.1.0",
Expand All @@ -57,43 +75,15 @@
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.9.1",
"eslint-plugin-relay": "^0.0.21",
"husky": "^0.14.3",
"lint-staged": "^7.2.0",
"husky": "^1.2.0",
"mochify": "^5.8.0",
"mochify-istanbul": "^2.4.2",
"prettier": "^1.13.5",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"prettier": "1.15.3",
"pretty-quick": "^1.8.0",
"rimraf": "^2.6.2",
"rollup": "^0.60.7",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-node-resolve": "^3.3.0",
"surge": "^0.19.0"
},
"scripts": {
"build": "npm run clean && rollup -c",
"build:watch": "rollup -c --watch",
"clean": "rimraf dist",
"test": "cross-env NODE_ENV=test mochify -R spec --transform babelify",
"test:watch": "cross-env NODE_ENV=test mochify -R spec --watch --transform babelify",
"test:coverage": "cross-env NODE_ENV=test mochify --plugin [ mochify-istanbul --exclude '**/test/**' --report lcovonly ] --transform babelify && cat lcov.info | coveralls && rm lcov.info",
"website:start": "npm run start --prefix website",
"website:deploy": "npm run deploy --prefix website",
"prettier": "prettier --write '{src,test}/**/*.js'",
"lint": "eslint src test",
"release:patch": "npm test && npm run build && npm version patch && git push && npm publish",
"precommit": "lint-staged"
},
"lint-staged": {
"*.js": [
"prettier --write",
"git add"
]
},
"babel": {
"presets": [
"./.babelrc.js"
]
"rollup-plugin-node-resolve": "^3.3.0"
}
}
29 changes: 21 additions & 8 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@
"whatwg-fetch": "2.0.3"
},
"jest": {
"collectCoverageFrom": ["src/**/*.{js,jsx,mjs}"],
"setupFiles": ["<rootDir>/config/polyfills.js"],
"collectCoverageFrom": [
"src/**/*.{js,jsx,mjs}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs}",
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs}"
Expand All @@ -78,10 +82,11 @@
"transform": {
"^.+\\.(js|jsx|mjs)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|mjs|css|json)$)":
"<rootDir>/config/jest/fileTransform.js"
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"],
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
},
Expand All @@ -96,20 +101,28 @@
]
},
"babel": {
"presets": ["react-app"]
"presets": [
"react-app"
]
},
"eslintConfig": {
"extends": "react-app"
},
"devDependencies": {
"language-babel": "https://github.com/gandm/language-babel"
"language-babel": "https://github.com/gandm/language-babel",
"surge": "^0.20.1"
},
"browserslist": {
"development": [
"last 2 chrome versions",
"last 2 firefox versions",
"last 2 edge versions"
],
"production": [">1%", "last 4 versions", "Firefox ESR", "not ie < 11"]
"production": [
">1%",
"last 4 versions",
"Firefox ESR",
"not ie < 11"
]
}
}
Loading

0 comments on commit 0e3a8a0

Please sign in to comment.