Files
jsonPrism/README.vi.md
T
poli0981andClaude Opus 4.7 27743986cc feat: UI/UX polish — Multi-target slogan, dynamic placeholders, social, reverse highlight, mobile (#35)
* feat(i18n): dynamic placeholders + Multi-target slogan

- Replace "Eight target formats" with "Multi-target formats" in app.description across en/vi/ja/zh-CN
- Add input_placeholder_format and output_empty_format keys with {{ext}} interpolation
- InputPanel and OutputPanel render extension-aware placeholders in reverse mode (e.g. "Paste your CSV here...", "Output will appear here once you provide valid YAML.")
- Forward mode keeps the original JSON-specific copy

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

* feat(ui): social links in Footer + About Community section

- Add SocialIcons component with 6 inline-SVG brand icons (Discord, X, Bluesky, Mastodon, Telegram, YouTube), since lucide-react has no brand icons
- Footer now exposes Discord (dev community) / X / Bluesky as a centered icon row, sandwiched between app meta and the maintainer credit
- About page gains a "Community" section between Donate and Third-party, listing all six platforms with icon + label
- Add i18n keys: about.community.* (titled section) and social.* (aria-labels) across en/vi/ja/zh-CN
- Curated based on username.txt: includes dev-relevant + maintainer's public socials; excludes Steam, Discord game server, email, and the Telegram bot (off-topic for the project)

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

* feat(editor): scroll polish + reverse highlight for md/sql/toml/jsonl

Scroll fix
- .cm-scroller switched from scrollbarWidth: 'none' to 'thin' and explicit overflow: 'auto'. Hiding the native scrollbar was making wheel scroll require a click-to-focus before it engaged on some Chromium builds. Thin themed scrollbar reads fine on both light and dark theme.

Reverse-mode highlight
- Add @codemirror/lang-markdown, @codemirror/lang-sql, @codemirror/legacy-modes
- CodeEditor's EditorLanguage union now covers markdown, sql, and toml
- InputPanel maps jsonl -> json, markdown -> markdown, sql -> sql, toml -> toml; csv/tsv stay plain (no good CodeMirror grammar)
- All extensions go through the existing prismHighlightStyle, so colors stay consistent with forward JSON highlighting

Bundle impact: the three new packs are routed into the existing 'codemirror' manualChunk; no initial-bundle regression.

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

* feat(ui): mobile responsiveness polish

- Header: nav links Convert/About now always visible (previously hidden md:flex), brand mark + wordmark scale down on small screens, padding tightened to 12px so the 360px viewport fits brand + nav + lang + theme + GitHub icon
- InputPanel/OutputPanel toolbar buttons: icon-only on mobile (label hidden below sm); aria-label and title now carry the text for a11y/tooltips
- ConverterWorkspace panels: min-h-[40vh] on mobile so the stacked Input/Output each keep a usable height instead of collapsing
- Home hero: stack the title and the drop-zone hint on mobile (flex-col), reduce outer padding
- About page: reduce outer padding on mobile (px-4 py-10) to claw back horizontal space
- FormatPicker chips: smaller padding + 11px font on mobile so the 12-format wrap stays compact

Skipped hamburger menu by design — Header only has 2 nav links, the drawer pattern adds bundle and complexity without payoff.

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

* docs: refresh README EN + VI for Multi-target slogan, full format table, Community section

- Replace "Eight target formats" tagline with "Multi-target formats" (EN) / "Đa định dạng đích" (VI), matching the in-app app.description copy
- VI README format table now mirrors EN: includes BSON / CBOR / MessagePack (Phase 4) and the "Reverse (→ JSON)" column that the VI side was missing
- Bump tech-stack line from Vite 6 to Vite 8 in both files (package.json has been on ^8.0.0 for a while; the About page already reflected this)
- Add a Community section listing Discord (dev community), X, Bluesky, Mastodon, Telegram, and YouTube — same set as the in-app Community section, sourced from the maintainer's public socials

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-14 10:27:04 +07:00

10 KiB

JSONPrism

Tán sắc JSON ra nhiều định dạng.

Một JSON đầu vào. Đa định dạng đích. Chạy hoàn toàn trong trình duyệt.

CI Deploy License: Apache 2.0

Bản demo · English · Lộ trình


JSONPrism là công cụ "tán sắc" cho developer. Nhận một JSON đầu vào và phân tách ra nhiều định dạng đích — như ánh sáng trắng đi qua lăng kính. Mọi thứ chạy client-side, dữ liệu của bạn không bao giờ rời khỏi máy.

Định dạng hỗ trợ

Định dạng Phần mở rộng Trạng thái Đảo (→ 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 ✅
Bảng Markdown .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 —

Tính năng

  • Chạy hoàn toàn client-side — không server, không telemetry, không upload. JSON của bạn ở lại trong trình duyệt.
  • Xử lý batch — tới 500 file cùng lúc (Phase 2).
  • Phát hiện shape thông minh — nhận diện flat object, mảng object, scalar; gợi ý format đích phù hợp.
  • Tuỳ chọn theo từng format — pretty-print, indentation, dialect (SQL), alignment (Markdown), v.v.
  • Theme sáng/tối — bảng màu Prism Spectrum với violet / cyan / amber / rose.
  • Đa ngôn ngữ EN + VI — sẵn sàng từ ngày đầu. Hoan nghênh thêm ngôn ngữ khác.
  • Bản desktop Tauri — drag-and-drop file, hoạt động offline (mốc Phase 2).

Tech stack

  • Vite 8 + React 19 + TypeScript 5.7
  • Tailwind CSS v4 + shadcn/ui (style New York, base neutral)
  • CodeMirror 6 cho editor đầu vào (Phase 1 polish)
  • PapaParse, js-yaml, smol-toml, fast-xml-parser để parse/serialize
  • i18next cho dịch thuật, Zustand cho state, Sonner cho toast
  • Tauri 2 wrapper (Phase 2)

Bắt đầu nhanh

Yêu cầu: Node.js 22 LTS trở lên.

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

Bản desktop (Tauri 2)

JSONPrism cũng có bản desktop native qua Tauri 2. App dùng cùng React UI, với dialog OS native và drag-drop tích hợp vào batch flow hiện có.

Yêu cầu thêm:

  • Rust toolchain (rustup) với channel stable
  • Build deps theo platform:
    • Windows: Visual Studio Build Tools (workload C++) + WebView2 (cài sẵn trên Windows 11)
    • macOS: Xcode Command Line Tools (xcode-select --install)
    • Linux: libwebkit2gtk-4.1-dev, libappindicator3-dev, librsvg2-dev, patchelf, libssl-dev

Generate icon một lần (dùng Tauri CLI render SVG ra PNG/ICO/ICNS):

npm run tauri:icon

Chạy dev mode (Vite + Tauri window có hot reload):

npm run tauri:dev

Build bundle native:

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

Release tự động: push tag v* sẽ trigger .github/workflows/release.yml, build cho tất cả platform song song và tạo draft GitHub release.

Các script

Script Chức năng
npm run dev Chạy Vite dev server với HMR
npm run build Build production vào dist/
npm run preview Xem trước bản build trên máy local
npm run lint Chạy ESLint
npm run lint:fix Chạy ESLint với autofix
npm run typecheck Type-check TypeScript, không emit
npm run format Format bằng Prettier
npm run format:check Kiểm tra format (CI dùng cái này)

Components shadcn/ui

components.json đã được cấu hình sẵn. Thêm component theo nhu cầu:

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

Kiến trúc

src/
├── app/                 # Router + providers
├── components/
│   ├── ui/              # shadcn components (thêm theo nhu cầu)
│   ├── layout/          # Header, Footer, ThemeToggle
│   ├── converter/       # Workspace, panels, format picker
│   └── common/          # ErrorBoundary, LanguageSwitcher
├── converters/          # Một module cho mỗi định dạng đích
│   ├── types.ts         # Interface Converter
│   ├── registry.ts      # Bảng tra cứu
│   └── *.ts             # Cài đặt theo từng format
├── hooks/               # Custom hooks
├── i18n/                # Dịch thuật (en, vi)
├── lib/                 # detect, theme, utils, sample
├── pages/               # Home, About
├── styles/              # globals.css (Tailwind + theme tokens)
└── main.tsx

Thêm định dạng mới

Mỗi format là một module độc lập, cài đặt interface Converter:

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 };
    }
  },
};

