lawspec 0.15.0 → 0.15.2
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 +532 -0
- package/README.md +60 -741
- package/api.mjs +1 -1
- package/bin/lawspec.mjs +4 -2
- package/build.json +25 -27
- package/core.wasm +0 -0
- package/doctor.mjs +1 -0
- package/examples-command.mjs +1 -0
- package/files.mjs +1 -0
- package/index.d.ts +1 -1
- package/launcher.mjs +26 -16
- package/native-examples.mjs +1 -0
- package/package.json +33 -6
- package/read-only-hpack.mjs +1 -0
- package/scalars.mjs +1 -0
- package/templates.mjs +112 -219
- package/API-MIGRATION.md +0 -339
- package/GO.md +0 -144
- package/HASKELL.md +0 -172
- package/JAVA.md +0 -113
- package/KOTLIN.md +0 -219
- package/LANGUAGE.md +0 -692
- package/NATIVE-BINDINGS.md +0 -1051
- package/PRIMITIVES.md +0 -150
- package/PYTHON.md +0 -152
- package/REFINEMENTS.md +0 -449
- package/RELEASE-0.10.md +0 -60
- package/RELEASE-0.11.md +0 -62
- package/RELEASE-0.12.md +0 -47
- package/RELEASE-0.13.md +0 -97
- package/RELEASE-0.14.md +0 -52
- package/RELEASE-0.15.md +0 -44
- package/RELEASE-0.9.md +0 -61
- package/RUST.md +0 -211
- package/WEB.md +0 -144
package/templates.mjs
CHANGED
|
@@ -1,226 +1,119 @@
|
|
|
1
|
+
// Generated from templates/npm/templates.mjs by lawspec-dev generate. Do not edit.
|
|
2
|
+
// Project scaffolds, test commands and setup advice for each target. The data
|
|
3
|
+
// is LawSpec.Scaffold's, so the npm CLI and the compiler cannot disagree.
|
|
1
4
|
export const targets = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
];
|
|
5
|
+
"java",
|
|
6
|
+
"python",
|
|
7
|
+
"javascript",
|
|
8
|
+
"typescript",
|
|
9
|
+
"go",
|
|
10
|
+
"haskell",
|
|
11
|
+
"kotlin",
|
|
12
|
+
"rust"
|
|
13
|
+
];
|
|
14
|
+
|
|
11
15
|
export const commands = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
"java": "mvn test",
|
|
17
|
+
"python": "python -m pytest",
|
|
18
|
+
"javascript": "node --test test/*.test.mjs",
|
|
19
|
+
"typescript": "npm exec -- tsc -p tsconfig.json && node --test dist/test/*.test.js",
|
|
20
|
+
"go": "go test ./...",
|
|
21
|
+
"haskell": "stack test",
|
|
22
|
+
"kotlin": "gradle test",
|
|
23
|
+
"rust": "cargo test"
|
|
24
|
+
};
|
|
25
|
+
|
|
22
26
|
export const setup = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
|
|
112
|
-
"xsi:schemaLocation":
|
|
113
|
-
"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd",
|
|
114
|
-
},
|
|
115
|
-
),
|
|
116
|
-
minify,
|
|
117
|
-
) + "\n"
|
|
118
|
-
);
|
|
119
|
-
}
|
|
27
|
+
"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. Run mvn test-compile.",
|
|
28
|
+
"python": "Use Python 3.13+. Install pytest 8.4.x and Hypothesis 6.x into the selected environment: python -m pip install -e \".[test]\". Configure pytest pythonpath=[\"src\"] and testpaths=[\"tests\"]. Set the target python field to the interpreter path if needed.",
|
|
29
|
+
"javascript": "Use Node 22+, package.json type=module, and npm install --save-dev fast-check@4.10.2.",
|
|
30
|
+
"typescript": "Use Node 22+, package.json type=module, and npm install --save-dev fast-check@4.10.2 typescript@5.9.3 @types/node@22.20.4. Configure tsconfig.json with module=NodeNext, target=ES2022, rootDir=., outDir=dist, include=[\"src/**/*.ts\",\"test/**/*.ts\"].",
|
|
31
|
+
"go": "Use Go 1.22+ and go get pgregory.net/rapid@v1.2.0, then go mod download.",
|
|
32
|
+
"haskell": "Use Stack with lts-24.58 and test dependencies hspec, hedgehog, hspec-hedgehog, hspec-discover, and a test/Spec.hs using hspec-discover. Run stack build --test --no-run-tests.",
|
|
33
|
+
"kotlin": "Use JDK 25, Gradle 9.3.0, Kotlin plugin 2.3.21, JVM target 25, Kotest 5.9.1 (runner, assertions, property), and useJUnitPlatform(). Run gradle testClasses.",
|
|
34
|
+
"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. Run cargo test."
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Each target's build files in the readable and the compact (minified) layout.
|
|
38
|
+
const scaffolds = {
|
|
39
|
+
"java": {
|
|
40
|
+
"readable": {
|
|
41
|
+
"pom.xml": "<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"
|
|
42
|
+
},
|
|
43
|
+
"compact": {
|
|
44
|
+
"pom.xml": "<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"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"python": {
|
|
48
|
+
"readable": {
|
|
49
|
+
"pyproject.toml": "[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\"\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"
|
|
50
|
+
},
|
|
51
|
+
"compact": {
|
|
52
|
+
"pyproject.toml": "[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\"\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"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"javascript": {
|
|
56
|
+
"readable": {
|
|
57
|
+
"package.json": "{\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"
|
|
58
|
+
},
|
|
59
|
+
"compact": {
|
|
60
|
+
"package.json": "{\"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"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"typescript": {
|
|
64
|
+
"readable": {
|
|
65
|
+
"package.json": "{\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",
|
|
66
|
+
"tsconfig.json": "{\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"
|
|
67
|
+
},
|
|
68
|
+
"compact": {
|
|
69
|
+
"package.json": "{\"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",
|
|
70
|
+
"tsconfig.json": "{\"compilerOptions\":{\"target\":\"ES2022\",\"module\":\"NodeNext\",\"rootDir\":\".\",\"outDir\":\"dist\",\"strict\":true,\"esModuleInterop\":true,\"skipLibCheck\":true},\"include\":[\"src/**/*.ts\",\"test/**/*.ts\"]}\n"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"go": {
|
|
74
|
+
"readable": {
|
|
75
|
+
"go.mod": "module example.com/lawspec-example\n\ngo 1.22\n\nrequire pgregory.net/rapid v1.2.0\n"
|
|
76
|
+
},
|
|
77
|
+
"compact": {
|
|
78
|
+
"go.mod": "module example.com/lawspec-example\n\ngo 1.22\n\nrequire pgregory.net/rapid v1.2.0\n"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"haskell": {
|
|
82
|
+
"readable": {
|
|
83
|
+
"stack.yaml": "snapshot: lts-24.58\npackages: [.]\n",
|
|
84
|
+
"package.yaml": "name: lawspec-example\nversion: 0.1.0\ndependencies: [base, text, bytestring]\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 build-tools: [hspec-discover]\n",
|
|
85
|
+
"test/Spec.hs": "{-# OPTIONS_GHC -F -pgmF hspec-discover #-}\n"
|
|
86
|
+
},
|
|
87
|
+
"compact": {
|
|
88
|
+
"stack.yaml": "snapshot: lts-24.58\npackages: [.]\n",
|
|
89
|
+
"package.yaml": "name: lawspec-example\nversion: 0.1.0\ndependencies: [base, text, bytestring]\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 build-tools: [hspec-discover]\n",
|
|
90
|
+
"test/Spec.hs": "{-# OPTIONS_GHC -F -pgmF hspec-discover #-}\n"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"kotlin": {
|
|
94
|
+
"readable": {
|
|
95
|
+
"settings.gradle.kts": "rootProject.name = \"lawspec-example\"\n",
|
|
96
|
+
"build.gradle.kts": "plugins {\n kotlin(\"jvm\") version \"2.3.21\"\n}\n\nrepositories {\n mavenCentral()\n}\n\nkotlin {\n jvmToolchain(25)\n}\n\ndependencies {\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"
|
|
97
|
+
},
|
|
98
|
+
"compact": {
|
|
99
|
+
"settings.gradle.kts": "rootProject.name = \"lawspec-example\"\n",
|
|
100
|
+
"build.gradle.kts": "plugins { kotlin(\"jvm\") version \"2.3.21\" }\nrepositories { mavenCentral() }\nkotlin { jvmToolchain(25) }\ndependencies { 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"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"rust": {
|
|
104
|
+
"readable": {
|
|
105
|
+
"src/lib.rs": "// Application library. LawSpec maintains the included module declarations.\ninclude!(\"lawspec_modules.rs\");\n",
|
|
106
|
+
"Cargo.toml": "[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"
|
|
107
|
+
},
|
|
108
|
+
"compact": {
|
|
109
|
+
"src/lib.rs": "// Application library. LawSpec maintains the included module declarations.\ninclude!(\"lawspec_modules.rs\");\n",
|
|
110
|
+
"Cargo.toml": "[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"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
120
115
|
export function templates(target, { minify = false } = {}) {
|
|
121
116
|
if (typeof minify !== "boolean") throw new Error("minify must be a boolean");
|
|
122
|
-
const json = (value) =>
|
|
123
|
-
JSON.stringify(value, null, minify ? undefined : 2) + "\n";
|
|
124
|
-
const kotlinBlock = (name, statements) =>
|
|
125
|
-
minify
|
|
126
|
-
? `${name} { ${statements.join("; ")} }`
|
|
127
|
-
: `${name} {\n${statements.map((line) => " " + line).join("\n")}\n}`;
|
|
128
117
|
if (!targets.includes(target)) throw new Error(`Unknown target: ${target}`);
|
|
129
|
-
|
|
130
|
-
name: "lawspec-example",
|
|
131
|
-
version: "0.1.0",
|
|
132
|
-
private: true,
|
|
133
|
-
type: "module",
|
|
134
|
-
};
|
|
135
|
-
switch (target) {
|
|
136
|
-
case "rust":
|
|
137
|
-
return {
|
|
138
|
-
"src/lib.rs":
|
|
139
|
-
'// Application library. LawSpec maintains the included module declarations.\ninclude!("lawspec_modules.rs");\n',
|
|
140
|
-
"Cargo.toml": `[package]
|
|
141
|
-
name = "lawspec-example"
|
|
142
|
-
version = "0.1.0"
|
|
143
|
-
edition = "2024"
|
|
144
|
-
rust-version = "1.85"
|
|
145
|
-
publish = false
|
|
146
|
-
|
|
147
|
-
[dependencies]
|
|
148
|
-
num-bigint = "=0.4.8"
|
|
149
|
-
num-rational = "=0.4.2"
|
|
150
|
-
num-complex = "=0.4.6"
|
|
151
|
-
num-traits = "=0.2.19"
|
|
152
|
-
|
|
153
|
-
[dev-dependencies]
|
|
154
|
-
proptest = "=1.11.0"
|
|
155
|
-
`,
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
case "javascript":
|
|
159
|
-
return {
|
|
160
|
-
"package.json": json({
|
|
161
|
-
...commonPackage,
|
|
162
|
-
scripts: { test: commands.javascript },
|
|
163
|
-
devDependencies: { "fast-check": "4.10.2" },
|
|
164
|
-
}),
|
|
165
|
-
};
|
|
166
|
-
case "typescript":
|
|
167
|
-
return {
|
|
168
|
-
"package.json": json({
|
|
169
|
-
...commonPackage,
|
|
170
|
-
scripts: { test: commands.typescript },
|
|
171
|
-
devDependencies: {
|
|
172
|
-
"fast-check": "4.10.2",
|
|
173
|
-
typescript: "5.9.3",
|
|
174
|
-
"@types/node": "22.20.4",
|
|
175
|
-
},
|
|
176
|
-
}),
|
|
177
|
-
"tsconfig.json": json({
|
|
178
|
-
compilerOptions: {
|
|
179
|
-
target: "ES2022",
|
|
180
|
-
module: "NodeNext",
|
|
181
|
-
rootDir: ".",
|
|
182
|
-
outDir: "dist",
|
|
183
|
-
strict: true,
|
|
184
|
-
esModuleInterop: true,
|
|
185
|
-
skipLibCheck: true,
|
|
186
|
-
},
|
|
187
|
-
include: ["src/**/*.ts", "test/**/*.ts"],
|
|
188
|
-
}),
|
|
189
|
-
};
|
|
190
|
-
case "python":
|
|
191
|
-
return {
|
|
192
|
-
"pyproject.toml": `[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"\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`,
|
|
193
|
-
};
|
|
194
|
-
case "java":
|
|
195
|
-
return {
|
|
196
|
-
"pom.xml": mavenProject(minify),
|
|
197
|
-
};
|
|
198
|
-
case "go":
|
|
199
|
-
return {
|
|
200
|
-
"go.mod":
|
|
201
|
-
"module example.com/lawspec-example\n\ngo 1.22\n\nrequire pgregory.net/rapid v1.2.0\n",
|
|
202
|
-
};
|
|
203
|
-
case "haskell":
|
|
204
|
-
return {
|
|
205
|
-
"stack.yaml": "snapshot: lts-24.58\npackages: [.]\n",
|
|
206
|
-
"package.yaml": `name: lawspec-example\nversion: 0.1.0\ndependencies: [base, text, bytestring]\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 build-tools: [hspec-discover]\n`,
|
|
207
|
-
"test/Spec.hs": "{-# OPTIONS_GHC -F -pgmF hspec-discover #-}\n",
|
|
208
|
-
};
|
|
209
|
-
case "kotlin":
|
|
210
|
-
return {
|
|
211
|
-
"settings.gradle.kts": 'rootProject.name = "lawspec-example"\n',
|
|
212
|
-
"build.gradle.kts":
|
|
213
|
-
[
|
|
214
|
-
kotlinBlock("plugins", ['kotlin("jvm") version "2.3.21"']),
|
|
215
|
-
kotlinBlock("repositories", ["mavenCentral()"]),
|
|
216
|
-
kotlinBlock("kotlin", ["jvmToolchain(25)"]),
|
|
217
|
-
kotlinBlock("dependencies", [
|
|
218
|
-
'testImplementation("io.kotest:kotest-runner-junit5:5.9.1")',
|
|
219
|
-
'testImplementation("io.kotest:kotest-assertions-core:5.9.1")',
|
|
220
|
-
'testImplementation("io.kotest:kotest-property:5.9.1")',
|
|
221
|
-
]),
|
|
222
|
-
kotlinBlock("tasks.test", ["useJUnitPlatform()"]),
|
|
223
|
-
].join(minify ? "\n" : "\n\n") + "\n",
|
|
224
|
-
};
|
|
225
|
-
}
|
|
118
|
+
return { ...scaffolds[target][minify ? "compact" : "readable"] };
|
|
226
119
|
}
|