Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

nextjs-to-tauri

БесплатноБез исполняемых скриптовНе проверен

Convert a static-exportable Next.js 16 App Router app to a Tauri 2 desktop shell with native packaging and optional updates. 将 Next.js 静态导出迁移到 Tauri 2。

rockbenbenот rockbenben1 469 установок в других каталогах

Об этом скилле

Next.js 16 → Tauri 2 Desktop App

Wrap a static-exportable Next.js 16 (App Router) app in a thin Tauri 2 native shell (.exe, .dmg, .AppImage, optional auto-update). Most migration friction comes from Tauri's embedded asset protocol (path/routing resolution), not React.

Guardrails & Scope

  • Static-export gate: Confirm the desktop routes work from output: "export". Keep build-time Server Components and static GET handlers. Request-time rendering, API handlers that need a running Next.js server, or Server Actions require a separate server design. Place desktop hooks inside a client component. Static-export support
  • Authorization & read-only mode: Read-only assessments stop at blockers and proposed checks without writing files. Migration tasks authorize necessary local edits (next.config.*, package.json, src-tauri/, desktop frontend boundary, icons, .gitignore, workflows) while preserving unrelated web behavior; do not ask approval before every file write. Signing secrets, OS code signing, and public release actions require explicit user scope.
  • Release-policy boundary: The bundled workflow builds and verifies a GitHub draft for manual publication (desktop-app-standard defaults to direct auto-publication). Preserve the user's requested release policy rather than mixing the two workflows.
  • Package manager: Commands and tauri-build.yml assume Yarn Classic. For npm or pnpm, substitute lockfile install/run commands (npm ci / pnpm install --frozen-lockfile, npm exec --no -- tauri / pnpm tauri) and update setup-node's cache: (cache: yarn fails without yarn.lock).

Procedure

  1. Verify target-compatible stable versions (Tauri 2):

    • npm & crates: Check published versions of @tauri-apps/cli, tauri, and each required plugin. Select compatible stable 2.x releases. In crates.io metadata, use the non-yanked entries in versions for the target major.
    • Actions & Node: Query latest stable Action majors (gh api repos/actions/checkout/releases/latest --jq .tag_name, plus setup-node, rust-cache, upload-artifact; check tauri-apps/tauri-action@v1 README). Pin the current Active LTS Node major from the Node schedule in both desktop-build.yml and tauri-build.yml. Set engines.node from actual Next.js/Tauri CLI floors, not as a copy of the CI major.
    • (Optional) If desktop-app-standard is installed, its audit script can supplement version/CI checks, though this migration does not require it.
  2. Gate static export on Tauri in next.config.* using TAURI_BUILD=1 (gotcha #1; retain existing reliable gating if present), preserving wrappers like next-intl:

    // Keep the NextConfig annotation so wrappers receive the literal "export" type.
    import type { NextConfig } from "next";
    
    const isTauri = process.env.TAURI_BUILD === "1"; // set by `yarn build:tauri`
    
    const nextConfig: NextConfig = {
      // ...your existing config...
      ...(isTauri ? { output: "export", trailingSlash: true } : {}),
      images: {
        // ...preserve existing image settings...
        ...(isTauri ? { unoptimized: true } : {}),
      },
    };
    
    export default nextConfig;
    

    If the project already wraps its config, retain the existing export, for example export default withNextIntl(nextConfig) in a next-intl app. Add cross-env (yarn add -D cross-env) and "build:tauri": "cross-env TAURI_BUILD=1 next build" in package.json so tauri.conf.json's beforeBuildCommand sets the flag.

  3. Scaffold Tauri & icons (JS CLI only; no local Rust needed yet):

    yarn add -D @tauri-apps/cli@^2
    yarn tauri init --ci --app-name "<app>" --window-title "<Title>" \
      --frontend-dist "../out" --dev-url "http://localhost:3000" \
      --before-dev-command "yarn dev" --before-build-command "yarn build:tauri"
    # Master icon must be square (1024x1024 PNG/SVG) to avoid upscaling blur.
    yarn tauri icon public/logo.png
    

    Keep mobile icon directories if present. Fix .gitignore immediately (gotcha #3) and confirm git check-ignore src-tauri/tauri.conf.json outputs nothing.

  4. Configure src-tauri/: Adapt tauri-files.md (tauri.conf.json with CSP, url, webviewInstallMode, mainBinaryName, optional updater; Cargo.toml; src/lib.rs with single-instance registered first + tray; capabilities/default.json). If shipping without auto-update, apply the full no-updater checklist.

  5. Integrate the selected frontend features: The client component handles external links. Add the update hook only for apps that support updates (it downloads before asking to install), and add the locale ho

Полный SKILL.md на ClawHub

Установить nextjs-to-tauri в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл nextjs-to-tauri?

Convert a static-exportable Next.js 16 App Router app to a Tauri 2 desktop shell with native packaging and optional updates. 将 Next.js 静态导出迁移到 Tauri 2。

Как установить скилл nextjs-to-tauri?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл nextjs-to-tauri запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить nextjs-to-tauri с