@youtyan/code-viewer 0.8.8 → 0.9.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/README.md +57 -17
- package/dist/code-viewer.js +716 -138
- package/package.json +1 -1
- package/skills/code-viewer-query/SKILL.md +3 -1
- package/web/app.js +304 -89
- package/web/style.css +10 -4
package/README.md
CHANGED
|
@@ -32,9 +32,9 @@ Requires Node.js 20 or newer when installed from npm. Development uses
|
|
|
32
32
|
- Switch the viewer UI between English and Japanese from Viewer Settings —
|
|
33
33
|
the language toggle live-updates every screen including the datastore
|
|
34
34
|
viewer.
|
|
35
|
-
- Browse SQLite, PostgreSQL, MySQL, Redis, Elasticsearch,
|
|
36
|
-
S3-compatible object storage (MinIO, LocalStack
|
|
37
|
-
viewer.
|
|
35
|
+
- Browse SQLite, PostgreSQL, MySQL, Cloudflare D1, Redis, Elasticsearch,
|
|
36
|
+
DynamoDB, and S3-compatible object storage (MinIO, LocalStack, Cloudflare R2)
|
|
37
|
+
with a built-in datastore viewer.
|
|
38
38
|
Local Supabase CLI (`supabase start`) Postgres projects are auto-discovered
|
|
39
39
|
too, without needing a `docker-compose.yml`.
|
|
40
40
|
Table descriptions appear inside expanded table entries and in the Schema
|
|
@@ -144,7 +144,11 @@ metadata instead of dumping bytes as text.
|
|
|
144
144
|
Markdown files use a dedicated preview tab. Relative links and images are
|
|
145
145
|
resolved inside the repository, code blocks are highlighted with Shiki, and
|
|
146
146
|
Mermaid diagrams are rendered lazily in the browser (click any diagram to
|
|
147
|
-
open it in a lightbox).
|
|
147
|
+
open it in a lightbox). Relative links lead to the same destinations as they
|
|
148
|
+
do on GitHub: another Markdown file opens its file page, an `#anchor` opens
|
|
149
|
+
the preview and scrolls to that heading, a non-Markdown file opens in the
|
|
150
|
+
Code view, and a link to a directory opens that folder in the repository
|
|
151
|
+
tree.
|
|
148
152
|
|
|
149
153
|
A file detail page lays out up to four tabs — **Preview**, **Code**,
|
|
150
154
|
**Blame**, **History** — modelled after the GitHub file view. For text files
|
|
@@ -152,7 +156,9 @@ A file detail page lays out up to four tabs — **Preview**, **Code**,
|
|
|
152
156
|
preview. Media files (images, video, audio, PDF) show a **Preview** tab only
|
|
153
157
|
— there is no Code tab for binary media. `Blame` and `History` each have
|
|
154
158
|
their own canonical URL (`view=blame`, `view=history`), so deep links and
|
|
155
|
-
the browser back/forward stay in sync.
|
|
159
|
+
the browser back/forward stay in sync. Opening another file from the
|
|
160
|
+
repository tree keeps the active tab (a file that cannot be previewed falls
|
|
161
|
+
back to Code). The Blame tab reuses the source
|
|
156
162
|
view's row component, so line numbers, drag-selection of `line=` ranges,
|
|
157
163
|
syntax highlighting and the Viewer Settings code font size all match the
|
|
158
164
|
Code tab.
|
|
@@ -272,7 +278,23 @@ global/local secondary indexes, and non-key attribute types inferred from
|
|
|
272
278
|
loaded items) alongside scan or query items, `LastEvaluatedKey` pagination,
|
|
273
279
|
and an item detail view with a copyable key. The explorer is read-only.
|
|
274
280
|
|
|
275
|
-
**
|
|
281
|
+
**Cloudflare D1** support: add a saved connection with a Cloudflare account ID,
|
|
282
|
+
database ID, and API token (needs the `D1:Read` permission). The database is
|
|
283
|
+
browsed over the D1 REST API (`POST /accounts/{account}/d1/database/{db}/raw`)
|
|
284
|
+
and reuses the SQL screens — table list, row grid, query editor, schema, ER
|
|
285
|
+
diagram, snapshots and diffs. D1 is SQLite, so the same `sqlite_master` and
|
|
286
|
+
`PRAGMA table_info` / `index_list` / `foreign_key_list` introspection is used.
|
|
287
|
+
The connection is read-only: the query editor accepts only
|
|
288
|
+
`SELECT` / `PRAGMA` / `EXPLAIN` / `WITH`, and the grid's row editing is
|
|
289
|
+
unavailable.
|
|
290
|
+
|
|
291
|
+
**Cloudflare R2**: R2 speaks the S3 API, so it is a saved connection of type
|
|
292
|
+
`s3` with the **Cloudflare R2** provider preset. Enter the account ID and an R2
|
|
293
|
+
access key pair; the endpoint (`https://<account-id>.r2.cloudflarestorage.com`)
|
|
294
|
+
and the required `auto` signing region are filled in for you. Everything in the
|
|
295
|
+
object-storage section below applies.
|
|
296
|
+
|
|
297
|
+
**S3-compatible object storage** (MinIO, LocalStack, Cloudflare R2): browse
|
|
276
298
|
buckets as a folder tree, search by prefix or filename, sort scanned objects by
|
|
277
299
|
update time, and preview images, video, audio, PDFs, Markdown, HTML, and text
|
|
278
300
|
files. Edit text/markdown/JSON object bodies inline, upload new objects to any
|
|
@@ -289,27 +311,45 @@ table grid to insert, update, or delete rows inline. Edits queue as pending
|
|
|
289
311
|
changes (shown with a yellow highlight on the affected row/cell) and are
|
|
290
312
|
applied as a single transaction on commit. Row updates and deletes require the
|
|
291
313
|
table to have a primary key. The whole batch rolls back on the first
|
|
292
|
-
constraint violation.
|
|
314
|
+
constraint violation. Cloudflare D1 is browsed read-only, so Edit mode is not
|
|
315
|
+
offered there.
|
|
293
316
|
|
|
294
317
|
### Browser UI
|
|
295
318
|
|
|
296
319
|
Open Datastores in the global navigation to access:
|
|
297
320
|
|
|
298
321
|
- **Saved connections** — use the `+` action beside the datastore selector to
|
|
299
|
-
add PostgreSQL, MySQL, Redis, Elasticsearch, S3-compatible
|
|
300
|
-
endpoints that are not present in the
|
|
322
|
+
add PostgreSQL, MySQL, Cloudflare D1, Redis, Elasticsearch, S3-compatible
|
|
323
|
+
(including Cloudflare R2), or DynamoDB endpoints that are not present in the
|
|
324
|
+
repository's local discovery files.
|
|
301
325
|
Required fields are marked in the connection dialog, and **Test connection**
|
|
302
326
|
verifies the current values before saving. Saved connections can be edited
|
|
303
327
|
or deleted from the adjacent actions.
|
|
304
328
|
PostgreSQL, MySQL, and Redis use Node.js drivers installed automatically with
|
|
305
|
-
this package, while Elasticsearch, S3, and DynamoDB use
|
|
306
|
-
clients. No database CLI or `curl` installation is required for
|
|
307
|
-
connections.
|
|
308
|
-
Non-secret settings
|
|
309
|
-
User names, access key
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
329
|
+
this package, while Cloudflare D1, Elasticsearch, S3, and DynamoDB use
|
|
330
|
+
built-in HTTP clients. No database CLI or `curl` installation is required for
|
|
331
|
+
saved connections.
|
|
332
|
+
Non-secret settings (host, endpoint, account/database id, region, …) are
|
|
333
|
+
stored in `.code-viewer/datastore-connections.json`. User names, access key
|
|
334
|
+
IDs, passwords, secret keys, session tokens, and API tokens are never written
|
|
335
|
+
to that file and are never returned by list/edit responses.
|
|
336
|
+
|
|
337
|
+
Those credentials are kept in the macOS Keychain (one generic-password item
|
|
338
|
+
per connection, service `code-viewer`) and reloaded on demand, so they
|
|
339
|
+
survive a restart without being stored anywhere in the repository. The
|
|
340
|
+
keychain item is written through `security -i`, which reads the command from
|
|
341
|
+
stdin, so the secret never appears in any process's argument list. Deleting a
|
|
342
|
+
connection also deletes its keychain item; if that fails (a locked keychain,
|
|
343
|
+
for example) the connection is still removed and the UI says the credentials
|
|
344
|
+
were left behind, so you can clear them from Keychain Access yourself.
|
|
345
|
+
|
|
346
|
+
Credentials are deliberately not encrypted into a file next to the data: a
|
|
347
|
+
file the app can decrypt unattended needs its key on the same disk, which is
|
|
348
|
+
no stronger than plaintext. Key protection is left to the OS.
|
|
349
|
+
|
|
350
|
+
On platforms without keychain integration (currently everything except
|
|
351
|
+
macOS), credentials stay in server memory only and must be entered again
|
|
352
|
+
after restarting code-viewer.
|
|
313
353
|
|
|
314
354
|
- **Multi-DB tabs** — open multiple databases side by side, with their own
|
|
315
355
|
sidebar, panes, and history. `+` adds an empty tab; `×` or middle-click
|