-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added information on documentation
- Loading branch information
ADMSK\AVROGAL1
committed
Apr 8, 2021
1 parent
ca9a386
commit 97726d5
Showing
17 changed files
with
268 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ coverage: | |
- "docs" | ||
- "scripts" | ||
- "tests" | ||
- "samples" | ||
|
||
flags: | ||
src: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
export default { | ||
roots: ['<rootDir>/tests/'], | ||
verbose: true, | ||
clearMocks: true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { readFile } from 'fs' | ||
import { stringify } from 'querystring' | ||
|
||
import * as fetchImport from 'isomorphic-unfetch' | ||
|
||
import { promisify } from 'util' | ||
|
||
const fetch = fetchImport.default || fetchImport | ||
const readFileAsync = promisify(readFile) | ||
|
||
const getScreenshot = async (): Promise<void> => { | ||
const code = await readFileAsync('./src/screenshot.ts') | ||
|
||
const language = 'ts' | ||
|
||
const params = { | ||
backgroundColor: '#E6EDF8', | ||
dropShadow: true, | ||
dropShadowBlurRadius: '68px', | ||
dropShadowOffsetY: '20px', | ||
fontFamily: 'Fira Code', | ||
fontSize: '14px', | ||
lineHeight: '133%', | ||
lineNumbers: false, | ||
paddingHorizontal: '35px', | ||
paddingVertical: '49px', | ||
squaredImage: false, | ||
theme: 'nord', | ||
widthAdjustment: true, | ||
language, | ||
} | ||
|
||
try { | ||
const option = { | ||
method: 'POST', | ||
body: code.toString('base64'), | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
const response = await fetch( | ||
`https://styled-code-formats.vercel.app/api?${stringify(params)}`, | ||
option | ||
) | ||
|
||
if (response.status === 200) { | ||
console.log(response) | ||
} else { | ||
console.error(response) | ||
} | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
|
||
void getScreenshot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"noImplicitAny": true, | ||
"removeComments": true, | ||
"preserveConstEnums": true, | ||
"sourceMap": true, | ||
"noEmit": false, | ||
"moduleResolution": "Node", | ||
"outDir": "./dist" | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
"**/*.spec.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.