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()
This commit is contained in:
nothingismagick
2019-11-30 12:48:39 +01:00
committed by Lucas Fernandes Nogueira
parent 50ef912721
commit 6dcccf5a8e
69 changed files with 4964 additions and 2851 deletions

File diff suppressed because it is too large Load Diff

View 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"
}
}

View 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

View 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"

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View 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

View 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 },
}

View 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();
}

View 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
}
}

File diff suppressed because it is too large Load Diff