Merge pull request #22 from domai-tb/dev
Update Dependencies and Small Changes
This commit is contained in:
commit
3d7fdd5aef
8 changed files with 202 additions and 3573 deletions
|
@ -88,14 +88,14 @@ Both ways will create a webserver that listens on port 3000.
|
|||
## Docker
|
||||
|
||||
```shell
|
||||
docker build . --tag your-tag
|
||||
docker run your-tag
|
||||
docker build . --tag codestats-readme
|
||||
docker run codestats-readme
|
||||
```
|
||||
|
||||
## NPM
|
||||
|
||||
```shell
|
||||
npm ci
|
||||
npm install
|
||||
npm run build
|
||||
npm run start
|
||||
```
|
||||
|
|
|
@ -48,7 +48,6 @@ export default async (req: Request<unknown, unknown, unknown, query>, res: Respo
|
|||
} = req.query
|
||||
|
||||
prepareResponse(res)
|
||||
console.log(theme)
|
||||
|
||||
try {
|
||||
const data = await fetchHistory(username, clampValue(parseNumber(days_count) || 14, 1, 30))
|
||||
|
|
1
index.ts
1
index.ts
|
@ -1,5 +1,4 @@
|
|||
import express from 'express'
|
||||
import api from './api/profile'
|
||||
import history from './api/history'
|
||||
import topLangs from './api/top-langs'
|
||||
import profile from './api/profile'
|
||||
|
|
3725
package-lock.json
generated
3725
package-lock.json
generated
File diff suppressed because it is too large
Load diff
30
package.json
30
package.json
|
@ -1,7 +1,23 @@
|
|||
{
|
||||
"name": "github-readme-stats",
|
||||
"name": "codestats-readme",
|
||||
"version": "1.0.0",
|
||||
"description": "Dynamically generate stats for your github readmes",
|
||||
"description": "Dynamically generated Code::Stats SVGs for your GitHub Readmes",
|
||||
"author": {
|
||||
"name": "Anurag Hazra",
|
||||
"url": "https://github.com/Aviortheking"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": ":Domai",
|
||||
"email": "coding@domai-tb.com",
|
||||
"url": "https://github.com/domai-tb"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/domai-tb/codestats-readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/domai-tb/codestats-readme/issues"
|
||||
},
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"dev": "ts-node ./index.ts",
|
||||
|
@ -9,25 +25,23 @@
|
|||
"start": "node dist/index.js",
|
||||
"theme-readme-gen": "ts-node scripts/generate-theme-doc"
|
||||
},
|
||||
"author": "Anurag Hazra",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/express": "^4",
|
||||
"@types/node-fetch": "^2",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"@typescript-eslint/eslint-plugin": "^6",
|
||||
"@typescript-eslint/parser": "^5",
|
||||
"@typescript-eslint/parser": "^6",
|
||||
"eslint": "^8",
|
||||
"ts-node": "^10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dzeio/config": "^1.1.12",
|
||||
"@dzeio/config": "^1",
|
||||
"express": "^4",
|
||||
"node-fetch": "^3",
|
||||
"node-fetch": "^2",
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
"typescript": "^4",
|
||||
"typescript": "^5",
|
||||
"word-wrap": "^1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,12 +8,10 @@ export default async function retryer<T = Promise<CodeStatsResponse>>(
|
|||
err?: any
|
||||
): Promise<T> {
|
||||
if (retries > 7) {
|
||||
throw new CustomError('Maximum retries exceeded' + err, 'MAX_RETRY')
|
||||
throw new CustomError('Maximum retries exceeded. ' + err, 'MAX_RETRY')
|
||||
}
|
||||
try {
|
||||
return await fetcher(
|
||||
data
|
||||
)
|
||||
return await fetcher(data)
|
||||
} catch (err) {
|
||||
return retryer(fetcher, data, ++retries, err)
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ export async function request(username: string): Promise<CodeStatsResponse> {
|
|||
const resp = await fetch(
|
||||
`https://codestats.net/api/users/${username}`
|
||||
)
|
||||
return resp.json()
|
||||
return resp.json() as Promise<CodeStatsResponse>;
|
||||
}
|
||||
|
||||
export async function profileGraphRequest<T>(body: string): Promise<T> {
|
||||
|
@ -56,7 +56,7 @@ export async function profileGraphRequest<T>(body: string): Promise<T> {
|
|||
method: 'POST'
|
||||
}
|
||||
)
|
||||
return resp.json()
|
||||
return resp.json() as Promise<T>;
|
||||
}
|
||||
|
||||
export function getColor(
|
||||
|
|
|
@ -14,7 +14,7 @@ export default class Error extends React.Component<{
|
|||
.gray { fill: #858585 }
|
||||
`}</style>
|
||||
<rect x="0.5" y="0.5" width="494" height="99%" rx="4.5" fill="#FFFEFE" stroke="#E4E2E2"/>
|
||||
<text x="25" y="45" className="text">Something went wrong! file an issue at https://dze.io/3nL29</text>
|
||||
<text x="25" y="45" className="text">Something went wrong!</text>
|
||||
<text data-testid="message" x="25" y="55" className="text small">
|
||||
<tspan x="25" dy="18">{encodeHTML(this.props.message)}</tspan>
|
||||
<tspan x="25" dy="18" className="gray">{this.props.secondaryMessage}</tspan>
|
||||
|
|
Loading…
Add table
Reference in a new issue