Skip to content
This repository was archived by the owner on Apr 27, 2022. It is now read-only.

Commit f61be02

Browse files
committed
people route
1 parent 4c8bb4c commit f61be02

File tree

7 files changed

+63
-106
lines changed

7 files changed

+63
-106
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"dependencies": {
1717
"cross-fetch": "^3.0.1",
1818
"next": "^8.0.3",
19+
"next-routes": "^1.4.2",
1920
"prettier": "^1.16.4",
2021
"react": "^16.8.4",
2122
"react-dom": "^16.8.4"
@@ -26,4 +27,4 @@
2627
"jest": "^24.5.0",
2728
"react-testing-library": "^6.0.1"
2829
}
29-
}
30+
}

pages/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class Home extends React.Component {
2222
<Link href="/about">
2323
<a role="link">About</a>
2424
</Link>
25+
<Link href="/people/">
26+
<a role="link">Go to people</a>
27+
</Link>
2528
</div>
2629
);
2730
}

pages/people/chris.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from "react";
2+
3+
class Persons extends React.Component {
4+
render() {
5+
return (
6+
<div>
7+
<h1>Chris Coyier</h1>
8+
</div>
9+
);
10+
}
11+
}
12+
13+
export default Persons;

pages/people/index.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import { Link } from "../../routes";
3+
4+
class Persons extends React.Component {
5+
render() {
6+
return (
7+
<div>
8+
<h1>People</h1>
9+
<Link route="people/csss">Chris Coyier</Link>
10+
</div>
11+
);
12+
}
13+
}
14+
15+
export default Persons;

pages/people/people.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from "react";
2+
import { Link } from "../../routes";
3+
4+
class Person extends React.Component {
5+
render() {
6+
return (
7+
<div>
8+
<h1>This is a person!!!!</h1>
9+
</div>
10+
);
11+
}
12+
}
13+
14+
export default Person;

routes.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const routes = require("next-routes");
2+
3+
module.exports = routes().add("people", "/people/:person");

yarn.lock

+13-105
Original file line numberDiff line numberDiff line change
@@ -909,11 +909,6 @@
909909
resolved "https://registry.yarnpkg.com/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.2.tgz#8013f2af54a2b7d735f71560ff360d3a8176a87b"
910910
integrity sha512-vTCdPp/T/Q3oSqwHmZ5Kpa9oI7iLtGl3RQaA/NyLHikvcrPxACkkKVr/XzkSPJWXHRhKGzVvb0urJsbMlRxi1Q==
911911

912-
"@types/anymatch@*":
913-
version "1.3.1"
914-
resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a"
915-
integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA==
916-
917912
"@types/babel__core@^7.1.0":
918913
version "7.1.0"
919914
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.0.tgz#710f2487dda4dcfd010ca6abb2b4dc7394365c51"
@@ -952,105 +947,16 @@
952947
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#2cc2ca41051498382b43157c8227fea60363f94a"
953948
integrity sha512-ohkhb9LehJy+PA40rDtGAji61NCgdtKLAlFoYp4cnuuQEswwdK3vz9SOIkkyc3wrk8dzjphQApNs56yyXLStaQ==
954949

