Skip to content

Kemosabert/jsed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsed — a JSON editor for large files

A project to build a JSON editor in Rust that comfortably handles files over 1500 MB.

Install (macOS, Apple Silicon)

The easiest way to install jsed is via Homebrew:

brew install Kemosabert/tap/jsed

Then run it from anywhere:

jsed ~/path/to/file.json   # opens the file on startup
jsed                       # opens the empty app; use File > Open

To upgrade later: brew upgrade jsed. To uninstall: brew uninstall jsed.

jsed accepts an optional file path as its first argument, so you can launch it on any JSON file from the shell regardless of your current directory.

Builds are currently published for Apple Silicon Macs only.

Prerequisites

Install the Rust toolchain (includes rustc and cargo):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

After install, restart your shell or source "$HOME/.cargo/env". Verify:

rustc --version   # should be 1.75 or newer
cargo --version

No other system dependencies needed on macOS — the glow backend uses OpenGL which is built into the OS.

Project layout

json-editor/
├── Cargo.toml          # workspace manifest
├── core/               # pure-logic crate (no UI deps)
│   ├── Cargo.toml
│   └── src/lib.rs      # Document, loading, (later) formatting, search
└── gui/                # egui-based desktop app
    ├── Cargo.toml
    └── src/main.rs

The split is deliberate: the core crate stays testable with plain cargo test, and when we later swap the GUI framework or add a CLI, the engine doesn't change.

Run it

# From the repo root
cargo run --release -p jsed-gui

# Or pass a file to open immediately:
cargo run --release -p jsed-gui -- ~/path/to/file.json

The first build will take 1–3 minutes while it compiles eframe and its dependencies. Subsequent builds are incremental and fast.

Use --release even during development — egui is noticeably smoother with optimizations on, and the workspace is configured to always optimize dependencies anyway so recompilation of our own code stays fast.

Test it

cargo test -p jsed-core

All tests live in the core crate for now, since the logic worth testing is there.

Build it as a macOS application bundle

If you'd rather have JSED as a real JSED.app you can launch from Spotlight, see in Finder's "Open With" menu, and set as the default opener for .json files, there's a small wrapper script:

./scripts/build-macos-app.sh             # build target/macos/JSED.app
./scripts/build-macos-app.sh --install   # also copy to /Applications and
                                         # register with LaunchServices

The script does a release build, assembles Contents/{MacOS,Info.plist, PkgInfo}, ad-hoc codesigns the bundle so Gatekeeper accepts it on your own Mac, and (with --install) forces a LaunchServices rescan so Finder picks up the JSON association immediately — no logout needed.

To make JSED the system default for .json files: right-click any .json in Finder → Get Info → pick JSED under "Open with:" → click Change All....

Custom app icon

Drop a single 1024×1024 PNG at branding/icon.png and re-run the build script. It uses the built-in sips and iconutil to render the ten sizes macOS expects (16, 32, 128, 256, 512 px in @1x and @2x) into Contents/Resources/AppIcon.icns and wires it into Info.plist for both the app icon and the JSON document badge. No external tools required.

If no branding/icon.png exists, the bundle uses the default generic app icon — no error, just plain.

Sharing the bundle

The ad-hoc signature only satisfies Gatekeeper on the machine that built it. To send JSED.app to another Mac:

ditto -c -k --keepParent target/macos/JSED.app /tmp/JSED.zip

On the receiving Mac, the first launch will be blocked ("Apple cannot verify the developer"). The recipient can either right-click → OpenOpen in the dialog, or strip the quarantine attribute once:

xattr -dr com.apple.quarantine /Applications/JSED.app

A fully-trusted experience on other machines requires an Apple Developer ID and notarization, which this script does not do.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors