Browse Source

chore: run `yarn format`

Lucas Nogueira 2 years ago
parent
commit
873b9aee90

File diff suppressed because it is too large
+ 101 - 369
core/config-schema/schema.json


+ 1 - 3
core/tests/app-updater/tauri.conf.json

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

+ 72 - 72
examples/commands/index.html

@@ -1,79 +1,79 @@
 <!DOCTYPE html>
 <html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>Tauri</title>
+  </head>
 
-<head>
-  <meta charset="UTF-8" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Tauri</title>
-</head>
-
-<body>
-  <h1>Tauri Commands</h1>
-  <div>Response: <span id="response"></span></div>
-  <div>Without Args: <span id="response-optional"></span></div>
-  <div id="container"></div>
-  <script>
-    function runCommand(commandName, args, optional) {
-      const id = optional ? '#response-optional' : '#response'
-      const result = document.querySelector(id)
-      window.__TAURI__
-        .invoke(commandName, args)
-        .then((response) => {
-          result.innerText = `Ok(${response})`
-        })
-        .catch((error) => {
-          result.innerText = `Err(${error})`
-        })
-    }
-
-    const container = document.querySelector('#container')
-    const commands = [
-      { name: 'borrow_cmd' },
-      { name: 'window_label' },
-      { name: 'simple_command' },
-      { name: 'stateful_command' },
-      { name: 'async_simple_command' },
-      { name: 'async_simple_command_snake' },
-      { name: 'future_simple_command' },
-      { name: 'async_stateful_command' },
-      { name: 'simple_command_with_result' },
-      // snake
-      { name: 'future_simple_command_snake' },
-      { name: 'future_simple_command_with_return_snake' },
-      { name: 'future_simple_command_with_result_snake' },
-      { name: 'force_async_snake' },
-      { name: 'force_async_with_result_snake' },
-      { name: 'simple_command_with_result_snake' },
-      { name: 'stateful_command_with_result_snake' },
-      // state
-      { name: 'stateful_command_with_result' },
-      { name: 'async_simple_command_with_result' },
-      { name: 'future_simple_command_with_return' },
-      { name: 'future_simple_command_with_result' },
-      { name: 'async_stateful_command_with_result' },
-      { name: 'command_arguments_wild' },
-      {
-        name: 'command_arguments_struct',
-        args: { Person: { name: 'ferris', age: 6 } }
-      },
-      {
-        name: 'command_arguments_tuple_struct',
-        args: { InlinePerson: ['ferris', 6] }
+  <body>
+    <h1>Tauri Commands</h1>
+    <div>Response: <span id="response"></span></div>
+    <div>Without Args: <span id="response-optional"></span></div>
+    <div id="container"></div>
+    <script>
+      function runCommand(commandName, args, optional) {
+        const id = optional ? '#response-optional' : '#response'
+        const result = document.querySelector(id)
+        window.__TAURI__
+          .invoke(commandName, args)
+          .then((response) => {
+            result.innerText = `Ok(${response})`
+          })
+          .catch((error) => {
+            result.innerText = `Err(${error})`
+          })
       }
-    ]
 
-    for (const command of commands) {
-      const { name } = command
-      const args = command.args ?? { [name.endsWith('snake') ? 'the_argument' : 'theArgument']: 'value' }
-      const button = document.createElement('button')
-      button.innerHTML = `Run ${name}`
-      button.addEventListener('click', function () {
-        runCommand(name, args, false)
-        runCommand(name, Object.create(null), true)
-      })
-      container.appendChild(button)
-    }
-  </script>
-</body>
+      const container = document.querySelector('#container')
+      const commands = [
+        { name: 'borrow_cmd' },
+        { name: 'window_label' },
+        { name: 'simple_command' },
+        { name: 'stateful_command' },
+        { name: 'async_simple_command' },
+        { name: 'async_simple_command_snake' },
+        { name: 'future_simple_command' },
+        { name: 'async_stateful_command' },
+        { name: 'simple_command_with_result' },
+        // snake
+        { name: 'future_simple_command_snake' },
+        { name: 'future_simple_command_with_return_snake' },
+        { name: 'future_simple_command_with_result_snake' },
+        { name: 'force_async_snake' },
+        { name: 'force_async_with_result_snake' },
+        { name: 'simple_command_with_result_snake' },
+        { name: 'stateful_command_with_result_snake' },
+        // state
+        { name: 'stateful_command_with_result' },
+        { name: 'async_simple_command_with_result' },
+        { name: 'future_simple_command_with_return' },
+        { name: 'future_simple_command_with_result' },
+        { name: 'async_stateful_command_with_result' },
+        { name: 'command_arguments_wild' },
+        {
+          name: 'command_arguments_struct',
+          args: { Person: { name: 'ferris', age: 6 } }
+        },
+        {
+          name: 'command_arguments_tuple_struct',
+          args: { InlinePerson: ['ferris', 6] }
+        }
+      ]
 
+      for (const command of commands) {
+        const { name } = command
+        const args = command.args ?? {
+          [name.endsWith('snake') ? 'the_argument' : 'theArgument']: 'value'
+        }
+        const button = document.createElement('button')
+        button.innerHTML = `Run ${name}`
+        button.addEventListener('click', function () {
+          runCommand(name, args, false)
+          runCommand(name, Object.create(null), true)
+        })
+        container.appendChild(button)
+      }
+    </script>
+  </body>
 </html>

+ 2 - 6
examples/commands/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "index.html"
-    ],
-    "devPath": [
-      "index.html"
-    ],
+    "distDir": ["index.html"],
+    "devPath": ["index.html"],
     "beforeDevCommand": "",
     "beforeBuildCommand": "",
     "withGlobalTauri": true

