Skip to content

Commit 69819a5

Browse files
committed
add typescript
1 parent ac7536b commit 69819a5

File tree

6 files changed

+162
-1
lines changed

6 files changed

+162
-1
lines changed

.babelrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"next/babel",
4+
"@zeit/next-typescript/babel"
5+
]
6+
}

next.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const withTypescript = require('@zeit/next-typescript')
2+
module.exports = withTypescript()

package.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@
77
"scripts": {
88
"dev": "next",
99
"build": "next build",
10-
"start": "next start"
10+
"start": "next start",
11+
"type-check": "tsc"
1112
},
1213
"dependencies": {
14+
"@zeit/next-typescript": "^1.1.1",
1315
"next": "^7.0.2",
1416
"react": "^16.7.0",
1517
"react-dom": "^16.7.0"
18+
},
19+
"devDependencies": {
20+
"@types/next": "^7.0.6",
21+
"@types/react": "^16.7.21",
22+
"@types/react-dom": "^16.0.11",
23+
"typescript": "^3.2.4"
1624
}
1725
}
File renamed without changes.

tsconfig.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"target": "esnext",
4+
"module": "esnext",
5+
"jsx": "preserve",
6+
"lib": ["dom", "es2017"],
7+
"moduleResolution": "node",
8+
"allowJs": true,
9+
"noEmit": true,
10+
"allowSyntheticDefaultImports": true,
11+
"skipLibCheck": true,
12+
"noUnusedLocals": true,
13+
"noUnusedParameters": true,
14+
"removeComments": false,
15+
"preserveConstEnums": true,
16+
"sourceMap": true
17+
}
18+
}

yarn.lock

+127
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,13 @@
337337
dependencies:
338338
"@babel/helper-plugin-utils" "^7.0.0"
339339

340+
"@babel/plugin-syntax-typescript@^7.2.0":
341+
version "7.2.0"
342+
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.2.0.tgz#55d240536bd314dcbbec70fd949c5cabaed1de29"
343+
integrity sha512-WhKr6yu6yGpGcNMVgIBuI9MkredpVc7Y3YR4UzEZmDztHoL6wV56YBHLhWnjO1EvId1B32HrD3DRFc+zSoKI1g==
344+
dependencies:
345+
"@babel/helper-plugin-utils" "^7.0.0"
346+
340347
"@babel/plugin-transform-arrow-functions@^7.0.0":
341348
version "7.2.0"
342349
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550"
@@ -584,6 +591,14 @@
584591
dependencies:
585592
"@babel/helper-plugin-utils" "^7.0.0"
586593

594+
"@babel/plugin-transform-typescript@^7.1.0":
595+
version "7.2.0"
596+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.2.0.tgz#bce7c06300434de6a860ae8acf6a442ef74a99d1"
597+
integrity sha512-EnI7i2/gJ7ZNr2MuyvN2Hu+BHJENlxWte5XygPvfj/MbvtOkWor9zcnHpMMQL2YYaaCcqtIvJUyJ7QVfoGs7ew==
598+
dependencies:
599+
"@babel/helper-plugin-utils" "^7.0.0"
600+
"@babel/plugin-syntax-typescript" "^7.2.0"
601+
587602
"@babel/plugin-transform-unicode-regex@^7.0.0":
588603
version "7.2.0"
589604
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.2.0.tgz#4eb8db16f972f8abb5062c161b8b115546ade08b"
@@ -651,6 +666,14 @@
651666
"@babel/plugin-transform-react-jsx-self" "^7.0.0"
652667
"@babel/plugin-transform-react-jsx-source" "^7.0.0"
653668

669+
"@babel/preset-typescript@^7.0.0":
670+
version "7.1.0"
671+
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.1.0.tgz#49ad6e2084ff0bfb5f1f7fb3b5e76c434d442c7f"
672+
integrity sha512-LYveByuF9AOM8WrsNne5+N79k1YxjNB6gmpCQsnuSBAcV8QUeB+ZUxQzL7Rz7HksPbahymKkq2qBR+o36ggFZA==
673+
dependencies:
674+
"@babel/helper-plugin-utils" "^7.0.0"
675+
"@babel/plugin-transform-typescript" "^7.1.0"
676+
654677
655678
version "7.0.0"
656679
resolved "https://registry.yarnpkg.com/@babel/runtime-corejs2/-/runtime-corejs2-7.0.0.tgz#786711ee099c2c2af7875638866c1259eff30a8c"
@@ -708,6 +731,93 @@
708731
lodash "^4.17.10"
709732
to-fast-properties "^2.0.0"
710733

