lenix 1.0.0 β 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +48 -1
- package/bin/Readme.md +23 -0
- package/bin/lua_modules.sh +50 -0
- package/dist/fxmanifest/index.d.ts +4 -0
- package/dist/fxmanifest/index.js +24 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +1 -24
- package/package.json +23 -4
- /package/dist/{fxmanifest.json β fxmanifest/fxmanifest.json} +0 -0
package/Readme.md
CHANGED
|
@@ -1 +1,48 @@
|
|
|
1
|
-
#
|
|
1
|
+
# lenix
|
|
2
|
+
|
|
3
|
+
Helpful modules for the software engineers
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
## π Depend
|
|
9
|
+
```json
|
|
10
|
+
"lenix": "latest",
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## π₯ Install
|
|
14
|
+
### NPM
|
|
15
|
+
```bash
|
|
16
|
+
npm i lenix
|
|
17
|
+
```
|
|
18
|
+
### PNPM
|
|
19
|
+
```bash
|
|
20
|
+
pnpm i lenix
|
|
21
|
+
```
|
|
22
|
+
### BUN
|
|
23
|
+
```bash
|
|
24
|
+
bun i lenix
|
|
25
|
+
```
|
|
26
|
+
### YARN
|
|
27
|
+
```bash
|
|
28
|
+
yarn add lenix
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## π Documentation
|
|
32
|
+
unavailable
|
|
33
|
+
|
|
34
|
+
## GitHub
|
|
35
|
+
[](https://github.com/lenixdev/lenix)
|
|
36
|
+
|
|
37
|
+
## πΊοΈ Roadmap
|
|
38
|
+
- [ ]
|
|
39
|
+
|
|
40
|
+
## π§ΎLicense
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
## π Support
|
|
44
|
+
[](https://discord.gg/users/886958797631926373)
|
|
45
|
+
|
|
46
|
+
## π» Build with
|
|
47
|
+

|
|
48
|
+

|
package/bin/Readme.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Lua Modules Setup
|
|
2
|
+
|
|
3
|
+
Auto-configure Lua to use `./lua_modules` (like `node_modules`).
|
|
4
|
+
|
|
5
|
+
### Install
|
|
6
|
+
```bash
|
|
7
|
+
npx lenix-lua_modules
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### Usage
|
|
11
|
+
```bash
|
|
12
|
+
# Install Lua packages
|
|
13
|
+
luarocks install --tree ./lua_modules inspect
|
|
14
|
+
|
|
15
|
+
# Use in code (no setup needed)
|
|
16
|
+
local inspect = require('inspect')
|
|
17
|
+
print(inspect({name = "Lenix"}))
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### What it does
|
|
21
|
+
|
|
22
|
+
Adds environment variables to your shell config (`~/.zshrc` or `~/.bashrc`) to automatically change your Lua modules configurations to `./lua_modules` instead of hidden nested directories.
|
|
23
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
SHELL_CONFIG="${HOME}/.zshrc"
|
|
4
|
+
|
|
5
|
+
if [ -f "${HOME}/.bashrc" ]; then
|
|
6
|
+
SHELL_CONFIG="${HOME}/.bashrc"
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
echo "===================================="
|
|
10
|
+
echo "Lua Modules Setup"
|
|
11
|
+
echo "===================================="
|
|
12
|
+
echo ""
|
|
13
|
+
echo "This script will add the following lines to: $SHELL_CONFIG"
|
|
14
|
+
echo ""
|
|
15
|
+
echo "# Lua local modules setup"
|
|
16
|
+
echo "eval \$(luarocks path --bin)"
|
|
17
|
+
echo "export LUA_PATH=\"./lua_modules/share/lua/5.4/?.lua;./lua_modules/share/lua/5.4/?/init.lua;;\""
|
|
18
|
+
echo "export LUA_CPATH=\"./lua_modules/lib/lua/5.4/?.so;;\""
|
|
19
|
+
echo ""
|
|
20
|
+
read -p "Continue? (y/n) " -n 1 -r
|
|
21
|
+
echo ""
|
|
22
|
+
|
|
23
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
24
|
+
echo "Installation cancelled."
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
if grep -q "# Lua local modules setup" "$SHELL_CONFIG"; then
|
|
29
|
+
echo "β οΈ Already installed in $SHELL_CONFIG"
|
|
30
|
+
echo "Installation aborted."
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
echo '' >> "$SHELL_CONFIG"
|
|
35
|
+
echo '# Lua local modules setup' >> "$SHELL_CONFIG"
|
|
36
|
+
echo 'eval $(luarocks path --bin)' >> "$SHELL_CONFIG"
|
|
37
|
+
echo 'export LUA_PATH="./lua_modules/share/lua/5.4/?.lua;./lua_modules/share/lua/5.4/?/init.lua;;"' >> "$SHELL_CONFIG"
|
|
38
|
+
echo 'export LUA_CPATH="./lua_modules/lib/lua/5.4/?.so;;"' >> "$SHELL_CONFIG"
|
|
39
|
+
|
|
40
|
+
source "$SHELL_CONFIG" 2>/dev/null || true
|
|
41
|
+
|
|
42
|
+
echo ""
|
|
43
|
+
echo "β Setup complete!"
|
|
44
|
+
echo "β Added 4 lines to: $SHELL_CONFIG"
|
|
45
|
+
echo ""
|
|
46
|
+
echo "π¦ Usage:"
|
|
47
|
+
echo " luarocks install --tree ./lua_modules <package>"
|
|
48
|
+
echo ""
|
|
49
|
+
echo "To undo, remove lines containing '# Lua local modules setup' from $SHELL_CONFIG"
|
|
50
|
+
echo "Restart your terminal or run: source $SHELL_CONFIG"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { writeFile } from 'fs/promises';
|
|
2
|
+
const fxmanifest = Object.entries((await import('./fxmanifest.json')).default);
|
|
3
|
+
const generateContent = () => {
|
|
4
|
+
let defaultContent = '';
|
|
5
|
+
for (const [key, value] of fxmanifest) {
|
|
6
|
+
if (Array.isArray(value)) {
|
|
7
|
+
defaultContent +=
|
|
8
|
+
`${key} {
|
|
9
|
+
"${value}",
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
}
|
|
13
|
+
else if (typeof value === 'string') {
|
|
14
|
+
defaultContent +=
|
|
15
|
+
`${key} "${value}"
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
else
|
|
19
|
+
throw new Error('Invalid value type');
|
|
20
|
+
}
|
|
21
|
+
return defaultContent;
|
|
22
|
+
};
|
|
23
|
+
const createFxmanifest = async (content) => await writeFile('fxmanifest.lua', content || generateContent());
|
|
24
|
+
export { createFxmanifest };
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const fxmanifest = Object.entries((await import('./fxmanifest.json')).default);
|
|
3
|
-
const generateContent = () => {
|
|
4
|
-
let defaultContent = '';
|
|
5
|
-
for (const [key, value] of fxmanifest) {
|
|
6
|
-
if (Array.isArray(value)) {
|
|
7
|
-
defaultContent +=
|
|
8
|
-
`${key} {
|
|
9
|
-
"${value}",
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
|
-
}
|
|
13
|
-
else if (typeof value === 'string') {
|
|
14
|
-
defaultContent +=
|
|
15
|
-
`${key} "${value}"
|
|
16
|
-
`;
|
|
17
|
-
}
|
|
18
|
-
else
|
|
19
|
-
throw new Error('Invalid value type');
|
|
20
|
-
}
|
|
21
|
-
return defaultContent;
|
|
22
|
-
};
|
|
23
|
-
const createFxmanifest = async (content) => await writeFile('fxmanifest.lua', content || generateContent());
|
|
24
|
-
export { createFxmanifest };
|
|
1
|
+
export default {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lenix",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "Lenix",
|
|
6
|
+
"license": "GPL-3.0",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"lenix",
|
|
9
|
+
"lua",
|
|
10
|
+
"luarocks",
|
|
11
|
+
"modules"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/lenixdev/lenix.git"
|
|
16
|
+
},
|
|
4
17
|
"main": "./dist/index.js",
|
|
5
18
|
"types": "./dist/index.d.ts",
|
|
6
|
-
"
|
|
19
|
+
"bin": {
|
|
20
|
+
"lenix-lua-modules": "bin/lua_modules.sh"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"bin"
|
|
25
|
+
],
|
|
7
26
|
"scripts": {
|
|
8
|
-
"build": "tsc"
|
|
27
|
+
"build": "tsc -p src/fxmanifest/tsconfig.json"
|
|
9
28
|
},
|
|
10
29
|
"devDependencies": {
|
|
11
30
|
"typescript": "^5.3.3"
|
|
@@ -13,4 +32,4 @@
|
|
|
13
32
|
"dependencies": {
|
|
14
33
|
"@types/node": "^20.7.1"
|
|
15
34
|
}
|
|
16
|
-
}
|
|
35
|
+
}
|
|
File without changes
|