+ 2 - 6
examples/helloworld/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "index.html"
-    ],
-    "devPath": [
-      "index.html"
-    ],
+    "distDir": ["index.html"],
+    "devPath": ["index.html"],
     "beforeDevCommand": "",
     "beforeBuildCommand": ""
   },

+ 73 - 75
examples/multiwindow/index.html

@@ -1,89 +1,87 @@
 <!DOCTYPE html>
 <html>
+  <head>
+    <style>
+      #response {
+        white-space: pre-wrap;
+      }
+    </style>
+  </head>
 
-<head>
-  <style>
-    #response {
-      white-space: pre-wrap;
-    }
-  </style>
-</head>
+  <body>
+    <div id="window-label"></div>
+    <div id="container"></div>
+    <div id="response"></div>
 
-<body>
-  <div id="window-label"></div>
-  <div id="container"></div>
-  <div id="response"></div>
+    <script>
+      var WebviewWindow = window.__TAURI__.window.WebviewWindow
+      var appWindow = window.__TAURI__.window.appWindow
+      var windowLabel = appWindow.label
+      var windowLabelContainer = document.getElementById('window-label')
+      windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.'
 
-  <script>
-    var WebviewWindow = window.__TAURI__.window.WebviewWindow
-    var appWindow = window.__TAURI__.window.appWindow
-    var windowLabel = appWindow.label
-    var windowLabelContainer = document.getElementById('window-label')
-    windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.'
+      var container = document.getElementById('container')
 
-    var container = document.getElementById('container')
+      function createWindowMessageBtn(label) {
+        var tauriWindow = WebviewWindow.getByLabel(label)
+        var button = document.createElement('button')
+        button.innerText = 'Send message to ' + label
+        button.addEventListener('click', function () {
+          tauriWindow.emit('clicked', 'message from ' + windowLabel)
+        })
+        container.appendChild(button)
+      }
 