955-
"@types/jest-diff@*":
956-
version "20.0.1"
957-
resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89"
958-
integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==
959-
960-
"@types/jest@^24.0.11":
961-
version "24.0.11"
962-
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.11.tgz#1f099bea332c228ea6505a88159bfa86a5858340"
963-
integrity sha512-2kLuPC5FDnWIDvaJBzsGTBQaBbnDweznicvK7UGYzlIJP4RJR2a4A/ByLUXEyEgag6jz8eHdlWExGDtH3EYUXQ==
964-
dependencies:
965-
"@types/jest-diff" "*"
966-
967-
"@types/next-server@*":
968-
version "7.0.5"
969-
resolved "https://registry.yarnpkg.com/@types/next-server/-/next-server-7.0.5.tgz#1eac1888449d5abb37a7b4b87cd8870b954a7b5e"
970-
integrity sha512-5nGbViLU+1rgX23krGgHjFf/gzHJBn+piejRWY9Hb8FoVZfyg0H79Ebju++8dXt77AOTAUhQRaV7uaUO0LCpSA==
971-
dependencies:
972-
"@types/node" "*"
973-
"@types/react" "*"
974-
"@types/react-loadable" "*"
975-
976-
"@types/next@^8.0.3":
977-
version "8.0.3"
978-
resolved "https://registry.yarnpkg.com/@types/next/-/next-8.0.3.tgz#c0d28cf3d84b024d80987a5ae37985912f91c549"
979-
integrity sha512-5Kg9Luit/pcwln8ReipEEyKPUEMTH7A15hm6t9WqUy4GcM3eIUqKy/SNNlxF9l0diigqrMq0SshqJ5QYhmN0Dg==
980-
dependencies:
981-
"@types/next-server" "*"
982-
"@types/node" "*"
983-
"@types/node-fetch" "*"
984-
"@types/react" "*"
985-
986-
"@types/node-fetch@*":
987-
version "2.1.6"
988-
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.1.6.tgz#4326288b49f352a142f03c63526ebce0f4c50877"
989-
integrity sha512-Hv1jgh3pfpUEl2F2mqUd1AfLSk1YbUCeBJFaP36t7esAO617dErqdxWb5cdG2NfJGOofkmBW36fdx0dVewxDRg==
990-
dependencies:
991-
"@types/node" "*"
992-
993950
"@types/node@*":
994951
version "11.11.4"
995952
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.4.tgz#8808bd5a82bbf6f5d412eff1c228d178e7c24bb3"
996953
integrity sha512-02tIL+QIi/RW4E5xILdoAMjeJ9kYq5t5S2vciUdFPXv/ikFTb0zK8q9vXkg4+WAJuYXGiVT1H28AkD2C+IkXVw==
997954

998-
"@types/prop-types@*":
999-
version "15.7.0"
1000-
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.0.tgz#4c48fed958d6dcf9487195a0ef6456d5f6e0163a"
1001-
integrity sha512-eItQyV43bj4rR3JPV0Skpl1SncRCdziTEK9/v8VwXmV6d/qOUO8/EuWeHBbCZcsfSHfzI5UyMJLCSXtxxznyZg==
1002-
1003-
"@types/react-dom@^16.8.2":
1004-
version "16.8.2"
1005-
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.8.2.tgz#9bd7d33f908b243ff0692846ef36c81d4941ad12"
1006-
integrity sha512-MX7n1wq3G/De15RGAAqnmidzhr2Y9O/ClxPxyqaNg96pGyeXUYPSvujgzEVpLo9oIP4Wn1UETl+rxTN02KEpBw==
1007-
dependencies:
1008-
"@types/react" "*"
1009-
1010-
"@types/react-loadable@*":
1011-
version "5.5.0"
1012-
resolved "https://registry.yarnpkg.com/@types/react-loadable/-/react-loadable-5.5.0.tgz#7a878408ad940250aeb91d77d2b54a18f3c7c946"
1013-
integrity sha512-evH/O6Wytz6lSmi36YL7YHnFc46zRPSA8+XNtTXI4D7A/CP7OVwcWbHjb2yGbh/jDxxhnTwIVO/PeqDXtUegnQ==
1014-
dependencies:
1015-
"@types/react" "*"
1016-
"@types/webpack" "*"
1017-
1018-
"@types/react@*", "@types/react@^16.8.8":
1019-
version "16.8.8"
1020-
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.8.tgz#4b60a469fd2469f7aa6eaa0f8cfbc51f6d76e662"
1021-
integrity sha512-xwEvyet96u7WnB96kqY0yY7qxx/pEpU51QeACkKFtrgjjXITQn0oO1iwPEraXVgh10ZFPix7gs1R4OJXF7P5sg==
1022-
dependencies:
1023-
"@types/prop-types" "*"
1024-
csstype "^2.2.0"
1025-
1026955
"@types/stack-utils@^1.0.1":
1027956
version "1.0.1"
1028957
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
1029958
integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==
1030959