734+
"@types/anymatch@*":
735+
version "1.3.0"
736+
resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.0.tgz#d1d55958d1fccc5527d4aba29fc9c4b942f563ff"
737+
integrity sha512-7WcbyctkE8GTzogDb0ulRAEw7v8oIS54ft9mQTU7PfM0hp5e+8kpa+HeQ7IQrFbKtJXBKcZ4bh+Em9dTw5L6AQ==
738+
739+
"@types/next-server@*":
740+
version "7.0.3"
741+
resolved "https://registry.yarnpkg.com/@types/next-server/-/next-server-7.0.3.tgz#a86f49045bc00e00bad8f6754f540acef33ef08f"
742+
integrity sha512-OCFYa4oBPViMvvLyjjIG/0St7rT+ggwi7z+Dn348I38YQey1kbVOQA5QCdEH4ydud8UqAOUFodO4AiAJO2+J2w==
743+
dependencies:
744+
"@types/node" "*"
745+
"@types/react" "*"
746+
"@types/react-loadable" "*"
747+
748+
"@types/next@^7.0.6":
749+
version "7.0.6"
750+
resolved "https://registry.yarnpkg.com/@types/next/-/next-7.0.6.tgz#c4dabfe8707404160651ecf1fa35fd33cc566cdb"
751+
integrity sha512-umm6e2UcVxO5HFZCpvFbedIW62Dv+6TS64hPdtgnzvlwsTNcILTXdq7virH+UWWDI/qdMQiiZHcqbXDzF0AUzA==
752+
dependencies:
753+
"@types/next-server" "*"
754+
"@types/node" "*"
755+
"@types/node-fetch" "*"
756+
"@types/react" "*"
757+
758+
"@types/node-fetch@*":
759+
version "2.1.4"
760+
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.1.4.tgz#093d1beae11541aef25999d70aa09286fd025b1a"
761+
integrity sha512-tR1ekaXUGpmzOcDXWU9BW73YfA2/VW1DF1FH+wlJ82BbCSnWTbdX+JkqWQXWKIGsFPnPsYadbXfNgz28g+ccWg==
762+
dependencies:
763+
"@types/node" "*"
764+
765+
"@types/node@*":
766+
version "10.12.18"
767+
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67"
768+
integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==
769+
770+
"@types/prop-types@*":
771+
version "15.5.8"
772+
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.8.tgz#8ae4e0ea205fe95c3901a5a1df7f66495e3a56ce"
773+
integrity sha512-3AQoUxQcQtLHsK25wtTWIoIpgYjH3vSDroZOUr7PpCHw/jLY1RB9z9E8dBT/OSmwStVgkRNvdh+ZHNiomRieaw==
774+
775+
"@types/react-dom@^16.0.11":
776+
version "16.0.11"
777+
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.0.11.tgz#bd10ccb0d9260343f4b9a49d4f7a8330a5c1f081"
778+
integrity sha512-x6zUx9/42B5Kl2Vl9HlopV8JF64wLpX3c+Pst9kc1HgzrsH+mkehe/zmHMQTplIrR48H2gpU7ZqurQolYu8XBA==
779+
dependencies:
780+
"@types/react" "*"
781+
782+
"@types/react-loadable@*":
783+
version "5.5.0"
784+
resolved "https://registry.yarnpkg.com/@types/react-loadable/-/react-loadable-5.5.0.tgz#7a878408ad940250aeb91d77d2b54a18f3c7c946"
785+
integrity sha512-evH/O6Wytz6lSmi36YL7YHnFc46zRPSA8+XNtTXI4D7A/CP7OVwcWbHjb2yGbh/jDxxhnTwIVO/PeqDXtUegnQ==
786+
dependencies:
787+
"@types/react" "*"
788+
"@types/webpack" "*"
789+
790+
"@types/react@*", "@types/react@^16.7.21":
791+
version "16.7.21"
792+
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.7.21.tgz#17e45871a2502e33b12b63279f44e1c02a4632fc"
793+
integrity sha512-8BPxwygC83LgaIjOVVLrzB4mpP2u1ih01fbfy76L3h9OgKN+fNyMVPXj/0mGpWnxImjiM/2lqb3YOeT2Ca+NYQ==
794+
dependencies:
795+
"@types/prop-types" "*"
796+
csstype "^2.2.0"
797+
798+
"@types/tapable@*":
799+
version "1.0.4"
800+
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.4.tgz#b4ffc7dc97b498c969b360a41eee247f82616370"
801+
integrity sha512-78AdXtlhpCHT0K3EytMpn4JNxaf5tbqbLcbIRoQIHzpTIyjpxLQKRoxU55ujBXAtg3Nl2h/XWvfDa9dsMOd0pQ==
802+
803+
"@types/uglify-js@*":
804+
version "3.0.4"
805+
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.4.tgz#96beae23df6f561862a830b4288a49e86baac082"
806+
integrity sha512-SudIN9TRJ+v8g5pTG8RRCqfqTMNqgWCKKd3vtynhGzkIIjxaicNAMuY5TRadJ6tzDu3Dotf3ngaMILtmOdmWEQ==
807+
dependencies:
808+
source-map "^0.6.1"
809+
810+
"@types/webpack@*":
811+
version "4.4.24"
812+
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.4.24.tgz#75bc301176066f566ec54151b6101c2b45abb8b2"
813+
integrity sha512-yg99CjvB7xZ/iuHrsZ7dkGKoq/FRDzqLzAxKh2EmTem6FWjzrty4FqCqBYuX5z+MFwSaaQGDAX4Q9HQkLjGLnQ==
814+
dependencies:
815+
"@types/anymatch" "*"
816+
"@types/node" "*"
817+
"@types/tapable" "*"
818+
"@types/uglify-js" "*"
819+
source-map "^0.6.0"
820+
711821
"@webassemblyjs/[email protected]":
712822
version "1.7.8"
713823
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.7.8.tgz#f31f480debeef957f01b623f27eabc695fa4fe8f"
@@ -861,6 +971,13 @@
861971
resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.1.tgz#5c85d662f76fa1d34575766c5dcd6615abcd30d8"
862972
integrity sha512-FZdkNBDqBRHKQ2MEbSC17xnPFOhZxeJ2YGSfr2BKf3sujG49Qe3bB+rGCwQfIaA7WHnGeGkSijX4FuBCdrzW/g==
863973