-    function createWindowMessageBtn(label) {
-      var tauriWindow = WebviewWindow.getByLabel(label)
-      var button = document.createElement('button')
-      button.innerText = 'Send message to ' + label
-      button.addEventListener('click', function () {
-        tauriWindow.emit('clicked', 'message from ' + windowLabel)
+      // global listener
+      window.__TAURI__.event.listen('clicked', function (event) {
+        responseContainer.innerHTML +=
+          'Got ' + JSON.stringify(event) + ' on global listener\n\n'
+      })
+      window.__TAURI__.event.listen('tauri://window-created', function (event) {
+        createWindowMessageBtn(event.payload.label)
       })
-      container.appendChild(button)
-    }
-
-    // global listener
-    window.__TAURI__.event.listen('clicked', function (event) {
-      responseContainer.innerHTML +=
-        'Got ' + JSON.stringify(event) + ' on global listener\n\n'
-    })
-    window.__TAURI__.event.listen('tauri://window-created', function (event) {
-      createWindowMessageBtn(event.payload.label)
-    })
-
-    var responseContainer = document.getElementById('response')
-    // listener tied to this window
-    appWindow.listen('clicked', function (event) {
-      responseContainer.innerText +=
-        'Got ' + JSON.stringify(event) + ' on window listener\n\n'
-    })
 
-    var createWindowButton = document.createElement('button')
-    createWindowButton.innerHTML = 'Create window'
-    createWindowButton.addEventListener('click', function () {
-      var webviewWindow = new WebviewWindow(
-        Math.random().toString().replace('.', ''),
-        {
-          tabbingIdentifier: windowLabel
-        }
-      )
-      webviewWindow.once('tauri://created', function () {
-        responseContainer.innerHTML += 'Created new webview'
+      var responseContainer = document.getElementById('response')
+      // listener tied to this window
+      appWindow.listen('clicked', function (event) {
+        responseContainer.innerText +=
+          'Got ' + JSON.stringify(event) + ' on window listener\n\n'
       })
-      webviewWindow.once('tauri://error', function (e) {
-        responseContainer.innerHTML += 'Error creating new webview'
+
+      var createWindowButton = document.createElement('button')
+      createWindowButton.innerHTML = 'Create window'
+      createWindowButton.addEventListener('click', function () {
+        var webviewWindow = new WebviewWindow(
+          Math.random().toString().replace('.', ''),
+          {
+            tabbingIdentifier: windowLabel
+          }
+        )
+        webviewWindow.once('tauri://created', function () {
+          responseContainer.innerHTML += 'Created new webview'
+        })
+        webviewWindow.once('tauri://error', function (e) {
+          responseContainer.innerHTML += 'Error creating new webview'
+        })
       })
-    })
-    container.appendChild(createWindowButton)
+      container.appendChild(createWindowButton)
 
-    var globalMessageButton = document.createElement('button')
-    globalMessageButton.innerHTML = 'Send global message'
-    globalMessageButton.addEventListener('click', function () {
-      // emit to all windows
-      window.__TAURI__.event.emit('clicked', 'message from ' + windowLabel)
-    })
-    container.appendChild(globalMessageButton)
+      var globalMessageButton = document.createElement('button')
+      globalMessageButton.innerHTML = 'Send global message'
+      globalMessageButton.addEventListener('click', function () {
+        // emit to all windows
+        window.__TAURI__.event.emit('clicked', 'message from ' + windowLabel)
+      })
+      container.appendChild(globalMessageButton)
 
-    var allWindows = window.__TAURI__.window.getAll()
-    for (var index in allWindows) {
-      var label = allWindows[index].label
-      if (label === windowLabel) {
-        continue
+      var allWindows = window.__TAURI__.window.getAll()
+      for (var index in allWindows) {
+        var label = allWindows[index].label
+        if (label === windowLabel) {
+          continue
+        }
+        createWindowMessageBtn(label)
       }
-      createWindowMessageBtn(label)
-    }
-  </script>
-</body>
-
-</html>
+    </script>
+  </body>
+</html>

+ 2 - 6
examples/multiwindow/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "index.html"
-    ],
-    "devPath": [
-      "index.html"
-    ],
+    "distDir": ["index.html"],
+    "devPath": ["index.html"],
     "withGlobalTauri": true
   },
   "package": {

+ 2 - 6
examples/parent-window/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "index.html"
-    ],
-    "devPath": [
-      "index.html"
-    ],
+    "distDir": ["index.html"],
+    "devPath": ["index.html"],
     "withGlobalTauri": true
   },
   "package": {

+ 3 - 9
examples/resources/src-tauri/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "../index.html"
-    ],
-    "devPath": [
-      "../index.html"
-    ],
+    "distDir": ["../index.html"],
+    "devPath": ["../index.html"],
     "beforeDevCommand": "",
     "beforeBuildCommand": "",
     "withGlobalTauri": true
@@ -27,9 +23,7 @@
         "../../.icons/icon.icns",
         "../../.icons/icon.ico"
       ],
-      "resources": [
-        "assets/*"
-      ],
+      "resources": ["assets/*"],
       "externalBin": [],
       "copyright": "",
       "category": "DeveloperTool",

+ 3 - 9
examples/sidecar/src-tauri/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "../index.html"
-    ],
-    "devPath": [
-      "../index.html"
-    ],
+    "distDir": ["../index.html"],
+    "devPath": ["../index.html"],
     "beforeDevCommand": "yarn package",
     "beforeBuildCommand": "yarn package",
     "withGlobalTauri": true
@@ -28,9 +24,7 @@
         "../../.icons/icon.ico"
       ],
       "resources": [],
-      "externalBin": [
-        "binaries/app"
-      ],
+      "externalBin": ["binaries/app"],
       "copyright": "",
       "category": "DeveloperTool",
       "shortDescription": "",

+ 2 - 6
examples/state/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "index.html"
-    ],
-    "devPath": [
-      "index.html"
-    ],
+    "distDir": ["index.html"],
+    "devPath": ["index.html"],
     "beforeDevCommand": "",
     "beforeBuildCommand": "",
     "withGlobalTauri": true

