diff --git a/.gitignore b/.gitignore index ce573a7..33ac004 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ thewhitesilk_config.json thewhitesilk_data/ deno.lock +node_modules/ \ No newline at end of file diff --git a/client/Data.ts b/client/Data.ts index 829d27b..072ed8f 100644 --- a/client/Data.ts +++ b/client/Data.ts @@ -1,9 +1,9 @@ -import { CryptoES } from './Imports.ts' +import * as CryptoES from 'crypto-es' const dataIsEmpty = !localStorage.tws_data || localStorage.tws_data == '' const aes = { - enc: (m: string, k: string) => CryptoES.AES.encrypt(m, k).toString(CryptoES.Utf8), + enc: (m: string, k: string) => CryptoES.AES.encrypt(m, k).toString(CryptoES.HexFormatter), dec: (m: string, k: string) => CryptoES.AES.decrypt(m, k).toString(CryptoES.Utf8), } diff --git a/client/Imports.ts b/client/Imports.ts deleted file mode 100644 index 277073b..0000000 --- a/client/Imports.ts +++ /dev/null @@ -1,30 +0,0 @@ -// @ts-types="./typedef/react@18.3.18.d.ts" -import * as React from './static/react-esm-18.3.1.static.js' -import * as ReactDOM from './static/react-dom-esm-18.3.1.static.js' -import * as CryptoES from './static/crypto-es-3.1.0.static.mjs' - -import type { Dialog } from 'https://unpkg.com/mdui@2.1.4/components/dialog/index.d.ts' -import type { TextField } from 'https://unpkg.com/mdui@2.1.4/components/text-field/index.d.ts' -import type { Button } from 'https://unpkg.com/mdui@2.1.4/components/button/index.d.ts' -import type { NavigationRail } from 'https://unpkg.com/mdui@2.1.4/components/navigation-rail/navigation-rail.d.ts' - -declare global { - namespace React { - namespace JSX { - interface IntrinsicAttributes { - id?: string - } - } - } -} - -export { - React, - ReactDOM, - CryptoES, - - Dialog as MduiDialog, - TextField as MduiTextField, - Button as MduiButton, - NavigationRail as MduiNavigationRail, -} diff --git a/client/deno.jsonc b/client/deno.jsonc new file mode 100644 index 0000000..e9629ec --- /dev/null +++ b/client/deno.jsonc @@ -0,0 +1,29 @@ +{ + "tasks": { + "dev": "deno run -A --node-modules-dir npm:vite", + "build": "deno run -A --node-modules-dir npm:vite build", + "preview": "deno run -A --node-modules-dir npm:vite preview", + "serve": "deno run --allow-net --allow-read jsr:@std/http@1/file-server dist/" + }, + "compilerOptions": { + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "jsx": "react-jsx", + "jsxImportSource": "react", + "jsxImportSourceTypes": "@types/react" + }, + "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", + "react": "npm:react@18.3.1", + "react-dom": "npm:react-dom@18.3.1", + "vite": "npm:vite@7.0.6", + + "chalk": "npm:chalk@5.4.1", + + "mdui": "npm:mdui@2.1.4", + "split.js": "npm:split.js@1.3.2", + "crypto-es": "npm:crypto-es@3.1.0" + } +} diff --git a/client/index.html b/client/index.html index dffd93b..b620792 100644 --- a/client/index.html +++ b/client/index.html @@ -7,88 +7,12 @@ - - - - -