-
Notifications
You must be signed in to change notification settings - Fork 0
Add vite and update dependencies #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Deploy to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| build-and-deploy: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
|
|
||
| - name: Enable Corepack | ||
| run: corepack enable | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install --frozen-lockfile | ||
|
|
||
| - name: Build | ||
| run: yarn build | ||
| env: | ||
| NODE_ENV: production | ||
|
|
||
| - name: Deploy to GitHub Pages | ||
| if: github.ref == 'refs/heads/main' | ||
| uses: peaceiris/actions-gh-pages@v3 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: ./dist |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| dist | ||
| dist-ssr | ||
| *.local | ||
|
|
||
| # Yarn | ||
| .pnp.cjs | ||
| .pnp.loader.mjs | ||
| .yarn | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
| .DS_Store | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| 22.19.0 | ||
|
|
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # WEKA REST API Documentation | ||
|
|
||
| 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. | ||
|
|
||
| All API documentation files are stored in `/public/docs/` as JSON files. | ||
|
|
||
| ## Contributing | ||
|
|
||
| When adding new API documentation versions: | ||
|
|
||
| 1. Place the new JSON file in `/public/docs/` | ||
| 2. Update the `urls` array in `src/main.js` to include the new version | ||
| 3. Follow the existing naming convention: `{version}.json` | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Node.js (version specified in `.nvmrc`) | ||
| - Yarn package manager | ||
|
|
||
| ### Installation | ||
|
|
||
| ```bash | ||
| yarn install | ||
| ``` | ||
|
|
||
| ### Development | ||
|
|
||
| ```bash | ||
| yarn start | ||
| ``` | ||
|
|
||
| The application will be available at `http://localhost:5000` (or the next available port). | ||
|
|
||
| ### Building for Production | ||
|
|
||
| ```bash | ||
| yarn build | ||
| ``` | ||
|
|
||
| The built files will be generated in the `dist/` directory. | ||
|
|
||
| ### Preview Production Build | ||
|
|
||
| ```bash | ||
| yarn preview | ||
| ``` | ||
|
|
||
| ### Deployment | ||
|
|
||
| This project is configured for automatic deployment to GitHub Pages via GitHub Actions. Simply push your changes to the `main` branch and the CI/CD pipeline will: | ||
|
|
||
| 1. Build the application using `yarn build` | ||
| 2. Deploy the built files to GitHub Pages automatically | ||
|
|
||
| No manual deployment commands are needed. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,70 +1,13 @@ | ||
| <!-- HTML for static distribution bundle build --> | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>Swagger UI</title> | ||
| <link rel="stylesheet" type="text/css" href="./swagger-ui.css" /> | ||
| <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" /> | ||
| <link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" /> | ||
| <style> | ||
| html | ||
| { | ||
| box-sizing: border-box; | ||
| overflow: -moz-scrollbars-vertical; | ||
| overflow-y: scroll; | ||
| } | ||
|
|
||
| *, | ||
| *:before, | ||
| *:after | ||
| { | ||
| box-sizing: inherit; | ||
| } | ||
|
|
||
| body | ||
| { | ||
| margin:0; | ||
| background: #fafafa; | ||
| } | ||
| </style> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/png" href="/favicon-32x32.png" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Vite App</title> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div id="swagger-ui"></div> | ||
|
|
||
| <script src="./swagger-ui-bundle.js" charset="UTF-8"> </script> | ||
| <script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script> | ||
| <script> | ||
| window.onload = function() { | ||
| // Begin Swagger UI call region | ||
| const ui = SwaggerUIBundle({ | ||
| //url: "https://petstore.swagger.io/v2/swagger.json", | ||
| urls: [ | ||
| {url: "5.0.json", name: "5.0"}, | ||
| {url: "4.4.json", name: "4.4"}, | ||
| {url: "4.3.json", name: "4.3"}, | ||
| {url: "4.2.json", name: "4.2"}, | ||
| {url: "4.1.json", name: "4.1"}, | ||
| {url: "4.0.json", name: "4.0"}, | ||
| {url: "3.14.json", name: "3.14"}, | ||
| ], | ||
| "urls.primaryName": "5.0", | ||
| dom_id: '#swagger-ui', | ||
| deepLinking: true, | ||
| presets: [ | ||
| SwaggerUIBundle.presets.apis, | ||
| SwaggerUIStandalonePreset | ||
| ], | ||
| plugins: [ | ||
| SwaggerUIBundle.plugins.DownloadUrl | ||
| ], | ||
| layout: "StandaloneLayout" | ||
| }); | ||
| // End Swagger UI call region | ||
|
|
||
| window.ui = ui; | ||
| }; | ||
| </script> | ||
| <div id="app"></div> | ||
| <script type="module" src="/src/main.js"></script> | ||
| </body> | ||
| </html> |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "name": "weka-rest-api-docs", | ||
| "private": true, | ||
| "version": "0.0.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "start": "vite", | ||
| "build": "vite build", | ||
| "preview": "vite preview" | ||
| }, | ||
| "dependencies": { | ||
| "@swagger-api/apidom-core": "^1.0.0-beta.48", | ||
| "buffer": "^6.0.3", | ||
| "react": "^18.3.1", | ||
| "react-dom": "^18.3.1", | ||
| "swagger-ui": "^5.29.0", | ||
| "to-buffer": "^1.2.1" | ||
| }, | ||
| "devDependencies": { | ||
| "vite": "^7.1.2" | ||
| }, | ||
| "resolutions": { | ||
| "react": "^18.3.1", | ||
| "react-dom": "^18.3.1" | ||
| }, | ||
| "packageManager": "yarn@4.9.3+sha512.8295ee814f6b253e16f516416481b481a215ed03ef1ae38524d108084872560a9ed75aeb23b91ab64222062ac4149a594150ae538c2a9536fdbcefd4e49b11cc" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| export function setupCounter(element) { | ||
| let counter = 0 | ||
| const setCounter = (count) => { | ||
| counter = count | ||
| element.innerHTML = `count is ${counter}` | ||
| } | ||
| element.addEventListener('click', () => setCounter(counter + 1)) | ||
| setCounter(0) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| body { | ||
| margin: 0 !important; | ||
| } | ||
|
|
||
| /* Hide authorization elements in SwaggerUI */ | ||
| .auth-wrapper, | ||
| .authorize, | ||
| .btn.authorize, | ||
| .auth-btn-wrapper, | ||
| .authorization__btn, | ||
| .scheme-container, | ||
| .auth-container { | ||
| display: none !important; | ||
| } | ||
|
|
||
| /* Hide try it out elements */ | ||
| .try-out, | ||
| .try-out__btn, | ||
| .execute-wrapper, | ||
| .btn.execute { | ||
| display: none !important; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import SwaggerUI from "swagger-ui"; | ||
| import SwaggerUIStandalonePreset from "swagger-ui/dist/swagger-ui-standalone-preset"; | ||
|
|
||
| import "swagger-ui/dist/swagger-ui.css"; | ||
| import "./main.css"; | ||
|
|
||
| SwaggerUI({ | ||
| dom_id: "#app", | ||
| urls: [ | ||
| { url: "/docs/5.0.json", name: "5.0" }, | ||
| { url: "/docs/4.4.json", name: "4.4" }, | ||
| { url: "/docs/4.3.json", name: "4.3" }, | ||
| { url: "/docs/4.2.json", name: "4.2" }, | ||
| { url: "/docs/4.1.json", name: "4.1" }, | ||
| { url: "/docs/4.0.json", name: "4.0" }, | ||
| { url: "/docs/3.14.json", name: "3.14" }, | ||
| { url: "/docs/3.13.json", name: "3.13" }, | ||
| { url: "/docs/3.12.json", name: "3.12" }, | ||
| { url: "/docs/3.11.json", name: "3.11" }, | ||
| ], | ||
| "urls.primaryName": "5.0", | ||
| deepLinking: true, | ||
| presets: [SwaggerUI.presets.apis, SwaggerUIStandalonePreset], | ||
| plugins: [SwaggerUI.plugins.DownloadUrl].filter( | ||
| (plugin) => plugin !== SwaggerUI.plugins.Auth | ||
| ), | ||
| layout: "StandaloneLayout", | ||
| supportedSubmitMethods: [], | ||
| showCommonExtensions: true, | ||
| showExtensions: true, | ||
| filter: true, | ||
| tryItOutEnabled: false, | ||
| persistAuthorization: false, | ||
| withCredentials: false, | ||
| }); |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AriAttias I changed the folder structure to be able to update dependencies