diff --git a/.gitignore b/.gitignore index ec8e5a9..87b5fc3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ node_modules/ dist/ src-tauri/target/ .vscode/ +*.log +.env* +.DS_Store +Thumbs.db diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..2aa7205 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 2fc2e54..0e78e1f 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -20,6 +20,10 @@ thiserror = "1.0" chrono = "0.4" anyhow = "1.0" +[lib] +name = "kimiswitch_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + [features] default = ["custom-protocol"] custom-protocol = ["tauri/custom-protocol"] diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs new file mode 100644 index 0000000..adad12a --- /dev/null +++ b/src-tauri/src/lib.rs @@ -0,0 +1,6 @@ +pub fn run() { + tauri::Builder::default() + .plugin(tauri_plugin_shell::init()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 3c7c14d..94246bb 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -21,17 +21,11 @@ } ], "security": { - "csp": null + "csp": "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;" } }, "bundle": { "active": true, - "targets": ["msi"], - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.ico" - ] + "targets": ["msi"] } } diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..77fc199 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,5 @@ +function App() { + return
KimiSwitch
; +} + +export default App; diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..614c86b --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,8 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], + theme: { + extend: {}, + }, + plugins: [], +}; diff --git a/vite.config.ts b/vite.config.ts index a1ace85..e8a6e13 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,5 +9,5 @@ export default defineConfig(async () => ({ strictPort: true, watch: { ignored: ["**/src-tauri/**"] }, }, - envPrefix: ["VITE_", "TAURI_"], + envPrefix: ["VITE_"], }));