Files
vern-nvim/lua/vern-nvim/langs/web.lua
T

60 lines
1.3 KiB
Lua

---@module "vern-nvim.core.fs"
local fs = require("vern-nvim.core.fs")
---@module "vern-nvim.core.terminal"
local term = require("vern-nvim.core.terminal")
---@module "vern-nvim.providers.web"
local providers = require("vern-nvim.providers.web")
local M = {}
M.attach = nil
M.create_project = function(opts, continue)
opts = opts or {}
local provider = vim.tbl_get(opts, "web", "providers")
if vim.trim(provider) == "bun" then
local items = { "Vanilla", "Tailwind", "Shadcn" }
vim.ui.select(items, {
prompt = "Select scaffold from Bun:",
format_item = function(item) return item end,
}, function(choice, _)
if choice then return continue(choice) end
end)
end
end
---@type VernCreateFile
M.create_file = nil
---@param opts VernWebConfig Takes a table for the runtime
M.run = function(opts)
opts = opts or {}
-- term.open({
-- "lua " .. vim.fs.joinpath(fs.root(), "lua", fs.name(), "/init.lua"),
-- }, opts.terminal or {}, false)
end
---@type VernLanguageConfig
M.web = {
root = "Web",
dirs = nil,
providers = "bun", --- "bun"|"deno"|"vanilla"
keybinds = nil,
templates = {
project = nil,
file = {
source = {
path = "{dirs.src}",
name = "{file_name}.lua",
kind = "source",
kind_path = "vern-nvim.templates.lua",
},
},
extras = nil,
},
}
return M