From afeecd6a8ad213b0a959dbbbe9c96129428a3926 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Sun, 4 Feb 2024 00:08:16 -0300 Subject: [PATCH] fix(web): format and adjust test --- .../tauri/config/tauri-conf-schema-v2.json | 622 ++++-------------- ...ne-number-by-nested-key-in-sources.test.ts | 10 +- .../tauri/tests/fixtures/valid-config.json | 7 +- 3 files changed, 146 insertions(+), 493 deletions(-) diff --git a/clients/web/src/lib/tauri/config/tauri-conf-schema-v2.json b/clients/web/src/lib/tauri/config/tauri-conf-schema-v2.json index 58b9101a..ff67a5a7 100644 --- a/clients/web/src/lib/tauri/config/tauri-conf-schema-v2.json +++ b/clients/web/src/lib/tauri/config/tauri-conf-schema-v2.json @@ -6,25 +6,16 @@ "properties": { "$schema": { "description": "The JSON schema for the Tauri config.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "productName": { "description": "App name.", - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "pattern": "^[^/\\:*?\"<>|]+$" }, "version": { "description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field. If removed the version number from `Cargo.toml` is used.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "identifier": { "description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`). This string must be unique across applications since it is used in system configurations like the bundle ID and path to the webview data directory. This string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), and periods (.).", @@ -214,10 +205,7 @@ }, "userAgent": { "description": "The user agent for the webview", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "fileDropEnabled": { "description": "Whether the file drop is enabled or not on the webview. By default it is enabled.\n\nDisabling it is required to use drag and drop on the frontend on Windows.", @@ -231,18 +219,12 @@ }, "x": { "description": "The horizontal position of the window's top left corner", - "type": [ - "number", - "null" - ], + "type": ["number", "null"], "format": "double" }, "y": { "description": "The vertical position of the window's top left corner", - "type": [ - "number", - "null" - ], + "type": ["number", "null"], "format": "double" }, "width": { @@ -259,34 +241,22 @@ }, "minWidth": { "description": "The min window width.", - "type": [ - "number", - "null" - ], + "type": ["number", "null"], "format": "double" }, "minHeight": { "description": "The min window height.", - "type": [ - "number", - "null" - ], + "type": ["number", "null"], "format": "double" }, "maxWidth": { "description": "The max window width.", - "type": [ - "number", - "null" - ], + "type": ["number", "null"], "format": "double" }, "maxHeight": { "description": "The max window height.", - "type": [ - "number", - "null" - ], + "type": ["number", "null"], "format": "double" }, "resizable": { @@ -401,17 +371,11 @@ }, "tabbingIdentifier": { "description": "Defines the window [tabbing identifier] for macOS.\n\nWindows with matching tabbing identifiers will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled.\n\n[tabbing identifier]: ", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "additionalBrowserArgs": { "description": "Defines additional browser arguments on Windows. By default wry passes `--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection` so if you use this method, you also need to disable these components by yourself if you want.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "shadow": { "description": "Whether or not the window has shadow.\n\n## Platform-specific\n\n- **Windows:** - `false` has no effect on decorated window, shadow are always ON. - `true` will make ndecorated window have a 1px white border, and on Windows 11, it will have a rounded corners. - **Linux:** Unsupported.", @@ -436,17 +400,11 @@ }, "parent": { "description": "Sets the window associated with this label to be the parent of the window to be created.\n\n## Platform-specific\n\n- **Windows**: This sets the passed parent as an owner window to the window to be created. From [MSDN owned windows docs](https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features#owned-windows): - An owned window is always above its owner in the z-order. - The system automatically destroys an owned window when its owner is destroyed. - An owned window is hidden when its owner is minimized. - **Linux**: This makes the new window transient for parent, see - **macOS**: This adds the window as a child of parent, see ", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "proxyUrl": { "description": "The proxy URL for the WebView for all network requests.\n\nMust be either a `http://` or a `socks5://` URL.\n\n## Platform-specific\n\n- **macOS**: Requires the `macos-proxy` feature flag and only compiles for macOS 14+.", - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "format": "uri" } }, @@ -477,16 +435,12 @@ { "description": "Light theme.", "type": "string", - "enum": [ - "Light" - ] + "enum": ["Light"] }, { "description": "Dark theme.", "type": "string", - "enum": [ - "Dark" - ] + "enum": ["Dark"] } ] }, @@ -496,32 +450,24 @@ { "description": "A normal title bar.", "type": "string", - "enum": [ - "Visible" - ] + "enum": ["Visible"] }, { "description": "Makes the title bar transparent, so the window background color is shown instead.\n\nUseful if you don't need to have actual HTML under the title bar. This lets you avoid the caveats of using `TitleBarStyle::Overlay`. Will be more useful when Tauri lets you set a custom window background color.", "type": "string", - "enum": [ - "Transparent" - ] + "enum": ["Transparent"] }, { "description": "Shows the title bar as a transparent overlay over the window's content.\n\nKeep in mind: - The height of the title bar is different on different OS versions, which can lead to window the controls and title not being where you don't expect. - You need to define a custom drag region to make your window draggable, however due to a limitation you can't drag the window when it's not in focus . - The color of the window title depends on the system theme.", "type": "string", - "enum": [ - "Overlay" - ] + "enum": ["Overlay"] } ] }, "WindowEffectsConfig": { "description": "The window effects configuration object", "type": "object", - "required": [ - "effects" - ], + "required": ["effects"], "properties": { "effects": { "description": "List of Window effects to apply to the Window. Conflicting effects will apply the first one and ignore the rest.", @@ -543,10 +489,7 @@ }, "radius": { "description": "Window effect corner radius **macOS Only**", - "type": [ - "number", - "null" - ], + "type": ["number", "null"], "format": "double" }, "color": { @@ -570,195 +513,141 @@ "description": "A default material appropriate for the view's effectiveAppearance. **macOS 10.14-**", "deprecated": true, "type": "string", - "enum": [ - "appearanceBased" - ] + "enum": ["appearanceBased"] }, { "description": "*macOS 10.14-**", "deprecated": true, "type": "string", - "enum": [ - "light" - ] + "enum": ["light"] }, { "description": "*macOS 10.14-**", "deprecated": true, "type": "string", - "enum": [ - "dark" - ] + "enum": ["dark"] }, { "description": "*macOS 10.14-**", "deprecated": true, "type": "string", - "enum": [ - "mediumLight" - ] + "enum": ["mediumLight"] }, { "description": "*macOS 10.14-**", "deprecated": true, "type": "string", - "enum": [ - "ultraDark" - ] + "enum": ["ultraDark"] }, { "description": "*macOS 10.10+**", "type": "string", - "enum": [ - "titlebar" - ] + "enum": ["titlebar"] }, { "description": "*macOS 10.10+**", "type": "string", - "enum": [ - "selection" - ] + "enum": ["selection"] }, { "description": "*macOS 10.11+**", "type": "string", - "enum": [ - "menu" - ] + "enum": ["menu"] }, { "description": "*macOS 10.11+**", "type": "string", - "enum": [ - "popover" - ] + "enum": ["popover"] }, { "description": "*macOS 10.11+**", "type": "string", - "enum": [ - "sidebar" - ] + "enum": ["sidebar"] }, { "description": "*macOS 10.14+**", "type": "string", - "enum": [ - "headerView" - ] + "enum": ["headerView"] }, { "description": "*macOS 10.14+**", "type": "string", - "enum": [ - "sheet" - ] + "enum": ["sheet"] }, { "description": "*macOS 10.14+**", "type": "string", - "enum": [ - "windowBackground" - ] + "enum": ["windowBackground"] }, { "description": "*macOS 10.14+**", "type": "string", - "enum": [ - "hudWindow" - ] + "enum": ["hudWindow"] }, { "description": "*macOS 10.14+**", "type": "string", - "enum": [ - "fullScreenUI" - ] + "enum": ["fullScreenUI"] }, { "description": "*macOS 10.14+**", "type": "string", - "enum": [ - "tooltip" - ] + "enum": ["tooltip"] }, { "description": "*macOS 10.14+**", "type": "string", - "enum": [ - "contentBackground" - ] + "enum": ["contentBackground"] }, { "description": "*macOS 10.14+**", "type": "string", - "enum": [ - "underWindowBackground" - ] + "enum": ["underWindowBackground"] }, { "description": "*macOS 10.14+**", "type": "string", - "enum": [ - "underPageBackground" - ] + "enum": ["underPageBackground"] }, { "description": "Mica effect that matches the system dark perefence **Windows 11 Only**", "type": "string", - "enum": [ - "mica" - ] + "enum": ["mica"] }, { "description": "Mica effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**", "type": "string", - "enum": [ - "micaDark" - ] + "enum": ["micaDark"] }, { "description": "Mica effect with light mode **Windows 11 Only**", "type": "string", - "enum": [ - "micaLight" - ] + "enum": ["micaLight"] }, { "description": "Tabbed effect that matches the system dark perefence **Windows 11 Only**", "type": "string", - "enum": [ - "tabbed" - ] + "enum": ["tabbed"] }, { "description": "Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**", "type": "string", - "enum": [ - "tabbedDark" - ] + "enum": ["tabbedDark"] }, { "description": "Tabbed effect with light mode **Windows 11 Only**", "type": "string", - "enum": [ - "tabbedLight" - ] + "enum": ["tabbedLight"] }, { "description": "**Windows 7/10/11(22H1) Only**\n\n## Notes\n\nThis effect has bad performance when resizing/dragging the window on Windows 11 build 22621.", "type": "string", - "enum": [ - "blur" - ] + "enum": ["blur"] }, { "description": "**Windows 10/11 Only**\n\n## Notes\n\nThis effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000.", "type": "string", - "enum": [ - "acrylic" - ] + "enum": ["acrylic"] } ] }, @@ -768,23 +657,17 @@ { "description": "Make window effect state follow the window's active state", "type": "string", - "enum": [ - "followsWindowActiveState" - ] + "enum": ["followsWindowActiveState"] }, { "description": "Make window effect state always active", "type": "string", - "enum": [ - "active" - ] + "enum": ["active"] }, { "description": "Make window effect state always inactive", "type": "string", - "enum": [ - "inactive" - ] + "enum": ["inactive"] } ] }, @@ -983,10 +866,7 @@ }, "requireLiteralLeadingDot": { "description": "Whether or not paths that contain components that start with a `.` will require that `.` appears literally in the pattern; `*`, `?`, `**`, or `[...]` will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files.\n\nDefaults to `true` on Unix systems and `false` on Windows", - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] } } } @@ -998,37 +878,26 @@ { "description": "Brownfield pattern.", "type": "object", - "required": [ - "use" - ], + "required": ["use"], "properties": { "use": { "type": "string", - "enum": [ - "brownfield" - ] + "enum": ["brownfield"] } } }, { "description": "Isolation pattern. Recommended for security purposes.", "type": "object", - "required": [ - "options", - "use" - ], + "required": ["options", "use"], "properties": { "use": { "type": "string", - "enum": [ - "isolation" - ] + "enum": ["isolation"] }, "options": { "type": "object", - "required": [ - "dir" - ], + "required": ["dir"], "properties": { "dir": { "description": "The dir containing the index.html file that contains the secure isolation application.", @@ -1043,16 +912,11 @@ "TrayIconConfig": { "description": "Configuration for application tray icon.\n\nSee more: ", "type": "object", - "required": [ - "iconPath" - ], + "required": ["iconPath"], "properties": { "id": { "description": "Set an id for this tray icon so you can reference it later, defaults to `main`.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "iconPath": { "description": "Path to the default icon to use for the tray icon.", @@ -1070,17 +934,11 @@ }, "title": { "description": "Title for MacOS tray", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "tooltip": { "description": "Tray icon tooltip on Windows and macOS", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -1091,17 +949,11 @@ "properties": { "runner": { "description": "The binary used to build and run the application.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "devUrl": { "description": "The URL to load in development.\n\nThis is usually an URL to a dev server, which serves your application assets with hot-reload and HMR. Most modern JavaScript bundlers like [vite](https://vitejs.dev/guide/) provides a way to start a dev server by default.\n\nIf you don't have a dev server or don't want to use one, ignore this option and use [`frontendDist`](BuildConfig::frontend_dist) and point to a web assets directory, and Tauri CLI will run its built-in dev server and provide a simple hot-reload experience.", - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "format": "uri" }, "frontendDist": { @@ -1150,10 +1002,7 @@ }, "features": { "description": "Features passed to `cargo` commands.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -1192,9 +1041,7 @@ { "description": "Run the given script with custom options.", "type": "object", - "required": [ - "script" - ], + "required": ["script"], "properties": { "script": { "description": "The script to execute.", @@ -1202,10 +1049,7 @@ }, "cwd": { "description": "The current working directory.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "wait": { "description": "Whether `tauri dev` should wait for the command to finish or not. Defaults to `false`.", @@ -1226,9 +1070,7 @@ { "description": "Run the given script with custom options.", "type": "object", - "required": [ - "script" - ], + "required": ["script"], "properties": { "script": { "description": "The script to execute.", @@ -1236,10 +1078,7 @@ }, "cwd": { "description": "The current working directory.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } } } @@ -1265,10 +1104,7 @@ }, "publisher": { "description": "The application's publisher. Defaults to the second element in the identifier string. Currently maps to the Manufacturer property of the Windows Installer.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "icon": { "description": "The app's icons", @@ -1291,62 +1127,38 @@ }, "copyright": { "description": "A copyright string associated with your application.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "license": { "description": "The package's license identifier to be included in the appropriate bundles. If not set, defaults to the license from the Cargo.toml file.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "licenseFile": { "description": "The path to the license file to be included in the appropriate bundles.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "category": { "description": "The application kind.\n\nShould be one of the following: Business, DeveloperTool, Education, Entertainment, Finance, Game, ActionGame, AdventureGame, ArcadeGame, BoardGame, CardGame, CasinoGame, DiceGame, EducationalGame, FamilyGame, KidsGame, MusicGame, PuzzleGame, RacingGame, RolePlayingGame, SimulationGame, SportsGame, StrategyGame, TriviaGame, WordGame, GraphicsAndDesign, HealthcareAndFitness, Lifestyle, Medical, Music, News, Photography, Productivity, Reference, SocialNetworking, Sports, Travel, Utility, Video, Weather.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "fileAssociations": { "description": "File associations to application.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/definitions/FileAssociation" } }, "shortDescription": { "description": "A short description of your application.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "longDescription": { "description": "A longer, multi-line description of the application.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "externalBin": { "description": "A list of—either absolute or relative—paths to binaries to embed with your application.\n\nNote that Tauri will look for system-specific binaries following the pattern \"binary-name{-target-triple}{.system-extension}\".\n\nE.g. for the external binary \"my-binary\", Tauri looks for:\n\n- \"my-binary-x86_64-pc-windows-msvc.exe\" for Windows - \"my-binary-x86_64-apple-darwin\" for macOS - \"my-binary-x86_64-unknown-linux-gnu\" for Linux\n\nso don't forget to provide binaries for all targeted platforms.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -1449,9 +1261,7 @@ "anyOf": [ { "description": "Bundle all targets.", - "enum": [ - "all" - ] + "enum": ["all"] }, { "description": "A list of bundle targets.", @@ -1476,58 +1286,42 @@ { "description": "The debian bundle (.deb).", "type": "string", - "enum": [ - "deb" - ] + "enum": ["deb"] }, { "description": "The RPM bundle (.rpm).", "type": "string", - "enum": [ - "rpm" - ] + "enum": ["rpm"] }, { "description": "The AppImage bundle (.appimage).", "type": "string", - "enum": [ - "appimage" - ] + "enum": ["appimage"] }, { "description": "The Microsoft Installer bundle (.msi).", "type": "string", - "enum": [ - "msi" - ] + "enum": ["msi"] }, { "description": "The NSIS bundle (.exe).", "type": "string", - "enum": [ - "nsis" - ] + "enum": ["nsis"] }, { "description": "The macOS application bundle (.app).", "type": "string", - "enum": [ - "app" - ] + "enum": ["app"] }, { "description": "The Apple Disk Image bundle (.dmg).", "type": "string", - "enum": [ - "dmg" - ] + "enum": ["dmg"] }, { "description": "The Tauri updater bundle.", "type": "string", - "enum": [ - "updater" - ] + "enum": ["updater"] } ] }, @@ -1553,9 +1347,7 @@ "FileAssociation": { "description": "File association", "type": "object", - "required": [ - "ext" - ], + "required": ["ext"], "properties": { "ext": { "description": "File extensions to associate with this app. e.g. 'png'", @@ -1566,17 +1358,11 @@ }, "name": { "description": "The name. Maps to `CFBundleTypeName` on macOS. Default to `ext[0]`", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "description": { "description": "The association description. Windows-only. It is displayed on the `Type` column on Windows Explorer.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "role": { "description": "The app's role with respect to the type. Maps to `CFBundleTypeRole` on macOS.", @@ -1589,10 +1375,7 @@ }, "mimeType": { "description": "The mime-type e.g. 'image/png' or 'text/plain'. Linux-only.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -1607,37 +1390,27 @@ { "description": "CFBundleTypeRole.Editor. Files can be read and edited.", "type": "string", - "enum": [ - "Editor" - ] + "enum": ["Editor"] }, { "description": "CFBundleTypeRole.Viewer. Files can be read.", "type": "string", - "enum": [ - "Viewer" - ] + "enum": ["Viewer"] }, { "description": "CFBundleTypeRole.Shell", "type": "string", - "enum": [ - "Shell" - ] + "enum": ["Shell"] }, { "description": "CFBundleTypeRole.QLGenerator", "type": "string", - "enum": [ - "QLGenerator" - ] + "enum": ["QLGenerator"] }, { "description": "CFBundleTypeRole.None", "type": "string", - "enum": [ - "None" - ] + "enum": ["None"] } ] }, @@ -1647,24 +1420,15 @@ "properties": { "digestAlgorithm": { "description": "Specifies the file digest algorithm to use for creating file signatures. Required for code signing. SHA-256 is recommended.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "certificateThumbprint": { "description": "Specifies the SHA1 hash of the signing certificate.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "timestampUrl": { "description": "Server to use during timestamping.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "tsp": { "description": "Whether to use Time-Stamp Protocol (TSP, a.k.a. RFC 3161) for the timestamp server. Your code signing provider may use a TSP timestamp server, like e.g. SSL.com does. If so, enable TSP by setting to true.", @@ -1685,10 +1449,7 @@ }, "webviewFixedRuntimePath": { "description": "Path to the webview fixed runtime to use. Overwrites [`Self::webview_install_mode`] if set.\n\nWill be removed in v2, prefer the [`Self::webview_install_mode`] option.\n\nThe fixed version can be downloaded [on the official website](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section). The `.cab` file must be extracted to a folder and this folder path must be defined on this field.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "allowDowngrades": { "description": "Validates a second app installation, blocking the user from installing an older version if set to `false`.\n\nFor instance, if `1.2.1` is installed, the user won't be able to install app version `1.2.0` or `1.1.5`.\n\nThe default value of this flag is `true`.", @@ -1726,15 +1487,11 @@ { "description": "Do not install the Webview2 as part of the Windows Installer.", "type": "object", - "required": [ - "type" - ], + "required": ["type"], "properties": { "type": { "type": "string", - "enum": [ - "skip" - ] + "enum": ["skip"] } }, "additionalProperties": false @@ -1742,15 +1499,11 @@ { "description": "Download the bootstrapper and run it. Requires an internet connection. Results in a smaller installer size, but is not recommended on Windows 7.", "type": "object", - "required": [ - "type" - ], + "required": ["type"], "properties": { "type": { "type": "string", - "enum": [ - "downloadBootstrapper" - ] + "enum": ["downloadBootstrapper"] }, "silent": { "description": "Instructs the installer to run the bootstrapper in silent mode. Defaults to `true`.", @@ -1763,15 +1516,11 @@ { "description": "Embed the bootstrapper and run it. Requires an internet connection. Increases the installer size by around 1.8MB, but offers better support on Windows 7.", "type": "object", - "required": [ - "type" - ], + "required": ["type"], "properties": { "type": { "type": "string", - "enum": [ - "embedBootstrapper" - ] + "enum": ["embedBootstrapper"] }, "silent": { "description": "Instructs the installer to run the bootstrapper in silent mode. Defaults to `true`.", @@ -1784,15 +1533,11 @@ { "description": "Embed the offline installer and run it. Does not require an internet connection. Increases the installer size by around 127MB.", "type": "object", - "required": [ - "type" - ], + "required": ["type"], "properties": { "type": { "type": "string", - "enum": [ - "offlineInstaller" - ] + "enum": ["offlineInstaller"] }, "silent": { "description": "Instructs the installer to run the installer in silent mode. Defaults to `true`.", @@ -1805,16 +1550,11 @@ { "description": "Embed a fixed webview2 version and use it at runtime. Increases the installer size by around 180MB.", "type": "object", - "required": [ - "path", - "type" - ], + "required": ["path", "type"], "properties": { "type": { "type": "string", - "enum": [ - "fixedRuntime" - ] + "enum": ["fixedRuntime"] }, "path": { "description": "The path to the fixed runtime to use.\n\nThe fixed version can be downloaded [on the official website](https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section). The `.cab` file must be extracted to a folder and this folder path must be defined on this field.", @@ -1840,10 +1580,7 @@ }, "template": { "description": "A custom .wxs template to use.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "fragmentPaths": { "description": "A list of paths to .wxs files with WiX fragments to use.", @@ -1905,17 +1642,11 @@ }, "bannerPath": { "description": "Path to a bitmap file to use as the installation user interface banner. This bitmap will appear at the top of all but the first page of the installer.\n\nThe required dimensions are 493px × 58px.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "dialogImagePath": { "description": "Path to a bitmap file to use on the installation user interface dialogs. It is used on the welcome and completion dialogs. The required dimensions are 493px × 312px.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -1949,10 +1680,7 @@ "properties": { "localePath": { "description": "The path to a locale (`.wxl`) file. See .", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -1963,31 +1691,19 @@ "properties": { "template": { "description": "A custom .nsi template to use.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "headerImage": { "description": "The path to a bitmap file to display on the header of installers pages.\n\nThe recommended dimensions are 150px x 57px.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "sidebarImage": { "description": "The path to a bitmap file for the Welcome page and the Finish page.\n\nThe recommended dimensions are 164px x 314px.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "installerIcon": { "description": "The path to an icon file used as the installer icon.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "installMode": { "description": "Whether the installation will be for all users or just the current user.", @@ -2000,20 +1716,14 @@ }, "languages": { "description": "A list of installer languages. By default the OS language is used. If the OS language is not in the list of languages, the first language will be used. To allow the user to select the language, set `display_language_selector` to `true`.\n\nSee for the complete list of languages.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } }, "customLanguageFiles": { "description": "A key-value pair where the key is the language and the value is the path to a custom `.nsh` file that holds the translated text for tauri's custom messages.\n\nSee for an example `.nsh` file.\n\n**Note**: the key must be a valid NSIS language and it must be added to [`NsisConfig`] languages array,", - "type": [ - "object", - "null" - ], + "type": ["object", "null"], "additionalProperties": { "type": "string" } @@ -2043,23 +1753,17 @@ { "description": "Default mode for the installer.\n\nInstall the app by default in a directory that doesn't require Administrator access.\n\nInstaller metadata will be saved under the `HKCU` registry path.", "type": "string", - "enum": [ - "currentUser" - ] + "enum": ["currentUser"] }, { "description": "Install the app by default in the `Program Files` folder directory requires Administrator access for the installation.\n\nInstaller metadata will be saved under the `HKLM` registry path.", "type": "string", - "enum": [ - "perMachine" - ] + "enum": ["perMachine"] }, { "description": "Combines both modes and allows the user to choose at install time whether to install for the current user or per machine. Note that this mode will require Administrator access even if the user wants to install it for the current user only.\n\nInstaller metadata will be saved under the `HKLM` or `HKCU` registry path based on the user's choice.", "type": "string", - "enum": [ - "both" - ] + "enum": ["both"] } ] }, @@ -2069,23 +1773,17 @@ { "description": "ZLIB uses the deflate algorithm, it is a quick and simple method. With the default compression level it uses about 300 KB of memory.", "type": "string", - "enum": [ - "zlib" - ] + "enum": ["zlib"] }, { "description": "BZIP2 usually gives better compression ratios than ZLIB, but it is a bit slower and uses more memory. With the default compression level it uses about 4 MB of memory.", "type": "string", - "enum": [ - "bzip2" - ] + "enum": ["bzip2"] }, { "description": "LZMA (default) is a new compression method that gives very good compression ratios. The decompression speed is high (10-20 MB/s on a 2 GHz CPU), the compression speed is lower. The memory size that will be used for decompression is the dictionary size plus a few KBs, the default is 8 MB.", "type": "string", - "enum": [ - "lzma" - ] + "enum": ["lzma"] } ] }, @@ -2158,10 +1856,7 @@ "properties": { "depends": { "description": "The list of deb dependencies your application relies on.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -2176,10 +1871,7 @@ }, "desktopTemplate": { "description": "Path to a custom desktop file Handlebars template.\n\nAvailable variables: `categories`, `comment` (optional), `exec`, `icon` and `name`.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -2190,10 +1882,7 @@ "properties": { "depends": { "description": "The list of RPM dependencies your application relies on.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -2220,10 +1909,7 @@ }, "desktopTemplate": { "description": "Path to a custom desktop file Handlebars template.\n\nAvailable variables: `categories`, `comment` (optional), `exec`, `icon` and `name`.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false @@ -2234,10 +1920,7 @@ "properties": { "frameworks": { "description": "A list of strings indicating any macOS X frameworks that need to be bundled with the application.\n\nIf a name is used, \".framework\" must be omitted and it will look for standard install locations. You may also use a path to a specific framework.", - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -2253,38 +1936,23 @@ "minimumSystemVersion": { "description": "A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`.\n\nSetting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist` and the `MACOSX_DEPLOYMENT_TARGET` environment variable.\n\nAn empty string is considered an invalid value so the default value is used.", "default": "10.13", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "exceptionDomain": { "description": "Allows your application to communicate with the outside world. It should be a lowercase, without port and protocol domain name.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "signingIdentity": { "description": "Identity to use for code signing.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "providerShortName": { "description": "Provider short name for notarization.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "entitlements": { "description": "Path to the entitlements file.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "dmg": { "description": "DMG-specific settings.", @@ -2317,10 +1985,7 @@ "properties": { "background": { "description": "Image to use as the background in dmg file. Accepted formats: `png`/`jpg`/`gif`.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "windowPosition": { "description": "Position of volume window on screen.", @@ -2375,10 +2040,7 @@ "Position": { "description": "Position coordinates struct.", "type": "object", - "required": [ - "x", - "y" - ], + "required": ["x", "y"], "properties": { "x": { "description": "X coordinate.", @@ -2398,10 +2060,7 @@ "Size": { "description": "Size of the window.", "type": "object", - "required": [ - "height", - "width" - ], + "required": ["height", "width"], "properties": { "width": { "description": "Width of the window.", @@ -2424,10 +2083,7 @@ "properties": { "developmentTeam": { "description": "The development team. This value is required for iOS development because code signing is enforced. The `APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "additionalProperties": false diff --git a/clients/web/src/lib/tauri/tests/find-line-number-by-nested-key-in-sources.test.ts b/clients/web/src/lib/tauri/tests/find-line-number-by-nested-key-in-sources.test.ts index 741b921d..57e8e00b 100644 --- a/clients/web/src/lib/tauri/tests/find-line-number-by-nested-key-in-sources.test.ts +++ b/clients/web/src/lib/tauri/tests/find-line-number-by-nested-key-in-sources.test.ts @@ -8,13 +8,13 @@ const validConfig = fs.readFileSync( describe("findLineNumberByNestedKey", () => { it("should be able to find top level keys.", () => { - expect(findLineNumberByNestedKeyInSource(validConfig, "app")).toBe(14); + expect(findLineNumberByNestedKeyInSource(validConfig, "app")).toBe(11); }); it("should be able to find deeply nested keys.", () => { expect( findLineNumberByNestedKeyInSource(validConfig, "bundle.active") - ).toBe(29); + ).toBe(26); }); it("should not break when the key is not in the config.", () => { @@ -26,18 +26,18 @@ describe("findLineNumberByNestedKey", () => { it("should be able to resolve array values.", () => { expect( findLineNumberByNestedKeyInSource(validConfig, "bundle.icon.2") - ).toBe(34); + ).toBe(31); }); it("should be able to resolve array values and their children.", () => { expect( findLineNumberByNestedKeyInSource(validConfig, "app.windows.0.height") - ).toBe(19); + ).toBe(16); }); it("should be able to resolve array values and their children, even if it is the same line.", () => { expect( findLineNumberByNestedKeyInSource(validConfig, "build.frontendDist.0") - ).toBe(7); + ).toBe(6); }); }); diff --git a/clients/web/src/lib/tauri/tests/fixtures/valid-config.json b/clients/web/src/lib/tauri/tests/fixtures/valid-config.json index 2e2d8bfa..0a5af212 100644 --- a/clients/web/src/lib/tauri/tests/fixtures/valid-config.json +++ b/clients/web/src/lib/tauri/tests/fixtures/valid-config.json @@ -3,10 +3,7 @@ "productName": "Hello World", "version": "0.1.0", "build": { - "frontendDist": [ - "index.html", - "test.html" - ], + "frontendDist": ["index.html", "test.html"], "devUrl": "http://localhost:1420", "beforeDevCommand": "", "beforeBuildCommand": "" @@ -40,4 +37,4 @@ "copyright": "", "category": "DeveloperTool" } -} \ No newline at end of file +}