Skip to content

Commit

Permalink
Merge pull request #1 from tonymushah/Repo-Setup
Browse files Browse the repository at this point in the history
Repo Setup
  • Loading branch information
tonymushah authored Dec 4, 2023
2 parents 722fba5 + 44453b2 commit ecc7fde
Show file tree
Hide file tree
Showing 33 changed files with 340 additions and 484 deletions.
10 changes: 5 additions & 5 deletions .changes/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"gitSiteUrl": "https://www.github.com/your-org/tauri-plugin-graphql/",
"gitSiteUrl": "https://www.github.com/tonymushah/mizuki",
"pkgManagers": {
"rust": {
"version": true,
Expand Down Expand Up @@ -65,14 +65,14 @@
}
},
"packages": {
"tauri-plugin-graphql": {
"mizuki": {
"path": ".",
"manager": "rust"
},
"tauri-plugin-graphql-urql": {
"@mizuki/urql": {
"path": "packages/urql",
"manager": "javascript",
"dependencies": ["tauri-plugin-graphql"]
"dependencies": ["mizuki"]
}
}
}
}
16 changes: 0 additions & 16 deletions .changes/readme.md

This file was deleted.

5 changes: 0 additions & 5 deletions .github/FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/audit-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
${{ runner.os }}-
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
- uses: pnpm/action-setup@v2.2.4
with:
run_install: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/covector-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '14'
node-version: '18'
- uses: pnpm/action-setup@v2.2.4
with:
run_install: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions-rs/toolchain@v1
Expand All @@ -25,9 +25,9 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '14'
node-version: '18'
- uses: pnpm/action-setup@v2.2.4
with:
run_install: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/format-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
audit-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '14'
node-version: '18'
- uses: pnpm/action-setup@v2.2.4
with:
run_install: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/format-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Install rustfmt with nightly toolchain
- uses: actions/checkout@v4
- name: Install rustfmt with stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
audit-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '14'
node-version: '18'
- uses: pnpm/action-setup@v2.2.4
with:
run_install: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install webkit2gtk
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
71 changes: 0 additions & 71 deletions CHANGELOG.md

This file was deleted.

6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mizuki"
version = "0.1.0"
authors = [ "tonymushah <tonymushahDev06@yahoo.com>" ]
authors = [ "Jonas Kruckenberg", "tonymushah <tonymushahDev06@yahoo.com>" ]
description = "A toolkit for building Tauri Plugins that enables type-safe IPC through GraphQL."
edition = "2021"
rust-version = "1.59"
Expand All @@ -11,9 +11,6 @@ repository = "https://github.com/tonymushah/mizuki"
categories = [ "gui", "web-programming" ]
keywords = [ "tauri-plugin", "graphql" ]

[package.metadata.docs.rs]
features = [ "graphiql" ]

[dependencies]
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
Expand All @@ -22,7 +19,6 @@ async-graphql = "6"

[features]
log = [ "async-graphql/log" ]
tracing = [ "async-graphql/tracing" ]
opentelemetry = [ "async-graphql/opentelemetry" ]
bson = [ "async-graphql/bson" ]
chrono = [ "async-graphql/chrono" ]
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Jonas Kruckenberg
Copyright (c) 2023 Tony Mushah

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
# Tauri Plugin graphql
# Mizuki

[![Crates.io][crates-badge]][crates-url]
[![Documentation][docs-badge]][docs-url]
[![MIT licensed][mit-badge]][mit-url]

[crates-badge]: https://img.shields.io/crates/v/tauri-plugin-graphql.svg
[crates-url]: https://crates.io/crates/tauri-plugin-graphql
[docs-badge]: https://img.shields.io/docsrs/tauri-plugin-graphql.svg
[docs-url]: https://docs.rs/tauri-plugin-graphql
[crates-badge]: https://img.shields.io/crates/v/mizuki.svg
[crates-url]: https://crates.io/crates/mizuki
[docs-badge]: https://img.shields.io/docsrs/mizuki.svg
[docs-url]: https://docs.rs/mizuki
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[mit-url]: LICENSE

A plugin for Tauri that enables type-safe IPC through GraphQL.
A toolkit for building Tauri plugins that enables type-safe IPC through GraphQL.

## Notice

This project is a fork from [JonasKruckenberg/tauri-plugin-graphql][initial-repo].

But I thought that it would be a great a idea to push the plugin futher
and create a toolkit for building GraphQL Tauri Plugins.

## Install

### Rust

```toml
[dependencies]
tauri-plugin-graphql = "2.0.0"
mizuki = "0.1.0"
```

### JavaScript

The only client-side adapter currently is `tauri-plugin-graphql-urql`, a custom exchange for [`urql`].
The only client-side adapter currently is `@mizuki/urql`, a custom exchange for [`urql`].
If you need adapters for other GraphQL clients, open a PR!

| Package | Version (click for changelogs) |
|-------------------------------|--------------------------------|
| [`tauri-plugin-graphql-urql`] | [![urql adapter version][urql-adapter-version-badge]][urql-adapter-changelog]
| [`@mizuki/urql`] | [![urql adapter version][urql-adapter-version-badge]][urql-adapter-changelog]

## Usage

Expand Down Expand Up @@ -75,7 +82,8 @@ fn main() {
);

tauri::Builder::default()
.plugin(tauri_plugin_graphql::init(schema))
// The plugin name is required
.plugin(mizuki::MizukiPlugin::new("todo-plugin", schema))
.run(tauri::generate_context!())
.expect("failed to run app");
}
Expand All @@ -91,10 +99,11 @@ PRs are welcome!

## License

[MIT © Jonas Kruckenberg](./LICENSE)
[MIT © Tony Mushah](./LICENSE)

[`tauri-plugin-graphql-urql`]: packages/urql
[urql-adapter-version-badge]: https://img.shields.io/npm/v/tauri-plugin-graphql-urql?label=%20
[`@mizuki/urql`]: packages/urql
[urql-adapter-version-badge]: https://img.shields.io/npm/v/@mizuki/urql?label=%20
[urql-adapter-changelog]: packages/urql/CHANGELOG.md
[`urql`]: https://formidable.com/open-source/urql/
[`async_graphql::Schema`]: https://docs.rs/async-graphql/latest/async_graphql/struct.Schema.html
[initial-repo]: https://github.com/JonasKruckenberg/tauri-plugin-graphql
12 changes: 6 additions & 6 deletions examples/preact-app/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodegenConfig } from '@graphql-codegen/cli';
import {CodegenConfig} from '@graphql-codegen/cli'

const config: CodegenConfig = {
schema: './myschema.graphqls',
Expand All @@ -7,9 +7,9 @@ const config: CodegenConfig = {
generates: {
'./src/gql/': {
preset: 'client',
plugins: [],
},
},
};
plugins: []
}
}
}

export default config;
export default config
5 changes: 4 additions & 1 deletion examples/preact-app/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ impl Subscription {
}

fn main() {
let my_plugin = mizuki::Mizuki::new("mizuki-test", Schema::new(Query, EmptyMutation, Subscription));
let my_plugin = mizuki::MizukiPlugin::new(
"mizuki-test",
Schema::new(Query, EmptyMutation, Subscription),
);
my_plugin.export_sdl("../myschema.graphqls").unwrap();
tauri::Builder::default()
.plugin(my_plugin)
Expand Down
Loading

0 comments on commit ecc7fde

Please sign in to comment.