diff --git a/.claude-context.md b/.claude-context.md
index 2ca845f7..94a20862 100644
--- a/.claude-context.md
+++ b/.claude-context.md
@@ -1,9 +1,11 @@
# Claude Context: Detaching Tauri from Yaak
## Goal
+
Make Yaak runnable as a standalone CLI without Tauri as a dependency. The core Rust crates in `crates/` should be usable independently, while Tauri-specific code lives in `crates-tauri/`.
## Project Structure
+
```
crates/ # Core crates - should NOT depend on Tauri
crates-tauri/ # Tauri-specific crates (yaak-app, yaak-tauri-utils, etc.)
@@ -13,11 +15,13 @@ crates-cli/ # CLI crate (yaak-cli)
## Completed Work
### 1. Folder Restructure
+
- Moved Tauri-dependent app code to `crates-tauri/yaak-app/`
- Created `crates-tauri/yaak-tauri-utils/` for shared Tauri utilities (window traits, api_client, error handling)
- Created `crates-cli/yaak-cli/` for the standalone CLI
### 2. Decoupled Crates (no longer depend on Tauri)
+
- **yaak-models**: Uses `init_standalone()` pattern for CLI database access
- **yaak-http**: Removed Tauri plugin, HttpConnectionManager initialized in yaak-app setup
- **yaak-common**: Only contains Tauri-free utilities (serde, platform)
@@ -25,6 +29,7 @@ crates-cli/ # CLI crate (yaak-cli)
- **yaak-grpc**: Replaced AppHandle with GrpcConfig struct, uses tokio::process::Command instead of Tauri sidecar
### 3. CLI Implementation
+
- Basic CLI at `crates-cli/yaak-cli/src/main.rs`
- Commands: workspaces, requests, send (by ID), get (ad-hoc URL), create
- Uses same database as Tauri app via `yaak_models::init_standalone()`
@@ -32,12 +37,14 @@ crates-cli/ # CLI crate (yaak-cli)
## Remaining Work
### Crates Still Depending on Tauri (in `crates/`)
+
1. **yaak-git** (3 files) - Moderate complexity
2. **yaak-plugins** (13 files) - **Hardest** - deeply integrated with Tauri for plugin-to-window communication
3. **yaak-sync** (4 files) - Moderate complexity
4. **yaak-ws** (5 files) - Moderate complexity
### Pattern for Decoupling
+
1. Remove Tauri plugin `init()` function from the crate
2. Move commands to `yaak-app/src/commands.rs` or keep inline in `lib.rs`
3. Move extension traits (e.g., `SomethingManagerExt`) to yaak-app or yaak-tauri-utils
@@ -47,6 +54,7 @@ crates-cli/ # CLI crate (yaak-cli)
7. Replace `tauri::async_runtime::block_on` with `tokio::runtime::Handle::current().block_on()`
## Key Files
+
- `crates-tauri/yaak-app/src/lib.rs` - Main Tauri app, setup block initializes managers
- `crates-tauri/yaak-app/src/commands.rs` - Migrated Tauri commands
- `crates-tauri/yaak-app/src/models_ext.rs` - Database plugin and extension traits
@@ -54,9 +62,11 @@ crates-cli/ # CLI crate (yaak-cli)
- `crates/yaak-models/src/lib.rs` - Contains `init_standalone()` for CLI usage
## Git Branch
+
Working on `detach-tauri` branch.
## Recent Commits
+
```
c40cff40 Remove Tauri dependencies from yaak-crypto and yaak-grpc
df495f1d Move Tauri utilities from yaak-common to yaak-tauri-utils
@@ -67,6 +77,7 @@ e718a5f1 Refactor models_ext to use init_standalone from yaak-models
```
## Testing
+
- Run `cargo check -p ` to verify a crate builds without Tauri
- Run `npm run app-dev` to test the Tauri app still works
- Run `cargo run -p yaak-cli -- --help` to test the CLI
diff --git a/.claude/commands/release/generate-release-notes.md b/.claude/commands/release/generate-release-notes.md
index 97fba5bc..a2e98b4a 100644
--- a/.claude/commands/release/generate-release-notes.md
+++ b/.claude/commands/release/generate-release-notes.md
@@ -8,7 +8,7 @@ Generate formatted release notes for Yaak releases by analyzing git history and
## What to do
1. Identifies the version tag and previous version
-2. Retrieves all commits between versions
+2. Retrieves all commits between versions
- If the version is a beta version, it retrieves commits between the beta version and previous beta version
- If the version is a stable version, it retrieves commits between the stable version and the previous stable version
3. Fetches PR descriptions for linked issues to find:
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index dd84ea78..9b77ea71 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,10 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
-title: ''
-labels: ''
-assignees: ''
-
+title: ""
+labels: ""
+assignees: ""
---
**Describe the bug**
@@ -12,6 +11,7 @@ A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
+
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- - OS: [e.g. iOS]
- - Browser [e.g. chrome, safari]
- - Version [e.g. 22]
+
+- OS: [e.g. iOS]
+- Browser [e.g. chrome, safari]
+- Version [e.g. 22]
**Smartphone (please complete the following information):**
- - Device: [e.g. iPhone6]
- - OS: [e.g. iOS8.1]
- - Browser [e.g. stock browser, safari]
- - Version [e.g. 22]
+
+- Device: [e.g. iPhone6]
+- OS: [e.g. iOS8.1]
+- Browser [e.g. stock browser, safari]
+- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 33c88d65..7286aa20 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -11,6 +11,7 @@
- [ ] I added or updated tests when reasonable.
Approved feedback item (required if not a bug fix or small-scope improvement):
+
## Related
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3797737b..55216e09 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- uses: voidzero-dev/setup-vp@v1
with:
- node-version: '24'
+ node-version: "24"
cache: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml
index d300267f..9471a059 100644
--- a/.github/workflows/claude.yml
+++ b/.github/workflows/claude.yml
@@ -47,4 +47,3 @@ jobs:
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'
-
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 32d62a7a..3a6f695f 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -53,7 +53,7 @@ jobs:
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
- node-version: '24'
+ node-version: "24"
cache: true
- name: install Rust stable
diff --git a/.github/workflows/sponsors.yml b/.github/workflows/sponsors.yml
index 457565e8..008b34c8 100644
--- a/.github/workflows/sponsors.yml
+++ b/.github/workflows/sponsors.yml
@@ -16,23 +16,23 @@ jobs:
uses: JamesIves/github-sponsors-readme-action@v1
with:
token: ${{ secrets.SPONSORS_PAT }}
- file: 'README.md'
+ file: "README.md"
maximum: 1999
template: '
'
active-only: false
include-private: true
- marker: 'sponsors-base'
+ marker: "sponsors-base"
- name: Generate Sponsors
uses: JamesIves/github-sponsors-readme-action@v1
with:
token: ${{ secrets.SPONSORS_PAT }}
- file: 'README.md'
+ file: "README.md"
minimum: 2000
template: '
'
active-only: false
include-private: true
- marker: 'sponsors-premium'
+ marker: "sponsors-premium"
# ⚠️ Note: You can use any deployment step here to automatically push the README
# changes back to your branch.
@@ -41,4 +41,4 @@ jobs:
with:
branch: main
force: false
- folder: '.'
+ folder: "."
diff --git a/.oxfmtignore b/.oxfmtignore
new file mode 100644
index 00000000..7d38738a
--- /dev/null
+++ b/.oxfmtignore
@@ -0,0 +1,2 @@
+**/bindings/**
+crates/yaak-templates/pkg/**
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index bab062e5..b2b5eb73 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,3 +1,7 @@
{
- "recommendations": ["rust-lang.rust-analyzer", "bradlc.vscode-tailwindcss", "VoidZero.vite-plus-extension-pack"]
+ "recommendations": [
+ "rust-lang.rust-analyzer",
+ "bradlc.vscode-tailwindcss",
+ "VoidZero.vite-plus-extension-pack"
+ ]
}
diff --git a/Cargo.toml b/Cargo.toml
index ac0e884f..acd11e16 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,30 +1,30 @@
[workspace]
resolver = "2"
members = [
- "crates/yaak",
- # Shared crates (no Tauri dependency)
- "crates/yaak-core",
- "crates/yaak-common",
- "crates/yaak-crypto",
- "crates/yaak-git",
- "crates/yaak-grpc",
- "crates/yaak-http",
- "crates/yaak-models",
- "crates/yaak-plugins",
- "crates/yaak-sse",
- "crates/yaak-sync",
- "crates/yaak-templates",
- "crates/yaak-tls",
- "crates/yaak-ws",
- "crates/yaak-api",
- # CLI crates
- "crates-cli/yaak-cli",
- # Tauri-specific crates
- "crates-tauri/yaak-app",
- "crates-tauri/yaak-fonts",
- "crates-tauri/yaak-license",
- "crates-tauri/yaak-mac-window",
- "crates-tauri/yaak-tauri-utils",
+ "crates/yaak",
+ # Shared crates (no Tauri dependency)
+ "crates/yaak-core",
+ "crates/yaak-common",
+ "crates/yaak-crypto",
+ "crates/yaak-git",
+ "crates/yaak-grpc",
+ "crates/yaak-http",
+ "crates/yaak-models",
+ "crates/yaak-plugins",
+ "crates/yaak-sse",
+ "crates/yaak-sync",
+ "crates/yaak-templates",
+ "crates/yaak-tls",
+ "crates/yaak-ws",
+ "crates/yaak-api",
+ # CLI crates
+ "crates-cli/yaak-cli",
+ # Tauri-specific crates
+ "crates-tauri/yaak-app",
+ "crates-tauri/yaak-fonts",
+ "crates-tauri/yaak-license",
+ "crates-tauri/yaak-mac-window",
+ "crates-tauri/yaak-tauri-utils",
]
[workspace.dependencies]
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 77ba2cf9..cf5683a2 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -1,24 +1,26 @@
# Developer Setup
-Yaak is a combined Node.js and Rust monorepo. It is a [Tauri](https://tauri.app) project, so
+Yaak is a combined Node.js and Rust monorepo. It is a [Tauri](https://tauri.app) project, so
uses Rust and HTML/CSS/JS for the main application but there is also a plugin system powered
by a Node.js sidecar that communicates to the app over gRPC.
-Because of the moving parts, there are a few setup steps required before development can
+Because of the moving parts, there are a few setup steps required before development can
begin.
## Prerequisites
Make sure you have the following tools installed:
-- [Node.js](https://nodejs.org/en/download/package-manager)
+- [Node.js](https://nodejs.org/en/download/package-manager) (v24+)
- [Rust](https://www.rust-lang.org/tools/install)
+- [Vite+](https://vite.dev/guide/vite-plus) (`vp` CLI)
Check the installations with the following commands:
```shell
node -v
npm -v
+vp --version
rustc --version
```
@@ -45,12 +47,12 @@ npm start
## SQLite Migrations
New migrations can be created from the `src-tauri/` directory:
-
+
```shell
npm run migration
```
-Rerun the app to apply the migrations.
+Rerun the app to apply the migrations.
_Note: For safety, development builds use a separate database location from production builds._
@@ -61,9 +63,9 @@ _Note: For safety, development builds use a separate database location from prod
lezer-generator components/core/Editor//.grammar > components/core/Editor//.ts
```
-## Linting & Formatting
+## Linting and Formatting
-This repo uses Biome for linting and formatting (replacing ESLint + Prettier).
+This repo uses [Vite+](https://vite.dev/guide/vite-plus) for linting (oxlint) and formatting (oxfmt).
- Lint the entire repo:
@@ -71,12 +73,6 @@ This repo uses Biome for linting and formatting (replacing ESLint + Prettier).
npm run lint
```
-- Auto-fix lint issues where possible:
-
-```sh
-npm run lint:fix
-```
-
- Format code:
```sh
@@ -84,5 +80,7 @@ npm run format
```
Notes:
-- Many workspace packages also expose the same scripts (`lint`, `lint:fix`, and `format`).
-- TypeScript type-checking still runs separately via `tsc --noEmit` in relevant packages.
+
+- A pre-commit hook runs `vp lint` automatically on commit.
+- Some workspace packages also run `tsc --noEmit` for type-checking.
+- VS Code users should install the recommended extensions for format-on-save support.
diff --git a/README.md b/README.md
index 3533a39a..b60f8769 100644
--- a/README.md
+++ b/README.md
@@ -16,8 +16,6 @@
-
-
@@ -27,12 +25,10 @@

-
## Features
-Yaak is an offline-first API client designed to stay out of your way while giving you everything you need when you need it.
-Built with [Tauri](https://tauri.app), Rust, and React, it’s fast, lightweight, and private. No telemetry, no VC funding, and no cloud lock-in.
-
+Yaak is an offline-first API client designed to stay out of your way while giving you everything you need when you need it.
+Built with [Tauri](https://tauri.app), Rust, and React, it’s fast, lightweight, and private. No telemetry, no VC funding, and no cloud lock-in.
### 🌐 Work with any API
@@ -41,21 +37,23 @@ Built with [Tauri](https://tauri.app), Rust, and React, it’s fast, lightweight
- Filter and inspect responses with JSONPath or XPath.
### 🔐 Stay secure
+
- Use OAuth 2.0, JWT, Basic Auth, or custom plugins for authentication.
-- Secure sensitive values with encrypted secrets.
+- Secure sensitive values with encrypted secrets.
- Store secrets in your OS keychain.
### ☁️ Organize & collaborate
+
- Group requests into workspaces and nested folders.
- Use environment variables to switch between dev, staging, and prod.
- Mirror workspaces to your filesystem for versioning in Git or syncing with Dropbox.
### 🧩 Extend & customize
+
- Insert dynamic values like UUIDs or timestamps with template tags.
- Pick from built-in themes or build your own.
- Create plugins to extend authentication, template tags, or the UI.
-
## Contribution Policy
> [!IMPORTANT]
diff --git a/crates-cli/yaak-cli/Cargo.toml b/crates-cli/yaak-cli/Cargo.toml
index 4c62578e..b3cb4b73 100644
--- a/crates-cli/yaak-cli/Cargo.toml
+++ b/crates-cli/yaak-cli/Cargo.toml
@@ -29,7 +29,14 @@ schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
sha2 = { workspace = true }
-tokio = { workspace = true, features = ["rt-multi-thread", "macros", "io-util", "net", "signal", "time"] }
+tokio = { workspace = true, features = [
+ "rt-multi-thread",
+ "macros",
+ "io-util",
+ "net",
+ "signal",
+ "time",
+] }
walkdir = "2"
webbrowser = "1"
zip = "4"
diff --git a/crates-cli/yaak-cli/README.md b/crates-cli/yaak-cli/README.md
index 65f36868..32157e2d 100644
--- a/crates-cli/yaak-cli/README.md
+++ b/crates-cli/yaak-cli/README.md
@@ -1,6 +1,6 @@
# Yaak CLI
-The `yaak` CLI for publishing plugins and creating/updating/sending requests.
+The `yaak` CLI for publishing plugins and creating/updating/sending requests.
## Installation
@@ -24,8 +24,8 @@ Use the `yaak` CLI with agents like Claude or Codex to do useful things for you.
Here are some example prompts:
```text
-Scan my API routes and create a workspace (using yaak cli) with
-all the requests needed for me to do manual testing?
+Scan my API routes and create a workspace (using yaak cli) with
+all the requests needed for me to do manual testing?
```
```text
diff --git a/crates-tauri/yaak-app/Cargo.toml b/crates-tauri/yaak-app/Cargo.toml
index 06afbbc0..2212a585 100644
--- a/crates-tauri/yaak-app/Cargo.toml
+++ b/crates-tauri/yaak-app/Cargo.toml
@@ -35,7 +35,16 @@ r2d2 = "0.8.10"
r2d2_sqlite = "0.25.0"
mime_guess = "2.0.5"
rand = "0.9.0"
-reqwest = { workspace = true, features = ["multipart", "gzip", "brotli", "deflate", "json", "rustls-tls-manual-roots-no-provider", "socks", "http2"] }
+reqwest = { workspace = true, features = [
+ "multipart",
+ "gzip",
+ "brotli",
+ "deflate",
+ "json",
+ "rustls-tls-manual-roots-no-provider",
+ "socks",
+ "http2",
+] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, features = ["raw_value"] }
tauri = { workspace = true, features = ["devtools", "protocol-asset"] }
diff --git a/crates-tauri/yaak-app/capabilities/default.json b/crates-tauri/yaak-app/capabilities/default.json
index 684716e3..4ec64a82 100644
--- a/crates-tauri/yaak-app/capabilities/default.json
+++ b/crates-tauri/yaak-app/capabilities/default.json
@@ -1,9 +1,7 @@
{
"identifier": "default",
"description": "Default capabilities for all build variants",
- "windows": [
- "*"
- ],
+ "windows": ["*"],
"permissions": [
"core:app:allow-identifier",
"core:event:allow-emit",
diff --git a/crates-tauri/yaak-app/package.json b/crates-tauri/yaak-app/package.json
index bfdc28b6..1ade5450 100644
--- a/crates-tauri/yaak-app/package.json
+++ b/crates-tauri/yaak-app/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/tauri",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "bindings/index.ts"
}
diff --git a/crates-tauri/yaak-app/tauri.conf.json b/crates-tauri/yaak-app/tauri.conf.json
index 606c72d0..ca6a1c15 100644
--- a/crates-tauri/yaak-app/tauri.conf.json
+++ b/crates-tauri/yaak-app/tauri.conf.json
@@ -14,10 +14,7 @@
"assetProtocol": {
"enable": true,
"scope": {
- "allow": [
- "$APPDATA/responses/*",
- "$RESOURCE/static/*"
- ]
+ "allow": ["$APPDATA/responses/*", "$RESOURCE/static/*"]
}
}
}
@@ -25,9 +22,7 @@
"plugins": {
"deep-link": {
"desktop": {
- "schemes": [
- "yaak"
- ]
+ "schemes": ["yaak"]
}
}
},
diff --git a/crates-tauri/yaak-app/tauri.release.conf.json b/crates-tauri/yaak-app/tauri.release.conf.json
index 0f6151a0..bc91f894 100644
--- a/crates-tauri/yaak-app/tauri.release.conf.json
+++ b/crates-tauri/yaak-app/tauri.release.conf.json
@@ -16,9 +16,7 @@
},
"plugins": {
"updater": {
- "endpoints": [
- "https://update.yaak.app/check/{{target}}/{{arch}}/{{current_version}}"
- ],
+ "endpoints": ["https://update.yaak.app/check/{{target}}/{{arch}}/{{current_version}}"],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEVGRkFGMjQxRUNEOTQ3MzAKUldRd1I5bnNRZkw2NzRtMnRlWTN3R24xYUR3aGRsUjJzWGwvdHdEcGljb3ZJMUNlMjFsaHlqVU4K"
}
},
diff --git a/crates-tauri/yaak-fonts/index.ts b/crates-tauri/yaak-fonts/index.ts
index acb05258..7d227d0f 100644
--- a/crates-tauri/yaak-fonts/index.ts
+++ b/crates-tauri/yaak-fonts/index.ts
@@ -1,14 +1,14 @@
-import { useQuery } from '@tanstack/react-query';
-import { invoke } from '@tauri-apps/api/core';
-import { Fonts } from './bindings/gen_fonts';
+import { useQuery } from "@tanstack/react-query";
+import { invoke } from "@tauri-apps/api/core";
+import { Fonts } from "./bindings/gen_fonts";
export async function listFonts() {
- return invoke('plugin:yaak-fonts|list', {});
+ return invoke("plugin:yaak-fonts|list", {});
}
export function useFonts() {
return useQuery({
- queryKey: ['list_fonts'],
+ queryKey: ["list_fonts"],
queryFn: () => listFonts(),
});
}
diff --git a/crates-tauri/yaak-fonts/package.json b/crates-tauri/yaak-fonts/package.json
index 36cb741e..d84f0d9e 100644
--- a/crates-tauri/yaak-fonts/package.json
+++ b/crates-tauri/yaak-fonts/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/fonts",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/crates-tauri/yaak-license/index.ts b/crates-tauri/yaak-license/index.ts
index 7de30646..ec789fac 100644
--- a/crates-tauri/yaak-license/index.ts
+++ b/crates-tauri/yaak-license/index.ts
@@ -1,31 +1,31 @@
-import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
-import { invoke } from '@tauri-apps/api/core';
-import { listen } from '@tauri-apps/api/event';
-import { appInfo } from '@yaakapp/app/lib/appInfo';
-import { useEffect } from 'react';
-import { LicenseCheckStatus } from './bindings/license';
+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
+import { invoke } from "@tauri-apps/api/core";
+import { listen } from "@tauri-apps/api/event";
+import { appInfo } from "@yaakapp/app/lib/appInfo";
+import { useEffect } from "react";
+import { LicenseCheckStatus } from "./bindings/license";
-export * from './bindings/license';
+export * from "./bindings/license";
-const CHECK_QUERY_KEY = ['license.check'];
+const CHECK_QUERY_KEY = ["license.check"];
export function useLicense() {
const queryClient = useQueryClient();
const activate = useMutation({
- mutationKey: ['license.activate'],
- mutationFn: (payload) => invoke('plugin:yaak-license|activate', payload),
+ mutationKey: ["license.activate"],
+ mutationFn: (payload) => invoke("plugin:yaak-license|activate", payload),
onSuccess: () => queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY }),
});
const deactivate = useMutation({
- mutationKey: ['license.deactivate'],
- mutationFn: () => invoke('plugin:yaak-license|deactivate'),
+ mutationKey: ["license.deactivate"],
+ mutationFn: () => invoke("plugin:yaak-license|deactivate"),
onSuccess: () => queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY }),
});
// Check the license again after a license is activated
useEffect(() => {
- const unlisten = listen('license-activated', async () => {
+ const unlisten = listen("license-activated", async () => {
await queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY });
});
return () => {
@@ -41,7 +41,7 @@ export function useLicense() {
if (!appInfo.featureLicense) {
return null;
}
- return invoke('plugin:yaak-license|check');
+ return invoke("plugin:yaak-license|check");
},
});
diff --git a/crates-tauri/yaak-license/package.json b/crates-tauri/yaak-license/package.json
index c6c8d557..f3861900 100644
--- a/crates-tauri/yaak-license/package.json
+++ b/crates-tauri/yaak-license/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/license",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/crates-tauri/yaak-mac-window/index.ts b/crates-tauri/yaak-mac-window/index.ts
index 1d01c0c9..d2c98823 100644
--- a/crates-tauri/yaak-mac-window/index.ts
+++ b/crates-tauri/yaak-mac-window/index.ts
@@ -1,9 +1,9 @@
-import { invoke } from '@tauri-apps/api/core';
+import { invoke } from "@tauri-apps/api/core";
export function setWindowTitle(title: string) {
- invoke('plugin:yaak-mac-window|set_title', { title }).catch(console.error);
+ invoke("plugin:yaak-mac-window|set_title", { title }).catch(console.error);
}
export function setWindowTheme(bgColor: string) {
- invoke('plugin:yaak-mac-window|set_theme', { bgColor }).catch(console.error);
+ invoke("plugin:yaak-mac-window|set_theme", { bgColor }).catch(console.error);
}
diff --git a/crates-tauri/yaak-mac-window/package.json b/crates-tauri/yaak-mac-window/package.json
index e4f23426..2c4cda03 100644
--- a/crates-tauri/yaak-mac-window/package.json
+++ b/crates-tauri/yaak-mac-window/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/mac-window",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/crates-tauri/yaak-mac-window/permissions/default.toml b/crates-tauri/yaak-mac-window/permissions/default.toml
index 31b4fcf1..ea9b21cc 100644
--- a/crates-tauri/yaak-mac-window/permissions/default.toml
+++ b/crates-tauri/yaak-mac-window/permissions/default.toml
@@ -1,6 +1,3 @@
[default]
description = "Default permissions for the plugin"
-permissions = [
- "allow-set-title",
- "allow-set-theme",
-]
+permissions = ["allow-set-title", "allow-set-theme"]
diff --git a/crates/yaak-crypto/index.ts b/crates/yaak-crypto/index.ts
index 66f3910b..58179042 100644
--- a/crates/yaak-crypto/index.ts
+++ b/crates/yaak-crypto/index.ts
@@ -1,17 +1,17 @@
-import { invoke } from '@tauri-apps/api/core';
+import { invoke } from "@tauri-apps/api/core";
export function enableEncryption(workspaceId: string) {
- return invoke('cmd_enable_encryption', { workspaceId });
+ return invoke("cmd_enable_encryption", { workspaceId });
}
export function revealWorkspaceKey(workspaceId: string) {
- return invoke('cmd_reveal_workspace_key', { workspaceId });
+ return invoke("cmd_reveal_workspace_key", { workspaceId });
}
export function setWorkspaceKey(args: { workspaceId: string; key: string }) {
- return invoke('cmd_set_workspace_key', args);
+ return invoke("cmd_set_workspace_key", args);
}
export function disableEncryption(workspaceId: string) {
- return invoke('cmd_disable_encryption', { workspaceId });
+ return invoke("cmd_disable_encryption", { workspaceId });
}
diff --git a/crates/yaak-crypto/package.json b/crates/yaak-crypto/package.json
index 96b3d62c..585b375a 100644
--- a/crates/yaak-crypto/package.json
+++ b/crates/yaak-crypto/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/crypto",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/crates/yaak-git/index.ts b/crates/yaak-git/index.ts
index 559b1e5e..ae28fc56 100644
--- a/crates/yaak-git/index.ts
+++ b/crates/yaak-git/index.ts
@@ -1,60 +1,66 @@
-import { useQuery } from '@tanstack/react-query';
-import { invoke } from '@tauri-apps/api/core';
-import { createFastMutation } from '@yaakapp/app/hooks/useFastMutation';
-import { queryClient } from '@yaakapp/app/lib/queryClient';
-import { useMemo } from 'react';
-import { BranchDeleteResult, CloneResult, GitCommit, GitRemote, GitStatusSummary, PullResult, PushResult } from './bindings/gen_git';
-import { showToast } from '@yaakapp/app/lib/toast';
+import { useQuery } from "@tanstack/react-query";
+import { invoke } from "@tauri-apps/api/core";
+import { createFastMutation } from "@yaakapp/app/hooks/useFastMutation";
+import { queryClient } from "@yaakapp/app/lib/queryClient";
+import { useMemo } from "react";
+import {
+ BranchDeleteResult,
+ CloneResult,
+ GitCommit,
+ GitRemote,
+ GitStatusSummary,
+ PullResult,
+ PushResult,
+} from "./bindings/gen_git";
+import { showToast } from "@yaakapp/app/lib/toast";
-export * from './bindings/gen_git';
-export * from './bindings/gen_models';
+export * from "./bindings/gen_git";
+export * from "./bindings/gen_models";
export interface GitCredentials {
username: string;
password: string;
}
-export type DivergedStrategy = 'force_reset' | 'merge' | 'cancel';
+export type DivergedStrategy = "force_reset" | "merge" | "cancel";
-export type UncommittedChangesStrategy = 'reset' | 'cancel';
+export type UncommittedChangesStrategy = "reset" | "cancel";
export interface GitCallbacks {
addRemote: () => Promise;
promptCredentials: (
- result: Extract,
+ result: Extract,
) => Promise;
- promptDiverged: (
- result: Extract,
- ) => Promise;
+ promptDiverged: (result: Extract) => Promise;
promptUncommittedChanges: () => Promise;
forceSync: () => Promise;
}
-const onSuccess = () => queryClient.invalidateQueries({ queryKey: ['git'] });
+const onSuccess = () => queryClient.invalidateQueries({ queryKey: ["git"] });
export function useGit(dir: string, callbacks: GitCallbacks, refreshKey?: string) {
const mutations = useMemo(() => gitMutations(dir, callbacks), [dir, callbacks]);
const fetchAll = useQuery({
- queryKey: ['git', 'fetch_all', dir, refreshKey],
- queryFn: () => invoke('cmd_git_fetch_all', { dir }),
+ queryKey: ["git", "fetch_all", dir, refreshKey],
+ queryFn: () => invoke("cmd_git_fetch_all", { dir }),
refetchInterval: 10 * 60_000,
});
return [
{
remotes: useQuery({
- queryKey: ['git', 'remotes', dir, refreshKey],
+ queryKey: ["git", "remotes", dir, refreshKey],
queryFn: () => getRemotes(dir),
placeholderData: (prev) => prev,
}),
log: useQuery({
- queryKey: ['git', 'log', dir, refreshKey],
- queryFn: () => invoke('cmd_git_log', { dir }),
+ queryKey: ["git", "log", dir, refreshKey],
+ queryFn: () => invoke("cmd_git_log", { dir }),
placeholderData: (prev) => prev,
}),
status: useQuery({
refetchOnMount: true,
- queryKey: ['git', 'status', dir, refreshKey, fetchAll.dataUpdatedAt],
- queryFn: () => invoke('cmd_git_status', { dir }),
+ queryKey: ["git", "status", dir, refreshKey, fetchAll.dataUpdatedAt],
+ queryFn: () => invoke("cmd_git_status", { dir }),
placeholderData: (prev) => prev,
}),
},
@@ -67,151 +73,167 @@ export const gitMutations = (dir: string, callbacks: GitCallbacks) => {
const remotes = await getRemotes(dir);
if (remotes.length === 0) {
const remote = await callbacks.addRemote();
- if (remote == null) throw new Error('No remote found');
+ if (remote == null) throw new Error("No remote found");
}
- const result = await invoke('cmd_git_push', { dir });
- if (result.type !== 'needs_credentials') return result;
+ const result = await invoke("cmd_git_push", { dir });
+ if (result.type !== "needs_credentials") return result;
// Needs credentials, prompt for them
const creds = await callbacks.promptCredentials(result);
- if (creds == null) throw new Error('Canceled');
+ if (creds == null) throw new Error("Canceled");
- await invoke('cmd_git_add_credential', {
+ await invoke("cmd_git_add_credential", {
remoteUrl: result.url,
username: creds.username,
password: creds.password,
});
// Push again
- return invoke('cmd_git_push', { dir });
+ return invoke("cmd_git_push", { dir });
};
const handleError = (err: unknown) => {
showToast({
id: err instanceof Error ? err.message : String(err),
message: err instanceof Error ? err.message : String(err),
- color: 'danger',
+ color: "danger",
timeout: 5000,
});
- }
+ };
return {
init: createFastMutation({
- mutationKey: ['git', 'init'],
- mutationFn: () => invoke('cmd_git_initialize', { dir }),
+ mutationKey: ["git", "init"],
+ mutationFn: () => invoke("cmd_git_initialize", { dir }),
onSuccess,
}),
add: createFastMutation({
- mutationKey: ['git', 'add', dir],
- mutationFn: (args) => invoke('cmd_git_add', { dir, ...args }),
+ mutationKey: ["git", "add", dir],
+ mutationFn: (args) => invoke("cmd_git_add", { dir, ...args }),
onSuccess,
}),
addRemote: createFastMutation({
- mutationKey: ['git', 'add-remote'],
- mutationFn: (args) => invoke('cmd_git_add_remote', { dir, ...args }),
+ mutationKey: ["git", "add-remote"],
+ mutationFn: (args) => invoke("cmd_git_add_remote", { dir, ...args }),
onSuccess,
}),
rmRemote: createFastMutation({
- mutationKey: ['git', 'rm-remote', dir],
- mutationFn: (args) => invoke('cmd_git_rm_remote', { dir, ...args }),
+ mutationKey: ["git", "rm-remote", dir],
+ mutationFn: (args) => invoke("cmd_git_rm_remote", { dir, ...args }),
onSuccess,
}),
createBranch: createFastMutation({
- mutationKey: ['git', 'branch', dir],
- mutationFn: (args) => invoke('cmd_git_branch', { dir, ...args }),
+ mutationKey: ["git", "branch", dir],
+ mutationFn: (args) => invoke("cmd_git_branch", { dir, ...args }),
onSuccess,
}),
mergeBranch: createFastMutation({
- mutationKey: ['git', 'merge', dir],
- mutationFn: (args) => invoke('cmd_git_merge_branch', { dir, ...args }),
+ mutationKey: ["git", "merge", dir],
+ mutationFn: (args) => invoke("cmd_git_merge_branch", { dir, ...args }),
onSuccess,
}),
- deleteBranch: createFastMutation({
- mutationKey: ['git', 'delete-branch', dir],
- mutationFn: (args) => invoke('cmd_git_delete_branch', { dir, ...args }),
+ deleteBranch: createFastMutation<
+ BranchDeleteResult,
+ string,
+ { branch: string; force?: boolean }
+ >({
+ mutationKey: ["git", "delete-branch", dir],
+ mutationFn: (args) => invoke("cmd_git_delete_branch", { dir, ...args }),
onSuccess,
}),
deleteRemoteBranch: createFastMutation({
- mutationKey: ['git', 'delete-remote-branch', dir],
- mutationFn: (args) => invoke('cmd_git_delete_remote_branch', { dir, ...args }),
+ mutationKey: ["git", "delete-remote-branch", dir],
+ mutationFn: (args) => invoke("cmd_git_delete_remote_branch", { dir, ...args }),
onSuccess,
}),
- renameBranch: createFastMutation({
- mutationKey: ['git', 'rename-branch', dir],
- mutationFn: (args) => invoke('cmd_git_rename_branch', { dir, ...args }),
+ renameBranch: createFastMutation({
+ mutationKey: ["git", "rename-branch", dir],
+ mutationFn: (args) => invoke("cmd_git_rename_branch", { dir, ...args }),
onSuccess,
}),
checkout: createFastMutation({
- mutationKey: ['git', 'checkout', dir],
- mutationFn: (args) => invoke('cmd_git_checkout', { dir, ...args }),
+ mutationKey: ["git", "checkout", dir],
+ mutationFn: (args) => invoke("cmd_git_checkout", { dir, ...args }),
onSuccess,
}),
commit: createFastMutation({
- mutationKey: ['git', 'commit', dir],
- mutationFn: (args) => invoke('cmd_git_commit', { dir, ...args }),
+ mutationKey: ["git", "commit", dir],
+ mutationFn: (args) => invoke("cmd_git_commit", { dir, ...args }),
onSuccess,
}),
commitAndPush: createFastMutation({
- mutationKey: ['git', 'commit_push', dir],
+ mutationKey: ["git", "commit_push", dir],
mutationFn: async (args) => {
- await invoke('cmd_git_commit', { dir, ...args });
+ await invoke("cmd_git_commit", { dir, ...args });
return push();
},
onSuccess,
}),
push: createFastMutation({
- mutationKey: ['git', 'push', dir],
+ mutationKey: ["git", "push", dir],
mutationFn: push,
onSuccess,
}),
pull: createFastMutation({
- mutationKey: ['git', 'pull', dir],
+ mutationKey: ["git", "pull", dir],
async mutationFn() {
- const result = await invoke('cmd_git_pull', { dir });
+ const result = await invoke("cmd_git_pull", { dir });
- if (result.type === 'needs_credentials') {
+ if (result.type === "needs_credentials") {
const creds = await callbacks.promptCredentials(result);
- if (creds == null) throw new Error('Canceled');
+ if (creds == null) throw new Error("Canceled");
- await invoke('cmd_git_add_credential', {
+ await invoke("cmd_git_add_credential", {
remoteUrl: result.url,
username: creds.username,
password: creds.password,
});
// Pull again after credentials
- return invoke('cmd_git_pull', { dir });
+ return invoke("cmd_git_pull", { dir });
}
- if (result.type === 'uncommitted_changes') {
- void callbacks.promptUncommittedChanges().then(async (strategy) => {
- if (strategy === 'cancel') return;
+ if (result.type === "uncommitted_changes") {
+ void callbacks
+ .promptUncommittedChanges()
+ .then(async (strategy) => {
+ if (strategy === "cancel") return;
- await invoke('cmd_git_reset_changes', { dir });
- return invoke('cmd_git_pull', { dir });
- }).then(async () => { await onSuccess(); await callbacks.forceSync(); }, handleError);
+ await invoke("cmd_git_reset_changes", { dir });
+ return invoke("cmd_git_pull", { dir });
+ })
+ .then(async () => {
+ await onSuccess();
+ await callbacks.forceSync();
+ }, handleError);
}
- if (result.type === 'diverged') {
- void callbacks.promptDiverged(result).then((strategy) => {
- if (strategy === 'cancel') return;
+ if (result.type === "diverged") {
+ void callbacks
+ .promptDiverged(result)
+ .then((strategy) => {
+ if (strategy === "cancel") return;
- if (strategy === 'force_reset') {
- return invoke('cmd_git_pull_force_reset', {
+ if (strategy === "force_reset") {
+ return invoke("cmd_git_pull_force_reset", {
+ dir,
+ remote: result.remote,
+ branch: result.branch,
+ });
+ }
+
+ return invoke("cmd_git_pull_merge", {
dir,
remote: result.remote,
branch: result.branch,
});
- }
-
- return invoke('cmd_git_pull_merge', {
- dir,
- remote: result.remote,
- branch: result.branch,
- });
- }).then(async () => { await onSuccess(); await callbacks.forceSync(); }, handleError);
+ })
+ .then(async () => {
+ await onSuccess();
+ await callbacks.forceSync();
+ }, handleError);
}
return result;
@@ -219,20 +241,20 @@ export const gitMutations = (dir: string, callbacks: GitCallbacks) => {
onSuccess,
}),
unstage: createFastMutation({
- mutationKey: ['git', 'unstage', dir],
- mutationFn: (args) => invoke('cmd_git_unstage', { dir, ...args }),
+ mutationKey: ["git", "unstage", dir],
+ mutationFn: (args) => invoke("cmd_git_unstage", { dir, ...args }),
onSuccess,
}),
resetChanges: createFastMutation({
- mutationKey: ['git', 'reset-changes', dir],
- mutationFn: () => invoke('cmd_git_reset_changes', { dir }),
+ mutationKey: ["git", "reset-changes", dir],
+ mutationFn: () => invoke("cmd_git_reset_changes", { dir }),
onSuccess,
}),
} as const;
};
async function getRemotes(dir: string) {
- return invoke('cmd_git_remotes', { dir });
+ return invoke("cmd_git_remotes", { dir });
}
/**
@@ -241,21 +263,24 @@ async function getRemotes(dir: string) {
export async function gitClone(
url: string,
dir: string,
- promptCredentials: (args: { url: string; error: string | null }) => Promise,
+ promptCredentials: (args: {
+ url: string;
+ error: string | null;
+ }) => Promise,
): Promise {
- const result = await invoke('cmd_git_clone', { url, dir });
- if (result.type !== 'needs_credentials') return result;
+ const result = await invoke("cmd_git_clone", { url, dir });
+ if (result.type !== "needs_credentials") return result;
// Prompt for credentials
const creds = await promptCredentials({ url: result.url, error: result.error });
- if (creds == null) return {type: 'cancelled'};
+ if (creds == null) return { type: "cancelled" };
// Store credentials and retry
- await invoke('cmd_git_add_credential', {
+ await invoke("cmd_git_add_credential", {
remoteUrl: result.url,
username: creds.username,
password: creds.password,
});
- return invoke('cmd_git_clone', { url, dir });
+ return invoke("cmd_git_clone", { url, dir });
}
diff --git a/crates/yaak-git/package.json b/crates/yaak-git/package.json
index 2c5450b3..671fe49a 100644
--- a/crates/yaak-git/package.json
+++ b/crates/yaak-git/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/git",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/crates/yaak-http/Cargo.toml b/crates/yaak-http/Cargo.toml
index 34ebba4b..ece83bfa 100644
--- a/crates/yaak-http/Cargo.toml
+++ b/crates/yaak-http/Cargo.toml
@@ -19,7 +19,12 @@ hyper-util = { version = "0.1.17", default-features = false, features = ["client
log = { workspace = true }
mime_guess = "2.0.5"
regex = "1.11.1"
-reqwest = { workspace = true, features = ["rustls-tls-manual-roots-no-provider", "socks", "http2", "stream"] }
+reqwest = { workspace = true, features = [
+ "rustls-tls-manual-roots-no-provider",
+ "socks",
+ "http2",
+ "stream",
+] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
thiserror = { workspace = true }
diff --git a/crates/yaak-models/guest-js/atoms.ts b/crates/yaak-models/guest-js/atoms.ts
index da3ad730..b9dc3e18 100644
--- a/crates/yaak-models/guest-js/atoms.ts
+++ b/crates/yaak-models/guest-js/atoms.ts
@@ -1,35 +1,39 @@
-import { atom } from 'jotai';
+import { atom } from "jotai";
-import { selectAtom } from 'jotai/utils';
-import type { AnyModel } from '../bindings/gen_models';
-import { ExtractModel } from './types';
-import { newStoreData } from './util';
+import { selectAtom } from "jotai/utils";
+import type { AnyModel } from "../bindings/gen_models";
+import { ExtractModel } from "./types";
+import { newStoreData } from "./util";
export const modelStoreDataAtom = atom(newStoreData());
-export const cookieJarsAtom = createOrderedModelAtom('cookie_jar', 'name', 'asc');
-export const environmentsAtom = createOrderedModelAtom('environment', 'sortPriority', 'asc');
-export const foldersAtom = createModelAtom('folder');
-export const grpcConnectionsAtom = createOrderedModelAtom('grpc_connection', 'createdAt', 'desc');
-export const grpcEventsAtom = createOrderedModelAtom('grpc_event', 'createdAt', 'asc');
-export const grpcRequestsAtom = createModelAtom('grpc_request');
-export const httpRequestsAtom = createModelAtom('http_request');
-export const httpResponsesAtom = createOrderedModelAtom('http_response', 'createdAt', 'desc');
-export const httpResponseEventsAtom = createOrderedModelAtom('http_response_event', 'createdAt', 'asc');
-export const keyValuesAtom = createModelAtom('key_value');
-export const pluginsAtom = createModelAtom('plugin');
-export const settingsAtom = createSingularModelAtom('settings');
-export const websocketRequestsAtom = createModelAtom('websocket_request');
-export const websocketEventsAtom = createOrderedModelAtom('websocket_event', 'createdAt', 'asc');
-export const websocketConnectionsAtom = createOrderedModelAtom(
- 'websocket_connection',
- 'createdAt',
- 'desc',
+export const cookieJarsAtom = createOrderedModelAtom("cookie_jar", "name", "asc");
+export const environmentsAtom = createOrderedModelAtom("environment", "sortPriority", "asc");
+export const foldersAtom = createModelAtom("folder");
+export const grpcConnectionsAtom = createOrderedModelAtom("grpc_connection", "createdAt", "desc");
+export const grpcEventsAtom = createOrderedModelAtom("grpc_event", "createdAt", "asc");
+export const grpcRequestsAtom = createModelAtom("grpc_request");
+export const httpRequestsAtom = createModelAtom("http_request");
+export const httpResponsesAtom = createOrderedModelAtom("http_response", "createdAt", "desc");
+export const httpResponseEventsAtom = createOrderedModelAtom(
+ "http_response_event",
+ "createdAt",
+ "asc",
);
-export const workspaceMetasAtom = createModelAtom('workspace_meta');
-export const workspacesAtom = createOrderedModelAtom('workspace', 'name', 'asc');
+export const keyValuesAtom = createModelAtom("key_value");
+export const pluginsAtom = createModelAtom("plugin");
+export const settingsAtom = createSingularModelAtom("settings");
+export const websocketRequestsAtom = createModelAtom("websocket_request");
+export const websocketEventsAtom = createOrderedModelAtom("websocket_event", "createdAt", "asc");
+export const websocketConnectionsAtom = createOrderedModelAtom(
+ "websocket_connection",
+ "createdAt",
+ "desc",
+);
+export const workspaceMetasAtom = createModelAtom("workspace_meta");
+export const workspacesAtom = createOrderedModelAtom("workspace", "name", "asc");
-export function createModelAtom(modelType: M) {
+export function createModelAtom(modelType: M) {
return selectAtom(
modelStoreDataAtom,
(data) => Object.values(data[modelType] ?? {}),
@@ -37,19 +41,19 @@ export function createModelAtom(modelType: M) {
);
}
-export function createSingularModelAtom(modelType: M) {
+export function createSingularModelAtom(modelType: M) {
return selectAtom(modelStoreDataAtom, (data) => {
const modelData = Object.values(data[modelType] ?? {});
const item = modelData[0];
- if (item == null) throw new Error('Failed creating singular model with no data: ' + modelType);
+ if (item == null) throw new Error("Failed creating singular model with no data: " + modelType);
return item;
});
}
-export function createOrderedModelAtom(
+export function createOrderedModelAtom(
modelType: M,
field: keyof ExtractModel,
- order: 'asc' | 'desc',
+ order: "asc" | "desc",
) {
return selectAtom(
modelStoreDataAtom,
@@ -58,7 +62,7 @@ export function createOrderedModelAtom(
return Object.values(modelData).sort(
(a: ExtractModel, b: ExtractModel) => {
const n = a[field] > b[field] ? 1 : -1;
- return order === 'desc' ? n * -1 : n;
+ return order === "desc" ? n * -1 : n;
},
);
},
diff --git a/crates/yaak-models/guest-js/index.ts b/crates/yaak-models/guest-js/index.ts
index ef564895..7ceff15c 100644
--- a/crates/yaak-models/guest-js/index.ts
+++ b/crates/yaak-models/guest-js/index.ts
@@ -1,11 +1,11 @@
-import { AnyModel } from '../bindings/gen_models';
+import { AnyModel } from "../bindings/gen_models";
-export * from '../bindings/gen_models';
-export * from '../bindings/gen_util';
-export * from './store';
-export * from './atoms';
+export * from "../bindings/gen_models";
+export * from "../bindings/gen_util";
+export * from "./store";
+export * from "./atoms";
export function modelTypeLabel(m: AnyModel): string {
const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
- return m.model.split('_').map(capitalize).join(' ');
+ return m.model.split("_").map(capitalize).join(" ");
}
diff --git a/crates/yaak-models/guest-js/store.ts b/crates/yaak-models/guest-js/store.ts
index 38ff71f9..78a96693 100644
--- a/crates/yaak-models/guest-js/store.ts
+++ b/crates/yaak-models/guest-js/store.ts
@@ -1,10 +1,10 @@
-import { invoke } from '@tauri-apps/api/core';
-import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
-import { resolvedModelName } from '@yaakapp/app/lib/resolvedModelName';
-import { AnyModel, ModelPayload } from '../bindings/gen_models';
-import { modelStoreDataAtom } from './atoms';
-import { ExtractModel, JotaiStore, ModelStoreData } from './types';
-import { newStoreData } from './util';
+import { invoke } from "@tauri-apps/api/core";
+import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
+import { resolvedModelName } from "@yaakapp/app/lib/resolvedModelName";
+import { AnyModel, ModelPayload } from "../bindings/gen_models";
+import { modelStoreDataAtom } from "./atoms";
+import { ExtractModel, JotaiStore, ModelStoreData } from "./types";
+import { newStoreData } from "./util";
let _store: JotaiStore | null = null;
@@ -12,11 +12,11 @@ export function initModelStore(store: JotaiStore) {
_store = store;
getCurrentWebviewWindow()
- .listen('model_write', ({ payload }) => {
+ .listen("model_write", ({ payload }) => {
if (shouldIgnoreModel(payload)) return;
mustStore().set(modelStoreDataAtom, (prev: ModelStoreData) => {
- if (payload.change.type === 'upsert') {
+ if (payload.change.type === "upsert") {
return {
...prev,
[payload.model.model]: {
@@ -36,7 +36,7 @@ export function initModelStore(store: JotaiStore) {
function mustStore(): JotaiStore {
if (_store == null) {
- throw new Error('Model store was not initialized');
+ throw new Error("Model store was not initialized");
}
return _store;
@@ -45,8 +45,8 @@ function mustStore(): JotaiStore {
let _activeWorkspaceId: string | null = null;
export async function changeModelStoreWorkspace(workspaceId: string | null) {
- console.log('Syncing models with new workspace', workspaceId);
- const workspaceModelsStr = await invoke('models_workspace_models', {
+ console.log("Syncing models with new workspace", workspaceId);
+ const workspaceModelsStr = await invoke("models_workspace_models", {
workspaceId, // NOTE: if no workspace id provided, it will just fetch global models
});
const workspaceModels = JSON.parse(workspaceModelsStr) as AnyModel[];
@@ -57,12 +57,12 @@ export async function changeModelStoreWorkspace(workspaceId: string | null) {
mustStore().set(modelStoreDataAtom, data);
- console.log('Synced model store with workspace', workspaceId, data);
+ console.log("Synced model store with workspace", workspaceId, data);
_activeWorkspaceId = workspaceId;
}
-export function listModels>(
+export function listModels>(
modelType: M | ReadonlyArray,
): T[] {
let data = mustStore().get(modelStoreDataAtom);
@@ -70,7 +70,7 @@ export function listModels Object.values(data[t]) as T[]);
}
-export function getModel>(
+export function getModel>(
modelType: M | ReadonlyArray,
id: string,
): T | null {
@@ -83,9 +83,7 @@ export function getModel>(
+export function patchModelById>(
model: M,
id: string,
patch: Partial | ((prev: T) => T),
@@ -105,54 +103,54 @@ export function patchModelById>(
- base: Pick,
+export async function patchModel>(
+ base: Pick,
patch: Partial,
): Promise {
return patchModelById(base.model, base.id, patch);
}
-export async function updateModel>(
+export async function updateModel>(
model: T,
): Promise {
- return invoke('models_upsert', { model });
+ return invoke("models_upsert", { model });
}
export async function deleteModelById<
- M extends AnyModel['model'],
+ M extends AnyModel["model"],
T extends ExtractModel,
>(modelType: M | M[], id: string) {
let model = getModel(modelType, id);
await deleteModel(model);
}
-export async function deleteModel>(
+export async function deleteModel>(
model: T | null,
) {
if (model == null) {
- throw new Error('Failed to delete null model');
+ throw new Error("Failed to delete null model");
}
- await invoke('models_delete', { model });
+ await invoke("models_delete", { model });
}
-export function duplicateModel>(
+export function duplicateModel>(
model: T | null,
) {
if (model == null) {
- throw new Error('Failed to duplicate null model');
+ throw new Error("Failed to duplicate null model");
}
// If the model has a name, try to duplicate it with a name that doesn't conflict
- let name = 'name' in model ? resolvedModelName(model) : undefined;
+ let name = "name" in model ? resolvedModelName(model) : undefined;
if (name != null) {
const existingModels = listModels(model.model);
for (let i = 0; i < 100; i++) {
const hasConflict = existingModels.some((m) => {
- if ('folderId' in m && 'folderId' in model && model.folderId !== m.folderId) {
+ if ("folderId" in m && "folderId" in model && model.folderId !== m.folderId) {
return false;
} else if (resolvedModelName(m) !== name) {
return false;
@@ -166,7 +164,7 @@ export function duplicateModel\d+))?$/);
if (m != null && m.groups?.n == null) {
- name = name.substring(0, m.index) + ' Copy 2';
+ name = name.substring(0, m.index) + " Copy 2";
} else if (m != null && m.groups?.n != null) {
name = name.substring(0, m.index) + ` Copy ${parseInt(m.groups.n) + 1}`;
} else {
@@ -175,23 +173,23 @@ export function duplicateModel('models_duplicate', { model: { ...model, name } });
+ return invoke("models_duplicate", { model: { ...model, name } });
}
export async function createGlobalModel>(
- patch: Partial & Pick,
+ patch: Partial & Pick,
): Promise {
- return invoke('models_upsert', { model: patch });
+ return invoke("models_upsert", { model: patch });
}
export async function createWorkspaceModel>(
- patch: Partial & Pick,
+ patch: Partial & Pick,
): Promise {
- return invoke('models_upsert', { model: patch });
+ return invoke("models_upsert", { model: patch });
}
export function replaceModelsInStore<
- M extends AnyModel['model'],
+ M extends AnyModel["model"],
T extends Extract,
>(model: M, models: T[]) {
const newModels: Record = {};
@@ -208,7 +206,7 @@ export function replaceModelsInStore<
}
export function mergeModelsInStore<
- M extends AnyModel['model'],
+ M extends AnyModel["model"],
T extends Extract,
>(model: M, models: T[], filter?: (model: T) => boolean) {
mustStore().set(modelStoreDataAtom, (prev: ModelStoreData) => {
@@ -237,7 +235,7 @@ export function mergeModelsInStore<
function shouldIgnoreModel({ model, updateSource }: ModelPayload) {
// Never ignore updates from non-user sources
- if (updateSource.type !== 'window') {
+ if (updateSource.type !== "window") {
return false;
}
@@ -247,11 +245,11 @@ function shouldIgnoreModel({ model, updateSource }: ModelPayload) {
}
// Only sync models that belong to this workspace, if a workspace ID is present
- if ('workspaceId' in model && model.workspaceId !== _activeWorkspaceId) {
+ if ("workspaceId" in model && model.workspaceId !== _activeWorkspaceId) {
return true;
}
- if (model.model === 'key_value' && model.namespace === 'no_sync') {
+ if (model.model === "key_value" && model.namespace === "no_sync") {
return true;
}
diff --git a/crates/yaak-models/guest-js/types.ts b/crates/yaak-models/guest-js/types.ts
index 6f11bad7..56f63062 100644
--- a/crates/yaak-models/guest-js/types.ts
+++ b/crates/yaak-models/guest-js/types.ts
@@ -1,8 +1,8 @@
-import { createStore } from 'jotai';
-import { AnyModel } from '../bindings/gen_models';
+import { createStore } from "jotai";
+import { AnyModel } from "../bindings/gen_models";
export type ExtractModel = T extends { model: M } ? T : never;
export type ModelStoreData = {
- [M in T['model']]: Record>;
+ [M in T["model"]]: Record>;
};
export type JotaiStore = ReturnType;
diff --git a/crates/yaak-models/guest-js/util.ts b/crates/yaak-models/guest-js/util.ts
index 81981114..7435a267 100644
--- a/crates/yaak-models/guest-js/util.ts
+++ b/crates/yaak-models/guest-js/util.ts
@@ -1,4 +1,4 @@
-import { ModelStoreData } from './types';
+import { ModelStoreData } from "./types";
export function newStoreData(): ModelStoreData {
return {
diff --git a/crates/yaak-models/package.json b/crates/yaak-models/package.json
index c7258427..a1e2ed76 100644
--- a/crates/yaak-models/package.json
+++ b/crates/yaak-models/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/models",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "guest-js/index.ts"
}
diff --git a/crates/yaak-plugins/index.ts b/crates/yaak-plugins/index.ts
index bfe7065d..0b992b79 100644
--- a/crates/yaak-plugins/index.ts
+++ b/crates/yaak-plugins/index.ts
@@ -1,30 +1,30 @@
-import { invoke } from '@tauri-apps/api/core';
-import { PluginNameVersion, PluginSearchResponse, PluginUpdatesResponse } from './bindings/gen_api';
+import { invoke } from "@tauri-apps/api/core";
+import { PluginNameVersion, PluginSearchResponse, PluginUpdatesResponse } from "./bindings/gen_api";
-export * from './bindings/gen_models';
-export * from './bindings/gen_events';
-export * from './bindings/gen_search';
+export * from "./bindings/gen_models";
+export * from "./bindings/gen_events";
+export * from "./bindings/gen_search";
export async function searchPlugins(query: string) {
- return invoke('cmd_plugins_search', { query });
+ return invoke("cmd_plugins_search", { query });
}
export async function installPlugin(name: string, version: string | null) {
- return invoke('cmd_plugins_install', { name, version });
+ return invoke("cmd_plugins_install", { name, version });
}
export async function uninstallPlugin(pluginId: string) {
- return invoke('cmd_plugins_uninstall', { pluginId });
+ return invoke("cmd_plugins_uninstall", { pluginId });
}
export async function checkPluginUpdates() {
- return invoke('cmd_plugins_updates', {});
+ return invoke("cmd_plugins_updates", {});
}
export async function updateAllPlugins() {
- return invoke('cmd_plugins_update_all', {});
+ return invoke("cmd_plugins_update_all", {});
}
export async function installPluginFromDirectory(directory: string) {
- return invoke('cmd_plugins_install_from_directory', { directory });
+ return invoke("cmd_plugins_install_from_directory", { directory });
}
diff --git a/crates/yaak-plugins/package.json b/crates/yaak-plugins/package.json
index e48f823a..25496a15 100644
--- a/crates/yaak-plugins/package.json
+++ b/crates/yaak-plugins/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/plugins",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/crates/yaak-sse/index.ts b/crates/yaak-sse/index.ts
index 3b4faf38..f41d82df 100644
--- a/crates/yaak-sse/index.ts
+++ b/crates/yaak-sse/index.ts
@@ -1 +1 @@
-export * from './bindings/sse';
+export * from "./bindings/sse";
diff --git a/crates/yaak-sse/package.json b/crates/yaak-sse/package.json
index 5ca3b1aa..0bce2079 100644
--- a/crates/yaak-sse/package.json
+++ b/crates/yaak-sse/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/sse",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/crates/yaak-sync/index.ts b/crates/yaak-sync/index.ts
index 295c03a6..810f3039 100644
--- a/crates/yaak-sync/index.ts
+++ b/crates/yaak-sync/index.ts
@@ -1,24 +1,24 @@
-import { Channel, invoke } from '@tauri-apps/api/core';
-import { emit } from '@tauri-apps/api/event';
-import type { WatchResult } from '@yaakapp-internal/tauri';
-import { SyncOp } from './bindings/gen_sync';
-import { WatchEvent } from './bindings/gen_watch';
+import { Channel, invoke } from "@tauri-apps/api/core";
+import { emit } from "@tauri-apps/api/event";
+import type { WatchResult } from "@yaakapp-internal/tauri";
+import { SyncOp } from "./bindings/gen_sync";
+import { WatchEvent } from "./bindings/gen_watch";
-export * from './bindings/gen_models';
+export * from "./bindings/gen_models";
export async function calculateSync(workspaceId: string, syncDir: string) {
- return invoke('cmd_sync_calculate', {
+ return invoke("cmd_sync_calculate", {
workspaceId,
syncDir,
});
}
export async function calculateSyncFsOnly(dir: string) {
- return invoke('cmd_sync_calculate_fs', { dir });
+ return invoke("cmd_sync_calculate_fs", { dir });
}
export async function applySync(workspaceId: string, syncDir: string, syncOps: SyncOp[]) {
- return invoke('cmd_sync_apply', {
+ return invoke("cmd_sync_apply", {
workspaceId,
syncDir,
syncOps: syncOps,
@@ -30,10 +30,10 @@ export function watchWorkspaceFiles(
syncDir: string,
callback: (e: WatchEvent) => void,
) {
- console.log('Watching workspace files', workspaceId, syncDir);
+ console.log("Watching workspace files", workspaceId, syncDir);
const channel = new Channel();
channel.onmessage = callback;
- const unlistenPromise = invoke('cmd_sync_watch', {
+ const unlistenPromise = invoke("cmd_sync_watch", {
workspaceId,
syncDir,
channel,
@@ -46,7 +46,7 @@ export function watchWorkspaceFiles(
return () =>
unlistenPromise
.then(async ({ unlistenEvent }) => {
- console.log('Unwatching workspace files', workspaceId, syncDir);
+ console.log("Unwatching workspace files", workspaceId, syncDir);
unlistenToWatcher(unlistenEvent);
})
.catch(console.error);
@@ -59,11 +59,11 @@ function unlistenToWatcher(unlistenEvent: string) {
}
function getWatchKeys() {
- return sessionStorage.getItem('workspace-file-watchers')?.split(',').filter(Boolean) ?? [];
+ return sessionStorage.getItem("workspace-file-watchers")?.split(",").filter(Boolean) ?? [];
}
function setWatchKeys(keys: string[]) {
- sessionStorage.setItem('workspace-file-watchers', keys.join(','));
+ sessionStorage.setItem("workspace-file-watchers", keys.join(","));
}
function addWatchKey(key: string) {
@@ -79,6 +79,6 @@ function removeWatchKey(key: string) {
// On page load, unlisten to all zombie watchers
const keys = getWatchKeys();
if (keys.length > 0) {
- console.log('Unsubscribing to zombie file watchers', keys);
+ console.log("Unsubscribing to zombie file watchers", keys);
keys.forEach(unlistenToWatcher);
}
diff --git a/crates/yaak-sync/package.json b/crates/yaak-sync/package.json
index 79c0b9c9..dbd1b0a1 100644
--- a/crates/yaak-sync/package.json
+++ b/crates/yaak-sync/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/sync",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/crates/yaak-templates/build-wasm.cjs b/crates/yaak-templates/build-wasm.cjs
index 23611d0d..9bf9eddb 100644
--- a/crates/yaak-templates/build-wasm.cjs
+++ b/crates/yaak-templates/build-wasm.cjs
@@ -1,18 +1,18 @@
-const { execSync } = require('node:child_process');
-const fs = require('node:fs');
-const path = require('node:path');
+const { execSync } = require("node:child_process");
+const fs = require("node:fs");
+const path = require("node:path");
-if (process.env.SKIP_WASM_BUILD === '1') {
- console.log('Skipping wasm-pack build (SKIP_WASM_BUILD=1)');
+if (process.env.SKIP_WASM_BUILD === "1") {
+ console.log("Skipping wasm-pack build (SKIP_WASM_BUILD=1)");
return;
}
-execSync('wasm-pack build --target bundler', { stdio: 'inherit' });
+execSync("wasm-pack build --target bundler", { stdio: "inherit" });
// Rewrite the generated entry to use Vite's ?init import style instead of
// the ES Module Integration style that wasm-pack generates, which Vite/rolldown
// does not support in production builds.
-const entry = path.join(__dirname, 'pkg', 'yaak_templates.js');
+const entry = path.join(__dirname, "pkg", "yaak_templates.js");
fs.writeFileSync(
entry,
[
@@ -20,8 +20,8 @@ fs.writeFileSync(
'export * from "./yaak_templates_bg.js";',
'import * as bg from "./yaak_templates_bg.js";',
'const instance = await init({ "./yaak_templates_bg.js": bg });',
- 'bg.__wbg_set_wasm(instance.exports);',
- 'instance.exports.__wbindgen_start();',
- '',
- ].join('\n'),
+ "bg.__wbg_set_wasm(instance.exports);",
+ "instance.exports.__wbindgen_start();",
+ "",
+ ].join("\n"),
);
diff --git a/crates/yaak-templates/index.ts b/crates/yaak-templates/index.ts
index 23dd9166..0b8ae3a4 100644
--- a/crates/yaak-templates/index.ts
+++ b/crates/yaak-templates/index.ts
@@ -1,6 +1,6 @@
-export * from './bindings/parser';
-import { Tokens } from './bindings/parser';
-import { escape_template, parse_template, unescape_template } from './pkg';
+export * from "./bindings/parser";
+import { Tokens } from "./bindings/parser";
+import { escape_template, parse_template, unescape_template } from "./pkg";
export function parseTemplate(template: string) {
return parse_template(template) as Tokens;
diff --git a/crates/yaak-templates/package.json b/crates/yaak-templates/package.json
index 9826bfb6..5e89a677 100644
--- a/crates/yaak-templates/package.json
+++ b/crates/yaak-templates/package.json
@@ -1,7 +1,7 @@
{
"name": "@yaakapp-internal/templates",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts",
"scripts": {
"bootstrap": "npm run build",
diff --git a/crates/yaak-ws/Cargo.toml b/crates/yaak-ws/Cargo.toml
index ee15c3ac..c574ae81 100644
--- a/crates/yaak-ws/Cargo.toml
+++ b/crates/yaak-ws/Cargo.toml
@@ -14,7 +14,10 @@ url = "2"
serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros", "time", "test-util", "rt"] }
-tokio-tungstenite = { version = "0.26.2", default-features = false, features = ["rustls-tls-native-roots", "connect"] }
+tokio-tungstenite = { version = "0.26.2", default-features = false, features = [
+ "rustls-tls-native-roots",
+ "connect",
+] }
yaak-http = { workspace = true }
yaak-tls = { workspace = true }
yaak-models = { workspace = true }
diff --git a/crates/yaak-ws/index.ts b/crates/yaak-ws/index.ts
index c9ce0fb7..11721d7c 100644
--- a/crates/yaak-ws/index.ts
+++ b/crates/yaak-ws/index.ts
@@ -1,8 +1,8 @@
-import { invoke } from '@tauri-apps/api/core';
-import { WebsocketConnection } from '@yaakapp-internal/models';
+import { invoke } from "@tauri-apps/api/core";
+import { WebsocketConnection } from "@yaakapp-internal/models";
export function deleteWebsocketConnections(requestId: string) {
- return invoke('cmd_ws_delete_connections', {
+ return invoke("cmd_ws_delete_connections", {
requestId,
});
}
@@ -16,7 +16,7 @@ export function connectWebsocket({
environmentId: string | null;
cookieJarId: string | null;
}) {
- return invoke('cmd_ws_connect', {
+ return invoke("cmd_ws_connect", {
requestId,
environmentId,
cookieJarId,
@@ -24,7 +24,7 @@ export function connectWebsocket({
}
export function closeWebsocket({ connectionId }: { connectionId: string }) {
- return invoke('cmd_ws_close', {
+ return invoke("cmd_ws_close", {
connectionId,
});
}
@@ -36,7 +36,7 @@ export function sendWebsocket({
connectionId: string;
environmentId: string | null;
}) {
- return invoke('cmd_ws_send', {
+ return invoke("cmd_ws_send", {
connectionId,
environmentId,
});
diff --git a/crates/yaak-ws/package.json b/crates/yaak-ws/package.json
index 4956fa73..075582a9 100644
--- a/crates/yaak-ws/package.json
+++ b/crates/yaak-ws/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/ws",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/npm/cli-darwin-arm64/package.json b/npm/cli-darwin-arm64/package.json
index e8ca680b..4b79e733 100644
--- a/npm/cli-darwin-arm64/package.json
+++ b/npm/cli-darwin-arm64/package.json
@@ -5,6 +5,10 @@
"type": "git",
"url": "git+https://github.com/mountain-loop/yaak.git"
},
- "os": ["darwin"],
- "cpu": ["arm64"]
+ "os": [
+ "darwin"
+ ],
+ "cpu": [
+ "arm64"
+ ]
}
diff --git a/npm/cli-darwin-x64/package.json b/npm/cli-darwin-x64/package.json
index a7e34777..8d70f53c 100644
--- a/npm/cli-darwin-x64/package.json
+++ b/npm/cli-darwin-x64/package.json
@@ -5,6 +5,10 @@
"type": "git",
"url": "git+https://github.com/mountain-loop/yaak.git"
},
- "os": ["darwin"],
- "cpu": ["x64"]
+ "os": [
+ "darwin"
+ ],
+ "cpu": [
+ "x64"
+ ]
}
diff --git a/npm/cli-linux-arm64/package.json b/npm/cli-linux-arm64/package.json
index 21ed08a8..ae2ead43 100644
--- a/npm/cli-linux-arm64/package.json
+++ b/npm/cli-linux-arm64/package.json
@@ -5,6 +5,10 @@
"type": "git",
"url": "git+https://github.com/mountain-loop/yaak.git"
},
- "os": ["linux"],
- "cpu": ["arm64"]
+ "os": [
+ "linux"
+ ],
+ "cpu": [
+ "arm64"
+ ]
}
diff --git a/npm/cli-linux-x64/package.json b/npm/cli-linux-x64/package.json
index 72b7df70..91dce3f3 100644
--- a/npm/cli-linux-x64/package.json
+++ b/npm/cli-linux-x64/package.json
@@ -5,6 +5,10 @@
"type": "git",
"url": "git+https://github.com/mountain-loop/yaak.git"
},
- "os": ["linux"],
- "cpu": ["x64"]
+ "os": [
+ "linux"
+ ],
+ "cpu": [
+ "x64"
+ ]
}
diff --git a/npm/cli-win32-arm64/package.json b/npm/cli-win32-arm64/package.json
index fdfe1451..9cef632c 100644
--- a/npm/cli-win32-arm64/package.json
+++ b/npm/cli-win32-arm64/package.json
@@ -5,6 +5,10 @@
"type": "git",
"url": "git+https://github.com/mountain-loop/yaak.git"
},
- "os": ["win32"],
- "cpu": ["arm64"]
+ "os": [
+ "win32"
+ ],
+ "cpu": [
+ "arm64"
+ ]
}
diff --git a/npm/cli-win32-x64/package.json b/npm/cli-win32-x64/package.json
index 5f615e82..a13ff425 100644
--- a/npm/cli-win32-x64/package.json
+++ b/npm/cli-win32-x64/package.json
@@ -5,6 +5,10 @@
"type": "git",
"url": "git+https://github.com/mountain-loop/yaak.git"
},
- "os": ["win32"],
- "cpu": ["x64"]
+ "os": [
+ "win32"
+ ],
+ "cpu": [
+ "x64"
+ ]
}
diff --git a/npm/cli/common.js b/npm/cli/common.js
index 21794886..8f22e196 100644
--- a/npm/cli/common.js
+++ b/npm/cli/common.js
@@ -4,7 +4,7 @@ const BINARY_DISTRIBUTION_PACKAGES = {
linux_arm64: "@yaakapp/cli-linux-arm64",
linux_x64: "@yaakapp/cli-linux-x64",
win32_x64: "@yaakapp/cli-win32-x64",
- win32_arm64: "@yaakapp/cli-win32-arm64"
+ win32_arm64: "@yaakapp/cli-win32-arm64",
};
const BINARY_DISTRIBUTION_VERSION = require("./package.json").version;
@@ -16,5 +16,5 @@ module.exports = {
BINARY_DISTRIBUTION_PACKAGES,
BINARY_DISTRIBUTION_VERSION,
BINARY_NAME,
- PLATFORM_SPECIFIC_PACKAGE_NAME
+ PLATFORM_SPECIFIC_PACKAGE_NAME,
};
diff --git a/npm/cli/install.js b/npm/cli/install.js
index ef8f1b59..d5f13112 100644
--- a/npm/cli/install.js
+++ b/npm/cli/install.js
@@ -5,7 +5,7 @@ const https = require("node:https");
const {
BINARY_DISTRIBUTION_VERSION,
BINARY_NAME,
- PLATFORM_SPECIFIC_PACKAGE_NAME
+ PLATFORM_SPECIFIC_PACKAGE_NAME,
} = require("./common");
const fallbackBinaryPath = path.join(__dirname, BINARY_NAME);
@@ -27,8 +27,8 @@ function makeRequest(url) {
} else {
reject(
new Error(
- `npm responded with status code ${response.statusCode} when downloading package ${url}`
- )
+ `npm responded with status code ${response.statusCode} when downloading package ${url}`,
+ ),
);
}
})
diff --git a/npm/cli/package.json b/npm/cli/package.json
index f000e55b..78da3884 100644
--- a/npm/cli/package.json
+++ b/npm/cli/package.json
@@ -1,25 +1,25 @@
{
"name": "@yaakapp/cli",
"version": "0.0.1",
- "main": "./index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/mountain-loop/yaak.git"
},
- "scripts": {
- "postinstall": "node ./install.js",
- "prepublishOnly": "node ./prepublish.js"
- },
"bin": {
"yaak": "bin/cli.js",
"yaakcli": "bin/cli.js"
},
+ "main": "./index.js",
+ "scripts": {
+ "postinstall": "node ./install.js",
+ "prepublishOnly": "node ./prepublish.js"
+ },
"optionalDependencies": {
- "@yaakapp/cli-darwin-x64": "0.0.1",
"@yaakapp/cli-darwin-arm64": "0.0.1",
+ "@yaakapp/cli-darwin-x64": "0.0.1",
"@yaakapp/cli-linux-arm64": "0.0.1",
"@yaakapp/cli-linux-x64": "0.0.1",
- "@yaakapp/cli-win32-x64": "0.0.1",
- "@yaakapp/cli-win32-arm64": "0.0.1"
+ "@yaakapp/cli-win32-arm64": "0.0.1",
+ "@yaakapp/cli-win32-x64": "0.0.1"
}
}
diff --git a/npm/prepare-publish.js b/npm/prepare-publish.js
index ba15dbe2..f576b9ff 100644
--- a/npm/prepare-publish.js
+++ b/npm/prepare-publish.js
@@ -14,34 +14,34 @@ const packages = [
"cli-linux-arm64",
"cli-linux-x64",
"cli-win32-arm64",
- "cli-win32-x64"
+ "cli-win32-x64",
];
const binaries = [
{
src: join(__dirname, "dist", "cli-darwin-arm64", "yaak"),
- dest: join(__dirname, "cli-darwin-arm64", "bin", "yaak")
+ dest: join(__dirname, "cli-darwin-arm64", "bin", "yaak"),
},
{
src: join(__dirname, "dist", "cli-darwin-x64", "yaak"),
- dest: join(__dirname, "cli-darwin-x64", "bin", "yaak")
+ dest: join(__dirname, "cli-darwin-x64", "bin", "yaak"),
},
{
src: join(__dirname, "dist", "cli-linux-arm64", "yaak"),
- dest: join(__dirname, "cli-linux-arm64", "bin", "yaak")
+ dest: join(__dirname, "cli-linux-arm64", "bin", "yaak"),
},
{
src: join(__dirname, "dist", "cli-linux-x64", "yaak"),
- dest: join(__dirname, "cli-linux-x64", "bin", "yaak")
+ dest: join(__dirname, "cli-linux-x64", "bin", "yaak"),
},
{
src: join(__dirname, "dist", "cli-win32-arm64", "yaak.exe"),
- dest: join(__dirname, "cli-win32-arm64", "bin", "yaak.exe")
+ dest: join(__dirname, "cli-win32-arm64", "bin", "yaak.exe"),
},
{
src: join(__dirname, "dist", "cli-win32-x64", "yaak.exe"),
- dest: join(__dirname, "cli-win32-x64", "bin", "yaak.exe")
- }
+ dest: join(__dirname, "cli-win32-x64", "bin", "yaak.exe"),
+ },
];
for (const { src, dest } of binaries) {
@@ -67,7 +67,7 @@ for (const pkg of packages) {
"@yaakapp/cli-linux-arm64": version,
"@yaakapp/cli-linux-x64": version,
"@yaakapp/cli-win32-x64": version,
- "@yaakapp/cli-win32-arm64": version
+ "@yaakapp/cli-win32-arm64": version,
};
}
diff --git a/package.json b/package.json
index aca27ec0..dc967498 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "yaak-app",
- "private": true,
"version": "0.0.0",
+ "private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/mountain-loop/yaak.git"
@@ -82,6 +82,7 @@
"vendor:vendor-plugins": "node scripts/vendor-plugins.cjs",
"vendor:vendor-protoc": "node scripts/vendor-protoc.cjs",
"vendor:vendor-node": "node scripts/vendor-node.cjs",
+ "format": "vp fmt --ignore-path .oxfmtignore",
"lint": "run-p lint:*",
"lint:vp": "vp lint",
"lint:workspaces": "npm run --workspaces --if-present lint",
@@ -90,10 +91,12 @@
"tauri-before-build": "npm run bootstrap",
"tauri-before-dev": "node scripts/run-workspaces-dev.mjs"
},
- "overrides": {
- "js-yaml": "^4.1.1",
- "vite": "npm:@voidzero-dev/vite-plus-core@latest",
- "vitest": "npm:@voidzero-dev/vite-plus-test@latest"
+ "dependencies": {
+ "@codemirror/lang-go": "^6.0.1",
+ "@codemirror/lang-java": "^6.0.2",
+ "@codemirror/lang-php": "^6.0.2",
+ "@codemirror/lang-python": "^6.2.1",
+ "@codemirror/legacy-modes": "^6.5.2"
},
"devDependencies": {
"@tauri-apps/cli": "^2.9.6",
@@ -105,12 +108,10 @@
"vite-plus": "latest",
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
},
- "dependencies": {
- "@codemirror/lang-go": "^6.0.1",
- "@codemirror/lang-java": "^6.0.2",
- "@codemirror/lang-php": "^6.0.2",
- "@codemirror/lang-python": "^6.2.1",
- "@codemirror/legacy-modes": "^6.5.2"
+ "overrides": {
+ "js-yaml": "^4.1.1",
+ "vite": "npm:@voidzero-dev/vite-plus-core@latest",
+ "vitest": "npm:@voidzero-dev/vite-plus-test@latest"
},
"packageManager": "npm@11.11.1"
}
diff --git a/packages/common-lib/formatSize.ts b/packages/common-lib/formatSize.ts
index c5f4e8e8..7d5ac66e 100644
--- a/packages/common-lib/formatSize.ts
+++ b/packages/common-lib/formatSize.ts
@@ -4,16 +4,16 @@ export function formatSize(bytes: number): string {
if (bytes > 1000 * 1000 * 1000) {
num = bytes / 1000 / 1000 / 1000;
- unit = 'GB';
+ unit = "GB";
} else if (bytes > 1000 * 1000) {
num = bytes / 1000 / 1000;
- unit = 'MB';
+ unit = "MB";
} else if (bytes > 1000) {
num = bytes / 1000;
- unit = 'KB';
+ unit = "KB";
} else {
num = bytes;
- unit = 'B';
+ unit = "B";
}
return `${Math.round(num * 10) / 10} ${unit}`;
diff --git a/packages/common-lib/index.ts b/packages/common-lib/index.ts
index 7297c64e..01983b42 100644
--- a/packages/common-lib/index.ts
+++ b/packages/common-lib/index.ts
@@ -1,3 +1,3 @@
-export * from './debounce';
-export * from './formatSize';
-export * from './templateFunction';
+export * from "./debounce";
+export * from "./formatSize";
+export * from "./templateFunction";
diff --git a/packages/common-lib/package.json b/packages/common-lib/package.json
index 7d497db4..e5b41bf6 100644
--- a/packages/common-lib/package.json
+++ b/packages/common-lib/package.json
@@ -1,6 +1,6 @@
{
"name": "@yaakapp-internal/lib",
- "private": true,
"version": "1.0.0",
+ "private": true,
"main": "index.ts"
}
diff --git a/packages/common-lib/templateFunction.ts b/packages/common-lib/templateFunction.ts
index c4e81123..4132ba25 100644
--- a/packages/common-lib/templateFunction.ts
+++ b/packages/common-lib/templateFunction.ts
@@ -2,20 +2,20 @@ import type {
CallTemplateFunctionArgs,
JsonPrimitive,
TemplateFunctionArg,
-} from '@yaakapp-internal/plugins';
+} from "@yaakapp-internal/plugins";
export function validateTemplateFunctionArgs(
fnName: string,
args: TemplateFunctionArg[],
- values: CallTemplateFunctionArgs['values'],
+ values: CallTemplateFunctionArgs["values"],
): string | null {
for (const arg of args) {
- if ('inputs' in arg && arg.inputs) {
+ if ("inputs" in arg && arg.inputs) {
// Recurse down
const err = validateTemplateFunctionArgs(fnName, arg.inputs, values);
if (err) return err;
}
- if (!('name' in arg)) continue;
+ if (!("name" in arg)) continue;
if (arg.optional) continue;
if (arg.defaultValue != null) continue;
if (arg.hidden) continue;
@@ -34,14 +34,14 @@ export function applyFormInputDefaults(
) {
let newValues: { [p: string]: JsonPrimitive | undefined } = { ...values };
for (const input of inputs) {
- if ('defaultValue' in input && values[input.name] === undefined) {
+ if ("defaultValue" in input && values[input.name] === undefined) {
newValues[input.name] = input.defaultValue;
}
- if (input.type === 'checkbox' && values[input.name] === undefined) {
+ if (input.type === "checkbox" && values[input.name] === undefined) {
newValues[input.name] = false;
}
// Recurse down to all child inputs
- if ('inputs' in input) {
+ if ("inputs" in input) {
newValues = applyFormInputDefaults(input.inputs ?? [], newValues);
}
}
diff --git a/packages/plugin-runtime-types/package.json b/packages/plugin-runtime-types/package.json
index d68a2e30..d4dd862d 100644
--- a/packages/plugin-runtime-types/package.json
+++ b/packages/plugin-runtime-types/package.json
@@ -3,23 +3,23 @@
"version": "0.8.0",
"keywords": [
"api-client",
- "insomnia-alternative",
"bruno-alternative",
+ "insomnia-alternative",
"postman-alternative"
],
+ "homepage": "https://yaak.app",
+ "bugs": {
+ "url": "https://feedback.yaak.app"
+ },
"repository": {
"type": "git",
"url": "https://github.com/mountain-loop/yaak"
},
- "bugs": {
- "url": "https://feedback.yaak.app"
- },
- "homepage": "https://yaak.app",
- "main": "lib/index.js",
- "typings": "./lib/index.d.ts",
"files": [
"lib/**/*"
],
+ "main": "lib/index.js",
+ "typings": "./lib/index.d.ts",
"scripts": {
"bootstrap": "npm run build",
"build": "run-s build:copy-types build:tsc",
diff --git a/packages/plugin-runtime-types/src/index.ts b/packages/plugin-runtime-types/src/index.ts
index 14313963..8ef2c463 100644
--- a/packages/plugin-runtime-types/src/index.ts
+++ b/packages/plugin-runtime-types/src/index.ts
@@ -1,9 +1,9 @@
-export type * from './plugins';
-export type * from './themes';
+export type * from "./plugins";
+export type * from "./themes";
-export * from './bindings/gen_models';
-export * from './bindings/gen_events';
+export * from "./bindings/gen_models";
+export * from "./bindings/gen_events";
// Some extras for utility
-export type { PartialImportResources } from './plugins/ImporterPlugin';
+export type { PartialImportResources } from "./plugins/ImporterPlugin";
diff --git a/packages/plugin-runtime-types/src/plugins/AuthenticationPlugin.ts b/packages/plugin-runtime-types/src/plugins/AuthenticationPlugin.ts
index 4102c27d..e6427d3b 100644
--- a/packages/plugin-runtime-types/src/plugins/AuthenticationPlugin.ts
+++ b/packages/plugin-runtime-types/src/plugins/AuthenticationPlugin.ts
@@ -5,9 +5,9 @@ import type {
FormInput,
GetHttpAuthenticationSummaryResponse,
HttpAuthenticationAction,
-} from '../bindings/gen_events';
-import type { MaybePromise } from '../helpers';
-import type { Context } from './Context';
+} from "../bindings/gen_events";
+import type { MaybePromise } from "../helpers";
+import type { Context } from "./Context";
type AddDynamicMethod = {
dynamic?: (
@@ -19,13 +19,13 @@ type AddDynamicMethod = {
// oxlint-disable-next-line no-explicit-any -- distributive conditional type pattern
type AddDynamic = T extends any
? T extends { inputs?: FormInput[] }
- ? Omit & {
+ ? Omit & {
inputs: Array>;
dynamic?: (
ctx: Context,
args: CallHttpAuthenticationActionArgs,
) => MaybePromise<
- Partial & { inputs: Array> }> | null | undefined
+ Partial & { inputs: Array> }> | null | undefined
>;
}
: T & AddDynamicMethod
diff --git a/packages/plugin-runtime-types/src/plugins/Context.ts b/packages/plugin-runtime-types/src/plugins/Context.ts
index 1e139b6c..0a1afa49 100644
--- a/packages/plugin-runtime-types/src/plugins/Context.ts
+++ b/packages/plugin-runtime-types/src/plugins/Context.ts
@@ -26,10 +26,10 @@ import type {
ShowToastRequest,
TemplateRenderRequest,
WorkspaceInfo,
-} from '../bindings/gen_events.ts';
-import type { Folder, HttpRequest } from '../bindings/gen_models.ts';
-import type { JsonValue } from '../bindings/serde_json/JsonValue';
-import type { MaybePromise } from '../helpers';
+} from "../bindings/gen_events.ts";
+import type { Folder, HttpRequest } from "../bindings/gen_models.ts";
+import type { JsonValue } from "../bindings/serde_json/JsonValue";
+import type { MaybePromise } from "../helpers";
export type CallPromptFormDynamicArgs = {
values: { [key in string]?: JsonPrimitive };
@@ -45,13 +45,13 @@ type AddDynamicMethod = {
// oxlint-disable-next-line no-explicit-any -- distributive conditional type pattern
type AddDynamic = T extends any
? T extends { inputs?: FormInput[] }
- ? Omit & {
+ ? Omit & {
inputs: Array>;
dynamic?: (
ctx: Context,
args: CallPromptFormDynamicArgs,
) => MaybePromise<
- Partial & { inputs: Array> }> | null | undefined
+ Partial & { inputs: Array> }> | null | undefined
>;
}
: T & AddDynamicMethod
@@ -59,11 +59,11 @@ type AddDynamic = T extends any
export type DynamicPromptFormArg = AddDynamic;
-type DynamicPromptFormRequest = Omit & {
+type DynamicPromptFormRequest = Omit & {
inputs: DynamicPromptFormArg[];
};
-export type WorkspaceHandle = Pick;
+export type WorkspaceHandle = Pick;
export interface Context {
clipboard: {
@@ -73,8 +73,8 @@ export interface Context {
show(args: ShowToastRequest): Promise;
};
prompt: {
- text(args: PromptTextRequest): Promise;
- form(args: DynamicPromptFormRequest): Promise;
+ text(args: PromptTextRequest): Promise;
+ form(args: DynamicPromptFormRequest): Promise;
};
store: {
set(key: string, value: T): Promise;
@@ -94,41 +94,41 @@ export interface Context {
openExternalUrl(url: string): Promise;
};
cookies: {
- listNames(): Promise;
- getValue(args: GetCookieValueRequest): Promise;
+ listNames(): Promise;
+ getValue(args: GetCookieValueRequest): Promise;
};
grpcRequest: {
- render(args: RenderGrpcRequestRequest): Promise;
+ render(args: RenderGrpcRequestRequest): Promise;
};
httpRequest: {
- send(args: SendHttpRequestRequest): Promise;
- getById(args: GetHttpRequestByIdRequest): Promise;
- render(args: RenderHttpRequestRequest): Promise;
- list(args?: ListHttpRequestsRequest): Promise;
+ send(args: SendHttpRequestRequest): Promise;
+ getById(args: GetHttpRequestByIdRequest): Promise;
+ render(args: RenderHttpRequestRequest): Promise;
+ list(args?: ListHttpRequestsRequest): Promise;
create(
- args: Omit, 'id' | 'model' | 'createdAt' | 'updatedAt'> &
- Pick,
+ args: Omit, "id" | "model" | "createdAt" | "updatedAt"> &
+ Pick,
): Promise;
update(
- args: Omit, 'model' | 'createdAt' | 'updatedAt'> &
- Pick,
+ args: Omit, "model" | "createdAt" | "updatedAt"> &
+ Pick,
): Promise;
delete(args: { id: string }): Promise;
};
folder: {
- list(args?: ListFoldersRequest): Promise;
+ list(args?: ListFoldersRequest): Promise;
getById(args: { id: string }): Promise;
create(
- args: Omit, 'id' | 'model' | 'createdAt' | 'updatedAt'> &
- Pick,
+ args: Omit, "id" | "model" | "createdAt" | "updatedAt"> &
+ Pick,
): Promise;
update(
- args: Omit, 'model' | 'createdAt' | 'updatedAt'> & Pick,
+ args: Omit, "model" | "createdAt" | "updatedAt"> & Pick,
): Promise;
delete(args: { id: string }): Promise;
};
httpResponse: {
- find(args: FindHttpResponsesRequest): Promise;
+ find(args: FindHttpResponsesRequest): Promise;
};
templates: {
render(args: TemplateRenderRequest & { data: T }): Promise;
diff --git a/packages/plugin-runtime-types/src/plugins/FilterPlugin.ts b/packages/plugin-runtime-types/src/plugins/FilterPlugin.ts
index d8a18a80..720d9f74 100644
--- a/packages/plugin-runtime-types/src/plugins/FilterPlugin.ts
+++ b/packages/plugin-runtime-types/src/plugins/FilterPlugin.ts
@@ -1,5 +1,5 @@
-import type { FilterResponse } from '../bindings/gen_events';
-import type { Context } from './Context';
+import type { FilterResponse } from "../bindings/gen_events";
+import type { Context } from "./Context";
export type FilterPlugin = {
name: string;
diff --git a/packages/plugin-runtime-types/src/plugins/FolderActionPlugin.ts b/packages/plugin-runtime-types/src/plugins/FolderActionPlugin.ts
index 59060129..da5ad294 100644
--- a/packages/plugin-runtime-types/src/plugins/FolderActionPlugin.ts
+++ b/packages/plugin-runtime-types/src/plugins/FolderActionPlugin.ts
@@ -1,5 +1,5 @@
-import type { CallFolderActionArgs, FolderAction } from '../bindings/gen_events';
-import type { Context } from './Context';
+import type { CallFolderActionArgs, FolderAction } from "../bindings/gen_events";
+import type { Context } from "./Context";
export type FolderActionPlugin = FolderAction & {
onSelect(ctx: Context, args: CallFolderActionArgs): Promise | void;
diff --git a/packages/plugin-runtime-types/src/plugins/GrpcRequestActionPlugin.ts b/packages/plugin-runtime-types/src/plugins/GrpcRequestActionPlugin.ts
index 881c907f..0defb53d 100644
--- a/packages/plugin-runtime-types/src/plugins/GrpcRequestActionPlugin.ts
+++ b/packages/plugin-runtime-types/src/plugins/GrpcRequestActionPlugin.ts
@@ -1,5 +1,5 @@
-import type { CallGrpcRequestActionArgs, GrpcRequestAction } from '../bindings/gen_events';
-import type { Context } from './Context';
+import type { CallGrpcRequestActionArgs, GrpcRequestAction } from "../bindings/gen_events";
+import type { Context } from "./Context";
export type GrpcRequestActionPlugin = GrpcRequestAction & {
onSelect(ctx: Context, args: CallGrpcRequestActionArgs): Promise | void;
diff --git a/packages/plugin-runtime-types/src/plugins/HttpRequestActionPlugin.ts b/packages/plugin-runtime-types/src/plugins/HttpRequestActionPlugin.ts
index 3d9b7d74..6dd4036f 100644
--- a/packages/plugin-runtime-types/src/plugins/HttpRequestActionPlugin.ts
+++ b/packages/plugin-runtime-types/src/plugins/HttpRequestActionPlugin.ts
@@ -1,5 +1,5 @@
-import type { CallHttpRequestActionArgs, HttpRequestAction } from '../bindings/gen_events';
-import type { Context } from './Context';
+import type { CallHttpRequestActionArgs, HttpRequestAction } from "../bindings/gen_events";
+import type { Context } from "./Context";
export type HttpRequestActionPlugin = HttpRequestAction & {
onSelect(ctx: Context, args: CallHttpRequestActionArgs): Promise | void;
diff --git a/packages/plugin-runtime-types/src/plugins/ImporterPlugin.ts b/packages/plugin-runtime-types/src/plugins/ImporterPlugin.ts
index 52ecca11..0d42c4cc 100644
--- a/packages/plugin-runtime-types/src/plugins/ImporterPlugin.ts
+++ b/packages/plugin-runtime-types/src/plugins/ImporterPlugin.ts
@@ -1,17 +1,17 @@
-import type { ImportResources } from '../bindings/gen_events';
-import type { AtLeast, MaybePromise } from '../helpers';
-import type { Context } from './Context';
+import type { ImportResources } from "../bindings/gen_events";
+import type { AtLeast, MaybePromise } from "../helpers";
+import type { Context } from "./Context";
-type RootFields = 'name' | 'id' | 'model';
-type CommonFields = RootFields | 'workspaceId';
+type RootFields = "name" | "id" | "model";
+type CommonFields = RootFields | "workspaceId";
export type PartialImportResources = {
- workspaces: Array>;
- environments: Array>;
- folders: Array>;
- httpRequests: Array>;
- grpcRequests: Array>;
- websocketRequests: Array>;
+ workspaces: Array>;
+ environments: Array>;
+ folders: Array>;
+ httpRequests: Array>;
+ grpcRequests: Array>;
+ websocketRequests: Array