lawspec 0.30.0 → 0.31.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.
Files changed (78) hide show
  1. package/CHANGELOG.md +377 -1
  2. package/README.md +9 -3
  3. package/api.mjs +1 -0
  4. package/beam-doctor.mjs +2 -2
  5. package/bin/lawspec.mjs +93 -95
  6. package/build.json +497 -405
  7. package/component-packages.mjs +339 -0
  8. package/component.d.ts +46 -0
  9. package/component.mjs +208 -0
  10. package/core.wasm +2 -2
  11. package/core_jsffi.js +5 -5
  12. package/examples/native-payments/clojure/lawspec.edn +48 -0
  13. package/examples/native-payments/clojure/src/domain/payments.clj +1 -1
  14. package/examples/native-payments/clojure/test/domain/payment_generators.clj +1 -1
  15. package/examples/native-payments/csharp/lawspec.edn +48 -0
  16. package/examples/native-payments/elixir/lawspec.edn +123 -0
  17. package/examples/native-payments/erlang/lawspec.edn +128 -0
  18. package/examples/native-payments/fsharp/lawspec.edn +123 -0
  19. package/examples/native-payments/gleam/lawspec.edn +123 -0
  20. package/examples/native-payments/go/lawspec.edn +123 -0
  21. package/examples/native-payments/groovy/lawspec.edn +123 -0
  22. package/examples/native-payments/haskell/lawspec.edn +123 -0
  23. package/examples/native-payments/java/lawspec.edn +123 -0
  24. package/examples/native-payments/javascript/lawspec.edn +123 -0
  25. package/examples/native-payments/kotlin/lawspec.edn +123 -0
  26. package/examples/native-payments/prolog/lawspec.edn +48 -0
  27. package/examples/native-payments/python/lawspec.edn +123 -0
  28. package/examples/native-payments/rust/lawspec.edn +124 -0
  29. package/examples/native-payments/scala/lawspec.edn +123 -0
  30. package/examples/native-payments/swift/lawspec.edn +123 -0
  31. package/examples/native-payments/typescript/lawspec.edn +123 -0
  32. package/examples/packages/orders/lawspec.edn +25 -0
  33. package/examples/packages/shop-domain/lawspec.edn +13 -0
  34. package/examples/packages/shop-tax-1/lawspec.edn +9 -0
  35. package/examples/packages/shop-tax-2/lawspec.edn +9 -0
  36. package/examples/specs/handler_bindings.lawspec +2 -2
  37. package/files.mjs +2 -1
  38. package/go.mod +4 -0
  39. package/index.d.ts +135 -2
  40. package/input-files.mjs +47 -0
  41. package/launcher.mjs +33 -13
  42. package/lsp.mjs +10 -5
  43. package/native-evidence.mjs +50 -15
  44. package/native-examples.mjs +8 -7
  45. package/native-host.mjs +71 -0
  46. package/package.json +8 -3
  47. package/proof.d.ts +8 -2
  48. package/proof.mjs +183 -31
  49. package/scala-build-state.mjs +59 -0
  50. package/templates.mjs +242 -2
  51. package/test-command.mjs +192 -60
  52. package/builtin-data-names.mjs +0 -73
  53. package/examples/native-payments/clojure/lawspec.json +0 -62
  54. package/examples/native-payments/csharp/lawspec.json +0 -62
  55. package/examples/native-payments/elixir/lawspec.json +0 -160
  56. package/examples/native-payments/erlang/lawspec.json +0 -159
  57. package/examples/native-payments/fsharp/lawspec.json +0 -178
  58. package/examples/native-payments/gleam/lawspec.json +0 -160
  59. package/examples/native-payments/go/lawspec.json +0 -147
  60. package/examples/native-payments/groovy/lawspec.json +0 -176
  61. package/examples/native-payments/haskell/lawspec.json +0 -160
  62. package/examples/native-payments/java/lawspec.json +0 -176
  63. package/examples/native-payments/javascript/lawspec.json +0 -160
  64. package/examples/native-payments/kotlin/lawspec.json +0 -176
  65. package/examples/native-payments/prolog/lawspec.json +0 -20
  66. package/examples/native-payments/python/lawspec.json +0 -160
  67. package/examples/native-payments/rust/lawspec.json +0 -178
  68. package/examples/native-payments/scala/lawspec.json +0 -176
  69. package/examples/native-payments/swift/lawspec.json +0 -165
  70. package/examples/native-payments/typescript/lawspec.json +0 -160
  71. package/examples/packages/orders/lawspec.json +0 -27
  72. package/examples/packages/shop-domain/lawspec-package.json +0 -7
  73. package/examples/packages/shop-tax-1/lawspec-package.json +0 -5
  74. package/examples/packages/shop-tax-2/lawspec-package.json +0 -5
  75. package/explain.mjs +0 -114
  76. package/expression-presentation.mjs +0 -333
  77. package/positional-fields.mjs +0 -13
  78. package/typed-presentation.mjs +0 -165
@@ -1,160 +0,0 @@
1
- {
2
- "version": 2,
3
- "sources": [
4
- "laws"
5
- ],
6
- "machineBits": 64,
7
- "targets": [
8
- {
9
- "language": "javascript",
10
- "root": ".",
11
- "nativeBindings": {
12
- "types": [
13
- {
14
- "type": "example.payments::type::Currency",
15
- "native": [
16
- "payments_domain",
17
- "CurrencyCode"
18
- ],
19
- "constructors": [
20
- {
21
- "constructor": "USD",
22
- "native": [
23
- "payments_domain",
24
- "Dollars"
25
- ],
26
- "style": "unit",
27
- "fields": []
28
- },
29
- {
30
- "constructor": "EUR",
31
- "native": [
32
- "payments_domain",
33
- "Euros"
34
- ],
35
- "style": "unit",
36
- "fields": []
37
- },
38
- {
39
- "constructor": "GBP",
40
- "native": [
41
- "payments_domain",
42
- "Pounds"
43
- ],
44
- "style": "unit",
45
- "fields": []
46
- }
47
- ]
48
- },
49
- {
50
- "type": "example.payments::type::Money",
51
- "native": [
52
- "payments_domain",
53
- "Price"
54
- ],
55
- "constructors": [
56
- {
57
- "constructor": "Money",
58
- "native": [
59
- "payments_domain",
60
- "Price"
61
- ],
62
- "style": "record",
63
- "fields": [
64
- {
65
- "field": "amount",
66
- "native": "major"
67
- },
68
- {
69
- "field": "currency",
70
- "native": "unit"
71
- }
72
- ]
73
- }
74
- ]
75
- },
76
- {
77
- "type": "example.payments::type::Payment",
78
- "native": [
79
- "payments_domain",
80
- "PaymentStatus"
81
- ],
82
- "constructors": [
83
- {
84
- "constructor": "Paid",
85
- "native": [
86
- "payments_domain",
87
- "Settled"
88
- ],
89
- "style": "variant",
90
- "fields": [
91
- {
92
- "field": "value",
93
- "native": "price"
94
- }
95
- ]
96
- },
97
- {
98
- "constructor": "Declined",
99
- "native": [
100
- "payments_domain",
101
- "Rejected"
102
- ],
103
- "style": "variant",
104
- "fields": [
105
- {
106
- "field": "value",
107
- "native": "explanation"
108
- }
109
- ]
110
- }
111
- ]
112
- }
113
- ],
114
- "functions": [
115
- {
116
- "declaration": "example.payments::addFee",
117
- "native": [
118
- "payments_domain",
119
- "apply_fee"
120
- ]
121
- },
122
- {
123
- "declaration": "example.payments::roundTrip",
124
- "native": [
125
- "payments_domain",
126
- "restore"
127
- ]
128
- },
129
- {
130
- "declaration": "example.payments::archive",
131
- "native": [
132
- "payments_domain",
133
- "store"
134
- ]
135
- }
136
- ],
137
- "generators": [
138
- {
139
- "type": "example.payments::type::Money",
140
- "factory": [
141
- "lawspec_generators",
142
- "prices"
143
- ]
144
- }
145
- ]
146
- }
147
- }
148
- ],
149
- "languageProfile": "1.0-rc.2",
150
- "verification": {
151
- "layers": [
152
- "proof",
153
- "exhaustive",
154
- "property",
155
- "examples",
156
- "runtime",
157
- "model"
158
- ]
159
- }
160
- }
@@ -1,176 +0,0 @@
1
- {
2
- "version": 2,
3
- "sources": [
4
- "laws"
5
- ],
6
- "machineBits": 64,
7
- "targets": [
8
- {
9
- "language": "kotlin",
10
- "root": ".",
11
- "nativeBindings": {
12
- "types": [
13
- {
14
- "type": "example.payments::type::Currency",
15
- "native": [
16
- "domain",
17
- "PaymentsDomain",
18
- "CurrencyCode"
19
- ],
20
- "constructors": [
21
- {
22
- "constructor": "USD",
23
- "native": [
24
- "domain",
25
- "PaymentsDomain",
26
- "CurrencyCode",
27
- "Dollars"
28
- ],
29
- "style": "unit",
30
- "fields": []
31
- },
32
- {
33
- "constructor": "EUR",
34
- "native": [
35
- "domain",
36
- "PaymentsDomain",
37
- "CurrencyCode",
38
- "Euros"
39
- ],
40
- "style": "unit",
41
- "fields": []
42
- },
43
- {
44
- "constructor": "GBP",
45
- "native": [
46
- "domain",
47
- "PaymentsDomain",
48
- "CurrencyCode",
49
- "Pounds"
50
- ],
51
- "style": "unit",
52
- "fields": []
53
- }
54
- ]
55
- },
56
- {
57
- "type": "example.payments::type::Money",
58
- "native": [
59
- "domain",
60
- "PaymentsDomain",
61
- "Price"
62
- ],
63
- "constructors": [
64
- {
65
- "constructor": "Money",
66
- "native": [
67
- "domain",
68
- "PaymentsDomain",
69
- "Price"
70
- ],
71
- "style": "record",
72
- "fields": [
73
- {
74
- "field": "amount",
75
- "native": "major"
76
- },
77
- {
78
- "field": "currency",
79
- "native": "unit"
80
- }
81
- ]
82
- }
83
- ]
84
- },
85
- {
86
- "type": "example.payments::type::Payment",
87
- "native": [
88
- "domain",
89
- "PaymentsDomain",
90
- "PaymentStatus"
91
- ],
92
- "constructors": [
93
- {
94
- "constructor": "Paid",
95
- "native": [
96
- "domain",
97
- "PaymentsDomain",
98
- "Settled"
99
- ],
100
- "style": "variant",
101
- "fields": [
102
- {
103
- "field": "value",
104
- "native": "price"
105
- }
106
- ]
107
- },
108
- {
109
- "constructor": "Declined",
110
- "native": [
111
- "domain",
112
- "PaymentsDomain",
113
- "Rejected"
114
- ],
115
- "style": "variant",
116
- "fields": [
117
- {
118
- "field": "value",
119
- "native": "explanation"
120
- }
121
- ]
122
- }
123
- ]
124
- }
125
- ],
126
- "functions": [
127
- {
128
- "declaration": "example.payments::addFee",
129
- "native": [
130
- "domain",
131
- "PaymentsDomain",
132
- "apply_fee"
133
- ]
134
- },
135
- {
136
- "declaration": "example.payments::roundTrip",
137
- "native": [
138
- "domain",
139
- "PaymentsDomain",
140
- "restore"
141
- ]
142
- },
143
- {
144
- "declaration": "example.payments::archive",
145
- "native": [
146
- "domain",
147
- "PaymentsDomain",
148
- "store"
149
- ]
150
- }
151
- ],
152
- "generators": [
153
- {
154
- "type": "example.payments::type::Money",
155
- "factory": [
156
- "domain",
157
- "PaymentGenerators",
158
- "prices"
159
- ]
160
- }
161
- ]
162
- }
163
- }
164
- ],
165
- "languageProfile": "1.0-rc.2",
166
- "verification": {
167
- "layers": [
168
- "proof",
169
- "exhaustive",
170
- "property",
171
- "examples",
172
- "runtime",
173
- "model"
174
- ]
175
- }
176
- }
@@ -1,20 +0,0 @@
1
- {
2
- "version": 2,
3
- "languageProfile": "1.0-rc.2",
4
- "sources": ["laws"],
5
- "machineBits": 64,
6
- "verification": {"layers": ["proof", "exhaustive", "property", "examples", "runtime", "model"]},
7
- "targets": [{
8
- "language": "prolog", "root": ".",
9
- "nativeBindings": {
10
- "functions": [
11
- {"declaration": "example.payments::addFee", "native": ["domain", "payments", "apply_fee"]},
12
- {"declaration": "example.payments::roundTrip", "native": ["domain", "payments", "restore"]},
13
- {"declaration": "example.payments::archive", "native": ["domain", "payments", "store"]}
14
- ],
15
- "generators": [
16
- {"type": "example.payments::type::Money", "factory": ["domain", "payment_generators", "prices"]}
17
- ]
18
- }
19
- }]
20
- }
@@ -1,160 +0,0 @@
1
- {
2
- "version": 2,
3
- "sources": [
4
- "laws"
5
- ],
6
- "machineBits": 64,
7
- "targets": [
8
- {
9
- "language": "python",
10
- "root": ".",
11
- "nativeBindings": {
12
- "types": [
13
- {
14
- "type": "example.payments::type::Currency",
15
- "native": [
16
- "payments_domain",
17
- "CurrencyCode"
18
- ],
19
- "constructors": [
20
- {
21
- "constructor": "USD",
22
- "native": [
23
- "payments_domain",
24
- "Dollars"
25
- ],
26
- "style": "unit",
27
- "fields": []
28
- },
29
- {
30
- "constructor": "EUR",
31
- "native": [
32
- "payments_domain",
33
- "Euros"
34
- ],
35
- "style": "unit",
36
- "fields": []
37
- },
38
- {
39
- "constructor": "GBP",
40
- "native": [
41
- "payments_domain",
42
- "Pounds"
43
- ],
44
- "style": "unit",
45
- "fields": []
46
- }
47
- ]
48
- },
49
- {
50
- "type": "example.payments::type::Money",
51
- "native": [
52
- "payments_domain",
53
- "Price"
54
- ],
55
- "constructors": [
56
- {
57
- "constructor": "Money",
58
- "native": [
59
- "payments_domain",
60
- "Price"
61
- ],
62
- "style": "record",
63
- "fields": [
64
- {
65
- "field": "amount",
66
- "native": "major"
67
- },
68
- {
69
- "field": "currency",
70
- "native": "unit"
71
- }
72
- ]
73
- }
74
- ]
75
- },
76
- {
77
- "type": "example.payments::type::Payment",
78
- "native": [
79
- "payments_domain",
80
- "PaymentStatus"
81
- ],
82
- "constructors": [
83
- {
84
- "constructor": "Paid",
85
- "native": [
86
- "payments_domain",
87
- "Settled"
88
- ],
89
- "style": "variant",
90
- "fields": [
91
- {
92
- "field": "value",
93
- "native": "price"
94
- }
95
- ]
96
- },
97
- {
98
- "constructor": "Declined",
99
- "native": [
100
- "payments_domain",
101
- "Rejected"
102
- ],
103
- "style": "variant",
104
- "fields": [
105
- {
106
- "field": "value",
107
- "native": "explanation"
108
- }
109
- ]
110
- }
111
- ]
112
- }
113
- ],
114
- "functions": [
115
- {
116
- "declaration": "example.payments::addFee",
117
- "native": [
118
- "payments_domain",
119
- "apply_fee"
120
- ]
121
- },
122
- {
123
- "declaration": "example.payments::roundTrip",
124
- "native": [
125
- "payments_domain",
126
- "restore"
127
- ]
128
- },
129
- {
130
- "declaration": "example.payments::archive",
131
- "native": [
132
- "payments_domain",
133
- "store"
134
- ]
135
- }
136
- ],
137
- "generators": [
138
- {
139
- "type": "example.payments::type::Money",
140
- "factory": [
141
- "lawspec_generators",
142
- "prices"
143
- ]
144
- }
145
- ]
146
- }
147
- }
148
- ],
149
- "languageProfile": "1.0-rc.2",
150
- "verification": {
151
- "layers": [
152
- "proof",
153
- "exhaustive",
154
- "property",
155
- "examples",
156
- "runtime",
157
- "model"
158
- ]
159
- }
160
- }
@@ -1,178 +0,0 @@
1
- {
2
- "version": 2,
3
- "sources": [
4
- "laws"
5
- ],
6
- "machineBits": 64,
7
- "targets": [
8
- {
9
- "language": "rust",
10
- "root": ".",
11
- "nativeBindings": {
12
- "rustCrate": "lawspec_example",
13
- "types": [
14
- {
15
- "type": "example.payments::type::Currency",
16
- "native": [
17
- "crate",
18
- "domain",
19
- "CurrencyCode"
20
- ],
21
- "constructors": [
22
- {
23
- "constructor": "USD",
24
- "native": [
25
- "crate",
26
- "domain",
27
- "CurrencyCode",
28
- "Dollars"
29
- ],
30
- "style": "unit",
31
- "fields": []
32
- },
33
- {
34
- "constructor": "EUR",
35
- "native": [
36
- "crate",
37
- "domain",
38
- "CurrencyCode",
39
- "Euros"
40
- ],
41
- "style": "unit",
42
- "fields": []
43
- },
44
- {
45
- "constructor": "GBP",
46
- "native": [
47
- "crate",
48
- "domain",
49
- "CurrencyCode",
50
- "Pounds"
51
- ],
52
- "style": "unit",
53
- "fields": []
54
- }
55
- ]
56
- },
57
- {
58
- "type": "example.payments::type::Money",
59
- "native": [
60
- "crate",
61
- "domain",
62
- "Price"
63
- ],
64
- "constructors": [
65
- {
66
- "constructor": "Money",
67
- "native": [
68
- "crate",
69
- "domain",
70
- "Price"
71
- ],
72
- "style": "record",
73
- "fields": [
74
- {
75
- "field": "amount",
76
- "native": "major"
77
- },
78
- {
79
- "field": "currency",
80
- "native": "unit"
81
- }
82
- ]
83
- }
84
- ]
85
- },
86
- {
87
- "type": "example.payments::type::Payment",
88
- "native": [
89
- "crate",
90
- "domain",
91
- "PaymentStatus"
92
- ],
93
- "constructors": [
94
- {
95
- "constructor": "Paid",
96
- "native": [
97
- "crate",
98
- "domain",
99
- "PaymentStatus",
100
- "Settled"
101
- ],
102
- "style": "variant",
103
- "fields": [
104
- {
105
- "field": "value",
106
- "native": "price"
107
- }
108
- ]
109
- },
110
- {
111
- "constructor": "Declined",
112
- "native": [
113
- "crate",
114
- "domain",
115
- "PaymentStatus",
116
- "Rejected"
117
- ],
118
- "style": "variant",
119
- "fields": [
120
- {
121
- "field": "value",
122
- "native": "explanation"
123
- }
124
- ]
125
- }
126
- ]
127
- }
128
- ],
129
- "functions": [
130
- {
131
- "declaration": "example.payments::addFee",
132
- "native": [
133
- "crate",
134
- "domain",
135
- "apply_fee"
136
- ]
137
- },
138
- {
139
- "declaration": "example.payments::roundTrip",
140
- "native": [
141
- "crate",
142
- "domain",
143
- "restore"
144
- ]
145
- },
146
- {
147
- "declaration": "example.payments::archive",
148
- "native": [
149
- "crate",
150
- "domain",
151
- "store"
152
- ]
153
- }
154
- ],
155
- "generators": [
156
- {
157
- "type": "example.payments::type::Money",
158
- "factory": [
159
- "lawspec_generators",
160
- "prices"
161
- ]
162
- }
163
- ]
164
- }
165
- }
166
- ],
167
- "languageProfile": "1.0-rc.2",
168
- "verification": {
169
- "layers": [
170
- "proof",
171
- "exhaustive",
172
- "property",
173
- "examples",
174
- "runtime",
175
- "model"
176
- ]
177
- }
178
- }