+ 2 - 6
examples/streaming/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "index.html"
-    ],
-    "devPath": [
-      "index.html"
-    ],
+    "distDir": ["index.html"],
+    "devPath": ["index.html"],
     "beforeDevCommand": "",
     "beforeBuildCommand": "",
     "withGlobalTauri": true

+ 2 - 6
examples/tauri-dynamic-lib/src-tauri/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "src/index.html"
-    ],
-    "devPath": [
-      "src/index.html"
-    ],
+    "distDir": ["src/index.html"],
+    "devPath": ["src/index.html"],
     "beforeDevCommand": "",
     "beforeBuildCommand": ""
   },

+ 2 - 6
examples/updater/src-tauri/tauri.conf.json

@@ -1,12 +1,8 @@
 {
   "$schema": "../../../core/config-schema/schema.json",
   "build": {
-    "distDir": [
-      "../index.html"
-    ],
-    "devPath": [
-      "../index.html"
-    ],
+    "distDir": ["../index.html"],
+    "devPath": ["../index.html"],
     "beforeDevCommand": "",
     "beforeBuildCommand": ""
   },

+ 1 - 3
tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json

@@ -37,9 +37,7 @@
       "all": false,
       "fs": {
         "readFile": true,
-        "scope": [
-          "$HOME/.tauri_3mb.json"
-        ]
+        "scope": ["$HOME/.tauri_3mb.json"]
       }
     },
     "windows": [

+ 18 - 21
tooling/cli/src/helpers/auto-reload.js

@@ -1,29 +1,26 @@
-
 // taken from https://github.com/thedodd/trunk/blob/5c799dc35f1f1d8f8d3d30c8723cbb761a9b6a08/src/autoreload.js
 
-(function () {
-  var url = 'ws:' + '//' + window.location.host + '/_tauri-cli/ws';
-  var poll_interval = 5000;
+;(function () {
+  var url = 'ws:' + '//' + window.location.host + '/_tauri-cli/ws'
+  var poll_interval = 5000
   var reload_upon_connect = () => {
-    window.setTimeout(
-      () => {
-        // when we successfully reconnect, we'll force a
-        // reload (since we presumably lost connection to
-        // trunk due to it being killed, so it will have
-        // rebuilt on restart)
-        var ws = new WebSocket(url);
-        ws.onopen = () => window.location.reload();
-        ws.onclose = reload_upon_connect;
-      },
-      poll_interval);
-  };
+    window.setTimeout(() => {
+      // when we successfully reconnect, we'll force a
+      // reload (since we presumably lost connection to
+      // trunk due to it being killed, so it will have
+      // rebuilt on restart)
+      var ws = new WebSocket(url)
+      ws.onopen = () => window.location.reload()
+      ws.onclose = reload_upon_connect
+    }, poll_interval)
+  }
 
-  var ws = new WebSocket(url);
+  var ws = new WebSocket(url)
   ws.onmessage = (ev) => {
-    const msg = JSON.parse(ev.data);
+    const msg = JSON.parse(ev.data)
     if (msg.reload) {
-      window.location.reload();
+      window.location.reload()
     }
-  };
-  ws.onclose = reload_upon_connect;
+  }
+  ws.onclose = reload_upon_connect
 })()

Some files were not shown because too many files changed in this diff