@breinzhang/mivark 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +158 -13
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,21 +1,166 @@
1
- # mivark(npm CLI)
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/breinzhang/mivark/main/assets/brand/mivark-icon.png" alt="Mivark icon" width="96" height="96" />
3
+ </p>
2
4
 
3
- 启动预编译 Mivark 桌面应用的命令行工具。**不包含 Rust 编译,不做任何网络下载**;应用二进制由同版本的 npm 平台包(`@breinzhang/mivark-<platform>-<arch>`)提供。
5
+ <h1 align="center">Mivark</h1>
4
6
 
5
- ## 用法
7
+ <p align="center">
8
+ A local-first desktop Markdown and JSON editor with PDF and image viewing for macOS and Windows.
9
+ </p>
6
10
 
7
- ```bash
11
+ <p align="center">
12
+ <strong>English</strong> | <a href="https://github.com/breinzhang/mivark/blob/main/README.zh-CN.md">简体中文</a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://github.com/breinzhang/mivark/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache--2.0-blue.svg" alt="License: Apache-2.0" /></a>
17
+ <img src="https://img.shields.io/badge/Platform-macOS%20%7C%20Windows-lightgrey.svg" alt="Platform: macOS | Windows" />
18
+ <img src="https://img.shields.io/badge/Built%20with-Tauri%202%20%2B%20React%20%2B%20Rust-orange.svg" alt="Built with Tauri 2, React, and Rust" />
19
+ </p>
20
+
21
+ ---
22
+
23
+ ## Features
24
+
25
+ - **Markdown Editing (Three Modes)**
26
+ - Switch seamlessly between **Rich (WYSIWYG)**, **Reader**, and **Source** modes while preserving a single canonical Markdown text state.
27
+ - Built-in **round-trip fidelity guard**: when a document contains syntax that rich editing cannot safely preserve, Mivark automatically keeps it in Source mode so your original bytes are never silently rewritten.
28
+ - Supports GitHub Flavored Markdown (GFM), Mermaid diagrams, slash commands, and light and dark themes.
29
+ - **Safe saving**: manual save by default (optional auto-save in Settings), disk modification conflict detection before writing, and atomic file replacement.
30
+ - **JSON Editor**
31
+ - Edit and save text in the syntax-highlighted **Raw** view, with find and replace. Switch to **Visual** to read the current buffer as an expandable tree with indented fields and values.
32
+ - Visual mode parses up to 8 MiB in a Web Worker and pages large branches. Files larger than 32 MiB open in a paged preview.
33
+ - **Image Viewer**
34
+ - View **PNG, JPEG, WebP, GIF, BMP, and SVG** files with zoom and fit-to-window controls.
35
+ - **PDF Viewer (Read-Only)**
36
+ - Read local PDFs up to 128 MiB with continuous scrolling, outline or thumbnail navigation, and zoom.
37
+ - **Desktop Workflow**
38
+ - Multi-tab workspace, folder explorer sidebar, drag-and-drop file opening, OS file associations, and single-instance window focus.
39
+
40
+ ## Security & Privacy
41
+
42
+ - **100% local-first**: works completely offline with no account or telemetry.
43
+ - **Untrusted content isolation**: Markdown, JSON, and SVG files are treated as untrusted — embedded scripts are never executed and remote resources referenced in Markdown are never loaded automatically.
44
+ - **Explicit file access**: filesystem operations are scoped through Tauri's Rust backend allowlist and explicit user actions.
45
+
46
+ ## Installation
47
+
48
+ ### 1. GitHub Releases (Recommended)
49
+
50
+ Download the prebuilt installer for your platform from [GitHub Releases](https://github.com/breinzhang/mivark/releases):
51
+
52
+ | Platform | Package |
53
+ | --- | --- |
54
+ | macOS (Apple Silicon — M1/M2/M3/M4) | `Mivark-<version>-darwin-arm64.dmg` |
55
+ | macOS (Intel) | `Mivark-<version>-darwin-x64.dmg` |
56
+ | Windows (x64) | `Mivark-<version>-win32-x64-setup.exe` (installer) or `Mivark-<version>-win32-x64.exe` (portable) |
57
+
58
+ Every release includes `SHA256SUMS.txt` for verifying download integrity.
59
+
60
+ ### 2. npm CLI Launcher (macOS & Windows, Offline-Ready)
61
+
62
+ If published to npm under a maintainer scope, you can install the precompiled desktop launcher globally (requires **Node.js 20+**; no Rust compilation and no runtime downloads from GitHub):
63
+
64
+ ```sh
8
65
  npm install -g @breinzhang/mivark
9
66
  mivark --version
10
67
  mivark /path/to/README.md
