-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 feat: add swagger ui/redoc documentation
- Loading branch information
0 parents
commit 209ba66
Showing
19 changed files
with
489 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"root": true, | ||
"env": { "browser": true, "es2020": true }, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react-hooks/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"ignorePatterns": ["dist", ".eslintrc"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["react-refresh", "prettier"], | ||
"rules": { | ||
"react-refresh/only-export-components": [ | ||
"warn", | ||
{ "allowConstantExport": true } | ||
], | ||
"prettier/prettier": "error" | ||
} | ||
} |
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,45 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: ['web'] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: 'pages' | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup bun | ||
uses: oven-sh/setup-bun@v1 | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
|
||
- name: Install Required Libraries | ||
run: bun install | ||
|
||
- name: Build | ||
run: bun run build | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'dist' | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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,7 @@ | ||
# dependencies | ||
/node_modules | ||
|
||
# production | ||
/dist | ||
|
||
*.js |
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,12 @@ | ||
{ | ||
"printWidth": 120, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"bracketSpacing": true, | ||
"arrowParens": "avoid", | ||
"proseWrap": "never", | ||
"endOfLine": "auto" | ||
} |
Binary file not shown.
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,29 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/variable/pretendardvariable-dynamic-subset.min.css" /> | ||
<link rel="stylesheet" href="https://font.elice.io/css?family=Elice+Digital+Coding" /> | ||
|
||
<title>Musixmatch OpenAPI - OAS 3.0</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
|
||
<script> | ||
;(function (l) { | ||
if (l.search[1] === '/') { | ||
var decoded = l.search | ||
.slice(1) | ||
.split('&') | ||
.map(function (s) { | ||
return s.replace(/~and~/g, '&') | ||
}) | ||
.join('?') | ||
window.history.replaceState(null, null, l.pathname.slice(0, -1) + decoded + l.hash) | ||
} | ||
})(window.location) | ||
</script> | ||
</body> | ||
</html> |
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,41 @@ | ||
{ | ||
"name": "musixmatch-oas", | ||
"private": true, | ||
"version": "1.0.1", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@tanstack/react-query": "^5.18.1", | ||
"core-js": "^3.35.1", | ||
"gh-pages": "^6.1.1", | ||
"mobx": "^6.12.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-router-dom": "^6.22.0", | ||
"redoc": "^2.1.3", | ||
"styled-components": "^6.1.8", | ||
"swagger-ui-dist": "^5.11.3", | ||
"yaml": "^2.3.4" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.2.55", | ||
"@types/react-dom": "^18.2.19", | ||
"@types/swagger-ui-dist": "^3.30.4", | ||
"@vitejs/plugin-react": "^4.2.1", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.4.5", | ||
"prettier": "^3.2.5", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.1.0", | ||
"vite-plugin-html": "^3.2.2", | ||
"vite-tsconfig-paths": "^4.3.1" | ||
} | ||
} |
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,31 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ayaan-fonts/[email protected]/fonts/webfonts/Paperlogy-dynamic-subset.css" /> | ||
<link rel="stylesheet" href="https://font.elice.io/css?family=Elice+Digital+Coding" /> | ||
|
||
<title>Musixmatch OpenAPI - OAS 3.0</title> | ||
</head> | ||
<body> | ||
<script> | ||
var pathSegmentsToKeep = 1 | ||
|
||
var l = window.location | ||
l.replace( | ||
l.protocol + | ||
'//' + | ||
l.hostname + | ||
(l.port ? ':' + l.port : '') + | ||
l.pathname | ||
.split('/') | ||
.slice(0, 1 + pathSegmentsToKeep) | ||
.join('/') + | ||
'/?/' + | ||
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') + | ||
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') + | ||
l.hash, | ||
) | ||
</script> | ||
</body> | ||
</html> |
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,14 @@ | ||
configUrl: '/musixmatch-oas/swagger-config.yaml' | ||
|
||
docExpansion: none | ||
tagsSorter: alpha | ||
operationsSorter: alpha | ||
displayOperationId: false | ||
persistAuthorization: true | ||
displayRequestDuration: true | ||
|
||
urls: | ||
- url: 'https://raw.githubusercontent.com/lunaiz-corp/musixmatch-oas/main/openapi.yaml' | ||
name: Version 1.1.0 | ||
|
||
validatorUrl: '' |
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,28 @@ | ||
html { | ||
box-sizing: border-box; | ||
overflow: -moz-scrollbars-vertical; | ||
overflow-y: scroll; | ||
} | ||
|
||
*, | ||
*:before, | ||
*:after { | ||
box-sizing: inherit; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
background: #fafafa; | ||
} | ||
|
||
body * { | ||
font-family: 'Pretendard Variable', sans-serif !important; | ||
} | ||
|
||
code, | ||
code *, | ||
.redoc-wrap .redoc-json *, | ||
.redoc-wrap .property-name, | ||
.swagger-ui .opblock-summary-path * { | ||
font-family: 'Elice Digital Coding', 'monospace' !important; | ||
} |
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,31 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
import { createBrowserRouter, RouterProvider } from 'react-router-dom' | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
|
||
import './index.css' | ||
import { Swagger, Redocly } from './routes' | ||
|
||
const queryClient = new QueryClient() | ||
|
||
const router = createBrowserRouter( | ||
[ | ||
{ | ||
path: '/', | ||
element: <Swagger />, | ||
}, | ||
{ | ||
path: '/redoc', | ||
element: <Redocly />, | ||
}, | ||
], | ||
{ basename: '/musixmatch-oas' }, | ||
) | ||
|
||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( | ||
<React.StrictMode> | ||
<QueryClientProvider client={queryClient}> | ||
<RouterProvider router={router} /> | ||
</QueryClientProvider> | ||
</React.StrictMode>, | ||
) |
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,2 @@ | ||
export { default as Swagger } from './swagger' | ||
export { default as Redocly } from './redocly' |
Oops, something went wrong.