@rezless/vitest 0.3.0 → 0.4.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/NOTICE +26 -14
- package/README.md +9 -14
- package/package.json +3 -3
package/NOTICE
CHANGED
|
@@ -8,26 +8,38 @@ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
|
8
8
|
Third-party content
|
|
9
9
|
-------------------
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
LSL function, event, and constant definitions come from the
|
|
12
|
+
secondlife/lsl-definitions project
|
|
13
|
+
(https://github.com/secondlife/lsl-definitions), licensed under the MIT License.
|
|
14
|
+
The vendored data file and the files generated from it:
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
Copyright (C) 2013-2025 Sei Lisa.
|
|
17
|
-
Copyright (C) 2017-2023 Mako Nozaki.
|
|
18
|
-
Copyright (C) 2023-2023 Alex Carpenter.
|
|
19
|
-
|
|
20
|
-
The vendored data file and any output mechanically derived from it remain
|
|
21
|
-
under their original LGPL-3.0-or-later license:
|
|
22
|
-
|
|
23
|
-
vendor/kwdb.xml (the data file)
|
|
16
|
+
vendor/lsl_definitions.yaml (the data file)
|
|
24
17
|
packages/vm/src/generated/constants.ts (derived)
|
|
25
18
|
packages/vm/src/generated/constants_table.ts (derived)
|
|
26
19
|
packages/vm/src/generated/functions.ts (derived)
|
|
27
20
|
packages/vm/src/generated/events.ts (derived)
|
|
28
21
|
packages/parser/src/generated/event-names.ts (derived)
|
|
29
22
|
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
MIT License
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2025 Linden Research, Inc.
|
|
26
|
+
|
|
27
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
28
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
29
|
+
in the Software without restriction, including without limitation the rights
|
|
30
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
31
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
32
|
+
furnished to do so, subject to the following conditions:
|
|
33
|
+
|
|
34
|
+
The above copyright notice and this permission notice shall be included in all
|
|
35
|
+
copies or substantial portions of the Software.
|
|
36
|
+
|
|
37
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
38
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
39
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
40
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
41
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
42
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
43
|
+
SOFTWARE.
|
|
32
44
|
|
|
33
45
|
Second Life is a registered trademark of Linden Research, Inc.
|
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ import { loadScript } from '@rezless/vitest'
|
|
|
70
70
|
|
|
71
71
|
```sh
|
|
72
72
|
pnpm install
|
|
73
|
-
pnpm gen # regenerate ll* stub tables from vendor/
|
|
73
|
+
pnpm gen # regenerate ll* stub tables from vendor/lsl_definitions.yaml
|
|
74
74
|
pnpm typecheck
|
|
75
75
|
pnpm build # per-package tsc emit
|
|
76
76
|
pnpm test
|
|
@@ -91,7 +91,7 @@ await loadScript({
|
|
|
91
91
|
objectKey: 'cccc-dddd-...', // optional, derived from filename
|
|
92
92
|
objectName: 'StarterCube', // optional, "Object" default
|
|
93
93
|
scriptName: 'greeter', // optional, derived from filename
|
|
94
|
-
functions: { // optional, functions
|
|
94
|
+
functions: { // optional, unlisted functions you'll mock
|
|
95
95
|
llNewThing: { returns: 'integer', params: ['string'] },
|
|
96
96
|
},
|
|
97
97
|
})
|
|
@@ -99,14 +99,14 @@ await loadScript({
|
|
|
99
99
|
|
|
100
100
|
Parse errors and type errors SL would refuse to compile (such as `!` on a key) throw `LslParseError` with `file:line:col` location info.
|
|
101
101
|
|
|
102
|
-
Calls to functions that aren't built in or defined by the script fail to load, as they do in Second Life. If the script calls a function
|
|
102
|
+
Calls to functions that aren't built in or defined by the script fail to load, as they do in Second Life. If the script calls a function the LSL definitions don't list yet, declare it in `functions` and give it an implementation with `s.mock`.
|
|
103
103
|
|
|
104
104
|
### `Script` handle
|
|
105
105
|
|
|
106
106
|
```ts
|
|
107
107
|
// Drive events
|
|
108
108
|
s.start() // run state_entry of default
|
|
109
|
-
s.fire(eventName, payload) // payload binds to handler params by
|
|
109
|
+
s.fire(eventName, payload) // payload binds to handler params by spec name
|
|
110
110
|
s.advanceTime(ms) // advance virtual clock; drains timer + queued events
|
|
111
111
|
s.deliverChat({ channel, name, key, message }) // fire `listen` on matching active listens
|
|
112
112
|
s.respondToHttp(key, { status, body }) // fire `http_response` for a captured llHTTPRequest
|
|
@@ -206,7 +206,7 @@ expect(s).toHaveListened(7, { key: ownerKey })
|
|
|
206
206
|
### Implemented `ll*` functions
|
|
207
207
|
|
|
208
208
|
The real-impl set covers the most common use cases. Anything outside it
|
|
209
|
-
falls through to a typed stub that returns the
|
|
209
|
+
falls through to a typed stub that returns the documented default
|
|
210
210
|
and records the call. Use `s.mock(name, fn)` to provide your own
|
|
211
211
|
behaviour for any function the script under test calls. Builtin
|
|
212
212
|
function delays (e.g. the 0.2s delay on `llSetLinkPrimitiveParams`) are
|
|
@@ -328,12 +328,7 @@ CLI, or `{ includeFixtures: true }` to the reporter, to keep them.
|
|
|
328
328
|
The rezless project is licensed under the **Apache License, Version 2.0** —
|
|
329
329
|
see [`LICENSE`](LICENSE).
|
|
330
330
|
|
|
331
|
-
LSL function/event/constant signatures come from
|
|
332
|
-
[
|
|
333
|
-
`vendor/
|
|
334
|
-
|
|
335
|
-
under that licence; see [`NOTICE`](NOTICE) for the full attribution.
|
|
336
|
-
|
|
337
|
-
Apache 2.0 is one-way compatible with LGPL-3 (per the FSF), so a
|
|
338
|
-
combined work that includes both can be redistributed under LGPL-3
|
|
339
|
-
terms — which is what consumers receive when they use rezless.
|
|
331
|
+
LSL function/event/constant signatures come from Linden Lab's official
|
|
332
|
+
[secondlife/lsl-definitions](https://github.com/secondlife/lsl-definitions),
|
|
333
|
+
vendored at `vendor/lsl_definitions.yaml` and licensed under the **MIT
|
|
334
|
+
License**; see [`NOTICE`](NOTICE) for the full attribution.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rezless/vitest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Vitest-style DSL for testing Linden Scripting Language (LSL) scripts.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "i-doll",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@rezless/vm": "0.
|
|
56
|
-
"@rezless/parser": "0.
|
|
55
|
+
"@rezless/vm": "0.4.0",
|
|
56
|
+
"@rezless/parser": "0.4.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"vitest": "^5.0.5"
|