Compare commits
2 Commits
a549773eb2
...
d76abcf512
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d76abcf512 | ||
|
|
6ca9946499 |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -2,9 +2,6 @@
|
|||||||
thewhitesilk_config.json
|
thewhitesilk_config.json
|
||||||
# **默认**数据目录
|
# **默认**数据目录
|
||||||
thewhitesilk_data/
|
thewhitesilk_data/
|
||||||
|
# Node.js
|
||||||
deno.lock
|
|
||||||
node_modules/
|
|
||||||
|
|
||||||
#npm
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
node_modules/
|
||||||
|
|||||||
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@@ -5,10 +5,10 @@
|
|||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"command": "deno task build-and-run-server",
|
"command": "npm run build-client-and-server",
|
||||||
"name": "Run debug",
|
"name": "Debug",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "node-terminal",
|
"type": "node-terminal"
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"deno.enable": true,
|
"deno.enable": false,
|
||||||
"deno.disablePaths": [
|
"deno.disablePaths": [
|
||||||
"./thewhitesilk_data",
|
"./thewhitesilk_data",
|
||||||
"./client/mdui_patched"
|
"./mdui_patched"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -8,29 +8,6 @@ import CallbackError from "./CallbackError.ts"
|
|||||||
|
|
||||||
import Message from "./Message.ts"
|
import Message from "./Message.ts"
|
||||||
|
|
||||||
import Chat from "./Chat.ts"
|
|
||||||
import User from "./User.ts"
|
|
||||||
import UserMySelf from "./UserMySelf.ts"
|
|
||||||
import UserBean from "./bean/UserBean.ts"
|
|
||||||
import ChatBean from "./bean/ChatBean.ts"
|
|
||||||
import GroupSettingsBean from "./bean/GroupSettingsBean.ts"
|
|
||||||
import JoinRequestBean from "./bean/JoinRequestBean.ts"
|
|
||||||
import MessageBean from "./bean/MessageBean.ts"
|
|
||||||
import RecentChatBean from "./bean/RecentChatBean.ts"
|
|
||||||
|
|
||||||
export {
|
|
||||||
Chat,
|
|
||||||
User,
|
|
||||||
UserMySelf,
|
|
||||||
|
|
||||||
UserBean,
|
|
||||||
ChatBean,
|
|
||||||
MessageBean,
|
|
||||||
RecentChatBean,
|
|
||||||
JoinRequestBean,
|
|
||||||
}
|
|
||||||
export type { GroupSettingsBean }
|
|
||||||
|
|
||||||
export default class LingChairClient {
|
export default class LingChairClient {
|
||||||
declare client: Socket
|
declare client: Socket
|
||||||
declare access_token: string
|
declare access_token: string
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"imports": {
|
|
||||||
"socket.io-client": "npm:socket.io-client@4.8.1",
|
|
||||||
"lingchair-internal-shared": "../internal-shared/mod.ts",
|
|
||||||
"marked": "npm:marked@16.3.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
25
client-protocol/main.ts
Normal file
25
client-protocol/main.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import Chat from "./Chat.ts"
|
||||||
|
import User from "./User.ts"
|
||||||
|
import UserMySelf from "./UserMySelf.ts"
|
||||||
|
import UserBean from "./bean/UserBean.ts"
|
||||||
|
import ChatBean from "./bean/ChatBean.ts"
|
||||||
|
import GroupSettingsBean from "./bean/GroupSettingsBean.ts"
|
||||||
|
import JoinRequestBean from "./bean/JoinRequestBean.ts"
|
||||||
|
import MessageBean from "./bean/MessageBean.ts"
|
||||||
|
import RecentChatBean from "./bean/RecentChatBean.ts"
|
||||||
|
import LingChairClient from "./LingChairClient.ts"
|
||||||
|
|
||||||
|
export {
|
||||||
|
LingChairClient,
|
||||||
|
|
||||||
|
Chat,
|
||||||
|
User,
|
||||||
|
UserMySelf,
|
||||||
|
|
||||||
|
UserBean,
|
||||||
|
ChatBean,
|
||||||
|
MessageBean,
|
||||||
|
RecentChatBean,
|
||||||
|
JoinRequestBean,
|
||||||
|
}
|
||||||
|
export type { GroupSettingsBean }
|
||||||
10
client-protocol/package.json
Normal file
10
client-protocol/package.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name": "lingchair-client-protocol",
|
||||||
|
"type": "module",
|
||||||
|
"main": "./main.ts",
|
||||||
|
"dependencies": {
|
||||||
|
"lingchair-internal-shared": "*",
|
||||||
|
"marked": "16.3.0",
|
||||||
|
"socket.io-client": "4.8.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
"tasks": {
|
|
||||||
"build": "deno run --allow-run --allow-env --allow-read checkIsAndroidAndBuild.ts npm:vite build",
|
|
||||||
"build-watch": "deno run --allow-run --allow-env --allow-read checkIsAndroidAndBuild.ts npm:vite --watch build"
|
|
||||||
},
|
|
||||||
"compilerOptions": {
|
|
||||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"jsxImportSource": "react",
|
|
||||||
"jsxImportSourceTypes": "@types/react"
|
|
||||||
},
|
|
||||||
"nodeModulesDir": "auto",
|
|
||||||
"links": [
|
|
||||||
"../mdui_patched"
|
|
||||||
],
|
|
||||||
"imports": {
|
|
||||||
"@deno/vite-plugin": "npm:@deno/vite-plugin@1.0.5",
|
|
||||||
"@types/react": "npm:@types/react@18.3.1",
|
|
||||||
"@types/react-dom": "npm:@types/react-dom@18.3.1",
|
|
||||||
"@vitejs/plugin-react": "npm:@vitejs/plugin-react@4.7.0",
|
|
||||||
"lightningcss": "npm:lightningcss@^1.30.2",
|
|
||||||
"react": "npm:react@18.3.1",
|
|
||||||
"react-dom": "npm:react-dom@18.3.1",
|
|
||||||
"terser": "npm:terser@^5.44.1",
|
|
||||||
"vite": "npm:vite@7.0.6",
|
|
||||||
|
|
||||||
"rollup": "npm:@rollup/wasm-node@4.48.0",
|
|
||||||
|
|
||||||
"chalk": "npm:chalk@5.4.1",
|
|
||||||
|
|
||||||
"mdui": "npm:mdui@2.1.4",
|
|
||||||
"split.js": "npm:split.js@1.3.2",
|
|
||||||
"crypto-js": "npm:crypto-js@4.2.0",
|
|
||||||
"socket.io-client": "npm:socket.io-client@4.8.1",
|
|
||||||
"marked": "npm:marked@16.3.0",
|
|
||||||
"dompurify": "npm:dompurify@3.2.7",
|
|
||||||
"pinch-zoom-element": "npm:pinch-zoom-element@1.1.1",
|
|
||||||
"ua-parser-js": "npm:ua-parser-js@2.0.6",
|
|
||||||
|
|
||||||
"lingchair-internal-shared": "../internal-shared/mod.ts",
|
|
||||||
"lingchair-client-protocol": "../mod.ts"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
29
client/package.json
Normal file
29
client/package.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"name": "lingchair-client",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "npx vite build",
|
||||||
|
"build-watch": "npx vite --watch build"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"react": "18.3.1",
|
||||||
|
"react-dom": "18.3.1",
|
||||||
|
"mdui": "2.1.4",
|
||||||
|
"split.js": "1.3.2",
|
||||||
|
"crypto-js": "4.2.0",
|
||||||
|
"socket.io-client": "4.8.1",
|
||||||
|
"marked": "16.3.0",
|
||||||
|
"dompurify": "3.2.7",
|
||||||
|
"pinch-zoom-element": "1.1.1",
|
||||||
|
"ua-parser-js": "2.0.6",
|
||||||
|
"lingchair-internal-shared": "*"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/react": "18.3.1",
|
||||||
|
"@types/react-dom": "18.3.1",
|
||||||
|
"@vitejs/plugin-react": "4.7.0",
|
||||||
|
"vite": "7.0.6",
|
||||||
|
"@rollup/wasm-node": "4.48.0",
|
||||||
|
"chalk": "5.4.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,40 +1,12 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import deno from '@deno/vite-plugin'
|
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
import config from '../server/config.ts'
|
import config from '../server/config.ts'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), deno()],
|
plugins: [react()],
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
outDir: "." + config.data_path + '/page_compiled',
|
outDir: "." + config.data_path + '/page_compiled',
|
||||||
minify: 'terser',
|
|
||||||
cssMinify: 'lightningcss',
|
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
manualChunks(id) {
|
|
||||||
if (id.includes('node_modules')) {
|
|
||||||
if (id.includes('mdui')) {
|
|
||||||
return 'mdui'
|
|
||||||
}
|
|
||||||
if (id.includes('crypto-js')) {
|
|
||||||
return 'cryptojs'
|
|
||||||
}
|
|
||||||
if (id.includes('split.js')) {
|
|
||||||
return 'splitjs'
|
|
||||||
}
|
|
||||||
if (id.includes('marked')) {
|
|
||||||
return 'marked'
|
|
||||||
}
|
|
||||||
return 'vendor'
|
|
||||||
}
|
|
||||||
return 'main'
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
optimizeDeps: {
|
|
||||||
include: ['socket.io-client']
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
18
deno.jsonc
18
deno.jsonc
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"tasks": {
|
|
||||||
"server": "deno run --allow-read --allow-write --allow-env --allow-net --allow-sys --allow-run=deno ./server/main.ts",
|
|
||||||
"build-and-run-server": "deno task build && deno run --watch --allow-read --allow-write --allow-env --allow-net --allow-sys --allow-run=deno ./server/main.ts",
|
|
||||||
"build": "cd ./client && deno task build"
|
|
||||||
},
|
|
||||||
"imports": {
|
|
||||||
"chalk": "npm:chalk@5.4.1",
|
|
||||||
"file-type": "npm:file-type@21.0.0",
|
|
||||||
"express": "npm:express@5.1.0",
|
|
||||||
"socket.io": "npm:socket.io@4.8.1",
|
|
||||||
"cookie-parser": "npm:cookie-parser@1.4.7",
|
|
||||||
"express-fileupload": "npm:express-fileupload@1.5.2",
|
|
||||||
"lingchair-internal-shared": "./internal-shared/mod.ts",
|
|
||||||
|
|
||||||
"socket.io-client": "npm:socket.io-client@4.8.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
5
internal-shared/package.json
Normal file
5
internal-shared/package.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "lingchair-internal-shared",
|
||||||
|
"type": "module",
|
||||||
|
"main": "./main.ts"
|
||||||
|
}
|
||||||
6
mod.ts
6
mod.ts
@@ -1,6 +0,0 @@
|
|||||||
import LingChairClient from './client-protocol/LingChairClient.ts'
|
|
||||||
|
|
||||||
export * from './client-protocol/LingChairClient.ts'
|
|
||||||
export {
|
|
||||||
LingChairClient
|
|
||||||
}
|
|
||||||
24
package.json
Normal file
24
package.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "lingchair",
|
||||||
|
"type": "module",
|
||||||
|
"workspaces": [
|
||||||
|
"./mdui_patched",
|
||||||
|
"./client-protocol",
|
||||||
|
"./internal-shared",
|
||||||
|
"./client"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build-client-and-server": "npm run build-client && npm run server",
|
||||||
|
"server": "npx tsx ./server/main.ts",
|
||||||
|
"build-client": "cd client && npm run build"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"chalk": "5.4.1",
|
||||||
|
"cookie-parser": "1.4.7",
|
||||||
|
"express": "5.1.0",
|
||||||
|
"express-fileupload": "1.5.2",
|
||||||
|
"file-type": "21.0.0",
|
||||||
|
"socket.io": "4.8.1",
|
||||||
|
"lingchair-internal-shared": "*"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user