Skip to content

Commit 400882c

Browse files
change namespace
1 parent c981148 commit 400882c

File tree

5 files changed

+72
-72
lines changed

5 files changed

+72
-72
lines changed

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
### Fixed
2323

2424
- Fixed `import_as_fallback` and `import_as_shared`, so they can be hot reloaded in some situations
25-
- Fixed some usage examples in the definitions from `SGG_Modding-ENVY-auto`
25+
- Fixed some usage examples in the definitions from `LuaENVY-ENVY-auto`
2626

2727
## [1.0.0] - 2024-05-15
2828

2929
### Added
3030

3131
- Initial Thunderstore release.
3232

33-
[unreleased]: https://github.com/SGG-Modding/ENVY/compare/1.1.0...HEAD
34-
[1.1.0]: https://github.com/SGG-Modding/ENVY/compare/1.0.1...1.1.0
35-
[1.0.1]: https://github.com/SGG-Modding/ENVY/compare/1.0.0...1.0.1
36-
[1.0.0]: https://github.com/SGG-Modding/ENVY/compare/6da071b5c4c8bb4458ed7ea5cb23e7f83d332911...1.0.0
33+
[unreleased]: https://github.com/LuaENVY/ENVY/compare/1.1.0...HEAD
34+
[1.1.0]: https://github.com/LuaENVY/ENVY/compare/1.0.1...1.1.0
35+
[1.0.1]: https://github.com/LuaENVY/ENVY/compare/1.0.0...1.0.1
36+
[1.0.0]: https://github.com/LuaENVY/ENVY/compare/6da071b5c4c8bb4458ed7ea5cb23e7f83d332911...1.0.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# ENVY
2-
A plugin to allow [ReturnOfModding](https://github.com/SGG-Modding/Hell2Modding) plugins greater control of their environment, helpful when you need to share information between multiple files in your plugin.
2+
A plugin to allow ReturnOfModding plugins greater control of their environment, helpful when you need to share information between multiple files in your plugin.

src/def.lua

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
---@meta SGG_Modding-ENVY
1+
---@meta LuaENVY-ENVY
22
local envy = {}
33

4-
---@alias SGG_Modding-ENVY*file userdata|table|string|fun(...): table
4+
---@alias LuaENVY-ENVY*file userdata|table|string|fun(...): table
55

66
--[[
77
Definition of `getfenv` in lua 5.2 for convenience
88
--]]
99
---@param fn integer | function? chunk function or stack level
1010
---@return table? env environment the chunk uses
1111
function envy.getfenv( fn ) end
12-
---@alias SGG_Modding-ENVY.getfenv ...
12+
---@alias LuaENVY-ENVY.getfenv ...
1313

1414
--[[
1515
Definition of `setfenv` in lua 5.2 for convenience
1616
--]]
1717
---@param fn integer | function? chunk function or stack level
1818
---@param env table? environment to set the chunk to use
1919
function envy.setfenv( fn, env ) end
20-
---@alias SGG_Modding-ENVY.setfenv ...
20+
---@alias LuaENVY-ENVY.setfenv ...
2121

2222

2323
--[[
@@ -32,12 +32,12 @@ function envy.setfenv( fn, env ) end
3232
result.value = 2; print(value) -- 2
3333
print(result.binder == binder) -- true
3434
--]]
35-
---@see SGG_Modding-ENVY.import_all to shallow copy into an environment
36-
---@see SGG_Modding-ENVY.import_as_fallback to use the result as a fallback
35+
---@see LuaENVY-ENVY.import_all to shallow copy into an environment
36+
---@see LuaENVY-ENVY.import_as_fallback to use the result as a fallback
3737
---@param binder function|integer? function to export locals
3838
---@return table result table bound to the upvalues <br/>
3939
function envy.export( binder ) end
40-
---@alias SGG_Modding-ENVY.export ...
40+
---@alias LuaENVY-ENVY.export ...
4141

4242

4343
--[[
@@ -49,18 +49,18 @@ function envy.export( binder ) end
4949
Usage:
5050
local helper = import(_ENV,"helper.lua")
5151
--]]
52-
---@see SGG_Modding-ENVY.export to share locals from the file
53-
---@see SGG_Modding-ENVY.import_all like python's `import *`
54-
---@see SGG_Modding-ENVY.import_as_fallback `import_all`, without shallow copy
52+
---@see LuaENVY-ENVY.export to share locals from the file
53+
---@see LuaENVY-ENVY.import_all like python's `import *`
54+
---@see LuaENVY-ENVY.import_as_fallback `import_all`, without shallow copy
5555
---@param env table environment (typically a plugin)
56-
---@param file SGG_Modding-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
56+
---@param file LuaENVY-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
5757
---@param fenv table? environment to give the function (not relevant if a module table was given)
5858
---@param level integer? stack level to send errors to
5959
---@param ... any arguments passed in to the chunk function (if relevant)
6060
---@return table data return value from the file/module
6161
---@return any ... additional return values from the file/module <br/>
6262
function envy.import(env,file,fenv,level,...) end
63-
---@alias SGG_Modding-ENVY.import ...
63+
---@alias LuaENVY-ENVY.import ...
6464

6565
--[[
6666
Uses `import` to get the data from a lua file/module,
@@ -70,15 +70,15 @@ function envy.import(env,file,fenv,level,...) end
7070
Usage:
7171
import_all(_ENV,"util.lua")
7272
--]]
73-
---@see SGG_Modding-ENVY.import how it obtains the data from the file/module
74-
---@see SGG_Modding-ENVY.import_as_fallback this, but without shallow copying.
75-
---@see SGG_Modding-ENVY.import_as_shared*auto this, but writes fallback as well.
73+
---@see LuaENVY-ENVY.import how it obtains the data from the file/module
74+
---@see LuaENVY-ENVY.import_as_fallback this, but without shallow copying.
75+
---@see LuaENVY-ENVY.import_as_shared*auto this, but writes fallback as well.
7676
---@param env table environment (typically a plugin)
77-
---@param file SGG_Modding-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
77+
---@param file LuaENVY-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
7878
---@param fenv table? environment to give the function (not relevant if a module table was given)
7979
---@param level integer? stack level to send errors to <br/>
8080
function envy.import_all(env,file,fenv,level,...) end
81-
---@alias SGG_Modding-ENVY.import_all ...
81+
---@alias LuaENVY-ENVY.import_all ...
8282

8383
--[[
8484
Uses `import` to get the data from a lua file/module,
@@ -89,14 +89,14 @@ function envy.import_all(env,file,fenv,level,...) end
8989
Usage:
9090
import_all_fallback(_ENV,"shell.lua")
9191
--]]
92-
---@see SGG_Modding-ENVY.import how it obtains the data from the file/module
93-
---@see SGG_Modding-ENVY.import_all this, but by shallow copying.
92+
---@see LuaENVY-ENVY.import how it obtains the data from the file/module
93+
---@see LuaENVY-ENVY.import_all this, but by shallow copying.
9494
---@param env table environment (typically a plugin)
95-
---@param file SGG_Modding-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
95+
---@param file LuaENVY-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
9696
---@param fenv table? environment to give the function (not relevant if a module table was given)
9797
---@param level integer? stack level to send errors to <br/>
9898
function envy.import_as_fallback(env,file,fenv,level,...) end
99-
---@alias SGG_Modding-ENVY.import_as_fallback ...
99+
---@alias LuaENVY-ENVY.import_as_fallback ...
100100

101101
--[[
102102
Uses `import` to get *and set* the data from a lua file/module,
@@ -107,15 +107,15 @@ function envy.import_as_fallback(env,file,fenv,level,...) end
107107
Usage:
108108
import_as_shared(_ENV,"state.lua")
109109
--]]
110-
---@see SGG_Modding-ENVY.import how it obtains the data from the file/module
111-
---@see SGG_Modding-ENVY.import_all this, but by shallow copying.
112-
---@see SGG_Modding-ENVY.import_as_shared this, but writes don't fallback.
110+
---@see LuaENVY-ENVY.import how it obtains the data from the file/module
111+
---@see LuaENVY-ENVY.import_all this, but by shallow copying.
112+
---@see LuaENVY-ENVY.import_as_shared this, but writes don't fallback.
113113
---@param env table environment (typically a plugin)
114-
---@param file SGG_Modding-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
114+
---@param file LuaENVY-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
115115
---@param fenv table? environment to give the function (not relevant if a module table was given)
116116
---@param level integer? stack level to send errors to <br/>
117117
function envy.import_as_shared(env,file,fenv,level,...) end
118-
---@alias SGG_Modding-ENVY.import_as_shared ...
118+
---@alias LuaENVY-ENVY.import_as_shared ...
119119

120120
--[[
121121
The extras are:
@@ -128,11 +128,11 @@ function envy.import_as_shared(env,file,fenv,level,...) end
128128
local _ENV, ext = setup(_ENV)
129129
import_all(_ENV,ext)
130130
--]]
131-
---@class SGG_Modding-ENVY*extras: table
132-
---@field public import fun(file: SGG_Modding-ENVY*file, fenv: table?,...): table loads a lua file/module relative to *your* plugin.
133-
---@field public import_all fun(file: SGG_Modding-ENVY*file, fenv: table?,...) uses `import` to get the data from a lua file/module (shallow copied into *your* environment).
134-
---@field public import_as_shared fun(file: SGG_Modding-ENVY*file, fenv: table?,...) uses `import` to get the data from a lua file/module (as fallback to *your* environment).
135-
---@field public import_as_fallback fun(file: SGG_Modding-ENVY*file, fenv: table?,...) uses `import` to get the data from a lua file/module (as a fallback with linked writes from *your* environment).
131+
---@class LuaENVY-ENVY*extras: table
132+
---@field public import fun(file: LuaENVY-ENVY*file, fenv: table?,...): table loads a lua file/module relative to *your* plugin.
133+
---@field public import_all fun(file: LuaENVY-ENVY*file, fenv: table?,...) uses `import` to get the data from a lua file/module (shallow copied into *your* environment).
134+
---@field public import_as_shared fun(file: LuaENVY-ENVY*file, fenv: table?,...) uses `import` to get the data from a lua file/module (as fallback to *your* environment).
135+
---@field public import_as_fallback fun(file: LuaENVY-ENVY*file, fenv: table?,...) uses `import` to get the data from a lua file/module (as a fallback with linked writes from *your* environment).
136136
---@field public export fun(binder: function|integer?): result: table exports locals by using a function bound to them as upvalues.
137137
---@field public private table the new 'private' environment
138138
---@field public public table the original 'public' environment
@@ -160,28 +160,28 @@ function envy.import_as_shared(env,file,fenv,level,...) end
160160
local _ENV, ext = setup(_ENV)
161161
import_all(_ENV,ext)
162162
--]]
163-
---@see SGG_Modding-ENVY*extras
164-
---@see SGG_Modding-ENVY.auto
165-
---@see SGG_Modding-ENVY.import_all
163+
---@see LuaENVY-ENVY*extras
164+
---@see LuaENVY-ENVY.auto
165+
---@see LuaENVY-ENVY.import_all
166166
---@return table newenv
167-
---@return SGG_Modding-ENVY*extras extras
167+
---@return LuaENVY-ENVY*extras extras
168168
function envy.setup(env) end
169-
---@alias SGG_Modding-ENVY.setup ...
169+
---@alias LuaENVY-ENVY.setup ...
170170

