lawspec 0.31.1 → 0.31.3
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 +89 -2
- package/README.md +85 -9
- package/api.mjs +14 -9
- package/authoring.mjs +899 -0
- package/beam-coverage.mjs +190 -65
- package/beam-doctor.mjs +343 -124
- package/bin/lawspec.mjs +1949 -661
- package/build.json +134 -128
- package/component-packages.mjs +662 -176
- package/component.d.ts +82 -20
- package/component.mjs +317 -94
- package/core.wasm +2 -2
- package/core_jsffi.js +5 -5
- package/doctor.mjs +558 -299
- package/examples-command.mjs +44 -23
- package/failure-database.mjs +60 -17
- package/files.mjs +122 -62
- package/index.d.ts +585 -312
- package/input-files.mjs +90 -25
- package/launcher.mjs +72 -31
- package/learn/coverage.json +184 -112
- package/learn/curriculum.json +4 -1
- package/learn/vendor/fantomas/{LawSpec.Learn.Formatter.5arcua4vy0.wasm → LawSpec.Learn.Formatter.poiijdbsl9.wasm} +0 -0
- package/learn/vendor/fantomas/dotnet.js +3 -3
- package/learn/vendor/manifest.json +4 -8
- package/lsp.mjs +444 -133
- package/mcp.mjs +250 -0
- package/native-evidence.mjs +668 -182
- package/native-examples.mjs +56 -19
- package/native-host.mjs +136 -42
- package/native-parsers/clojure.LICENSE +121 -0
- package/native-parsers/clojure.wasm +0 -0
- package/native-parsers/csharp.LICENSE +21 -0
- package/native-parsers/csharp.wasm +0 -0
- package/native-parsers/elixir.LICENSE +176 -0
- package/native-parsers/elixir.wasm +0 -0
- package/native-parsers/erlang.LICENSE +201 -0
- package/native-parsers/erlang.wasm +0 -0
- package/native-parsers/fsharp.LICENSE +21 -0
- package/native-parsers/fsharp.wasm +0 -0
- package/native-parsers/gleam.LICENSE +202 -0
- package/native-parsers/gleam.wasm +0 -0
- package/native-parsers/go.LICENSE +21 -0
- package/native-parsers/go.wasm +0 -0
- package/native-parsers/groovy.LICENSE +21 -0
- package/native-parsers/groovy.wasm +0 -0
- package/native-parsers/haskell.LICENSE +21 -0
- package/native-parsers/haskell.wasm +0 -0
- package/native-parsers/java.LICENSE +21 -0
- package/native-parsers/java.wasm +0 -0
- package/native-parsers/javascript.LICENSE +21 -0
- package/native-parsers/javascript.wasm +0 -0
- package/native-parsers/kotlin.LICENSE +9 -0
- package/native-parsers/kotlin.wasm +0 -0
- package/native-parsers/lock.json +114 -0
- package/native-parsers/prolog.LICENSE +21 -0
- package/native-parsers/prolog.wasm +0 -0
- package/native-parsers/python.LICENSE +21 -0
- package/native-parsers/python.wasm +0 -0
- package/native-parsers/rust.LICENSE +21 -0
- package/native-parsers/rust.wasm +0 -0
- package/native-parsers/scala.LICENSE +21 -0
- package/native-parsers/scala.wasm +0 -0
- package/native-parsers/swift.LICENSE +21 -0
- package/native-parsers/swift.wasm +0 -0
- package/native-parsers/typescript.LICENSE +21 -0
- package/native-parsers/typescript.wasm +0 -0
- package/node-events-reporter.mjs +41 -17
- package/package.json +4 -3
- package/project.mjs +338 -0
- package/proof.d.ts +93 -19
- package/proof.mjs +1538 -447
- package/read-only-hpack.mjs +6 -5
- package/scala-build-state.mjs +131 -41
- package/scala-coverage.mjs +57 -34
- package/scalars.mjs +23 -8
- package/templates.mjs +566 -617
- package/test-command.mjs +1671 -521
- package/learn/vendor/fantomas/LawSpec.Learn.Formatter.u1ne3a6xd2.wasm +0 -0
package/templates.mjs
CHANGED
|
@@ -2,634 +2,583 @@
|
|
|
2
2
|
// Project scaffolds, test commands and setup advice for each target. The data
|
|
3
3
|
// is LawSpec.Scaffold's, so the npm CLI and the compiler cannot disagree.
|
|
4
4
|
export const targets = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
'java',
|
|
6
|
+
'python',
|
|
7
|
+
'javascript',
|
|
8
|
+
'typescript',
|
|
9
|
+
'go',
|
|
10
|
+
'haskell',
|
|
11
|
+
'kotlin',
|
|
12
|
+
'rust',
|
|
13
|
+
'erlang',
|
|
14
|
+
'elixir',
|
|
15
|
+
'gleam',
|
|
16
|
+
'fsharp',
|
|
17
|
+
'csharp',
|
|
18
|
+
'scala',
|
|
19
|
+
'groovy',
|
|
20
|
+
'clojure',
|
|
21
|
+
'swift',
|
|
22
|
+
'prolog',
|
|
23
|
+
'hcl',
|
|
24
|
+
'yaml',
|
|
25
|
+
'antlr4',
|
|
26
|
+
'make',
|
|
27
|
+
];
|
|
28
28
|
export const programTargets = [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export const artifactTargets = [
|
|
49
|
-
"hcl",
|
|
50
|
-
"yaml",
|
|
51
|
-
"antlr4",
|
|
52
|
-
"make"
|
|
53
|
-
];
|
|
29
|
+
'java',
|
|
30
|
+
'python',
|
|
31
|
+
'javascript',
|
|
32
|
+
'typescript',
|
|
33
|
+
'go',
|
|
34
|
+
'haskell',
|
|
35
|
+
'kotlin',
|
|
36
|
+
'rust',
|
|
37
|
+
'erlang',
|
|
38
|
+
'elixir',
|
|
39
|
+
'gleam',
|
|
40
|
+
'fsharp',
|
|
41
|
+
'csharp',
|
|
42
|
+
'scala',
|
|
43
|
+
'groovy',
|
|
44
|
+
'clojure',
|
|
45
|
+
'swift',
|
|
46
|
+
'prolog',
|
|
47
|
+
];
|
|
48
|
+
export const artifactTargets = ['hcl', 'yaml', 'antlr4', 'make'];
|
|
54
49
|
export const targetLabels = [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
],
|
|
79
|
-
[
|
|
80
|
-
"kotlin",
|
|
81
|
-
"Kotlin"
|
|
82
|
-
],
|
|
83
|
-
[
|
|
84
|
-
"rust",
|
|
85
|
-
"Rust"
|
|
86
|
-
],
|
|
87
|
-
[
|
|
88
|
-
"erlang",
|
|
89
|
-
"Erlang"
|
|
90
|
-
],
|
|
91
|
-
[
|
|
92
|
-
"elixir",
|
|
93
|
-
"Elixir"
|
|
94
|
-
],
|
|
95
|
-
[
|
|
96
|
-
"gleam",
|
|
97
|
-
"Gleam"
|
|
98
|
-
],
|
|
99
|
-
[
|
|
100
|
-
"fsharp",
|
|
101
|
-
"F#"
|
|
102
|
-
],
|
|
103
|
-
[
|
|
104
|
-
"csharp",
|
|
105
|
-
"C#"
|
|
106
|
-
],
|
|
107
|
-
[
|
|
108
|
-
"scala",
|
|
109
|
-
"Scala"
|
|
110
|
-
],
|
|
111
|
-
[
|
|
112
|
-
"groovy",
|
|
113
|
-
"Groovy"
|
|
114
|
-
],
|
|
115
|
-
[
|
|
116
|
-
"clojure",
|
|
117
|
-
"Clojure"
|
|
118
|
-
],
|
|
119
|
-
[
|
|
120
|
-
"swift",
|
|
121
|
-
"Swift"
|
|
122
|
-
],
|
|
123
|
-
[
|
|
124
|
-
"prolog",
|
|
125
|
-
"Prolog"
|
|
126
|
-
],
|
|
127
|
-
[
|
|
128
|
-
"hcl",
|
|
129
|
-
"HCL"
|
|
130
|
-
],
|
|
131
|
-
[
|
|
132
|
-
"yaml",
|
|
133
|
-
"YAML"
|
|
134
|
-
],
|
|
135
|
-
[
|
|
136
|
-
"antlr4",
|
|
137
|
-
"ANTLR"
|
|
138
|
-
],
|
|
139
|
-
[
|
|
140
|
-
"make",
|
|
141
|
-
"Make"
|
|
142
|
-
]
|
|
143
|
-
];
|
|
50
|
+
['java', 'Java'],
|
|
51
|
+
['python', 'Python'],
|
|
52
|
+
['javascript', 'JavaScript'],
|
|
53
|
+
['typescript', 'TypeScript'],
|
|
54
|
+
['go', 'Go'],
|
|
55
|
+
['haskell', 'Haskell'],
|
|
56
|
+
['kotlin', 'Kotlin'],
|
|
57
|
+
['rust', 'Rust'],
|
|
58
|
+
['erlang', 'Erlang'],
|
|
59
|
+
['elixir', 'Elixir'],
|
|
60
|
+
['gleam', 'Gleam'],
|
|
61
|
+
['fsharp', 'F#'],
|
|
62
|
+
['csharp', 'C#'],
|
|
63
|
+
['scala', 'Scala'],
|
|
64
|
+
['groovy', 'Groovy'],
|
|
65
|
+
['clojure', 'Clojure'],
|
|
66
|
+
['swift', 'Swift'],
|
|
67
|
+
['prolog', 'Prolog'],
|
|
68
|
+
['hcl', 'HCL'],
|
|
69
|
+
['yaml', 'YAML'],
|
|
70
|
+
['antlr4', 'ANTLR'],
|
|
71
|
+
['make', 'Make'],
|
|
72
|
+
];
|
|
144
73
|
|
|
145
74
|
export const presentationChecks = {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
"environment": {}
|
|
331
|
-
}
|
|
332
|
-
],
|
|
333
|
-
"clojure": [
|
|
334
|
-
{
|
|
335
|
-
"command": "clojure",
|
|
336
|
-
"args": [
|
|
337
|
-
"-M",
|
|
338
|
-
"-e",
|
|
339
|
-
"(require 'lawspec.build) (lawspec.build/compile-java! true) (shutdown-agents)"
|
|
340
|
-
],
|
|
341
|
-
"suffix": null,
|
|
342
|
-
"each": false,
|
|
343
|
-
"environment": {}
|
|
344
|
-
}
|
|
345
|
-
],
|
|
346
|
-
"swift": [
|
|
347
|
-
{
|
|
348
|
-
"command": "swift",
|
|
349
|
-
"args": [
|
|
350
|
-
"build",
|
|
351
|
-
"--build-tests"
|
|
352
|
-
],
|
|
353
|
-
"suffix": null,
|
|
354
|
-
"each": false,
|
|
355
|
-
"environment": {}
|
|
356
|
-
}
|
|
357
|
-
],
|
|
358
|
-
"prolog": [
|
|
359
|
-
{
|
|
360
|
-
"command": "python3",
|
|
361
|
-
"args": [
|
|
362
|
-
"-B",
|
|
363
|
-
"-c",
|
|
364
|
-
"import ast,pathlib,sys; [ast.parse(pathlib.Path(p).read_text(),filename=p) for p in sys.argv[1:]]"
|
|
365
|
-
],
|
|
366
|
-
"suffix": ".py",
|
|
367
|
-
"each": false,
|
|
368
|
-
"environment": {}
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
"command": "swipl",
|
|
372
|
-
"args": [
|
|
373
|
-
"-q",
|
|
374
|
-
"-g",
|
|
375
|
-
"halt",
|
|
376
|
-
"-s"
|
|
377
|
-
],
|
|
378
|
-
"suffix": ".pl",
|
|
379
|
-
"each": true,
|
|
380
|
-
"environment": {}
|
|
381
|
-
}
|
|
382
|
-
]
|
|
383
|
-
};
|
|
75
|
+
java: [
|
|
76
|
+
{
|
|
77
|
+
command: 'mvn',
|
|
78
|
+
args: ['-q', 'test-compile'],
|
|
79
|
+
suffix: null,
|
|
80
|
+
each: false,
|
|
81
|
+
environment: {},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
python: [
|
|
85
|
+
{
|
|
86
|
+
command: 'python3',
|
|
87
|
+
args: [
|
|
88
|
+
'-B',
|
|
89
|
+
'-c',
|
|
90
|
+
'import ast,pathlib,sys; [ast.parse(pathlib.Path(p).read_text(),filename=p) for p in sys.argv[1:]]',
|
|
91
|
+
],
|
|
92
|
+
suffix: '.py',
|
|
93
|
+
each: false,
|
|
94
|
+
environment: {},
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
javascript: [
|
|
98
|
+
{
|
|
99
|
+
command: 'node',
|
|
100
|
+
args: ['--check'],
|
|
101
|
+
suffix: '.mjs',
|
|
102
|
+
each: true,
|
|
103
|
+
environment: {},
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
typescript: [
|
|
107
|
+
{
|
|
108
|
+
command: 'npm',
|
|
109
|
+
args: ['exec', '--', 'tsc', '-p', 'tsconfig.json'],
|
|
110
|
+
suffix: null,
|
|
111
|
+
each: false,
|
|
112
|
+
environment: {},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
go: [
|
|
116
|
+
{
|
|
117
|
+
command: 'go',
|
|
118
|
+
args: ['test', './...', '-run', '^$'],
|
|
119
|
+
suffix: null,
|
|
120
|
+
each: false,
|
|
121
|
+
environment: {},
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
haskell: [
|
|
125
|
+
{
|
|
126
|
+
command: 'stack',
|
|
127
|
+
args: ['--no-terminal', 'build', '--test', '--no-run-tests'],
|
|
128
|
+
suffix: null,
|
|
129
|
+
each: false,
|
|
130
|
+
environment: {},
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
kotlin: [
|
|
134
|
+
{
|
|
135
|
+
command: 'gradle',
|
|
136
|
+
args: ['testClasses', '--console=plain'],
|
|
137
|
+
suffix: null,
|
|
138
|
+
each: false,
|
|
139
|
+
environment: {},
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
rust: [
|
|
143
|
+
{
|
|
144
|
+
command: 'cargo',
|
|
145
|
+
args: ['test', '--no-run'],
|
|
146
|
+
suffix: null,
|
|
147
|
+
each: false,
|
|
148
|
+
environment: {},
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
erlang: [
|
|
152
|
+
{
|
|
153
|
+
command: 'rebar3',
|
|
154
|
+
args: ['as', 'test', 'compile'],
|
|
155
|
+
suffix: null,
|
|
156
|
+
each: false,
|
|
157
|
+
environment: {},
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
elixir: [
|
|
161
|
+
{
|
|
162
|
+
command: 'mix',
|
|
163
|
+
args: ['compile'],
|
|
164
|
+
suffix: null,
|
|
165
|
+
each: false,
|
|
166
|
+
environment: {
|
|
167
|
+
MIX_ENV: 'test',
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
gleam: [
|
|
172
|
+
{
|
|
173
|
+
command: 'gleam',
|
|
174
|
+
args: ['build'],
|
|
175
|
+
suffix: null,
|
|
176
|
+
each: false,
|
|
177
|
+
environment: {},
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
fsharp: [
|
|
181
|
+
{
|
|
182
|
+
command: 'dotnet',
|
|
183
|
+
args: ['build'],
|
|
184
|
+
suffix: null,
|
|
185
|
+
each: false,
|
|
186
|
+
environment: {},
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
csharp: [
|
|
190
|
+
{
|
|
191
|
+
command: 'dotnet',
|
|
192
|
+
args: ['build'],
|
|
193
|
+
suffix: null,
|
|
194
|
+
each: false,
|
|
195
|
+
environment: {},
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
scala: [
|
|
199
|
+
{
|
|
200
|
+
command: 'scala',
|
|
201
|
+
args: ['compile', '--test', '.'],
|
|
202
|
+
suffix: null,
|
|
203
|
+
each: false,
|
|
204
|
+
environment: {},
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
groovy: [
|
|
208
|
+
{
|
|
209
|
+
command: 'gradle',
|
|
210
|
+
args: ['testClasses', '--console=plain'],
|
|
211
|
+
suffix: null,
|
|
212
|
+
each: false,
|
|
213
|
+
environment: {},
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
clojure: [
|
|
217
|
+
{
|
|
218
|
+
command: 'clojure',
|
|
219
|
+
args: [
|
|
220
|
+
'-M',
|
|
221
|
+
'-e',
|
|
222
|
+
"(require 'lawspec.build) (lawspec.build/compile-java! true) (shutdown-agents)",
|
|
223
|
+
],
|
|
224
|
+
suffix: null,
|
|
225
|
+
each: false,
|
|
226
|
+
environment: {},
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
swift: [
|
|
230
|
+
{
|
|
231
|
+
command: 'swift',
|
|
232
|
+
args: ['build', '--build-tests'],
|
|
233
|
+
suffix: null,
|
|
234
|
+
each: false,
|
|
235
|
+
environment: {},
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
prolog: [
|
|
239
|
+
{
|
|
240
|
+
command: 'python3',
|
|
241
|
+
args: [
|
|
242
|
+
'-B',
|
|
243
|
+
'-c',
|
|
244
|
+
'import ast,pathlib,sys; [ast.parse(pathlib.Path(p).read_text(),filename=p) for p in sys.argv[1:]]',
|
|
245
|
+
],
|
|
246
|
+
suffix: '.py',
|
|
247
|
+
each: false,
|
|
248
|
+
environment: {},
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
command: 'swipl',
|
|
252
|
+
args: ['-q', '-g', 'halt', '-s'],
|
|
253
|
+
suffix: '.pl',
|
|
254
|
+
each: true,
|
|
255
|
+
environment: {},
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
};
|
|
384
259
|
|
|
385
260
|
export const commands = {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
261
|
+
java: 'mvn test',
|
|
262
|
+
python: 'python -m pytest',
|
|
263
|
+
javascript: 'node --test test/*.test.mjs',
|
|
264
|
+
typescript:
|
|
265
|
+
'npm exec -- tsc -p tsconfig.json && node --test dist/test/*.test.js',
|
|
266
|
+
go: 'go test ./...',
|
|
267
|
+
haskell: 'stack test',
|
|
268
|
+
kotlin: 'gradle test',
|
|
269
|
+
rust: 'cargo test',
|
|
270
|
+
erlang: 'rebar3 eunit',
|
|
271
|
+
elixir: 'mix test',
|
|
272
|
+
gleam: 'gleam test',
|
|
273
|
+
fsharp: 'dotnet test',
|
|
274
|
+
csharp: 'dotnet test',
|
|
275
|
+
scala: 'scala test .',
|
|
276
|
+
groovy: 'gradle test',
|
|
277
|
+
clojure: 'clojure -M:test',
|
|
278
|
+
swift: 'swift test',
|
|
279
|
+
prolog: 'python lawspec_test.py',
|
|
280
|
+
};
|
|
405
281
|
|
|
406
282
|
export const setup = {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
283
|
+
java: 'Use JDK 25+, Maven, JetCheck 0.3.0, JUnit Jupiter 5.14.x, compiler plugin 3.14.1+, Surefire 3.5.x, and maven.compiler.release=25; a program that imports lawspec.crypto or lawspec.network also needs Bouncy Castle bcprov-jdk18on 1.86. Run mvn test-compile.',
|
|
284
|
+
python:
|
|
285
|
+
'Use Python 3.13+. Install pytest 8.4.x and Hypothesis 6.x into the selected environment, and, for a program that imports lawspec.crypto or lawspec.network, cryptography 50: python -m pip install -e ".[test]". Configure pytest pythonpath=["src"] and testpaths=["tests"]. Set the target python field to the interpreter path if needed.',
|
|
286
|
+
javascript:
|
|
287
|
+
'Use Node 22+, package.json type=module, npm install --save-dev fast-check@4.10.2, and for a program that imports lawspec.crypto or lawspec.network npm install @noble/post-quantum@0.7.1.',
|
|
288
|
+
typescript:
|
|
289
|
+
'Use Node 22+, package.json type=module, npm install --save-dev fast-check@4.10.2 typescript@5.9.3 @types/node@22.20.4 (and npm install @noble/post-quantum@0.7.1 for a program that imports lawspec.crypto or lawspec.network). Configure tsconfig.json with module=NodeNext, target=ES2022, rootDir=., outDir=dist, include=["src/**/*.ts","test/**/*.ts"].',
|
|
290
|
+
go: 'Use Go 1.25+ and go get pgregory.net/rapid@v1.2.0 (and github.com/cloudflare/circl@v1.6.5 for a program that imports lawspec.crypto or lawspec.network), then go mod download.',
|
|
291
|
+
haskell:
|
|
292
|
+
'Use Stack with lts-24.58, directory and time as dependencies (and, for a program that imports lawspec.crypto, lawspec.network or lawspec.randomness, extra-deps crypton-1.1.5, ram-0.22.1, mlkem-0.2.3.0 and mldsa-0.1.1.0 as dependencies too), and test dependencies hspec, hedgehog, hspec-hedgehog, hspec-discover, and a test/Spec.hs using hspec-discover. Run stack build --test --no-run-tests.',
|
|
293
|
+
kotlin:
|
|
294
|
+
'Use JDK 25, Gradle 9.3.0, Kotlin plugin 2.3.21, JVM target 25, Kotest 5.9.1 (runner, assertions, property), and useJUnitPlatform(); a program that imports lawspec.crypto or lawspec.network also needs Bouncy Castle bcprov-jdk18on 1.86. Run gradle testClasses.',
|
|
295
|
+
rust: 'Use Rust 1.85+ with edition 2024, Proptest 1.11.0, num-bigint 0.4.8, num-rational 0.4.2, num-complex 0.4.6 and num-traits 0.2.19; a program that imports lawspec.crypto, lawspec.network or lawspec.randomness also needs sha3 0.12.0, shake 0.1.0, ml-kem 0.3.2, ml-dsa 0.1.1, slh-dsa 0.2.0-rc.5, aes-gcm 0.11.1 and getrandom 0.4.3. Run cargo test.',
|
|
296
|
+
erlang:
|
|
297
|
+
"Use Erlang/OTP 29, Rebar3 3.27.1 and PropEr 1.5.0 as a Hex dependency in the test profile. Configure {eunit_opts, [{print_depth, 100}, {report, {lawspec_beam_report, []}}]}. Run rebar3 as test compile to prepare dependencies, then rebar3 eunit. Custom test directories must be in extra_src_dirs. Programs importing lawspec.crypto or lawspec.network need OTP's post-quantum crypto support and a Unix C toolchain (WSL on Windows). Install OpenSSL 3.5+ development headers with the same major version as OTP, then run escript lawspec_crypto_build.escript before compiling. The builder uses pkg-config or Homebrew; LAWSPEC_OPENSSL_PREFIX overrides the installation. Ship the compiled priv directory with the application.",
|
|
298
|
+
elixir:
|
|
299
|
+
"Use Erlang/OTP 29, Elixir 1.20.x and StreamData 1.4.0 as a direct Hex test dependency. Run mix deps.get and MIX_ENV=test mix deps.compile. In MIX_ENV=test include src and test/support in erlc_paths, and lib and test/support in elixirc_paths. Add LawSpec.Beam.ExUnitFormatter to ExUnit's formatters in test/test_helper.exs and use unfiltered discovery. Run mix test. Programs importing lawspec.crypto or lawspec.network need OTP's post-quantum crypto support and a Unix C toolchain (WSL on Windows). Install OpenSSL 3.5+ development headers with the same major version as OTP, then run escript lawspec_crypto_build.escript before compiling. The builder uses pkg-config or Homebrew; LAWSPEC_OPENSSL_PREFIX overrides the installation. Ship the compiled priv directory with the application.",
|
|
300
|
+
gleam:
|
|
301
|
+
'Use Erlang/OTP 29, Gleam 1.18 or 1.19, gleam_stdlib 1.0.5, gleeunit 1.11.0 and qcheck 1.0.5. Select target=erlang, src/test directories, and the lawspec_test_support development dependency at ./test-support. In test/<package>_test.gleam use @external(erlang, "lawspec_beam_test_run", "gleam_main") pub fn main() -> Nil. Prepare dependencies with gleam build, then run gleam test. Programs importing lawspec.crypto or lawspec.network need OTP\'s post-quantum crypto support and a Unix C toolchain (WSL on Windows). Install OpenSSL 3.5+ development headers with the same major version as OTP, then run escript lawspec_crypto_build.escript before compiling. The builder uses pkg-config or Homebrew; LAWSPEC_OPENSSL_PREFIX overrides the installation. Ship the compiled priv directory with the application.',
|
|
302
|
+
fsharp:
|
|
303
|
+
'Use the .NET 10 SDK (10.0.100 or later) with F# 10. dotnet test runs on Microsoft.Testing.Platform (global.json opts in) with xunit.v3 4.0.2; the generated runtime projects under lawspec/ use FSharp.Core from the SDK, LawSpec.Testing runs properties on FsCheck 3.4.0 and, for a program that imports lawspec.crypto or lawspec.network, BouncyCastle.Cryptography 2.7.0. Import src/LawSpec.Sources.props and tests/LawSpec.Tests.props in the project files, as lawspec init does. Run dotnet build.',
|
|
304
|
+
csharp:
|
|
305
|
+
"Use the .NET 10 SDK (10.0.100 or later); the LawSpec runtime is F# and builds with the SDK's F# compiler. dotnet test runs on Microsoft.Testing.Platform (global.json opts in) with xunit.v3 4.0.2 and FsCheck 3.4.0 (referenced by lawspec/LawSpec.Testing); for a program that imports lawspec.crypto or lawspec.network the runtime also uses BouncyCastle.Cryptography 2.7.0. Reference lawspec/LawSpec.Runtime from the source project and lawspec/LawSpec.Testing from the test project, as lawspec init does. Run dotnet build.",
|
|
306
|
+
scala:
|
|
307
|
+
'Use JDK 25 and Scala CLI 1.16 (the scala command), with Scala 3.9.0, ScalaCheck 1.20.0 and ScalaTest 3.2.20 (scalatest-funsuite) as test dependencies in project.scala; a program that imports lawspec.crypto or lawspec.network also needs Bouncy Castle bcprov-jdk18on 1.86. Run scala compile --test .',
|
|
308
|
+
groovy:
|
|
309
|
+
"Use JDK 25, Gradle 9.3.0 with the groovy plugin, Groovy 5.0.8 (org.apache.groovy:groovy), Spock 2.5-groovy-5.0, JetCheck 0.3.0 and JUnit Jupiter's API 5.14.0, and useJUnitPlatform(); the Java model compiles jointly with the Groovy sources, so src/main/java and src/test/java are Groovy source directories. A program that imports lawspec.crypto or lawspec.network also needs Bouncy Castle bcprov-jdk18on 1.86. Run gradle testClasses.",
|
|
310
|
+
clojure:
|
|
311
|
+
"Use JDK 25 and the Clojure CLI 1.12 with Clojure 1.12.5 and, for tests, test.check 1.1.3 (the :test alias). The Java model in java/src compiles with the JDK's compiler into target/classes, which lawspec.build does before the tests run (clojure -M:build compiles it alone). A program that imports lawspec.crypto or lawspec.network also needs Bouncy Castle bcprov-jdk18on 1.86. Run clojure -M:test.",
|
|
312
|
+
swift:
|
|
313
|
+
"Use Swift 6.2 or later (Xcode 26 on macOS 26, where CryptoKit has ML-KEM and ML-DSA) and SwiftPM. The generated runtime and test support are local targets under lawspec/ with no package dependencies; tests run on Swift Testing, from the toolchain, with LawSpec's own property engine. Package.swift declares the targets LawSpecRuntime, LawSpecTesting, App (src) and AppTests (tests), as lawspec init writes it. Run swift build --build-tests.",
|
|
314
|
+
prolog:
|
|
315
|
+
'Use SWI-Prolog 10.0+ and Python 3.13+ with janus-swi 1.5.3, pytest 8.4.x and Hypothesis 6.x. Install the generated project with python -m pip install -e ".[test]". Run python lawspec_test.py (PLUnit with the checked Python model), or lawspec test. Set the target python field to the selected interpreter.',
|
|
316
|
+
hcl: 'Generate Terraform variables and checked tfvars using lawspec generate. Run tofu init -backend=false, tofu validate and tofu plan -var-file=configuration.tfvars.json. Artifact generation does not execute application laws.',
|
|
317
|
+
yaml: 'Generate YAML 1.2 configuration and a JSON Schema 2020-12 schema using lawspec generate. Validate edited YAML with a JSON Schema validator. Artifact generation does not execute application laws.',
|
|
318
|
+
antlr4:
|
|
319
|
+
'Compile LawSpecData.g4 with ANTLR 4. The grammar checks data syntax; numeric ranges and field predicates require the companion JSON Schema after decoding. Artifact generation does not execute application laws.',
|
|
320
|
+
make: 'Run make to check the project, generate its configured targets and execute its program target tests using the installed lawspec CLI.',
|
|
321
|
+
};
|
|
430
322
|
|
|
431
323
|
// Each target's build files in the readable and the compact (minified) layout.
|
|
432
324
|
const scaffolds = {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
325
|
+
java: {
|
|
326
|
+
readable: {
|
|
327
|
+
'pom.xml':
|
|
328
|
+
'<project\n xmlns="http://maven.apache.org/POM/4.0.0"\n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">\n <modelVersion>4.0.0</modelVersion>\n <groupId>example</groupId>\n <artifactId>lawspec-example</artifactId>\n <version>0.1.0</version>\n <properties>\n <maven.compiler.release>25</maven.compiler.release>\n <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n </properties>\n <dependencies>\n <dependency>\n <groupId>org.jetbrains</groupId>\n <artifactId>jetCheck</artifactId>\n <version>0.3.0</version>\n <scope>test</scope>\n </dependency>\n <dependency>\n <groupId>org.junit.jupiter</groupId>\n <artifactId>junit-jupiter</artifactId>\n <version>5.14.0</version>\n <scope>test</scope>\n </dependency>\n </dependencies>\n <build>\n <plugins>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-compiler-plugin</artifactId>\n <version>3.14.1</version>\n </plugin>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-surefire-plugin</artifactId>\n <version>3.5.4</version>\n </plugin>\n </plugins>\n </build>\n</project>\n',
|
|
329
|
+
},
|
|
330
|
+
compact: {
|
|
331
|
+
'pom.xml':
|
|
332
|
+
'<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>example</groupId><artifactId>lawspec-example</artifactId><version>0.1.0</version><properties><maven.compiler.release>25</maven.compiler.release><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>org.jetbrains</groupId><artifactId>jetCheck</artifactId><version>0.3.0</version><scope>test</scope></dependency><dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter</artifactId><version>5.14.0</version><scope>test</scope></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.14.1</version></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>3.5.4</version></plugin></plugins></build></project>\n',
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
python: {
|
|
336
|
+
readable: {
|
|
337
|
+
'pyproject.toml':
|
|
338
|
+
'[build-system]\nrequires = ["setuptools==80.9.0"]\nbuild-backend = "setuptools.build_meta"\n\n[project]\nname = "lawspec-example"\nversion = "0.1.0"\nrequires-python = ">=3.13"\ndependencies = []\n\n[project.optional-dependencies]\ntest = ["pytest==8.4.2", "hypothesis==6.135.26"]\n\n[tool.setuptools.packages.find]\nwhere = ["src"]\n\n[tool.pytest.ini_options]\npythonpath = ["src"]\ntestpaths = ["tests"]\n',
|
|
339
|
+
},
|
|
340
|
+
compact: {
|
|
341
|
+
'pyproject.toml':
|
|
342
|
+
'[build-system]\nrequires = ["setuptools==80.9.0"]\nbuild-backend = "setuptools.build_meta"\n\n[project]\nname = "lawspec-example"\nversion = "0.1.0"\nrequires-python = ">=3.13"\ndependencies = []\n\n[project.optional-dependencies]\ntest = ["pytest==8.4.2", "hypothesis==6.135.26"]\n\n[tool.setuptools.packages.find]\nwhere = ["src"]\n\n[tool.pytest.ini_options]\npythonpath = ["src"]\ntestpaths = ["tests"]\n',
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
javascript: {
|
|
346
|
+
readable: {
|
|
347
|
+
'package.json':
|
|
348
|
+
'{\n "name": "lawspec-example",\n "version": "0.1.0",\n "private": true,\n "type": "module",\n "scripts": {\n "test": "node --test test/*.test.mjs"\n },\n "devDependencies": {\n "fast-check": "4.10.2"\n }\n}\n',
|
|
349
|
+
},
|
|
350
|
+
compact: {
|
|
351
|
+
'package.json':
|
|
352
|
+
'{"name":"lawspec-example","version":"0.1.0","private":true,"type":"module","scripts":{"test":"node --test test/*.test.mjs"},"devDependencies":{"fast-check":"4.10.2"}}\n',
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
typescript: {
|
|
356
|
+
readable: {
|
|
357
|
+
'package.json':
|
|
358
|
+
'{\n "name": "lawspec-example",\n "version": "0.1.0",\n "private": true,\n "type": "module",\n "scripts": {\n "test": "npm exec -- tsc -p tsconfig.json && node --test dist/test/*.test.js"\n },\n "devDependencies": {\n "fast-check": "4.10.2",\n "typescript": "5.9.3",\n "@types/node": "22.20.4"\n }\n}\n',
|
|
359
|
+
'tsconfig.json':
|
|
360
|
+
'{\n "compilerOptions": {\n "target": "ES2022",\n "module": "NodeNext",\n "rootDir": ".",\n "outDir": "dist",\n "strict": true,\n "esModuleInterop": true,\n "skipLibCheck": true\n },\n "include": [\n "src/**/*.ts",\n "test/**/*.ts"\n ]\n}\n',
|
|
361
|
+
},
|
|
362
|
+
compact: {
|
|
363
|
+
'package.json':
|
|
364
|
+
'{"name":"lawspec-example","version":"0.1.0","private":true,"type":"module","scripts":{"test":"npm exec -- tsc -p tsconfig.json && node --test dist/test/*.test.js"},"devDependencies":{"fast-check":"4.10.2","typescript":"5.9.3","@types/node":"22.20.4"}}\n',
|
|
365
|
+
'tsconfig.json':
|
|
366
|
+
'{"compilerOptions":{"target":"ES2022","module":"NodeNext","rootDir":".","outDir":"dist","strict":true,"esModuleInterop":true,"skipLibCheck":true},"include":["src/**/*.ts","test/**/*.ts"]}\n',
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
go: {
|
|
370
|
+
readable: {
|
|
371
|
+
'go.mod':
|
|
372
|
+
'module example.com/lawspec-example\n\ngo 1.25.0\n\nrequire pgregory.net/rapid v1.2.0\n',
|
|
373
|
+
},
|
|
374
|
+
compact: {
|
|
375
|
+
'go.mod':
|
|
376
|
+
'module example.com/lawspec-example\n\ngo 1.25.0\n\nrequire pgregory.net/rapid v1.2.0\n',
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
haskell: {
|
|
380
|
+
readable: {
|
|
381
|
+
'stack.yaml': 'snapshot: lts-24.58\npackages: [.]\n',
|
|
382
|
+
'package.yaml':
|
|
383
|
+
'name: lawspec-example\nversion: 0.1.0\ndependencies: [base, text, bytestring, containers, network, directory, time]\nlibrary:\n source-dirs: src\ntests:\n laws:\n main: Spec.hs\n source-dirs: test\n dependencies: [lawspec-example, hspec, hedgehog, hspec-hedgehog, containers, mtl]\n ghc-options: [-O0, -threaded, -rtsopts, "-with-rtsopts=-N"]\n build-tools: [hspec-discover]\n',
|
|
384
|
+
'test/Spec.hs': '{-# OPTIONS_GHC -F -pgmF hspec-discover #-}\n',
|
|
385
|
+
},
|
|
386
|
+
compact: {
|
|
387
|
+
'stack.yaml': 'snapshot: lts-24.58\npackages: [.]\n',
|
|
388
|
+
'package.yaml':
|
|
389
|
+
'name: lawspec-example\nversion: 0.1.0\ndependencies: [base, text, bytestring, containers, network, directory, time]\nlibrary:\n source-dirs: src\ntests:\n laws:\n main: Spec.hs\n source-dirs: test\n dependencies: [lawspec-example, hspec, hedgehog, hspec-hedgehog, containers, mtl]\n ghc-options: [-O0, -threaded, -rtsopts, "-with-rtsopts=-N"]\n build-tools: [hspec-discover]\n',
|
|
390
|
+
'test/Spec.hs': '{-# OPTIONS_GHC -F -pgmF hspec-discover #-}\n',
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
kotlin: {
|
|
394
|
+
readable: {
|
|
395
|
+
'settings.gradle.kts': 'rootProject.name = "lawspec-example"\n',
|
|
396
|
+
'gradle.properties': 'kotlin.daemon.jvmargs=-Xmx2g\n',
|
|
397
|
+
'build.gradle.kts':
|
|
398
|
+
'plugins {\n kotlin("jvm") version "2.3.21"\n}\n\nrepositories {\n mavenCentral()\n}\n\nkotlin {\n jvmToolchain(25)\n}\n\ndependencies {\n implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")\n testImplementation("io.kotest:kotest-runner-junit5:5.9.1")\n testImplementation("io.kotest:kotest-assertions-core:5.9.1")\n testImplementation("io.kotest:kotest-property:5.9.1")\n}\n\ntasks.test {\n useJUnitPlatform()\n}\n',
|
|
399
|
+
},
|
|
400
|
+
compact: {
|
|
401
|
+
'settings.gradle.kts': 'rootProject.name = "lawspec-example"\n',
|
|
402
|
+
'gradle.properties': 'kotlin.daemon.jvmargs=-Xmx2g\n',
|
|
403
|
+
'build.gradle.kts':
|
|
404
|
+
'plugins { kotlin("jvm") version "2.3.21" }\nrepositories { mavenCentral() }\nkotlin { jvmToolchain(25) }\ndependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0"); testImplementation("io.kotest:kotest-runner-junit5:5.9.1"); testImplementation("io.kotest:kotest-assertions-core:5.9.1"); testImplementation("io.kotest:kotest-property:5.9.1") }\ntasks.test { useJUnitPlatform() }\n',
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
rust: {
|
|
408
|
+
readable: {
|
|
409
|
+
'src/lib.rs':
|
|
410
|
+
'// Application library. LawSpec maintains the included module declarations.\ninclude!("lawspec_modules.rs");\n',
|
|
411
|
+
'Cargo.toml':
|
|
412
|
+
'[package]\nname = "lawspec-example"\nversion = "0.1.0"\nedition = "2024"\nrust-version = "1.85"\npublish = false\n\n[dependencies]\nnum-bigint = "=0.4.8"\nnum-rational = "=0.4.2"\nnum-complex = "=0.4.6"\nnum-traits = "=0.2.19"\n\n[dev-dependencies]\nproptest = "=1.11.0"\n',
|
|
413
|
+
},
|
|
414
|
+
compact: {
|
|
415
|
+
'src/lib.rs':
|
|
416
|
+
'// Application library. LawSpec maintains the included module declarations.\ninclude!("lawspec_modules.rs");\n',
|
|
417
|
+
'Cargo.toml':
|
|
418
|
+
'[package]\nname = "lawspec-example"\nversion = "0.1.0"\nedition = "2024"\nrust-version = "1.85"\npublish = false\n\n[dependencies]\nnum-bigint = "=0.4.8"\nnum-rational = "=0.4.2"\nnum-complex = "=0.4.6"\nnum-traits = "=0.2.19"\n\n[dev-dependencies]\nproptest = "=1.11.0"\n',
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
erlang: {
|
|
422
|
+
readable: {
|
|
423
|
+
'rebar.config':
|
|
424
|
+
'{erl_opts, [debug_info]}.\n{eunit_opts, [{print_depth, 100}, {report, {lawspec_beam_report, []}}]}.\n{profiles, [{test, [{deps, [{proper, "1.5.0"}]}]}]}.\n',
|
|
425
|
+
'src/lawspec_example.app.src':
|
|
426
|
+
'{application, lawspec_example, [\n {description, "LawSpec example"},\n {vsn, "0.1.0"},\n {modules, []},\n {registered, []},\n {applications, [kernel, stdlib]}\n]}.\n',
|
|
427
|
+
},
|
|
428
|
+
compact: {
|
|
429
|
+
'rebar.config':
|
|
430
|
+
'{erl_opts, [debug_info]}.\n{eunit_opts, [{print_depth, 100}, {report, {lawspec_beam_report, []}}]}.\n{profiles, [{test, [{deps, [{proper, "1.5.0"}]}]}]}.\n',
|
|
431
|
+
'src/lawspec_example.app.src':
|
|
432
|
+
'{application, lawspec_example, [\n {description, "LawSpec example"},\n {vsn, "0.1.0"},\n {modules, []},\n {registered, []},\n {applications, [kernel, stdlib]}\n]}.\n',
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
elixir: {
|
|
436
|
+
readable: {
|
|
437
|
+
'mix.exs':
|
|
438
|
+
'defmodule LawSpecExample.MixProject do\n use Mix.Project\n\n def project do\n [app: :lawspec_example, version: "0.1.0", elixir: "~> 1.20",\n erlc_paths: ["src"] ++ test_paths(), elixirc_paths: ["lib"] ++ test_paths(),\n deps: [{:stream_data, "== 1.4.0", only: :test}]]\n end\n\n defp test_paths, do: if(Mix.env() == :test, do: ["test/support"], else: [])\n\n def application do\n [extra_applications: [:logger]]\n end\nend\n',
|
|
439
|
+
'test/test_helper.exs':
|
|
440
|
+
'case System.get_env("LAWSPEC_SEED") do\n nil -> ExUnit.start()\n seed -> ExUnit.start(seed: String.to_integer(seed))\nend\nif Code.ensure_loaded?(LawSpec.Beam.ExUnitFormatter) do\n ExUnit.configure(formatters: Enum.uniq(ExUnit.configuration()[:formatters] ++ [LawSpec.Beam.ExUnitFormatter]))\nend\nif Code.ensure_loaded?(:lawspec_beam_resources) do\n :lawspec_beam_resources.configure_suite(Process.whereis(ExUnit.Server))\n ExUnit.after_suite(fn _ -> :lawspec_beam_resources.stop_suite() end)\nend\n',
|
|
441
|
+
},
|
|
442
|
+
compact: {
|
|
443
|
+
'mix.exs':
|
|
444
|
+
'defmodule LawSpecExample.MixProject do\n use Mix.Project\n\n def project do\n [app: :lawspec_example, version: "0.1.0", elixir: "~> 1.20",\n erlc_paths: ["src"] ++ test_paths(), elixirc_paths: ["lib"] ++ test_paths(),\n deps: [{:stream_data, "== 1.4.0", only: :test}]]\n end\n\n defp test_paths, do: if(Mix.env() == :test, do: ["test/support"], else: [])\n\n def application do\n [extra_applications: [:logger]]\n end\nend\n',
|
|
445
|
+
'test/test_helper.exs':
|
|
446
|
+
'case System.get_env("LAWSPEC_SEED") do\n nil -> ExUnit.start()\n seed -> ExUnit.start(seed: String.to_integer(seed))\nend\nif Code.ensure_loaded?(LawSpec.Beam.ExUnitFormatter) do\n ExUnit.configure(formatters: Enum.uniq(ExUnit.configuration()[:formatters] ++ [LawSpec.Beam.ExUnitFormatter]))\nend\nif Code.ensure_loaded?(:lawspec_beam_resources) do\n :lawspec_beam_resources.configure_suite(Process.whereis(ExUnit.Server))\n ExUnit.after_suite(fn _ -> :lawspec_beam_resources.stop_suite() end)\nend\n',
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
gleam: {
|
|
450
|
+
readable: {
|
|
451
|
+
'gleam.toml':
|
|
452
|
+
'name = "lawspec_example"\nversion = "0.1.0"\ngleam = ">= 1.18.0"\ntarget = "erlang"\n\n[dependencies]\ngleam_stdlib = "== 1.0.5"\n\n[dev-dependencies]\ngleeunit = "== 1.11.0"\nqcheck = "== 1.0.5"\nlawspec_test_support = { path = "./test-support" }\n',
|
|
453
|
+
'test-support/gleam.toml':
|
|
454
|
+
'# Generated test helpers are a development-only dependency.\nname = "lawspec_test_support"\nversion = "0.1.0"\ntarget = "erlang"\n\n[dependencies]\nqcheck = "== 1.0.5"\n',
|
|
455
|
+
'test-support/src/.gitkeep': '',
|
|
456
|
+
'test/lawspec_example_test.gleam':
|
|
457
|
+
'@external(erlang, "lawspec_beam_test_run", "gleam_main")\npub fn main() -> Nil\n',
|
|
458
|
+
},
|
|
459
|
+
compact: {
|
|
460
|
+
'gleam.toml':
|
|
461
|
+
'name = "lawspec_example"\nversion = "0.1.0"\ngleam = ">= 1.18.0"\ntarget = "erlang"\n\n[dependencies]\ngleam_stdlib = "== 1.0.5"\n\n[dev-dependencies]\ngleeunit = "== 1.11.0"\nqcheck = "== 1.0.5"\nlawspec_test_support = { path = "./test-support" }\n',
|
|
462
|
+
'test-support/gleam.toml':
|
|
463
|
+
'# Generated test helpers are a development-only dependency.\nname = "lawspec_test_support"\nversion = "0.1.0"\ntarget = "erlang"\n\n[dependencies]\nqcheck = "== 1.0.5"\n',
|
|
464
|
+
'test-support/src/.gitkeep': '',
|
|
465
|
+
'test/lawspec_example_test.gleam':
|
|
466
|
+
'@external(erlang, "lawspec_beam_test_run", "gleam_main")\npub fn main() -> Nil\n',
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
fsharp: {
|
|
470
|
+
readable: {
|
|
471
|
+
'global.json': '{ "test": { "runner": "Microsoft.Testing.Platform" } }\n',
|
|
472
|
+
'Example.slnx':
|
|
473
|
+
'<Solution>\n <Project Path="src/Example.fsproj" />\n <Project Path="tests/Example.Tests.fsproj" />\n <Project Path="lawspec/LawSpec.Runtime/LawSpec.Runtime.fsproj" />\n <Project Path="lawspec/LawSpec.Testing/LawSpec.Testing.fsproj" />\n</Solution>\n',
|
|
474
|
+
'src/Example.fsproj':
|
|
475
|
+
'<Project Sdk="Microsoft.NET.Sdk">\n <PropertyGroup>\n <TargetFramework>net10.0</TargetFramework>\n <RootNamespace>Example</RootNamespace>\n </PropertyGroup>\n <Import Project="LawSpec.Sources.props" />\n <ItemGroup>\n <ProjectReference Include="../lawspec/LawSpec.Runtime/LawSpec.Runtime.fsproj" />\n </ItemGroup>\n</Project>\n',
|
|
476
|
+
'tests/Example.Tests.fsproj':
|
|
477
|
+
'<Project Sdk="Microsoft.NET.Sdk">\n <PropertyGroup>\n <TargetFramework>net10.0</TargetFramework>\n <OutputType>Exe</OutputType>\n <IsPackable>false</IsPackable>\n <IsTestProject>true</IsTestProject>\n </PropertyGroup>\n <Import Project="LawSpec.Tests.props" />\n <ItemGroup>\n <ProjectReference Include="../src/Example.fsproj" />\n <ProjectReference Include="../lawspec/LawSpec.Testing/LawSpec.Testing.fsproj" />\n <PackageReference Include="xunit.v3" Version="4.0.2" />\n </ItemGroup>\n</Project>\n',
|
|
478
|
+
},
|
|
479
|
+
compact: {
|
|
480
|
+
'global.json': '{ "test": { "runner": "Microsoft.Testing.Platform" } }\n',
|
|
481
|
+
'Example.slnx':
|
|
482
|
+
'<Solution>\n<Project Path="src/Example.fsproj" />\n<Project Path="tests/Example.Tests.fsproj" />\n<Project Path="lawspec/LawSpec.Runtime/LawSpec.Runtime.fsproj" />\n<Project Path="lawspec/LawSpec.Testing/LawSpec.Testing.fsproj" />\n</Solution>\n',
|
|
483
|
+
'src/Example.fsproj':
|
|
484
|
+
'<Project Sdk="Microsoft.NET.Sdk">\n<PropertyGroup>\n<TargetFramework>net10.0</TargetFramework>\n<RootNamespace>Example</RootNamespace>\n</PropertyGroup>\n<Import Project="LawSpec.Sources.props" />\n<ItemGroup>\n<ProjectReference Include="../lawspec/LawSpec.Runtime/LawSpec.Runtime.fsproj" />\n</ItemGroup>\n</Project>\n',
|
|
485
|
+
'tests/Example.Tests.fsproj':
|
|
486
|
+
'<Project Sdk="Microsoft.NET.Sdk">\n<PropertyGroup>\n<TargetFramework>net10.0</TargetFramework>\n<OutputType>Exe</OutputType>\n<IsPackable>false</IsPackable>\n<IsTestProject>true</IsTestProject>\n</PropertyGroup>\n<Import Project="LawSpec.Tests.props" />\n<ItemGroup>\n<ProjectReference Include="../src/Example.fsproj" />\n<ProjectReference Include="../lawspec/LawSpec.Testing/LawSpec.Testing.fsproj" />\n<PackageReference Include="xunit.v3" Version="4.0.2" />\n</ItemGroup>\n</Project>\n',
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
csharp: {
|
|
490
|
+
readable: {
|
|
491
|
+
'global.json': '{ "test": { "runner": "Microsoft.Testing.Platform" } }\n',
|
|
492
|
+
'Example.slnx':
|
|
493
|
+
'<Solution>\n <Project Path="src/Example.csproj" />\n <Project Path="tests/Example.Tests.csproj" />\n <Project Path="lawspec/LawSpec.Runtime/LawSpec.Runtime.fsproj" />\n <Project Path="lawspec/LawSpec.Testing/LawSpec.Testing.fsproj" />\n <Project Path="lawspec/LawSpec.Model/LawSpec.Model.fsproj" />\n</Solution>\n',
|
|
494
|
+
'src/Example.csproj':
|
|
495
|
+
'<Project Sdk="Microsoft.NET.Sdk">\n <PropertyGroup>\n <TargetFramework>net10.0</TargetFramework>\n <RootNamespace>Example</RootNamespace>\n <Nullable>disable</Nullable>\n </PropertyGroup>\n <Import Project="LawSpec.Sources.props" />\n <ItemGroup>\n <ProjectReference Include="../lawspec/LawSpec.Runtime/LawSpec.Runtime.fsproj" />\n </ItemGroup>\n</Project>\n',
|
|
496
|
+
'tests/Example.Tests.csproj':
|
|
497
|
+
'<Project Sdk="Microsoft.NET.Sdk">\n <PropertyGroup>\n <TargetFramework>net10.0</TargetFramework>\n <OutputType>Exe</OutputType>\n <IsPackable>false</IsPackable>\n <IsTestProject>true</IsTestProject>\n <Nullable>disable</Nullable>\n </PropertyGroup>\n <Import Project="LawSpec.Tests.props" />\n <ItemGroup>\n <ProjectReference Include="../src/Example.csproj" />\n <ProjectReference Include="../lawspec/LawSpec.Testing/LawSpec.Testing.fsproj" />\n <PackageReference Include="xunit.v3" Version="4.0.2" />\n </ItemGroup>\n</Project>\n',
|
|
498
|
+
},
|
|
499
|
+
compact: {
|
|
500
|
+
'global.json': '{ "test": { "runner": "Microsoft.Testing.Platform" } }\n',
|
|
501
|
+
'Example.slnx':
|
|
502
|
+
'<Solution>\n<Project Path="src/Example.csproj" />\n<Project Path="tests/Example.Tests.csproj" />\n<Project Path="lawspec/LawSpec.Runtime/LawSpec.Runtime.fsproj" />\n<Project Path="lawspec/LawSpec.Testing/LawSpec.Testing.fsproj" />\n<Project Path="lawspec/LawSpec.Model/LawSpec.Model.fsproj" />\n</Solution>\n',
|
|
503
|
+
'src/Example.csproj':
|
|
504
|
+
'<Project Sdk="Microsoft.NET.Sdk">\n<PropertyGroup>\n<TargetFramework>net10.0</TargetFramework>\n<RootNamespace>Example</RootNamespace>\n<Nullable>disable</Nullable>\n</PropertyGroup>\n<Import Project="LawSpec.Sources.props" />\n<ItemGroup>\n<ProjectReference Include="../lawspec/LawSpec.Runtime/LawSpec.Runtime.fsproj" />\n</ItemGroup>\n</Project>\n',
|
|
505
|
+
'tests/Example.Tests.csproj':
|
|
506
|
+
'<Project Sdk="Microsoft.NET.Sdk">\n<PropertyGroup>\n<TargetFramework>net10.0</TargetFramework>\n<OutputType>Exe</OutputType>\n<IsPackable>false</IsPackable>\n<IsTestProject>true</IsTestProject>\n<Nullable>disable</Nullable>\n</PropertyGroup>\n<Import Project="LawSpec.Tests.props" />\n<ItemGroup>\n<ProjectReference Include="../src/Example.csproj" />\n<ProjectReference Include="../lawspec/LawSpec.Testing/LawSpec.Testing.fsproj" />\n<PackageReference Include="xunit.v3" Version="4.0.2" />\n</ItemGroup>\n</Project>\n',
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
scala: {
|
|
510
|
+
readable: {
|
|
511
|
+
'project.scala':
|
|
512
|
+
'// The build, for Scala CLI (the scala command): scala test .\n//> using scala 3.9.0\n//> using options -deprecation -feature\n//> using javaOpt --sun-misc-unsafe-memory-access=allow\n//> using test.dep org.scalacheck::scalacheck:1.20.0\n//> using test.dep org.scalatest::scalatest-funsuite:3.2.20\n',
|
|
513
|
+
},
|
|
514
|
+
compact: {
|
|
515
|
+
'project.scala':
|
|
516
|
+
'// The build, for Scala CLI (the scala command): scala test .\n//> using scala 3.9.0\n//> using options -deprecation -feature\n//> using javaOpt --sun-misc-unsafe-memory-access=allow\n//> using test.dep org.scalacheck::scalacheck:1.20.0\n//> using test.dep org.scalatest::scalatest-funsuite:3.2.20\n',
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
groovy: {
|
|
520
|
+
readable: {
|
|
521
|
+
'settings.gradle': "rootProject.name = 'lawspec-example'\n",
|
|
522
|
+
'build.gradle':
|
|
523
|
+
"plugins {\n id 'groovy'\n}\n\nrepositories {\n mavenCentral()\n}\n\njava {\n toolchain { languageVersion = JavaLanguageVersion.of(25) }\n}\n\nsourceSets {\n main { java { srcDirs = [] }; groovy { srcDirs = ['src/main/groovy', 'src/main/java'] } }\n test { java { srcDirs = [] }; groovy { srcDirs = ['src/test/groovy', 'src/test/java'] } }\n}\n\ntasks.withType(org.gradle.api.tasks.compile.GroovyCompile).configureEach {\n groovyOptions.forkOptions.memoryMaximumSize = '2g'\n}\n\ndependencies {\n implementation 'org.apache.groovy:groovy:5.0.8'\n testImplementation platform('org.spockframework:spock-bom:2.5-groovy-5.0')\n testImplementation 'org.spockframework:spock-core'\n testImplementation 'org.jetbrains:jetCheck:0.3.0'\n testImplementation 'org.junit.jupiter:junit-jupiter-api:5.14.0'\n testRuntimeOnly 'org.junit.platform:junit-platform-launcher'\n}\n\ntest {\n useJUnitPlatform()\n}\n",
|
|
524
|
+
},
|
|
525
|
+
compact: {
|
|
526
|
+
'settings.gradle': "rootProject.name = 'lawspec-example'\n",
|
|
527
|
+
'build.gradle':
|
|
528
|
+
"plugins { id 'groovy' }\nrepositories { mavenCentral() }\njava { toolchain { languageVersion = JavaLanguageVersion.of(25) } }\nsourceSets { main { java { srcDirs = [] }; groovy { srcDirs = ['src/main/groovy', 'src/main/java'] } }; test { java { srcDirs = [] }; groovy { srcDirs = ['src/test/groovy', 'src/test/java'] } } }\ntasks.withType(org.gradle.api.tasks.compile.GroovyCompile).configureEach { groovyOptions.forkOptions.memoryMaximumSize = '2g' }\ndependencies { implementation 'org.apache.groovy:groovy:5.0.8'; testImplementation platform('org.spockframework:spock-bom:2.5-groovy-5.0'); testImplementation 'org.spockframework:spock-core'; testImplementation 'org.jetbrains:jetCheck:0.3.0'; testImplementation 'org.junit.jupiter:junit-jupiter-api:5.14.0'; testRuntimeOnly 'org.junit.platform:junit-platform-launcher' }\ntest { useJUnitPlatform() }\n",
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
clojure: {
|
|
532
|
+
readable: {
|
|
533
|
+
'deps.edn':
|
|
534
|
+
'{:paths ["src" "target/classes"]\n :deps {org.clojure/clojure {:mvn/version "1.12.5"}}\n :aliases\n {:test {:extra-paths ["test" "target/test-classes"]\n :extra-deps {org.clojure/test.check {:mvn/version "1.1.3"}}\n :main-opts ["-m" "lawspec.test-runner"]}\n :build {:main-opts ["-m" "lawspec.build"]}}}\n',
|
|
535
|
+
},
|
|
536
|
+
compact: {
|
|
537
|
+
'deps.edn':
|
|
538
|
+
'{:paths ["src" "target/classes"]\n :deps {org.clojure/clojure {:mvn/version "1.12.5"}}\n :aliases\n {:test {:extra-paths ["test" "target/test-classes"]\n :extra-deps {org.clojure/test.check {:mvn/version "1.1.3"}}\n :main-opts ["-m" "lawspec.test-runner"]}\n :build {:main-opts ["-m" "lawspec.build"]}}}\n',
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
swift: {
|
|
542
|
+
readable: {
|
|
543
|
+
'Package.swift':
|
|
544
|
+
'// swift-tools-version: 6.2\nimport PackageDescription\n\nlet package = Package(\n name: "Example",\n platforms: [.macOS(.v26)],\n targets: [\n .target(name: "LawSpecRuntime", path: "lawspec/LawSpecRuntime"),\n .target(\n name: "LawSpecTesting", dependencies: ["LawSpecRuntime"], path: "lawspec/LawSpecTesting"),\n .target(name: "App", dependencies: ["LawSpecRuntime"], path: "src"),\n .testTarget(\n name: "AppTests", dependencies: ["App", "LawSpecRuntime", "LawSpecTesting"], path: "tests"),\n ]\n)\n',
|
|
545
|
+
},
|
|
546
|
+
compact: {
|
|
547
|
+
'Package.swift':
|
|
548
|
+
'// swift-tools-version: 6.2\nimport PackageDescription\nlet package = Package(\n name: "Example",\n platforms: [.macOS(.v26)],\n targets: [\n .target(name: "LawSpecRuntime", path: "lawspec/LawSpecRuntime"),\n .target(\n name: "LawSpecTesting", dependencies: ["LawSpecRuntime"], path: "lawspec/LawSpecTesting"),\n .target(name: "App", dependencies: ["LawSpecRuntime"], path: "src"),\n .testTarget(\n name: "AppTests", dependencies: ["App", "LawSpecRuntime", "LawSpecTesting"], path: "tests"),\n ]\n)\n',
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
prolog: {
|
|
552
|
+
readable: {
|
|
553
|
+
'pyproject.toml':
|
|
554
|
+
'[build-system]\nrequires = ["setuptools==80.9.0"]\nbuild-backend = "setuptools.build_meta"\n\n[project]\nname = "lawspec-example"\nversion = "0.1.0"\nrequires-python = ">=3.13"\ndependencies = ["janus-swi==1.5.3"]\n\n[project.optional-dependencies]\ntest = ["pytest==8.4.2", "hypothesis==6.135.26"]\n\n[tool.setuptools.packages.find]\nwhere = ["src"]\n\n[tool.pytest.ini_options]\npythonpath = ["src"]\ntestpaths = ["tests"]\n',
|
|
555
|
+
},
|
|
556
|
+
compact: {
|
|
557
|
+
'pyproject.toml':
|
|
558
|
+
'[build-system]\nrequires = ["setuptools==80.9.0"]\nbuild-backend = "setuptools.build_meta"\n\n[project]\nname = "lawspec-example"\nversion = "0.1.0"\nrequires-python = ">=3.13"\ndependencies = ["janus-swi==1.5.3"]\n\n[project.optional-dependencies]\ntest = ["pytest==8.4.2", "hypothesis==6.135.26"]\n\n[tool.setuptools.packages.find]\nwhere = ["src"]\n\n[tool.pytest.ini_options]\npythonpath = ["src"]\ntestpaths = ["tests"]\n',
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
hcl: {
|
|
562
|
+
readable: {},
|
|
563
|
+
compact: {},
|
|
564
|
+
},
|
|
565
|
+
yaml: {
|
|
566
|
+
readable: {},
|
|
567
|
+
compact: {},
|
|
568
|
+
},
|
|
569
|
+
antlr4: {
|
|
570
|
+
readable: {},
|
|
571
|
+
compact: {},
|
|
572
|
+
},
|
|
573
|
+
make: {
|
|
574
|
+
readable: {},
|
|
575
|
+
compact: {},
|
|
576
|
+
},
|
|
577
|
+
};
|
|
630
578
|
|
|
631
|
-
export function templates(target, {
|
|
632
|
-
|
|
579
|
+
export function templates(target, {minify = false} = {})
|
|
580
|
+
{
|
|
581
|
+
if (typeof minify !== 'boolean') throw new Error('minify must be a boolean');
|
|
633
582
|
if (!targets.includes(target)) throw new Error(`Unknown target: ${target}`);
|
|
634
|
-
return {
|
|
583
|
+
return {...scaffolds[target][minify ? 'compact' : 'readable']};
|
|
635
584
|
}
|