@contractkit/plugin-csharp 0.0.0 → 0.1.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.
- package/.turbo/turbo-build$colon$ci.log +11 -11
- package/.turbo/turbo-test$colon$ci.log +36 -0
- package/CHANGELOG.md +10 -0
- package/package.json +47 -47
- package/.turbo/turbo-build.log +0 -12
- package/.turbo/turbo-format.log +0 -34
- package/.turbo/turbo-test.log +0 -17
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
$ eslint --max-warnings=0 && pnpm run build
|
|
2
2
|
$ tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
4
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
5
|
+
[34mCLI[39m tsup v8.5.1
|
|
6
|
+
[34mCLI[39m Target: esnext
|
|
7
|
+
[34mESM[39m Build start
|
|
8
|
+
[32mESM[39m [1mdist/index.js [22m[32m93.08 KB[39m
|
|
9
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m198.91 KB[39m
|
|
10
|
+
[32mESM[39m ⚡️ Build success in 293ms
|
|
11
|
+
[34mDTS[39m Build start
|
|
12
|
+
[32mDTS[39m ⚡️ Build success in 6492ms
|
|
13
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.50 KB[39m
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
$ vitest run --coverage
|
|
2
|
+
|
|
3
|
+
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.5 [39m[90m/home/runner/work/ContractKit/ContractKit/packages/plugin-csharp[39m
|
|
4
|
+
[2mCoverage enabled with [22m[33mv8[39m
|
|
5
|
+
|
|
6
|
+
[32m✓[39m tests/codegen-client.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m 213[2mms[22m[39m
|
|
7
|
+
[32m✓[39m tests/index.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 175[2mms[22m[39m
|
|
8
|
+
[32m✓[39m tests/codegen-models.test.ts [2m([22m[2m63 tests[22m[2m)[22m[32m 246[2mms[22m[39m
|
|
9
|
+
[32m✓[39m tests/runtime.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 47[2mms[22m[39m
|
|
10
|
+
[32m✓[39m tests/naming.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 45[2mms[22m[39m
|
|
11
|
+
[32m✓[39m tests/scaffold.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 37[2mms[22m[39m
|
|
12
|
+
[32m✓[39m tests/hoist.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
13
|
+
|
|
14
|
+
[2m Test Files [22m [1m[32m7 passed[39m[22m[90m (7)[39m
|
|
15
|
+
[2m Tests [22m [1m[32m147 passed[39m[22m[90m (147)[39m
|
|
16
|
+
[2m Start at [22m 17:49:55
|
|
17
|
+
[2m Duration [22m 12.67s[2m (transform 6.76s, setup 0ms, import 21.88s, tests 802ms, environment 1ms)[22m
|
|
18
|
+
|
|
19
|
+
[34m % [39m[2mCoverage report from [22m[33mv8[39m
|
|
20
|
+
-------------------|---------|----------|---------|---------|-------------------
|
|
21
|
+
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
22
|
+
-------------------|---------|----------|---------|---------|-------------------
|
|
23
|
+
All files | 87.99 | 76.98 | 89.44 | 90.79 |
|
|
24
|
+
src | 88.03 | 77.05 | 89.63 | 90.83 |
|
|
25
|
+
...gen-client.ts | 94.61 | 87.12 | 94.91 | 97.59 | ...94-496,513-514
|
|
26
|
+
...gen-models.ts | 91.19 | 75 | 96.42 | 92.97 | ...79,881,903-906
|
|
27
|
+
codegen-sdk.ts | 100 | 100 | 100 | 100 |
|
|
28
|
+
hoist.ts | 78.66 | 61.9 | 93.1 | 79.06 | ...13-322,350-362
|
|
29
|
+
index.ts | 70.74 | 71.21 | 58.06 | 75.59 | ...25-329,350-369
|
|
30
|
+
naming.ts | 86.2 | 72.72 | 100 | 100 | ...40,164-191,204
|
|
31
|
+
...converters.ts | 100 | 100 | 100 | 100 |
|
|
32
|
+
runtime.ts | 100 | 100 | 100 | 100 |
|
|
33
|
+
scaffold.ts | 100 | 100 | 100 | 100 |
|
|
34
|
+
tests | 86.95 | 75.67 | 88 | 89.74 |
|
|
35
|
+
helpers.ts | 86.95 | 75.67 | 88 | 89.74 | 99,138,146,175
|
|
36
|
+
-------------------|---------|----------|---------|---------|-------------------
|
package/CHANGELOG.md
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
1
|
# @contractkit/plugin-csharp
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 024df73: Add `@contractkit/plugin-csharp`, a C#/.NET SDK generator built on `System.Text.Json` and `HttpClient` with no NuGet dependencies, so a generated SDK restores and builds with no feed reachable.
|
|
8
|
+
|
|
9
|
+
It emits one file of `sealed record` models per contract file and one client of `Task`-returning `...Async` methods per operation file, alongside a small runtime (`SdkHttp`, `SdkException`, `SdkOptions`, the wire converters) and an aggregator sharing one `HttpClient` across every client. `scaffold: true` writes `<SdkName>.csproj` once, as a user-owned file.
|
|
10
|
+
|
|
11
|
+
Where it differs from the Kotlin generator it mirrors: an optional field and a required-nullable field are told apart per property (`T?` with `[JsonIgnore(WhenWritingNull)]` versus `required T?`), so a null the contract requires is written and an absent field is omitted; every tuple is hoisted with a type-level converter, so one nested in a collection still travels as a JSON array; a discriminated union is a marker interface its member records implement, so one contract can belong to several unions; and the generated output is compiled by `dotnet build` in the cross-plugin test suite wherever a .NET SDK is installed.
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
}
|
|
2
|
+
"name": "@contractkit/plugin-csharp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "ContractKit built-in plugin: C#/.NET SDK client generation (System.Text.Json + HttpClient, no NuGet dependencies)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Marooned Software",
|
|
8
|
+
"url": "https://github.com/MaroonedSoftware/contractkit"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/MaroonedSoftware/contractkit/issues"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/MaroonedSoftware/contractkit/packages/plugin-csharp#readme",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"contractkit",
|
|
16
|
+
"csharp",
|
|
17
|
+
"dotnet",
|
|
18
|
+
"system.text.json"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/MaroonedSoftware/contractkit.git"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"module": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@contractkit/core": "0.29.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"unplugin-swc": "^1.5.9",
|
|
36
|
+
"vitest": "^4.1.5",
|
|
37
|
+
"@repo/config-eslint": "0.3.1",
|
|
38
|
+
"@repo/config-typescript": "0.1.0"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration",
|
|
42
|
+
"build:ci": "eslint --max-warnings=0 && pnpm run build",
|
|
43
|
+
"lint": "eslint --fix",
|
|
44
|
+
"format": "prettier --write .",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"test:ci": "vitest run --coverage"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
$ tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
|
|
2
|
-
CLI Building entry: src/index.ts
|
|
3
|
-
CLI Using tsconfig: tsconfig.json
|
|
4
|
-
CLI tsup v8.5.1
|
|
5
|
-
CLI Target: esnext
|
|
6
|
-
ESM Build start
|
|
7
|
-
ESM dist/index.js 93.08 KB
|
|
8
|
-
ESM dist/index.js.map 198.91 KB
|
|
9
|
-
ESM ⚡️ Build success in 19ms
|
|
10
|
-
DTS Build start
|
|
11
|
-
DTS ⚡️ Build success in 299ms
|
|
12
|
-
DTS dist/index.d.ts 1.50 KB
|
package/.turbo/turbo-format.log
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
$ prettier --write .
|
|
2
|
-
CHANGELOG.md 9ms (unchanged)
|
|
3
|
-
dist/codegen-client.d.ts 22ms
|
|
4
|
-
dist/codegen-models.d.ts 7ms
|
|
5
|
-
dist/codegen-sdk.d.ts 1ms
|
|
6
|
-
dist/hoist.d.ts 5ms
|
|
7
|
-
dist/index.d.ts 3ms
|
|
8
|
-
dist/index.js 97ms
|
|
9
|
-
dist/naming.d.ts 6ms
|
|
10
|
-
dist/runtime-converters.d.ts 1ms
|
|
11
|
-
dist/runtime.d.ts 1ms
|
|
12
|
-
dist/scaffold.d.ts 2ms
|
|
13
|
-
eslint.config.js 1ms (unchanged)
|
|
14
|
-
package.json 2ms (unchanged)
|
|
15
|
-
README.md 20ms
|
|
16
|
-
src/codegen-client.ts 37ms
|
|
17
|
-
src/codegen-models.ts 40ms
|
|
18
|
-
src/codegen-sdk.ts 3ms (unchanged)
|
|
19
|
-
src/hoist.ts 17ms (unchanged)
|
|
20
|
-
src/index.ts 13ms (unchanged)
|
|
21
|
-
src/naming.ts 5ms (unchanged)
|
|
22
|
-
src/runtime-converters.ts 1ms (unchanged)
|
|
23
|
-
src/runtime.ts 1ms (unchanged)
|
|
24
|
-
src/scaffold.ts 1ms (unchanged)
|
|
25
|
-
tests/codegen-client.test.ts 13ms
|
|
26
|
-
tests/codegen-models.test.ts 32ms
|
|
27
|
-
tests/helpers.ts 8ms (unchanged)
|
|
28
|
-
tests/hoist.test.ts 6ms (unchanged)
|
|
29
|
-
tests/index.test.ts 6ms
|
|
30
|
-
tests/naming.test.ts 4ms (unchanged)
|
|
31
|
-
tests/runtime.test.ts 2ms (unchanged)
|
|
32
|
-
tests/scaffold.test.ts 1ms (unchanged)
|
|
33
|
-
tsconfig.json 1ms (unchanged)
|
|
34
|
-
vitest.config.ts 1ms (unchanged)
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
$ vitest run
|
|
2
|
-
|
|
3
|
-
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.5 [39m[90m/Users/robert/projects/ContractKit/packages/plugin-csharp[39m
|
|
4
|
-
|
|
5
|
-
[32m✓[39m tests/scaffold.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 1[2mms[22m[39m
|
|
6
|
-
[32m✓[39m tests/naming.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
7
|
-
[32m✓[39m tests/runtime.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
8
|
-
[32m✓[39m tests/hoist.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
9
|
-
[32m✓[39m tests/codegen-client.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
10
|
-
[32m✓[39m tests/codegen-models.test.ts [2m([22m[2m63 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
11
|
-
[32m✓[39m tests/index.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
12
|
-
|
|
13
|
-
[2m Test Files [22m [1m[32m7 passed[39m[22m[90m (7)[39m
|
|
14
|
-
[2m Tests [22m [1m[32m147 passed[39m[22m[90m (147)[39m
|
|
15
|
-
[2m Start at [22m 09:19:55
|
|
16
|
-
[2m Duration [22m 213ms[2m (transform 426ms, setup 0ms, import 716ms, tests 25ms, environment 0ms)[22m
|
|
17
|
-
|