md-review 0.0.4 → 0.0.6
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/README.md +17 -6
- package/bin/md-review.js +26 -38
- package/dist/assets/index-BZ_-Uaqe.js +87 -0
- package/dist/assets/index-B_-fb83n.css +19 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/server/index.js +24 -6
- package/dist/assets/index-BSdkfsKj.css +0 -10
- package/dist/assets/index-CZ7h92Sm.js +0 -87
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
*{margin:0;padding:0;box-sizing:border-box}:root{--bg-primary: #ffffff;--bg-secondary: #f6f8fa;--bg-tertiary: #f3f4f6;--text-primary: #24292f;--text-secondary: #57606a;--text-tertiary: #6a737d;--border-primary: #d0d7de;--border-secondary: #e1e4e8;--link-color: #0366d6;--code-bg: #f6f8fa;--table-bg-alt: #f6f8fa}.dark-mode{--bg-primary: #0d1117;--bg-secondary: #161b22;--bg-tertiary: #1f2937;--text-primary: #e6edf3;--text-secondary: #8b949e;--text-tertiary: #7d8590;--border-primary: #30363d;--border-secondary: #21262d;--link-color: #58a6ff;--code-bg: #161b22;--table-bg-alt: #161b22}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:var(--bg-primary);color:var(--text-primary);transition:background-color .3s,color .3s}.theme-toggle{display:flex;align-items:center;justify-content:center;background:none;border:none;color:var(--text-secondary);cursor:pointer;padding:8px;border-radius:6px;transition:background-color .2s,color .2s}.theme-toggle:hover{background-color:var(--bg-secondary);color:var(--text-primary)}.file-tree{height:100%;display:flex;flex-direction:column;background-color:var(--bg-secondary)}.file-tree-header{padding:16px;border-bottom:1px solid var(--border-primary);background-color:var(--bg-primary);display:flex;align-items:center;justify-content:space-between}.file-tree-header-content{flex:1}.file-tree-header-actions{display:flex;align-items:center;gap:4px}.file-tree-footer{padding:12px 16px;border-top:1px solid var(--border-primary);background-color:var(--bg-primary)}.github-link{display:inline-flex;align-items:center;color:var(--text-secondary);transition:color .2s}.github-link:hover{color:var(--text-primary)}.file-tree-header h3{margin:0 0 4px;font-size:14px;font-weight:600;color:var(--text-primary)}.file-count{font-size:12px;color:var(--text-secondary)}.sidebar-collapse-button{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:none;border:none;border-radius:6px;cursor:pointer;color:var(--text-secondary);transition:background-color .2s,color .2s;padding:0;flex-shrink:0}.sidebar-collapse-button:hover{background-color:var(--bg-secondary);color:var(--text-primary)}.sidebar-collapse-button:active{background-color:var(--bg-tertiary)}.search-container{padding:12px 16px;border-bottom:1px solid var(--border-primary);background-color:var(--bg-primary)}.search-input-wrapper{position:relative;display:flex;align-items:center;background-color:var(--bg-secondary);border:1px solid var(--border-primary);border-radius:6px;padding:6px 8px;transition:border-color .2s,background-color .2s}.search-input-wrapper:focus-within{background-color:var(--bg-primary);border-color:var(--link-color);box-shadow:0 0 0 3px #58a6ff1a}.search-icon{font-size:14px;margin-right:6px;color:var(--text-secondary);flex-shrink:0}.search-input{flex:1;border:none;background:transparent;outline:none;font-size:14px;color:var(--text-primary);padding:0;min-width:0}.search-input::placeholder{color:var(--text-secondary)}.search-clear{background:none;border:none;cursor:pointer;padding:0 4px;color:var(--text-secondary);font-size:16px;line-height:1;transition:color .2s;flex-shrink:0}.search-clear:hover{color:var(--text-primary)}.search-shortcut{margin-left:8px;padding:2px 6px;background-color:var(--bg-primary);border:1px solid var(--border-primary);border-radius:4px;font-size:11px;color:var(--text-secondary);font-family:system-ui,-apple-system,sans-serif;flex-shrink:0}.search-input-wrapper:focus-within .search-shortcut{display:none}.file-tree-content{flex:1;overflow-y:auto;padding:8px 0}.tree-item{display:flex;align-items:center;padding:4px 8px;cursor:pointer;font-size:14px;-webkit-user-select:none;user-select:none;transition:background-color .1s}.tree-item:hover{background-color:var(--bg-tertiary)}.tree-item.file{color:var(--text-primary)}.tree-item.file.selected{background-color:#58a6ff26;border-left:2px solid var(--link-color)}.tree-item.directory{color:var(--text-primary);font-weight:500}.chevron-icon{margin-right:4px;color:var(--text-secondary);flex-shrink:0;transition:transform .2s ease-in-out}.file-icon,.folder-icon{margin-right:6px;font-size:16px;flex-shrink:0}.tree-item.file .file-icon{margin-left:20px}.file-name,.folder-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-tree-content::-webkit-scrollbar{width:8px}.file-tree-content::-webkit-scrollbar-track{background:var(--bg-secondary)}.file-tree-content::-webkit-scrollbar-thumb{background:var(--border-primary);border-radius:4px}.file-tree-content::-webkit-scrollbar-thumb:hover{background:var(--text-tertiary)}/*!
|
|
2
|
+
Theme: GitHub
|
|
3
|
+
Description: Light theme as seen on github.com
|
|
4
|
+
Author: github.com
|
|
5
|
+
Maintainer: @Hirse
|
|
6
|
+
Updated: 2021-05-15
|
|
7
|
+
|
|
8
|
+
Outdated base version: https://github.com/primer/github-syntax-light
|
|
9
|
+
Current colors taken from GitHub's CSS
|
|
10
|
+
*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
11
|
+
Theme: GitHub Dark
|
|
12
|
+
Description: Dark theme as seen on github.com
|
|
13
|
+
Author: github.com
|
|
14
|
+
Maintainer: @Hirse
|
|
15
|
+
Updated: 2021-05-15
|
|
16
|
+
|
|
17
|
+
Outdated base version: https://github.com/primer/github-syntax-dark
|
|
18
|
+
Current colors taken from GitHub's CSS
|
|
19
|
+
*/.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}.markdown-with-comments{display:flex;gap:0;min-height:100vh}.markdown-container{flex:1;max-width:900px;padding:2rem;padding-right:320px;position:relative;margin:0 auto}.comments-sidebar{width:300px;flex-shrink:0;border-left:1px solid var(--border-secondary);background:var(--bg-secondary);padding:1rem;height:100vh;position:fixed;top:0;right:0;overflow-y:auto}.comments-sidebar-resizer{position:absolute;top:0;left:-2px;width:8px;height:100%;cursor:col-resize;background:transparent;transition:background-color .2s;z-index:10}.comments-sidebar-resizer:before{content:"";position:absolute;top:0;left:50%;transform:translate(-50%);width:1px;height:100%;background-color:transparent;transition:background-color .2s}.comments-sidebar-resizer:hover:before{background-color:var(--link-color);width:2px}.markdown-with-comments.resizing .comments-sidebar-resizer:before{background-color:var(--link-color);width:2px}.markdown-with-comments.resizing{-webkit-user-select:none;user-select:none;cursor:col-resize}.markdown-with-comments.resizing *{cursor:col-resize!important}.comments-toggle-button{position:fixed;top:20px;right:20px;width:48px;height:48px;display:flex;align-items:center;justify-content:center;background:var(--link-color);border:none;border-radius:50%;cursor:pointer;box-shadow:0 4px 12px #00000026;transition:all .2s ease;z-index:1000;color:#fff}.comments-toggle-button:hover{transform:scale(1.05);box-shadow:0 6px 16px #0003}.comments-toggle-button:active{transform:scale(.95)}.comments-badge{position:absolute;top:-4px;right:-4px;min-width:20px;height:20px;display:flex;align-items:center;justify-content:center;background:#d73a49;color:#fff;font-size:11px;font-weight:600;border-radius:10px;padding:0 6px;border:2px solid var(--bg-primary)}.markdown-header{border-bottom:2px solid var(--border-secondary);padding-bottom:1rem;margin-bottom:2rem}.markdown-header h1{font-size:1.5rem;color:var(--text-primary);margin:0}.markdown-content{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;font-size:16px;line-height:1.6;color:var(--text-primary);position:relative;padding-left:0}.markdown-content .highlight-line{animation:highlightFade 2s ease-out;background-color:#58a6ff33;border-radius:3px;padding:.25rem;margin:-.25rem}@keyframes highlightFade{0%{background-color:#58a6ff4d}to{background-color:transparent}}.markdown-content h1{font-size:2em;border-bottom:1px solid var(--border-secondary);padding-bottom:.3em;margin-top:1.5em;margin-bottom:.5em;color:var(--text-primary)}.markdown-content h2{font-size:1.5em;border-bottom:1px solid var(--border-secondary);padding-bottom:.3em;margin-top:1.5em;margin-bottom:.5em;color:var(--text-primary)}.markdown-content h3{font-size:1.25em;margin-top:1.5em;margin-bottom:.5em;color:var(--text-primary)}.markdown-content h4{font-size:1em;margin-top:1.5em;margin-bottom:.5em;color:var(--text-primary)}.markdown-content pre{background-color:var(--code-bg);border-radius:6px;padding:16px;overflow:auto;font-size:14px;line-height:1.45;border:1px solid var(--border-secondary)}.markdown-content code{background-color:var(--code-bg);padding:.2em .4em;border-radius:3px;font-size:85%;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;color:var(--text-primary)}.markdown-content pre code{background-color:transparent;padding:0;font-size:100%}.markdown-content ul,.markdown-content ol{padding-left:2em;margin-top:0;margin-bottom:16px}.markdown-content li{margin-top:.25em}.markdown-content blockquote{padding:0 1em;color:var(--text-tertiary);border-left:4px solid var(--border-secondary);margin:0 0 16px}.markdown-content table{border-collapse:collapse;width:100%;margin-bottom:16px}.markdown-content table th,.markdown-content table td{padding:6px 13px;border:1px solid var(--border-secondary)}.markdown-content table th{font-weight:600;background-color:var(--table-bg-alt);color:var(--text-primary)}.markdown-content table tr{background-color:var(--bg-primary);border-top:1px solid var(--border-primary)}.markdown-content table tr:nth-child(2n){background-color:var(--table-bg-alt)}.markdown-content a{color:var(--link-color);text-decoration:none}.markdown-content a:hover{text-decoration:underline}.markdown-content hr{height:.25em;padding:0;margin:24px 0;background-color:var(--border-secondary);border:0}.markdown-content input[type=checkbox]{margin-right:.5em}.markdown-content img{max-width:100%;height:auto;display:block;margin:1em 0}.line-range{font-size:.75rem;font-weight:400;color:var(--text-tertiary);margin-left:.5rem}.selection-popover{display:flex;gap:4px;background:#1f2937;border-radius:6px;padding:4px;box-shadow:0 4px 12px #0000004d;z-index:1000}.popover-button{background:transparent;border:none;color:#e5e7eb;font-size:12px;padding:6px 10px;border-radius:4px;cursor:pointer;white-space:nowrap;transition:background-color .15s}.popover-button:hover{background:#374151}.popover-button:active{background:#4b5563}.comment-form{display:flex;flex-direction:column;gap:8px;min-width:280px}.comment-input{background:#374151;border:1px solid #4b5563;border-radius:4px;color:#e5e7eb;font-size:13px;padding:8px;resize:vertical;min-height:60px;font-family:inherit}.comment-input:focus{outline:none;border-color:#6b7280}.comment-input::placeholder{color:#9ca3af}.comment-actions{display:flex;justify-content:flex-end;gap:8px}.comment-cancel,.comment-submit{font-size:12px;padding:6px 12px;border-radius:4px;cursor:pointer;border:none;transition:background-color .15s}.comment-cancel{background:transparent;color:#9ca3af}.comment-cancel:hover{background:#374151;color:#e5e7eb}.comment-submit{background:#3b82f6;color:#fff}.comment-submit:hover{background:#2563eb}.comment-submit:disabled{background:#4b5563;color:#9ca3af;cursor:not-allowed}.selection-highlight{background-color:#0000001a;border-radius:2px}.comment-list-empty{text-align:center;color:var(--text-tertiary);padding:2rem 1rem}.comment-list-empty p{margin:.5rem 0}.comment-list-hint{font-size:.85rem;color:var(--text-secondary)}.comment-list-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:1px solid var(--border-secondary)}.comment-list-title-wrapper{display:flex;align-items:center;gap:.25rem}.comment-list-collapse-btn{display:flex;align-items:center;justify-content:center;width:20px;height:20px;background:none;border:none;border-radius:3px;color:var(--text-secondary);cursor:pointer;transition:all .15s;padding:0;flex-shrink:0}.comment-list-collapse-btn:hover{background:var(--bg-tertiary);color:var(--text-primary)}.comment-list-title{font-size:.9rem;font-weight:600;color:var(--text-primary);margin:0}.comment-list-actions{display:flex;gap:.5rem}.comment-list-copy-all{display:flex;align-items:center;gap:.25rem;background:none;border:1px solid var(--border-secondary);border-radius:4px;padding:.25rem .5rem;font-size:.75rem;color:var(--text-tertiary);cursor:pointer;transition:all .15s}.comment-list-copy-all:hover{background:var(--bg-tertiary);color:var(--link-color);border-color:var(--link-color)}.comment-list-copy-all.copied{color:#22863a;border-color:#22863a}.comment-list-delete-all{display:flex;align-items:center;gap:.25rem;background:none;border:1px solid var(--border-secondary);border-radius:4px;padding:.25rem .5rem;font-size:.75rem;color:var(--text-tertiary);cursor:pointer;transition:all .15s}.comment-list-delete-all:hover{background:#ff64641a;color:#d73a49;border-color:#d73a49}.comment-list-items{display:flex;flex-direction:column;gap:.75rem}.comment-item{background:var(--bg-primary);border:1px solid var(--border-secondary);border-radius:6px;padding:.75rem;font-size:.85rem}.comment-item-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.comment-item-lines{font-size:.75rem;color:var(--text-tertiary);font-weight:500;background:none;border:none;cursor:pointer;padding:0;text-decoration:underline;text-decoration-style:dotted;transition:color .15s}.comment-item-lines:hover{color:var(--link-color)}.comment-item-actions{display:flex;gap:.25rem;align-items:center}.comment-item-copy,.comment-item-delete{background:none;border:none;color:var(--text-secondary);cursor:pointer;padding:.125rem .25rem;display:flex;align-items:center;justify-content:center}.comment-item-delete{font-size:1rem;line-height:1}.comment-item-copy:hover{color:var(--link-color)}.comment-item-copy.copied{color:#22863a}.comment-item-delete:hover{color:#d73a49}.comment-item-selection{font-size:.8rem;color:var(--text-tertiary);font-style:italic;margin-bottom:.5rem;padding:.25rem .5rem;background:var(--bg-secondary);border-radius:3px;overflow:hidden;text-overflow:ellipsis}.comment-item-text{color:var(--text-primary);line-height:1.4;white-space:pre-wrap}.dev-container{display:flex;height:100vh;overflow:hidden;position:relative}.dev-sidebar{flex-shrink:0;height:100%;overflow:hidden;background-color:var(--bg-secondary);border-right:1px solid var(--border-primary)}.dev-sidebar:not(.closed){position:relative}.dev-sidebar.closed{width:56px;transition:width .3s ease-in-out}.sidebar-resizer{position:absolute;top:0;right:-2px;width:8px;height:100%;cursor:col-resize;background:transparent;transition:background-color .2s;z-index:10}.sidebar-resizer:before{content:"";position:absolute;top:0;left:50%;transform:translate(-50%);width:1px;height:100%;background-color:transparent;transition:background-color .2s}.sidebar-resizer:hover:before{background-color:var(--link-color);width:2px}.dev-container.resizing .sidebar-resizer:before{background-color:var(--link-color);width:2px}.dev-container.resizing{-webkit-user-select:none;user-select:none;cursor:col-resize}.dev-container.resizing *{cursor:col-resize!important}.sidebar-icon-bar{width:56px;height:100%;display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:8px;background-color:var(--bg-primary)}.icon-bar-spacer{flex:1}.icon-bar-item{width:40px;height:40px;display:flex;align-items:center;justify-content:center;background:none;border:none;border-radius:6px;cursor:pointer;color:var(--text-secondary);transition:background-color .2s,color .2s;padding:0}.icon-bar-item:hover{background-color:var(--bg-secondary);color:var(--text-primary)}.icon-bar-item:active{background-color:var(--bg-tertiary)}.sidebar-content{width:100%;height:100%;overflow:hidden}.dev-main{flex:1;height:100%;overflow-y:auto;background-color:var(--bg-primary)}.dev-loading,.dev-placeholder,.dev-empty{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;color:var(--text-secondary)}.dev-placeholder h2,.dev-empty h2{margin:0 0 8px;font-size:24px;color:var(--text-primary)}.dev-placeholder p,.dev-empty p{margin:4px 0;font-size:14px}.dev-placeholder .file-count{margin-top:16px;padding:8px 16px;background-color:var(--bg-secondary);border-radius:6px;font-weight:500;color:var(--text-primary)}@media(max-width:768px){.dev-sidebar:not(.closed){width:240px}.dev-sidebar.closed{width:56px}}@media(max-width:480px){.dev-container{flex-direction:column}.dev-sidebar{width:100%;height:auto;max-height:40%;border-right:none;border-bottom:1px solid #d0d7de;flex-direction:row}.dev-sidebar.closed{width:100%;height:56px}.sidebar-icon-bar{width:100%;height:56px;flex-direction:row;border-right:none;border-bottom:1px solid var(--border-primary);padding:0 12px}.sidebar-content{display:none}.dev-sidebar:not(.closed) .sidebar-content{display:flex}.dev-main{flex:1}}
|
package/dist/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Markdown Review</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-BZ_-Uaqe.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B_-fb83n.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
// server/index.js
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
3
|
import { serve } from '@hono/node-server';
|
|
4
|
+
import { serveStatic } from '@hono/node-server/serve-static';
|
|
4
5
|
import { readFile, readdir, stat } from 'fs/promises';
|
|
5
|
-
import { basename, join, relative, resolve } from 'path';
|
|
6
|
+
import { basename, join, relative, resolve, dirname } from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
const packageRoot = resolve(__dirname, '..');
|
|
12
|
+
const distDir = resolve(packageRoot, 'dist');
|
|
6
13
|
|
|
7
14
|
// Port validation function
|
|
8
15
|
function validatePort(value) {
|
|
@@ -57,11 +64,8 @@ async function scanMarkdownFiles(dir, baseDir = dir) {
|
|
|
57
64
|
const fullPath = join(dir, entry.name);
|
|
58
65
|
const relativePath = relative(baseDir, fullPath);
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
if (entry.name
|
|
62
|
-
entry.name === 'node_modules' ||
|
|
63
|
-
entry.name === 'dist' ||
|
|
64
|
-
entry.name === 'dist-ssr') {
|
|
67
|
+
const skipPatterns = ['node_modules', 'dist'];
|
|
68
|
+
if (skipPatterns.includes(entry.name)) {
|
|
65
69
|
continue;
|
|
66
70
|
}
|
|
67
71
|
|
|
@@ -142,6 +146,20 @@ app.get('/api/markdown/:path{.+}', async (c) => {
|
|
|
142
146
|
}
|
|
143
147
|
});
|
|
144
148
|
|
|
149
|
+
// Serve static files from dist directory (for production/CLI mode)
|
|
150
|
+
app.use('/*', serveStatic({ root: relative(process.cwd(), distDir) || '.' }));
|
|
151
|
+
|
|
152
|
+
// Fallback to index.html for SPA routing
|
|
153
|
+
app.get('*', async (c) => {
|
|
154
|
+
try {
|
|
155
|
+
const indexPath = resolve(distDir, 'index.html');
|
|
156
|
+
const html = await readFile(indexPath, 'utf-8');
|
|
157
|
+
return c.html(html);
|
|
158
|
+
} catch (err) {
|
|
159
|
+
return c.text('Not found', 404);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
145
163
|
const SERVER_READY_MESSAGE = 'md-review server started';
|
|
146
164
|
|
|
147
165
|
startServer(app, PORT).then((actualPort) => {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.file-tree{height:100%;display:flex;flex-direction:column;background-color:#f6f8fa}.file-tree-header{padding:16px;border-bottom:1px solid #d0d7de;background-color:#fff;display:flex;align-items:center;justify-content:space-between}.file-tree-header-content{flex:1}.file-tree-footer{padding:12px 16px;border-top:1px solid #d0d7de;background-color:#fff}.github-link{display:inline-flex;align-items:center;color:#57606a;transition:color .2s}.github-link:hover{color:#24292f}.file-tree-header h3{margin:0 0 4px;font-size:14px;font-weight:600;color:#24292f}.file-count{font-size:12px;color:#57606a}.sidebar-collapse-button{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:none;border:none;border-radius:6px;cursor:pointer;color:#57606a;transition:background-color .2s,color .2s;padding:0;flex-shrink:0;margin-left:8px}.sidebar-collapse-button:hover{background-color:#f6f8fa;color:#24292f}.sidebar-collapse-button:active{background-color:#eaeef2}.search-container{padding:12px 16px;border-bottom:1px solid #d0d7de;background-color:#fff}.search-input-wrapper{position:relative;display:flex;align-items:center;background-color:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;padding:6px 8px;transition:border-color .2s,background-color .2s}.search-input-wrapper:focus-within{background-color:#fff;border-color:#0969da;box-shadow:0 0 0 3px #0969da1a}.search-icon{font-size:14px;margin-right:6px;color:#57606a;flex-shrink:0}.search-input{flex:1;border:none;background:transparent;outline:none;font-size:14px;color:#24292f;padding:0;min-width:0}.search-input::placeholder{color:#57606a}.search-clear{background:none;border:none;cursor:pointer;padding:0 4px;color:#57606a;font-size:16px;line-height:1;transition:color .2s;flex-shrink:0}.search-clear:hover{color:#24292f}.search-shortcut{margin-left:8px;padding:2px 6px;background-color:#fff;border:1px solid #d0d7de;border-radius:4px;font-size:11px;color:#57606a;font-family:system-ui,-apple-system,sans-serif;flex-shrink:0}.search-input-wrapper:focus-within .search-shortcut{display:none}.file-tree-content{flex:1;overflow-y:auto;padding:8px 0}.tree-item{display:flex;align-items:center;padding:4px 8px;cursor:pointer;font-size:14px;-webkit-user-select:none;user-select:none;transition:background-color .1s}.tree-item:hover{background-color:#eaeef2}.tree-item.file{color:#24292f}.tree-item.file.selected{background-color:#ddf4ff;border-left:2px solid #0969da}.tree-item.directory{color:#24292f;font-weight:500}.chevron-icon{margin-right:4px;color:#57606a;flex-shrink:0;transition:transform .2s ease-in-out}.file-icon,.folder-icon{margin-right:6px;font-size:16px;flex-shrink:0}.tree-item.file .file-icon{margin-left:20px}.file-name,.folder-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-tree-content::-webkit-scrollbar{width:8px}.file-tree-content::-webkit-scrollbar-track{background:#f6f8fa}.file-tree-content::-webkit-scrollbar-thumb{background:#d0d7de;border-radius:4px}.file-tree-content::-webkit-scrollbar-thumb:hover{background:#afb8c1}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
2
|
-
Theme: GitHub
|
|
3
|
-
Description: Light theme as seen on github.com
|
|
4
|
-
Author: github.com
|
|
5
|
-
Maintainer: @Hirse
|
|
6
|
-
Updated: 2021-05-15
|
|
7
|
-
|
|
8
|
-
Outdated base version: https://github.com/primer/github-syntax-light
|
|
9
|
-
Current colors taken from GitHub's CSS
|
|
10
|
-
*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.markdown-with-comments{display:flex;gap:0;min-height:100vh}.markdown-container{flex:1;max-width:900px;padding:2rem;padding-right:320px;position:relative;margin:0 auto}.comments-sidebar{width:300px;flex-shrink:0;border-left:1px solid #e1e4e8;background:#f6f8fa;padding:1rem;height:100vh;position:fixed;top:0;right:0;overflow-y:auto}.markdown-header{border-bottom:2px solid #e1e4e8;padding-bottom:1rem;margin-bottom:2rem}.markdown-header h1{font-size:1.5rem;color:#24292e;margin:0}.markdown-content{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;font-size:16px;line-height:1.6;color:#24292e;position:relative;padding-left:0}.markdown-content h1{font-size:2em;border-bottom:1px solid #eaecef;padding-bottom:.3em;margin-top:1.5em;margin-bottom:.5em}.markdown-content h2{font-size:1.5em;border-bottom:1px solid #eaecef;padding-bottom:.3em;margin-top:1.5em;margin-bottom:.5em}.markdown-content h3{font-size:1.25em;margin-top:1.5em;margin-bottom:.5em}.markdown-content h4{font-size:1em;margin-top:1.5em;margin-bottom:.5em}.markdown-content pre{background-color:#f6f8fa;border-radius:6px;padding:16px;overflow:auto;font-size:14px;line-height:1.45}.markdown-content code{background-color:#f6f8fa;padding:.2em .4em;border-radius:3px;font-size:85%;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace}.markdown-content pre code{background-color:transparent;padding:0;font-size:100%}.markdown-content ul,.markdown-content ol{padding-left:2em;margin-top:0;margin-bottom:16px}.markdown-content li{margin-top:.25em}.markdown-content blockquote{padding:0 1em;color:#6a737d;border-left:4px solid #dfe2e5;margin:0 0 16px}.markdown-content table{border-collapse:collapse;width:100%;margin-bottom:16px}.markdown-content table th,.markdown-content table td{padding:6px 13px;border:1px solid #dfe2e5}.markdown-content table th{font-weight:600;background-color:#f6f8fa}.markdown-content table tr{background-color:#fff;border-top:1px solid #c6cbd1}.markdown-content table tr:nth-child(2n){background-color:#f6f8fa}.markdown-content a{color:#0366d6;text-decoration:none}.markdown-content a:hover{text-decoration:underline}.markdown-content hr{height:.25em;padding:0;margin:24px 0;background-color:#e1e4e8;border:0}.markdown-content input[type=checkbox]{margin-right:.5em}.line-range{font-size:.75rem;font-weight:400;color:#6a737d;margin-left:.5rem}.selection-popover{display:flex;gap:4px;background:#1f2937;border-radius:6px;padding:4px;box-shadow:0 4px 12px #0000004d;z-index:1000}.popover-button{background:transparent;border:none;color:#e5e7eb;font-size:12px;padding:6px 10px;border-radius:4px;cursor:pointer;white-space:nowrap;transition:background-color .15s}.popover-button:hover{background:#374151}.popover-button:active{background:#4b5563}.comment-form{display:flex;flex-direction:column;gap:8px;min-width:280px}.comment-input{background:#374151;border:1px solid #4b5563;border-radius:4px;color:#e5e7eb;font-size:13px;padding:8px;resize:vertical;min-height:60px;font-family:inherit}.comment-input:focus{outline:none;border-color:#6b7280}.comment-input::placeholder{color:#9ca3af}.comment-actions{display:flex;justify-content:flex-end;gap:8px}.comment-cancel,.comment-submit{font-size:12px;padding:6px 12px;border-radius:4px;cursor:pointer;border:none;transition:background-color .15s}.comment-cancel{background:transparent;color:#9ca3af}.comment-cancel:hover{background:#374151;color:#e5e7eb}.comment-submit{background:#3b82f6;color:#fff}.comment-submit:hover{background:#2563eb}.comment-submit:disabled{background:#4b5563;color:#9ca3af;cursor:not-allowed}.selection-highlight{background-color:#0000001a;border-radius:2px}.comment-list-empty{text-align:center;color:#6a737d;padding:2rem 1rem}.comment-list-empty p{margin:.5rem 0}.comment-list-hint{font-size:.85rem;color:#959da5}.comment-list-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:1px solid #e1e4e8}.comment-list-title{font-size:.9rem;font-weight:600;color:#24292e;margin:0}.comment-list-copy-all{display:flex;align-items:center;gap:.25rem;background:none;border:1px solid #e1e4e8;border-radius:4px;padding:.25rem .5rem;font-size:.75rem;color:#6a737d;cursor:pointer;transition:all .15s}.comment-list-copy-all:hover{background:#f6f8fa;color:#0366d6;border-color:#0366d6}.comment-list-copy-all.copied{color:#22863a;border-color:#22863a}.comment-list-actions{display:flex;gap:.5rem}.comment-list-delete-all{display:flex;align-items:center;gap:.25rem;background:none;border:1px solid #e1e4e8;border-radius:4px;padding:.25rem .5rem;font-size:.75rem;color:#6a737d;cursor:pointer;transition:all .15s}.comment-list-delete-all:hover{background:#ffeef0;color:#d73a49;border-color:#d73a49}.comment-list-items{display:flex;flex-direction:column;gap:.75rem}.comment-item{background:#fff;border:1px solid #e1e4e8;border-radius:6px;padding:.75rem;font-size:.85rem}.comment-item-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.comment-item-lines{font-size:.75rem;color:#6a737d;font-weight:500}.comment-item-actions{display:flex;gap:.25rem;align-items:center}.comment-item-copy,.comment-item-delete{background:none;border:none;color:#959da5;cursor:pointer;padding:.125rem .25rem;display:flex;align-items:center;justify-content:center}.comment-item-delete{font-size:1rem;line-height:1}.comment-item-copy:hover{color:#0366d6}.comment-item-copy.copied{color:#22863a}.comment-item-delete:hover{color:#d73a49}.comment-item-selection{font-size:.8rem;color:#6a737d;font-style:italic;margin-bottom:.5rem;padding:.25rem .5rem;background:#f6f8fa;border-radius:3px;overflow:hidden;text-overflow:ellipsis}.comment-item-text{color:#24292e;line-height:1.4;white-space:pre-wrap}.dev-container{display:flex;height:100vh;overflow:hidden;position:relative}.dev-sidebar{flex-shrink:0;height:100%;overflow:hidden;transition:width .3s ease-in-out;background-color:#f6f8fa;border-right:1px solid #d0d7de}.dev-sidebar:not(.closed){width:300px}.dev-sidebar.closed{width:56px}.sidebar-icon-bar{width:56px;height:100%;display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:8px;background-color:#fff}.icon-bar-item{width:40px;height:40px;display:flex;align-items:center;justify-content:center;background:none;border:none;border-radius:6px;cursor:pointer;color:#57606a;transition:background-color .2s,color .2s;padding:0}.icon-bar-item:hover{background-color:#f6f8fa;color:#24292f}.icon-bar-item:active{background-color:#eaeef2}.sidebar-content{width:300px;height:100%;overflow:hidden}.dev-main{flex:1;height:100%;overflow-y:auto;background-color:#fff}.dev-loading,.dev-placeholder,.dev-empty{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;color:#57606a}.dev-placeholder h2,.dev-empty h2{margin:0 0 8px;font-size:24px;color:#24292f}.dev-placeholder p,.dev-empty p{margin:4px 0;font-size:14px}.dev-placeholder .file-count{margin-top:16px;padding:8px 16px;background-color:#f6f8fa;border-radius:6px;font-weight:500;color:#24292f}@media(max-width:768px){.dev-sidebar{width:250px}.dev-sidebar.closed{width:56px}}@media(max-width:480px){.dev-container{flex-direction:column}.dev-sidebar{width:100%;height:auto;max-height:40%;border-right:none;border-bottom:1px solid #d0d7de;flex-direction:row}.dev-sidebar.closed{width:100%;height:56px}.sidebar-icon-bar{width:100%;height:56px;flex-direction:row;border-right:none;border-bottom:1px solid #d0d7de;padding:0 12px}.sidebar-content{display:none}.dev-sidebar:not(.closed) .sidebar-content{display:flex}.dev-main{flex:1}}
|