171171
--[[
172172
Finds the caller (at the stack `level`) to `setup` its environment and `import` all `extras`.
173173
174174
Usage:
175-
---@module 'SGG_Modding-ENVY-auto'
175+
---@module 'LuaENVY-ENVY-auto'
176176
auto()
177177
--]]
178-
---@see SGG_Modding-ENVY*extras
179-
---@see SGG_Modding-ENVY.setup
180-
---@see SGG_Modding-ENVY.import
178+
---@see LuaENVY-ENVY*extras
179+
---@see LuaENVY-ENVY.setup
180+
---@see LuaENVY-ENVY.import
181181
---@param level integer?
182-
---@return SGG_Modding-ENVY*extras extras
182+
---@return LuaENVY-ENVY*extras extras
183183
function envy.auto(level) end
184-
---@alias SGG_Modding-ENVY.auto ...
184+
---@alias LuaENVY-ENVY.auto ...
185185

186186
envy.globals = _G
187187

src/def_auto.lua

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---@meta SGG_Modding-ENVY-auto
1+
---@meta LuaENVY-ENVY-auto
22

33
--[[
44
Loads a lua file/module relative to *your* plugin.
@@ -9,16 +9,16 @@
99
Usage:
1010
local helper = import("helper.lua")
1111
--]]
12-
---@see SGG_Modding-ENVY-auto.export to share locals from the file
13-
---@see SGG_Modding-ENVY-auto.import_all like python's `import *`
14-
---@see SGG_Modding-ENVY-auto.import_as_fallback `import_all`, without shallow copy
15-
---@param file SGG_Modding-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
12+
---@see LuaENVY-ENVY-auto.export to share locals from the file
13+
---@see LuaENVY-ENVY-auto.import_all like python's `import *`
14+
---@see LuaENVY-ENVY-auto.import_as_fallback `import_all`, without shallow copy
15+
---@param file LuaENVY-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
1616
---@param fenv table? environment to give the function (not relevant if a module table was given)
1717
---@param ... any arguments passed in to the chunk function (if relevant)
1818
---@return table data return value from the file/module
1919
---@return any ... additional return values from the file/module <br/>
2020
function import(file,fenv,...) end
21-
---@alias SGG_Modding-ENVY-auto.import ...
21+
---@alias LuaENVY-ENVY-auto.import ...
2222

