Commit graph

57 commits

Author SHA1 Message Date
Barrett Ruth
c5c69e9ec2
fix: prevent infinite loop when started from non-filesystem buffer (#35)
Some checks are pending
quality / changes (push) Waiting to run
quality / Lua Format Check (push) Blocked by required conditions
quality / Lua Lint Check (push) Blocked by required conditions
quality / Lua Type Check (push) Blocked by required conditions
quality / Markdown Format Check (push) Blocked by required conditions
## Problem

Calling \`:LiveServerStart\` from an oil.nvim buffer (or any URI-scheme
buffer) caused two issues: first, \`find_cached_dir\` entered an
infinite loop as \`fnamemodify(cur, ':h')\` degenerated to \`.\`,
freezing Neovim and pegging the CPU; second, even after fixing the loop,
the server would error out instead of doing the right thing — serving
the directory being browsed.

## Solution

Add a progress check to \`find_cached_dir\` so it bails if the path
stops changing. Fix \`resolve_dir\` to detect URI-scheme buffer names
(e.g. \`oil:///path/to/dir\`) and extract the real filesystem path from
them, so \`:LiveServerStart\` correctly serves the browsed directory.
Also corrects the bug report repro template (\`require('lazy')\`, \`lazy
= false\`, no deprecated \`opts\`) and ignores \`repro.lua\`.

Closes #34
2026-03-06 11:58:46 -05:00
f18dfa0a8d
ci: nix 2026-03-04 14:11:41 -05:00
a4386c9f4d
ci : scripts + format 2026-03-04 13:42:15 -05:00
Barrett Ruth
f42f958c24
feat: replace npm live-server with pure-Lua HTTP server (#29)
## Problem

The plugin requires users to install Node.js and the `live-server` npm
package globally. This is a heavyweight external dependency for what
amounts to a simple local dev-server workflow, and it creates friction
for users who don't otherwise need Node.js.

## Solution

Replace the npm shell-out with a pure-Lua HTTP server built on `vim.uv`
(libuv bindings), eliminating all external dependencies. The new server
supports static file serving, SSE-based live reload, CSS hot-swap
without full page reload, directory listings, and recursive file
watching with configurable debounce.

Minimum Neovim version is bumped to 0.10 for `vim.uv` and `vim.ui.open`.
The old `args`-based config is automatically migrated with a deprecation
warning.

Closes #28.
2026-03-02 23:16:35 -05:00
Barrett Ruth
baeb211719
fix: add one-time deprecation notice for Neovim < 0.10 (#31)
## Problem

v0.2.0 will replace the npm `live-server` dependency with a pure-Lua
HTTP
server that requires Neovim >= 0.10 (`vim.uv`, `vim.ui.open`). Users on
older Neovim versions who auto-update will get a cryptic Lua error with
no
explanation or migration path.

## Solution

Add a one-time notification at plugin load time for Neovim < 0.10 users.
The notice tells them v0.2.0 will require Neovim >= 0.10 and shows how
to
pin to the `v0.1.6` tag. A marker file in `stdpath('data')` ensures the
message fires exactly once, ever. The plugin continues to work normally
after the notice — no functionality is removed.

This is the last release supporting Neovim < 0.10 and npm `live-server`.
Tag as `v0.1.6` after merge.
2026-02-23 13:08:52 -05:00
Barrett Ruth
26dafe2f08
feat: add <Plug> mappings (#27)
## Problem

Users who want keybindings must call Lua functions directly or wrap
commands in closures. There is no stable public API for key binding.

## Solution

Define <Plug> mappings in the plugin file and document them in a new
MAPPINGS section in the vimdoc.
2026-02-07 14:02:00 -05:00
a59bec1ae3 feat(doc): luacats and other docs 2026-02-04 01:05:57 -05:00
8d6605cbac fix: move readme 2026-02-03 22:37:54 -05:00
Barrett Ruth
76199cefaa
Merge pull request #26 from barrettruth/docs/modernize-readme
docs: modernize readme
2026-02-03 22:36:31 -05:00
d7d189a2e9 docs: modernize readme 2026-02-03 22:33:01 -05:00
c867f5efb7 fix(ci): add license 2026-02-03 21:28:34 -05:00
Barrett Ruth
771d8d7b38
Merge pull request #25 from barrettruth/docs/modernize
docs: modernize readme and vimdoc
2026-02-03 21:12:11 -05:00
4ee3715efa docs: modernize readme and vimdoc
- Update homepage URL to barrettruth.com
- Replace setup() docs with vim.g.live_server config
- Add luarocks installation to readme
- Remove lazy.nvim specific example
2026-02-03 21:11:26 -05:00
Barrett Ruth
4aeb022382
Merge pull request #23 from barrettruth/chore/update-project-configs
chore: update project configs
2026-02-03 21:07:23 -05:00
0745539d40 fix: suppress deprecation stack trace for cleaner UX 2026-02-03 21:05:52 -05:00
8f4693452a feat: run pre-commit 2026-02-03 21:03:18 -05:00
657575ae30 chore: add CI, pre-commit, and luarocks configs
- Add CI workflows (format, lint, typecheck)
- Add quality workflow
- Add luarocks publishing workflow
- Add pre-commit configuration
- Add luarocks rockspec
- Add selene.toml for linting
- Remove issue template
2026-02-03 21:01:57 -05:00
0342a892fb chore: update project configs to match cp.nvim
- Add .editorconfig
- Add .luarc.json for LSP support
- Rename .stylua.toml to stylua.toml
- Update .gitignore
2026-02-03 21:00:07 -05:00
55331ee545 fix: use vim.deprecate with v0.1.0 2026-02-03 20:50:54 -05:00
d4679799d7 fix: use vim.notify_once for deprecation warning 2026-02-03 20:48:05 -05:00
e8681e97fd fix: add deprecated setup() for backward compatibility
Restores setup() with deprecation warning via vim.deprecate(). Users can
continue using setup() while migrating to vim.g.live_server.
2026-02-03 20:47:23 -05:00
Barrett Ruth
5bb05f40c9
Merge pull request #19 from barrettruth/refactor/vim-g-config
refactor: use vim.g config and lazy loading
2026-02-03 20:33:31 -05:00
af7255b0a0 refactor: use vim.g config and lazy loading
Replace setup() with vim.g.live_server configuration. Add plugin/ file
with load guard and user commands for proper lazy loading.
2026-02-03 20:13:12 -05:00
Barrett Ruth
58f2e30e02
Update readme.md 2026-01-10 11:03:18 -06:00
Barrett Ruth
e8a34bc37f
Merge pull request #17 from powN1/port-notification
Add port notification on start
2025-05-29 14:42:43 -05:00
powN
ade465ef36 Add port notification on start 2025-05-26 18:22:04 +02:00
Barrett Ruth
75cd33beec
Merge pull request #16 from wasubu/fix/windows-dir-safety
Improve Windows support and add error message for nil directory in live-server.nvim
2025-05-24 00:05:35 -05:00
Barrett Ruth
d2694d2324
Merge pull request #15 from wasubu/fix/windows-cmd-path
Fix: Use .cmd path for Windows compatibility
2025-05-24 00:04:54 -05:00
wasubu
d92306bde3 Improve Windows support and add error message for nil dir 2025-05-23 12:59:03 +09:00
wasubu
bdd92e83fd Fix Windows path for live-server command 2025-05-23 12:41:42 +09:00
Barrett Ruth
3547fecc98
Merge pull request #14 from tolu-c/main
Added Development Server information
2025-01-29 20:44:03 -05:00
webDevTolu
c22d3f1443
Update readme.md
Added Development server information
2025-01-28 23:56:43 +01:00
5fc8abb727 fix: resolve root dir if not specified 2024-07-21 19:13:57 -05:00
fde21e3dc4 feat: resolve directories correctly 2024-07-14 19:55:52 -05:00
84751fd8a7 feat(doc): optional dir arg to commands 2024-07-13 19:10:13 -05:00
da3496d878 feat: take in optional dir arg 2024-07-13 13:52:53 -05:00
Barrett Ruth
f34ae262bf
Merge pull request #10 from mrcapivaro/main
fix: infinite loop on the find_cached_dir function on the Windows OS
2024-06-18 14:15:06 +00:00
mrcapivaro
d55461ffdb fix: infinite loop on the find_cached_dir function on the Windows OS 2024-06-18 00:03:51 -03:00
Barrett Ruth
0b4d31c665
Merge pull request #8 from IamGideonIdoko/main
Replace yarn with pnpm link in installation example
2024-02-18 11:09:47 -05:00
ꁅꀤꀸꍟꂦꈤ
e4c4639463
readme: replace yarn with pnpm link in installation example 2024-02-17 04:54:31 +01:00
Barrett Ruth
4e1dd2956b
Merge pull request #6 from mathstylish/feat/improvements
Improvements
2024-02-12 16:22:08 -05:00
Matheus
146c1b6211 feat: 🎸 create a toggle function 2024-02-12 17:29:51 -03:00
Matheus
a9901e8e0d refactor: 💡 change default live server port 2024-02-12 00:24:20 -03:00
Barrett Ruth
a2becf0d0a
Merge pull request #5 from Subhashis2007/main
readme.md : add missing comma
2024-01-27 15:00:13 -05:00
Subhashis
586b120795
readme.md : add missing comma 2024-01-27 22:12:41 +05:30
acc8890b46 feat(docs): update lazy config 2024-01-24 10:07:26 -05:00
0e4cf0e7e8 feat(docs): update website 2024-01-24 10:06:48 -05:00
d135afb5e8 fix: ignore proper exit on sigterm 2024-01-24 09:47:22 -05:00
Barrett Ruth
8cae0641ca
Merge pull request #1 from oeyoews/main
fix: add missing comma
2023-01-11 09:59:21 -06:00
oeyoews
3b980d8364
fix: add missing comma 2023-01-11 16:59:02 +08:00