Skip to content

Commit

Permalink
feat: add StoreHooks (#144)
Browse files Browse the repository at this point in the history
* docs: reorganize dirs

* feat: add `StoreHooks`

* style: format files

* chore: remove unused feature

* ci: run `type-check`

* ci: run `build:shared`

* ci: add powershell scripts

* style: format file

* ci: run `svelte:sync`

* ci: remove type check
  • Loading branch information
ferreira-tb authored Feb 9, 2025
1 parent a67a572 commit ddaccc7
Show file tree
Hide file tree
Showing 228 changed files with 930 additions and 546 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,9 @@ jobs:
- name: Configure Pages
uses: actions/configure-pages@v5

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libgtk-3-dev libwebkit2gtk-4.1-dev
pnpm install
- name: Build
shell: pwsh
run: |
pnpm run codegen
pnpm run build
pnpm run build:docs
touch docs/dist/.nojekyll
run: scripts/deploy-docs.ps1

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ jobs:
with:
components: clippy

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Test
shell: pwsh
run: |
cargo clippy --workspace
cargo test -p tauri-store --tests -- --test-threads=1
run: scripts/test.ps1 -Ubuntu
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions crates/tauri-plugin-pinia/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "tauri-plugin-pinia"
description = "Persistent Pinia stores for Tauri"
version = "1.1.2"
version = "1.2.0"
documentation = "https://docs.rs/tauri-plugin-pinia"
homepage = "https://tb.dev.br/tauri-store"
repository = "https://github.com/ferreira-tb/tauri-store"
authors = ["Andrew Ferreira <[email protected]>"]
license = "MIT"
readme = "./README.md"
keywords = ["tauri", "plugin", "store", "pinia", "vue"]
keywords = ["pinia", "plugin", "store", "tauri", "vue"]
links = "tauri-plugin-pinia"

[package.edition]
Expand Down Expand Up @@ -36,6 +36,7 @@ tauri = "2"
[dependencies.tauri-store]
version = "0.7"
path = "../tauri-store"
default-features = false
features = ["derive"]

[target."cfg(tauri_store_tracing)".dependencies]
Expand Down
12 changes: 11 additions & 1 deletion crates/tauri-plugin-pinia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ Persistent [Pinia](https://pinia.vuejs.org/) stores for Tauri and Vue.

Check the [documentation](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-pinia) for more information on how to install and use the plugin.

## Plugins

Currently, the following plugins are available:

| Name | Version | Works with |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------- |
| [tauri-plugin-pinia](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-pinia) | [![npm](https://img.shields.io/npm/v/tauri-plugin-pinia.svg)](https://www.npmjs.com/package/tauri-plugin-pinia) | Vue, Nuxt |
| [tauri-plugin-svelte](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-svelte) | [![npm](https://img.shields.io/npm/v/tauri-plugin-svelte.svg)](https://www.npmjs.com/package/tauri-plugin-svelte) | Svelte |
| [tauri-plugin-valtio](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-valtio) | [![npm](https://img.shields.io/npm/v/tauri-plugin-valtio.svg)](https://www.npmjs.com/package/tauri-plugin-valtio) | React |

## Supported Tauri Version

This plugin requires Tauri `2.0` or later.
The plugins require Tauri `2.0` or later.
5 changes: 3 additions & 2 deletions crates/tauri-plugin-svelte/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "tauri-plugin-svelte"
description = "Persistent Svelte stores for Tauri"
version = "1.1.1"
version = "1.2.0"
documentation = "https://docs.rs/tauri-plugin-svelte"
homepage = "https://tb.dev.br/tauri-store"
repository = "https://github.com/ferreira-tb/tauri-store"
authors = ["Andrew Ferreira <[email protected]>"]
license = "MIT"
readme = "./README.md"
keywords = ["tauri", "plugin", "store", "svelte"]
keywords = ["plugin", "store", "svelte", "tauri"]
links = "tauri-plugin-svelte"

[package.edition]
Expand Down Expand Up @@ -36,6 +36,7 @@ tauri = "2"
[dependencies.tauri-store]
version = "0.7"
path = "../tauri-store"
default-features = false
features = ["derive"]

[target."cfg(tauri_store_tracing)".dependencies]
Expand Down
14 changes: 12 additions & 2 deletions crates/tauri-plugin-svelte/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tauri-plugin-svelte

Persistent Svelte stores for Tauri.
Persistent Svelte stores and runes for Tauri.

## Features

Expand All @@ -13,6 +13,16 @@ Persistent Svelte stores for Tauri.

Check the [documentation](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-svelte) for more information on how to install and use the plugin.

## Plugins

Currently, the following plugins are available:

| Name | Version | Works with |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------- |
| [tauri-plugin-pinia](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-pinia) | [![npm](https://img.shields.io/npm/v/tauri-plugin-pinia.svg)](https://www.npmjs.com/package/tauri-plugin-pinia) | Vue, Nuxt |
| [tauri-plugin-svelte](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-svelte) | [![npm](https://img.shields.io/npm/v/tauri-plugin-svelte.svg)](https://www.npmjs.com/package/tauri-plugin-svelte) | Svelte |
| [tauri-plugin-valtio](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-valtio) | [![npm](https://img.shields.io/npm/v/tauri-plugin-valtio.svg)](https://www.npmjs.com/package/tauri-plugin-valtio) | React |

## Supported Tauri Version

This plugin requires Tauri `2.0` or later.
The plugins require Tauri `2.0` or later.
5 changes: 3 additions & 2 deletions crates/tauri-plugin-valtio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "tauri-plugin-valtio"
description = "Persistent Valtio stores for Tauri"
version = "1.0.0"
version = "1.1.0"
documentation = "https://docs.rs/tauri-plugin-valtio"
homepage = "https://tb.dev.br/tauri-store"
repository = "https://github.com/ferreira-tb/tauri-store"
authors = ["Andrew Ferreira <[email protected]>"]
license = "MIT"
readme = "./README.md"
keywords = ["tauri", "plugin", "store", "react", "valtio"]
keywords = ["plugin", "react", "store", "tauri", "valtio"]
links = "tauri-plugin-valtio"

[package.edition]
Expand Down Expand Up @@ -36,6 +36,7 @@ tauri = "2"
[dependencies.tauri-store]
version = "0.7"
path = "../tauri-store"
default-features = false
features = ["derive"]

[target."cfg(tauri_store_tracing)".dependencies]
Expand Down
12 changes: 11 additions & 1 deletion crates/tauri-plugin-valtio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ Persistent [Valtio](https://valtio.dev/) stores for Tauri and React.

Check the [documentation](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-valtio) for more information on how to install and use the plugin.

## Plugins

Currently, the following plugins are available:

| Name | Version | Works with |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------- |
| [tauri-plugin-pinia](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-pinia) | [![npm](https://img.shields.io/npm/v/tauri-plugin-pinia.svg)](https://www.npmjs.com/package/tauri-plugin-pinia) | Vue, Nuxt |
| [tauri-plugin-svelte](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-svelte) | [![npm](https://img.shields.io/npm/v/tauri-plugin-svelte.svg)](https://www.npmjs.com/package/tauri-plugin-svelte) | Svelte |
| [tauri-plugin-valtio](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-valtio) | [![npm](https://img.shields.io/npm/v/tauri-plugin-valtio.svg)](https://www.npmjs.com/package/tauri-plugin-valtio) | React |

## Supported Tauri Version

This plugin requires Tauri `2.0` or later.
The plugins require Tauri `2.0` or later.
2 changes: 1 addition & 1 deletion crates/tauri-store-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tauri-store-macros"
description = "Persistent stores for Tauri"
version = "0.7.1"
version = "0.7.2"
documentation = "https://docs.rs/tauri-store"
homepage = "https://tb.dev.br/tauri-store"
repository = "https://github.com/ferreira-tb/tauri-store"
Expand Down
8 changes: 4 additions & 4 deletions crates/tauri-store-macros/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Persistent stores for Tauri.
- Debounce or throttle store updates.
- Access the stores from both JavaScript and Rust.

## Documentation

Check the [documentation](https://tb.dev.br/tauri-store/) for more information on how to install and use the plugins.

## Plugins

Currently, the following plugins are available:
Expand All @@ -19,10 +23,6 @@ Currently, the following plugins are available:
| [tauri-plugin-svelte](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-svelte) | [![npm](https://img.shields.io/npm/v/tauri-plugin-svelte.svg)](https://www.npmjs.com/package/tauri-plugin-svelte) | Svelte |
| [tauri-plugin-valtio](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-valtio) | [![npm](https://img.shields.io/npm/v/tauri-plugin-valtio.svg)](https://www.npmjs.com/package/tauri-plugin-valtio) | React |

## Documentation

Check the [documentation](https://tb.dev.br/tauri-store/) for more information on how to install and use the plugins.

## Supported Tauri Version

The plugins require Tauri `2.0` or later.
2 changes: 1 addition & 1 deletion crates/tauri-store-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tauri-store-utils"
description = "Utilities for the Tauri store"
version = "0.2.0"
version = "0.2.1"
documentation = "https://docs.rs/tauri-store-utils"
homepage = "https://tb.dev.br/tauri-store"
repository = "https://github.com/ferreira-tb/tauri-store"
Expand Down
8 changes: 4 additions & 4 deletions crates/tauri-store-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Persistent stores for Tauri.
- Debounce or throttle store updates.
- Access the stores from both JavaScript and Rust.

## Documentation

Check the [documentation](https://tb.dev.br/tauri-store/) for more information on how to install and use the plugins.

## Plugins

Currently, the following plugins are available:
Expand All @@ -19,10 +23,6 @@ Currently, the following plugins are available:
| [tauri-plugin-svelte](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-svelte) | [![npm](https://img.shields.io/npm/v/tauri-plugin-svelte.svg)](https://www.npmjs.com/package/tauri-plugin-svelte) | Svelte |
| [tauri-plugin-valtio](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-valtio) | [![npm](https://img.shields.io/npm/v/tauri-plugin-valtio.svg)](https://www.npmjs.com/package/tauri-plugin-valtio) | React |

## Documentation

Check the [documentation](https://tb.dev.br/tauri-store/) for more information on how to install and use the plugins.

## Supported Tauri Version

The plugins require Tauri `2.0` or later.
4 changes: 2 additions & 2 deletions crates/tauri-store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "tauri-store"
description = "Persistent stores for Tauri"
version = "0.7.1"
version = "0.7.2"
documentation = "https://docs.rs/tauri-store"
homepage = "https://tb.dev.br/tauri-store"
repository = "https://github.com/ferreira-tb/tauri-store"
authors = ["Andrew Ferreira <[email protected]>"]
license = "MIT"
readme = "./README.md"
keywords = ["tauri", "plugin", "store"]
keywords = ["plugin", "store", "tauri"]

[package.edition]
workspace = true
Expand Down
8 changes: 4 additions & 4 deletions crates/tauri-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Persistent stores for Tauri.
- Debounce or throttle store updates.
- Access the stores from both JavaScript and Rust.

## Documentation

Check the [documentation](https://tb.dev.br/tauri-store/) for more information on how to install and use the plugins.

## Plugins

Currently, the following plugins are available:
Expand All @@ -19,10 +23,6 @@ Currently, the following plugins are available:
| [tauri-plugin-svelte](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-svelte) | [![npm](https://img.shields.io/npm/v/tauri-plugin-svelte.svg)](https://www.npmjs.com/package/tauri-plugin-svelte) | Svelte |
| [tauri-plugin-valtio](https://tb.dev.br/tauri-store/guide/getting-started?plugin=tauri-plugin-valtio) | [![npm](https://img.shields.io/npm/v/tauri-plugin-valtio.svg)](https://www.npmjs.com/package/tauri-plugin-valtio) | React |

## Documentation

Check the [documentation](https://tb.dev.br/tauri-store/) for more information on how to install and use the plugins.

## Supported Tauri Version

The plugins require Tauri `2.0` or later.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.17.1",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tb-dev/utils": "^4.1.3",
"@tb-dev/utils": "^4.1.5",
"@types/semver": "^7.5.8",
"autoprefixer": "^10.4.20",
"bits-ui": "1.0.0-next.90",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { npm } from '$lib/url';
import { NPM_SHARED } from '$lib/url';
import { Link } from '$components/link';
import { Changelog } from '$components/container';
Expand All @@ -10,6 +10,6 @@

<Changelog.Dependencies {version}>
<ul>
<li>Update <Link href={npm.shared} code>@tauri-store/shared</Link>.</li>
<li>Update <Link href={NPM_SHARED} code>@tauri-store/shared</Link>.</li>
</ul>
</Changelog.Dependencies>
4 changes: 2 additions & 2 deletions docs/src/content/changelog/tauri-plugin-pinia/v1/1.1.1.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { npm } from '$lib/url';
import { NPM_SHARED } from '$lib/url';
import { Link } from '$components/link';
import { Changelog } from '$components/container';
Expand All @@ -10,6 +10,6 @@

<Changelog.Dependencies {version}>
<ul>
<li>Update <Link href={npm.shared} code>@tauri-store/shared</Link> to <code>0.4.1</code>.</li>
<li>Update <Link href={NPM_SHARED} code>@tauri-store/shared</Link> to <code>0.4.1</code>.</li>
</ul>
</Changelog.Dependencies>
21 changes: 21 additions & 0 deletions docs/src/content/changelog/tauri-plugin-pinia/v1/1.2.0.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script lang="ts">
import { Ext } from '$components/link';
import { Changelog } from '$components/container';
const version = '1.2.0';
// prettier-ignore
const url = {
hooks: 'https://tb.dev.br/tauri-store/reference/tauri-plugin-pinia/interfaces/StoreHooks.html',
onError: 'https://tb.dev.br/tauri-store/reference/tauri-plugin-pinia/interfaces/StoreFrontendOptions.html#onerror',
};
</script>

<Changelog.Version {version} />

<Changelog.Features {version}>
<ul>
<li>Deprecate <Ext href={url.onError} code>StoreFrontendOptions.onError</Ext>.</li>
<li>Add <Ext href={url.hooks} code>StoreHooks</Ext> to the plugin options.</li>
</ul>
</Changelog.Features>
Loading

0 comments on commit ddaccc7

Please sign in to comment.