-
Hey all, as someone coming from Typescript I instantly fell in love with Teal. However, I am now struggling with typing I want to use I noticed inside the copied declaration files the same error occurs, e.g. in Is this maybe caused by a configuration issue on my side? How should dependencies originating from My return {
include_dir={"src"},
source_dir="src",
build_dir = "dist/",
global_env_def = "globals"
} My project structure looks like this:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
put the It is known that this is not ideal but people haven't gotten the time yet to properly think of and implement a solution for this yet. Ideally it is something that is fixed within |
Beta Was this translation helpful? Give feedback.
-
I got it to work by moving the contents of the |
Beta Was this translation helpful? Give feedback.
-
I have solved this problem in my teal project with the following structure:
The config files are: -- tlconfig.lua
return {
build_dir = "build",
source_dir = "src",
include_dir = {
"src/<project name>",
"types",
},
}
# justfile
lua_version := "5.4"
lua := "lua" + " -l set_paths"
tl := "tl run" + " -l set_paths"
rocks_tree := "lua_modules"
rockspec_file := "<project name>-dev-1.rockspec"
lua_targets := `find src/ -type f -iname '*.lua' | xargs` + " " + `ls *.lua | xargs`
teal_targets := `find src/ types/ -type f -iname '*.tl' | xargs`
install:
luarocks \
--lua-version {{ lua_version }} \
install \
--tree {{ rocks_tree }} \
--only-deps \
{{ rockspec_file }}
uninstall:
rm -rf {{ rocks_tree }}
check-lua *FLAGS:
luacheck {{ lua_targets }} {{ FLAGS }}
check-teal:
cyan check {{ teal_targets }}
check-format:
stylua --check {{ lua_targets }}
check: check-lua check-format check-teal
build:
cyan build
clean:
rm -rf build
run:
{{ tl }} src/<project name>/init.tl
run-lua:
{{ lua }} build/<project name>/init.lua
gen-lua-set_path:
cyan gen --output set_paths.lua --gen-compat "off" set_paths.tl
sed -i 's/"src\/<project name>"/"build\/<project name>"/g' set_paths.lua
stylua set_paths.lua Replace all the I could move the I run the program only with tl. It is still possible to run the generated Lua files with the |
Beta Was this translation helpful? Give feedback.
-
I think your include_dir = {
"src/server",
"src/types",
}, and |
Beta Was this translation helpful? Give feedback.
I have solved this problem in my teal project with the following structure:
The config files are: