Skip to content

Commit 84cc5d4

Browse files
committed
Add vite and update dependencies
1 parent f9371a4 commit 84cc5d4

38 files changed

Lines changed: 3650 additions & 164 deletions

.github/workflows/deploy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version-file: '.nvmrc'
21+
22+
- name: Enable Corepack
23+
run: corepack enable
24+
25+
- name: Install dependencies
26+
run: yarn install --frozen-lockfile
27+
28+
- name: Build
29+
run: yarn build
30+
env:
31+
NODE_ENV: production
32+
33+
- name: Deploy to GitHub Pages
34+
if: github.ref == 'refs/heads/main'
35+
uses: peaceiris/actions-gh-pages@v3
36+
with:
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
publish_dir: ./dist

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Yarn
16+
.pnp.cjs
17+
.pnp.loader.mjs
18+
.yarn
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
.DS_Store
25+
*.suo
26+
*.ntvs*
27+
*.njsproj
28+
*.sln
29+
*.sw?

.nvmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
22.19.0
2+

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# WEKA REST API Documentation
2+
3+
A documentation viewer for the WEKA REST API across multiple versions. This project provides an interactive Swagger UI interface to explore and understand the WEKA system's RESTful API capabilities.
4+
5+
All API documentation files are stored in `/public/docs/` as JSON files.
6+
7+
## Contributing
8+
9+
When adding new API documentation versions:
10+
11+
1. Place the new JSON file in `/public/docs/`
12+
2. Update the `urls` array in `src/main.js` to include the new version
13+
3. Follow the existing naming convention: `{version}.json`
14+
15+
## Getting Started
16+
17+
### Prerequisites
18+
19+
- Node.js (version specified in `.nvmrc`)
20+
- Yarn package manager
21+
22+
### Installation
23+
24+
```bash
25+
yarn install
26+
```
27+
28+
### Development
29+
30+
```bash
31+
yarn start
32+
```
33+
34+
The application will be available at `http://localhost:5000` (or the next available port).
35+
36+
### Building for Production
37+
38+
```bash
39+
yarn build
40+
```
41+
42+
The built files will be generated in the `dist/` directory.
43+
44+
### Preview Production Build
45+
46+
```bash
47+
yarn preview
48+
```
49+
50+
### Deployment
51+
52+
```bash
53+
yarn deploy
54+
```
55+
56+
This command builds the application and deploys it to GitHub Pages using the `gh-pages` branch.
57+
58+
**Note**: For production deployments, this project is configured to deploy via CI/CD to GitHub Pages automatically when changes are pushed to the main branch.

favicon-16x16.png

-665 Bytes
Binary file not shown.

index.html

Lines changed: 6 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,13 @@
1-
<!-- HTML for static distribution bundle build -->
21
<!DOCTYPE html>
32
<html lang="en">
43
<head>
5-
<meta charset="UTF-8">
6-
<title>Swagger UI</title>
7-
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
8-
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
9-
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
10-
<style>
11-
html
12-
{
13-
box-sizing: border-box;
14-
overflow: -moz-scrollbars-vertical;
15-
overflow-y: scroll;
16-
}
17-
18-
*,
19-
*:before,
20-
*:after
21-
{
22-
box-sizing: inherit;
23-
}
24-
25-
body
26-
{
27-
margin:0;
28-
background: #fafafa;
29-
}
30-
</style>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/png" href="/favicon-32x32.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
318
</head>
32-
339
<body>
34-
<div id="swagger-ui"></div>
35-
36-
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
37-
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
38-
<script>
39-
window.onload = function() {
40-
// Begin Swagger UI call region
41-
const ui = SwaggerUIBundle({
42-
//url: "https://petstore.swagger.io/v2/swagger.json",
43-
urls: [
44-
{url: "5.0.json", name: "5.0"},
45-
{url: "4.4.json", name: "4.4"},
46-
{url: "4.3.json", name: "4.3"},
47-
{url: "4.2.json", name: "4.2"},
48-
{url: "4.1.json", name: "4.1"},
49-
{url: "4.0.json", name: "4.0"},
50-
{url: "3.14.json", name: "3.14"},
51-
],
52-
"urls.primaryName": "5.0",
53-
dom_id: '#swagger-ui',
54-
deepLinking: true,
55-
presets: [
56-
SwaggerUIBundle.presets.apis,
57-
SwaggerUIStandalonePreset
58-
],
59-
plugins: [
60-
SwaggerUIBundle.plugins.DownloadUrl
61-
],
62-
layout: "StandaloneLayout"
63-
});
64-
// End Swagger UI call region
65-
66-
window.ui = ui;
67-
};
68-
</script>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.js"></script>
6912
</body>
7013
</html>

oauth2-redirect.html

Lines changed: 0 additions & 75 deletions
This file was deleted.

package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "weka-rest-api-docs",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"start": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview",
10+
"deploy": "yarn build && gh-pages -d dist"
11+
},
12+
"dependencies": {
13+
"@swagger-api/apidom-core": "^1.0.0-beta.48",
14+
"buffer": "^6.0.3",
15+
"react": "^18.3.1",
16+
"react-dom": "^18.3.1",
17+
"swagger-ui": "^5.29.0",
18+
"to-buffer": "^1.2.1"
19+
},
20+
"devDependencies": {
21+
"gh-pages": "^6.1.1",
22+
"vite": "^7.1.2"
23+
},
24+
"resolutions": {
25+
"react": "^18.3.1",
26+
"react-dom": "^18.3.1"
27+
},
28+
"packageManager": "yarn@4.9.3+sha512.8295ee814f6b253e16f516416481b481a215ed03ef1ae38524d108084872560a9ed75aeb23b91ab64222062ac4149a594150ae538c2a9536fdbcefd4e49b11cc"
29+
}
File renamed without changes.

0 commit comments

Comments
 (0)