diff options
author | V1K1NGbg <victor@ilchev.com> | 2024-08-20 20:54:39 +0300 |
---|---|---|
committer | V1K1NGbg <victor@ilchev.com> | 2024-08-20 20:54:39 +0300 |
commit | 434042b9783359fea051d3649b03e9270e305dbb (patch) | |
tree | bd86f342f2bc0415c9df450a0ece3d1d8bb7aff9 | |
parent | ec0de3d09266f28cb9c45b635da50db113abeba2 (diff) | |
download | luarocks-434042b9783359fea051d3649b03e9270e305dbb.tar.gz luarocks-434042b9783359fea051d3649b03e9270e305dbb.tar.bz2 luarocks-434042b9783359fea051d3649b03e9270e305dbb.zip |
tynew type
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") | |||
9 | local dir = require("luarocks.dir") | 9 | local dir = require("luarocks.dir") |
10 | local util = require("luarocks.util") | 10 | local util = require("luarocks.util") |
11 | 11 | ||
12 | function cache.get_upload_server(server: string): string, string | 12 | function 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] |
18 | end | 18 | end |
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 | |||
21 | function add.add_to_parser(parser: Parser) | 21 | function 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 | |||
128 | end | 128 | end |
129 | 129 | ||
130 | function add.command(args: Args): boolean, string, string --! | 130 | function 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) |
134 | end | 134 | end |
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) | |||
22 | end | 22 | end |
23 | 23 | ||
24 | function refresh_cache.command(args: Args): boolean, string | 24 | function 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 | |||
21 | function admin_remove.add_to_parser(parser: Parser) | 21 | function 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 | |||
89 | end | 89 | end |
90 | 90 | ||
91 | function admin_remove.command(args: Args): boolean, string | 91 | function 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) --! |
95 | end | 95 | end |
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") | |||
10 | local dir = require("luarocks.dir") | 10 | local dir = require("luarocks.dir") |
11 | local manif = require("luarocks.manif") | 11 | local manif = require("luarocks.manif") |
12 | 12 | ||
13 | local type r = require("luarocks.core.types.rockspec") | 13 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
14 | local type Rockspec = r.Rockspec | ||
15 | 14 | ||
16 | local type m = require("luarocks.core.types.manifest") | 15 | local type m = require("luarocks.core.types.manifest") |
17 | local type Entry = m.Manifest.Entry | 16 | local 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") | |||
20 | local repo_writer = require("luarocks.repo_writer") | 20 | local repo_writer = require("luarocks.repo_writer") |
21 | local deplocks = require("luarocks.deplocks") | 21 | local deplocks = require("luarocks.deplocks") |
22 | 22 | ||
23 | local type r = require("luarocks.core.types.rockspec") | 23 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
24 | local type Rockspec = r.Rockspec | ||
25 | 24 | ||
26 | local type i = require("luarocks.core.types.installs") | 25 | local type InstallDirs = require("luarocks.core.types.installs").InstallDirs |
27 | local type InstallDirs = i.InstallDirs | 26 | local type InstallDir = require("luarocks.core.types.installs").InstallDir |
28 | local type InstallDir = i.InstallDir | ||
29 | 27 | ||
30 | local type t = require("luarocks.core.types.tree") | 28 | local type Tree = require("luarocks.core.types.tree").Tree |
31 | local type Tree = t.Tree | ||
32 | 29 | ||
33 | local type b = require("luarocks.core.types.build") | 30 | local type Build = require("luarocks.core.types.build").Build |
34 | local type Build = b.Build | 31 | local type Module = require("luarocks.core.types.build").BuiltinBuild.Module |
35 | local type Module = b.BuiltinBuild.Module | ||
36 | 32 | ||
37 | local type bo = require("luarocks.core.types.bopts") | 33 | local type BOpts = require("luarocks.core.types.bopts").BOpts |
38 | local type BOpts = bo.BOpts | ||
39 | 34 | ||
40 | 35 | ||
41 | local type Builds = build.Builds | 36 | local 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 |
5 | end | 5 | end |
6 | 6 | ||
7 | local type r = require("luarocks.core.types.rockspec") | 7 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
8 | local type Rockspec = r.Rockspec | ||
9 | 8 | ||
10 | local type b = require("luarocks.core.types.build") | 9 | local type BuiltinBuild = require("luarocks.core.types.build").BuiltinBuild |
11 | local type BuiltinBuild = b.BuiltinBuild | 10 | local type Build = require("luarocks.core.types.build").Build |
12 | local type Build = b.Build | ||
13 | local type Module = BuiltinBuild.Module | 11 | local 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") | |||
7 | local util = require("luarocks.util") | 7 | local util = require("luarocks.util") |
8 | local cfg = require("luarocks.core.cfg") | 8 | local cfg = require("luarocks.core.cfg") |
9 | 9 | ||
10 | local type r = require("luarocks.core.types.rockspec") | 10 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
11 | local type Rockspec = r.Rockspec | ||
12 | 11 | ||
13 | local type b = require("luarocks.core.types.build") | 12 | local type CMakeBuild = require("luarocks.core.types.build").CMakeBuild |
14 | local 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") | |||
7 | local util = require("luarocks.util") | 7 | local util = require("luarocks.util") |
8 | local cfg = require("luarocks.core.cfg") | 8 | local cfg = require("luarocks.core.cfg") |
9 | 9 | ||
10 | local type r = require("luarocks.core.types.rockspec") | 10 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
11 | local type Rockspec = r.Rockspec | ||
12 | 11 | ||
13 | local type b = require("luarocks.core.types.build") | 12 | local type CommandBuild = require("luarocks.core.types.build").CommandBuild |
14 | local 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") | |||
7 | local util = require("luarocks.util") | 7 | local util = require("luarocks.util") |
8 | local cfg = require("luarocks.core.cfg") | 8 | local cfg = require("luarocks.core.cfg") |
9 | 9 | ||
10 | local type r = require("luarocks.core.types.rockspec") | 10 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
11 | local type Rockspec = r.Rockspec | ||
12 | 11 | ||
13 | local type b = require("luarocks.core.types.build") | 12 | local type MakeBuild = require("luarocks.core.types.build").MakeBuild |
14 | local 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") | |||
22 | local fs = require("luarocks.fs") | 22 | local fs = require("luarocks.fs") |
23 | local argparse = require("luarocks.vendor.argparse") | 23 | local argparse = require("luarocks.vendor.argparse") |
24 | 24 | ||
25 | local type t = require("luarocks.core.types.tree") | 25 | local type Tree = require("luarocks.core.types.tree").Tree |
26 | local type Tree = t.Tree | ||
27 | 26 | ||
28 | local type Parser = argparse.Parser | 27 | local 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 | ||
25 | local type Args = require("luarocks.core.types.args").Args | 25 | local type Args = require("luarocks.core.types.args").Args |
26 | 26 | ||
27 | local type bo = require("luarocks.core.types.bopts") | 27 | local type BOpts = require("luarocks.core.types.bopts").BOpts |
28 | local type BOpts = bo.BOpts | ||
29 | 28 | ||
30 | local type r = require("luarocks.core.types.rockspec") | 29 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
31 | local type Rockspec = r.Rockspec | ||
32 | 30 | ||
33 | function cmd_build.add_to_parser(parser: Parser) | 31 | function 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") | |||
24 | local type Args = a.Args | 24 | local type Args = a.Args |
25 | 25 | ||
26 | 26 | ||
27 | local type i = require("luarocks.core.types.installs") | 27 | local type IOpts = require("luarocks.core.types.installs").IOpts |
28 | local type IOpts = i.IOpts | ||
29 | 28 | ||
30 | function install.add_to_parser(parser: Parser) | 29 | function 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 | |||
25 | local type a = require("luarocks.core.types.args") | 25 | local type a = require("luarocks.core.types.args") |
26 | local type Args = a.Args | 26 | local type Args = a.Args |
27 | 27 | ||
28 | local type t = require("luarocks.core.types.tree") | 28 | local type Tree = require("luarocks.core.types.tree").Tree |
29 | local type Tree = t.Tree | ||
30 | 29 | ||
31 | local type q = require("luarocks.core.types.query") | 30 | local type q = require("luarocks.core.types.query") |
32 | local type Query = q.Query | 31 | local 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 | |||
23 | local type a = require("luarocks.core.types.args") | 23 | local type a = require("luarocks.core.types.args") |
24 | local type Args = a.Args | 24 | local type Args = a.Args |
25 | 25 | ||
26 | local type bo = require("luarocks.core.types.bopts") | 26 | local type BOpts = require("luarocks.core.types.bopts").BOpts |
27 | local type BOpts = bo.BOpts | ||
28 | 27 | ||
29 | function make.cmd_options(parser: Parser) | 28 | function 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 | |||
21 | local type p = require("luarocks.core.types.persist") | 21 | local type p = require("luarocks.core.types.persist") |
22 | local type PersistableTable = p.PersistableTable | 22 | local type PersistableTable = p.PersistableTable |
23 | 23 | ||
24 | local type r = require("luarocks.core.types.rockspec") | 24 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
25 | local type Rockspec = r.Rockspec | ||
26 | 25 | ||
27 | function new_version.add_to_parser(parser: Parser) | 26 | function 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 |
9 | end | 9 | end |
10 | 10 | ||
@@ -20,6 +20,7 @@ local manif = require("luarocks.manif") | |||
20 | local repos = require("luarocks.repos") | 20 | local repos = require("luarocks.repos") |
21 | 21 | ||
22 | local type Return = show.Return | 22 | local type Return = show.Return |
23 | local type RenderData = {string: string | {string}} | ||
23 | 24 | ||
24 | local argparse = require("luarocks.vendor.argparse") | 25 | local argparse = require("luarocks.vendor.argparse") |
25 | local type Parser = argparse.Parser | 26 | local type Parser = argparse.Parser |
@@ -27,15 +28,13 @@ local type Parser = argparse.Parser | |||
27 | local type a = require("luarocks.core.types.args") | 28 | local type a = require("luarocks.core.types.args") |
28 | local type Args = a.Args | 29 | local type Args = a.Args |
29 | 30 | ||
30 | local type t = require("luarocks.core.types.tree") | 31 | local type Tree = require("luarocks.core.types.tree").Tree |
31 | local type Tree = t.Tree | ||
32 | 32 | ||
33 | local type q = require("luarocks.core.types.query") | 33 | local type q = require("luarocks.core.types.query") |
34 | local type Query = q.Query | 34 | local type Query = q.Query |
35 | 35 | ||
36 | local type r = require("luarocks.core.types.rockspec") | 36 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
37 | local type Rockspec = r.Rockspec | 37 | local type Dependencies = require("luarocks.core.types.rockspec").Dependencies |
38 | local type Dependencies = r.Dependencies | ||
39 | 38 | ||
40 | local type m = require("luarocks.core.types.manifest") | 39 | local type m = require("luarocks.core.types.manifest") |
41 | local type Entry = m.Manifest.Entry | 40 | local type Entry = m.Manifest.Entry |
@@ -152,17 +151,19 @@ local function format_text(text: string): string | |||
152 | end | 151 | end |
153 | 152 | ||
154 | local function installed_rock_label(dep: Query, tree: string | Tree): string | 153 | local 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" |
163 | end | 164 | end |
164 | 165 | ||
165 | local function render(template: string, data: {string: string | {string}}): string | 166 | local 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)) |
288 | end | 292 | end |
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 | |||
17 | local type a = require("luarocks.core.types.args") | 17 | local type a = require("luarocks.core.types.args") |
18 | local type Args = a.Args | 18 | local type Args = a.Args |
19 | 19 | ||
20 | local type r = require("luarocks.core.types.rockspec") | 20 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
21 | local type Rockspec = r.Rockspec | ||
22 | 21 | ||
23 | function unpack.add_to_parser(parser: Parser) | 22 | function 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 | ||
2 | local record upload | 2 | local record upload |
3 | record Response | ||
4 | end | ||
3 | end | 5 | end |
4 | 6 | ||
5 | local signing = require("luarocks.signing") | 7 | local 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") |
43 | end | 45 | end |
44 | 46 | ||
45 | function upload.command(args: Args): boolean, string, string --! | 47 | function 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 | |||
22 | local type p = require("luarocks.core.types.persist") | 22 | local type p = require("luarocks.core.types.persist") |
23 | local type PersistableTable = p.PersistableTable | 23 | local type PersistableTable = p.PersistableTable |
24 | 24 | ||
25 | local type b = require("luarocks.core.types.build") | 25 | local type BuiltinBuild = require("luarocks.core.types.build").BuiltinBuild |
26 | local type BuiltinBuild = b.BuiltinBuild | ||
27 | 26 | ||
28 | local type r = require("luarocks.core.types.rockspec") | 27 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
29 | local type Rockspec = r.Rockspec | 28 | local type Dependencies = require("luarocks.core.types.rockspec").Dependencies |
30 | local type Dependencies = r.Dependencies | ||
31 | 29 | ||
32 | local lua_versions = { | 30 | local 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 @@ | |||
1 | local type r = require("luarocks.core.types.rockspec") | 1 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
2 | local type Rockspec = r.Rockspec | ||
3 | 2 | ||
4 | local type t = require("luarocks.core.types.tree") | 3 | local type Tree = require("luarocks.core.types.tree").Tree |
5 | local type Tree = t.Tree | ||
6 | 4 | ||
7 | local record cfg | 5 | local 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 | |||
5 | local cfg = require("luarocks.core.cfg") | 5 | local cfg = require("luarocks.core.cfg") |
6 | local dir = require("luarocks.core.dir") | 6 | local dir = require("luarocks.core.dir") |
7 | 7 | ||
8 | local type t = require("luarocks.core.types.tree") | 8 | local type Tree = require("luarocks.core.types.tree").Tree |
9 | local type Tree = t.Tree | ||
10 | 9 | ||
11 | local dir_sep = package.config:sub(1, 1) | 10 | local 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 |
106 | end | 110 | end |
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 @@ | |||
1 | local type q = require("luarocks.core.types.query") | 1 | local type q = require("luarocks.core.types.query") |
2 | local type Query = q.Query | 2 | local type Query = q.Query |
3 | 3 | ||
4 | local type t = require("luarocks.core.types.tree") | 4 | local type Tree = require("luarocks.core.types.tree").Tree |
5 | local type Tree = t.Tree | ||
6 | 5 | ||
7 | local record manifest | 6 | local 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 @@ | |||
1 | local type q = require("luarocks.core.types.query") | 1 | local type q = require("luarocks.core.types.query") |
2 | local type Query = q.Query | 2 | local type Query = q.Query |
3 | 3 | ||
4 | local type b = require("luarocks.core.types.build") | 4 | local type Build = require("luarocks.core.types.build").Build |
5 | local type Build = b.Build | ||
6 | 5 | ||
7 | local record rockspec | 6 | local 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 @@ | |||
1 | local type r = require("luarocks.core.types.rockspec") | 1 | local type Test = require("luarocks.core.types.rockspec").Test |
2 | local type Test = r.Test | ||
3 | 2 | ||
4 | local record testrunner | 3 | local 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") | |||
14 | local queries = require("luarocks.queries") | 14 | local queries = require("luarocks.queries") |
15 | local deplocks = require("luarocks.deplocks") | 15 | local deplocks = require("luarocks.deplocks") |
16 | 16 | ||
17 | local type r = require("luarocks.core.types.rockspec") | 17 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
18 | local type Rockspec = r.Rockspec | 18 | local type Dependencies = require("luarocks.core.types.rockspec").Dependencies |
19 | local type Dependencies = r.Dependencies | ||
20 | 19 | ||
21 | local type bld = require("luarocks.core.types.build") | 20 | local type bld = require("luarocks.core.types.build") |
22 | local type BuiltinBuild = bld.BuiltinBuild | 21 | local type BuiltinBuild = bld.BuiltinBuild |
23 | local type Module = BuiltinBuild.Module | 22 | local type Module = BuiltinBuild.Module |
24 | local type Build = bld.Build | 23 | local type Build = bld.Build |
25 | 24 | ||
26 | local type t = require("luarocks.core.types.tree") | 25 | local type Tree = require("luarocks.core.types.tree").Tree |
27 | local type Tree = t.Tree | ||
28 | 26 | ||
29 | local type q = require("luarocks.core.types.query") | 27 | local type q = require("luarocks.core.types.query") |
30 | local type Query = q.Query | 28 | local 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 | ||
17 | local type Fetch = fetch.Fetch | 17 | local type Fetch = fetch.Fetch |
18 | local type Lock = fs.Lock --! | 18 | local type Lock = fs.Lock --! |
19 | local type r = require("luarocks.core.types.rockspec") | 19 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
20 | local type Rockspec = r.Rockspec | ||
21 | 20 | ||
22 | 21 | ||
23 | local function ensure_trailing_slash(url: string): string | 22 | local 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") | |||
7 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
8 | local util = require("luarocks.util") | 8 | local util = require("luarocks.util") |
9 | 9 | ||
10 | local type r = require("luarocks.core.types.rockspec") | 10 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
11 | local 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") | |||
9 | local vers = require("luarocks.core.vers") | 9 | local vers = require("luarocks.core.vers") |
10 | local util = require("luarocks.util") | 10 | local util = require("luarocks.util") |
11 | 11 | ||
12 | local type r = require("luarocks.core.types.rockspec") | 12 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
13 | local type Rockspec = r.Rockspec | ||
14 | local type v = require("luarocks.core.types.version") | 13 | local type v = require("luarocks.core.types.version") |
15 | local type Version = v.Version | 14 | local 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 | ||
6 | local git = require("luarocks.fetch.git") | 6 | local git = require("luarocks.fetch.git") |
7 | 7 | ||
8 | local type r = require("luarocks.core.types.rockspec") | 8 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
9 | local 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 | ||
13 | local git = require("luarocks.fetch.git") | 13 | local git = require("luarocks.fetch.git") |
14 | 14 | ||
15 | local type r = require("luarocks.core.types.rockspec") | 15 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
16 | local 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 | ||
13 | local git = require("luarocks.fetch.git") | 13 | local git = require("luarocks.fetch.git") |
14 | 14 | ||
15 | local type r = require("luarocks.core.types.rockspec") | 15 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
16 | local 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") | |||
7 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
8 | local util = require("luarocks.util") | 8 | local util = require("luarocks.util") |
9 | 9 | ||
10 | local type r = require("luarocks.core.types.rockspec") | 10 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
11 | local 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 | ||
11 | local hg = require("luarocks.fetch.hg") | 11 | local hg = require("luarocks.fetch.hg") |
12 | 12 | ||
13 | local type r = require("luarocks.core.types.rockspec") | 13 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
14 | local 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 | |||
6 | local fs = require("luarocks.fs") | 6 | local fs = require("luarocks.fs") |
7 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
8 | 8 | ||
9 | local type r = require("luarocks.core.types.rockspec") | 9 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
10 | local 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") | |||
7 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
8 | local util = require("luarocks.util") | 8 | local util = require("luarocks.util") |
9 | 9 | ||
10 | local type r = require("luarocks.core.types.rockspec") | 10 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
11 | local 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") | |||
24 | local queries = require("luarocks.queries") | 24 | local queries = require("luarocks.queries") |
25 | local type_manifest = require("luarocks.type.manifest") | 25 | local type_manifest = require("luarocks.type.manifest") |
26 | 26 | ||
27 | local type t = require("luarocks.core.types.tree") | 27 | local type Tree = require("luarocks.core.types.tree").Tree |
28 | local type Tree = t.Tree | ||
29 | local type m = require("luarocks.core.types.manifest") | 28 | local type m = require("luarocks.core.types.manifest") |
30 | local type Manifest = m.Manifest | 29 | local type Manifest = m.Manifest |
31 | local type Tree_manifest = m.Tree_manifest | 30 | local 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") | |||
19 | local type m = require("luarocks.core.types.manifest") | 19 | local type m = require("luarocks.core.types.manifest") |
20 | local type Manifest = m.Manifest | 20 | local type Manifest = m.Manifest |
21 | 21 | ||
22 | local type r = require("luarocks.core.types.rockspec") | 22 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
23 | local type Rockspec = r.Rockspec | ||
24 | 23 | ||
25 | local type res = require("luarocks.core.types.result") | 24 | local type res = require("luarocks.core.types.result") |
26 | local type Result = res.Result | 25 | local 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") | |||
15 | local search = require("luarocks.search") | 15 | local search = require("luarocks.search") |
16 | local signing = require("luarocks.signing") | 16 | local signing = require("luarocks.signing") |
17 | 17 | ||
18 | local type t = require("luarocks.core.types.tree") | 18 | local type Tree = require("luarocks.core.types.tree").Tree |
19 | local type Tree = t.Tree | ||
20 | 19 | ||
21 | local type q = require("luarocks.core.types.query") | 20 | local type q = require("luarocks.core.types.query") |
22 | local type Query = q.Query | 21 | local 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") | |||
8 | local dir = require("luarocks.dir") | 8 | local dir = require("luarocks.dir") |
9 | local util = require("luarocks.core.util") | 9 | local util = require("luarocks.core.util") |
10 | 10 | ||
11 | local type t = require("luarocks.core.types.tree") | 11 | local type Tree = require("luarocks.core.types.tree").Tree |
12 | local type Tree = t.Tree | ||
13 | 12 | ||
14 | local record path | 13 | local 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") | |||
28 | local type RockManifest = rm.RockManifest | 28 | local type RockManifest = rm.RockManifest |
29 | local type Entry = RockManifest.Entry | 29 | local type Entry = RockManifest.Entry |
30 | 30 | ||
31 | local type r = require("luarocks.core.types.rockspec") | 31 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
32 | local type Rockspec = r.Rockspec | ||
33 | 32 | ||
34 | local type t = require("luarocks.core.types.tree") | 33 | local type Tree = require("luarocks.core.types.tree").Tree |
35 | local type Tree = t.Tree | ||
36 | 34 | ||
37 | local type Op = repos.Op | 35 | local type Op = repos.Op |
38 | local type Paths = repos.Paths | 36 | local 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 | |||
18 | local type ver = require("luarocks.core.types.version") | 18 | local type ver = require("luarocks.core.types.version") |
19 | local type Version = ver.Version | 19 | local type Version = ver.Version |
20 | 20 | ||
21 | local type t = require("luarocks.core.types.tree") | 21 | local type Tree = require("luarocks.core.types.tree").Tree |
22 | local 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") | |||
5 | local deps = require("luarocks.deps") | 5 | local deps = require("luarocks.deps") |
6 | local util = require("luarocks.util") | 6 | local util = require("luarocks.util") |
7 | 7 | ||
8 | local type r = require("luarocks.core.types.rockspec") | 8 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
9 | local type Rockspec = r.Rockspec | 9 | local type Dependencies = require("luarocks.core.types.rockspec").Dependencies |
10 | local type Dependencies = r.Dependencies | ||
11 | 10 | ||
12 | local type t = require("luarocks.core.types.testrunner") | 11 | local type t = require("luarocks.core.types.testrunner") |
13 | local type TestRunner = t.TestRunner | 12 | local 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") | |||
9 | local queries = require("luarocks.queries") | 9 | local queries = require("luarocks.queries") |
10 | local install = require("luarocks.cmd.install") | 10 | local install = require("luarocks.cmd.install") |
11 | 11 | ||
12 | local type r = require("luarocks.core.types.rockspec") | 12 | local type Test = require("luarocks.core.types.rockspec").Test |
13 | local type Test = r.Test | ||
14 | 13 | ||
15 | function busted.detect_type(): boolean | 14 | function 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 | |||
5 | local fs = require("luarocks.fs") | 5 | local fs = require("luarocks.fs") |
6 | local cfg = require("luarocks.core.cfg") | 6 | local cfg = require("luarocks.core.cfg") |
7 | 7 | ||
8 | local type r = require("luarocks.core.types.rockspec") | 8 | local type Test = require("luarocks.core.types.rockspec").Test |
9 | local type Test = r.Test | ||
10 | 9 | ||
11 | function command.detect_type(): boolean | 10 | function 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 | |||
6 | local type o = require("luarocks.core.types.ordering") | 6 | local type o = require("luarocks.core.types.ordering") |
7 | local type Ordering = o.Ordering | 7 | local type Ordering = o.Ordering |
8 | 8 | ||
9 | local type r = require("luarocks.core.types.rockspec") | 9 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
10 | local type Rockspec = r.Rockspec | ||
11 | 10 | ||
12 | local type_check = require("luarocks.type_check") | 11 | local 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 | ||
21 | end | 14 | end |
22 | 15 | ||
23 | local cfg = require("luarocks.core.cfg") | 16 | local cfg = require("luarocks.core.cfg") |
@@ -31,7 +24,7 @@ local dir_sep = package.config:sub(1, 1) | |||
31 | 24 | ||
32 | local type Parameters = multipart.Parameters | 25 | local type Parameters = multipart.Parameters |
33 | local type Api = api.Api | 26 | local type Api = api.Api |
34 | local type Args = api.Args | 27 | local type Args = require("luarocks.core.types.args").Args |
35 | local type Configuration = api.Configuration | 28 | local type Configuration = api.Configuration |
36 | local type File = multipart.File | 29 | local 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 | |||
51 | util.matchquote = core.matchquote | 51 | util.matchquote = core.matchquote |
52 | 52 | ||
53 | local type Fn = util.Fn | 53 | local type Fn = util.Fn |
54 | local type r = require("luarocks.core.types.rockspec") | 54 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec |
55 | local type Rockspec = r.Rockspec | ||
56 | 55 | ||
57 | local argparse = require("luarocks.vendor.argparse") | 56 | local argparse = require("luarocks.vendor.argparse") |
58 | local type Parser = argparse.Parser | 57 | local type Parser = argparse.Parser |