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