mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 14:34:19 +01:00
Pear release 1.11.1 docs (#169)
* Add `data` cli command & info about `apps` subcommand * Add `pear reset` cli command for resetting a Pear application Added a warning in the description as the command can result in lost data and users should be cautious when using it. * Remove leading spaces for `data` command flags * Add note about dumping paths from `pear://` links in `dump` command * Add `Pear.tray()` to Pear API docs * Add supported formats for tray icon * Remove `--unsafe-clear-preferences` from `pear run` cli doc * Add `pear.gui.name` config option * Edit new documentation for grammar & formatting * Clarify `pear.gui.name` is an override & doesnt have a default * Remove using "you" in `pear dump` doc & Correct grammar in `Pear.tray()` Co-authored-by: David Mark Clements <huperekchunow@googlemail.com> * Reword `pear reset` to make warning explicit * Add note about hidden app issues when linux doesn't support `Pear.tray()` --------- Co-authored-by: David Mark Clements <huperekchunow@googlemail.com>
This commit is contained in:
@@ -451,6 +451,29 @@ Returns a `Boolean` promise for whether the call succeeded.
|
|||||||
|
|
||||||
Desktop Applications only.
|
Desktop Applications only.
|
||||||
|
|
||||||
|
### `Pear.tray(options <Object>, listener <Async Function|Function>) => Promise<untray()>`
|
||||||
|
|
||||||
|
Configure a tray icon for the application. This method will return a promise which resolves to an `untray()` function for removing the tray.
|
||||||
|
|
||||||
|
The `listener` function is triggered whenever a menu item or the tray icon is clicked. It receives a single argument `key` that represents the menu item `key` that was clicked or the special value of `'click'` for when the menu icon itself was clicked. If no `listener` function is provided, a default listener will show the application window when triggered with `'click'` or `'show'` and quits with `'quit'`.
|
||||||
|
|
||||||
|
A Pear application must be `hideable` to support adding a tray (see [`pear.gui.hideable`](./configuration.md#pear.gui.hideable-less-than-boolean-greater-than-default-false)).
|
||||||
|
|
||||||
|
WARNING: Linux tray support varies which can cause scenarios where the application's tray doesn't work and closing the app will be hidden and inaccessible. Using a tray and `hideable` on Linux is not recommended.
|
||||||
|
|
||||||
|
Desktop Applications only.
|
||||||
|
|
||||||
|
**Options**
|
||||||
|
|
||||||
|
* `icon <String>` Default: The Pear icon - The path for icon for the tray
|
||||||
|
relative to the project root. Supported formats: PNG & JPEG
|
||||||
|
* `menu <Object>` Default: ``{ show: `Show ${Pear.config.name}`, quit: 'Quit' }`` - The
|
||||||
|
tray menu items. Each property of the object is the `key` passed to the
|
||||||
|
`listener` and whose value is the text displayed in the menu.
|
||||||
|
* `os <Object>` Default: `{ win32: true, linux: true, darwin: true }` - which
|
||||||
|
platforms support using the tray menu. The platform is checked via the
|
||||||
|
`process.platform` value.
|
||||||
|
|
||||||
### `const win = new Pear.Window(entry <String>, options <Object>)`
|
### `const win = new Pear.Window(entry <String>, options <Object>)`
|
||||||
|
|
||||||
Desktop Applications only.
|
Desktop Applications only.
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ Run an application from a link or dir.
|
|||||||
--links <kvs> Override configured links with comma-separated key-values
|
--links <kvs> Override configured links with comma-separated key-values
|
||||||
--chrome-webrtc-internals Enable chrome://webrtc-internals
|
--chrome-webrtc-internals Enable chrome://webrtc-internals
|
||||||
--unsafe-clear-app-storage Clear app storage
|
--unsafe-clear-app-storage Clear app storage
|
||||||
--unsafe-clear-preferences Clear preferences (such as trustlist)
|
|
||||||
--appling=path Set application shell path
|
--appling=path Set application shell path
|
||||||
--checkout=n Run a checkout, n is version length
|
--checkout=n Run a checkout, n is version length
|
||||||
--checkout=release Run checkout from marked released length
|
--checkout=release Run checkout from marked released length
|
||||||
@@ -157,6 +156,12 @@ Synchronize files from link to dir.
|
|||||||
|
|
||||||
> To dump to stdout use `-` in place of `<dir>`
|
> To dump to stdout use `-` in place of `<dir>`
|
||||||
|
|
||||||
|
`<link>` can contain a path portion to dump a subset of the files for the Pear application. For example, to dump only the `CHANGELOG.md` from Keet into a `dump-dir` directory run:
|
||||||
|
|
||||||
|
```
|
||||||
|
pear dump pear://keet/CHANGELOG.md dump-dir/
|
||||||
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
--dry-run|-d Execute a dump without writing
|
--dry-run|-d Execute a dump without writing
|
||||||
--checkout=n Dump from specified checkout, n is version length
|
--checkout=n Dump from specified checkout, n is version length
|
||||||
@@ -218,6 +223,19 @@ Move user application storage between applications.
|
|||||||
--json Newline delimited JSON output
|
--json Newline delimited JSON output
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `pear reset [flags] <link>`
|
||||||
|
|
||||||
|
Advanced. Reset an application to initial state
|
||||||
|
|
||||||
|
Clears application storage for a given application link.
|
||||||
|
|
||||||
|
WARNING: Confirmation will be requested as the storage will be deleted permanently and cannot be recovered. Use with caution.
|
||||||
|
|
||||||
|
```
|
||||||
|
--json Newline delimited JSON output
|
||||||
|
--help|-h Show help
|
||||||
|
```
|
||||||
|
|
||||||
## `pear gc [flags] [command]`
|
## `pear gc [flags] [command]`
|
||||||
|
|
||||||
Perform garbage collection and remove unused resources.
|
Perform garbage collection and remove unused resources.
|
||||||
@@ -232,5 +250,27 @@ Perform garbage collection and remove unused resources.
|
|||||||
--help|-h Show help
|
--help|-h Show help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `pear data [flags] [command]`
|
||||||
|
|
||||||
|
View database contents.
|
||||||
|
|
||||||
|
The database contains metadata stored on this device used by the Pear runtime.
|
||||||
|
|
||||||
|
| Commands | Description |
|
||||||
|
| ---------- | -------------------------- |
|
||||||
|
| apps | Installed apps |
|
||||||
|
| dht | DHT known-nodes cache |
|
||||||
|
| gc | Garbage collection records |
|
||||||
|
|
||||||
|
```
|
||||||
|
--secrets Show sensitive information, i.e. encryption-keys
|
||||||
|
--json Newline delimited JSON output
|
||||||
|
--help|-h Show help
|
||||||
|
```
|
||||||
|
|
||||||
|
### `pear data apps [flags] [link]`
|
||||||
|
|
||||||
|
List installed apps, filtered by `[link]` if provided.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ The following `platform`s are supported:
|
|||||||
- `linux`
|
- `linux`
|
||||||
- `win32`
|
- `win32`
|
||||||
|
|
||||||
|
### `pear.gui.name <String>`
|
||||||
|
|
||||||
|
Override the app name which otherwise defaults to [name](#pear.name-less-than-string-greater-than).
|
||||||
|
|
||||||
#### `pear.gui.width <Number>`
|
#### `pear.gui.width <Number>`
|
||||||
|
|
||||||
Window width (pixels).
|
Window width (pixels).
|
||||||
@@ -142,6 +146,8 @@ Enable transparency. Must be set for opacity to work.
|
|||||||
|
|
||||||
Keep app running when all windows are closed.
|
Keep app running when all windows are closed.
|
||||||
|
|
||||||
|
WARNING: Linux tray support varies which can cause scenarios where the application's tray doesn't work and closing the app will be hidden and inaccessible. Using a tray and `hideable` on Linux is not recommended.
|
||||||
|
|
||||||
#### `pear.gui.backgroundColor <String>` (default: "#000" non-transparent, "#00000000" transparent)
|
#### `pear.gui.backgroundColor <String>` (default: "#000" non-transparent, "#00000000" transparent)
|
||||||
|
|
||||||
Background color (Hex, RGB, RGBA, HSL, HSLA, CSS color).
|
Background color (Hex, RGB, RGBA, HSL, HSLA, CSS color).
|
||||||
|
|||||||
Reference in New Issue
Block a user