Sau đó đăng ký nó trong src/converters/registry.ts và thêm label key vào src/i18n/locales/*.json.

Xem docs/ROADMAP.md để biết kế hoạch phase đầy đủ.

Đóng góp

Welcome pull request — vui lòng đọc CONTRIBUTING.md trước. PR thuộc nhóm auto-ignored (code đáng ngờ, lan man không vào vấn đề, không mô tả…) sẽ bị đóng không review.

Báo bug hoặc đề xuất tính năng tại GitHub Issues. Vấn đề bảo mật vui lòng dùng Security Advisory riêng tư.

Tài liệu project

Doc Nội dung
PRIVACY.md Offline-first, chỉ localStorage, không telemetry.
TERMS.md ToS / EULA — acceptable use, kế thừa giấy phép, quyền sở hữu dữ liệu.
SECURITY.md Cách report vulnerability, SLA.
DISCLAIMER.md Project 1 người + AI-assisted, không bảo hành.
THIRD-PARTY.md Mỗi dependency: version, giấy phép, link.
MAINTAINERS.md Ai chịu trách nhiệm gì.
CODE_OF_CONDUCT.md Contributor Covenant v2.1.
docs/ROADMAP.md Phase plan, trạng thái hiện tại.
docs/i18n/vi/pc_spec.md · docs/i18n/vi/dev_env.md Phần cứng + toolchain của maintainer.
docs/TAURI-NOTES.md Ghi chú Tauri build / process.
docs/RESX-MIGRATION.md Hướng dẫn i18next JSON → .NET RESX.

Cộng đồng

Trò chuyện, hỏi đáp, hoặc theo dõi cập nhật:

Ghi nhận

Phần lớn code, test, bản dịch và tài liệu của JSONPrism được draft với Claude Chat và Claude Code (Opus 4.7, 1M context). Xem DISCLAIMER.md để biết chi tiết về AI-assist. Chất lượng bản dịch ngôn ngữ ngoài tiếng Anh là best-effort — rất hoan nghênh đóng góp từ người bản ngữ.

Tài trợ

Nếu JSONPrism hữu ích cho bạn, hãy cân nhắc tài trợ maintainer qua một trong các kên trong .github/FUNDING.yml: GitHub Sponsors, Ko-fi, Buy Me a Coffee, Patreon hoặc PayPal.

Giấy phép

Apache License 2.0 — © 2026 Kokone (@poli0981).