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": "elixir",
10
- "root": ".",
11
- "nativeBindings": {
12
- "types": [
13
- {
14
- "type": "example.payments::type::Currency",
15
- "native": [
16
- "PaymentsDomain",
17
- "CurrencyCode"
18
- ],
19
- "constructors": [
20
- {
21
- "constructor": "USD",
22
- "native": [
23
- "PaymentsDomain",
24
- "Dollars"
25
- ],
26
- "style": "unit",
27
- "fields": []
28
- },
29
- {
30
- "constructor": "EUR",
31
- "native": [
32
- "PaymentsDomain",
33
- "Euros"
34
- ],
35
- "style": "unit",
36
- "fields": []
37
- },
38
- {
39
- "constructor": "GBP",
40
- "native": [
41
- "PaymentsDomain",
42
- "Pounds"
43
- ],
44
- "style": "unit",
45
- "fields": []
46
- }
47
- ]
48
- },
49
- {
50
- "type": "example.payments::type::Money",
51
- "native": [
52
- "PaymentsDomain",
53
- "Price"
54
- ],
55
- "constructors": [
56
- {
57
- "constructor": "Money",
58
- "native": [
59
- "PaymentsDomain",
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
- "PaymentsDomain",
80
- "PaymentStatus"
81
- ],
82
- "constructors": [
83
- {
84
- "constructor": "Paid",
85
- "native": [
86
- "PaymentsDomain",
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
- "PaymentsDomain",
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
- "PaymentsDomain",
119
- "apply_fee"
120
- ]
121
- },
122
- {
123
- "declaration": "example.payments::roundTrip",
124
- "native": [
125
- "PaymentsDomain",
126
- "restore"
127
- ]
128
- },
129
- {
130
- "declaration": "example.payments::archive",
131
- "native": [
132
- "PaymentsDomain",
133
- "store"
134
- ]
135
- }
136
- ],
137
- "generators": [
138
- {
139
- "type": "example.payments::type::Money",
140
- "factory": [
141
- "PaymentGenerators",
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,159 +0,0 @@
1
- {
2
- "version": 2,
3
- "sources": [
4
- "laws"
5
- ],
6
- "machineBits": 64,
7
- "targets": [
8
- {
9
- "language": "erlang",
10
- "root": ".",
11
- "nativeBindings": {
12
- "types": [
13
- {
14
- "type": "example.payments::type::Currency",
15
- "native": [
16
- "payments_domain",
17
- "currency_code"
18
- ],
19
- "constructors": [
20
- {
21
- "constructor": "USD",
22
- "native": [
23
- "dollars"
24
- ],
25
- "style": "unit",
26
- "fields": []
27
- },
28
- {
29
- "constructor": "EUR",
30
- "native": [
31
- "euros"
32
- ],
33
- "style": "unit",
34
- "fields": []
35
- },
36
- {
37
- "constructor": "GBP",
38
- "native": [
39
- "pounds"
40
- ],
41
- "style": "unit",
42
- "fields": []
43
- }
44
- ]
45
- },
46
- {
47
- "type": "example.payments::type::Money",
48
- "native": [
49
- "payments_domain",
50
- "price"
51
- ],
52
- "constructors": [
53
- {
54
- "constructor": "Money",
55
- "native": [
56
- "price"
57
- ],
58
- "style": "record",
59
- "fields": [
60
- {
61
- "field": "amount",
62
- "native": "major"
63
- },
64
- {
65
- "field": "currency",
66
- "native": "unit"
67
- }
68
- ]
69
- }
70
- ]
71
- },
72
- {
73
- "type": "example.payments::type::Payment",
74
- "native": [
75
- "payments_domain",
76
- "payment_status"
77
- ],
78
- "constructors": [
79
- {
80
- "constructor": "Paid",
81
- "native": [
82
- "settled"
83
- ],
84
- "style": "variant",
85
- "fields": [
86
- {
87
- "field": "value",
88
- "native": "price"
89
- }
90
- ]
91
- },
92
- {
93
- "constructor": "Declined",
94
- "native": [
95
- "rejected"
96
- ],
97
- "style": "variant",
98
- "fields": [
99
- {
100
- "field": "value",
101
- "native": "explanation"
102
- }
103
- ]
104
- }
105
- ]
106
- }
107
- ],
108
- "functions": [
109
- {
110
- "declaration": "example.payments::addFee",
111
- "native": [
112
- "payments_domain",
113
- "apply_fee"
114
- ]
115
- },
116
- {
117
- "declaration": "example.payments::roundTrip",
118
- "native": [
119
- "payments_domain",
120
- "restore"
121
- ]
122
- },
123
- {
124
- "declaration": "example.payments::archive",
125
- "native": [
126
- "payments_domain",
127
- "store"
128
- ]
129
- }
130
- ],
131
- "generators": [
132
- {
133
- "type": "example.payments::type::Money",
134
- "factory": [
135
- "payment_generators",
136
- "prices"
137
- ]
138
- }
139
- ],
140
- "erlangIncludes": [
141
- {
142
- "path": "payments_domain.hrl"
143
- }
144
- ]
145
- }
146
- }
147
- ],
148
- "languageProfile": "1.0-rc.2",
149
- "verification": {
150
- "layers": [
151
- "proof",
152
- "exhaustive",
153
- "property",
154
- "examples",
155
- "runtime",
156
- "model"
157
- ]
158
- }
159
- }
@@ -1,178 +0,0 @@
1
- {
2
- "version": 2,
3
- "sources": [
4
- "laws"
5
- ],
6
- "machineBits": 64,
7
- "targets": [
8
- {
9
- "language": "fsharp",
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
- "PaymentStatus",
99
- "Settled"
100
- ],
101
- "style": "variant",
102
- "fields": [
103
- {
104
- "field": "value",
105
- "native": "price"
106
- }
107
- ]
108
- },
109
- {
110
- "constructor": "Declined",
111
- "native": [
112
- "Domain",
113
- "PaymentsDomain",
114
- "PaymentStatus",
115
- "Rejected"
116
- ],
117
- "style": "variant",
118
- "fields": [
119
- {
120
- "field": "value",
121
- "native": "explanation"
122
- }
123
- ]
124
- }
125
- ]
126
- }
127
- ],
128
- "functions": [
129
- {
130
- "declaration": "example.payments::addFee",
131
- "native": [
132
- "Domain",
133
- "PaymentsDomain",
134
- "apply_fee"
135
- ]
136
- },
137
- {
138
- "declaration": "example.payments::roundTrip",
139
- "native": [
140
- "Domain",
141
- "PaymentsDomain",
142
- "restore"
143
- ]
144
- },
145
- {
146
- "declaration": "example.payments::archive",
147
- "native": [
148
- "Domain",
149
- "PaymentsDomain",
150
- "store"
151
- ]
152
- }
153
- ],
154
- "generators": [
155
- {
156
- "type": "example.payments::type::Money",
157
- "factory": [
158
- "Domain",
159
- "PaymentGenerators",
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
- }
@@ -1,160 +0,0 @@
1
- {
2
- "version": 2,
3
- "sources": [
4
- "laws"
5
- ],
6
- "machineBits": 64,
7
- "targets": [
8
- {
9
- "language": "gleam",
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
- "payment_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
- }