feat(tauri.js): repath template files

This commit is contained in:
Daniel Thompson-Yvetot
2019-11-29 07:27:26 +01:00
parent 29ce255568
commit d7b7b668a1
26 changed files with 39 additions and 7 deletions

View File

@@ -3,8 +3,7 @@ const { readFileSync, writeFileSync, ensureDir } = require('fs-extra')
const path = require('path')
module.exports.generate = (outDir, cfg) => {
// this MUST be from the templates repo
const apiTemplate = readFileSync(path.resolve(__dirname, '../lib/tauri.js'), 'utf-8')
const apiTemplate = readFileSync(path.resolve(__dirname, './templates/tauri.js'), 'utf-8')
const apiContent = compileTemplate(apiTemplate)({
...cfg,
confName: 'tauri.conf.js'

View File

@@ -1,9 +1,9 @@
{
"name": "tauri",
"version": "0.1.0",
"version": "0.1.1",
"description": "Multi-binding collection of libraries and templates for building Tauri apps",
"bin": {
"tauri": "./mode/bin/tauri.js"
"tauri": "./bin/tauri.js"
},
"funding": {
"type": "opencollective",
@@ -27,7 +27,7 @@
"access": "public"
},
"engines": {
"node": ">= 10.16.3",
"node": ">= 10.17.0",
"npm": ">= 6.6.0",
"yarn": ">= 1.19.1"
},

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: false
},
window: {
title: 'Tauri App'
},
security: {
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
}
},
edge: true
}
}

View File

@@ -14,7 +14,7 @@ const injectConfFile = (injectPath, force, logging, directory) => {
} else {
try {
removeSync(path)
copySync(resolve(__dirname, '../templates/conf/tauri.conf.js'), path)
copySync(resolve(__dirname, './templates/tauri.conf.js'), path)
} catch (e) {
if (logging) console.log(e)
return false
@@ -33,7 +33,7 @@ Run \`tauri init --force template\` to overwrite.`)
try {
removeSync(injectPath)
mkdirSync(injectPath)
copySync(resolve(__dirname, '../templates/rust'), injectPath)
copySync(resolve(__dirname, './templates/rust'), injectPath)
} catch (e) {
if (logging) console.log(e)
return false

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB