{"_id":"@benjaminnoufel/react-router","_rev":"6-be940a4096c05e55a6a3c0915b304728","time":{"1.0.0":"2021-01-19T13:08:33.030Z","1.0.1":"2021-01-19T13:08:33.030Z","1.0.2":"2021-01-19T13:08:33.030Z","created":"2021-02-09T02:59:35.120Z","0.1.0":"2021-02-09T02:59:35.556Z","modified":"2022-04-04T18:22:51.941Z"},"name":"@benjaminnoufel/react-router","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@benjaminnoufel/react-router","version":"0.1.0","description":"This a React Router componant for initialize a router.","license":"MIT","main":"./lib/ReactRouter.js","types":"./lib/ReactRouter.d.ts","scripts":{"build":"rollup --config rollup.config.js","types":"tsc --declaration --emitDeclarationOnly --declarationDir lib","lint":"eslint --ext .ts,.js,.json,tsx ."},"devDependencies":{"@benjaminnoufel/eslint-config-javascript":"^0.1.3","@benjaminnoufel/eslint-config-typescript":"^0.1.2","@rollup/plugin-typescript":"^8.1.1","@types/react":"^16.9.51","@types/react-router-dom":"^5.1.6","@typescript-eslint/eslint-plugin":"^4.14.2","@typescript-eslint/parser":"^4.14.2","eslint":"^7.5.0","eslint-loader":"^4.0.2","eslint-plugin-jest":"^24.1.3","eslint-plugin-json":"^2.1.2","eslint-plugin-react-hooks":"^4.0.8","rollup":"^2.38.4","rollup-plugin-delete":"^2.0.0","rollup-plugin-terser":"^7.0.2","tslib":"^2.0.3","typescript":"^4.1.3"},"peerDependencies":{"@material-ui/core":"4","react":"16","react-router-dom":"5"},"licenseText":"Copyright 2020 404 Place Vendôme\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@benjaminnoufel/react-router@0.1.0","dist":{"shasum":"2fe7406dec6368ea0af6c3517ddd809ca9120896","integrity":"sha512-4jsrB27tDpMJjpZJFZnnNxciyOCzSd2z2T+yG6lwf/IipLB3juVgRfZiYii7LC1BXGr0mJpzThjR5zpMwXrq4A==","tarball":"https://registry.npmjs.org/@benjaminnoufel/react-router/-/react-router-0.1.0.tgz","fileCount":8,"unpackedSize":7382,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIfqYCRA9TVsSAnZWagAAkCMP/1mdZvdprJlJRGRdNS67\n6muLhTXJIMEQ6NuA26oG88ASttypqPzH8MdKHR8mfETWv1ayeQFNHIYqSCKJ\ngKoP7QhMg2rJHJI5nW8BX7n9ja/YOJOlx2/9voB8bYjP5o6Ik57MwhCEhLDw\n2JEBC+tTGdBY1sYbCGfGCxbbU+CpRUp5I1NACmsetk1yciOUIHcrVG/voOCr\nzpnbm8gw+IVoyCHAmx12n+dsz/4R1yzqurXS4hQwThk3t8a02lqpBTcDp/Gi\nGVJoBpiTHg051lAYw+DQCAim7nhnMiF9yofvokIprC3qE3Asxp74Gzgimcv6\n8RNtlzS/7Fj04M5IVULOXjvWhT4p/jtnA3Khwx8tFR+tIH85XZs9zmafsV+o\nNW8gCmz10Gy1h6ZiLYhP5Vpqxmtsjq/60v0E+uB38LCkuMMlUrAw8ukJpUCa\nzBYlNf8LRXibVaOYfVuvcXUQ7DBWoWY+bONIiGSL/NeY5aEZHf8a9TVTsa1O\neayTd3SqK0G+0FN2f5FB9ZW0xgiVExtHqmYiOTqBnMxp9hQjCCCtmARv0gY1\n4y8oVdNK2HIv61/aIkZjfJylCGo9vdgPL2A0Q/47H4IwEQZhewbY7S/hHhrO\n5RYLXwjP1zFWgdoHkwP5+3Yukn4zPaK5d3zJZrRXjyGeGYUv4fpp+6dE1lt4\nFENc\r\n=RDXu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfirZURzAg5Ll2Px7HCXURlTWsLxYp6L1g7wB2dkE7fwIgZSN2jCOaNBlrBOhY7jO6Mxmk322RbEm89AtaVDvu0wQ="}]},"_npmUser":{"name":"bnoufel","email":"benjamin.noufel@gmail.com"},"directories":{},"maintainers":[{"name":"bnoufel","email":"benjamin.noufel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-router_0.1.0_1612839575341_0.26776720609483484"},"_hasShrinkwrap":false}},"maintainers":[{"name":"bnoufel","email":"benjamin.noufel@gmail.com"}],"description":"This a React Router componant for initialize a router.","license":"MIT","readme":"# react-router\n\nThis a React Router componant for initialize a router.\n\n![Code Style CI](https://github.com/benjaminnoufel/react-router/workflows/Code%20Style%20CI/badge.svg)\n![Package](https://github.com/benjaminnoufel/react-router/workflows/Package/badge.svg)\n![Package npmjs](https://github.com/benjaminnoufel/react-router/workflows/Package%20npmjs/badge.svg)\n\n## Requirements\n\n- [Node](node)\n- [NPM][npm] or [Yarn][yarn]\n\n## Installation\n\n### [NPM][npm]\n\n```console\n$ npm install --save @benjaminnoufel/react-router\n```\n\n### [Yarn][yarn]\n\n```console\n$ yarn add @benjaminnoufel/react-router\n```\n\n## Environment setup\n\n```console\n$ cp .env.example .env\n$ $EDITOR .env\n```\n\nWhere `$EDITOR` is your favorite text editor's command line interface.\n\n## Usage\n\n### Use ReactRouter with only connected routes\n```tsx\nimport ReactRouter from \"@benjaminnoufel/react-router\"\nimport React, {FC as FunctionalComponent, LazyExoticComponent, lazy} from \"react\";\n\nconst App = () => {\n    const HomePage: LazyExoticComponent<FunctionalComponent> = lazy(() => import(\"@Pages/HomePage\"));\n    const Logout: LazyExoticComponent<FunctionalComponent> = lazy(() => import(\"@Pages/Logout\"));\n    const NotFoundPage: LazyExoticComponent<FunctionalComponent> = lazy(() => import(\"@Pages/404\"));\n\n    const isConnectedRoutes = [\n        {\n            exact: true,\n            path: \"/home\",\n            component: HomePage\n        },\n        {\n            exact: true,\n            path: \"/logout\",\n            component: Logout\n        }\n    ];\n\n\n    return (\n        <>\n            <ReactRouter\n                isConnectedRoutes={isConnectedRoutes}\n                isDisconnectRoutes={[]}\n                globalRoutes={[]}\n                notFoundPage={NotFoundPage}\n                isConnected={true}\n\n            />\n        </>\n    );   \n}\n\n```\n\n### Use ReactRouter with connected, disconnected and global routes\n```tsx\nimport ReactRouter from \"@benjaminnoufel/react-router\"\nimport React, {FC as FunctionalComponent, LazyExoticComponent, lazy} from \"react\";\n\nconst App = () => {\n    const HomePage: LazyExoticComponent<FunctionalComponent> = lazy(() => import(\"@Pages/HomePage\"));\n    const Logout: LazyExoticComponent<FunctionalComponent> = lazy(() => import(\"@Pages/Logout\"));\n    const Login: LazyExoticComponent<FunctionalComponent> = lazy(() => import(\"@Pages/Login\"));\n    const Information: LazyExoticComponent<FunctionalComponent> = lazy(() => import(\"@Pages/Information\"));\n\n    const isConnectedRoutes = [\n        {\n            exact: true,\n            path: \"/home\",\n            component: HomePage\n        },\n        {\n            exact: true,\n            path: \"/logout\",\n            component: Logout\n        }\n    ];\n\n    const isDisconnectRoutes = [\n        {\n            exact: true,\n            path: \"/login\",\n            component: Login\n        }\n    ];\n\n    const globalRoutes = [\n        {\n            exact: true,\n            path: \"/\",\n            component: Information\n        }\n    ];\n\n    return (\n        <>\n            <ReactRouter\n                isConnectedRoutes={isConnectedRoutes}\n                isDisconnectRoutes={isDisconnectRoutes}\n                globalRoutes={globalRoutes}\n                notFoundPage={NotFoundPage}\n                isConnected={true}\n            />\n        </>\n    );   \n}\n\n```\n\n### API\n\n```ts\nimport {RouteProps} from \"react-router-dom\";\ninterface IRouterItems extends RouteProps {}\n\ninterface IRouter {\n    isConnectedRoutes: IRouterItems[];\n    isDisconnectRoutes: IRouterItems[];\n    globalRoutes: IRouterItems[];\n    notFoundPage: LazyExoticComponent<FunctionalComponent>;\n    isConnected: boolean;\n}\n```\n\n\n[npm]: https://www.npmjs.com/\n[yarn]: https://yarnpkg.com/\n","readmeFilename":"README.md"}