Skip to content

Commit

Permalink
chore: bump lua build
Browse files Browse the repository at this point in the history
  • Loading branch information
rktjmp committed Mar 17, 2024
1 parent 909dd53 commit be90335
Show file tree
Hide file tree
Showing 12 changed files with 633 additions and 998 deletions.
4 changes: 2 additions & 2 deletions lua/hotpot.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
assert((1 == vim.fn.has("nvim-0.9.1")), "Hotpot requires neovim 0.9.1+")
local _let_1_ = require("hotpot.loader")
local make_searcher = _let_1_["make-searcher"]
local searcher = _let_1_["searcher"]
local compiled_cache_path = _let_1_["compiled-cache-path"]
local _let_2_ = require("hotpot.fs")
local join_path = _let_2_["join-path"]
Expand All @@ -12,7 +12,7 @@ local _let_4_ = require("hotpot.api.make")
local automake = _let_4_["auto"]
make_path(compiled_cache_path)
do end (vim.opt.runtimepath):prepend(join_path(compiled_cache_path, "*"))
do end (package.loaders)[1] = make_searcher()
table.insert(package.loaders, 2, searcher)
neovim_runtime.enable()
automake.enable()
local function setup(options)
Expand Down
39 changes: 0 additions & 39 deletions lua/hotpot/dependency-map.lua

This file was deleted.

153 changes: 141 additions & 12 deletions lua/hotpot/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,166 @@ local uv = (vim.uv or vim.loop)
local _local_1_ = vim.health
local report_start = _local_1_["report_start"]
local report_info = _local_1_["report_info"]
local report_ok = _local_1_["report_ok"]
local report_error = _local_1_["report_error"]
local function fmt(s, ...)
return string.format(s, ...)
end
local function bytes__3ehuman(bytes)
local function f(b)
return (b / 1024)
end
local function _2_(...)
local _3_ = ...
local function _4_(...)
local bytes0 = _3_[1]
local unit = _3_[2]
return (1023 < bytes0)
end
if (((_G.type(_3_) == "table") and (nil ~= _3_[1]) and (nil ~= _3_[2])) and _4_(...)) then
local bytes0 = _3_[1]
local unit = _3_[2]
local function _5_(...)
local _6_ = ...
local function _7_(...)
local kbytes = _6_[1]
local unit0 = _6_[2]
return (1023 < kbytes)
end
if (((_G.type(_6_) == "table") and (nil ~= _6_[1]) and (nil ~= _6_[2])) and _7_(...)) then
local kbytes = _6_[1]
local unit0 = _6_[2]
local function _8_(...)
local _9_ = ...
local function _10_(...)
local mbytes = _9_[1]
local unit1 = _9_[2]
return (1023 < mbytes)
end
if (((_G.type(_9_) == "table") and (nil ~= _9_[1]) and (nil ~= _9_[2])) and _10_(...)) then
local mbytes = _9_[1]
local unit1 = _9_[2]
local function _11_(...)
local _12_ = ...
if ((_G.type(_12_) == "table") and (nil ~= _12_[1]) and (nil ~= _12_[2])) then
local gbytes = _12_[1]
local unit2 = _12_[2]
return fmt(unit2, gbytes)
elseif ((_G.type(_12_) == "table") and (nil ~= _12_[1]) and (nil ~= _12_[2])) then
local size = _12_[1]
local unit2 = _12_[2]
return fmt(unit2, size)
else
return nil
end
end
return _11_({f(mbytes), "%.2fbg"})
elseif ((_G.type(_9_) == "table") and (nil ~= _9_[1]) and (nil ~= _9_[2])) then
local size = _9_[1]
local unit1 = _9_[2]
return fmt(unit1, size)
else
return nil
end
end
return _8_({f(kbytes), "%.2fmb"})
elseif ((_G.type(_6_) == "table") and (nil ~= _6_[1]) and (nil ~= _6_[2])) then
local size = _6_[1]
local unit0 = _6_[2]
return fmt(unit0, size)
else
return nil
end
end
return _5_({f(bytes0), "%dkb"})
elseif ((_G.type(_3_) == "table") and (nil ~= _3_[1]) and (nil ~= _3_[2])) then
local size = _3_[1]
local unit = _3_[2]
return fmt(unit, size)
else
return nil
end
end
return _2_({bytes, "%db"})
end
local function disk_info()
report_start("Hotpot Data")
report_start("Hotpot Cache Data")
local runtime = require("hotpot.runtime")
local config = runtime["user-config"]()
local cache_root = runtime["cache-root-path"]()
local paths = vim.fn.globpath(cache_root, "**", true, true, true)
local count = #paths
local size
do
local function _17_()
local size0 = 0
for _, p in ipairs(paths) do
local function _2_(...)
local t_3_ = uv.fs_stat(p)
if (nil ~= t_3_) then
t_3_ = t_3_.size
local function _18_(...)
local t_19_ = uv.fs_stat(p)
if (nil ~= t_19_) then
t_19_ = t_19_.size
else
end
return t_3_
return t_19_
end
size0 = (size0 + _2_() + 0)
size0 = (size0 + _18_() + 0)
end
size = size0
return size0
end
local size0 = math.floor((size / 1024))
size = bytes__3ehuman(_17_())
report_info(fmt("Cache root path: %s", cache_root))
return report_info(fmt("Cache size: %s files, %skb", count, size0))
return report_info(fmt("Cache size: %s files, %s", count, size))
end
local function log_info()
report_start("Hotpot Log")
local logger = require("hotpot.logger")
local path = logger.path()
local size
do
local _21_ = uv.fs_stat(path)
if (_21_ == nil) then
size = 0
elseif ((_G.type(_21_) == "table") and (nil ~= _21_.size)) then
local size0 = _21_.size
size = bytes__3ehuman(size0)
else
size = nil
end
end
report_info(fmt("Log path: %s", path))
return report_info(fmt("Log size: %s", size))
end
local function searcher_info()
report_start("Hotpot Module Searcher")
local _let_23_ = require("hotpot.loader")
local searcher = _let_23_["searcher"]
local expected_index = 2
local actual_index
do
local x = nil
for i, v in ipairs(package.loaders) do
if x then break end
if (searcher == v) then
x = i
else
x = nil
end
end
actual_index = x
end
if (expected_index == actual_index) then
return report_ok(fmt("package.loader index: %s", actual_index))
else
report_error(fmt("package.loader index: %s, requires: %s", actual_index, expected_index))
if vim.loader.enabled then
return report_info(fmt("Ensure you are calling `vim.loader.enable()` before `require('hotpot')`"))
else
return nil
end
end
end
local function check()
return disk_info()
disk_info()
log_info()
return searcher_info()
end
return {check = check}
Loading

0 comments on commit be90335

Please sign in to comment.