11
68
  ```
12
69
 
13
- - `--version` / `--help` 不启动 GUI。
14
- - 文件参数会启动(或聚焦已运行的)Mivark 并打开对应文件。
15
- - macOS 首次运行校验 ZIP SHA-256,解包到 `~/Library/Application Support/Mivark/npm/<version>-<arch>-<payload-sha>/Mivark.app`;每次启动复验缓存内容和 `codesign --verify --deep --strict`,损坏时从本地包重建。无需联网。
16
- - 并发首次启动通过目录锁串行处理;暂存目录与缓存同盘,验证完成才切换目录,失败尝试恢复旧缓存。
17
- - 锁等待超时会报告具体路径。只有确认其他启动器均已退出后,才删除该锁目录重试;旧版缓存不会自动删除。
18
- - 不再支持 `MIVARK_SKIP_CODESIGN_CHECK`。启动器会校验本地应用包完整性与 `codesign` 签名(支持 ad-hoc 签名或 Developer ID 签名)。
19
- - macOS 等待 `open` 返回,失败以非零退出码报告。Windows 等待进程创建成功后分离;这不代表 GUI/WebView2 已就绪。
20
- - 支持 `--ignore-scripts` 安装;`--omit=optional` 可能导致平台包缺失,CLI 会给出修复指引。
21
- - 相对路径按调用目录解析;以 `-` 开头的文件名放在 `--` 后;未知选项报错,不静默忽略。
70
+ ### 3. Homebrew Cask (macOS)
71
+
72
+ If published to a Homebrew Tap:
73
+
74
+ ```sh
75
+ brew install --cask breinzhang/mivark/mivark
76
+ ```
77
+
78
+ ### First-Launch Notice (Unsigned / Ad-hoc Builds)
79
+
80
+ If a release is distributed without a paid Apple Developer ID or Windows Authenticode certificate:
81
+
82
+ - **macOS**: After dragging `Mivark.app` into `/Applications`, if macOS blocks the first launch, open **System Settings → Privacy & Security**, scroll down to Security, and click **Open Anyway**. If newer macOS versions report that the app "is damaged and can't be opened", clear the quarantine attribute once in Terminal:
83
+ ```sh
84
+ xattr -cr /Applications/Mivark.app
85
+ ```
86
+ - **Windows**: If Windows SmartScreen appears, click **More info → Run anyway**.
87
+
88
+ ## Build from Source
89
+
90
+ ### Prerequisites
91
+
92
+ - **Node.js** `22.13+` (with `npm`)
93
+ - **Rust** stable toolchain (`rustup`, `cargo`)
94
+ - Platform-specific [Tauri 2 prerequisites](https://v2.tauri.app/start/prerequisites/)
95
+
96
+ ### Development
97
+
98
+ ```sh
99
+ npm ci
100
+ npm run tauri dev
101
+ ```
102
+
103
+ ### Production Bundle
104
+
105
+ ```sh
106
+ npm run tauri build
107
+ ```
108
+
109
+ Generated installers and application bundles are written to `src-tauri/target/release/bundle/`.
110
+
111
+ ## Testing & Validation
112
+
113
+ Run the full verification suite locally:
114
+
115
+ ```sh
116
+ npm run typecheck
117
+ npm run lint
118
+ npm run format:check
119
+ npm run test:unit
120
+ npm run test:integration
121
+ npm run test:launcher
122
+ cargo test --manifest-path src-tauri/Cargo.toml
123
+ ```
124
+
125
+ ### Web End-to-End Tests (Playwright)
126
+
127
+ Before the first run, generate test fixtures and install Chromium:
128
+
129
+ ```sh
130
+ npm run fixtures:generate
131
+ npx playwright install chromium
132
+ npm run test:e2e:web
133
+ ```
134
+
135
+ ## Tech Stack
136
+
137
+ - **Desktop Shell & Backend**: [Tauri 2](https://v2.tauri.app/) (Rust)
138
+ - **Frontend**: React 19, TypeScript, Vite, Zustand
139
+ - **Editors & Viewers**: Milkdown Crepe (WYSIWYG), CodeMirror 6 (Source & JSON Raw), `react-markdown` + `remark-gfm` (Reader), Mermaid, `@tanstack/react-virtual` (JSON & PDF), DOMPurify
140
+
141
+ ## Release Automation
142
+
143
+ When automated publishing is enabled on `main`, pushing a version-bump commit triggers [.github/workflows/release.yml](https://github.com/breinzhang/mivark/blob/main/.github/workflows/release.yml) to build macOS Apple Silicon, macOS Intel, and Windows x64 from the same commit and distribute them to GitHub Releases, npm, and Homebrew Tap.
144
+
145
+ - Sync versions across npm, Cargo, and Tauri configs with:
146
+ ```sh
147
+ npm run release:version -- X.Y.Z
148
+ ```
149
+ - Maintainers can run the **Release** workflow manually via `workflow_dispatch` with `publish` unchecked to test cross-platform builds and download the `distribution` artifact without publishing.
150
+ - Apple Developer ID signing/notarization and Windows Authenticode signing are both optional: leave their secrets unset for ad-hoc / unsigned builds, or configure them to enable signed releases.
151
+
152
+ ## Contributing
153
+
154
+ Issues and Pull Requests are welcome! When reporting a bug, please include:
155
+
156
+ - Mivark version and operating system (including CPU architecture)
157
+ - Clear reproduction steps
158
+ - A minimal, non-sensitive sample file if applicable
159
+
160
+ Please run the [Testing & Validation](#testing--validation) checks before submitting a Pull Request.
161
+
162
+ ## License
163
+
164
+ Mivark is licensed under the [Apache License 2.0](https://github.com/breinzhang/mivark/blob/main/LICENSE).
165
+
166
+ Bundled third-party components retain their respective licenses and copyright notices; see [THIRD_PARTY_NOTICES.txt](https://github.com/breinzhang/mivark/blob/main/public/THIRD_PARTY_NOTICES.txt) and `vendor/`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breinzhang/mivark",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Mivark desktop launcher — starts the precompiled Mivark.app / Mivark.exe",
5
5
  "bin": {
6
6
  "mivark": "bin/mivark.mjs"
@@ -10,9 +10,9 @@
10
10
  "node": ">=20"
11
11
  },
12
12
  "optionalDependencies": {
13
- "@breinzhang/mivark-darwin-arm64": "0.1.0",
14
- "@breinzhang/mivark-darwin-x64": "0.1.0",
15
- "@breinzhang/mivark-win32-x64": "0.1.0"
13
+ "@breinzhang/mivark-darwin-arm64": "0.1.2",
14
+ "@breinzhang/mivark-darwin-x64": "0.1.2",
15
+ "@breinzhang/mivark-win32-x64": "0.1.2"
16
16
  },
17
17
  "files": [
18
18
  "bin/",