aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-08-20 20:54:39 +0300
committerV1K1NGbg <victor@ilchev.com>2024-08-20 20:54:39 +0300
commit434042b9783359fea051d3649b03e9270e305dbb (patch)
treebd86f342f2bc0415c9df450a0ece3d1d8bb7aff9
parentec0de3d09266f28cb9c45b635da50db113abeba2 (diff)
downloadluarocks-434042b9783359fea051d3649b03e9270e305dbb.tar.gz
luarocks-434042b9783359fea051d3649b03e9270e305dbb.tar.bz2
luarocks-434042b9783359fea051d3649b03e9270e305dbb.zip
tynew type
-rw-r--r--src/luarocks/admin/cache.tl4
-rw-r--r--src/luarocks/admin/cmd/add.tl8
-rw-r--r--src/luarocks/admin/cmd/refresh_cache.tl4
-rw-r--r--src/luarocks/admin/cmd/remove.tl8
-rw-r--r--src/luarocks/admin/index.tl7
-rw-r--r--src/luarocks/build.tl19
-rw-r--r--src/luarocks/build/builtin.tl8
-rw-r--r--src/luarocks/build/cmake.tl6
-rw-r--r--src/luarocks/build/command.tl6
-rw-r--r--src/luarocks/build/make.tl6
-rw-r--r--src/luarocks/cmd.tl3
-rw-r--r--src/luarocks/cmd/build.tl6
-rw-r--r--src/luarocks/cmd/install.tl3
-rw-r--r--src/luarocks/cmd/list.tl3
-rw-r--r--src/luarocks/cmd/make.tl3
-rw-r--r--src/luarocks/cmd/new_version.tl3
-rw-r--r--src/luarocks/cmd/show.tl30
-rw-r--r--src/luarocks/cmd/unpack.tl3
-rw-r--r--src/luarocks/cmd/upload.tl6
-rw-r--r--src/luarocks/cmd/write_rockspec.tl8
-rw-r--r--src/luarocks/core/cfg.d.tl8
-rw-r--r--src/luarocks/core/path.tl3
-rw-r--r--src/luarocks/core/types/args.d.tl4
-rw-r--r--src/luarocks/core/types/manifest.d.tl3
-rw-r--r--src/luarocks/core/types/rockspec.tl3
-rw-r--r--src/luarocks/core/types/testrunner.d.tl3
-rw-r--r--src/luarocks/deps.tl8
-rw-r--r--src/luarocks/fetch.tl3
-rw-r--r--src/luarocks/fetch/cvs.tl3
-rw-r--r--src/luarocks/fetch/git.tl3
-rw-r--r--src/luarocks/fetch/git_file.tl3
-rw-r--r--src/luarocks/fetch/git_http.tl3
-rw-r--r--src/luarocks/fetch/git_ssh.tl3
-rw-r--r--src/luarocks/fetch/hg.tl3
-rw-r--r--src/luarocks/fetch/hg_http.tl3
-rw-r--r--src/luarocks/fetch/sscm.tl3
-rw-r--r--src/luarocks/fetch/svn.tl3
-rw-r--r--src/luarocks/manif.tl3
-rw-r--r--src/luarocks/manif/writer.tl3
-rw-r--r--src/luarocks/pack.tl3
-rw-r--r--src/luarocks/path.tl3
-rw-r--r--src/luarocks/repos.tl6
-rw-r--r--src/luarocks/search.tl3
-rw-r--r--src/luarocks/test.tl5
-rw-r--r--src/luarocks/test/busted.tl3
-rw-r--r--src/luarocks/test/command.tl3
-rw-r--r--src/luarocks/type/rockspec.tl3
-rw-r--r--src/luarocks/upload/api.tl9
-rw-r--r--src/luarocks/util.tl3
49 files changed, 101 insertions, 152 deletions
diff --git a/src/luarocks/admin/cache.tl b/src/luarocks/admin/cache.tl
index 85e3df36..eb3b9568 100644
--- a/src/luarocks/admin/cache.tl
+++ b/src/luarocks/admin/cache.tl
@@ -9,10 +9,10 @@ local cfg = require("luarocks.core.cfg")
9local dir = require("luarocks.dir") 9local dir = require("luarocks.dir")
10local util = require("luarocks.util") 10local util = require("luarocks.util")
11 11
12function cache.get_upload_server(server: string): string, string 12function cache.get_upload_server(server: string): string, {string: string}, string
13 if not server then server = cfg.upload_server end 13 if not server then server = cfg.upload_server end
14 if not server then 14 if not server then
15 return nil, "No server specified and no default configured with upload_server." 15 return nil, nil, "No server specified and no default configured with upload_server."
16 end 16 end
17 return server, cfg.upload_servers and cfg.upload_servers[server] 17 return server, cfg.upload_servers and cfg.upload_servers[server]
18end 18end
diff --git a/src/luarocks/admin/cmd/add.tl b/src/luarocks/admin/cmd/add.tl
index f90eabc0..666e96b1 100644
--- a/src/luarocks/admin/cmd/add.tl
+++ b/src/luarocks/admin/cmd/add.tl
@@ -21,7 +21,7 @@ local type Args = a.Args
21function add.add_to_parser(parser: Parser) 21function add.add_to_parser(parser: Parser)
22 local cmd = parser:command("add", "Add a rock or rockspec to a rocks server.", util.see_also()) 22 local cmd = parser:command("add", "Add a rock or rockspec to a rocks server.", util.see_also())
23 23
24 cmd:argument("rock", "A local rockspec or rock file.") 24 cmd:argument("rocks", "A local rockspec or rock file.")
25 :args("+") 25 :args("+")
26 26
27 cmd:option("--server", "The server to use. If not given, the default server ".. 27 cmd:option("--server", "The server to use. If not given, the default server "..
@@ -128,9 +128,9 @@ local function add_files_to_server(refresh: boolean, rockfiles: {string}, server
128end 128end
129 129
130function add.command(args: Args): boolean, string, string --! 130function add.command(args: Args): boolean, string, string --!
131 local server, server_table = cache.get_upload_server(args.add_server or args.server) 131 local server, server_table, err = cache.get_upload_server(args.add_server or args.server)
132 if not server then return nil, server_table end 132 if not server then return nil, err end
133 return add_files_to_server(not args.no_refresh, args.rock, server, server_table, args.index) 133 return add_files_to_server(not args.no_refresh, args.rocks, server, server_table, args.index)
134end 134end
135 135
136 136
diff --git a/src/luarocks/admin/cmd/refresh_cache.tl b/src/luarocks/admin/cmd/refresh_cache.tl
index 1e2b84d2..09b26373 100644
--- a/src/luarocks/admin/cmd/refresh_cache.tl
+++ b/src/luarocks/admin/cmd/refresh_cache.tl
@@ -22,8 +22,8 @@ function refresh_cache.add_to_parser(parser: Parser)
22end 22end
23 23
24function refresh_cache.command(args: Args): boolean, string 24function refresh_cache.command(args: Args): boolean, string
25 local server, upload_server = cache.get_upload_server(args.server) 25 local server, upload_server, err = cache.get_upload_server(args.server)
26 if not server then return nil, upload_server end 26 if not server then return nil, err end
27 local download_url = cache.get_server_urls(server, upload_server) 27 local download_url = cache.get_server_urls(server, upload_server)
28 28
29 local ok, err = cache.refresh_local_cache(download_url, cfg.upload_user, cfg.upload_password) 29 local ok, err = cache.refresh_local_cache(download_url, cfg.upload_user, cfg.upload_password)
diff --git a/src/luarocks/admin/cmd/remove.tl b/src/luarocks/admin/cmd/remove.tl
index 46b4feeb..78bf652e 100644
--- a/src/luarocks/admin/cmd/remove.tl
+++ b/src/luarocks/admin/cmd/remove.tl
@@ -21,7 +21,7 @@ local type Args = a.Args
21function admin_remove.add_to_parser(parser: Parser) 21function admin_remove.add_to_parser(parser: Parser)
22 local cmd = parser:command("remove", "Remove a rock or rockspec from a rocks server.", util.see_also()) 22 local cmd = parser:command("remove", "Remove a rock or rockspec from a rocks server.", util.see_also())
23 23
24 cmd:argument("rock", "A local rockspec or rock file.") 24 cmd:argument("rocks", "A local rockspec or rock file.")
25 :args("+") 25 :args("+")
26 26
27 cmd:option("--server", "The server to use. If not given, the default server ".. 27 cmd:option("--server", "The server to use. If not given, the default server "..
@@ -89,9 +89,9 @@ local function remove_files_from_server(refresh: boolean, rockfiles: {string}, s
89end 89end
90 90
91function admin_remove.command(args: Args): boolean, string 91function admin_remove.command(args: Args): boolean, string
92 local server, server_table = cache.get_upload_server(args.server) 92 local server, server_table, err = cache.get_upload_server(args.server)
93 if not server then return nil, server_table end 93 if not server then return nil, err end
94 return remove_files_from_server(not args.no_refresh, args.rock, server, server_table) --! 94 return remove_files_from_server(not args.no_refresh, args.rocks, server, server_table) --!
95end 95end
96 96
97 97
diff --git a/src/luarocks/admin/index.tl b/src/luarocks/admin/index.tl
index 06968828..e1b01f10 100644
--- a/src/luarocks/admin/index.tl
+++ b/src/luarocks/admin/index.tl
@@ -10,8 +10,7 @@ local persist = require("luarocks.persist")
10local dir = require("luarocks.dir") 10local dir = require("luarocks.dir")
11local manif = require("luarocks.manif") 11local manif = require("luarocks.manif")
12 12
13local type r = require("luarocks.core.types.rockspec") 13local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
14local type Rockspec = r.Rockspec
15 14
16local type m = require("luarocks.core.types.manifest") 15local type m = require("luarocks.core.types.manifest")
17local type Entry = m.Manifest.Entry 16local type Entry = m.Manifest.Entry
@@ -106,13 +105,13 @@ function index.format_external_dependencies(rockspec: Rockspec): string
106 if rockspec.external_dependencies then 105 if rockspec.external_dependencies then
107 local deplist = {} 106 local deplist = {}
108 local listed_set: {string: boolean} = {} 107 local listed_set: {string: boolean} = {}
109 local plats: {string : string} = nil 108 local plats: {string : {string: string}} = nil
110 for name, desc in util.sortedpairs(rockspec.external_dependencies) do 109 for name, desc in util.sortedpairs(rockspec.external_dependencies) do
111 if name ~= "platforms" then 110 if name ~= "platforms" then
112 table.insert(deplist, name:lower()) 111 table.insert(deplist, name:lower())
113 listed_set[name] = true 112 listed_set[name] = true
114 else 113 else
115 plats = desc 114 plats = desc as {string : {string: string}}
116 end 115 end
117 end 116 end
118 if plats then 117 if plats then
diff --git a/src/luarocks/build.tl b/src/luarocks/build.tl
index b3594225..b11ceb80 100644
--- a/src/luarocks/build.tl
+++ b/src/luarocks/build.tl
@@ -20,22 +20,17 @@ local repos = require("luarocks.repos")
20local repo_writer = require("luarocks.repo_writer") 20local repo_writer = require("luarocks.repo_writer")
21local deplocks = require("luarocks.deplocks") 21local deplocks = require("luarocks.deplocks")
22 22
23local type r = require("luarocks.core.types.rockspec") 23local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
24local type Rockspec = r.Rockspec
25 24
26local type i = require("luarocks.core.types.installs") 25local type InstallDirs = require("luarocks.core.types.installs").InstallDirs
27local type InstallDirs = i.InstallDirs 26local type InstallDir = require("luarocks.core.types.installs").InstallDir
28local type InstallDir = i.InstallDir
29 27
30local type t = require("luarocks.core.types.tree") 28local type Tree = require("luarocks.core.types.tree").Tree
31local type Tree = t.Tree
32 29
33local type b = require("luarocks.core.types.build") 30local type Build = require("luarocks.core.types.build").Build
34local type Build = b.Build 31local type Module = require("luarocks.core.types.build").BuiltinBuild.Module
35local type Module = b.BuiltinBuild.Module
36 32
37local type bo = require("luarocks.core.types.bopts") 33local type BOpts = require("luarocks.core.types.bopts").BOpts
38local type BOpts = bo.BOpts
39 34
40 35
41local type Builds = build.Builds 36local type Builds = build.Builds
diff --git a/src/luarocks/build/builtin.tl b/src/luarocks/build/builtin.tl
index d4bd7fd7..5720a405 100644
--- a/src/luarocks/build/builtin.tl
+++ b/src/luarocks/build/builtin.tl
@@ -4,12 +4,10 @@ local record builtin
4 skip_lua_inc_lib_check: boolean 4 skip_lua_inc_lib_check: boolean
5end 5end
6 6
7local type r = require("luarocks.core.types.rockspec") 7local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
8local type Rockspec = r.Rockspec
9 8
10local type b = require("luarocks.core.types.build") 9local type BuiltinBuild = require("luarocks.core.types.build").BuiltinBuild
11local type BuiltinBuild = b.BuiltinBuild 10local type Build = require("luarocks.core.types.build").Build
12local type Build = b.Build
13local type Module = BuiltinBuild.Module 11local type Module = BuiltinBuild.Module
14 12
15-- This build driver checks LUA_INCDIR and LUA_LIBDIR on demand, 13-- This build driver checks LUA_INCDIR and LUA_LIBDIR on demand,
diff --git a/src/luarocks/build/cmake.tl b/src/luarocks/build/cmake.tl
index 1c00797f..c149a3cd 100644
--- a/src/luarocks/build/cmake.tl
+++ b/src/luarocks/build/cmake.tl
@@ -7,11 +7,9 @@ local fs = require("luarocks.fs")
7local util = require("luarocks.util") 7local util = require("luarocks.util")
8local cfg = require("luarocks.core.cfg") 8local cfg = require("luarocks.core.cfg")
9 9
10local type r = require("luarocks.core.types.rockspec") 10local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
11local type Rockspec = r.Rockspec
12 11
13local type b = require("luarocks.core.types.build") 12local type CMakeBuild = require("luarocks.core.types.build").CMakeBuild
14local type CMakeBuild = b.CMakeBuild
15 13
16--- Driver function for the "cmake" build back-end. 14--- Driver function for the "cmake" build back-end.
17-- @param rockspec table: the loaded rockspec. 15-- @param rockspec table: the loaded rockspec.
diff --git a/src/luarocks/build/command.tl b/src/luarocks/build/command.tl
index c2739987..baadf01b 100644
--- a/src/luarocks/build/command.tl
+++ b/src/luarocks/build/command.tl
@@ -7,11 +7,9 @@ local fs = require("luarocks.fs")
7local util = require("luarocks.util") 7local util = require("luarocks.util")
8local cfg = require("luarocks.core.cfg") 8local cfg = require("luarocks.core.cfg")
9 9
10local type r = require("luarocks.core.types.rockspec") 10local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
11local type Rockspec = r.Rockspec
12 11
13local type b = require("luarocks.core.types.build") 12local type CommandBuild = require("luarocks.core.types.build").CommandBuild
14local type CommandBuild = b.CommandBuild
15 13
16--- Driver function for the "command" build back-end. 14--- Driver function for the "command" build back-end.
17-- @param rockspec table: the loaded rockspec. 15-- @param rockspec table: the loaded rockspec.
diff --git a/src/luarocks/build/make.tl b/src/luarocks/build/make.tl
index 4107bca1..1943bd04 100644
--- a/src/luarocks/build/make.tl
+++ b/src/luarocks/build/make.tl
@@ -7,11 +7,9 @@ local fs = require("luarocks.fs")
7local util = require("luarocks.util") 7local util = require("luarocks.util")
8local cfg = require("luarocks.core.cfg") 8local cfg = require("luarocks.core.cfg")
9 9
10local type r = require("luarocks.core.types.rockspec") 10local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
11local type Rockspec = r.Rockspec
12 11
13local type b = require("luarocks.core.types.build") 12local type MakeBuild = require("luarocks.core.types.build").MakeBuild
14local type MakeBuild = b.MakeBuild
15 13
16--- Call "make" with given target and variables 14--- Call "make" with given target and variables
17-- @param make_cmd string: the make command to be used (typically 15-- @param make_cmd string: the make command to be used (typically
diff --git a/src/luarocks/cmd.tl b/src/luarocks/cmd.tl
index 64abf6ce..4e314b87 100644
--- a/src/luarocks/cmd.tl
+++ b/src/luarocks/cmd.tl
@@ -22,8 +22,7 @@ local fun = require("luarocks.fun")
22local fs = require("luarocks.fs") 22local fs = require("luarocks.fs")
23local argparse = require("luarocks.vendor.argparse") 23local argparse = require("luarocks.vendor.argparse")
24 24
25local type t = require("luarocks.core.types.tree") 25local type Tree = require("luarocks.core.types.tree").Tree
26local type Tree = t.Tree
27 26
28local type Parser = argparse.Parser 27local type Parser = argparse.Parser
29 28
diff --git a/src/luarocks/cmd/build.tl b/src/luarocks/cmd/build.tl
index 96e2ec42..58729719 100644
--- a/src/luarocks/cmd/build.tl
+++ b/src/luarocks/cmd/build.tl
@@ -24,11 +24,9 @@ local type Parser = argparse.Parser
24 24
25local type Args = require("luarocks.core.types.args").Args 25local type Args = require("luarocks.core.types.args").Args
26 26
27local type bo = require("luarocks.core.types.bopts") 27local type BOpts = require("luarocks.core.types.bopts").BOpts
28local type BOpts = bo.BOpts
29 28
30local type r = require("luarocks.core.types.rockspec") 29local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
31local type Rockspec = r.Rockspec
32 30
33function cmd_build.add_to_parser(parser: Parser) 31function cmd_build.add_to_parser(parser: Parser)
34 local cmd = parser:command("build", "Build and install a rock, compiling its C parts if any.\n".. -- luacheck: ignore 431 32 local cmd = parser:command("build", "Build and install a rock, compiling its C parts if any.\n".. -- luacheck: ignore 431
diff --git a/src/luarocks/cmd/install.tl b/src/luarocks/cmd/install.tl
index ca3d3916..506716ef 100644
--- a/src/luarocks/cmd/install.tl
+++ b/src/luarocks/cmd/install.tl
@@ -24,8 +24,7 @@ local type a = require("luarocks.core.types.args")
24local type Args = a.Args 24local type Args = a.Args
25 25
26 26
27local type i = require("luarocks.core.types.installs") 27local type IOpts = require("luarocks.core.types.installs").IOpts
28local type IOpts = i.IOpts
29 28
30function install.add_to_parser(parser: Parser) 29function install.add_to_parser(parser: Parser)
31 local cmd = parser:command("install", "Install a rock.", util.see_also()) -- luacheck: ignore 431 30 local cmd = parser:command("install", "Install a rock.", util.see_also()) -- luacheck: ignore 431
diff --git a/src/luarocks/cmd/list.tl b/src/luarocks/cmd/list.tl
index 558ea09a..0e3f1fd1 100644
--- a/src/luarocks/cmd/list.tl
+++ b/src/luarocks/cmd/list.tl
@@ -25,8 +25,7 @@ local type Parser = argparse.Parser
25local type a = require("luarocks.core.types.args") 25local type a = require("luarocks.core.types.args")
26local type Args = a.Args 26local type Args = a.Args
27 27
28local type t = require("luarocks.core.types.tree") 28local type Tree = require("luarocks.core.types.tree").Tree
29local type Tree = t.Tree
30 29
31local type q = require("luarocks.core.types.query") 30local type q = require("luarocks.core.types.query")
32local type Query = q.Query 31local type Query = q.Query
diff --git a/src/luarocks/cmd/make.tl b/src/luarocks/cmd/make.tl
index 17af28ae..a92bc23e 100644
--- a/src/luarocks/cmd/make.tl
+++ b/src/luarocks/cmd/make.tl
@@ -23,8 +23,7 @@ local type Parser = argparse.Parser
23local type a = require("luarocks.core.types.args") 23local type a = require("luarocks.core.types.args")
24local type Args = a.Args 24local type Args = a.Args
25 25
26local type bo = require("luarocks.core.types.bopts") 26local type BOpts = require("luarocks.core.types.bopts").BOpts
27local type BOpts = bo.BOpts
28 27
29function make.cmd_options(parser: Parser) 28function make.cmd_options(parser: Parser)
30 parser:flag("--no-install", "Do not install the rock.") 29 parser:flag("--no-install", "Do not install the rock.")
diff --git a/src/luarocks/cmd/new_version.tl b/src/luarocks/cmd/new_version.tl
index b2fdf81a..c3129055 100644
--- a/src/luarocks/cmd/new_version.tl
+++ b/src/luarocks/cmd/new_version.tl
@@ -21,8 +21,7 @@ local type Args = a.Args
21local type p = require("luarocks.core.types.persist") 21local type p = require("luarocks.core.types.persist")
22local type PersistableTable = p.PersistableTable 22local type PersistableTable = p.PersistableTable
23 23
24local type r = require("luarocks.core.types.rockspec") 24local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
25local type Rockspec = r.Rockspec
26 25
27function new_version.add_to_parser(parser: Parser) 26function new_version.add_to_parser(parser: Parser)
28 local cmd = parser:command("new_version", [[ 27 local cmd = parser:command("new_version", [[
diff --git a/src/luarocks/cmd/show.tl b/src/luarocks/cmd/show.tl
index 1d6eddda..a5c95b18 100644
--- a/src/luarocks/cmd/show.tl
+++ b/src/luarocks/cmd/show.tl
@@ -4,7 +4,7 @@ local record show
4 record Return 4 record Return
5 name: string 5 name: string
6 file: string 6 file: string
7 lable: string 7 label: string
8 end 8 end
9end 9end
10 10
@@ -20,6 +20,7 @@ local manif = require("luarocks.manif")
20local repos = require("luarocks.repos") 20local repos = require("luarocks.repos")
21 21
22local type Return = show.Return 22local type Return = show.Return
23local type RenderData = {string: string | {string}}
23 24
24local argparse = require("luarocks.vendor.argparse") 25local argparse = require("luarocks.vendor.argparse")
25local type Parser = argparse.Parser 26local type Parser = argparse.Parser
@@ -27,15 +28,13 @@ local type Parser = argparse.Parser
27local type a = require("luarocks.core.types.args") 28local type a = require("luarocks.core.types.args")
28local type Args = a.Args 29local type Args = a.Args
29 30
30local type t = require("luarocks.core.types.tree") 31local type Tree = require("luarocks.core.types.tree").Tree
31local type Tree = t.Tree
32 32
33local type q = require("luarocks.core.types.query") 33local type q = require("luarocks.core.types.query")
34local type Query = q.Query 34local type Query = q.Query
35 35
36local type r = require("luarocks.core.types.rockspec") 36local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
37local type Rockspec = r.Rockspec 37local type Dependencies = require("luarocks.core.types.rockspec").Dependencies
38local type Dependencies = r.Dependencies
39 38
40local type m = require("luarocks.core.types.manifest") 39local type m = require("luarocks.core.types.manifest")
41local type Entry = m.Manifest.Entry 40local type Entry = m.Manifest.Entry
@@ -152,17 +151,19 @@ local function format_text(text: string): string
152end 151end
153 152
154local function installed_rock_label(dep: Query, tree: string | Tree): string 153local function installed_rock_label(dep: Query, tree: string | Tree): string
155 local installed, version: string, string 154 local installed, version: boolean, string
156 local rocks_provided = util.get_rocks_provided() 155 local rocks_provided = util.get_rocks_provided()
157 if rocks_provided[dep.name] then 156 if rocks_provided[dep.name] then
158 installed, version = true, rocks_provided[dep.name] 157 installed, version = true, rocks_provided[dep.name]
159 else 158 else
160 installed, version = search.pick_installed_rock(dep, tree) 159 local name: string
160 name, version = search.pick_installed_rock(dep, tree)
161 installed = name ~= nil
161 end 162 end
162 return installed and "using "..version or "missing" 163 return installed and "using "..version or "missing"
163end 164end
164 165
165local function render(template: string, data: {string: string | {string}}): string 166local function render(template: string, data: RenderData): string
166 local out = {} 167 local out = {}
167 for cmd, var, line in template:gmatch("(.)([a-z]*)%s*:([^\n]*)\n") do 168 for cmd, var, line in template:gmatch("(.)([a-z]*)%s*:([^\n]*)\n") do
168 line = line:gsub("\\t", "\t") 169 line = line:gsub("\\t", "\t")
@@ -173,13 +174,16 @@ local function render(template: string, data: {string: string | {string}}): stri
173 if (cmd == "!" and d == nil) 174 if (cmd == "!" and d == nil)
174 or (cmd ~= "!" and (d is string 175 or (cmd ~= "!" and (d is string
175 or (d is {string} and next(d) ~= nil))) then 176 or (d is {string} and next(d) ~= nil))) then
176 local n = cmd == "*" and #d or 1 177 local n = d is {string} and #d or 1
178 if cmd ~= "*" then
179 n = 1
180 end
177 for i = 1, n do 181 for i = 1, n do
178 local tbl = cmd == "*" and d[i] or data 182 local tbl: string | {any: any} = cmd == "*" and d is {string} and d[i] or data
179 if tbl is string then 183 if tbl is string then
180 tbl = tbl:gsub("%%", "%%%%") 184 tbl = tbl:gsub("%%", "%%%%")
181 end 185 end
182 table.insert(out, (line:gsub("${([a-z]+)}", tbl))) 186 table.insert(out, (line:gsub("${([a-z]+)}", tbl as string))) -- code works under the assumption that template is well behaved
183 end 187 end
184 end 188 end
185 end 189 end
@@ -284,7 +288,7 @@ local function show_rock(template: string, namespace: string, name: string, vers
284 deps = deps_to_list(rockspec.dependencies, tree), 288 deps = deps_to_list(rockspec.dependencies, tree),
285 ideps = indirect_deps(minfo.dependencies, rockspec.dependencies, tree), 289 ideps = indirect_deps(minfo.dependencies, rockspec.dependencies, tree),
286 } 290 }
287 util.printout(render(template, data)) 291 util.printout(render(template, data as RenderData))
288end 292end
289 293
290--- Driver function for "show" command. 294--- Driver function for "show" command.
diff --git a/src/luarocks/cmd/unpack.tl b/src/luarocks/cmd/unpack.tl
index 07900039..f6a1526a 100644
--- a/src/luarocks/cmd/unpack.tl
+++ b/src/luarocks/cmd/unpack.tl
@@ -17,8 +17,7 @@ local type Parser = argparse.Parser
17local type a = require("luarocks.core.types.args") 17local type a = require("luarocks.core.types.args")
18local type Args = a.Args 18local type Args = a.Args
19 19
20local type r = require("luarocks.core.types.rockspec") 20local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
21local type Rockspec = r.Rockspec
22 21
23function unpack.add_to_parser(parser: Parser) 22function unpack.add_to_parser(parser: Parser)
24 local cmd = parser:command("unpack", [[ 23 local cmd = parser:command("unpack", [[
diff --git a/src/luarocks/cmd/upload.tl b/src/luarocks/cmd/upload.tl
index ae02fc64..19b8f6ef 100644
--- a/src/luarocks/cmd/upload.tl
+++ b/src/luarocks/cmd/upload.tl
@@ -1,5 +1,7 @@
1 1
2local record upload 2local record upload
3 record Response
4 end
3end 5end
4 6
5local signing = require("luarocks.signing") 7local signing = require("luarocks.signing")
@@ -42,8 +44,8 @@ local function is_dev_version(version: string): string
42 return version:match("^dev") or version:match("^scm") 44 return version:match("^dev") or version:match("^scm")
43end 45end
44 46
45function upload.command(args: Args): boolean, string, string --! 47function upload.command(args: Args): boolean, string, string
46 local api, err = Api.new(args as argparse.Args) --! 48 local api, err = Api.new(args)
47 if not api then 49 if not api then
48 return nil, err 50 return nil, err
49 end 51 end
diff --git a/src/luarocks/cmd/write_rockspec.tl b/src/luarocks/cmd/write_rockspec.tl
index ebd3b783..0d95d62a 100644
--- a/src/luarocks/cmd/write_rockspec.tl
+++ b/src/luarocks/cmd/write_rockspec.tl
@@ -22,12 +22,10 @@ local type Args = a.Args
22local type p = require("luarocks.core.types.persist") 22local type p = require("luarocks.core.types.persist")
23local type PersistableTable = p.PersistableTable 23local type PersistableTable = p.PersistableTable
24 24
25local type b = require("luarocks.core.types.build") 25local type BuiltinBuild = require("luarocks.core.types.build").BuiltinBuild
26local type BuiltinBuild = b.BuiltinBuild
27 26
28local type r = require("luarocks.core.types.rockspec") 27local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
29local type Rockspec = r.Rockspec 28local type Dependencies = require("luarocks.core.types.rockspec").Dependencies
30local type Dependencies = r.Dependencies
31 29
32local lua_versions = { 30local lua_versions = {
33 "5.1", 31 "5.1",
diff --git a/src/luarocks/core/cfg.d.tl b/src/luarocks/core/cfg.d.tl
index fa3e9901..8437a043 100644
--- a/src/luarocks/core/cfg.d.tl
+++ b/src/luarocks/core/cfg.d.tl
@@ -1,8 +1,6 @@
1local type r = require("luarocks.core.types.rockspec") 1local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
2local type Rockspec = r.Rockspec
3 2
4local type t = require("luarocks.core.types.tree") 3local type Tree = require("luarocks.core.types.tree").Tree
5local type Tree = t.Tree
6 4
7local record cfg 5local record cfg
8 detect_sysconfdir: function(): string 6 detect_sysconfdir: function(): string
@@ -112,7 +110,7 @@ local record cfg
112 export_path_separator: string 110 export_path_separator: string
113 -- admin cache 111 -- admin cache
114 upload_server: string 112 upload_server: string
115 upload_servers: {string: string} 113 upload_servers: {string: {string: string}}
116 -- admin add 114 -- admin add
117 upload_user: string 115 upload_user: string
118 upload_password: string 116 upload_password: string
diff --git a/src/luarocks/core/path.tl b/src/luarocks/core/path.tl
index 491fe484..eff15a51 100644
--- a/src/luarocks/core/path.tl
+++ b/src/luarocks/core/path.tl
@@ -5,8 +5,7 @@ end
5local cfg = require("luarocks.core.cfg") 5local cfg = require("luarocks.core.cfg")
6local dir = require("luarocks.core.dir") 6local dir = require("luarocks.core.dir")
7 7
8local type t = require("luarocks.core.types.tree") 8local type Tree = require("luarocks.core.types.tree").Tree
9local type Tree = t.Tree
10 9
11local dir_sep = package.config:sub(1, 1) 10local dir_sep = package.config:sub(1, 1)
12-------------------------------------------------------------------------------- 11--------------------------------------------------------------------------------
diff --git a/src/luarocks/core/types/args.d.tl b/src/luarocks/core/types/args.d.tl
index 00945789..d2aca6fc 100644
--- a/src/luarocks/core/types/args.d.tl
+++ b/src/luarocks/core/types/args.d.tl
@@ -102,6 +102,10 @@ local record args
102 index: boolean 102 index: boolean
103 repository: string 103 repository: string
104 local_tree: string 104 local_tree: string
105 temp_key: string
106 api_key: string
107 debug: boolean
108 rocks: {string}
105 end 109 end
106end 110end
107 111
diff --git a/src/luarocks/core/types/manifest.d.tl b/src/luarocks/core/types/manifest.d.tl
index 1e986867..205a8dc9 100644
--- a/src/luarocks/core/types/manifest.d.tl
+++ b/src/luarocks/core/types/manifest.d.tl
@@ -1,8 +1,7 @@
1local type q = require("luarocks.core.types.query") 1local type q = require("luarocks.core.types.query")
2local type Query = q.Query 2local type Query = q.Query
3 3
4local type t = require("luarocks.core.types.tree") 4local type Tree = require("luarocks.core.types.tree").Tree
5local type Tree = t.Tree
6 5
7local record manifest 6local record manifest
8 record Manifest 7 record Manifest
diff --git a/src/luarocks/core/types/rockspec.tl b/src/luarocks/core/types/rockspec.tl
index cfb35be2..22216f1d 100644
--- a/src/luarocks/core/types/rockspec.tl
+++ b/src/luarocks/core/types/rockspec.tl
@@ -1,8 +1,7 @@
1local type q = require("luarocks.core.types.query") 1local type q = require("luarocks.core.types.query")
2local type Query = q.Query 2local type Query = q.Query
3 3
4local type b = require("luarocks.core.types.build") 4local type Build = require("luarocks.core.types.build").Build
5local type Build = b.Build
6 5
7local record rockspec 6local record rockspec
8 record Description 7 record Description
diff --git a/src/luarocks/core/types/testrunner.d.tl b/src/luarocks/core/types/testrunner.d.tl
index 508356fa..e310504d 100644
--- a/src/luarocks/core/types/testrunner.d.tl
+++ b/src/luarocks/core/types/testrunner.d.tl
@@ -1,5 +1,4 @@
1local type r = require("luarocks.core.types.rockspec") 1local type Test = require("luarocks.core.types.rockspec").Test
2local type Test = r.Test
3 2
4local record testrunner 3local record testrunner
5 record TestRunner 4 record TestRunner
diff --git a/src/luarocks/deps.tl b/src/luarocks/deps.tl
index 58c0bd1c..c1fefe2c 100644
--- a/src/luarocks/deps.tl
+++ b/src/luarocks/deps.tl
@@ -14,17 +14,15 @@ local vers = require("luarocks.core.vers")
14local queries = require("luarocks.queries") 14local queries = require("luarocks.queries")
15local deplocks = require("luarocks.deplocks") 15local deplocks = require("luarocks.deplocks")
16 16
17local type r = require("luarocks.core.types.rockspec") 17local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
18local type Rockspec = r.Rockspec 18local type Dependencies = require("luarocks.core.types.rockspec").Dependencies
19local type Dependencies = r.Dependencies
20 19
21local type bld = require("luarocks.core.types.build") 20local type bld = require("luarocks.core.types.build")
22local type BuiltinBuild = bld.BuiltinBuild 21local type BuiltinBuild = bld.BuiltinBuild
23local type Module = BuiltinBuild.Module 22local type Module = BuiltinBuild.Module
24local type Build = bld.Build 23local type Build = bld.Build
25 24
26local type t = require("luarocks.core.types.tree") 25local type Tree = require("luarocks.core.types.tree").Tree
27local type Tree = t.Tree
28 26
29local type q = require("luarocks.core.types.query") 27local type q = require("luarocks.core.types.query")
30local type Query = q.Query 28local type Query = q.Query
diff --git a/src/luarocks/fetch.tl b/src/luarocks/fetch.tl
index ccd8680e..6ee1c616 100644
--- a/src/luarocks/fetch.tl
+++ b/src/luarocks/fetch.tl
@@ -16,8 +16,7 @@ local cfg = require("luarocks.core.cfg")
16 16
17local type Fetch = fetch.Fetch 17local type Fetch = fetch.Fetch
18local type Lock = fs.Lock --! 18local type Lock = fs.Lock --!
19local type r = require("luarocks.core.types.rockspec") 19local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
20local type Rockspec = r.Rockspec
21 20
22 21
23local function ensure_trailing_slash(url: string): string 22local function ensure_trailing_slash(url: string): string
diff --git a/src/luarocks/fetch/cvs.tl b/src/luarocks/fetch/cvs.tl
index 0532cecb..c8fc5e3d 100644
--- a/src/luarocks/fetch/cvs.tl
+++ b/src/luarocks/fetch/cvs.tl
@@ -7,8 +7,7 @@ local fs = require("luarocks.fs")
7local dir = require("luarocks.dir") 7local dir = require("luarocks.dir")
8local util = require("luarocks.util") 8local util = require("luarocks.util")
9 9
10local type r = require("luarocks.core.types.rockspec") 10local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
11local type Rockspec = r.Rockspec
12 11
13--- Download sources for building a rock, using CVS. 12--- Download sources for building a rock, using CVS.
14-- @param rockspec table: The rockspec table 13-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/git.tl b/src/luarocks/fetch/git.tl
index 466c4039..35e28272 100644
--- a/src/luarocks/fetch/git.tl
+++ b/src/luarocks/fetch/git.tl
@@ -9,8 +9,7 @@ local dir = require("luarocks.dir")
9local vers = require("luarocks.core.vers") 9local vers = require("luarocks.core.vers")
10local util = require("luarocks.util") 10local util = require("luarocks.util")
11 11
12local type r = require("luarocks.core.types.rockspec") 12local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
13local type Rockspec = r.Rockspec
14local type v = require("luarocks.core.types.version") 13local type v = require("luarocks.core.types.version")
15local type Version = v.Version 14local type Version = v.Version
16 15
diff --git a/src/luarocks/fetch/git_file.tl b/src/luarocks/fetch/git_file.tl
index 06ada30b..90e14d12 100644
--- a/src/luarocks/fetch/git_file.tl
+++ b/src/luarocks/fetch/git_file.tl
@@ -5,8 +5,7 @@ end
5 5
6local git = require("luarocks.fetch.git") 6local git = require("luarocks.fetch.git")
7 7
8local type r = require("luarocks.core.types.rockspec") 8local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
9local type Rockspec = r.Rockspec
10 9
11--- Fetch sources for building a rock from a local Git repository. 10--- Fetch sources for building a rock from a local Git repository.
12-- @param rockspec table: The rockspec table 11-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/git_http.tl b/src/luarocks/fetch/git_http.tl
index ecf23763..4ff602d9 100644
--- a/src/luarocks/fetch/git_http.tl
+++ b/src/luarocks/fetch/git_http.tl
@@ -12,8 +12,7 @@ end
12 12
13local git = require("luarocks.fetch.git") 13local git = require("luarocks.fetch.git")
14 14
15local type r = require("luarocks.core.types.rockspec") 15local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
16local type Rockspec = r.Rockspec
17 16
18--- Fetch sources for building a rock from a local Git repository. 17--- Fetch sources for building a rock from a local Git repository.
19-- @param rockspec table: The rockspec table 18-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/git_ssh.tl b/src/luarocks/fetch/git_ssh.tl
index 0d6f9742..b5c30e3a 100644
--- a/src/luarocks/fetch/git_ssh.tl
+++ b/src/luarocks/fetch/git_ssh.tl
@@ -12,8 +12,7 @@ end
12 12
13local git = require("luarocks.fetch.git") 13local git = require("luarocks.fetch.git")
14 14
15local type r = require("luarocks.core.types.rockspec") 15local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
16local type Rockspec = r.Rockspec
17 16
18--- Fetch sources for building a rock from a local Git repository. 17--- Fetch sources for building a rock from a local Git repository.
19-- @param rockspec table: The rockspec table 18-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/hg.tl b/src/luarocks/fetch/hg.tl
index cbdcdc86..3f94cee1 100644
--- a/src/luarocks/fetch/hg.tl
+++ b/src/luarocks/fetch/hg.tl
@@ -7,8 +7,7 @@ local fs = require("luarocks.fs")
7local dir = require("luarocks.dir") 7local dir = require("luarocks.dir")
8local util = require("luarocks.util") 8local util = require("luarocks.util")
9 9
10local type r = require("luarocks.core.types.rockspec") 10local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
11local type Rockspec = r.Rockspec
12 11
13--- Download sources for building a rock, using hg. 12--- Download sources for building a rock, using hg.
14-- @param rockspec table: The rockspec table 13-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/hg_http.tl b/src/luarocks/fetch/hg_http.tl
index 218543cd..a4ce48fd 100644
--- a/src/luarocks/fetch/hg_http.tl
+++ b/src/luarocks/fetch/hg_http.tl
@@ -10,8 +10,7 @@ end
10 10
11local hg = require("luarocks.fetch.hg") 11local hg = require("luarocks.fetch.hg")
12 12
13local type r = require("luarocks.core.types.rockspec") 13local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
14local type Rockspec = r.Rockspec
15 14
16--- Download sources for building a rock, using hg over http. 15--- Download sources for building a rock, using hg over http.
17-- @param rockspec table: The rockspec table 16-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/sscm.tl b/src/luarocks/fetch/sscm.tl
index fd9b2ef5..7c850a4b 100644
--- a/src/luarocks/fetch/sscm.tl
+++ b/src/luarocks/fetch/sscm.tl
@@ -6,8 +6,7 @@ end
6local fs = require("luarocks.fs") 6local fs = require("luarocks.fs")
7local dir = require("luarocks.dir") 7local dir = require("luarocks.dir")
8 8
9local type r = require("luarocks.core.types.rockspec") 9local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
10local type Rockspec = r.Rockspec
11 10
12--- Download sources via Surround SCM Server for building a rock. 11--- Download sources via Surround SCM Server for building a rock.
13-- @param rockspec table: The rockspec table 12-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/svn.tl b/src/luarocks/fetch/svn.tl
index fc4ba2a5..4d738d74 100644
--- a/src/luarocks/fetch/svn.tl
+++ b/src/luarocks/fetch/svn.tl
@@ -7,8 +7,7 @@ local fs = require("luarocks.fs")
7local dir = require("luarocks.dir") 7local dir = require("luarocks.dir")
8local util = require("luarocks.util") 8local util = require("luarocks.util")
9 9
10local type r = require("luarocks.core.types.rockspec") 10local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
11local type Rockspec = r.Rockspec
12 11
13--- Download sources for building a rock, using Subversion. 12--- Download sources for building a rock, using Subversion.
14-- @param rockspec table: The rockspec table 13-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/manif.tl b/src/luarocks/manif.tl
index 6fbf3fb2..ce3ca5c0 100644
--- a/src/luarocks/manif.tl
+++ b/src/luarocks/manif.tl
@@ -24,8 +24,7 @@ local util = require("luarocks.util")
24local queries = require("luarocks.queries") 24local queries = require("luarocks.queries")
25local type_manifest = require("luarocks.type.manifest") 25local type_manifest = require("luarocks.type.manifest")
26 26
27local type t = require("luarocks.core.types.tree") 27local type Tree = require("luarocks.core.types.tree").Tree
28local type Tree = t.Tree
29local type m = require("luarocks.core.types.manifest") 28local type m = require("luarocks.core.types.manifest")
30local type Manifest = m.Manifest 29local type Manifest = m.Manifest
31local type Tree_manifest = m.Tree_manifest 30local type Tree_manifest = m.Tree_manifest
diff --git a/src/luarocks/manif/writer.tl b/src/luarocks/manif/writer.tl
index 5af74e6a..24161af5 100644
--- a/src/luarocks/manif/writer.tl
+++ b/src/luarocks/manif/writer.tl
@@ -19,8 +19,7 @@ local queries = require("luarocks.queries")
19local type m = require("luarocks.core.types.manifest") 19local type m = require("luarocks.core.types.manifest")
20local type Manifest = m.Manifest 20local type Manifest = m.Manifest
21 21
22local type r = require("luarocks.core.types.rockspec") 22local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
23local type Rockspec = r.Rockspec
24 23
25local type res = require("luarocks.core.types.result") 24local type res = require("luarocks.core.types.result")
26local type Result = res.Result 25local type Result = res.Result
diff --git a/src/luarocks/pack.tl b/src/luarocks/pack.tl
index 037a1069..e4ffd117 100644
--- a/src/luarocks/pack.tl
+++ b/src/luarocks/pack.tl
@@ -15,8 +15,7 @@ local manif = require("luarocks.manif")
15local search = require("luarocks.search") 15local search = require("luarocks.search")
16local signing = require("luarocks.signing") 16local signing = require("luarocks.signing")
17 17
18local type t = require("luarocks.core.types.tree") 18local type Tree = require("luarocks.core.types.tree").Tree
19local type Tree = t.Tree
20 19
21local type q = require("luarocks.core.types.query") 20local type q = require("luarocks.core.types.query")
22local type Query = q.Query 21local type Query = q.Query
diff --git a/src/luarocks/path.tl b/src/luarocks/path.tl
index d6a06b5d..dae3e318 100644
--- a/src/luarocks/path.tl
+++ b/src/luarocks/path.tl
@@ -8,8 +8,7 @@ local core = require("luarocks.core.path")
8local dir = require("luarocks.dir") 8local dir = require("luarocks.dir")
9local util = require("luarocks.core.util") 9local util = require("luarocks.core.util")
10 10
11local type t = require("luarocks.core.types.tree") 11local type Tree = require("luarocks.core.types.tree").Tree
12local type Tree = t.Tree
13 12
14local record path 13local record path
15 rocks_dir: function(string | Tree): string 14 rocks_dir: function(string | Tree): string
diff --git a/src/luarocks/repos.tl b/src/luarocks/repos.tl
index 7b974221..ee4fcf62 100644
--- a/src/luarocks/repos.tl
+++ b/src/luarocks/repos.tl
@@ -28,11 +28,9 @@ local type rm = require("luarocks.core.types.rockmanifest")
28local type RockManifest = rm.RockManifest 28local type RockManifest = rm.RockManifest
29local type Entry = RockManifest.Entry 29local type Entry = RockManifest.Entry
30 30
31local type r = require("luarocks.core.types.rockspec") 31local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
32local type Rockspec = r.Rockspec
33 32
34local type t = require("luarocks.core.types.tree") 33local type Tree = require("luarocks.core.types.tree").Tree
35local type Tree = t.Tree
36 34
37local type Op = repos.Op 35local type Op = repos.Op
38local type Paths = repos.Paths 36local type Paths = repos.Paths
diff --git a/src/luarocks/search.tl b/src/luarocks/search.tl
index 3737b26a..97287a0f 100644
--- a/src/luarocks/search.tl
+++ b/src/luarocks/search.tl
@@ -18,8 +18,7 @@ local type Query = q.Query
18local type ver = require("luarocks.core.types.version") 18local type ver = require("luarocks.core.types.version")
19local type Version = ver.Version 19local type Version = ver.Version
20 20
21local type t = require("luarocks.core.types.tree") 21local type Tree = require("luarocks.core.types.tree").Tree
22local type Tree = t.Tree
23 22
24--- Store a search result (a rock or rockspec) in the result tree. 23--- Store a search result (a rock or rockspec) in the result tree.
25-- @param result_tree table: The result tree, where keys are package names and 24-- @param result_tree table: The result tree, where keys are package names and
diff --git a/src/luarocks/test.tl b/src/luarocks/test.tl
index b60e3458..d2e36409 100644
--- a/src/luarocks/test.tl
+++ b/src/luarocks/test.tl
@@ -5,9 +5,8 @@ local fetch = require("luarocks.fetch")
5local deps = require("luarocks.deps") 5local deps = require("luarocks.deps")
6local util = require("luarocks.util") 6local util = require("luarocks.util")
7 7
8local type r = require("luarocks.core.types.rockspec") 8local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
9local type Rockspec = r.Rockspec 9local type Dependencies = require("luarocks.core.types.rockspec").Dependencies
10local type Dependencies = r.Dependencies
11 10
12local type t = require("luarocks.core.types.testrunner") 11local type t = require("luarocks.core.types.testrunner")
13local type TestRunner = t.TestRunner 12local type TestRunner = t.TestRunner
diff --git a/src/luarocks/test/busted.tl b/src/luarocks/test/busted.tl
index 01473f1f..832a81b7 100644
--- a/src/luarocks/test/busted.tl
+++ b/src/luarocks/test/busted.tl
@@ -9,8 +9,7 @@ local dir = require("luarocks.dir")
9local queries = require("luarocks.queries") 9local queries = require("luarocks.queries")
10local install = require("luarocks.cmd.install") 10local install = require("luarocks.cmd.install")
11 11
12local type r = require("luarocks.core.types.rockspec") 12local type Test = require("luarocks.core.types.rockspec").Test
13local type Test = r.Test
14 13
15function busted.detect_type(): boolean 14function busted.detect_type(): boolean
16 if fs.exists(".busted") then 15 if fs.exists(".busted") then
diff --git a/src/luarocks/test/command.tl b/src/luarocks/test/command.tl
index 2a1e3ce9..217a34fc 100644
--- a/src/luarocks/test/command.tl
+++ b/src/luarocks/test/command.tl
@@ -5,8 +5,7 @@ end
5local fs = require("luarocks.fs") 5local fs = require("luarocks.fs")
6local cfg = require("luarocks.core.cfg") 6local cfg = require("luarocks.core.cfg")
7 7
8local type r = require("luarocks.core.types.rockspec") 8local type Test = require("luarocks.core.types.rockspec").Test
9local type Test = r.Test
10 9
11function command.detect_type(): boolean 10function command.detect_type(): boolean
12 if fs.exists("test.lua") then 11 if fs.exists("test.lua") then
diff --git a/src/luarocks/type/rockspec.tl b/src/luarocks/type/rockspec.tl
index 8458c6f7..52c0c029 100644
--- a/src/luarocks/type/rockspec.tl
+++ b/src/luarocks/type/rockspec.tl
@@ -6,8 +6,7 @@ end
6local type o = require("luarocks.core.types.ordering") 6local type o = require("luarocks.core.types.ordering")
7local type Ordering = o.Ordering 7local type Ordering = o.Ordering
8 8
9local type r = require("luarocks.core.types.rockspec") 9local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
10local type Rockspec = r.Rockspec
11 10
12local type_check = require("luarocks.type_check") 11local type_check = require("luarocks.type_check")
13 12
diff --git a/src/luarocks/upload/api.tl b/src/luarocks/upload/api.tl
index 4ea9f922..86a9e5cb 100644
--- a/src/luarocks/upload/api.tl
+++ b/src/luarocks/upload/api.tl
@@ -11,13 +11,6 @@ local record api
11 debug: boolean 11 debug: boolean
12 _server_tool_version: string 12 _server_tool_version: string
13 end 13 end
14
15 record Args
16 server: string
17 temp_key: string
18 api_key: string
19 debug: boolean
20 end
21end 14end
22 15
23local cfg = require("luarocks.core.cfg") 16local cfg = require("luarocks.core.cfg")
@@ -31,7 +24,7 @@ local dir_sep = package.config:sub(1, 1)
31 24
32local type Parameters = multipart.Parameters 25local type Parameters = multipart.Parameters
33local type Api = api.Api 26local type Api = api.Api
34local type Args = api.Args 27local type Args = require("luarocks.core.types.args").Args
35local type Configuration = api.Configuration 28local type Configuration = api.Configuration
36local type File = multipart.File 29local type File = multipart.File
37 30
diff --git a/src/luarocks/util.tl b/src/luarocks/util.tl
index c03751e6..79378416 100644
--- a/src/luarocks/util.tl
+++ b/src/luarocks/util.tl
@@ -51,8 +51,7 @@ util.keys = core.keys
51util.matchquote = core.matchquote 51util.matchquote = core.matchquote
52 52
53local type Fn = util.Fn 53local type Fn = util.Fn
54local type r = require("luarocks.core.types.rockspec") 54local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
55local type Rockspec = r.Rockspec
56 55
57local argparse = require("luarocks.vendor.argparse") 56local argparse = require("luarocks.vendor.argparse")
58local type Parser = argparse.Parser 57local type Parser = argparse.Parser