specv 0.1.1 → 0.2.0
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.
- package/LICENSE +21 -0
- package/README.md +38 -27
- package/dist/client/assets/index-BwFlB__h.js +41 -0
- package/dist/client/assets/index-DNf9f_m4.css +1 -0
- package/dist/client/index.html +3 -3
- package/dist/server/cli.js +114 -72
- package/package.json +29 -15
- package/dist/client/assets/index-2hQ6H2zK.css +0 -1
- package/dist/client/assets/index-CHUTKwt0.js +0 -41
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 daiki-beppu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# specv
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A CLI tool that previews Markdown files in the current directory with GitHub-style rendering in your browser.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- GitHub Flavored Markdown (GFM)
|
|
8
|
-
-
|
|
9
|
-
- Preview / Source
|
|
10
|
-
-
|
|
11
|
-
- VSCode
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- GitHub
|
|
15
|
-
-
|
|
7
|
+
- GitHub Flavored Markdown (GFM) rendering
|
|
8
|
+
- Syntax-highlighted code blocks with copy button
|
|
9
|
+
- Preview / Source toggle
|
|
10
|
+
- File tree (sidebar) with search
|
|
11
|
+
- VSCode-style Quick Open (`Cmd+P`) with fzf fuzzy search
|
|
12
|
+
- Sidebar toggle (`Cmd+B`)
|
|
13
|
+
- Dark / Light mode (follows OS preference + manual toggle)
|
|
14
|
+
- GitHub dark theme color scheme
|
|
15
|
+
- Automatic port detection (tries next port on conflict)
|
|
16
16
|
|
|
17
17
|
## Install
|
|
18
18
|
|
|
@@ -23,52 +23,63 @@ npm install -g specv
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
#
|
|
26
|
+
# Preview .md files in the current directory
|
|
27
27
|
specv
|
|
28
28
|
|
|
29
|
-
#
|
|
29
|
+
# Specify a port
|
|
30
30
|
specv -p 3000
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
A browser window opens automatically, rendering your Markdown files with GitHub-style formatting.
|
|
34
34
|
|
|
35
35
|
## Keyboard Shortcuts
|
|
36
36
|
|
|
37
|
-
| Shortcut | Action
|
|
38
|
-
| ------------------ |
|
|
39
|
-
| `Cmd+P` / `Ctrl+P` | Quick Open (
|
|
40
|
-
| `Cmd+B` / `Ctrl+B` |
|
|
37
|
+
| Shortcut | Action |
|
|
38
|
+
| ------------------ | ------------------- |
|
|
39
|
+
| `Cmd+P` / `Ctrl+P` | Quick Open (search) |
|
|
40
|
+
| `Cmd+B` / `Ctrl+B` | Toggle sidebar |
|
|
41
41
|
|
|
42
42
|
## Architecture
|
|
43
43
|
|
|
44
44
|
```
|
|
45
|
-
|
|
46
|
-
/api/files
|
|
47
|
-
/api/file?path=...
|
|
45
|
+
Hono Server (API) ─── React SPA (Vite build)
|
|
46
|
+
/api/files FileTree + Preview + Source
|
|
47
|
+
/api/file?path=... react-markdown + prism-react-renderer
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
- **Server:**
|
|
50
|
+
- **Server:** Hono + @hono/node-server + commander (CLI)
|
|
51
51
|
- **Client:** React 19 + Vite + Tailwind CSS v4
|
|
52
52
|
- **Markdown:** react-markdown + remark-gfm
|
|
53
53
|
- **Search:** fzf (fuzzy finder) + TanStack Hotkeys
|
|
54
|
-
- **Security:**
|
|
54
|
+
- **Security:** Path traversal protection, restricted to .md files only
|
|
55
55
|
|
|
56
56
|
## Development
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
#
|
|
59
|
+
# Client dev server (HMR)
|
|
60
60
|
pnpm dev:client
|
|
61
61
|
|
|
62
|
-
#
|
|
62
|
+
# Server development
|
|
63
63
|
pnpm dev:server
|
|
64
64
|
|
|
65
|
-
#
|
|
65
|
+
# Run tests
|
|
66
66
|
pnpm test
|
|
67
67
|
|
|
68
|
-
#
|
|
68
|
+
# Build
|
|
69
69
|
pnpm build
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
## CI/CD
|
|
73
|
+
|
|
74
|
+
Automated via GitHub Actions:
|
|
75
|
+
|
|
76
|
+
- **CI** — Runs lint / knip / typecheck / test / build on PRs and main pushes
|
|
77
|
+
- **Publish** — Publishes to npm on GitHub Release creation (Trusted Publishing)
|
|
78
|
+
|
|
79
|
+
## Contributing
|
|
80
|
+
|
|
81
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
82
|
+
|
|
72
83
|
## License
|
|
73
84
|
|
|
74
|
-
MIT
|
|
85
|
+
[MIT](LICENSE)
|