Skip to content

Commit

Permalink
Merge pull request #23 from ferreira-tb:next
Browse files Browse the repository at this point in the history
BREAKING CHANGE: rename `async-pinia` feature to `unstable-async`
  • Loading branch information
ferreira-tb authored Sep 26, 2024
2 parents ef8a408 + b7864b0 commit f2e98e5
Show file tree
Hide file tree
Showing 107 changed files with 2,905 additions and 1,898 deletions.
104 changes: 52 additions & 52 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
name: Deploy docs

on:
push:
branches: [main]

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
run_install: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Setup Pages
uses: actions/configure-pages@v4

- run: |
pnpm run build:docs
touch packages/docs/.vitepress/dist/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: packages/docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
name: Deploy docs

on:
push:
branches: [main]

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
run_install: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Setup Pages
uses: actions/configure-pages@v4

- run: |
pnpm run build:docs
touch docs/.vitepress/dist/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
33 changes: 0 additions & 33 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .husky/pre-commit

This file was deleted.

7 changes: 1 addition & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
"recommendations": [
"dbaeumer.vscode-eslint",
"vivaxy.vscode-conventional-commits",
"tamasfe.even-better-toml",
"donjayamanne.githistory",
"github.vscode-pull-request-github",
"esbenp.prettier-vscode",
"rust-lang.rust-analyzer",
"tauri-apps.tauri-vscode",
"vscode-icons-team.vscode-icons",
"redhat.vscode-yaml"
"tauri-apps.tauri-vscode"
]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
"githubPullRequests.defaultMergeMethod": "squash",
"prettier.requireConfig": true,
"typescript.tsdk": "node_modules\\typescript\\lib"
}
}
5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
[workspace]
members = ["plugin", "packages/playground/src-tauri"]
members = ["crates/*", "examples/pinia/src-tauri"]
resolver = "2"

[workspace.package]
edition = "2021"
rust-version = "1.71"

[workspace.lints.rust]
async_fn_in_trait = "allow"

[workspace.lints.clippy]
clone_on_ref_ptr = "deny"
filetype_is_file = "deny"
Expand Down
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
# tauri-plugin-pinia
# tauri-store

Persistent Pinia stores for Tauri and Vue.
Persistent stores for Tauri.

## Features

- Save your Pinia stores to disk.
- Synchronize your stores across multiple windows.
- Save your stores to disk.
- Synchronize across multiple windows.
- Debounce store updates.

## Documentation

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

## Supported Tauri Version

This plugin requires Tauri `2.0.0-rc` or later.
23 changes: 8 additions & 15 deletions plugin/Cargo.toml → crates/tauri-plugin-pinia/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "tauri-plugin-pinia"
description = "Persistent Pinia stores for Tauri"
version = "0.5.1"
version = "0.6.0"
documentation = "https://docs.rs/tauri-plugin-pinia"
homepage = "https://tb.dev.br/tauri-plugin-pinia"
repository = "https://github.com/ferreira-tb/tauri-plugin-pinia"
authors = ["Andrew Ferreira <[email protected]>"]
license = "MIT"
readme = "../README.md"
readme = "./README.md"
keywords = ["plugin", "tauri", "tauri-plugin", "vue", "pinia"]
links = "tauri-plugin-pinia"

Expand All @@ -19,7 +19,7 @@ workspace = true

[package.metadata.docs.rs]
no-default-features = true
features = ["async-pinia"]
features = ["unstable-async"]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

Expand All @@ -36,22 +36,15 @@ thiserror = "1.0"
version = "0.8"
optional = true

[dependencies.tracing]
[dependencies.tauri-store]
version = "0.1"
optional = true

[dependencies.tokio]
version = "1.39"
optional = true
default-features = false
features = ["fs", "io-util", "time"]
path = "../tauri-store"
features = ["derive"]

[build-dependencies.tauri-plugin]
version = "2.0.0-rc"
features = ["build"]

[features]
async-pinia = ["tokio"]
ahash = ["dep:ahash", "ahash/serde"]
tracing = ["dep:tracing"]
tokio = ["dep:tokio"]
unstable-async = ["tauri-store/unstable-async"]
ahash = ["tauri-store/ahash", "dep:ahash", "ahash/serde"]
17 changes: 17 additions & 0 deletions crates/tauri-plugin-pinia/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# tauri-plugin-pinia

Persistent Pinia stores for Tauri and Vue.

## Features

- Save your stores to disk.
- Synchronize across multiple windows.
- Debounce store updates.

## Documentation

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

## Supported Tauri Version

This plugin requires Tauri `2.0.0-rc` or later.
20 changes: 20 additions & 0 deletions crates/tauri-plugin-pinia/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const COMMANDS: &[&str] = &[
"clear_autosave",
"disable_sync",
"enable_sync",
"get_pinia_path",
"get_store_ids",
"get_store_path",
"get_store_state",
"load",
"patch",
"save",
"save_all",
"save_some",
"set_autosave",
"unload",
];

fn main() {
tauri_plugin::Builder::new(COMMANDS).build();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!

"$schema" = "../../schemas/schema.json"

[[permission]]
identifier = "allow-clear-autosave"
description = "Enables the clear_autosave command without any pre-configured scope."
commands.allow = ["clear_autosave"]

[[permission]]
identifier = "deny-clear-autosave"
description = "Denies the clear_autosave command without any pre-configured scope."
commands.deny = ["clear_autosave"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!

"$schema" = "../../schemas/schema.json"

[[permission]]
identifier = "allow-disable-sync"
description = "Enables the disable_sync command without any pre-configured scope."
commands.allow = ["disable_sync"]

[[permission]]
identifier = "deny-disable-sync"
description = "Denies the disable_sync command without any pre-configured scope."
commands.deny = ["disable_sync"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!

"$schema" = "../../schemas/schema.json"

[[permission]]
identifier = "allow-enable-sync"
description = "Enables the enable_sync command without any pre-configured scope."
commands.allow = ["enable_sync"]

[[permission]]
identifier = "deny-enable-sync"
description = "Denies the enable_sync command without any pre-configured scope."
commands.deny = ["enable_sync"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!

"$schema" = "../../schemas/schema.json"

[[permission]]
identifier = "allow-get-pinia-path"
description = "Enables the get_pinia_path command without any pre-configured scope."
commands.allow = ["get_pinia_path"]

[[permission]]
identifier = "deny-get-pinia-path"
description = "Denies the get_pinia_path command without any pre-configured scope."
commands.deny = ["get_pinia_path"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!

"$schema" = "../../schemas/schema.json"

[[permission]]
identifier = "allow-get-store-ids"
description = "Enables the get_store_ids command without any pre-configured scope."
commands.allow = ["get_store_ids"]

[[permission]]
identifier = "deny-get-store-ids"
description = "Denies the get_store_ids command without any pre-configured scope."
commands.deny = ["get_store_ids"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!

"$schema" = "../../schemas/schema.json"

[[permission]]
identifier = "allow-get-store-path"
description = "Enables the get_store_path command without any pre-configured scope."
commands.allow = ["get_store_path"]

[[permission]]
identifier = "deny-get-store-path"
description = "Denies the get_store_path command without any pre-configured scope."
commands.deny = ["get_store_path"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!

"$schema" = "../../schemas/schema.json"

[[permission]]
identifier = "allow-get-store-state"
description = "Enables the get_store_state command without any pre-configured scope."
commands.allow = ["get_store_state"]

[[permission]]
identifier = "deny-get-store-state"
description = "Denies the get_store_state command without any pre-configured scope."
commands.deny = ["get_store_state"]
Loading

0 comments on commit f2e98e5

Please sign in to comment.