From 7b4801144df0624fc5912ce38c8fc8164e0b7f86 Mon Sep 17 00:00:00 2001 From: masoud Date: Thu, 18 Apr 2019 11:34:47 +0430 Subject: [PATCH 1/3] change guery string library --- package.json | 6 ++-- src/Link.js | 3 +- src/createBrowserApp.js | 3 +- yarn.lock | 65 +++++------------------------------------ 4 files changed, 12 insertions(+), 65 deletions(-) diff --git a/package.json b/package.json index feff6dd..c7fd83a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "homepage": "https://github.com/react-navigation/react-navigation-web#readme", "dependencies": { "history": "^4.7.2", - "query-string": "^6.2.0" + "qs": "^6.7.0" }, "devDependencies": { "babel-cli": "^6.26.0", @@ -66,9 +66,9 @@ "release-it": "^7.6.1" }, "peerDependencies": { + "@react-navigation/core": "^3.0.0-alpha.13", "react": "*", - "react-dom": "*", - "@react-navigation/core": "^3.0.0-alpha.13" + "react-dom": "*" }, "jest": { "preset": "react-native", diff --git a/src/Link.js b/src/Link.js index 91441b5..f1e0517 100644 --- a/src/Link.js +++ b/src/Link.js @@ -1,7 +1,6 @@ import React, { Component } from 'react'; import { withNavigation, NavigationActions } from '@react-navigation/core'; - -const queryString = require('query-string'); +import queryString from 'qs'; const getTopNavigation = navigation => { const parent = navigation.dangerouslyGetParent(); diff --git a/src/createBrowserApp.js b/src/createBrowserApp.js index 2e01c09..f73f821 100644 --- a/src/createBrowserApp.js +++ b/src/createBrowserApp.js @@ -7,9 +7,8 @@ import { getNavigation, NavigationProvider, } from '@react-navigation/core'; +import queryString from 'qs'; -/* eslint-disable import/no-commonjs */ -const queryString = require('query-string'); const history = createBrowserHistory(); diff --git a/yarn.lock b/yarn.lock index fa74775..f8d6b3a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -607,17 +607,6 @@ node-fetch "^2.1.1" url-template "^2.0.8" -"@react-navigation/core@^3.0.0-alpha.7": - version "3.0.0-alpha.7" - resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-3.0.0-alpha.7.tgz#10116867febd74a371a7cc393c3dd6071e25ceae" - integrity sha512-aUbUAUgNpOppxj59E++S39gBiRCLlttzmwxeZoIJJ57q3IQ2vXNjXiAl66xJeRTIGT5GsEn0nOJO4YeSd5FOfQ== - dependencies: - create-react-context "^0.2.3" - hoist-non-react-statics "^3.0.1" - path-to-regexp "^1.7.0" - query-string "^6.2.0" - react-lifecycles-compat "^3.0.4" - "@sindresorhus/is@^0.7.0": version "0.7.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" @@ -2675,14 +2664,6 @@ create-react-class@^15.6.3: loose-envify "^1.3.1" object-assign "^4.1.1" -create-react-context@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.3.tgz#9ec140a6914a22ef04b8b09b7771de89567cb6f3" - integrity sha512-CQBmD0+QGgTaxDL3OX1IDXYqjkp2It4RIbcb99jS6AEg27Ga+a9G3JtK6SIu0HBwPLZlmwt9F7UwWA4Bn92Rag== - dependencies: - fbjs "^0.8.0" - gud "^1.0.0" - cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -3615,7 +3596,7 @@ fbjs-scripts@^0.8.1: semver "^5.1.0" through2 "^2.0.0" -fbjs@^0.8.0, fbjs@^0.8.14, fbjs@^0.8.16, fbjs@^0.8.9: +fbjs@^0.8.14, fbjs@^0.8.16, fbjs@^0.8.9: version "0.8.17" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= @@ -4063,11 +4044,6 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -gud@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" - integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw== - handlebars@^4.0.2, handlebars@^4.0.3: version "4.0.12" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" @@ -4188,13 +4164,6 @@ history@^4.7.2: value-equal "^0.4.0" warning "^3.0.0" -hoist-non-react-statics@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.0.1.tgz#fba3e7df0210eb9447757ca1a7cb607162f0a364" - integrity sha512-1kXwPsOi0OGQIZNVMPvgWJ9tSnGMiMfJdihqEzrPEXlHOBh9AAHXX/QYmAJTXztnz/K+PQ8ryCb4eGaN6HlGbQ== - dependencies: - react-is "^16.3.2" - home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" @@ -6523,13 +6492,6 @@ path-parse@^1.0.5: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== -path-to-regexp@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d" - integrity sha1-Wf3g9DW62suhA6hOnTvGTpa5k30= - dependencies: - isarray "0.0.1" - path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -6783,6 +6745,11 @@ q@^1.4.1, q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= +qs@^6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -6797,14 +6764,6 @@ query-string@^5.0.1: object-assign "^4.1.0" strict-uri-encode "^1.0.0" -query-string@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.2.0.tgz#468edeb542b7e0538f9f9b1aeb26f034f19c86e1" - integrity sha512-5wupExkIt8RYL4h/FE+WTg3JHk62e6fFPWtAZA9J5IWK1PfTfKkMS93HBUHcFpeYi9KsY5pFbh+ldvEyaz5MyA== - dependencies: - decode-uri-component "^0.2.0" - strict-uri-encode "^2.0.0" - quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" @@ -6862,16 +6821,11 @@ react-dom@16.3.1: object-assign "^4.1.1" prop-types "^15.6.0" -react-is@^16.3.1, react-is@^16.3.2, react-is@^16.5.2: +react-is@^16.3.1, react-is@^16.5.2: version "16.5.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.5.2.tgz#e2a7b7c3f5d48062eb769fcb123505eb928722e3" integrity sha512-hSl7E6l25GTjNEZATqZIuWOgSnpXb3kD0DVCujmg46K5zLxsbiKaaT6VO9slkSBDPZfYs30lwfJwbOFOnoEnKQ== -react-lifecycles-compat@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" - integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== - react-native@^0.55.4: version "0.55.4" resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.55.4.tgz#eecffada3750a928e2ddd07cf11d857ae9751c30" @@ -7865,11 +7819,6 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= -strict-uri-encode@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" - integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= - string-length@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" From e91e84753c494e6254afb2e5f562e8a71c0db1c3 Mon Sep 17 00:00:00 2001 From: masoud Date: Sat, 20 Apr 2019 13:35:55 +0430 Subject: [PATCH 2/3] fix lint issue --- src/createBrowserApp.js | 1 - src/index.js | 14 +++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/createBrowserApp.js b/src/createBrowserApp.js index f73f821..6f3ae6f 100644 --- a/src/createBrowserApp.js +++ b/src/createBrowserApp.js @@ -9,7 +9,6 @@ import { } from '@react-navigation/core'; import queryString from 'qs'; - const history = createBrowserHistory(); const getPathAndParamsFromLocation = location => { diff --git a/src/index.js b/src/index.js index f1d7757..280f79e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,11 +1,3 @@ -module.exports = { - get createBrowserApp() { - return require('./createBrowserApp').default; - }, - get handleServerRequest() { - return require('./handleServerRequest').default; - }, - get Link() { - return require('./Link').default; - }, -}; +export const createBrowserApp = require('./createBrowserApp').default; +export const handleServerRequest = require('./handleServerRequest').default; +export const Link = require('./Link').default; From 7e34975b04aace11af2fb5dd5b14513f01ddf5fd Mon Sep 17 00:00:00 2001 From: masoud Date: Sat, 20 Apr 2019 13:52:59 +0430 Subject: [PATCH 3/3] test issue --- package.json | 3 ++- yarn.lock | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c7fd83a..db07b18 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,8 @@ "react-dom": "16.3.1", "react-native": "^0.55.4", "react-test-renderer": "16.3.1", - "release-it": "^7.6.1" + "release-it": "^7.6.1", + "@react-navigation/core": "*" }, "peerDependencies": { "@react-navigation/core": "^3.0.0-alpha.13", diff --git a/yarn.lock b/yarn.lock index f8d6b3a..78bd94d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -607,6 +607,16 @@ node-fetch "^2.1.1" url-template "^2.0.8" +"@react-navigation/core@*": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-3.3.1.tgz#14021eff792a6e27ee407c867d454b25507efdf2" + integrity sha512-pvvnUPUe4Pf5hJ8+fAsRsuNaBT8kcxmBJkd9SsFA7aftvEnAIXL9mEanMJyhtUAw2s6nipqu4E+Mw1ToPhW6oA== + dependencies: + hoist-non-react-statics "^2.5.5" + path-to-regexp "^1.7.0" + query-string "^6.2.0" + react-is "^16.6.3" + "@sindresorhus/is@^0.7.0": version "0.7.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" @@ -4164,6 +4174,11 @@ history@^4.7.2: value-equal "^0.4.0" warning "^3.0.0" +hoist-non-react-statics@^2.5.5: + version "2.5.5" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47" + integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw== + home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" @@ -6492,6 +6507,13 @@ path-parse@^1.0.5: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== +path-to-regexp@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d" + integrity sha1-Wf3g9DW62suhA6hOnTvGTpa5k30= + dependencies: + isarray "0.0.1" + path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -6764,6 +6786,15 @@ query-string@^5.0.1: object-assign "^4.1.0" strict-uri-encode "^1.0.0" +query-string@^6.2.0: + version "6.4.2" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.4.2.tgz#8be1dbd105306aebf86022144f575a29d516b713" + integrity sha512-DfJqAen17LfLA3rQ+H5S4uXphrF+ANU1lT2ijds4V/Tj4gZxA3gx5/tg1bz7kYCmwna7LyJNCYqO7jNRzo3aLw== + dependencies: + decode-uri-component "^0.2.0" + split-on-first "^1.0.0" + strict-uri-encode "^2.0.0" + quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" @@ -6826,6 +6857,11 @@ react-is@^16.3.1, react-is@^16.5.2: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.5.2.tgz#e2a7b7c3f5d48062eb769fcb123505eb928722e3" integrity sha512-hSl7E6l25GTjNEZATqZIuWOgSnpXb3kD0DVCujmg46K5zLxsbiKaaT6VO9slkSBDPZfYs30lwfJwbOFOnoEnKQ== +react-is@^16.6.3: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + react-native@^0.55.4: version "0.55.4" resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.55.4.tgz#eecffada3750a928e2ddd07cf11d857ae9751c30" @@ -7720,6 +7756,11 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz#e2a303236cac54b04031fa7a5a79c7e701df852f" integrity sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w== +split-on-first@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.0.0.tgz#648af4ce9a28fbcaadd43274455f298b55025fc6" + integrity sha512-mjA57TQtdWztVZ9THAjGNpgbuIrNfsNrGa5IyK94NoPaT4N14M+GI4jD7t4arLjFkYRQWdETC5RxFzLWouoB3A== + split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -7819,6 +7860,11 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= + string-length@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed"