Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Vue3 rewrite #47

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
27d88ce
WIP.
m1k1o Mar 16, 2024
c8c7df7
add proxy server.
m1k1o Mar 17, 2024
4b1fbbf
fix watchers and intervals.
m1k1o Mar 17, 2024
338c1dc
fix serve script.
m1k1o Mar 17, 2024
bdacd55
fix members.
m1k1o Mar 17, 2024
6272e48
tsconfig only ts files and vue.
m1k1o Mar 17, 2024
e036690
use glob to load plugins.
m1k1o Mar 17, 2024
5ebfb04
dev use app path inside docker as well.
m1k1o Mar 17, 2024
f3a49e7
fix javascript files import.
m1k1o Mar 17, 2024
93125ab
fix plugins members.
m1k1o Mar 17, 2024
3a96d26
do not use ref where not needed.
m1k1o Mar 17, 2024
b6be4f0
fix watchers.
m1k1o Mar 24, 2024
b302c98
implement filetransfer.
m1k1o Apr 19, 2024
22524f7
fix minor issues.
m1k1o Apr 20, 2024
fb0af48
add locked_logins.
m1k1o Apr 20, 2024
bc26fde
add filetransfer lock.
m1k1o Apr 20, 2024
7eb40ab
implement control protection.
m1k1o Apr 21, 2024
17b6493
add id to event screen updated.
m1k1o May 3, 2024
2536b49
add room.settings.updated.
m1k1o May 6, 2024
7998018
add id to room.control.host.
m1k1o May 6, 2024
3a0bd06
fix click on color.
m1k1o May 9, 2024
d891d5b
lint types.
m1k1o May 9, 2024
06955aa
update api.
m1k1o May 9, 2024
86095ec
add room.control.request.
m1k1o May 10, 2024
2d8e5c9
WIP add chat plugin.
m1k1o Jun 9, 2024
4bd6eb6
fix dev scripts.
m1k1o Jun 16, 2024
ad101dd
filetransfer: use enabeld in settings and profile.
m1k1o Jun 16, 2024
2918e31
chat: use can send & can receive in settings and profile.
m1k1o Jun 16, 2024
d79dea2
fix plugin settings unmarshal by changing to "name.key".
m1k1o Jun 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

19 changes: 0 additions & 19 deletions .eslintrc

This file was deleted.

26 changes: 26 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
overrides: [
{
files: [
'e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'
],
'extends': [
'plugin:playwright/recommended'
]
}
],
parserOptions: {
ecmaVersion: 'latest'
},
ignorePatterns: ["**/*.js"]
}
34 changes: 33 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
.env.local
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo

test-results/
playwright-report/

/src/page/plugins/*
!/src/page/plugins/filetransfer
!/src/page/plugins/chat
!/src/page/plugins/.gitkeep
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
15 changes: 1 addition & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,9 @@
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.encoding": "utf8",
"files.eol": "\n",
"typescript.tsdk": "./node_modules/typescript/lib",
"todo-tree.filtering.excludeGlobs": ["**/node_modules/**"],
"eslint.validate": [
"vue",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
],
"vetur.validation.template": true,
"vetur.useWorkspaceDependencies": true,
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "ui"
},
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
Expand Down
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,68 @@ npm run build
KEYBOARD=novnc npm run build
```

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).

## Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```

### Run Unit Tests with [Vitest](https://vitest.dev/)

```sh
npm run test:unit
```

### Run End-to-End Tests with [Playwright](https://playwright.dev)

```sh
# Install browsers for the first run
npx playwright install

# When testing on CI, must build the project first
npm run build

# Runs the end-to-end tests
npm run test:e2e
# Runs the tests only on Chromium
npm run test:e2e -- --project=chromium
# Runs the tests of a specific file
npm run test:e2e -- tests/example.spec.ts
# Runs the tests in debug mode
npm run test:e2e -- --debug
```

### Lint with [ESLint](https://eslint.org/)

```sh
npm run lint
```


### Example
API consists of accessing Vue reactive state, calling various methods and subscribing to events. Simple usage:

Expand Down
6 changes: 4 additions & 2 deletions dev/build
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/sh
cd "$(dirname "$0")"

APP_PATH="$(realpath ../)"

# start component watch
docker run --rm -it \
--user "$(id -u):$(id -g)" \
--volume "${PWD}/../:/app" \
--volume "$APP_PATH:$APP_PATH" \
--entrypoint="npm" \
--workdir="/app" \
--workdir="$APP_PATH" \
node:18-buster-slim run build
6 changes: 4 additions & 2 deletions dev/exec
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/sh
cd "$(dirname "$0")"

APP_PATH="$(realpath ../)"

# start component watch
docker run --rm -it \
--user "$(id -u):$(id -g)" \
--volume "${PWD}/../:/app" \
--volume "$APP_PATH:$APP_PATH" \
--entrypoint="/bin/bash" \
--workdir="/app" \
--workdir="$APP_PATH" \
node:18-buster-slim
6 changes: 4 additions & 2 deletions dev/npm
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/sh
cd "$(dirname "$0")"

APP_PATH="$(realpath ../)"

# npm
docker run --rm -it \
--user "$(id -u):$(id -g)" \
--volume "${PWD}/../:/app" \
--volume "$APP_PATH:$APP_PATH" \
--entrypoint="npm" \
--workdir="/app" \
--workdir="$APP_PATH" \
node:18-buster-slim "$@"
14 changes: 10 additions & 4 deletions dev/serve
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ if [ -z $NEKO_HOST ]; then
fi
done

if [ -z $NEKO_HOST ]; then
NEKO_HOST=$(hostname -I 2>/dev/null | awk '{print $1}')
fi

if [ -z $NEKO_HOST ]; then
NEKO_HOST=$(hostname -i 2>/dev/null)
fi
Expand All @@ -21,14 +25,16 @@ fi
echo "Using app port: ${NEKO_PORT}"
echo "Using IP address: ${NEKO_HOST}"

APP_PATH="$(realpath ../)"

# npm run serve
docker run --rm -it \
-p 3001:8080 \
-p 3001:3001 \
-e "NEKO_HOST=$NEKO_HOST" \
-e "NEKO_PORT=$NEKO_PORT" \
-e "VUE_APP_LOG_COLOR=true" \
--user "$(id -u):$(id -g)" \
--volume "${PWD}/../:/app" \
--volume "$APP_PATH:$APP_PATH" \
--entrypoint="npm" \
--workdir="/app" \
node:18-buster-slim run serve
--workdir="$APP_PATH" \
node:18-buster-slim run dev -- --port 3001 --host
4 changes: 4 additions & 0 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"include": ["./**/*"]
}
8 changes: 8 additions & 0 deletions e2e/vue.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { test, expect } from '@playwright/test';

// See here how to get started:
// https://playwright.dev/docs/intro
test('visits the app root url', async ({ page }) => {
await page.goto('/');
await expect(page.locator('div.greetings > h1')).toHaveText('You did it!');
})
1 change: 1 addition & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Neko</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading
Loading