1
0
mirror of https://github.com/uetchy/namae.git synced 2025-07-01 22:10:04 +09:00

fix: tsc errors

This commit is contained in:
uetchy 2021-02-25 16:48:45 +09:00
parent 42c38028f7
commit 7bd485c6d5
6 changed files with 3582 additions and 3297 deletions

View File

@ -1,4 +1,5 @@
import { NowRequest, NowResponse } from '@vercel/node';
import assert from 'assert';
import fetch from 'cross-fetch';
import { send, sendError } from '../../../util/http';
@ -8,6 +9,8 @@ export default async function handler(
): Promise<void> {
const { query } = req.query;
assert(process.env.DOMAINR_API_KEY);
if (!query || typeof query !== 'string') {
return sendError(res, new Error('No query given'));
}

View File

@ -1,5 +1,6 @@
import { send, sendError, fetch } from '../../../util/http';
import { NowRequest, NowResponse } from '@vercel/node';
import 'cross-fetch';
import { fetch, send, sendError } from '../../../util/http';
export default async function handler(
req: NowRequest,
@ -18,12 +19,14 @@ export default async function handler(
)}`,
'GET'
).then((res) => res.text());
const response = JSON.parse(
responseText.match(
/AF_initDataCallback.+?hash: '5'.+?data:([\w\W]+?), sideChannel/m
)[1]
)?.[1] ?? ''
);
const apps = response[0][1][0][0][0].map((entry) => ({
const apps = response[0][1][0][0][0].map((entry: any) => ({
id: entry[12][0],
name: entry[2],
author: entry[4][0][0][0],

View File

@ -9,58 +9,57 @@
"test": "jest --coverage && CI=true react-scripts test --coverage"
},
"dependencies": {
"@sentry/browser": "^5.21.1",
"@sentry/browser": "^6.2.0",
"cross-fetch": "^3.0.6",
"easy-peasy": "^3.3.1",
"fetch-suspense": "^1.2.2",
"framer-motion": "^2.5.1",
"i18next": ">=19.8.4",
"i18next": ">=19.9.0",
"i18next-browser-languagedetector": "^6.0.1",
"i18next-chained-backend": "^2.0.1",
"i18next-localstorage-backend": "^3.1.2",
"i18next-xhr-backend": "^3.2.2",
"npm-name": "^6.0.1",
"rc-tooltip": "^5.0.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-ga": "^3.3.0",
"react-helmet": "^6.0.0",
"react-i18next": "11.8.5",
"react-i18next": "11.8.8",
"react-icons": "^3.11.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"react-scripts": "4.0.3",
"react-spinners": "^0.9.0",
"react-toastify": "^6.2.0",
"styled-components": "^5.2.1",
"swr": "^0.3.2",
"swr": "^0.4.2",
"validator": "^13.5.2",
"whois-json": "^2.0.4"
},
"devDependencies": {
"@sentry/cli": "^1.61.0",
"@sentry/cli": "^1.62.0",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.3",
"@testing-library/react": "^11.2.5",
"@types/i18next-node-fs-backend": "^2.1.0",
"@types/jest": "26.0.20",
"@types/node": "^14.14.22",
"@types/react-dom": "^16.9.8",
"@types/node": "^14.14.31",
"@types/react-dom": "^17.0.1",
"@types/react-helmet": "^6.1.0",
"@types/react-router-dom": "^5.1.7",
"@types/styled-components": "^5.1.7",
"@types/validator": "^13.1.3",
"@vercel/build-utils": "^2.7.0",
"@vercel/build-utils": "^2.9.0",
"@vercel/node": "^1.9.0",
"codacy-coverage": "^3.4.0",
"husky": "^4.3.8",
"husky": "^5.1.1",
"i18next-node-fs-backend": "^2.1.3",
"jest": "24.9.0",
"mutationobserver-shim": "^0.3.5",
"nock": "^13.0.6",
"nock": "^13.0.8",
"prettier": "^2.2.1",
"pretty-quick": "^3.1.0",
"ts-jest": "26.4.4",
"typescript": "^4.1.3"
"ts-jest": "26.5.2",
"typescript": "^4.2.0"
},
"husky": {
"hooks": {

View File

@ -2,7 +2,7 @@ import React from 'react';
import styled from 'styled-components';
import useSWR from 'swr';
export interface Contributors {
export interface IContributors {
projectName: string;
projectOwner: string;
repoType: string;
@ -27,7 +27,7 @@ export interface Contributor {
const fetcher = (url: string) => fetch(url).then((r) => r.json());
const Contributors: React.FC = () => {
const { data } = useSWR<Contributors>(
const { data } = useSWR<IContributors>(
'https://raw.githubusercontent.com/uetchy/namae/master/.all-contributorsrc',
fetcher
);

View File

@ -13,9 +13,10 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"jsx": "react-jsx",
"allowJs": true,
"downlevelIteration": true
"downlevelIteration": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src", "types"]
"include": ["api", "src", "types"]
}

6823
yarn.lock

File diff suppressed because it is too large Load Diff