chore: add prettierignore and fmt the repo (#5192)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
Amr Bashir 2022-09-18 14:16:35 +02:00 committed by GitHub
parent ecb489a77c
commit 1d7171a1ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 255 additions and 243 deletions

11
.prettierignore Normal file
View File

@ -0,0 +1,11 @@
/.github
/.husky
/.vscode
/audits
node_modules
target
dist
/core/tauri/scripts
/tooling/cli/templates
/tooling/cli/node
/tooling/cli/schema.json

View File

@ -10,26 +10,26 @@ we should look to find a more "rusty way" to import / "pin" a version value in o
rust binaries.
*/
const {
readFileSync,
writeFileSync
} = require('fs')
const { readFileSync, writeFileSync } = require('fs')
const packageNickname = process.argv[2]
const filePath = packageNickname === 'cli.js' ? `../../../tooling/cli/metadata.json` : `../../tooling/cli/metadata.json`
const filePath =
packageNickname === 'cli.js'
? `../../../tooling/cli/metadata.json`
: `../../tooling/cli/metadata.json`
const bump = process.argv[3]
let index = null
switch (bump) {
case 'major':
index = 0;
break;
index = 0
break
case 'minor':
index = 1;
break;
index = 1
break
case 'patch':
index = 2;
break;
index = 2
break
default:
throw new Error('unexpected bump ' + bump)
}

View File

@ -30,9 +30,7 @@
"active": true,
"dialog": false,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE5QzMxNjYwNTM5OEUwNTgKUldSWTRKaFRZQmJER1h4d1ZMYVA3dnluSjdpN2RmMldJR09hUFFlZDY0SlFqckkvRUJhZDJVZXAK",
"endpoints": [
"http://localhost:3007"
],
"endpoints": ["http://localhost:3007"],
"windows": {
"installMode": "quiet"
}

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta charset="UTF-8" />
<title>Isolation Secure Script</title>
</head>
<body>

View File

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<style>
#response {
@ -52,7 +51,9 @@
var createWindowButton = document.createElement('button')
createWindowButton.innerHTML = 'Create window'
createWindowButton.addEventListener('click', function () {
var webviewWindow = new WebviewWindow(Math.random().toString().replace('.', ''))
var webviewWindow = new WebviewWindow(
Math.random().toString().replace('.', '')
)
webviewWindow.once('tauri://created', function () {
responseContainer.innerHTML += 'Created new webview'
})
@ -80,5 +81,4 @@
}
</script>
</body>
</html>

View File

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@ -17,5 +16,4 @@
</script>
<script src="secondary.js"></script>
</body>
</html>

View File

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<style>
#response {
@ -43,12 +42,13 @@
var windowNumber = 1
createWindowButton.innerHTML = 'Create child window ' + windowNumber
createWindowButton.addEventListener('click', function () {
runCommand('create_child_window', { id: `child-${windowId}-${windowNumber}` })
runCommand('create_child_window', {
id: `child-${windowId}-${windowNumber}`
})
windowNumber += 1
createWindowButton.innerHTML = 'Create child window ' + windowNumber
})
container.appendChild(createWindowButton)
</script>
</body>
</html>

View File

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@ -36,14 +35,22 @@
const frontendDiv = document.getElementById('frontend')
const { Command } = window.__TAURI__.shell
const command = Command.sidecar('binaries/app')
command.on('close', data => {
addMessage(frontendDiv, `command finished with code ${data.code} and signal ${data.signal}`)
command.on('close', (data) => {
addMessage(
frontendDiv,
`command finished with code ${data.code} and signal ${data.signal}`
)
})
command.on('error', error => addMessage(frontendDiv, `command error: "${error}"`))
command.stdout.on('data', line => addMessage(frontendDiv, `command stdout: "${line}"`))
command.stderr.on('data', line => addMessage(frontendDiv, `command stderr: "${line}"`))
command.on('error', (error) =>
addMessage(frontendDiv, `command error: "${error}"`)
)
command.stdout.on('data', (line) =>
addMessage(frontendDiv, `command stdout: "${line}"`)
)
command.stderr.on('data', (line) =>
addMessage(frontendDiv, `command stderr: "${line}"`)
)
command.spawn()
</script>
</body>
</html>

View File

@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@ -27,5 +26,4 @@
video.load()
</script>
</body>
</html>

View File

@ -11,7 +11,7 @@
"url": "https://github.com/tauri-apps/tauri.git"
},
"scripts": {
"format": "prettier --write --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path .gitignore",
"format": "prettier --write --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path .prettierignore",
"postinstall": "husky install"
},
"devDependencies": {

View File

@ -16,8 +16,8 @@
"npm-publish": "yarn build && cd ./dist && yarn publish --access public --loglevel silly",
"lint": "eslint --ext ts \"./src/**/*.ts\"",
"lint-fix": "eslint --fix --ext ts \"./src/**/*.ts\"",
"format": "prettier --write --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path .gitignore",
"format:check": "prettier --check --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path .gitignore",
"format": "prettier --write --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path ../../.prettierignore",
"format:check": "prettier --check --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path ../../.prettierignore",
"generate-docs": "typedoc"
},
"repository": {