From 5644c9c4e91488113d91960760becf4de66cb38c Mon Sep 17 00:00:00 2001
From: wallpants <47203170+wallpants@users.noreply.github.com>
Date: Sat, 30 May 2026 13:17:32 -0600
Subject: [PATCH 1/4] fix(dependencies): update dependencies & replace prettier
with oxfmt
---
.eslintrc.cjs | 54 +-
.oxfmtrc.json | 21 +
.prettierignore | 2 -
.prettierrc.json | 11 -
README.md | 24 +-
app/github-preview.ts | 503 +++---
app/global.d.ts | 1 +
app/index.ts | 74 +-
app/nvim/on-before-exit.ts | 26 +-
app/nvim/on-config-update.ts | 8 +-
app/nvim/on-content-change.ts | 100 +-
app/nvim/on-cursor-move.ts | 26 +-
app/sample.test.ts | 2 +-
app/server/http.ts | 196 ++-
app/server/index.ts | 16 +-
app/server/websocket.ts | 158 +-
app/tsconfig.json | 6 +-
app/types.ts | 294 ++--
app/web/.eslintrc.cjs | 34 +-
app/web/app.tsx | 21 +-
app/web/components/explorer/entry.tsx | 157 +-
app/web/components/explorer/footer.tsx | 46 +-
app/web/components/explorer/header.tsx | 104 +-
app/web/components/explorer/index.tsx | 114 +-
.../explorer/settings/collapsed-option.tsx | 188 +--
.../explorer/settings/collapsed.tsx | 100 +-
.../components/explorer/settings/index.tsx | 162 +-
.../components/explorer/settings/option.tsx | 236 +--
.../explorer/settings/options/cursorline.tsx | 84 +-
.../settings/options/details-tags.tsx | 50 +-
.../explorer/settings/options/scroll.tsx | 62 +-
.../explorer/settings/options/single-file.tsx | 48 +-
.../explorer/settings/options/theme.tsx | 95 +-
.../components/explorer/settings/select.tsx | 110 +-
app/web/components/filling-circle.tsx | 60 +-
app/web/components/icon-button.tsx | 60 +-
app/web/components/icons/check.tsx | 30 +-
app/web/components/icons/chevron-right.tsx | 28 +-
app/web/components/icons/close.tsx | 32 +-
app/web/components/icons/copy.tsx | 32 +-
app/web/components/icons/cursorline.tsx | 32 +-
app/web/components/icons/dir.tsx | 26 +-
app/web/components/icons/file.tsx | 30 +-
app/web/components/icons/fold-vertical.tsx | 44 +-
app/web/components/icons/moon.tsx | 26 +-
app/web/components/icons/mouse.tsx | 32 +-
app/web/components/icons/open-dir.tsx | 26 +-
app/web/components/icons/panel-close.tsx | 30 +-
app/web/components/icons/panel-open.tsx | 30 +-
app/web/components/icons/pin-off.tsx | 36 +-
app/web/components/icons/pin.tsx | 32 +-
app/web/components/icons/settings.tsx | 32 +-
app/web/components/icons/sun.tsx | 42 +-
app/web/components/icons/system.tsx | 26 +-
app/web/components/icons/unfold-vertical.tsx | 44 +-
app/web/components/markdown/breadcrumbs.tsx | 116 +-
app/web/components/markdown/cursor-line.tsx | 92 +-
app/web/components/markdown/explorer.tsx | 104 +-
app/web/components/markdown/index.tsx | 282 ++--
app/web/components/markdown/line-numbers.tsx | 58 +-
app/web/components/markdown/mermaid.ts | 145 +-
app/web/components/markdown/post-process.ts | 264 +--
app/web/components/markdown/scroll.ts | 344 ++--
app/web/components/theme-provider.tsx | 92 +-
app/web/components/toggle.tsx | 32 +-
.../components/websocket-provider/context.ts | 42 +-
.../websocket-provider/provider.tsx | 208 +--
app/web/index.html | 32 +-
app/web/index.tsx | 6 +-
app/web/postcss.config.cjs | 10 +-
app/web/static/index.css | 76 +-
app/web/static/preflight.css | 184 +--
app/web/tailwind.config.mjs | 120 +-
app/web/use-on-document-click.ts | 40 +-
app/web/utils.ts | 90 +-
app/web/vite.config.ts | 34 +-
bun.lock | 1452 ++++++++---------
package.json | 106 +-
78 files changed, 3801 insertions(+), 3991 deletions(-)
create mode 100644 .oxfmtrc.json
delete mode 100644 .prettierignore
delete mode 100644 .prettierrc.json
create mode 100644 app/global.d.ts
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index f93cba77..c788e184 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -1,30 +1,30 @@
/** @type {import('eslint').ESLint.Options} */
module.exports = {
- root: true,
- ignorePatterns: [".eslintrc.cjs"],
- parser: "@typescript-eslint/parser",
- parserOptions: {
- ecmaVersion: "latest",
- sourceType: "module",
- project: [__dirname + "/app/tsconfig.json"],
- },
- extends: [
- "eslint:recommended",
- "plugin:@typescript-eslint/strict-type-checked",
- "plugin:@typescript-eslint/stylistic-type-checked",
- ],
- rules: {
- "@typescript-eslint/no-unused-expressions": "off",
- "@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
- "@typescript-eslint/no-non-null-assertion": "off",
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
- "@typescript-eslint/no-unused-vars": [
- "error",
- { argsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" },
- ],
- "@typescript-eslint/consistent-type-imports": [
- "warn",
- { prefer: "type-imports", fixStyle: "inline-type-imports" },
- ],
- },
+ root: true,
+ ignorePatterns: [".eslintrc.cjs"],
+ parser: "@typescript-eslint/parser",
+ parserOptions: {
+ ecmaVersion: "latest",
+ sourceType: "module",
+ project: [__dirname + "/app/tsconfig.json"],
+ },
+ extends: [
+ "eslint:recommended",
+ "plugin:@typescript-eslint/strict-type-checked",
+ "plugin:@typescript-eslint/stylistic-type-checked",
+ ],
+ rules: {
+ "@typescript-eslint/no-unused-expressions": "off",
+ "@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }],
+ "@typescript-eslint/no-non-null-assertion": "off",
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
+ "@typescript-eslint/no-unused-vars": [
+ "error",
+ { argsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" },
+ ],
+ "@typescript-eslint/consistent-type-imports": [
+ "warn",
+ { prefer: "type-imports", fixStyle: "inline-type-imports" },
+ ],
+ },
};
diff --git a/.oxfmtrc.json b/.oxfmtrc.json
new file mode 100644
index 00000000..0b0784a7
--- /dev/null
+++ b/.oxfmtrc.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "./node_modules/oxfmt/configuration_schema.json",
+ "ignorePatterns": [".github", "tailwind.css"],
+ "printWidth": 100,
+ "tabWidth": 3,
+ "sortImports": {
+ "newlinesBetween": false
+ },
+ "sortTailwindcss": {
+ "stylesheet": "./app/web/static/tailwind.css",
+ "functions": ["cn"]
+ },
+ "overrides": [
+ {
+ "files": ["*.json", "*.md"],
+ "options": {
+ "tabWidth": 2
+ }
+ }
+ ]
+}
diff --git a/.prettierignore b/.prettierignore
deleted file mode 100644
index 26b57c6a..00000000
--- a/.prettierignore
+++ /dev/null
@@ -1,2 +0,0 @@
-tailwind.css
-.github/dependabot.yml
diff --git a/.prettierrc.json b/.prettierrc.json
deleted file mode 100644
index 081f39bd..00000000
--- a/.prettierrc.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "tabWidth": 4,
- "printWidth": 100,
- "plugins": ["prettier-plugin-organize-imports"],
- "overrides": [
- {
- "files": ["*.json", "*.md", "*.yml"],
- "options": { "tabWidth": 2 }
- }
- ]
-}
diff --git a/README.md b/README.md
index 61887b30..9ddea764 100644
--- a/README.md
+++ b/README.md
@@ -12,21 +12,21 @@ https://github.com/wallpants/github-preview.nvim/assets/47203170/e332a671-0ee4-4
## ✨ Features
-* [💻 Linux / macOS / WSL](/docs/FEATURES.md#-linux--macos--wsl)
-* [🔴 LIVE updates](/docs/FEATURES.md#-live-updates)
-* [♻️ Synced Scrolling](/docs/FEATURES.md#%EF%B8%8F-synced-scrolling)
-* [🌈 Dark & Light modes](/docs/FEATURES.md#-dark--light-modes)
-* [🖍️ Cursorline in Preview](/docs/FEATURES.md#%EF%B8%8F-cursorline-in-preview)
-* [📹 Video Support](/docs/FEATURES.md#-video-support)
-* [🏞️ Local Image Support](/docs/FEATURES.md#%EF%B8%8F-local-image-support)
-* [🧜 Mermaid Support](/docs/FEATURES.md#-mermaid-support)
-* [📌 Single-file mode](/docs/FEATURES.md#-single-file-mode)
-* [📂 Repository mode](/docs/FEATURES.md#-repository-mode)
+- [💻 Linux / macOS / WSL](/docs/FEATURES.md#-linux--macos--wsl)
+- [🔴 LIVE updates](/docs/FEATURES.md#-live-updates)
+- [♻️ Synced Scrolling](/docs/FEATURES.md#%EF%B8%8F-synced-scrolling)
+- [🌈 Dark & Light modes](/docs/FEATURES.md#-dark--light-modes)
+- [🖍️ Cursorline in Preview](/docs/FEATURES.md#%EF%B8%8F-cursorline-in-preview)
+- [📹 Video Support](/docs/FEATURES.md#-video-support)
+- [🏞️ Local Image Support](/docs/FEATURES.md#%EF%B8%8F-local-image-support)
+- [🧜 Mermaid Support](/docs/FEATURES.md#-mermaid-support)
+- [📌 Single-file mode](/docs/FEATURES.md#-single-file-mode)
+- [📂 Repository mode](/docs/FEATURES.md#-repository-mode)
## ✅ Requirements
-* [x] [Bun](https://bun.sh)
-* [x] [Neovim](https://neovim.io)
+- [x] [Bun](https://bun.sh)
+- [x] [Neovim](https://neovim.io)
## 📦 Installation
diff --git a/app/github-preview.ts b/app/github-preview.ts
index ddbf451f..35985b28 100644
--- a/app/github-preview.ts
+++ b/app/github-preview.ts
@@ -1,300 +1,297 @@
+import { existsSync } from "node:fs";
+import { basename, dirname, normalize, resolve } from "node:path";
import { type Server } from "bun";
import { NVIM_LOG_LEVELS, attach, type LogLevel, type Nvim } from "bunvim";
import { globby } from "globby";
import { isBinaryFile } from "isbinaryfile";
-import { existsSync } from "node:fs";
-import { basename, dirname, normalize, resolve } from "node:path";
import { parse } from "valibot";
import { startServer } from "./server";
import { UNALIVE_URL } from "./server/http";
import { EDITOR_EVENTS_TOPIC } from "./server/websocket";
import {
- PluginPropsSchema,
- type Config,
- type ContentChange,
- type CustomEvents,
- type PluginProps,
- type UpdateConfigAction,
- type WsServerMessage,
+ PluginPropsSchema,
+ type Config,
+ type ContentChange,
+ type CustomEvents,
+ type PluginProps,
+ type UpdateConfigAction,
+ type WsServerMessage,
} from "./types";
const ENV = {
- NVIM: process.env["NVIM"],
- LOG_LEVEL: process.env["LOG_LEVEL"] as LogLevel | undefined,
- DEV: Boolean(process.env["IS_DEV"]),
+ NVIM: process.env["NVIM"],
+ LOG_LEVEL: process.env["LOG_LEVEL"] as LogLevel | undefined,
+ DEV: Boolean(process.env["IS_DEV"]),
};
export class GithubPreview {
- nvim: Nvim
- with ♥️ by{" "}
-
- wallpants.io
-
-
+ with ♥️ by{" "}
+
+ wallpants.io
- )}
- File explorer only available when in repository mode. File explorer only available when in repository mode.
- Temporarily override your settings.
-
+ Temporarily override your settings.
+ {name} {name} {disabled} {disabled}
+
+
+ )}
+ Files
- Files
+ Single-file mode
+ Single-file mode
-
- To persist changes, update your{" "}
-
- neovim config files
-
- .
-
+ To persist changes, update your{" "}
+
+ neovim config files
+
+ .
+
+
with ♥️ by{" "}
wallpants.io
@@ -21,7 +22,7 @@ export const Footer = ({ isExpanded }: { isExpanded: boolean }) => (
rel="noreferrer"
className="size-8 overflow-hidden rounded-full"
>
-
+
)}