2323
--[[
2424
Uses `import` to get the data from a lua file/module,
@@ -28,13 +28,13 @@ function import(file,fenv,...) end
2828
Usage:
2929
import_all("util.lua")
3030
--]]
31-
---@see SGG_Modding-ENVY-auto.import how it obtains the data from the file/module
32-
---@see SGG_Modding-ENVY-auto.import_as_fallback this, but without shallow copying.
33-
---@param file SGG_Modding-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
31+
---@see LuaENVY-ENVY-auto.import how it obtains the data from the file/module
32+
---@see LuaENVY-ENVY-auto.import_as_fallback this, but without shallow copying.
33+
---@param file LuaENVY-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
3434
---@param fenv table? environment to give the function (not relevant if a module table was given)
3535
---@param ... any arguments passed in to the chunk function (if relevant) <br/>
3636
function import_all(file,fenv,...) end
37-
---@alias SGG_Modding-ENVY-auto.import_all ...
37+
---@alias LuaENVY-ENVY-auto.import_all ...
3838

3939
--[[
4040
Uses `import` to get the data from a lua file/module,
@@ -45,14 +45,14 @@ function import_all(file,fenv,...) end
4545
Usage:
4646
import_all_fallback("shell.lua")
4747
--]]
48-
---@see SGG_Modding-ENVY-auto.import how it obtains the data from the file/module
49-
---@see SGG_Modding-ENVY-auto.import_all this, but by shallow copying.
50-
---@see SGG_Modding-ENVY-auto.import_as_shared this, but writes fallback as well.
51-
---@param file SGG_Modding-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
48+
---@see LuaENVY-ENVY-auto.import how it obtains the data from the file/module
49+
---@see LuaENVY-ENVY-auto.import_all this, but by shallow copying.
50+
---@see LuaENVY-ENVY-auto.import_as_shared this, but writes fallback as well.
51+
---@param file LuaENVY-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
5252
---@param fenv table? environment to give the function (not relevant if a module table was given)
5353
---@param ... any arguments passed in to the chunk function (if relevant) <br/>
5454
function import_as_fallback(file,fenv,...) end
55-
---@alias SGG_Modding-ENVY-auto.import_as_fallback ...
55+
---@alias LuaENVY-ENVY-auto.import_as_fallback ...
5656

