feat(tauri.js): repath template files
@@ -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'
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
33
cli/tauri.js/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: false
|
||||
},
|
||||
window: {
|
||||
title: 'Tauri App'
|
||||
},
|
||||
security: {
|
||||
csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
|
||||
}
|
||||
},
|
||||
edge: true
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |