@sprig-and-prose/sprig-scenes 0.1.1
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/CHANGELOG.md +7 -0
- package/biome.json +23 -0
- package/docs/projection-expectations.md +188 -0
- package/example/players.example.js +21 -0
- package/examples/expectations-demo.js +146 -0
- package/package.json +36 -0
- package/scripts/build-canonical.js +29 -0
- package/src/api/PortalHandle.js +22 -0
- package/src/api/SceneCompiler.js +24 -0
- package/src/api/SceneInstance.js +50 -0
- package/src/api/SceneRuntime.js +14 -0
- package/src/api/formatUnknownMemberError.js +18 -0
- package/src/attestations/attestations.js +65 -0
- package/src/attestations/compute_status.js +101 -0
- package/src/canonical/actor.scene.json +20 -0
- package/src/canonical/actor.scene.prose +8 -0
- package/src/canonical/actors.scene.json +74 -0
- package/src/canonical/actors.scene.prose +39 -0
- package/src/canonical/tools.scene.json +198 -0
- package/src/canonical/tools.scene.prose +92 -0
- package/src/compiler/compile_scene.js +1885 -0
- package/src/compiler/compile_scene_file.js +15 -0
- package/src/index.js +41 -0
- package/src/manifest/scene_manifest.d.ts +98 -0
- package/src/manifest/scene_manifest.js +84 -0
- package/test/api.test.js +110 -0
- package/test/compile_scene.test.js +311 -0
- package/test/expectations.test.js +508 -0
- package/test/fixtures/expectations-basic.attestations.json +33 -0
- package/test/fixtures/expectations-basic.scene.prose +79 -0
- package/test/fixtures/players.scene.prose +24 -0
- package/test/fixtures/skills-many-some.scene.prose +53 -0
- package/test/fixtures/skills-many.scene.prose +71 -0
- package/test/fixtures/skills.scene.prose +85 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
scene SkillManyScene {
|
|
2
|
+
actors {
|
|
3
|
+
Skill {
|
|
4
|
+
kind {
|
|
5
|
+
id { integer }
|
|
6
|
+
name { string }
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
identity { id }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
RawPlayerSkill {
|
|
13
|
+
kind {
|
|
14
|
+
playerId { integer }
|
|
15
|
+
skillId { integer }
|
|
16
|
+
experience { integer }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
identity { playerId skillId }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
portals {
|
|
24
|
+
Skills {
|
|
25
|
+
kind { [ Skill ] }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
RawPlayerSkills {
|
|
29
|
+
kind { [ RawPlayerSkill ] }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
derived {
|
|
34
|
+
PlayerSkillMatches {
|
|
35
|
+
each {
|
|
36
|
+
from { RawPlayerSkills[] }
|
|
37
|
+
named { row }
|
|
38
|
+
as {
|
|
39
|
+
skillMatches {
|
|
40
|
+
many {
|
|
41
|
+
from { Skills[] }
|
|
42
|
+
matches { row.skillId }
|
|
43
|
+
by { id }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
experience { row.experience }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
PlayerSkillMatchesSome {
|
|
53
|
+
each {
|
|
54
|
+
from { RawPlayerSkills[] }
|
|
55
|
+
named { row }
|
|
56
|
+
as {
|
|
57
|
+
skillMatches {
|
|
58
|
+
many {
|
|
59
|
+
from { Skills[] }
|
|
60
|
+
matches { row.skillId }
|
|
61
|
+
by { id }
|
|
62
|
+
expects { some }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
experience { row.experience }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
scene SkillScene {
|
|
2
|
+
actors {
|
|
3
|
+
Skill {
|
|
4
|
+
kind {
|
|
5
|
+
id { integer }
|
|
6
|
+
name { string }
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
identity { id }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
Player {
|
|
13
|
+
kind {
|
|
14
|
+
id { integer }
|
|
15
|
+
name { string }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
identity { id }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
RawPlayerSkill {
|
|
22
|
+
kind {
|
|
23
|
+
playerId { integer }
|
|
24
|
+
skillId { integer }
|
|
25
|
+
experience { integer }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
identity { playerId skillId }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
PlayerSkill {
|
|
32
|
+
kind {
|
|
33
|
+
player { Player }
|
|
34
|
+
skill { Skill }
|
|
35
|
+
experience { integer }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
identity { player skill }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
portals {
|
|
43
|
+
Players {
|
|
44
|
+
kind { [ Player ] }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Skills {
|
|
48
|
+
kind { [ Skill ] }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
RawPlayerSkills {
|
|
52
|
+
kind { [ RawPlayerSkill ] }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
derived {
|
|
57
|
+
PlayerSkills {
|
|
58
|
+
kind { [ PlayerSkill ] }
|
|
59
|
+
|
|
60
|
+
each {
|
|
61
|
+
from { RawPlayerSkills[] }
|
|
62
|
+
named { row }
|
|
63
|
+
as {
|
|
64
|
+
player {
|
|
65
|
+
one {
|
|
66
|
+
from { Players[] }
|
|
67
|
+
matches { row.playerId }
|
|
68
|
+
by { id }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
skill {
|
|
73
|
+
one {
|
|
74
|
+
from { Skills[] }
|
|
75
|
+
matches { row.skillId }
|
|
76
|
+
by { id }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
experience { row.experience }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"checkJs": true,
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"noEmit": true,
|
|
6
|
+
"strict": true,
|
|
7
|
+
"target": "ES2022",
|
|
8
|
+
"module": "ES2022",
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*", "test/**/*", "scripts/**/*"]
|
|
14
|
+
}
|