5757
--[[
5858
Uses `import` to get *and set* the data from a lua file/module,
@@ -63,14 +63,14 @@ function import_as_fallback(file,fenv,...) end
6363
Usage:
6464
import_as_shared("state.lua")
6565
--]]
66-
---@see SGG_Modding-ENVY-auto.import how it obtains the data from the file/module
67-
---@see SGG_Modding-ENVY-auto.import_all this, but by shallow copying.
68-
---@see SGG_Modding-ENVY-auto.import_as_shared this, but writes don't fallback.
69-
---@param file SGG_Modding-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
66+
---@see LuaENVY-ENVY-auto.import how it obtains the data from the file/module
67+
---@see LuaENVY-ENVY-auto.import_all this, but by shallow copying.
68+
---@see LuaENVY-ENVY-auto.import_as_shared this, but writes don't fallback.
69+
---@param file LuaENVY-ENVY*file path relative to plugin, absolute path, file handle, chunk function, or module table
7070
---@param fenv table? environment to give the function (not relevant if a module table was given)
7171
---@param ... any arguments passed in to the chunk function (if relevant) <br/>
7272
function import_as_shared(file,fenv,...) end
73-
---@alias SGG_Modding-ENVY-auto.import_as_shared*auto ...
73+
---@alias LuaENVY-ENVY-auto.import_as_shared*auto ...
7474

7575
--[[
7676
Exports locals by using a function bound to them as upvalues.
@@ -84,12 +84,12 @@ function import_as_shared(file,fenv,...) end
8484
result.value = 2; print(value) -- 2
8585
print(result.binder == binder) -- true
8686
--]]
87-
---@see SGG_Modding-ENVY-auto.import_all to shallow copy into an environment
88-
---@see SGG_Modding-ENVY-auto.import_as_fallback to use the result as a fallback
87+
---@see LuaENVY-ENVY-auto.import_all to shallow copy into an environment
88+
---@see LuaENVY-ENVY-auto.import_as_fallback to use the result as a fallback
8989
---@param binder function|integer? function to export locals
9090
---@return table result table bound to the upvalues <br/>
9191
function export( binder ) end
92-
---@alias SGG_Modding-ENVY-auto.export ...
92+
---@alias LuaENVY-ENVY-auto.export ...
9393

9494
-- the original 'public' environment
9595
public = _ENV

src/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ end
488488

489489
-- extending itself
490490

491-
---@module 'SGG_Modding-ENVY-auto'
491+
---@module 'LuaENVY-ENVY-auto'
492492
auto()
493493

494494
for k,v in pairs(exports) do

0 commit comments

Comments
 (0)