Skip to content

Commit

Permalink
Merge pull request #34 from apicalshark/main
Browse files Browse the repository at this point in the history
server : (webui) migrate project to ReactJS with typescript (ggerganov#11688)
  • Loading branch information
apicalshark authored Feb 6, 2025
2 parents 6258f0b + 52b4868 commit c789f4f
Show file tree
Hide file tree
Showing 31 changed files with 7,133 additions and 2,916 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,36 @@ jobs:
with:
node-version: '22.11.0'

- name: WebUI - Install dependencies
id: webui_lint
run: |
cd examples/server/webui
npm ci
- name: WebUI - Check code format
id: webui_format
run: |
git config --global --add safe.directory $(realpath .)
cd examples/server/webui
git status
npm run format
git status
modified_files="$(git status -s)"
echo "Modified files: ${modified_files}"
if [ -n "${modified_files}" ]; then
echo "Files do not follow coding style. To fix: npm run format"
echo "${modified_files}"
exit 1
fi
- name: Verify bundled index.html
id: verify_server_index_html
run: |
git config --global --add safe.directory $(realpath .)
cd examples/server/webui
git status
npm ci
npm run build
git status
modified_files="$(git status -s)"
Expand Down
Binary file modified examples/server/public/index.html.gz
Binary file not shown.
24 changes: 24 additions & 0 deletions examples/server/webui/.gitignore
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?
10 changes: 10 additions & 0 deletions examples/server/webui/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**/.vscode
**/.github
**/.git
**/.svn
**/.hg
**/node_modules
**/dist
**/build

*.config.js
26 changes: 26 additions & 0 deletions examples/server/webui/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
)
353 changes: 14 additions & 339 deletions examples/server/webui/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit c789f4f

Please sign in to comment.