1031-
"@types/tapable@*":
1032-
version "1.0.4"
1033-
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.4.tgz#b4ffc7dc97b498c969b360a41eee247f82616370"
1034-
integrity sha512-78AdXtlhpCHT0K3EytMpn4JNxaf5tbqbLcbIRoQIHzpTIyjpxLQKRoxU55ujBXAtg3Nl2h/XWvfDa9dsMOd0pQ==
1035-
1036-
"@types/uglify-js@*":
1037-
version "3.0.4"
1038-
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.4.tgz#96beae23df6f561862a830b4288a49e86baac082"
1039-
integrity sha512-SudIN9TRJ+v8g5pTG8RRCqfqTMNqgWCKKd3vtynhGzkIIjxaicNAMuY5TRadJ6tzDu3Dotf3ngaMILtmOdmWEQ==
1040-
dependencies:
1041-
source-map "^0.6.1"
1042-
1043-
"@types/webpack@*":
1044-
version "4.4.26"
1045-
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.4.26.tgz#b52f605351f2ed60e6ce24fa7df39ab7abd03470"
1046-
integrity sha512-vs8LjgEZUQTBxotXbMf8s4jgykozkqjv6P0JRi+1BLh0n7LQUkMXfvsoPb5U/dBL1ay5Lu0c46G6FRmAZBhAUA==
1047-
dependencies:
1048-
"@types/anymatch" "*"
1049-
"@types/node" "*"
1050-
"@types/tapable" "*"
1051-
"@types/uglify-js" "*"
1052-
source-map "^0.6.0"
1053-
1054960
"@types/yargs@^12.0.2", "@types/yargs@^12.0.9":
1055961
version "12.0.10"
1056962
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.10.tgz#17a8ec65cd8e88f51b418ceb271af18d3137df67"
@@ -2183,11 +2089,6 @@ cssstyle@^1.0.0:
21832089
dependencies:
21842090
cssom "0.3.x"
21852091

2186-
csstype@^2.2.0:
2187-
version "2.6.3"
2188-
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.3.tgz#b701e5968245bf9b08d54ac83d00b624e622a9fa"
2189-
integrity sha512-rINUZXOkcBmoHWEyu7JdHu5JMzkGRoMX4ov9830WNgxf5UYxcBUO0QTKAqeJ5EZfSdlrcJYkC8WwfVW7JYi4yg==
2190-
21912092
cyclist@~0.2.2:
21922093
version "0.2.2"
21932094
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640"
@@ -4369,6 +4270,13 @@ neo-async@^2.5.0, neo-async@^2.6.0:
43694270
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835"
43704271
integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==
43714272

4273+
next-routes@^1.4.2:
4274+
version "1.4.2"
4275+
resolved "https://registry.yarnpkg.com/next-routes/-/next-routes-1.4.2.tgz#736a382579a792ea69f35ae70b449acdfefa7944"
4276+
integrity sha512-1Ljs0BEV9IGcJLKxC/WZUtmftSvmkY6DlI8fVs8dClCoR82QRzBGRka/L/XB76wE5814MMeP9qVJYQil0FE9QQ==
4277+
dependencies:
4278+
path-to-regexp "^2.1.0"
4279+
43724280
43734281
version "8.0.4"
43744282
resolved "https://registry.yarnpkg.com/next-server/-/next-server-8.0.4.tgz#e8a01949e5827b346924a46ce83a71c6a1910b21"
@@ -4382,7 +4290,7 @@ [email protected]:
43824290
send "0.16.1"
43834291
url "0.11.0"
43844292

4385-
next@^8.0.4:
4293+
next@^8.0.3:
43864294
version "8.0.4"
43874295
resolved "https://registry.yarnpkg.com/next/-/next-8.0.4.tgz#da08220ccfce40fb9825820814a770e19e09359a"
43884296
integrity sha512-ttZNm/RoZr0PPfT9QkluCsB+y77kdk7m6aGXCETvLYcnCKAOyiJL7ztFGKBiCj9paUV+txZ+NKI2k2Jz5/vsWQ==
@@ -4869,6 +4777,11 @@ [email protected]:
48694777
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.1.0.tgz#7e30f9f5b134bd6a28ffc2e3ef1e47075ac5259b"
48704778
integrity sha512-dZY7QPCPp5r9cnNuQ955mOv4ZFVDXY/yvqeV7Y1W2PJA3PEFcuow9xKFfJxbBj1pIjOAP+M2B4/7xubmykLrXw==
48714779

4780+
path-to-regexp@^2.1.0:
4781+
version "2.4.0"
4782+
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.4.0.tgz#35ce7f333d5616f1c1e1bfe266c3aba2e5b2e704"
4783+
integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w==
4784+
48724785
path-type@^2.0.0:
48734786
version "2.0.0"
48744787
resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
@@ -6167,11 +6080,6 @@ typedarray@^0.0.6:
61676080
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
61686081
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
61696082

6170-
typescript@^3.3.4000:
6171-
version "3.3.4000"
6172-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.4000.tgz#76b0f89cfdbf97827e1112d64f283f1151d6adf0"
6173-
integrity sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==
6174-
61756083
uglify-js@^3.1.4:
61766084
version "3.4.10"
61776085
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f"

0 commit comments

Comments
 (0)