poli0981andClaude Opus 4.7 9c6b6d3f65 feat: hygiene, dep upgrades, Tauri, binary formats, reverse conversion (#1)
* feat: hygiene, dep upgrades, Tauri, binary formats, reverse conversion

Đợt sửa lỗi 2 — five phases landed together:

1. Build & type hygiene: fix 8 TS strict errors (override, exactOptional,
   Uint8Array<ArrayBuffer> for Blob), switch `typecheck` to `tsc -b
   --noEmit`, refactor ThemeToggle to click-outside + Escape (replaces
   the racy onBlur close), fix 10 pre-existing test failures.
2. Dep upgrades: jsdom 25→29, vite 6→8 (Rolldown), @vitejs/plugin-react
   4→6, engines.node >=22.11, manualChunks converted to function form.
3. Tauri process hygiene: explicit RunEvent::ExitRequested +
   WindowEvent::CloseRequested cleanup; docs/TAURI-NOTES.md captures
   the WebView2 GDI leak (upstream).
4. Binary converters: BSON, CBOR, MessagePack with base64/hex display
   encoding; OutputPanel decodes back to raw bytes on download.
5. Reverse conversion: Converter.reverse() interface, JSONL/CSV/YAML/
   TOML/RESX → JSON impls, DirectionToggle UI, FormatPicker disables
   non-reversible formats in reverse mode.

175 tests pass (was 137). Build clean. CI scripts now meaningful.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: apply prettier + ignore src-tauri/target in eslint

CI's format:check stage caught 24 files that didn't match the project's
prettier config. Run `npm run format` to normalize. Also widen the
eslint ignore list to skip cargo build output under src-tauri/target so
local Rust builds don't pollute the lint run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(build): switch minifier to oxc for Vite 8 / Rolldown compat

Vite 8 deprecated `transformWithEsbuild`; selecting `minify: 'esbuild'`
now requires esbuild as a separate install. CI didn't have it (we don't
list it as a dep), so the production build failed with
`Cannot find package 'esbuild'`. Switching to oxc — the Rolldown-native
minifier already included with Vite 8 — fixes the build with no new deps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 12:21:23 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00
2026-05-13 09:43:37 +07:00

JSONPrism

Disperse JSON into many formats.

One JSON input. Eight target formats. Fully in your browser.

CI Deploy License: Apache 2.0

Live demo · Tiếng Việt · Roadmap


JSONPrism is a refracting tool for developers. It takes a single JSON input and disperses it into many target formats — like white light through a prism. Everything runs client-side, so your data never leaves your device.

Target formats

Format Extension Status Reverse (→ JSON)
JSONL .jsonl ✅ Phase 1 ✅
CSV .csv ✅ Phase 1 ✅
TSV .tsv ✅ Phase 1 ✅
YAML .yaml ✅ Phase 1 ✅
XML .xml ✅ Phase 2 —
TOML .toml ✅ Phase 2 ✅
Markdown table .md ✅ Phase 2 —
SQL INSERT .sql ✅ Phase 2 —
RESX (.NET) .resx ✅ Phase 3 ✅
BSON .bson ✅ Phase 4 —
CBOR .cbor ✅ Phase 4 —
MessagePack .msgpack ✅ Phase 4 —

Features

  • Client-side only — no server, no telemetry, no upload. Your JSON stays in your browser.
  • Batch processing — up to 500 files at once (Phase 2).
  • Smart shape detection — recognizes flat objects, arrays of objects, scalars; suggests the best target format.
  • Per-format options — pretty-print, indentation, dialect (for SQL), alignment (for Markdown), and more.
  • Dark + light themes — Prism Spectrum palette with violet / cyan / amber / rose accents.
  • EN + VI — bilingual interface out of the box. More languages welcome.
  • Tauri desktop build — drag-and-drop file workflow, offline-first (Phase 2 milestone).

Tech stack

  • Vite 6 + React 19 + TypeScript 5.7
  • Tailwind CSS v4 + shadcn/ui (New York style, neutral base)
  • CodeMirror 6 for the input editor (Phase 1 polish)
  • PapaParse, js-yaml, smol-toml, fast-xml-parser for parsing/serialization
  • i18next for translations, Zustand for state, Sonner for toasts
  • Tauri 2 wrapper (Phase 2)

