@laot/bridge 1.3.1 → 1.3.3

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 CHANGED
@@ -5,10 +5,11 @@
5
5
  [![GitHub Release Date](https://img.shields.io/github/release-date/laot7490/ltbridge?style=flat&colorA=18181B&colorB=a855f7)](https://github.com/laot7490/ltbridge/releases)
6
6
  [![GitHub contributors](https://img.shields.io/github/contributors/laot7490/ltbridge?style=flat&colorA=18181B&colorB=f59e0b)](https://github.com/laot7490/ltbridge/graphs/contributors)
7
7
  [![GitHub License](https://img.shields.io/github/license/laot7490/ltbridge?style=flat&colorA=18181B&colorB=white)](https://github.com/laot7490/ltbridge/blob/main/LICENSE)
8
+ [![Documentation](https://img.shields.io/badge/docs-GitBook-3884FF?style=flat&logo=gitbook&logoColor=white&colorA=18181B)](https://laot7490.gitbook.io/ltbridge)
8
9
 
9
10
  A next-generation **FiveM Script Bridge & Module Manager** designed to be incredibly fast, clean, and bloat-free.
10
11
 
11
- Unlike traditional monolithic libraries that force every script to load hundreds of unused functions into memory, **LTBridge** acts as a smart build tool. It lets you maintain a central repository of your favorite utilities (like Inventory, Framework, Notify) and compiles **only the exact code you actually use** right into your FiveM resource.
12
+ Unlike traditional monolithic libraries that force every script to load hundreds of unused functions into memory, **LTBridge** acts as a smart build tool. It lets you maintain a central repository of your favorite utilities (like Inventory, Framework, Notify) and compiles **only the exact code you actually use** right into your FiveM resource.
12
13
 
13
14
  By eliminating slow cross-resource exports and memory bloat, LTBridge helps you build highly independent, lightning-fast scripts with a perfect development experience.
14
15
 
@@ -53,6 +54,8 @@ npx @laot/bridge [command]
53
54
  local name, lastname = LT.Framework.GetPlayerName()
54
55
  ```
55
56
 
57
+ *For the full walkthrough, see [Quick Start on GitBook](https://laot7490.gitbook.io/ltbridge/getting-started/quick-start).*
58
+
56
59
  ## ⚙️ Configuration (`ltbridge/ltbridge.config.json`)
57
60
 
58
61
  When you run `init`, LTBridge creates a simple JSON config.
@@ -68,6 +71,8 @@ When you run `init`, LTBridge walks you through bundle mode, minify, and debug o
68
71
 
69
72
  ## 🛠️ Commands
70
73
 
74
+ Full command reference with examples: [CLI Commands on GitBook](https://laot7490.gitbook.io/ltbridge/cli/commands).
75
+
71
76
  | Command | Alias | Description |
72
77
  | --- | --- | --- |
73
78
  | `ltbridge` | - | **Interactive Menu**: Manage your modules visually. |
@@ -108,3 +113,4 @@ A huge thanks to the **[community_bridge](https://github.com/TheOrderFivem)** pr
108
113
  > ```json
109
114
  > "Lua.workspace.ignoreDir": ["**/ltbridge/modules/**"]
110
115
  > ```
116
+ > See also: [IDE Setup on GitBook](https://laot7490.gitbook.io/ltbridge/getting-started/ide-setup) for autocomplete and workspace configuration.
package/dist/ltbridge.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var U=(u,i)=>()=>(i||u((i={exports:{}}).exports,i),i.exports);var xe=U((ro,On)=>{On.exports={name:"@laot/bridge",version:"1.3.1",description:"LTBridge CLI for fetching and bundling FiveM modules.",license:"MIT",repository:{type:"git",url:"https://github.com/laot7490/ltbridge.git"},author:"laot",keywords:["fivem","lua","bridge","module-manager","bundler","cli","gta5","redm","laot","ltbridge"],main:"dist/ltbridge.js",scripts:{build:"node scripts/compiler.js && esbuild bin/ltbridge.js --bundle --minify --platform=node --target=node18 --packages=external --outfile=dist/ltbridge.js",zip:"node scripts/zip-dist.js",prepublishOnly:"npm run build && npm run zip"},bin:{ltbridge:"./dist/ltbridge.js"},files:["dist","LICENSE","README.md"],dependencies:{chokidar:"^5.0.0",commander:"^11.0.0","fs-extra":"^11.1.1",prompts:"^2.4.2"},devDependencies:{esbuild:"^0.25.0"}}});var Je=U((lo,He)=>{var jn=/__LT_VERSION\s*=\s*'[^']*'/g,qn=/__LT_DISABLE_DEBUG\s*=\s*(true|false)/g;function Un(u,{version:i,disableDebug:a}={}){if(!u)return u;let n=u;return i&&(n=n.replace(jn,`__LT_VERSION = '${i}'`)),a!==void 0&&(n=n.replace(qn,`__LT_DISABLE_DEBUG = ${a?"true":"false"}`)),n}He.exports={applyBuildConstants:Un}});var ne=U((so,Qe)=>{var Ze=require("fs"),Wn=require("path"),Be=null;function Ne(){if(Be)return Be;let u=Wn.join(__dirname,"..","dist","modules.dat");return Ze.existsSync(u)||(console.log("\x1B[31m\u2716 LTBridge is not compiled. Please run 'npm run build' first.\x1B[0m"),process.exit(1)),Be=JSON.parse(Ze.readFileSync(u,"utf8")),Be}function Dn(){return Ne().registry}function Kn(u){return Ne().modules[u]}Qe.exports={getModuleRegistry:Dn,getDatabase:Ne,getModuleData:Kn}});var Ge=U((uo,Ye)=>{var{getModuleRegistry:zn,getModuleData:Hn}=ne();function Xe(u){let i=Hn(u);return i?Array.isArray(i.dependencies)?i.dependencies:i.meta&&Array.isArray(i.meta.dependencies)?i.meta.dependencies:[]:[]}function Jn(u,i){let a=zn(),n=new Set,t=new Set,r=[],e={};function o(s){if(n.has(s))return;if(t.has(s)){console.log(`
2
+ var U=(u,i)=>()=>(i||u((i={exports:{}}).exports,i),i.exports);var xe=U((ro,On)=>{On.exports={name:"@laot/bridge",version:"1.3.3",description:"LTBridge CLI for fetching and bundling FiveM modules.",license:"MIT",repository:{type:"git",url:"https://github.com/laot7490/ltbridge.git"},author:"laot",keywords:["fivem","lua","bridge","module-manager","bundler","cli","gta5","redm","laot","ltbridge"],main:"dist/ltbridge.js",scripts:{build:"node scripts/compiler.js && esbuild bin/ltbridge.js --bundle --minify --platform=node --target=node18 --packages=external --outfile=dist/ltbridge.js",zip:"node scripts/zip-dist.js",prepublishOnly:"npm run build && npm run zip"},bin:{ltbridge:"./dist/ltbridge.js"},files:["dist","LICENSE","README.md"],dependencies:{chokidar:"^5.0.0",commander:"^11.0.0","fs-extra":"^11.1.1",prompts:"^2.4.2"},devDependencies:{esbuild:"^0.25.0"}}});var Je=U((lo,He)=>{var jn=/__LT_VERSION\s*=\s*'[^']*'/g,qn=/__LT_DISABLE_DEBUG\s*=\s*(true|false)/g;function Un(u,{version:i,disableDebug:a}={}){if(!u)return u;let n=u;return i&&(n=n.replace(jn,`__LT_VERSION = '${i}'`)),a!==void 0&&(n=n.replace(qn,`__LT_DISABLE_DEBUG = ${a?"true":"false"}`)),n}He.exports={applyBuildConstants:Un}});var ne=U((so,Qe)=>{var Ze=require("fs"),Wn=require("path"),Be=null;function Ne(){if(Be)return Be;let u=Wn.join(__dirname,"..","dist","modules.dat");return Ze.existsSync(u)||(console.log("\x1B[31m\u2716 LTBridge is not compiled. Please run 'npm run build' first.\x1B[0m"),process.exit(1)),Be=JSON.parse(Ze.readFileSync(u,"utf8")),Be}function Dn(){return Ne().registry}function Kn(u){return Ne().modules[u]}Qe.exports={getModuleRegistry:Dn,getDatabase:Ne,getModuleData:Kn}});var Ge=U((uo,Ye)=>{var{getModuleRegistry:zn,getModuleData:Hn}=ne();function Xe(u){let i=Hn(u);return i?Array.isArray(i.dependencies)?i.dependencies:i.meta&&Array.isArray(i.meta.dependencies)?i.meta.dependencies:[]:[]}function Jn(u,i){let a=zn(),n=new Set,t=new Set,r=[],e={};function o(s){if(n.has(s))return;if(t.has(s)){console.log(`
3
3
  \x1B[33m! Circular dependency detected involving '${s}'.\x1B[0m`);return}if(t.add(s),!a[s]){console.log(`\x1B[31m\u2716 Trying to resolve '${s}' but it does not exist in LTBridge.\x1B[0m`),t.delete(s);return}let c=Xe(s);e[s]=c;for(let f of c)o(f);t.delete(s),n.add(s),r.push(s)}for(let s of u)o(s);return{sequence:r,graph:e}}Ye.exports={resolveDependencies:Jn,getModuleDependencies:Xe}});var ln=U((ao,$e)=>{var Se=console.log,W=function(u,i){if(!u)throw i};function Zn(u,i){if(!u)return 0;var a=u.toString().split(".");return a.length>1?parseInt(a[0],i)+parseInt(a[1],i)/Math.pow(i,a[1].length):parseInt(a[0],i)}var Qn=[" ",`
4
4
  `," ","\r"],Xn={r:"\r",n:`
5
5
  `,t:" ",'"':'"',"'":"'","\\":"\\"},en=new Proxy(Xn,{get(u,i){return Zn(i)}}),Yn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","_","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],Pe=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","_","a","b","c","d","e","f","g","t","u","v","w","h","i","j","k","l","m","n","o","p","q","r","s","x","y","z"],me=["0","1","2","3","4","5","6","7","8","9"],et=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","A","B","C","D","E","F"],nt=["+","-","*",")",";","/","^","%","#",",","{","}",":","[","]","(",".","`"],tt=["~","=",">","<"],ot=["+","-","*","/","^","..","%","//"],it=["+=","-=","*=","/=","^=","..=","%=","//="],tn=["and","break","do","else","elseif","end","false","for","function","goto","if","in","local","nil","not","or","repeat","return","then","true","until","while","continue"],ke=["continue","goto"],rt=["else","elseif","until","end"],lt=["-","not","#","~"],on=["+","-","*","/","%","^","#","//","&","|","~","<<",">>","..",".",":",">","<","<=",">=","~=","==","+=","-=","*=","/=","%=","^=","..=","//=","and","or"],st=11,Me={"^":[13,12],"%":[10,10],"//":[10,10],"/":[10,10],"*":[10,10],"+":[9,9],"-":[9,9],"..":[8,7],">>":[7,7],"<<":[7,7],"&":[6,6],"~":[5,5],"|":[4,4],"==":[3,3],"~=":[3,3],">=":[3,3],"<=":[3,3],">":[3,3],"<":[3,3],"+=":[3,3],"-=":[3,3],"*=":[3,3],"/=":[3,3],"^=":[3,3],"%=":[3,3],"..=":[3,3],"//=":[3,3],and:[2,2],or:[1,1]};function ut(u){let i=0,a=u.length,n=[];function t(d){return d=d||0,i<=a?u.substr(i+d,1):""}function r(){if(i<=a){let d=u.substr(i,1);return i++,d}else return""}function e(d){let p=0,h=1,y=1;for(;p<=i;)u.substr(p,1)==`