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。
от 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-standarddefaults to direct auto-publication). Preserve the user's requested release policy rather than mixing the two workflows. - Package manager: Commands and
tauri-build.ymlassume Yarn Classic. For npm or pnpm, substitute lockfile install/run commands (npm ci/pnpm install --frozen-lockfile,npm exec --no -- tauri/pnpm tauri) and updatesetup-node'scache:(cache: yarnfails withoutyarn.lock).
Procedure
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 inversionsfor the target major. - Actions & Node: Query latest stable Action majors (
gh api repos/actions/checkout/releases/latest --jq .tag_name, plussetup-node,rust-cache,upload-artifact; checktauri-apps/tauri-action@v1README). Pin the current Active LTS Node major from the Node schedule in bothdesktop-build.ymlandtauri-build.yml. Setengines.nodefrom actual Next.js/Tauri CLI floors, not as a copy of the CI major. - (Optional) If
desktop-app-standardis installed, its audit script can supplement version/CI checks, though this migration does not require it.
- npm & crates: Check published versions of
Gate static export on Tauri in
next.config.*usingTAURI_BUILD=1(gotcha #1; retain existing reliable gating if present), preserving wrappers likenext-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. Addcross-env(yarn add -D cross-env) and"build:tauri": "cross-env TAURI_BUILD=1 next build"inpackage.jsonsotauri.conf.json'sbeforeBuildCommandsets the flag.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.pngKeep mobile icon directories if present. Fix
.gitignoreimmediately (gotcha #3) and confirmgit check-ignore src-tauri/tauri.conf.jsonoutputs nothing.Configure
src-tauri/: Adapt tauri-files.md (tauri.conf.jsonwith CSP,url,webviewInstallMode,mainBinaryName, optional updater;Cargo.toml;src/lib.rswith single-instance registered first + tray;capabilities/default.json). If shipping without auto-update, apply the full no-updater checklist.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
Установить 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), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic