feature/env (#80)
* fix(js-cli) resolve correct paths on `tauri init` * feat(js-cli) inject src-tauri/ as lodash template * fix(js-cli) entry paths * feat(js-cli) rename APP_URL to devPath and allow .html values * feat(js-cli) reload config when `tauri.conf.js` change detected * feat(node): update to testing * feat(template): fix phf, remove updater * feat(samples): add vanillajs * fix(templates): objectify tauri Closes #99. * fix(examples): update cargo.toml - to match signature * chore(tauri): version update * feat(workflows): fix dirs, add tokens * fix(config): more robust env checking * feat(fixture): start a testing fixture for tauri * fix(workflow): use fixture for ENV * fix(examples:vanilla): remove updater * addition to previous commit re. fixture * fix(config.rs): fix the unfix * feat(js-cli) use the new cargo-tauri-cli * chore(template) cleanup src-tauri/Cargo.toml * chore(js-cli) toml features cleanup * chore(js-cli) move edge to config > tauri * fix(js-cli) appPaths resolve() instead of join()
1773
examples/vanillajs/monolith/dist/index.html
vendored
Normal file
18
examples/vanillajs/monolith/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "monolith",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"html:dev": "quasar serve ./dist",
|
||||
"tauri:init": "node node_modules/tauri/bin/tauri init",
|
||||
"tauri:dev": "node node_modules/tauri/bin/tauri dev",
|
||||
"tauri:build": "node node_modules/tauri/bin/tauri dev"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tauri": "link:../../../cli/tauri.js"
|
||||
}
|
||||
}
|
||||
14
examples/vanillajs/monolith/src-tauri/.gitignore
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
|
||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||
Cargo.lock
|
||||
|
||||
# These are backup files generated by rustfmt
|
||||
**/*.rs.bk
|
||||
|
||||
tauri.js
|
||||
config.json
|
||||
bundle.json
|
||||
39
examples/vanillajs/monolith/src-tauri/Cargo.toml
Normal file
@@ -0,0 +1,39 @@
|
||||
[package]
|
||||
name = "app"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
author = [ "you" ]
|
||||
license = ""
|
||||
repository = ""
|
||||
default-run = "app"
|
||||
edition = "2018"
|
||||
|
||||
[package.metadata.bundle]
|
||||
identifier = "com.tauri.dev"
|
||||
icon = [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1.0.41"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
tiny_http = "0.6"
|
||||
phf = "0.7.24"
|
||||
includedir = "0.5.0"
|
||||
|
||||
[dependencies.tauri]
|
||||
version = "0.1.0"
|
||||
features = [ "all-api" ]
|
||||
|
||||
[features]
|
||||
dev = [ "tauri/dev" ]
|
||||
embedded-server = [ "tauri/embedded-server" ]
|
||||
|
||||
[[bin]]
|
||||
name = "app"
|
||||
path = "src/main.rs"
|
||||
BIN
examples/vanillajs/monolith/src-tauri/icons/128x128.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
examples/vanillajs/monolith/src-tauri/icons/128x128@2x.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
examples/vanillajs/monolith/src-tauri/icons/32x32.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 33 KiB |
BIN
examples/vanillajs/monolith/src-tauri/icons/Square30x30Logo.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 38 KiB |
BIN
examples/vanillajs/monolith/src-tauri/icons/Square44x44Logo.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
examples/vanillajs/monolith/src-tauri/icons/Square71x71Logo.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
examples/vanillajs/monolith/src-tauri/icons/Square89x89Logo.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
examples/vanillajs/monolith/src-tauri/icons/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
examples/vanillajs/monolith/src-tauri/icons/icon.icns
Normal file
BIN
examples/vanillajs/monolith/src-tauri/icons/icon.ico
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
examples/vanillajs/monolith/src-tauri/icons/icon.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
13
examples/vanillajs/monolith/src-tauri/rustfmt.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
max_width = 100
|
||||
hard_tabs = false
|
||||
tab_spaces = 2
|
||||
newline_style = "Auto"
|
||||
use_small_heuristics = "Default"
|
||||
reorder_imports = true
|
||||
reorder_modules = true
|
||||
remove_nested_parens = true
|
||||
edition = "2018"
|
||||
merge_derives = true
|
||||
use_try_shorthand = false
|
||||
use_field_init_shorthand = false
|
||||
force_explicit_abi = true
|
||||
8
examples/vanillajs/monolith/src-tauri/src/cmd.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
#[derive(Deserialize)]
|
||||
#[serde(tag = "cmd", rename_all = "camelCase")]
|
||||
pub enum Cmd {
|
||||
// your custom commands
|
||||
// multiple arguments are allowed
|
||||
// note that rename_all = "camelCase": you need to use "myCustomCommand" on JS
|
||||
MyCustomCommand { argument: String },
|
||||
}
|
||||
26
examples/vanillajs/monolith/src-tauri/src/main.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
mod cmd;
|
||||
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
extern crate serde_json;
|
||||
|
||||
fn main() {
|
||||
tauri::AppBuilder::new()
|
||||
.invoke_handler(|_webview, arg| {
|
||||
use cmd::Cmd::*;
|
||||
match serde_json::from_str(arg) {
|
||||
Err(_) => {}
|
||||
Ok(command) => {
|
||||
match command {
|
||||
// definitions for your custom commands from Cmd here
|
||||
MyCustomCommand { argument } => {
|
||||
// your command code
|
||||
println!("{}", argument);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.build()
|
||||
.run();
|
||||
}
|
||||
33
examples/vanillajs/monolith/tauri.conf.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const path = require('path')
|
||||
const distDir = path.resolve(__dirname, './dist')
|
||||
|
||||
module.exports = function () {
|
||||
return {
|
||||
automaticStart: {
|
||||
active: true
|
||||
},
|
||||
build: {
|
||||
distDir: distDir,
|
||||
devPath: 'http://localhost:4000' // devServer URL or path to html file
|
||||
},
|
||||
ctx: {},
|
||||
tauri: {
|
||||
embeddedServer: {
|
||||
active: true
|
||||
},
|
||||
bundle: {
|
||||
active: true
|
||||
},
|
||||
whitelist: {
|
||||
all: true
|
||||
},
|
||||
window: {
|
||||
title: 'Tauri App'
|
||||
},
|
||||
security: {
|
||||
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
||||
}
|
||||
},
|
||||
edge: true
|
||||
}
|
||||
}
|
||||