@ecmaos/jaffa 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ [package]
2
+ name = "ecmaos-jaffa"
3
+ version = "0.1.0"
4
+ description = "A Tauri App"
5
+ authors = ["you"]
6
+ edition = "2021"
7
+
8
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9
+
10
+ [lib]
11
+ # The `_lib` suffix may seem redundant but it is necessary
12
+ # to make the lib name unique and wouldn't conflict with the bin name.
13
+ # This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
14
+ name = "ecmaos_jaffa_lib"
15
+ crate-type = ["staticlib", "cdylib", "rlib"]
16
+
17
+ [build-dependencies]
18
+ tauri-build = { version = "2", features = [] }
19
+
20
+ [dependencies]
21
+ tauri = { version = "2", features = [] }
22
+ tauri-plugin-shell = "2"
23
+ serde = { version = "1", features = ["derive"] }
24
+ serde_json = "1"
25
+
@@ -0,0 +1,3 @@
1
+ fn main() {
2
+ tauri_build::build()
3
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "../gen/schemas/desktop-schema.json",
3
+ "identifier": "default",
4
+ "description": "Capability for the main window",
5
+ "windows": ["main"],
6
+ "permissions": [
7
+ "core:default",
8
+ "shell:allow-open"
9
+ ]
10
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,14 @@
1
+ // Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
2
+ #[tauri::command]
3
+ fn greet(name: &str) -> String {
4
+ format!("Hello, {}! You've been greeted from Rust!", name)
5
+ }
6
+
7
+ #[cfg_attr(mobile, tauri::mobile_entry_point)]
8
+ pub fn run() {
9
+ tauri::Builder::default()
10
+ .plugin(tauri_plugin_shell::init())
11
+ .invoke_handler(tauri::generate_handler![greet])
12
+ .run(tauri::generate_context!())
13
+ .expect("error while running tauri application");
14
+ }
@@ -0,0 +1,6 @@
1
+ // Prevents additional console window on Windows in release, DO NOT REMOVE!!
2
+ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
3
+
4
+ fn main() {
5
+ ecmaos_jaffa_lib::run()
6
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://schema.tauri.app/config/2",
3
+ "productName": "ecmaos-jaffa",
4
+ "version": "0.1.0",
5
+ "identifier": "com.ecmaos-jaffa.app",
6
+ "build": {
7
+ "beforeDevCommand": "pnpm dev",
8
+ "devUrl": "http://localhost:30888",
9
+ "beforeBuildCommand": "pnpm build",
10
+ "frontendDist": "../dist"
11
+ },
12
+ "app": {
13
+ "withGlobalTauri": true,
14
+ "windows": [
15
+ {
16
+ "title": "ecmaos-jaffa",
17
+ "width": 1024,
18
+ "height": 768
19
+ }
20
+ ],
21
+ "security": {
22
+ "csp": null
23
+ }
24
+ },
25
+ "bundle": {
26
+ "active": true,
27
+ "targets": "all",
28
+ "icon": [
29
+ "icons/32x32.png",
30
+ "icons/128x128.png",
31
+ "icons/128x128@2x.png",
32
+ "icons/icon.icns",
33
+ "icons/icon.ico"
34
+ ]
35
+ }
36
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "include": ["src"],
3
+ "compilerOptions": {
4
+ "target": "ES2020",
5
+ "useDefineForClassFields": true,
6
+ "module": "ESNext",
7
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "resolveJsonModule": true,
14
+ "isolatedModules": true,
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "noFallthroughCasesInSwitch": true
22
+ }
23
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,34 @@
1
+ import { defineConfig } from "vite"
2
+ import { nodePolyfills } from 'vite-plugin-node-polyfills'
3
+ import i18nextLoader from 'vite-plugin-i18next-loader'
4
+
5
+ const host = process.env.TAURI_DEV_HOST
6
+
7
+ // https://vitejs.dev/config/
8
+ export default defineConfig(async () => ({
9
+ plugins: [
10
+ nodePolyfills({ include: ['module', 'os', 'path'] }),
11
+ i18nextLoader({ namespaceResolution: 'basename', paths: ['locales'] })
12
+ ],
13
+ // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
14
+ //
15
+ // 1. prevent vite from obscuring rust errors
16
+ clearScreen: false,
17
+ // 2. tauri expects a fixed port, fail if that port is not available
18
+ server: {
19
+ port: 30888,
20
+ strictPort: true,
21
+ host: host || false,
22
+ hmr: host
23
+ ? {
24
+ protocol: "ws",
25
+ host,
26
+ port: 30888
27
+ }
28
+ : undefined,
29
+ watch: {
30
+ // 3. tell vite to ignore watching `src-tauri`
31
+ ignored: ["**/src-tauri/**"]
32
+ }
33
+ }
34
+ }))