Quick start

Requirements: Node.js 22 LTS or newer.

git clone https://github.com/poli0981/jsonprism.git
cd jsonprism
npm install
npm run dev          # http://localhost:5173

Desktop app (Tauri 2)

JSONPrism also ships as a native desktop app via Tauri 2. The app uses the same React UI, with native OS dialogs and drag-drop hooked into the existing batch flow.

Additional requirements:

  • Rust toolchain (rustup) with the stable channel
  • Platform build deps:
    • Windows: Visual Studio Build Tools (C++ workload) + WebView2 (preinstalled on Windows 11)
    • macOS: Xcode Command Line Tools (xcode-select --install)
    • Linux: libwebkit2gtk-4.1-dev, libappindicator3-dev, librsvg2-dev, patchelf, libssl-dev

Generate icons once (uses Tauri's CLI to render the SVG to PNG/ICO/ICNS):

npm run tauri:icon

Run in dev mode (Vite + Tauri window with hot reload):

npm run tauri:dev

Build native bundles:

npm run tauri:build

Output:

  • Windows → src-tauri/target/release/bundle/msi/*.msi + nsis/*-setup.exe
  • macOS → src-tauri/target/release/bundle/dmg/*.dmg + macos/*.app
  • Linux → src-tauri/target/release/bundle/appimage/*.AppImage + deb/*.deb

Automated releases: pushing a v* tag triggers .github/workflows/release.yml, which builds for all platforms in parallel and creates a draft GitHub release.

Scripts

Script What it does
npm run dev Start Vite dev server with HMR
npm run build Production build to dist/
npm run preview Preview the built site locally
npm run lint Run ESLint
npm run lint:fix Run ESLint with autofix
npm run typecheck TypeScript type-check, no emit
npm run format Format with Prettier
npm run format:check Check formatting (CI uses this)

shadcn/ui components

The components.json is preconfigured. Add components on demand:

npx shadcn@latest add button input textarea tabs select card dialog sheet \
  dropdown-menu switch badge progress tooltip sonner resizable

Architecture

src/
├── app/                 # Router + global providers
├── components/
│   ├── ui/              # shadcn components (added on demand)
│   ├── layout/          # Header, Footer, ThemeToggle
│   ├── converter/       # Workspace, panels, format picker
│   └── common/          # ErrorBoundary, LanguageSwitcher
├── converters/          # One module per target format
│   ├── types.ts         # Converter interface
│   ├── registry.ts      # Lookup table
│   └── *.ts             # Per-format implementations
├── hooks/               # Custom hooks
├── i18n/                # Translations (en, vi)
├── lib/                 # detect, theme, utils, sample
├── pages/               # Home, About
├── styles/              # globals.css (Tailwind + theme tokens)
└── main.tsx

Adding a new format

Each format is a self-contained module implementing the Converter interface:

import type { Converter } from './types';

interface MyFormatOptions {
  indent: 2 | 4;
}

export const myFormatConverter: Converter<MyFormatOptions> = {
  meta: {
    id: 'myformat',
    labelKey: 'formats.myformat',
    extension: 'myf',
    mimeType: 'application/x-myformat',
    phase: 1,
    ready: true,
  },
  defaultOptions: { indent: 2 },
  convert({ data }, options) {
    try {
      const output = serialize(data, options);
      return { ok: true, output };
    } catch (err) {
      return { ok: false, error: (err as Error).message };
    }
  },
};

Then register it in src/converters/registry.ts and add label keys to src/i18n/locales/*.json.

See docs/ROADMAP.md for the full phase plan.

Contributing

Pull requests welcome — please read CONTRIBUTING.md first.

For bug reports and feature requests, use GitHub Issues.

License

Apache License 2.0 — © 2026 Kokone.

S
Description
No description provided
Readme Apache-2.0
1.2 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 96.4%
CSS 1.5%
Kotlin 0.7%
HTML 0.6%
Rust 0.4%
Other 0.4%