Open-Source Wikis

/

Tauri

/

Crates

/

tauri-schema-worker

tauri-apps/tauri

tauri-schema-worker

Active contributors: Lucas Fernandes Nogueira, Amr Bashir

Purpose

crates/tauri-schema-worker is a TypeScript Cloudflare Worker (no Rust!) that serves the JSON Schemas generated by tauri-schema-generator at https://schema.tauri.app. It is checked into the Rust workspace because it sits at the same release cadence as the Config types.

The Worker is the recommended $schema URL in tauri.conf.json:

{
  "$schema": "https://schema.tauri.app/config/2"
}

By serving schemas under https://schema.tauri.app/config/<major> (and similar per-version paths) it lets editors validate user config without making them download a local schema file.

Directory layout

crates/tauri-schema-worker/
├── package.json              # listed in pnpm-workspace.yaml
├── (worker source — TS)
└── ...

The crate is a pnpm workspace package, not a Rust crate despite the path. Tooling references:

  • Listed under pnpm-workspace.yaml alongside packages/api and packages/cli.
  • Deployed by CI workflow .github/workflows/deploy-schema-worker.yml on dev pushes that touch the worker.
  • Most recent CI fix in scope: fix(schema-worker): return content type json (#15301) — sets the Content-Type: application/json response header explicitly.

How it works

graph LR
    Editor["VS Code / JetBrains"] -->|"$schema URL"| Worker["schema.tauri.app"]
    Worker --> Schemas["bundled JSON schemas"]
    Schemas -.-> RepoFiles["crates/tauri-schema-generator/schemas/"]

The Worker bundles the generated schemas from crates/tauri-schema-generator/schemas/, returns the right content for each version path, and sets the right MIME type and CORS headers. Cloudflare handles the TLS and CDN.

Integration points

  • Up: the public https://schema.tauri.app URL; consumed by editors via $schema.
  • Down: ships the JSON files generated by tauri-schema-generator.

Entry points for modification

  • Routing and content-type behaviour: the worker's TS handler.
  • Schema versioning: the path-to-file mapping inside the worker.
  • Build/deploy config: package.json + Wrangler config.

See tauri-schema-generator for the generator, and Tooling for the CI deploy flow.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

tauri-schema-worker – Tauri wiki | Factory