From 3d3f50049ea4301a20eb4795d93cae4851c447b3 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Wed, 7 Jun 2017 23:08:21 +0300 Subject: [PATCH] #85: add flow --- .babelrc | 2 +- .flowconfig | 14 ++++++++++++++ npm-shrinkwrap.json | 8 +++++++- package.json | 5 ++++- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .flowconfig diff --git a/.babelrc b/.babelrc index 3605b4e..94791de 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { - "presets": ["react", "es2015", "es2017", "stage-0"], + "presets": ["react", "flow", "es2015", "es2017", "stage-0"], "plugins": [ ["transform-runtime", {"polyfill": false}], "transform-function-bind", diff --git a/.flowconfig b/.flowconfig new file mode 100644 index 0000000..948b322 --- /dev/null +++ b/.flowconfig @@ -0,0 +1,14 @@ +[ignore] + +[include] + +[libs] + +[options] +module.system.node.resolve_dirname=node_modules +module.system.node.resolve_dirname=src +module.file_ext=.js +module.file_ext=.json +module.file_ext=.jsx +module.file_ext=.css +module.file_ext=.scss diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d31a409..f5c472e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1626,7 +1626,7 @@ }, "babel-preset-flow": { "version": "6.23.0", - "from": "babel-preset-flow@>=6.23.0 <7.0.0", + "from": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", "resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", "dev": true }, @@ -3431,6 +3431,12 @@ "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", "dev": true }, + "flow-bin": { + "version": "0.47.0", + "from": "flow-bin@latest", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.47.0.tgz", + "dev": true + }, "fontgen-loader": { "version": "0.2.1", "from": "fontgen-loader@>=0.2.1 <0.3.0", diff --git a/package.json b/package.json index ae94268..f64b6e8 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "lockDeps": "npm shrinkwrap --dev", "test": "npm run build:dll && karma start ./karma.conf.js", "lint": "eslint ./src", + "flow": "flow", "i18n:collect": "babel-node ./scripts/i18n-collect.js", "i18n:publish": "babel-node --presets es2015,stage-0 ./scripts/i18n-onesky.js publish", "i18n:pull": "babel-node --presets es2015,stage-0 ./scripts/i18n-onesky.js pull", @@ -56,8 +57,9 @@ "babel-plugin-transform-runtime": "^6.3.13", "babel-preset-airbnb": "^2.0.0", "babel-preset-es2015": "^6.3.13", - "babel-preset-es2017": "^6.16.0", "babel-preset-react": "^6.3.13", + "babel-preset-es2017": "^6.16.0", + "babel-preset-flow": "^6.23.0", "babel-preset-react-hmre": "^1.0.1", "babel-preset-stage-0": "^6.3.13", "babel-runtime": "^6.0.0", @@ -70,6 +72,7 @@ "exports-loader": "^0.6.3", "extract-text-webpack-plugin": "^1.0.0", "file-loader": "^0.11.0", + "flow-bin": "^0.47.0", "fontgen-loader": "^0.2.1", "html-loader": "^0.4.3", "html-webpack-plugin": "^2.0.0",