@thigasdevelopment/luam 0.4.1 → 0.6.0
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 +31 -32
- package/luam.mjs +13507 -9606
- package/package.json +1 -1
- package/template/luam.manifest +11 -0
- package/template/luam.json +0 -11
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ See [Editor support](#editor-support) for the compatibility matrix and manual in
|
|
|
147
147
|
> **[Quick start](https://thigasdevelopment.github.io/luam/en/guide/quick-start)**
|
|
148
148
|
> · [Início rápido](https://thigasdevelopment.github.io/luam/pt-br/guide/quick-start)
|
|
149
149
|
|
|
150
|
-
**1. Scaffold.** `init` writes exactly one file,
|
|
150
|
+
**1. Scaffold.** `init` writes exactly one file, `.luam.manifest`. No framework, no
|
|
151
151
|
example tree, nothing to delete.
|
|
152
152
|
|
|
153
153
|
```bash
|
|
@@ -161,7 +161,7 @@ the environment**: `src/server` is server-side, `src/client` is client-side,
|
|
|
161
161
|
|
|
162
162
|
```
|
|
163
163
|
my-resource/
|
|
164
|
-
├── luam.
|
|
164
|
+
├── .luam.manifest
|
|
165
165
|
└── src/
|
|
166
166
|
├── shared/config.luam
|
|
167
167
|
├── server/main.luam
|
|
@@ -215,11 +215,12 @@ refresh
|
|
|
215
215
|
start my-resource
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
-
**5. Iterate.** Point
|
|
218
|
+
**5. Iterate.** Point `.luam.manifest` at your server and let `dev` build, sync,
|
|
219
219
|
restart, and stream resource logs on every save:
|
|
220
220
|
|
|
221
|
-
```
|
|
222
|
-
|
|
221
|
+
```luam
|
|
222
|
+
name = 'my-resource'
|
|
223
|
+
serverPath = 'C:/MTA Server'
|
|
223
224
|
```
|
|
224
225
|
|
|
225
226
|
```bash
|
|
@@ -234,19 +235,19 @@ luam dev
|
|
|
234
235
|
> **[CLI commands](https://thigasdevelopment.github.io/luam/en/tooling/cli)**
|
|
235
236
|
> · [Comandos da CLI](https://thigasdevelopment.github.io/luam/pt-br/tooling/cli)
|
|
236
237
|
|
|
237
|
-
Project commands read
|
|
238
|
+
Project commands read `.luam.manifest` from the current directory or from `--cwd`.
|
|
238
239
|
`setup`, `doctor`, and `init` do not require an existing project.
|
|
239
240
|
|
|
240
241
|
### `luam init`
|
|
241
242
|
|
|
242
|
-
Scaffolds
|
|
243
|
+
Scaffolds `.luam.manifest` and stops. The resource name comes from `--name`, or from
|
|
243
244
|
the directory you are in.
|
|
244
245
|
|
|
245
246
|
```bash
|
|
246
247
|
luam init --name gamemode-race
|
|
247
248
|
```
|
|
248
249
|
|
|
249
|
-
An existing
|
|
250
|
+
An existing `.luam.manifest` is kept and reported — pass `--force` to overwrite it.
|
|
250
251
|
|
|
251
252
|
### `luam setup`
|
|
252
253
|
|
|
@@ -341,7 +342,7 @@ your MTA server, restarts it, and repeats all of that on every save.
|
|
|
341
342
|
luam ensure
|
|
342
343
|
```
|
|
343
344
|
|
|
344
|
-
How much it does depends on what
|
|
345
|
+
How much it does depends on what `.luam.manifest` gives it:
|
|
345
346
|
|
|
346
347
|
| Configured | What `ensure` does |
|
|
347
348
|
| --- | --- |
|
|
@@ -352,18 +353,17 @@ How much it does depends on what `luam.json` gives it:
|
|
|
352
353
|
To get the restart, add an `http` transport pointing at a resource on your server
|
|
353
354
|
that exports `refreshResources` and `restartResource`:
|
|
354
355
|
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}
|
|
356
|
+
```luam
|
|
357
|
+
name = 'my-resource'
|
|
358
|
+
serverPath = 'C:/MTA Server'
|
|
359
|
+
|
|
360
|
+
transport = {
|
|
361
|
+
kind = 'http',
|
|
362
|
+
host = '127.0.0.1',
|
|
363
|
+
port = 22005,
|
|
364
|
+
resource = 'luam-sync',
|
|
365
|
+
username = 'luam',
|
|
366
|
+
passwordEnv = 'LUAM_MTA_PASSWORD',
|
|
367
367
|
}
|
|
368
368
|
```
|
|
369
369
|
|
|
@@ -388,8 +388,8 @@ a deploy script wants.
|
|
|
388
388
|
|
|
389
389
|
| Option | Meaning |
|
|
390
390
|
| --- | --- |
|
|
391
|
-
| `--cwd <path>` | Project directory holding
|
|
392
|
-
| `--
|
|
391
|
+
| `--cwd <path>` | Project directory holding `.luam.manifest`. Defaults to the current directory |
|
|
392
|
+
| `--manifest <path>` | Load this file instead of `.luam.manifest` |
|
|
393
393
|
| `--name <name>` | Resource name for `init` |
|
|
394
394
|
| `--force` | Let `init` overwrite a file that exists |
|
|
395
395
|
| `--watch` / `--no-watch` | Keep `ensure` or `dev` watching, or run it once. Both watch by default |
|
|
@@ -411,7 +411,7 @@ Progress is painted on stderr and the report goes to stdout, so redirecting
|
|
|
411
411
|
stdout captures the report alone. Output drops all escape sequences when the
|
|
412
412
|
stream is not a terminal — a CI log stays readable.
|
|
413
413
|
|
|
414
|
-
###
|
|
414
|
+
### `.luam.manifest`
|
|
415
415
|
|
|
416
416
|
Only `name` is required.
|
|
417
417
|
|
|
@@ -436,10 +436,10 @@ Paths must stay inside their base directory — an absolute path or a `..` segme
|
|
|
436
436
|
is rejected.
|
|
437
437
|
|
|
438
438
|
Every field, the transport in detail, `.env` handling and declaration files:
|
|
439
|
-
**[luam.
|
|
439
|
+
**[.luam.manifest](https://thigasdevelopment.github.io/luam/en/tooling/luam-manifest)**
|
|
440
440
|
and
|
|
441
441
|
[Configuration fields](https://thigasdevelopment.github.io/luam/en/reference/configuration-fields)
|
|
442
|
-
· [luam.
|
|
442
|
+
· [.luam.manifest](https://thigasdevelopment.github.io/luam/pt-br/tooling/luam-manifest)
|
|
443
443
|
· also in [`packages/cli/README.md`](packages/cli/README.md).
|
|
444
444
|
|
|
445
445
|
---
|
|
@@ -468,10 +468,10 @@ interface Command { # compile-only, never emitted
|
|
|
468
468
|
class VIPPlayer extends Player implements Command {
|
|
469
469
|
level: number = 1
|
|
470
470
|
|
|
471
|
-
constructor(name: string, level: number)
|
|
471
|
+
constructor = function (name: string, level: number)
|
|
472
472
|
self:super(name)
|
|
473
473
|
self.level = level
|
|
474
|
-
|
|
474
|
+
end
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
local vip = new VIPPlayer('Thigas', 2)
|
|
@@ -490,7 +490,7 @@ local vip = new VIPPlayer('Thigas', 2)
|
|
|
490
490
|
| Comments | `# line` and `#* block *#`; write length without a space as `#items` |
|
|
491
491
|
| Object extensions | `items.count` → `table.size(items)`, `name.trim`, `ratio.clamp(a, b)` |
|
|
492
492
|
| Multi-return | `local x, y, z = getElementPosition(el)` — typed from the MTA catalog |
|
|
493
|
-
| `export` | Erased from the Lua, written into `meta.xml` as `<export function="f" />` |
|
|
493
|
+
| `export` | Erased from the Lua, written into `meta.xml` as `<export function="f" http="false" />` |
|
|
494
494
|
| Native libraries | `sleep` plus the `Threads`, `Async` and `Dotenv` classes, injected only when named |
|
|
495
495
|
| Native classes | `local tasks = new Async(100)` — same `new` as a project class |
|
|
496
496
|
| MTA OOP classes | `Player.getRandom()`, `File.exists(path)`, and callable constructors such as `File(path)` |
|
|
@@ -639,7 +639,7 @@ pnpm --filter luam bundle
|
|
|
639
639
|
code --extensionDevelopmentPath=packages/vscode
|
|
640
640
|
```
|
|
641
641
|
|
|
642
|
-
The extension activates when the workspace holds a
|
|
642
|
+
The extension activates when the workspace holds a `.luam.manifest` or any `.luam`
|
|
643
643
|
file, so open your resource folder as the workspace root.
|
|
644
644
|
|
|
645
645
|
### Commands and settings
|
|
@@ -681,8 +681,7 @@ node packages/lsp/dist/luam-lsp.mjs --stdio
|
|
|
681
681
|
- **No static members, declared metamethods, or generic classes.**
|
|
682
682
|
- **The editor does not re-check an open file when another one changes.**
|
|
683
683
|
Cross-module violations surface in `luam check`.
|
|
684
|
-
- **An export is named, never verified
|
|
685
|
-
`http="true"`.
|
|
684
|
+
- **An export is named, never verified** against the side that calls it.
|
|
686
685
|
|
|
687
686
|
---
|
|
688
687
|
|