From 33fedbc4b4aa1f1b6f04305014cdcfa0a26bb1bc Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Wed, 15 Nov 2023 12:59:55 +0000 Subject: [PATCH] fix(updater): Use escaped installer path to start the nsis updater (#727) Port of v1 change: https://github.com/tauri-apps/tauri/pull/7956 Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/6877612128 Co-authored-by: amrbashir --- dist-js/{index.min.js => index.cjs} | 134 ++++++++-------------------- dist-js/{index.mjs => index.js} | 5 +- dist-js/index.min.js.map | 1 - dist-js/index.mjs.map | 1 - package.json | 11 +-- rollup.config.js | 7 ++ rollup.config.mjs | 11 --- src/api-iife.js | 2 +- 8 files changed, 50 insertions(+), 122 deletions(-) rename dist-js/{index.min.js => index.cjs} (65%) rename dist-js/{index.mjs => index.js} (98%) delete mode 100644 dist-js/index.min.js.map delete mode 100644 dist-js/index.mjs.map create mode 100644 rollup.config.js delete mode 100644 rollup.config.mjs diff --git a/dist-js/index.min.js b/dist-js/index.cjs similarity index 65% rename from dist-js/index.min.js rename to dist-js/index.cjs index 39c3144..a0b3292 100644 --- a/dist-js/index.min.js +++ b/dist-js/index.cjs @@ -1,84 +1,7 @@ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol */ - - -typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; +'use strict'; -/** - * Sends a message to the backend. - * @example - * ```typescript - * import { invoke } from '@tauri-apps/api/primitives'; - * await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' }); - * ``` - * - * @param cmd The command name. - * @param args The optional arguments to pass to the command. - * @param options The request options. - * @return A promise resolving or rejecting to the backend response. - * - * @since 1.0.0 - */ -async function invoke(cmd, args = {}, options) { - return window.__TAURI_INTERNALS__.invoke(cmd, args, options); -} - -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT -/** - * The path module provides utilities for working with file and directory paths. - * - * This package is also accessible with `window.__TAURI__.path` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - * - * It is recommended to allowlist only the APIs you use for optimal bundle size and security. - * @module - */ -/** - * @since 2.0.0 - */ -var BaseDirectory; -(function (BaseDirectory) { - BaseDirectory[BaseDirectory["Audio"] = 1] = "Audio"; - BaseDirectory[BaseDirectory["Cache"] = 2] = "Cache"; - BaseDirectory[BaseDirectory["Config"] = 3] = "Config"; - BaseDirectory[BaseDirectory["Data"] = 4] = "Data"; - BaseDirectory[BaseDirectory["LocalData"] = 5] = "LocalData"; - BaseDirectory[BaseDirectory["Document"] = 6] = "Document"; - BaseDirectory[BaseDirectory["Download"] = 7] = "Download"; - BaseDirectory[BaseDirectory["Picture"] = 8] = "Picture"; - BaseDirectory[BaseDirectory["Public"] = 9] = "Public"; - BaseDirectory[BaseDirectory["Video"] = 10] = "Video"; - BaseDirectory[BaseDirectory["Resource"] = 11] = "Resource"; - BaseDirectory[BaseDirectory["Temp"] = 12] = "Temp"; - BaseDirectory[BaseDirectory["AppConfig"] = 13] = "AppConfig"; - BaseDirectory[BaseDirectory["AppData"] = 14] = "AppData"; - BaseDirectory[BaseDirectory["AppLocalData"] = 15] = "AppLocalData"; - BaseDirectory[BaseDirectory["AppCache"] = 16] = "AppCache"; - BaseDirectory[BaseDirectory["AppLog"] = 17] = "AppLog"; - BaseDirectory[BaseDirectory["Desktop"] = 18] = "Desktop"; - BaseDirectory[BaseDirectory["Executable"] = 19] = "Executable"; - BaseDirectory[BaseDirectory["Font"] = 20] = "Font"; - BaseDirectory[BaseDirectory["Home"] = 21] = "Home"; - BaseDirectory[BaseDirectory["Runtime"] = 22] = "Runtime"; - BaseDirectory[BaseDirectory["Template"] = 23] = "Template"; -})(BaseDirectory || (BaseDirectory = {})); +var path = require('@tauri-apps/api/path'); +var primitives = require('@tauri-apps/api/primitives'); // Copyright 2019-2023 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 @@ -137,7 +60,7 @@ var BaseDirectory; * @since 2.0.0 */ async function readTextFile(filePath, options = {}) { - return await invoke("plugin:fs|read_text_file", { + return await primitives.invoke("plugin:fs|read_text_file", { path: filePath, options, }); @@ -154,7 +77,7 @@ async function readTextFile(filePath, options = {}) { * @since 2.0.0 */ async function readBinaryFile(filePath, options = {}) { - const arr = await invoke("plugin:fs|read_file", { + const arr = await primitives.invoke("plugin:fs|read_file", { path: filePath, options, }); @@ -184,12 +107,12 @@ async function writeTextFile(path, contents, options) { file.contents = path.contents; } if (typeof contents === "string") { - file.contents = contents !== null && contents !== void 0 ? contents : ""; + file.contents = contents ?? ""; } else { fileOptions = contents; } - return await invoke("plugin:fs|write_file", { + return await primitives.invoke("plugin:fs|write_file", { path: file.path, contents: Array.from(new TextEncoder().encode(file.contents)), options: fileOptions, @@ -223,9 +146,9 @@ async function writeBinaryFile(path, contents, options) { } else if (typeof path === "string") { // @ts-expect-error in this case `contents` is always a BinaryFileContents - file.contents = contents !== null && contents !== void 0 ? contents : []; + file.contents = contents ?? []; } - return await invoke("plugin:fs|write_file", { + return await primitives.invoke("plugin:fs|write_file", { path: file.path, contents: Array.from(file.contents instanceof ArrayBuffer ? new Uint8Array(file.contents) @@ -254,7 +177,7 @@ async function writeBinaryFile(path, contents, options) { * @since 2.0.0 */ async function readDir(dir, options = {}) { - return await invoke("plugin:fs|read_dir", { + return await primitives.invoke("plugin:fs|read_dir", { path: dir, options, }); @@ -275,7 +198,7 @@ async function readDir(dir, options = {}) { * @since 2.0.0 */ async function createDir(dir, options = {}) { - return await invoke("plugin:fs|create_dir", { + return await primitives.invoke("plugin:fs|create_dir", { path: dir, options, }); @@ -295,7 +218,7 @@ async function createDir(dir, options = {}) { * @since 2.0.0 */ async function removeDir(dir, options = {}) { - return await invoke("plugin:fs|remove_dir", { + return await primitives.invoke("plugin:fs|remove_dir", { path: dir, options, }); @@ -314,7 +237,7 @@ async function removeDir(dir, options = {}) { * @since 2.0.0 */ async function copyFile(source, destination, options = {}) { - return await invoke("plugin:fs|copy_file", { + return await primitives.invoke("plugin:fs|copy_file", { source, destination, options, @@ -334,7 +257,7 @@ async function copyFile(source, destination, options = {}) { * @since 2.0.0 */ async function removeFile(file, options = {}) { - return await invoke("plugin:fs|remove_file", { + return await primitives.invoke("plugin:fs|remove_file", { path: file, options, }); @@ -353,7 +276,7 @@ async function removeFile(file, options = {}) { * @since 2.0.0 */ async function renameFile(oldPath, newPath, options = {}) { - return await invoke("plugin:fs|rename_file", { + return await primitives.invoke("plugin:fs|rename_file", { oldPath, newPath, options, @@ -371,7 +294,7 @@ async function renameFile(oldPath, newPath, options = {}) { * @since 2.0.0 */ async function exists(path) { - return await invoke("plugin:fs|exists", { path }); + return await primitives.invoke("plugin:fs|exists", { path }); } /** * Returns the metadata for the given path. @@ -379,7 +302,7 @@ async function exists(path) { * @since 2.0.0 */ async function metadata(path) { - return await invoke("plugin:fs|metadata", { + return await primitives.invoke("plugin:fs|metadata", { path, }).then((metadata) => { const { accessedAtMs, createdAtMs, modifiedAtMs, ...data } = metadata; @@ -392,5 +315,24 @@ async function metadata(path) { }); } -export { BaseDirectory, BaseDirectory as Dir, copyFile, createDir, exists, metadata, readBinaryFile, readDir, readTextFile, removeDir, removeFile, renameFile, writeBinaryFile, writeTextFile as writeFile, writeTextFile }; -//# sourceMappingURL=index.min.js.map +Object.defineProperty(exports, 'BaseDirectory', { + enumerable: true, + get: function () { return path.BaseDirectory; } +}); +Object.defineProperty(exports, 'Dir', { + enumerable: true, + get: function () { return path.BaseDirectory; } +}); +exports.copyFile = copyFile; +exports.createDir = createDir; +exports.exists = exists; +exports.metadata = metadata; +exports.readBinaryFile = readBinaryFile; +exports.readDir = readDir; +exports.readTextFile = readTextFile; +exports.removeDir = removeDir; +exports.removeFile = removeFile; +exports.renameFile = renameFile; +exports.writeBinaryFile = writeBinaryFile; +exports.writeFile = writeTextFile; +exports.writeTextFile = writeTextFile; diff --git a/dist-js/index.mjs b/dist-js/index.js similarity index 98% rename from dist-js/index.mjs rename to dist-js/index.js index 389ffc3..f74e9af 100644 --- a/dist-js/index.mjs +++ b/dist-js/index.js @@ -105,7 +105,7 @@ async function writeTextFile(path, contents, options) { file.contents = path.contents; } if (typeof contents === "string") { - file.contents = contents !== null && contents !== void 0 ? contents : ""; + file.contents = contents ?? ""; } else { fileOptions = contents; @@ -144,7 +144,7 @@ async function writeBinaryFile(path, contents, options) { } else if (typeof path === "string") { // @ts-expect-error in this case `contents` is always a BinaryFileContents - file.contents = contents !== null && contents !== void 0 ? contents : []; + file.contents = contents ?? []; } return await invoke("plugin:fs|write_file", { path: file.path, @@ -314,4 +314,3 @@ async function metadata(path) { } export { copyFile, createDir, exists, metadata, readBinaryFile, readDir, readTextFile, removeDir, removeFile, renameFile, writeBinaryFile, writeTextFile as writeFile, writeTextFile }; -//# sourceMappingURL=index.mjs.map diff --git a/dist-js/index.min.js.map b/dist-js/index.min.js.map deleted file mode 100644 index 1b0750c..0000000 --- a/dist-js/index.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.min.js","sources":["../../../node_modules/.pnpm/@tauri-apps+api@2.0.0-alpha.11/node_modules/@tauri-apps/api/external/tslib/tslib.es6.js","../../../node_modules/.pnpm/@tauri-apps+api@2.0.0-alpha.11/node_modules/@tauri-apps/api/primitives.js","../../../node_modules/.pnpm/@tauri-apps+api@2.0.0-alpha.11/node_modules/@tauri-apps/api/path.js","../guest-js/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nexport { __classPrivateFieldGet, __classPrivateFieldSet };\n","import { __classPrivateFieldGet, __classPrivateFieldSet } from './external/tslib/tslib.es6.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\nvar _Channel_onmessage;\n/**\n * Invoke your custom commands.\n *\n * This package is also accessible with `window.__TAURI__.tauri` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * Transforms a callback function to a string identifier that can be passed to the backend.\n * The backend uses the identifier to `eval()` the callback.\n *\n * @return A unique identifier associated with the callback function.\n *\n * @since 1.0.0\n */\nfunction transformCallback(callback, once = false) {\n return window.__TAURI_INTERNALS__.transformCallback(callback, once);\n}\nclass Channel {\n constructor() {\n // @ts-expect-error field used by the IPC serializer\n this.__TAURI_CHANNEL_MARKER__ = true;\n _Channel_onmessage.set(this, () => {\n // no-op\n });\n this.id = transformCallback((response) => {\n __classPrivateFieldGet(this, _Channel_onmessage, \"f\").call(this, response);\n });\n }\n set onmessage(handler) {\n __classPrivateFieldSet(this, _Channel_onmessage, handler, \"f\");\n }\n get onmessage() {\n return __classPrivateFieldGet(this, _Channel_onmessage, \"f\");\n }\n toJSON() {\n return `__CHANNEL__:${this.id}`;\n }\n}\n_Channel_onmessage = new WeakMap();\nclass PluginListener {\n constructor(plugin, event, channelId) {\n this.plugin = plugin;\n this.event = event;\n this.channelId = channelId;\n }\n async unregister() {\n return invoke(`plugin:${this.plugin}|remove_listener`, {\n event: this.event,\n channelId: this.channelId\n });\n }\n}\n/**\n * Adds a listener to a plugin event.\n *\n * @returns The listener object to stop listening to the events.\n *\n * @since 2.0.0\n */\nasync function addPluginListener(plugin, event, cb) {\n const handler = new Channel();\n handler.onmessage = cb;\n return invoke(`plugin:${plugin}|register_listener`, { event, handler }).then(() => new PluginListener(plugin, event, handler.id));\n}\n/**\n * Sends a message to the backend.\n * @example\n * ```typescript\n * import { invoke } from '@tauri-apps/api/primitives';\n * await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n * ```\n *\n * @param cmd The command name.\n * @param args The optional arguments to pass to the command.\n * @param options The request options.\n * @return A promise resolving or rejecting to the backend response.\n *\n * @since 1.0.0\n */\nasync function invoke(cmd, args = {}, options) {\n return window.__TAURI_INTERNALS__.invoke(cmd, args, options);\n}\n/**\n * Convert a device file path to an URL that can be loaded by the webview.\n * Note that `asset:` and `http://asset.localhost` must be added to [`tauri.security.csp`](https://tauri.app/v1/api/config/#securityconfig.csp) in `tauri.conf.json`.\n * Example CSP value: `\"csp\": \"default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost\"` to use the asset protocol on image sources.\n *\n * Additionally, `asset` must be added to [`tauri.allowlist.protocol`](https://tauri.app/v1/api/config/#allowlistconfig.protocol)\n * in `tauri.conf.json` and its access scope must be defined on the `assetScope` array on the same `protocol` object.\n *\n * @param filePath The file path.\n * @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol.\n * @example\n * ```typescript\n * import { appDataDir, join } from '@tauri-apps/api/path';\n * import { convertFileSrc } from '@tauri-apps/api/primitives';\n * const appDataDirPath = await appDataDir();\n * const filePath = await join(appDataDirPath, 'assets/video.mp4');\n * const assetUrl = convertFileSrc(filePath);\n *\n * const video = document.getElementById('my-video');\n * const source = document.createElement('source');\n * source.type = 'video/mp4';\n * source.src = assetUrl;\n * video.appendChild(source);\n * video.load();\n * ```\n *\n * @return the URL that can be used as source on the webview.\n *\n * @since 1.0.0\n */\nfunction convertFileSrc(filePath, protocol = 'asset') {\n return window.__TAURI_INTERNALS__.convertFileSrc(filePath, protocol);\n}\n\nexport { Channel, PluginListener, addPluginListener, convertFileSrc, invoke, transformCallback };\n","import { invoke } from './primitives.js';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * The path module provides utilities for working with file and directory paths.\n *\n * This package is also accessible with `window.__TAURI__.path` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.\n *\n * It is recommended to allowlist only the APIs you use for optimal bundle size and security.\n * @module\n */\n/**\n * @since 2.0.0\n */\nvar BaseDirectory;\n(function (BaseDirectory) {\n BaseDirectory[BaseDirectory[\"Audio\"] = 1] = \"Audio\";\n BaseDirectory[BaseDirectory[\"Cache\"] = 2] = \"Cache\";\n BaseDirectory[BaseDirectory[\"Config\"] = 3] = \"Config\";\n BaseDirectory[BaseDirectory[\"Data\"] = 4] = \"Data\";\n BaseDirectory[BaseDirectory[\"LocalData\"] = 5] = \"LocalData\";\n BaseDirectory[BaseDirectory[\"Document\"] = 6] = \"Document\";\n BaseDirectory[BaseDirectory[\"Download\"] = 7] = \"Download\";\n BaseDirectory[BaseDirectory[\"Picture\"] = 8] = \"Picture\";\n BaseDirectory[BaseDirectory[\"Public\"] = 9] = \"Public\";\n BaseDirectory[BaseDirectory[\"Video\"] = 10] = \"Video\";\n BaseDirectory[BaseDirectory[\"Resource\"] = 11] = \"Resource\";\n BaseDirectory[BaseDirectory[\"Temp\"] = 12] = \"Temp\";\n BaseDirectory[BaseDirectory[\"AppConfig\"] = 13] = \"AppConfig\";\n BaseDirectory[BaseDirectory[\"AppData\"] = 14] = \"AppData\";\n BaseDirectory[BaseDirectory[\"AppLocalData\"] = 15] = \"AppLocalData\";\n BaseDirectory[BaseDirectory[\"AppCache\"] = 16] = \"AppCache\";\n BaseDirectory[BaseDirectory[\"AppLog\"] = 17] = \"AppLog\";\n BaseDirectory[BaseDirectory[\"Desktop\"] = 18] = \"Desktop\";\n BaseDirectory[BaseDirectory[\"Executable\"] = 19] = \"Executable\";\n BaseDirectory[BaseDirectory[\"Font\"] = 20] = \"Font\";\n BaseDirectory[BaseDirectory[\"Home\"] = 21] = \"Home\";\n BaseDirectory[BaseDirectory[\"Runtime\"] = 22] = \"Runtime\";\n BaseDirectory[BaseDirectory[\"Template\"] = 23] = \"Template\";\n})(BaseDirectory || (BaseDirectory = {}));\n/**\n * Returns the path to the suggested directory for your app's config files.\n * Resolves to `${configDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value [`tauri.bundle.identifier`](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in `tauri.conf.json`.\n * @example\n * ```typescript\n * import { appConfigDir } from '@tauri-apps/api/path';\n * const appConfigDirPath = await appConfigDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appConfigDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.AppConfig\n });\n}\n/**\n * Returns the path to the suggested directory for your app's data files.\n * Resolves to `${dataDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value [`tauri.bundle.identifier`](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in `tauri.conf.json`.\n * @example\n * ```typescript\n * import { appDataDir } from '@tauri-apps/api/path';\n * const appDataDirPath = await appDataDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appDataDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.AppData\n });\n}\n/**\n * Returns the path to the suggested directory for your app's local data files.\n * Resolves to `${localDataDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value [`tauri.bundle.identifier`](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in `tauri.conf.json`.\n * @example\n * ```typescript\n * import { appLocalDataDir } from '@tauri-apps/api/path';\n * const appLocalDataDirPath = await appLocalDataDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appLocalDataDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.AppLocalData\n });\n}\n/**\n * Returns the path to the suggested directory for your app's cache files.\n * Resolves to `${cacheDir}/${bundleIdentifier}`, where `bundleIdentifier` is the value [`tauri.bundle.identifier`](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in `tauri.conf.json`.\n * @example\n * ```typescript\n * import { appCacheDir } from '@tauri-apps/api/path';\n * const appCacheDirPath = await appCacheDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appCacheDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.AppCache\n });\n}\n/**\n * Returns the path to the user's audio directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_MUSIC_DIR`.\n * - **macOS:** Resolves to `$HOME/Music`.\n * - **Windows:** Resolves to `{FOLDERID_Music}`.\n * @example\n * ```typescript\n * import { audioDir } from '@tauri-apps/api/path';\n * const audioDirPath = await audioDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function audioDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Audio\n });\n}\n/**\n * Returns the path to the user's cache directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_CACHE_HOME` or `$HOME/.cache`.\n * - **macOS:** Resolves to `$HOME/Library/Caches`.\n * - **Windows:** Resolves to `{FOLDERID_LocalAppData}`.\n * @example\n * ```typescript\n * import { cacheDir } from '@tauri-apps/api/path';\n * const cacheDirPath = await cacheDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function cacheDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Cache\n });\n}\n/**\n * Returns the path to the user's config directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_CONFIG_HOME` or `$HOME/.config`.\n * - **macOS:** Resolves to `$HOME/Library/Application Support`.\n * - **Windows:** Resolves to `{FOLDERID_RoamingAppData}`.\n * @example\n * ```typescript\n * import { configDir } from '@tauri-apps/api/path';\n * const configDirPath = await configDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function configDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Config\n });\n}\n/**\n * Returns the path to the user's data directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_DATA_HOME` or `$HOME/.local/share`.\n * - **macOS:** Resolves to `$HOME/Library/Application Support`.\n * - **Windows:** Resolves to `{FOLDERID_RoamingAppData}`.\n * @example\n * ```typescript\n * import { dataDir } from '@tauri-apps/api/path';\n * const dataDirPath = await dataDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function dataDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Data\n });\n}\n/**\n * Returns the path to the user's desktop directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DESKTOP_DIR`.\n * - **macOS:** Resolves to `$HOME/Desktop`.\n * - **Windows:** Resolves to `{FOLDERID_Desktop}`.\n * @example\n * ```typescript\n * import { desktopDir } from '@tauri-apps/api/path';\n * const desktopPath = await desktopDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function desktopDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Desktop\n });\n}\n/**\n * Returns the path to the user's document directory.\n * @example\n * ```typescript\n * import { documentDir } from '@tauri-apps/api/path';\n * const documentDirPath = await documentDir();\n * ```\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DOCUMENTS_DIR`.\n * - **macOS:** Resolves to `$HOME/Documents`.\n * - **Windows:** Resolves to `{FOLDERID_Documents}`.\n *\n * @since 1.0.0\n */\nasync function documentDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Document\n });\n}\n/**\n * Returns the path to the user's download directory.\n *\n * #### Platform-specific\n *\n * - **Linux**: Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DOWNLOAD_DIR`.\n * - **macOS**: Resolves to `$HOME/Downloads`.\n * - **Windows**: Resolves to `{FOLDERID_Downloads}`.\n * @example\n * ```typescript\n * import { downloadDir } from '@tauri-apps/api/path';\n * const downloadDirPath = await downloadDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function downloadDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Download\n });\n}\n/**\n * Returns the path to the user's executable directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_BIN_HOME/../bin` or `$XDG_DATA_HOME/../bin` or `$HOME/.local/bin`.\n * - **macOS:** Not supported.\n * - **Windows:** Not supported.\n * @example\n * ```typescript\n * import { executableDir } from '@tauri-apps/api/path';\n * const executableDirPath = await executableDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function executableDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Executable\n });\n}\n/**\n * Returns the path to the user's font directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_DATA_HOME/fonts` or `$HOME/.local/share/fonts`.\n * - **macOS:** Resolves to `$HOME/Library/Fonts`.\n * - **Windows:** Not supported.\n * @example\n * ```typescript\n * import { fontDir } from '@tauri-apps/api/path';\n * const fontDirPath = await fontDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function fontDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Font\n });\n}\n/**\n * Returns the path to the user's home directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$HOME`.\n * - **macOS:** Resolves to `$HOME`.\n * - **Windows:** Resolves to `{FOLDERID_Profile}`.\n * @example\n * ```typescript\n * import { homeDir } from '@tauri-apps/api/path';\n * const homeDirPath = await homeDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function homeDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Home\n });\n}\n/**\n * Returns the path to the user's local data directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_DATA_HOME` or `$HOME/.local/share`.\n * - **macOS:** Resolves to `$HOME/Library/Application Support`.\n * - **Windows:** Resolves to `{FOLDERID_LocalAppData}`.\n * @example\n * ```typescript\n * import { localDataDir } from '@tauri-apps/api/path';\n * const localDataDirPath = await localDataDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function localDataDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.LocalData\n });\n}\n/**\n * Returns the path to the user's picture directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_PICTURES_DIR`.\n * - **macOS:** Resolves to `$HOME/Pictures`.\n * - **Windows:** Resolves to `{FOLDERID_Pictures}`.\n * @example\n * ```typescript\n * import { pictureDir } from '@tauri-apps/api/path';\n * const pictureDirPath = await pictureDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function pictureDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Picture\n });\n}\n/**\n * Returns the path to the user's public directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_PUBLICSHARE_DIR`.\n * - **macOS:** Resolves to `$HOME/Public`.\n * - **Windows:** Resolves to `{FOLDERID_Public}`.\n * @example\n * ```typescript\n * import { publicDir } from '@tauri-apps/api/path';\n * const publicDirPath = await publicDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function publicDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Public\n });\n}\n/**\n * Returns the path to the application's resource directory.\n * To resolve a resource path, see the [[resolveResource | `resolveResource API`]].\n * @example\n * ```typescript\n * import { resourceDir } from '@tauri-apps/api/path';\n * const resourceDirPath = await resourceDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function resourceDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Resource\n });\n}\n/**\n * Resolve the path to a resource file.\n * @example\n * ```typescript\n * import { resolveResource } from '@tauri-apps/api/path';\n * const resourcePath = await resolveResource('script.sh');\n * ```\n *\n * @param resourcePath The path to the resource.\n * Must follow the same syntax as defined in `tauri.conf.json > tauri > bundle > resources`, i.e. keeping subfolders and parent dir components (`../`).\n * @returns The full path to the resource.\n *\n * @since 1.0.0\n */\nasync function resolveResource(resourcePath) {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Resource,\n path: resourcePath\n });\n}\n/**\n * Returns the path to the user's runtime directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `$XDG_RUNTIME_DIR`.\n * - **macOS:** Not supported.\n * - **Windows:** Not supported.\n * @example\n * ```typescript\n * import { runtimeDir } from '@tauri-apps/api/path';\n * const runtimeDirPath = await runtimeDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function runtimeDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Runtime\n });\n}\n/**\n * Returns the path to the user's template directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_TEMPLATES_DIR`.\n * - **macOS:** Not supported.\n * - **Windows:** Resolves to `{FOLDERID_Templates}`.\n * @example\n * ```typescript\n * import { templateDir } from '@tauri-apps/api/path';\n * const templateDirPath = await templateDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function templateDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Template\n });\n}\n/**\n * Returns the path to the user's video directory.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_VIDEOS_DIR`.\n * - **macOS:** Resolves to `$HOME/Movies`.\n * - **Windows:** Resolves to `{FOLDERID_Videos}`.\n * @example\n * ```typescript\n * import { videoDir } from '@tauri-apps/api/path';\n * const videoDirPath = await videoDir();\n * ```\n *\n * @since 1.0.0\n */\nasync function videoDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Video\n });\n}\n/**\n * Returns the path to the suggested directory for your app's log files.\n *\n * #### Platform-specific\n *\n * - **Linux:** Resolves to `${configDir}/${bundleIdentifier}/logs`.\n * - **macOS:** Resolves to `${homeDir}/Library/Logs/{bundleIdentifier}`\n * - **Windows:** Resolves to `${configDir}/${bundleIdentifier}/logs`.\n * @example\n * ```typescript\n * import { appLogDir } from '@tauri-apps/api/path';\n * const appLogDirPath = await appLogDir();\n * ```\n *\n * @since 1.2.0\n */\nasync function appLogDir() {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.AppLog\n });\n}\n/**\n * Returns a temporary directory.\n * @example\n * ```typescript\n * import { tempDir } from '@tauri-apps/api/path';\n * const temp = await tempDir();\n * ```\n *\n * @since 2.0.0\n */\nasync function tempDir(path) {\n return invoke('plugin:path|resolve_directory', {\n directory: BaseDirectory.Temp\n });\n}\n/**\n * Returns the platform-specific path segment separator:\n * - `\\` on Windows\n * - `/` on POSIX\n *\n * @since 2.0.0\n */\nfunction sep() {\n return window.__TAURI_INTERNALS__.plugins.path.sep;\n}\n/**\n * Returns the platform-specific path segment delimiter:\n * - `;` on Windows\n * - `:` on POSIX\n *\n * @since 2.0.0\n */\nfunction delimiter() {\n return window.__TAURI_INTERNALS__.plugins.path.delimiter;\n}\n/**\n * Resolves a sequence of `paths` or `path` segments into an absolute path.\n * @example\n * ```typescript\n * import { resolve, appDataDir } from '@tauri-apps/api/path';\n * const appDataDirPath = await appDataDir();\n * const path = await resolve(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n * ```\n *\n * @since 1.0.0\n */\nasync function resolve(...paths) {\n return invoke('plugin:path|resolve', { paths });\n}\n/**\n * Normalizes the given `path`, resolving `'..'` and `'.'` segments and resolve symbolic links.\n * @example\n * ```typescript\n * import { normalize, appDataDir } from '@tauri-apps/api/path';\n * const appDataDirPath = await appDataDir();\n * const path = await normalize(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n * ```\n *\n * @since 1.0.0\n */\nasync function normalize(path) {\n return invoke('plugin:path|normalize', { path });\n}\n/**\n * Joins all given `path` segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.\n * @example\n * ```typescript\n * import { join, appDataDir } from '@tauri-apps/api/path';\n * const appDataDirPath = await appDataDir();\n * const path = await join(appDataDirPath, 'users', 'tauri', 'avatar.png');\n * ```\n *\n * @since 1.0.0\n */\nasync function join(...paths) {\n return invoke('plugin:path|join', { paths });\n}\n/**\n * Returns the directory name of a `path`. Trailing directory separators are ignored.\n * @example\n * ```typescript\n * import { dirname, appDataDir } from '@tauri-apps/api/path';\n * const appDataDirPath = await appDataDir();\n * const dir = await dirname(appDataDirPath);\n * ```\n *\n * @since 1.0.0\n */\nasync function dirname(path) {\n return invoke('plugin:path|dirname', { path });\n}\n/**\n * Returns the extension of the `path`.\n * @example\n * ```typescript\n * import { extname, resolveResource } from '@tauri-apps/api/path';\n * const resourcePath = await resolveResource('app.conf');\n * const ext = await extname(resourcePath);\n * assert(ext === 'conf');\n * ```\n *\n * @since 1.0.0\n */\nasync function extname(path) {\n return invoke('plugin:path|extname', { path });\n}\n/**\n * Returns the last portion of a `path`. Trailing directory separators are ignored.\n * @example\n * ```typescript\n * import { basename, resolveResource } from '@tauri-apps/api/path';\n * const resourcePath = await resolveResource('app.conf');\n * const base = await basename(resourcePath);\n * assert(base === 'app.conf');\n * ```\n *\n * @param ext An optional file extension to be removed from the returned path.\n *\n * @since 1.0.0\n */\nasync function basename(path, ext) {\n return invoke('plugin:path|basename', { path, ext });\n}\n/**\n * Returns whether the path is absolute or not.\n * @example\n * ```typescript\n * import { isAbsolute } from '@tauri-apps/api/path';\n * assert(await isAbsolute('/home/tauri'));\n * ```\n *\n * @since 1.0.0\n */\nasync function isAbsolute(path) {\n return invoke('plugin:path|isAbsolute', { path });\n}\n\nexport { BaseDirectory, appCacheDir, appConfigDir, appDataDir, appLocalDataDir, appLogDir, audioDir, basename, cacheDir, configDir, dataDir, delimiter, desktopDir, dirname, documentDir, downloadDir, executableDir, extname, fontDir, homeDir, isAbsolute, join, localDataDir, normalize, pictureDir, publicDir, resolve, resolveResource, resourceDir, runtimeDir, sep, tempDir, templateDir, videoDir };\n",null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA,OAAO,eAAe,KAAK,UAAU,GAAG,eAAe,GAAG,UAAU,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE;AAChG,IAAI,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC/B,IAAI,OAAO,CAAC,CAAC,IAAI,GAAG,iBAAiB,EAAE,CAAC,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,CAAC,UAAU,GAAG,UAAU,EAAE,CAAC,CAAC;AACrF,CAAC;;ACqCD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM,CAAC,GAAG,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,EAAE;AAC/C,IAAI,OAAO,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACjE;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACG,IAAC,cAAc;AAClB,CAAC,UAAU,aAAa,EAAE;AAC1B,IAAI,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;AACxD,IAAI,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,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ACL,CAAC;AAED;;;;;;;;;;AAUG;AACH,eAAe,MAAM,CAAC,IAAY,EAAA;IAChC,OAAO,MAAM,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;;;AAIG;AACH,eAAe,QAAQ,CAAC,IAAY,EAAA;AAClC,IAAA,OAAO,MAAM,MAAM,CAAkB,oBAAoB,EAAE;QACzD,IAAI;AACL,KAAA,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAI;AACnB,QAAA,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC;QACtE,OAAO;AACL,YAAA,UAAU,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;AAClC,YAAA,SAAS,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;AAChC,YAAA,UAAU,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;AAClC,YAAA,GAAG,IAAI;SACR,CAAC;AACJ,KAAC,CAAC,CAAC;AACL;;;;","x_google_ignoreList":[0,1,2]} \ No newline at end of file diff --git a/dist-js/index.mjs.map b/dist-js/index.mjs.map deleted file mode 100644 index b0bee1a..0000000 --- a/dist-js/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../guest-js/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCG;AAyKH;;;;;;;;;;AAUG;AACH,eAAe,YAAY,CACzB,QAAgB,EAChB,UAAqB,EAAE,EAAA;AAEvB,IAAA,OAAO,MAAM,MAAM,CAAC,0BAA0B,EAAE;AAC9C,QAAA,IAAI,EAAE,QAAQ;QACd,OAAO;AACR,KAAA,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;AAUG;AACH,eAAe,cAAc,CAC3B,QAAgB,EAChB,UAAqB,EAAE,EA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OAAO;AACR,KAAA,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;AAYG;AACH,eAAe,UAAU,CACvB,OAAe,EACf,OAAe,EACf,UAAqB,EAAE,EAAA;AAEvB,IAAA,OAAO,MAAM,MAAM,CAAC,uBAAuB,EAAE;QAC3C,OAAO;QACP,OAAO;QACP,OAAO;AACR,KAAA,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;AAUG;AACH,eAAe,MAAM,CAAC,IAAY,EAAA;IAChC,OAAO,MAAM,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;;;AAIG;AACH,eAAe,QAAQ,CAAC,IAAY,EAAA;AAClC,IAAA,OAAO,MAAM,MAAM,CAAkB,oBAAoB,EAAE;QACzD,IAAI;AACL,KAAA,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAI;AACnB,QAAA,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC;QACtE,OAAO;AACL,YAAA,UAAU,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;AAClC,YAAA,SAAS,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;AAChC,YAAA,UAAU,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;AAClC,YAAA,GAAG,IAAI;SACR,CAAC;AACJ,KAAC,CAAC,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/package.json b/package.json index c007231..0fedb51 100644 --- a/package.json +++ b/package.json @@ -7,26 +7,19 @@ "Tauri Programme within The Commons Conservancy" ], "type": "module", - "browser": "dist-js/index.min.js", - "module": "dist-js/index.mjs", - "types": "dist-js/index.d.ts", "exports": { - "import": "./dist-js/index.mjs", "types": "./dist-js/index.d.ts", - "browser": "./dist-js/index.min.js" + "import": "./dist-js/index.js", + "require": "./dist-js/index.cjs" }, "scripts": { "build": "rollup -c" }, "files": [ "dist-js", - "!dist-js/**/*.map", "README.md", "LICENSE" ], - "devDependencies": { - "tslib": "^2.4.1" - }, "dependencies": { "@tauri-apps/api": "2.0.0-alpha.11" } diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..977dfac --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,7 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { createConfig } from "../../shared/rollup.config.js"; + +export default createConfig(); diff --git a/rollup.config.mjs b/rollup.config.mjs deleted file mode 100644 index 99a3dd3..0000000 --- a/rollup.config.mjs +++ /dev/null @@ -1,11 +0,0 @@ -import { readFileSync } from "fs"; - -import { createConfig } from "../../shared/rollup.config.mjs"; - -export default createConfig({ - input: "guest-js/index.ts", - pkg: JSON.parse( - readFileSync(new URL("./package.json", import.meta.url), "utf8"), - ), - external: [/^@tauri-apps\/api/], -}); diff --git a/src/api-iife.js b/src/api-iife.js index d4da6a7..4ac1112 100644 --- a/src/api-iife.js +++ b/src/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_FS__=function(t){"use strict";async function e(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}var n;async function a(t,n,a){"object"==typeof a&&Object.freeze(a),"object"==typeof t&&Object.freeze(t);const i={path:"",contents:""};let o=a;return"string"==typeof t?i.path=t:(i.path=t.path,i.contents=t.contents),"string"==typeof n?i.contents=null!=n?n:"":o=n,await e("plugin:fs|write_file",{path:i.path,contents:Array.from((new TextEncoder).encode(i.contents)),options:o})}return"function"==typeof SuppressedError&&SuppressedError,t.Dir=void 0,(n=t.Dir||(t.Dir={}))[n.Audio=1]="Audio",n[n.Cache=2]="Cache",n[n.Config=3]="Config",n[n.Data=4]="Data",n[n.LocalData=5]="LocalData",n[n.Document=6]="Document",n[n.Download=7]="Download",n[n.Picture=8]="Picture",n[n.Public=9]="Public",n[n.Video=10]="Video",n[n.Resource=11]="Resource",n[n.Temp=12]="Temp",n[n.AppConfig=13]="AppConfig",n[n.AppData=14]="AppData",n[n.AppLocalData=15]="AppLocalData",n[n.AppCache=16]="AppCache",n[n.AppLog=17]="AppLog",n[n.Desktop=18]="Desktop",n[n.Executable=19]="Executable",n[n.Font=20]="Font",n[n.Home=21]="Home",n[n.Runtime=22]="Runtime",n[n.Template=23]="Template",t.BaseDirectory=t.Dir,t.copyFile=async function(t,n,a={}){return await e("plugin:fs|copy_file",{source:t,destination:n,options:a})},t.createDir=async function(t,n={}){return await e("plugin:fs|create_dir",{path:t,options:n})},t.exists=async function(t){return await e("plugin:fs|exists",{path:t})},t.metadata=async function(t){return await e("plugin:fs|metadata",{path:t}).then((t=>{const{accessedAtMs:e,createdAtMs:n,modifiedAtMs:a,...i}=t;return{accessedAt:new Date(e),createdAt:new Date(n),modifiedAt:new Date(a),...i}}))},t.readBinaryFile=async function(t,n={}){const a=await e("plugin:fs|read_file",{path:t,options:n});return Uint8Array.from(a)},t.readDir=async function(t,n={}){return await e("plugin:fs|read_dir",{path:t,options:n})},t.readTextFile=async function(t,n={}){return await e("plugin:fs|read_text_file",{path:t,options:n})},t.removeDir=async function(t,n={}){return await e("plugin:fs|remove_dir",{path:t,options:n})},t.removeFile=async function(t,n={}){return await e("plugin:fs|remove_file",{path:t,options:n})},t.renameFile=async function(t,n,a={}){return await e("plugin:fs|rename_file",{oldPath:t,newPath:n,options:a})},t.writeBinaryFile=async function(t,n,a){"object"==typeof a&&Object.freeze(a),"object"==typeof t&&Object.freeze(t);const i={path:"",contents:[]};let o=a;return"string"==typeof t?i.path=t:(i.path=t.path,i.contents=t.contents),n&&"dir"in n?o=n:"string"==typeof t&&(i.contents=null!=n?n:[]),await e("plugin:fs|write_file",{path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:o})},t.writeFile=a,t.writeTextFile=a,t}({});Object.defineProperty(window.__TAURI__,"fs",{value:__TAURI_FS__})} +if("__TAURI__"in window){var __TAURI_PLUGIN_FS__=function(t){"use strict";async function e(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}var n;async function a(t,n,a){"object"==typeof a&&Object.freeze(a),"object"==typeof t&&Object.freeze(t);const i={path:"",contents:""};let o=a;return"string"==typeof t?i.path=t:(i.path=t.path,i.contents=t.contents),"string"==typeof n?i.contents=n??"":o=n,await e("plugin:fs|write_file",{path:i.path,contents:Array.from((new TextEncoder).encode(i.contents)),options:o})}return"function"==typeof SuppressedError&&SuppressedError,t.Dir=void 0,(n=t.Dir||(t.Dir={}))[n.Audio=1]="Audio",n[n.Cache=2]="Cache",n[n.Config=3]="Config",n[n.Data=4]="Data",n[n.LocalData=5]="LocalData",n[n.Document=6]="Document",n[n.Download=7]="Download",n[n.Picture=8]="Picture",n[n.Public=9]="Public",n[n.Video=10]="Video",n[n.Resource=11]="Resource",n[n.Temp=12]="Temp",n[n.AppConfig=13]="AppConfig",n[n.AppData=14]="AppData",n[n.AppLocalData=15]="AppLocalData",n[n.AppCache=16]="AppCache",n[n.AppLog=17]="AppLog",n[n.Desktop=18]="Desktop",n[n.Executable=19]="Executable",n[n.Font=20]="Font",n[n.Home=21]="Home",n[n.Runtime=22]="Runtime",n[n.Template=23]="Template",t.BaseDirectory=t.Dir,t.copyFile=async function(t,n,a={}){return await e("plugin:fs|copy_file",{source:t,destination:n,options:a})},t.createDir=async function(t,n={}){return await e("plugin:fs|create_dir",{path:t,options:n})},t.exists=async function(t){return await e("plugin:fs|exists",{path:t})},t.metadata=async function(t){return await e("plugin:fs|metadata",{path:t}).then((t=>{const{accessedAtMs:e,createdAtMs:n,modifiedAtMs:a,...i}=t;return{accessedAt:new Date(e),createdAt:new Date(n),modifiedAt:new Date(a),...i}}))},t.readBinaryFile=async function(t,n={}){const a=await e("plugin:fs|read_file",{path:t,options:n});return Uint8Array.from(a)},t.readDir=async function(t,n={}){return await e("plugin:fs|read_dir",{path:t,options:n})},t.readTextFile=async function(t,n={}){return await e("plugin:fs|read_text_file",{path:t,options:n})},t.removeDir=async function(t,n={}){return await e("plugin:fs|remove_dir",{path:t,options:n})},t.removeFile=async function(t,n={}){return await e("plugin:fs|remove_file",{path:t,options:n})},t.renameFile=async function(t,n,a={}){return await e("plugin:fs|rename_file",{oldPath:t,newPath:n,options:a})},t.writeBinaryFile=async function(t,n,a){"object"==typeof a&&Object.freeze(a),"object"==typeof t&&Object.freeze(t);const i={path:"",contents:[]};let o=a;return"string"==typeof t?i.path=t:(i.path=t.path,i.contents=t.contents),n&&"dir"in n?o=n:"string"==typeof t&&(i.contents=n??[]),await e("plugin:fs|write_file",{path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:o})},t.writeFile=a,t.writeTextFile=a,t}({});Object.defineProperty(window.__TAURI__,"fs",{value:__TAURI_PLUGIN_FS__})}