974+
"@zeit/next-typescript@^1.1.1":
975+
version "1.1.1"
976+
resolved "https://registry.yarnpkg.com/@zeit/next-typescript/-/next-typescript-1.1.1.tgz#0b0ddfbb13ca04cde52ac2718473f1b9c40ba0ee"
977+
integrity sha512-EUcHCASftz1Bc80djkf3cKJrFgvFQyODOH1kty7ShVLLdXMaZpRLj+z7RxrCoNo1bP06w0vtXEDU0cKa0HmGgg==
978+
dependencies:
979+
"@babel/preset-typescript" "^7.0.0"
980+
864981
abbrev@1:
865982
version "1.1.1"
866983
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
@@ -1621,6 +1738,11 @@ crypto-browserify@^3.11.0:
16211738
randombytes "^2.0.0"
16221739
randomfill "^1.0.3"
16231740

1741+
csstype@^2.2.0:
1742+
version "2.6.1"
1743+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.1.tgz#4cfbf637a577497036ebcd7e32647ef19a0b8076"
1744+
integrity sha512-wv7IRqCGsL7WGKB8gPvrl+++HlFM9kxAM6jL1EXNPNTshEJYilMkbfS2SnuHha77uosp/YVK0wAp2jmlBzn1tg==
1745+
16241746
cyclist@~0.2.2:
16251747
version "0.2.2"
16261748
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640"
@@ -4391,6 +4513,11 @@ typedarray@^0.0.6:
43914513
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
43924514
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
43934515

4516+
typescript@^3.2.4:
4517+
version "3.2.4"
4518+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d"
4519+
integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==
4520+
43944521
uglify-es@^3.3.4:
43954522
version "3.3.9"
43964523
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"

0 commit comments

Comments
 (0)