REFACTOR: I spent all day on it but I am heavily refactoring the API and

organization because it was terrible before and hard to maintain. Now it
should be much easier and there is still of a design decisions to figure
out
This commit is contained in:
2026-10-15 02:07:14 -04:00
parent 2b30e36fad
commit 4bcac5d09b
27 changed files with 875 additions and 480 deletions
+31
View File
@@ -0,0 +1,31 @@
local M = {}
---@param opts table
M.template = function(opts)
local base = [=[
.DS_Store
.vscode/
.idea/
.env
.env.*
]=]
local lang_block = {
python = [=[
__pycache__/
build/
dist/
.venv/
env/
venv/
.pytest_cache/
]=],
}
local extra = (opts and opts and lang_block[opts.lang]) or ""
return base .. extra
end
return M
+13
View File
@@ -0,0 +1,13 @@
local M = {}
---@param opts table
M.template = function(opts)
local template = [=[
# %s
__all__: list[str] = []
]=]
return string.format(template, opts.project_name)
end
return M
+15
View File
@@ -0,0 +1,15 @@
local M = {}
---@param opts table
M.template = function(opts)
local template = [=[
def main() -> None:
printf("Hello from %s!")
if __name__ == "__main__":
main()
]=]
return string.format(template, opts.project_name)
end
return M
+13
View File
@@ -0,0 +1,13 @@
local M = {}
---@param opts table
M.template = function(opts)
local template = [=[
"""
%s module
"""
]=]
return string.format(template, opts.project_name)
end
return M
+25
View File
@@ -0,0 +1,25 @@
local M = {}
---@param opts table
M.template = function(opts)
local n = opts.project_name
local template = [=[
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "%s"
version = "0.1.0"
description = "Project %s"
readme = "README.md"
requires-python = ">=3.10"
dependencies = []
[project.scripts]
%s = "%s.main:main"
]=]
return string.format(template, n, n, n, n)
end
return M