aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-08-06 12:39:50 +0300
committerV1K1NGbg <victor@ilchev.com>2024-08-06 12:39:50 +0300
commit4e40d895c233a90ca5cf7676375f17cb827f250a (patch)
tree3b3d0e625b28eb2041a43357c3bc1dccc2dae7b6
parentb9a6f9e6cb2b0f32e8a42db59025cbfba3e4c94d (diff)
downloadluarocks-4e40d895c233a90ca5cf7676375f17cb827f250a.tar.gz
luarocks-4e40d895c233a90ca5cf7676375f17cb827f250a.tar.bz2
luarocks-4e40d895c233a90ca5cf7676375f17cb827f250a.zip
fix almost all redeclerations
-rw-r--r--src/luarocks/core/cfg.d.tl10
-rw-r--r--src/luarocks/core/manif.tl22
-rw-r--r--src/luarocks/core/path.tl4
-rw-r--r--src/luarocks/core/types/manifest.d.tl8
-rw-r--r--src/luarocks/core/types/query.d.tl4
-rw-r--r--src/luarocks/core/types/rockspec.d.tl4
-rw-r--r--src/luarocks/core/util.tl6
-rw-r--r--src/luarocks/core/vers.tl6
-rw-r--r--src/luarocks/deps.tl29
-rw-r--r--src/luarocks/fetch.tl4
-rw-r--r--src/luarocks/fetch/cvs.tl4
-rw-r--r--src/luarocks/fetch/git.tl8
-rw-r--r--src/luarocks/fetch/git_file.tl4
-rw-r--r--src/luarocks/fetch/git_http.tl4
-rw-r--r--src/luarocks/fetch/git_ssh.tl4
-rw-r--r--src/luarocks/fetch/hg.tl4
-rw-r--r--src/luarocks/fetch/hg_http.tl4
-rw-r--r--src/luarocks/fetch/sscm.tl4
-rw-r--r--src/luarocks/fetch/svn.tl4
-rw-r--r--src/luarocks/manif.tl16
-rw-r--r--src/luarocks/path.tl4
-rw-r--r--src/luarocks/queries.tl25
-rw-r--r--src/luarocks/results.tl4
-rw-r--r--src/luarocks/rockspecs.tl17
-rw-r--r--src/luarocks/test.tl6
-rw-r--r--src/luarocks/type/manifest.tl4
-rw-r--r--src/luarocks/type/rockspec.tl8
-rw-r--r--src/luarocks/util.tl10
28 files changed, 115 insertions, 116 deletions
diff --git a/src/luarocks/core/cfg.d.tl b/src/luarocks/core/cfg.d.tl
index bbb070f2..b8501924 100644
--- a/src/luarocks/core/cfg.d.tl
+++ b/src/luarocks/core/cfg.d.tl
@@ -1,8 +1,8 @@
1local type rockspec = require("luarocks.core.types.rockspec") 1local type r = require("luarocks.core.types.rockspec")
2local type Rockspec = rockspec.Rockspec 2local type Rockspec = r.Rockspec
3local type Variables = rockspec.Variables 3local type Variables = r.Variables
4local type tree = require("luarocks.core.types.tree") 4local type t = require("luarocks.core.types.tree")
5local type Tree = tree.Tree 5local type Tree = t.Tree
6 6
7local record cfg 7local record cfg
8 detect_sysconfdir: function(): string 8 detect_sysconfdir: function(): string
diff --git a/src/luarocks/core/manif.tl b/src/luarocks/core/manif.tl
index 742e64b7..7ef018db 100644
--- a/src/luarocks/core/manif.tl
+++ b/src/luarocks/core/manif.tl
@@ -1,4 +1,7 @@
1 1
2--- Core functions for querying manifest files.
3local record manif
4end
2 5
3local persist = require("luarocks.core.persist") 6local persist = require("luarocks.core.persist")
4local cfg = require("luarocks.core.cfg") 7local cfg = require("luarocks.core.cfg")
@@ -7,20 +10,17 @@ local util = require("luarocks.core.util")
7local vers = require("luarocks.core.vers") 10local vers = require("luarocks.core.vers")
8local path = require("luarocks.core.path") 11local path = require("luarocks.core.path")
9 12
10local type tree = require("luarocks.core.types.tree") 13--------------------------------------------------------------------------------
11local type Tree = tree.Tree
12 14
13--- Core functions for querying manifest files. 15local type t = require("luarocks.core.types.tree")
14local record manif 16local type Tree = t.Tree
15end
16 17
17-------------------------------------------------------------------------------- 18local type q = require("luarocks.core.types.query")
18local type query = require("luarocks.core.types.query") 19local type Query = q.Query
19local type Query = query.Query
20 20
21local type manifest = require("luarocks.core.types.manifest") 21local type m = require("luarocks.core.types.manifest")
22local type Manifest = manifest.Manifest 22local type Manifest = m.Manifest
23local type Tree_manifest = manifest.Tree_manifest 23local type Tree_manifest = m.Tree_manifest
24 24
25 25
26 26
diff --git a/src/luarocks/core/path.tl b/src/luarocks/core/path.tl
index 563a36ef..37421445 100644
--- a/src/luarocks/core/path.tl
+++ b/src/luarocks/core/path.tl
@@ -5,8 +5,8 @@ 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 tree = require("luarocks.core.types.tree") 8local type t = require("luarocks.core.types.tree")
9local type Tree = tree.Tree 9local type Tree = t.Tree
10 10
11local dir_sep = package.config:sub(1, 1) 11local dir_sep = package.config:sub(1, 1)
12-------------------------------------------------------------------------------- 12--------------------------------------------------------------------------------
diff --git a/src/luarocks/core/types/manifest.d.tl b/src/luarocks/core/types/manifest.d.tl
index f24869b9..de1319d4 100644
--- a/src/luarocks/core/types/manifest.d.tl
+++ b/src/luarocks/core/types/manifest.d.tl
@@ -1,8 +1,8 @@
1local type query = require("luarocks.core.types.query") 1local type q = require("luarocks.core.types.query")
2local type Query = query.Query 2local type Query = q.Query
3 3
4local type tree = require("luarocks.core.types.tree") 4local type t = require("luarocks.core.types.tree")
5local type Tree = tree.Tree 5local type Tree = t.Tree
6 6
7local record manifest 7local record manifest
8 record Manifest 8 record Manifest
diff --git a/src/luarocks/core/types/query.d.tl b/src/luarocks/core/types/query.d.tl
index e1ef21b6..b23579af 100644
--- a/src/luarocks/core/types/query.d.tl
+++ b/src/luarocks/core/types/query.d.tl
@@ -1,5 +1,5 @@
1local type version = require("luarocks.core.types.version") 1local type v = require("luarocks.core.types.version")
2local type Constraint = version.Constraint 2local type Constraint = v.Constraint
3 3
4local record query 4local record query
5 record Query 5 record Query
diff --git a/src/luarocks/core/types/rockspec.d.tl b/src/luarocks/core/types/rockspec.d.tl
index 027cefb4..04dbcd82 100644
--- a/src/luarocks/core/types/rockspec.d.tl
+++ b/src/luarocks/core/types/rockspec.d.tl
@@ -1,5 +1,5 @@
1local type query = require("luarocks.core.types.query") 1local type q = require("luarocks.core.types.query")
2local type Query = query.Query 2local type Query = q.Query
3 3
4local record rockspec 4local record rockspec
5 record Description 5 record Description
diff --git a/src/luarocks/core/util.tl b/src/luarocks/core/util.tl
index 56c0072e..ede0e75f 100644
--- a/src/luarocks/core/util.tl
+++ b/src/luarocks/core/util.tl
@@ -4,9 +4,9 @@ end
4 4
5-------------------------------------------------------------------------------- 5--------------------------------------------------------------------------------
6 6
7local type ordering = require("luarocks.core.types.ordering") 7local type o = require("luarocks.core.types.ordering")
8local type Ordering = ordering.Ordering 8local type Ordering = o.Ordering
9local type SortBy = ordering.SortBy 9local type SortBy = o.SortBy
10 10
11local dir_sep = package.config:sub(1, 1) 11local dir_sep = package.config:sub(1, 1)
12 12
diff --git a/src/luarocks/core/vers.tl b/src/luarocks/core/vers.tl
index ab1c6c5b..f7ecdb98 100644
--- a/src/luarocks/core/vers.tl
+++ b/src/luarocks/core/vers.tl
@@ -2,9 +2,9 @@ local record vers
2end 2end
3 3
4local util = require("luarocks.core.util") 4local util = require("luarocks.core.util")
5local type version = require("luarocks.core.types.version") 5local type v = require("luarocks.core.types.version")
6local type Version = version.Version 6local type Version = v.Version
7local type Constraint = version.Constraint 7local type Constraint = v.Constraint
8-------------------------------------------------------------------------------- 8--------------------------------------------------------------------------------
9 9
10local deltas: {string: integer} = { 10local deltas: {string: integer} = {
diff --git a/src/luarocks/deps.tl b/src/luarocks/deps.tl
index cf552ef8..104be1b9 100644
--- a/src/luarocks/deps.tl
+++ b/src/luarocks/deps.tl
@@ -13,16 +13,17 @@ local vers = require("luarocks.core.vers")
13local queries = require("luarocks.queries") 13local queries = require("luarocks.queries")
14local deplocks = require("luarocks.deplocks") 14local deplocks = require("luarocks.deplocks")
15 15
16local type rockspec = require("luarocks.core.types.rockspec") 16local type r = require("luarocks.core.types.rockspec")
17local type Rockspec = rockspec.Rockspec 17local type Rockspec = r.Rockspec
18 18
19local type tree = require("luarocks.core.types.tree") 19local type t = require("luarocks.core.types.tree")
20local type Tree = tree.Tree 20local type Tree = t.Tree
21 21
22local core = require("luarocks.core.manif") 22local type q = require("luarocks.core.types.query")
23local type DependencyVersion = core.DependencyVersion 23local type Query = q.Query
24local type version = require("luarocks.core.types.version") 24
25local type Version = version.Version 25local type v = require("luarocks.core.types.version")
26local type Version = v.Version
26 27
27--- Generate a function that matches dep queries against the manifest, 28--- Generate a function that matches dep queries against the manifest,
28-- taking into account rocks_provided, the list of versions to skip, 29-- taking into account rocks_provided, the list of versions to skip,
@@ -41,9 +42,9 @@ local type Version = version.Version
41-- * map of versions to locations 42-- * map of versions to locations
42-- * version matched via lockfile if any 43-- * version matched via lockfile if any
43-- * true if rock matched via rocks_provided 44-- * true if rock matched via rocks_provided
44local function prepare_get_versions(deps_mode: string, rocks_provided: {string : string}, depskey: string, skip_set?): function(DependencyVersion): {string}, {string: string | Tree}, string, boolean 45local function prepare_get_versions(deps_mode: string, rocks_provided: {string : string}, depskey: string, skip_set?): function(Query): {string}, {string: string | Tree}, string, boolean
45 46
46 return function(dep: DependencyVersion): {string}, {string: string | Tree}, string, boolean 47 return function(dep: Query): {string}, {string: string | Tree}, string, boolean
47 local versions, locations: {string}, {string: string | Tree} 48 local versions, locations: {string}, {string: string | Tree}
48 local provided = rocks_provided[dep.name] 49 local provided = rocks_provided[dep.name]
49 if provided then 50 if provided then
@@ -83,8 +84,8 @@ end
83-- 2. nil 84-- 2. nil
84-- 3. either 'dep' or an alternative query to be used 85-- 3. either 'dep' or an alternative query to be used
85-- 4. false 86-- 4. false
86local function match_dep(dep: DependencyVersion, 87local function match_dep(dep: Query,
87 get_versions: function(DependencyVersion): {string}, {string: string | Tree}, string, boolean): string, string | Tree, DependencyVersion, boolean 88 get_versions: function(Query): {string}, {string: string | Tree}, string, boolean): string, string | Tree, Query, boolean
88 89
89 local versions, locations, lockversion, provided = get_versions(dep) 90 local versions, locations, lockversion, provided = get_versions(dep)
90 91
@@ -112,8 +113,8 @@ local function match_dep(dep: DependencyVersion,
112 return latest_vstring, locations[latest_vstring], dep, provided 113 return latest_vstring, locations[latest_vstring], dep, provided
113end 114end
114 115
115local function match_all_deps(dependencies: {DependencyVersion}, 116local function match_all_deps(dependencies: {Query},
116 get_versions: function(DependencyVersion): {string}, {string: string | Tree}, string, boolean): {DependencyVersion: any}, {string}, {string} 117 get_versions: function(Query): {string}, {string: string | Tree}, string, boolean): {Query: any}, {string}, {string}
117 118
118 local matched, missing, no_upgrade = {}, {}, {} 119 local matched, missing, no_upgrade = {}, {}, {}
119 120
diff --git a/src/luarocks/fetch.tl b/src/luarocks/fetch.tl
index 321d4f4e..6612b253 100644
--- a/src/luarocks/fetch.tl
+++ b/src/luarocks/fetch.tl
@@ -16,8 +16,8 @@ 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 rockspec = require("luarocks.core.types.rockspec") 19local type r = require("luarocks.core.types.rockspec")
20local type Rockspec = rockspec.Rockspec 20local type Rockspec = r.Rockspec
21 21
22 22
23local function ensure_trailing_slash(url: string): string 23local function ensure_trailing_slash(url: string): string
diff --git a/src/luarocks/fetch/cvs.tl b/src/luarocks/fetch/cvs.tl
index f40d0991..a2f67dcf 100644
--- a/src/luarocks/fetch/cvs.tl
+++ b/src/luarocks/fetch/cvs.tl
@@ -7,8 +7,8 @@ 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 rockspec = require("luarocks.core.types.rockspec") 10local type r = require("luarocks.core.types.rockspec")
11local type Rockspec = rockspec.Rockspec 11local type Rockspec = r.Rockspec
12 12
13--- Download sources for building a rock, using CVS. 13--- Download sources for building a rock, using CVS.
14-- @param rockspec table: The rockspec table 14-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/git.tl b/src/luarocks/fetch/git.tl
index 1a4438c9..466c4039 100644
--- a/src/luarocks/fetch/git.tl
+++ b/src/luarocks/fetch/git.tl
@@ -9,10 +9,10 @@ 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 rockspec = require("luarocks.core.types.rockspec") 12local type r = require("luarocks.core.types.rockspec")
13local type Rockspec = rockspec.Rockspec 13local type Rockspec = r.Rockspec
14local type version = require("luarocks.core.types.version") 14local type v = require("luarocks.core.types.version")
15local type Version = version.Version 15local type Version = v.Version
16 16
17local cached_git_version: Version 17local cached_git_version: Version
18 18
diff --git a/src/luarocks/fetch/git_file.tl b/src/luarocks/fetch/git_file.tl
index 858e67a3..06ada30b 100644
--- a/src/luarocks/fetch/git_file.tl
+++ b/src/luarocks/fetch/git_file.tl
@@ -5,8 +5,8 @@ end
5 5
6local git = require("luarocks.fetch.git") 6local git = require("luarocks.fetch.git")
7 7
8local type rockspec = require("luarocks.core.types.rockspec") 8local type r = require("luarocks.core.types.rockspec")
9local type Rockspec = rockspec.Rockspec 9local type Rockspec = r.Rockspec
10 10
11--- Fetch sources for building a rock from a local Git repository. 11--- Fetch sources for building a rock from a local Git repository.
12-- @param rockspec table: The rockspec table 12-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/git_http.tl b/src/luarocks/fetch/git_http.tl
index a7b3d692..ecf23763 100644
--- a/src/luarocks/fetch/git_http.tl
+++ b/src/luarocks/fetch/git_http.tl
@@ -12,8 +12,8 @@ end
12 12
13local git = require("luarocks.fetch.git") 13local git = require("luarocks.fetch.git")
14 14
15local type rockspec = require("luarocks.core.types.rockspec") 15local type r = require("luarocks.core.types.rockspec")
16local type Rockspec = rockspec.Rockspec 16local type Rockspec = r.Rockspec
17 17
18--- Fetch sources for building a rock from a local Git repository. 18--- Fetch sources for building a rock from a local Git repository.
19-- @param rockspec table: The rockspec table 19-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/git_ssh.tl b/src/luarocks/fetch/git_ssh.tl
index 65954353..0d6f9742 100644
--- a/src/luarocks/fetch/git_ssh.tl
+++ b/src/luarocks/fetch/git_ssh.tl
@@ -12,8 +12,8 @@ end
12 12
13local git = require("luarocks.fetch.git") 13local git = require("luarocks.fetch.git")
14 14
15local type rockspec = require("luarocks.core.types.rockspec") 15local type r = require("luarocks.core.types.rockspec")
16local type Rockspec = rockspec.Rockspec 16local type Rockspec = r.Rockspec
17 17
18--- Fetch sources for building a rock from a local Git repository. 18--- Fetch sources for building a rock from a local Git repository.
19-- @param rockspec table: The rockspec table 19-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/hg.tl b/src/luarocks/fetch/hg.tl
index 0fbf5601..cbdcdc86 100644
--- a/src/luarocks/fetch/hg.tl
+++ b/src/luarocks/fetch/hg.tl
@@ -7,8 +7,8 @@ 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 rockspec = require("luarocks.core.types.rockspec") 10local type r = require("luarocks.core.types.rockspec")
11local type Rockspec = rockspec.Rockspec 11local type Rockspec = r.Rockspec
12 12
13--- Download sources for building a rock, using hg. 13--- Download sources for building a rock, using hg.
14-- @param rockspec table: The rockspec table 14-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/hg_http.tl b/src/luarocks/fetch/hg_http.tl
index f526d2d5..218543cd 100644
--- a/src/luarocks/fetch/hg_http.tl
+++ b/src/luarocks/fetch/hg_http.tl
@@ -10,8 +10,8 @@ end
10 10
11local hg = require("luarocks.fetch.hg") 11local hg = require("luarocks.fetch.hg")
12 12
13local type rockspec = require("luarocks.core.types.rockspec") 13local type r = require("luarocks.core.types.rockspec")
14local type Rockspec = rockspec.Rockspec 14local type Rockspec = r.Rockspec
15 15
16--- Download sources for building a rock, using hg over http. 16--- Download sources for building a rock, using hg over http.
17-- @param rockspec table: The rockspec table 17-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/sscm.tl b/src/luarocks/fetch/sscm.tl
index ad5a615e..fd9b2ef5 100644
--- a/src/luarocks/fetch/sscm.tl
+++ b/src/luarocks/fetch/sscm.tl
@@ -6,8 +6,8 @@ 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 rockspec = require("luarocks.core.types.rockspec") 9local type r = require("luarocks.core.types.rockspec")
10local type Rockspec = rockspec.Rockspec 10local type Rockspec = r.Rockspec
11 11
12--- Download sources via Surround SCM Server for building a rock. 12--- Download sources via Surround SCM Server for building a rock.
13-- @param rockspec table: The rockspec table 13-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/fetch/svn.tl b/src/luarocks/fetch/svn.tl
index df3cdde9..3db136e9 100644
--- a/src/luarocks/fetch/svn.tl
+++ b/src/luarocks/fetch/svn.tl
@@ -7,8 +7,8 @@ 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 rockspec = require("luarocks.core.types.rockspec") 10local type r = require("luarocks.core.types.rockspec")
11local type Rockspec = rockspec.Rockspec 11local type Rockspec = r.Rockspec
12 12
13--- Download sources for building a rock, using Subversion. 13--- Download sources for building a rock, using Subversion.
14-- @param rockspec table: The rockspec table 14-- @param rockspec table: The rockspec table
diff --git a/src/luarocks/manif.tl b/src/luarocks/manif.tl
index f1963150..7a003021 100644
--- a/src/luarocks/manif.tl
+++ b/src/luarocks/manif.tl
@@ -9,9 +9,9 @@ local record manif
9 rock_manifest_cache: {string: RockManifest} 9 rock_manifest_cache: {string: RockManifest}
10end 10end
11 11
12local type rockmanifest = require("luarocks.core.types.rockmanifest") 12local type rm = require("luarocks.core.types.rockmanifest")
13local type RockManifest = rockmanifest.RockManifest 13local type RockManifest = rm.RockManifest
14local type Entry = rockmanifest.RockManifest.Entry 14local type Entry = rm.RockManifest.Entry
15 15
16local core = require("luarocks.core.manif") 16local core = require("luarocks.core.manif")
17local persist = require("luarocks.persist") 17local persist = require("luarocks.persist")
@@ -24,13 +24,13 @@ 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 tree = require("luarocks.core.types.tree") 27local type t = require("luarocks.core.types.tree")
28local type Tree = tree.Tree 28local type Tree = t.Tree
29local type m = require("luarocks.core.types.manifest") 29local type m = require("luarocks.core.types.manifest")
30local type Manifest = m.Manifest 30local type Manifest = m.Manifest
31local type Tree_manifest = m .Tree_manifest 31local type Tree_manifest = m.Tree_manifest
32local type query = require("luarocks.core.types.query") 32local type q = require("luarocks.core.types.query")
33local type Query = query.Query 33local type Query = q.Query
34 34
35manif.cache_manifest = core.cache_manifest 35manif.cache_manifest = core.cache_manifest
36manif.load_rocks_tree_manifests = core.load_rocks_tree_manifests 36manif.load_rocks_tree_manifests = core.load_rocks_tree_manifests
diff --git a/src/luarocks/path.tl b/src/luarocks/path.tl
index 1dc77e86..908b5952 100644
--- a/src/luarocks/path.tl
+++ b/src/luarocks/path.tl
@@ -8,8 +8,8 @@ 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 tree = require("luarocks.core.types.tree") 11local type t = require("luarocks.core.types.tree")
12local type Tree = tree.Tree 12local type Tree = t.Tree
13 13
14local record path 14local record path
15 rocks_dir: function(string | Tree): string 15 rocks_dir: function(string | Tree): string
diff --git a/src/luarocks/queries.tl b/src/luarocks/queries.tl
index dec57585..bed7612c 100644
--- a/src/luarocks/queries.tl
+++ b/src/luarocks/queries.tl
@@ -6,22 +6,23 @@ local vers = require("luarocks.core.vers")
6local util = require("luarocks.util") 6local util = require("luarocks.util")
7local cfg = require("luarocks.core.cfg") 7local cfg = require("luarocks.core.cfg")
8 8
9local type query = require("luarocks.core.types.query") 9local type q = require("luarocks.core.types.query")
10local type version = require("luarocks.core.types.version") 10local type Query = q.Query
11local type Query = query.Query 11
12local type Version = version.Version 12local type v = require("luarocks.core.types.version")
13local type Constraint = version.Constraint 13local type Version = v.Version
14local type Constraint = v.Constraint
14 15
15local query_mt: metatable<Query> = {} 16local query_mt: metatable<Query> = {}
16 17
17query_mt.__index = query.Query 18query_mt.__index = q.Query
18 19
19function query.Query.type(): string --? remove later 20function q.Query.type(): string --? remove later
20 return "query" 21 return "query"
21end 22end
22 23
23-- Fallback default value for the `arch` field, if not explicitly set. 24-- Fallback default value for the `arch` field, if not explicitly set.
24query.Query.arch = { 25q.Query.arch = {
25 src = true, 26 src = true,
26 all = true, 27 all = true,
27 rockspec = true, 28 rockspec = true,
@@ -30,7 +31,7 @@ query.Query.arch = {
30} 31}
31 32
32-- Fallback default value for the `substring` field, if not explicitly set. 33-- Fallback default value for the `substring` field, if not explicitly set.
33query.Query.substring = false 34q.Query.substring = false
34 35
35--- Convert the arch field of a query table to table format. 36--- Convert the arch field of a query table to table format.
36-- @param input string, table or nil 37-- @param input string, table or nil
@@ -75,7 +76,7 @@ function queries.new(name: string, namespace?: string, version?: string, substri
75 table.insert(self.constraints, { op = operator, version = vers.parse_version(version)}) 76 table.insert(self.constraints, { op = operator, version = vers.parse_version(version)})
76 end 77 end
77 78
78 query.Query.arch[cfg.arch] = true 79 q.Query.arch[cfg.arch] = true
79 return setmetatable(self, query_mt) 80 return setmetatable(self, query_mt)
80end 81end
81 82
@@ -179,13 +180,13 @@ do
179 constraints = constraints, 180 constraints = constraints,
180 } 181 }
181 182
182 query.Query.arch[cfg.arch] = true 183 q.Query.arch[cfg.arch] = true
183 return setmetatable(self, query_mt) 184 return setmetatable(self, query_mt)
184 end 185 end
185end 186end
186 187
187function queries.from_persisted_table(tbl: Query): Query 188function queries.from_persisted_table(tbl: Query): Query
188 query.Query.arch[cfg.arch] = true 189 q.Query.arch[cfg.arch] = true
189 return setmetatable(tbl, query_mt) 190 return setmetatable(tbl, query_mt)
190end 191end
191 192
diff --git a/src/luarocks/results.tl b/src/luarocks/results.tl
index 99f70ec4..cbe6704d 100644
--- a/src/luarocks/results.tl
+++ b/src/luarocks/results.tl
@@ -10,10 +10,10 @@ end
10 10
11local vers = require("luarocks.core.vers") 11local vers = require("luarocks.core.vers")
12local util = require("luarocks.util") 12local util = require("luarocks.util")
13local type query = require("luarocks.core.types.query") 13local type q = require("luarocks.core.types.query")
14local type Query = q.Query
14 15
15local type Results = results.Results 16local type Results = results.Results
16local type Query = query.Query
17 17
18local result_mt: metatable<Results> = {} 18local result_mt: metatable<Results> = {}
19 19
diff --git a/src/luarocks/rockspecs.tl b/src/luarocks/rockspecs.tl
index 175428c4..3ea6c147 100644
--- a/src/luarocks/rockspecs.tl
+++ b/src/luarocks/rockspecs.tl
@@ -9,15 +9,12 @@ local type_rockspec = require("luarocks.type.rockspec")
9local util = require("luarocks.util") 9local util = require("luarocks.util")
10local vers = require("luarocks.core.vers") 10local vers = require("luarocks.core.vers")
11 11
12local type rockspec = require("luarocks.core.types.rockspec") 12local type r = require("luarocks.core.types.rockspec")
13local type Rockspec = rockspec.Rockspec 13local type Rockspec = r.Rockspec
14local type Variables = r.Variables
14 15
15-- local type Query = require("luarocks.core.types.query").Query --TEAL BUG #778 16local type q = require("luarocks.core.types.query")
16 17local type Query = q.Query
17local type query = require("luarocks.core.types.query")
18local type Query = query.Query
19
20local type Variables = rockspec.Variables
21 18
22local vendored_build_type_set: {string: boolean} = { 19local vendored_build_type_set: {string: boolean} = {
23 ["builtin"] = true, 20 ["builtin"] = true,
@@ -30,9 +27,9 @@ local vendored_build_type_set: {string: boolean} = {
30 27
31local rockspec_mt: metatable<Rockspec> = {} 28local rockspec_mt: metatable<Rockspec> = {}
32 29
33rockspec_mt.__index = rockspec.Rockspec 30rockspec_mt.__index = r.Rockspec
34 31
35function rockspec.Rockspec.type(): string 32function r.Rockspec.type(): string
36 return "rockspec" 33 return "rockspec"
37end 34end
38 35
diff --git a/src/luarocks/test.tl b/src/luarocks/test.tl
index ec2b0ada..56bc8c74 100644
--- a/src/luarocks/test.tl
+++ b/src/luarocks/test.tl
@@ -5,9 +5,9 @@ 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 rockspec = require("luarocks.core.types.rockspec") 8local type r = require("luarocks.core.types.rockspec")
9local type Rockspec = rockspec.Rockspec 9local type Rockspec = r.Rockspec
10local type Test = rockspec.Test 10local type Test = r.Test
11 11
12local test_types = { 12local test_types = {
13 "busted", 13 "busted",
diff --git a/src/luarocks/type/manifest.tl b/src/luarocks/type/manifest.tl
index 3114b82a..2f9a8a5d 100644
--- a/src/luarocks/type/manifest.tl
+++ b/src/luarocks/type/manifest.tl
@@ -1,8 +1,8 @@
1local record type_manifest 1local record type_manifest
2end 2end
3 3
4local type manifest = require("luarocks.core.types.manifest") 4local type m = require("luarocks.core.types.manifest")
5local type Manifest = manifest.Manifest 5local type Manifest = m.Manifest
6 6
7local type_check = require("luarocks.type_check") 7local type_check = require("luarocks.type_check")
8 8
diff --git a/src/luarocks/type/rockspec.tl b/src/luarocks/type/rockspec.tl
index 014dc4d3..8458c6f7 100644
--- a/src/luarocks/type/rockspec.tl
+++ b/src/luarocks/type/rockspec.tl
@@ -3,11 +3,11 @@ local record type_rockspec
3 rockspec_format: string 3 rockspec_format: string
4end 4end
5 5
6local type ordering = require("luarocks.core.types.ordering") 6local type o = require("luarocks.core.types.ordering")
7local type Ordering = ordering.Ordering 7local type Ordering = o.Ordering
8 8
9local type rockspec = require("luarocks.core.types.rockspec") 9local type r = require("luarocks.core.types.rockspec")
10local type Rockspec = rockspec.Rockspec 10local type Rockspec = r.Rockspec
11 11
12local type_check = require("luarocks.type_check") 12local type_check = require("luarocks.type_check")
13 13
diff --git a/src/luarocks/util.tl b/src/luarocks/util.tl
index 4b4fd3bd..9e940f8c 100644
--- a/src/luarocks/util.tl
+++ b/src/luarocks/util.tl
@@ -7,9 +7,9 @@
7local core = require("luarocks.core.util") 7local core = require("luarocks.core.util")
8local cfg = require("luarocks.core.cfg") 8local cfg = require("luarocks.core.cfg")
9 9
10local type ordering = require("luarocks.core.types.ordering") 10local type o = require("luarocks.core.types.ordering")
11local type Ordering = ordering.Ordering 11local type Ordering = o.Ordering
12local type SortBy = ordering.SortBy 12local type SortBy = o.SortBy
13 13
14local record util 14local record util
15 cleanup_path: function(string, string, string, boolean): string 15 cleanup_path: function(string, string, string, boolean): string
@@ -51,8 +51,8 @@ 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 rockspec = require("luarocks.core.types.rockspec") 54local type r = require("luarocks.core.types.rockspec")
55local type Rockspec = rockspec.Rockspec 55local type Rockspec = r.Rockspec
56local type Parser = util.Parser 56local type Parser = util.Parser
57 57
58 58