diff --git a/.gitignore b/.gitignore index cf97db2..46c6ef0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules dist +lib coverage *.log diff --git a/.npmignore b/.npmignore index 5e5cab4..4812941 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,9 @@ test coverage +flow-typed +src +test .circleci .flowconfig -flow-typed +webpack.config.js +yarn.lock \ No newline at end of file diff --git a/package.json b/package.json index 6abb2af..7c486f2 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,8 @@ { "name": "react-dfb", - "version": "1.0.0", + "version": "1.0.2", "description": "A button to allow to download file without href link", - "main": "dist/index.js", - "es6": "src/index.js", + "main": "lib/index.js", "license": "MIT", "author": { "name": "Hugo Capocci", @@ -48,6 +47,7 @@ "enzyme": "3.4.4", "enzyme-adapter-react-16": "1.2.0", "flow-bin": "0.79.1", + "flow-copy-source": "2.0.2", "jest": "23.5.0", "react": "16.4.2", "react-dom": "16.4.2", @@ -58,9 +58,15 @@ "scripts": { "flow": "flow", "prepublish:old": "yarn flow && yarn test", - "prepare": "yarn build", + "prepare": "webpack && yarn build-js && yarn build-flow", "test": "jest", - "build": "webpack ", + "build-js": "babel src -d lib --ignore *.test.jsx", + "build-flow": "flow-copy-source src lib -i *.test.*", "build-analyse": "ANALYSE_BUNDLE=true webpack" - } + }, + "files": [ + "README.md", + "dist/", + "lib/" + ] } diff --git a/src/index.jsx b/src/index.jsx index 8a81ad3..2fd9d3d 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -18,10 +18,7 @@ type Props = { label?: string, }; -type State = {}; - -class DownloadButton extends React.Component { - state = {}; +class DownloadButton extends React.Component { static defaultProps = { disabled: false, downloadData: { diff --git a/yarn.lock b/yarn.lock index 3b2e5e4..9d22c90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1469,7 +1469,7 @@ chokidar@^1.6.1: optionalDependencies: fsevents "^1.0.0" -chokidar@^2.0.2: +chokidar@^2.0.0, chokidar@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" dependencies: @@ -1552,7 +1552,7 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -codecov@^3.0.4: +codecov@3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.0.4.tgz#37f2bf9ed71086923aac7496d982e32e5899dfd8" dependencies: @@ -2429,6 +2429,16 @@ flow-bin@0.79.1: version "0.79.1" resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.79.1.tgz#01c9f427baa6556753fa878c192d42e1ecb764b6" +flow-copy-source@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/flow-copy-source/-/flow-copy-source-2.0.2.tgz#096e579a9bb63a38afc5d4dd68ac847a5be27594" + dependencies: + chokidar "^2.0.0" + fs-extra "^7.0.0" + glob "^7.0.0" + kefir "^3.7.3" + yargs "^12.0.1" + flush-write-stream@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" @@ -2479,6 +2489,14 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" +fs-extra@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.0.tgz#8cc3f47ce07ef7b3593a11b9fb245f7e34c041d6" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -2572,7 +2590,7 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob@^7.0.3, glob@^7.1.1: +glob@^7.0.0, glob@^7.0.3, glob@^7.1.1: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" dependencies: @@ -2602,7 +2620,7 @@ globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -3554,6 +3572,12 @@ json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + optionalDependencies: + graceful-fs "^4.1.6" + jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -3563,6 +3587,12 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +kefir@^3.7.3: + version "3.8.3" + resolved "https://registry.yarnpkg.com/kefir/-/kefir-3.8.3.tgz#8e0ab10084ed8a01cbb5d4f7f18a0b859f7b9bd9" + dependencies: + symbol-observable "1.0.4" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -5301,6 +5331,10 @@ supports-color@^5.3.0, supports-color@^5.4.0: dependencies: has-flag "^3.0.0" +symbol-observable@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" + symbol-tree@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" @@ -5510,6 +5544,10 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"