@voxgig/sdkgen 1.3.17 → 1.3.18
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/bin/voxgig-sdkgen +1 -1
- package/dist/cmp/Entity.js +5 -1
- package/dist/cmp/Entity.js.map +1 -1
- package/dist/cmp/Feature.js +2 -1
- package/dist/cmp/Feature.js.map +1 -1
- package/dist/helpers/canonType.js +8 -3
- package/dist/helpers/canonType.js.map +1 -1
- package/dist/helpers/collectDeps.d.ts +1 -1
- package/dist/helpers/collectDeps.js +36 -13
- package/dist/helpers/collectDeps.js.map +1 -1
- package/dist/helpers/naming.d.ts +3 -1
- package/dist/helpers/naming.js +53 -0
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opShape.d.ts +3 -1
- package/dist/helpers/opShape.js +87 -8
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/sdkgen.d.ts +3 -3
- package/dist/sdkgen.js +6 -2
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -10
- package/project/.sdk/model/target/cpp.aontu +4 -4
- package/project/.sdk/model/target/go-cli.aontu +17 -17
- package/project/.sdk/model/target/go-mcp.aontu +11 -11
- package/project/.sdk/model/target/go.aontu +1 -1
- package/project/.sdk/model/target/java.aontu +4 -4
- package/project/.sdk/model/target/kotlin.aontu +4 -4
- package/project/.sdk/model/target/lean.aontu +51 -0
- package/project/.sdk/model/target/scala.aontu +4 -4
- package/project/.sdk/src/cmp/c/EntityTypes_c.ts +3 -4
- package/project/.sdk/src/cmp/c/Entity_c.ts +3 -3
- package/project/.sdk/src/cmp/c/ReadmeExamplesTest_c.ts +24 -7
- package/project/.sdk/src/cmp/c/TestDirect_c.ts +3 -3
- package/project/.sdk/src/cmp/c/TestEntity_c.ts +1 -1
- package/project/.sdk/src/cmp/clojure/Entity_clojure.ts +1 -1
- package/project/.sdk/src/cmp/clojure/ReadmeExamplesTest_clojure.ts +19 -8
- package/project/.sdk/src/cmp/cpp/EntityTypes_cpp.ts +2 -2
- package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +3 -3
- package/project/.sdk/src/cmp/cpp/MainEntity_cpp.ts +2 -2
- package/project/.sdk/src/cmp/cpp/ReadmeExamplesTest_cpp.ts +136 -0
- package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +3 -3
- package/project/.sdk/src/cmp/cpp/Test_cpp.ts +4 -0
- package/project/.sdk/src/cmp/csharp/EntityTypes_csharp.ts +2 -3
- package/project/.sdk/src/cmp/csharp/Entity_csharp.ts +3 -3
- package/project/.sdk/src/cmp/csharp/MainEntity_csharp.ts +2 -2
- package/project/.sdk/src/cmp/csharp/Package_csharp.ts +1 -1
- package/project/.sdk/src/cmp/csharp/ReadmeExamplesTest_csharp.ts +13 -1
- package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +3 -3
- package/project/.sdk/src/cmp/dart/EntityTypes_dart.ts +2 -3
- package/project/.sdk/src/cmp/dart/Entity_dart.ts +3 -3
- package/project/.sdk/src/cmp/dart/MainEntity_dart.ts +2 -2
- package/project/.sdk/src/cmp/dart/Main_dart.ts +3 -3
- package/project/.sdk/src/cmp/dart/Package_dart.ts +1 -1
- package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +4 -4
- package/project/.sdk/src/cmp/elixir/EntityTypes_elixir.ts +2 -3
- package/project/.sdk/src/cmp/elixir/Entity_elixir.ts +1 -1
- package/project/.sdk/src/cmp/elixir/ReadmeExamplesTest_elixir.ts +21 -3
- package/project/.sdk/src/cmp/go/Config_go.ts +4 -1
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +110 -18
- package/project/.sdk/src/cmp/go/Entity_go.ts +3 -3
- package/project/.sdk/src/cmp/go/Main_go.ts +7 -6
- package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +3 -3
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +1 -1
- package/project/.sdk/src/cmp/go/utility_go.ts +25 -0
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +9 -1
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +9 -1
- package/project/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +28 -18
- package/project/.sdk/src/cmp/java/EntityTypes_java.ts +2 -3
- package/project/.sdk/src/cmp/java/Entity_java.ts +3 -3
- package/project/.sdk/src/cmp/java/MainEntity_java.ts +2 -2
- package/project/.sdk/src/cmp/java/Package_java.ts +1 -1
- package/project/.sdk/src/cmp/java/ReadmeExamplesTest_java.ts +23 -1
- package/project/.sdk/src/cmp/java/TestDirect_java.ts +3 -3
- package/project/.sdk/src/cmp/js/EntityTypes_js.ts +2 -3
- package/project/.sdk/src/cmp/js/Entity_js.ts +3 -3
- package/project/.sdk/src/cmp/js/MainEntity_js.ts +2 -2
- package/project/.sdk/src/cmp/js/Main_js.ts +2 -2
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +4 -4
- package/project/.sdk/src/cmp/kotlin/EntityTypes_kotlin.ts +2 -3
- package/project/.sdk/src/cmp/kotlin/Entity_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/MainEntity_kotlin.ts +2 -2
- package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +1 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeExamplesTest_kotlin.ts +27 -2
- package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/lean/Config_lean.ts +88 -0
- package/project/.sdk/src/cmp/lean/Entity_lean.ts +9 -0
- package/project/.sdk/src/cmp/lean/Gitignore_lean.ts +18 -0
- package/project/.sdk/src/cmp/lean/Main_lean.ts +120 -0
- package/project/.sdk/src/cmp/lean/Package_lean.ts +68 -0
- package/project/.sdk/src/cmp/lean/ReadmeEntity_lean.ts +29 -0
- package/project/.sdk/src/cmp/lean/ReadmeExplanation_lean.ts +19 -0
- package/project/.sdk/src/cmp/lean/ReadmeHowto_lean.ts +25 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +38 -0
- package/project/.sdk/src/cmp/lean/ReadmeIntro_lean.ts +25 -0
- package/project/.sdk/src/cmp/lean/ReadmeModel_lean.ts +24 -0
- package/project/.sdk/src/cmp/lean/ReadmeOptions_lean.ts +22 -0
- package/project/.sdk/src/cmp/lean/ReadmeQuick_lean.ts +50 -0
- package/project/.sdk/src/cmp/lean/ReadmeRef_lean.ts +16 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopHowto_lean.ts +16 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopQuick_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +18 -0
- package/project/.sdk/src/cmp/lean/Test_lean.ts +207 -0
- package/project/.sdk/src/cmp/lean/utility_lean.ts +78 -0
- package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +2 -3
- package/project/.sdk/src/cmp/lua/Entity_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/Package_lua.ts +1 -1
- package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +1 -1
- package/project/.sdk/src/cmp/ocaml/ReadmeExamplesTest_ocaml.ts +29 -14
- package/project/.sdk/src/cmp/perl/Entity_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/MainEntity_perl.ts +2 -2
- package/project/.sdk/src/cmp/perl/Package_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -3
- package/project/.sdk/src/cmp/php/EntityTypes_php.ts +2 -3
- package/project/.sdk/src/cmp/php/Entity_php.ts +3 -3
- package/project/.sdk/src/cmp/php/MainEntity_php.ts +2 -2
- package/project/.sdk/src/cmp/php/Package_php.ts +1 -1
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -3
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +1 -1
- package/project/.sdk/src/cmp/py/EntityTypes_py.ts +2 -3
- package/project/.sdk/src/cmp/py/Entity_py.ts +3 -3
- package/project/.sdk/src/cmp/py/MainEntity_py.ts +2 -2
- package/project/.sdk/src/cmp/py/Main_py.ts +2 -2
- package/project/.sdk/src/cmp/py/Package_py.ts +1 -1
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -3
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +1 -1
- package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +15 -5
- package/project/.sdk/src/cmp/rb/Entity_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +2 -2
- package/project/.sdk/src/cmp/rb/Package_rb.ts +2 -2
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +1 -1
- package/project/.sdk/src/cmp/rust/EntityBase_rust.ts +2 -2
- package/project/.sdk/src/cmp/rust/EntityTypes_rust.ts +3 -4
- package/project/.sdk/src/cmp/rust/Entity_rust.ts +3 -3
- package/project/.sdk/src/cmp/rust/MainEntity_rust.ts +2 -2
- package/project/.sdk/src/cmp/rust/Package_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/ReadmeExamplesTest_rust.ts +22 -10
- package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -3
- package/project/.sdk/src/cmp/scala/EntityTypes_scala.ts +2 -3
- package/project/.sdk/src/cmp/scala/Entity_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/MainEntity_scala.ts +2 -2
- package/project/.sdk/src/cmp/scala/ReadmeExamplesTest_scala.ts +22 -3
- package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/Test_scala.ts +1 -1
- package/project/.sdk/src/cmp/swift/EntityTypes_swift.ts +3 -4
- package/project/.sdk/src/cmp/swift/Entity_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/MainEntity_swift.ts +2 -2
- package/project/.sdk/src/cmp/swift/Package_swift.ts +1 -1
- package/project/.sdk/src/cmp/swift/ReadmeExamplesTest_swift.ts +18 -1
- package/project/.sdk/src/cmp/swift/TestDirect_swift.ts +1 -1
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +2 -3
- package/project/.sdk/src/cmp/ts/Entity_ts.ts +3 -3
- package/project/.sdk/src/cmp/ts/MainEntity_ts.ts +2 -2
- package/project/.sdk/src/cmp/ts/Main_ts.ts +2 -2
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +4 -4
- package/project/.sdk/src/cmp/zig/Entity_zig.ts +3 -3
- package/project/.sdk/src/cmp/zig/MainEntity_zig.ts +2 -2
- package/project/.sdk/src/cmp/zig/Package_zig.ts +10 -2
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +8 -16
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +10 -28
- package/project/.sdk/tm/dart/test/primary_test.dart +7 -0
- package/project/.sdk/tm/go/feature/test_feature.go +33 -1
- package/project/.sdk/tm/go/test/primary_utility_test.go +41 -42
- package/project/.sdk/tm/go/test/runner_test.go +30 -1
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +7 -24
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +18 -1
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +8 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +7 -20
- package/project/.sdk/tm/lean/LICENSE +21 -0
- package/project/.sdk/tm/lean/VERSION +1 -0
- package/project/.sdk/tm/lean/src/SdkFeature.lean +171 -0
- package/project/.sdk/tm/lean/src/SdkFeatures.lean +602 -0
- package/project/.sdk/tm/lean/src/SdkJson.lean +134 -0
- package/project/.sdk/tm/lean/src/SdkRuntime.lean +356 -0
- package/project/.sdk/tm/lean/src/SdkUtility.lean +617 -0
- package/project/.sdk/tm/lean/src/VoxgigStruct.lean +2880 -0
- package/project/.sdk/tm/lean/src/Vregex.lean +412 -0
- package/project/.sdk/tm/lean/src/feature/README.md +5 -0
- package/project/.sdk/tm/lean/src/feature/audit/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/cache/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/clienttrack/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/debug/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/idempotency/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/log/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/metrics/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/netsim/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/paging/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/proxy/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/ratelimit/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/rbac/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/retry/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/streaming/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/telemetry/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/lean/src/feature/timeout/.gitkeep +0 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +697 -0
- package/project/.sdk/tm/lean/test/TFeature.lean +268 -0
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +349 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +10 -8
- package/project/.sdk/tm/perl/t/primary_utility.t +8 -17
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +9 -7
- package/project/.sdk/tm/py/feature/test_feature.py +28 -1
- package/project/.sdk/tm/py/test/test_primary_utility.py +13 -18
- package/project/.sdk/tm/rb/feature/test_feature.rb +24 -1
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +7 -8
- package/project/.sdk/tm/rust/tests/common/mod.rs +37 -1
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +12 -26
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +7 -8
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +18 -1
- package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +65 -21
- package/src/cmp/Entity.ts +5 -1
- package/src/cmp/Feature.ts +2 -1
- package/src/helpers/canonType.ts +8 -3
- package/src/helpers/collectDeps.ts +39 -12
- package/src/helpers/naming.ts +59 -0
- package/src/helpers/opShape.ts +99 -12
- package/src/sdkgen.ts +7 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
# Go CLI target — a Go program that *consumes* the sibling Go SDK
|
|
3
|
+
# (generated by the `go` target into the same SDK repo). It is not a
|
|
4
|
+
# language SDK in its own right, so the standard per-entity /
|
|
5
|
+
# per-feature / readme / test generation phases are switched off via
|
|
6
|
+
# the `phase` map below.
|
|
7
7
|
|
|
8
8
|
main: kit: target: 'go-cli': {
|
|
9
9
|
|
|
@@ -12,12 +12,12 @@ main: kit: target: 'go-cli': {
|
|
|
12
12
|
comment: line: "//"
|
|
13
13
|
module: name: '$$name$$'
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
# Per-generation-phase activation. Mirrors the feature pattern
|
|
16
|
+
# (`main.kit.feature.<name>: { active: true }`). Root.ts inspects
|
|
17
|
+
# `target.phase.<name>.active` — defaults to true (active) when
|
|
18
|
+
# the entry is missing, so existing standard targets need no
|
|
19
|
+
# changes. A CLI-style target switches the standard phases off
|
|
20
|
+
# and runs only Main.
|
|
21
21
|
phase: {
|
|
22
22
|
entity: { active: false }
|
|
23
23
|
feature: { active: false }
|
|
@@ -26,16 +26,16 @@ main: kit: target: 'go-cli': {
|
|
|
26
26
|
test: { active: false }
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
# No external module deps declared here; the generated go.mod uses
|
|
30
|
+
# a relative replace to the sibling SDK at ../go and (until
|
|
31
|
+
# aql/eng is published with a subdir tag) a local replace for the
|
|
32
|
+
# AQL engine. See Main_go-cli.ts.
|
|
33
33
|
deps: {}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
# Feature-deps map slot — every target carries this so the same
|
|
38
|
+
# feature can specify per-target dep variants.
|
|
39
39
|
main: kit: feature: &: target: 'go-cli': deps: &: {
|
|
40
40
|
kind: *'prod' | string
|
|
41
41
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
# Go MCP server target — a Go program that *consumes* the sibling Go
|
|
3
|
+
# SDK and exposes it as MCP tools. Like go-cli, it is not a language
|
|
4
|
+
# SDK in its own right, so the standard per-entity / per-feature /
|
|
5
|
+
# readme / test generation phases are switched off via the `phase`
|
|
6
|
+
# map below.
|
|
7
7
|
|
|
8
8
|
main: kit: target: 'go-mcp': {
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ main: kit: target: 'go-mcp': {
|
|
|
12
12
|
comment: line: "//"
|
|
13
13
|
module: name: '$$name$$'
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
# Per-generation-phase activation. Mirrors go-cli — only Main runs.
|
|
16
16
|
phase: {
|
|
17
17
|
entity: { active: false }
|
|
18
18
|
feature: { active: false }
|
|
@@ -21,15 +21,15 @@ main: kit: target: 'go-mcp': {
|
|
|
21
21
|
test: { active: false }
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
# No external module deps declared here. The generated go.mod uses
|
|
25
|
+
# a relative replace to the sibling SDK at ../go and declares the
|
|
26
|
+
# MCP Go SDK as a direct dep. See Main_go-mcp.ts.
|
|
27
27
|
deps: {}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
# Feature-deps map slot — every target carries this so the same
|
|
32
|
+
# feature can specify per-target dep variants.
|
|
33
33
|
main: kit: feature: &: target: 'go-mcp': deps: &: {
|
|
34
34
|
kind: *'prod' | string
|
|
35
35
|
}
|
|
@@ -10,10 +10,10 @@ main: kit: target: java: {
|
|
|
10
10
|
kind: *'prod' | string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
# struct is inlined under utility/struct — no external runtime dep.
|
|
14
|
+
# JSON parsing is the zero-dep utility/Json.java; HTTP transport is
|
|
15
|
+
# java.net.http.HttpClient (JDK built-in). Tests need only JUnit,
|
|
16
|
+
# declared directly in the generated pom.xml (test scope).
|
|
17
17
|
deps: {}
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -10,10 +10,10 @@ main: kit: target: kotlin: {
|
|
|
10
10
|
kind: *'prod' | string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
# struct is inlined under utility/struct — no external runtime dep.
|
|
14
|
+
# JSON parsing is the zero-dep utility/Json.kt; HTTP transport is
|
|
15
|
+
# java.net.http.HttpClient (JDK built-in). Tests need only JUnit,
|
|
16
|
+
# declared directly in the generated build.gradle.kts (test scope).
|
|
17
17
|
deps: {}
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
main: kit: target: lean: {
|
|
3
|
+
|
|
4
|
+
title: Lean
|
|
5
|
+
ext: lean
|
|
6
|
+
comment: line: "--"
|
|
7
|
+
module: name: '$$name$$'
|
|
8
|
+
srcfeature: false
|
|
9
|
+
|
|
10
|
+
# Entities are generic (config-driven F.makeEntity), so no per-entity or
|
|
11
|
+
# per-feature generated modules — the same model as the Haskell target. The
|
|
12
|
+
# readme + agentguide phases read the API model directly (not per-entity
|
|
13
|
+
# generated code), so they are active; entity/feature generation stays off.
|
|
14
|
+
phase: {
|
|
15
|
+
entity: { active: false }
|
|
16
|
+
feature: { active: false }
|
|
17
|
+
readme: { active: true }
|
|
18
|
+
agentguide: { active: true }
|
|
19
|
+
test: { active: true }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
deps: &: {
|
|
23
|
+
kind: *'prod' | string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
# struct is vendored under src/ (VoxgigStruct.lean + Vregex.lean) and the
|
|
27
|
+
# runtime is dependency-free: it compiles with the stock Lean 4 toolchain
|
|
28
|
+
# (only the built-in prelude + Std), no Lake package dependencies. The HTTP
|
|
29
|
+
# transport shells out to `curl` via IO.Process, so there are no manifest
|
|
30
|
+
# deps.
|
|
31
|
+
deps: {}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
main: kit: feature: &: target: lean: deps: &: {
|
|
36
|
+
kind: *'prod' | string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# Publication: Reservoir (Lean package index) — declared, publish pending
|
|
41
|
+
# (git-tag only for now).
|
|
42
|
+
main: kit: target: lean: publish: {
|
|
43
|
+
tag: { active: true }
|
|
44
|
+
registry: {
|
|
45
|
+
state: 'pending'
|
|
46
|
+
active: false
|
|
47
|
+
name: 'reservoir'
|
|
48
|
+
url: 'https://reservoir.lean-lang.org'
|
|
49
|
+
vault: { alias: 'reservoir', env: 'RESERVOIR_TOKEN' }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -10,10 +10,10 @@ main: kit: target: scala: {
|
|
|
10
10
|
kind: *'prod' | string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
# struct is inlined under utility/struct — no external runtime dep.
|
|
14
|
+
# JSON parsing is the zero-dep utility/Json.java; HTTP transport is
|
|
15
|
+
# java.net.http.HttpClient (JDK built-in). The corpus runner and pipeline
|
|
16
|
+
# tests are plain scala-cli mains (no test-framework dependency).
|
|
17
17
|
deps: {}
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
// <Name>RemoveMatch.
|
|
29
29
|
|
|
30
30
|
import {
|
|
31
|
-
cmp, each,
|
|
31
|
+
cmp, each,
|
|
32
32
|
File, Content, Folder,
|
|
33
33
|
} from '@voxgig/sdkgen'
|
|
34
34
|
|
|
35
|
-
import { canonToType, opTypeName, opRequestShape, warnEntityTypeCollisions } from '@voxgig/sdkgen'
|
|
35
|
+
import { canonToType, opTypeName, opRequestShape, warnEntityTypeCollisions , deriveEntityNames } from '@voxgig/sdkgen'
|
|
36
36
|
|
|
37
37
|
import {
|
|
38
38
|
KIT,
|
|
@@ -93,8 +93,7 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
|
93
93
|
// Emit for every entity that gets an entity file (filter on `name`, always
|
|
94
94
|
// present; derive `Name` here so the struct set is deterministic — parity
|
|
95
95
|
// with the go/rust emitters' fix).
|
|
96
|
-
const entityList =
|
|
97
|
-
entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
|
|
96
|
+
const entityList = deriveEntityNames(entity)
|
|
98
97
|
|
|
99
98
|
// Surface duplicate generated type names (two entities with the same
|
|
100
99
|
// PascalCase Name) — they would redeclare a type in statically-typed
|
|
@@ -4,7 +4,7 @@ import * as Path from 'node:path'
|
|
|
4
4
|
import {
|
|
5
5
|
cmp, camelify,
|
|
6
6
|
File, Content, Folder, Fragment,
|
|
7
|
-
entityClassName,
|
|
7
|
+
entityClassName, entityCollection,
|
|
8
8
|
} from '@voxgig/sdkgen'
|
|
9
9
|
|
|
10
10
|
import {
|
|
@@ -20,7 +20,7 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
20
20
|
const { model, stdrep } = props.ctx$
|
|
21
21
|
const { target, entity } = props
|
|
22
22
|
|
|
23
|
-
const entityColl =
|
|
23
|
+
const entityColl = entityCollection(model)
|
|
24
24
|
const cls = entityClassName(entity, entityColl)
|
|
25
25
|
const evar = cVarName(entity.name)
|
|
26
26
|
|
|
@@ -34,7 +34,7 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
34
34
|
|
|
35
35
|
File({ name: evar + '.c' }, () => {
|
|
36
36
|
|
|
37
|
-
const opnames = Object.keys(entity.op)
|
|
37
|
+
const opnames = Object.keys(entity.op || {})
|
|
38
38
|
|
|
39
39
|
// For each CRUD op: splice the real implementation when the spec
|
|
40
40
|
// defines it, otherwise emit a stub that errors at runtime (so the
|
|
@@ -67,22 +67,31 @@ static void ltrim_eq_buf(const char* start, const char* end, char* out, size_t c
|
|
|
67
67
|
out[len] = '\\0';
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
// Balanced (), [], {} outside of string literals
|
|
71
|
-
//
|
|
70
|
+
// Balanced (), [], {} outside of string literals, with each closer matching
|
|
71
|
+
// the most-recent opener (so "([)]" is rejected, not just counted). Naive
|
|
72
|
+
// quote toggle: the generated snippets never embed an escaped quote inside a
|
|
73
|
+
// string.
|
|
72
74
|
static int is_balanced(const char* block, size_t len) {
|
|
73
75
|
int in_str = 0;
|
|
74
|
-
|
|
76
|
+
// Depth can never exceed len; a per-call heap stack keeps this reentrant.
|
|
77
|
+
char* stack = (char*)malloc(len + 1);
|
|
78
|
+
if (!stack) return 0;
|
|
79
|
+
size_t top = 0;
|
|
75
80
|
for (size_t i = 0; i < len; i++) {
|
|
76
81
|
char c = block[i];
|
|
77
82
|
if (c == '"') { in_str = !in_str; continue; }
|
|
78
83
|
if (in_str) continue;
|
|
79
|
-
if (c == '('
|
|
84
|
+
if (c == '(') stack[top++] = ')';
|
|
85
|
+
else if (c == '[') stack[top++] = ']';
|
|
86
|
+
else if (c == '{') stack[top++] = '}';
|
|
80
87
|
else if (c == ')' || c == ']' || c == '}') {
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
if (top == 0 || stack[top - 1] != c) { free(stack); return 0; }
|
|
89
|
+
top--;
|
|
83
90
|
}
|
|
84
91
|
}
|
|
85
|
-
|
|
92
|
+
int ok = (top == 0 && !in_str);
|
|
93
|
+
free(stack);
|
|
94
|
+
return ok;
|
|
86
95
|
}
|
|
87
96
|
|
|
88
97
|
// Scan one doc: for every \`\`\`c ... \`\`\` block, check non-empty + balanced.
|
|
@@ -126,6 +135,14 @@ static int check_doc(const char* label, const char* path) {
|
|
|
126
135
|
p = nl + 1;
|
|
127
136
|
}
|
|
128
137
|
|
|
138
|
+
// A fence opened but never closed is a malformed doc — fail rather than
|
|
139
|
+
// silently skipping the unterminated block.
|
|
140
|
+
{
|
|
141
|
+
char msg[128];
|
|
142
|
+
snprintf(msg, sizeof(msg), "%s: c fence closed", label);
|
|
143
|
+
CHECK(!in_block, msg);
|
|
144
|
+
}
|
|
145
|
+
|
|
129
146
|
free(src);
|
|
130
147
|
return blocks;
|
|
131
148
|
}
|
|
@@ -64,15 +64,15 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
64
64
|
const evar = cVarName(entity.name)
|
|
65
65
|
const Name = model.const.Name
|
|
66
66
|
|
|
67
|
-
const opnames = Object.keys(entity.op)
|
|
67
|
+
const opnames = Object.keys(entity.op || {})
|
|
68
68
|
const hasLoad = opnames.includes('load')
|
|
69
69
|
const hasList = opnames.includes('list')
|
|
70
70
|
if (!hasLoad && !hasList) {
|
|
71
71
|
return
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
const loadOp = (entity.op as any)
|
|
75
|
-
const listOp = (entity.op as any)
|
|
74
|
+
const loadOp = (entity.op as any)?.load
|
|
75
|
+
const listOp = (entity.op as any)?.list
|
|
76
76
|
|
|
77
77
|
const loadPoint = loadOp?.points?.[0]
|
|
78
78
|
const loadPath = loadPoint ? normalizePathParams(loadPoint.parts || [], loadPoint?.args?.params || [], loadPoint?.rename?.param) : ''
|
|
@@ -44,7 +44,7 @@ int main(void) {
|
|
|
44
44
|
// The stream test drives the list op; only emit it when the entity has a
|
|
45
45
|
// list op — a create/load-only entity has no list endpoint, so
|
|
46
46
|
// stream("list") would error.
|
|
47
|
-
const hasList = null != (entity.op && (entity.op as any)
|
|
47
|
+
const hasList = null != (entity.op && (entity.op as any)?.list)
|
|
48
48
|
if (hasList) {
|
|
49
49
|
Content(`
|
|
50
50
|
// stream(): runs the list op through the full pipeline and returns a List
|
|
@@ -31,7 +31,7 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
31
31
|
|
|
32
32
|
File({ name: entity.name + '.' + target.ext }, () => {
|
|
33
33
|
|
|
34
|
-
const opnames = Object.keys(entity.op)
|
|
34
|
+
const opnames = Object.keys(entity.op || {})
|
|
35
35
|
|
|
36
36
|
// For each CRUD op: splice the real implementation when the spec
|
|
37
37
|
// defines it; otherwise leave the slot empty (the fn is simply not
|
|
@@ -20,9 +20,10 @@ import { cmp, Content } from '@voxgig/sdkgen'
|
|
|
20
20
|
// TS template literal needs no embedded backticks.
|
|
21
21
|
const ReadmeExamplesTest = cmp(function ReadmeExamplesTest(_props: any) {
|
|
22
22
|
|
|
23
|
-
Content(` (letfn [(
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
Content(` (letfn [(fence-pat [] (re-pattern (apply str (repeat 3 (char 96)))))
|
|
24
|
+
(fence-count [text] (count (re-seq (fence-pat) text)))
|
|
25
|
+
(clj-blocks [text]
|
|
26
|
+
(let [parts (clojure.string/split text (fence-pat))]
|
|
26
27
|
(->> parts
|
|
27
28
|
(map-indexed vector)
|
|
28
29
|
(filter (fn [[i _]] (odd? i)))
|
|
@@ -40,11 +41,21 @@ const ReadmeExamplesTest = cmp(function ReadmeExamplesTest(_props: any) {
|
|
|
40
41
|
(fn []
|
|
41
42
|
(if-not (.exists (java.io.File. ^String path))
|
|
42
43
|
(t/is-true true (str label " absent (skipped)"))
|
|
43
|
-
(let [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
(let [text (slurp path)]
|
|
45
|
+
;; A code fence opened but never closed leaves an ODD number of
|
|
46
|
+
;; fence markers; the split-on-fence then captures the trailing
|
|
47
|
+
;; prose (everything after the last opener) as if it were a
|
|
48
|
+
;; clojure block, which can parse cleanly and pass silently. Fail
|
|
49
|
+
;; on the malformed doc instead. (Count markers directly rather
|
|
50
|
+
;; than split parts: split drops trailing empty segments, so a
|
|
51
|
+
;; closing fence at EOF would be miscounted.)
|
|
52
|
+
(t/is-true (even? (fence-count text))
|
|
53
|
+
(str label " code fences balanced (no unclosed fence)"))
|
|
54
|
+
(let [blocks (clj-blocks text)]
|
|
55
|
+
(doseq [b blocks]
|
|
56
|
+
(binding [*read-eval* false]
|
|
57
|
+
(read-string (str "[\\n" b "\\n]"))))
|
|
58
|
+
(t/is-true true (str label " clojure blocks parse cleanly")))))))))
|
|
48
59
|
`)
|
|
49
60
|
})
|
|
50
61
|
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
cmp, each, names,
|
|
28
28
|
File, Content,
|
|
29
29
|
canonToType, opTypeName, opRequestShape, warnEntityTypeCollisions,
|
|
30
|
+
deriveEntityNames,
|
|
30
31
|
} from '@voxgig/sdkgen'
|
|
31
32
|
|
|
32
33
|
import {
|
|
@@ -99,9 +100,8 @@ const EntityTypes = cmp(function EntityTypes(props: any) {
|
|
|
99
100
|
// filter, so inactive entities still get class files referencing these
|
|
100
101
|
// typed names. Filter on `name` (always present), NOT `active` — parity
|
|
101
102
|
// with the go emitter's fix.
|
|
102
|
-
const entityList =
|
|
103
|
+
const entityList = deriveEntityNames(entity)
|
|
103
104
|
// Derive the PascalCase Name up-front — it is set LAZILY by names().
|
|
104
|
-
entityList.forEach((e: any) => { if (null == e.Name) names(e, e.name) })
|
|
105
105
|
|
|
106
106
|
// Surface duplicate generated type names (two entities with the same
|
|
107
107
|
// PascalCase Name) — they would redeclare a type in statically-typed
|
|
@@ -4,7 +4,7 @@ import * as Path from 'node:path'
|
|
|
4
4
|
import {
|
|
5
5
|
cmp, camelify,
|
|
6
6
|
File, Content, Folder, Fragment,
|
|
7
|
-
entityClassName,
|
|
7
|
+
entityClassName, entityCollection,
|
|
8
8
|
} from '@voxgig/sdkgen'
|
|
9
9
|
|
|
10
10
|
import {
|
|
@@ -20,7 +20,7 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
20
20
|
const { model, stdrep } = props.ctx$
|
|
21
21
|
const { target, entity } = props
|
|
22
22
|
|
|
23
|
-
const entityColl =
|
|
23
|
+
const entityColl = entityCollection(model)
|
|
24
24
|
const cls = entityClassName(entity, entityColl)
|
|
25
25
|
|
|
26
26
|
const entrep = {
|
|
@@ -33,7 +33,7 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
33
33
|
|
|
34
34
|
File({ name: cppVarName(entity.name) + '.' + target.ext }, () => {
|
|
35
35
|
|
|
36
|
-
const opnames = Object.keys(entity.op)
|
|
36
|
+
const opnames = Object.keys(entity.op || {})
|
|
37
37
|
|
|
38
38
|
// For each CRUD op: splice the real method if the spec defines it, else
|
|
39
39
|
// a stub that satisfies the SdkEntity interface but throws at runtime.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, entityClassName } from '@voxgig/sdkgen'
|
|
2
|
+
import { cmp, Content, entityClassName, entityCollection } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -16,7 +16,7 @@ const MainEntity = cmp(async function MainEntity(props: any) {
|
|
|
16
16
|
const { entity } = props
|
|
17
17
|
const { model } = props.ctx$
|
|
18
18
|
|
|
19
|
-
const entityColl =
|
|
19
|
+
const entityColl = entityCollection(model)
|
|
20
20
|
const cls = entityClassName(entity, entityColl)
|
|
21
21
|
const accessor = cppVarName(entity.name)
|
|
22
22
|
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
|
|
2
|
+
import { cmp, Content, File } from '@voxgig/sdkgen'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// Emits test/readme_examples_test.cpp — a structural gate over every ```cpp
|
|
6
|
+
// fenced block in the docs that ship C++ examples:
|
|
7
|
+
// - the root README.md (top-level, multi-language quick start)
|
|
8
|
+
// - the per-language cpp/README.md
|
|
9
|
+
// - the per-language cpp/REFERENCE.md
|
|
10
|
+
//
|
|
11
|
+
// DESIGN NOTE (mirrors ReadmeExamplesTest_c): the go gate shells out to
|
|
12
|
+
// `go build`/`go run` to COMPILE and RUN every block. A faithful C++ port
|
|
13
|
+
// would extract each snippet, wrap it in a translation unit, and drive the
|
|
14
|
+
// bundled Makefile / c++ against the header-only runtime — a large,
|
|
15
|
+
// environment-sensitive harness that cannot be authored safely here. This gate
|
|
16
|
+
// instead validates that every documented C++ block is PRESENT and
|
|
17
|
+
// STRUCTURALLY well-formed (balanced ()[]{}, non-empty). It is a real,
|
|
18
|
+
// always-passing test that keeps the docs honest about block structure;
|
|
19
|
+
// upgrading it to a true compile gate is left as a follow-up. Missing docs are
|
|
20
|
+
// tolerated (a run may generate a subset of phases).
|
|
21
|
+
//
|
|
22
|
+
// The test binary runs with the C++ project root as its working directory, so
|
|
23
|
+
// the doc paths resolve as "README.md", "REFERENCE.md", and "../README.md".
|
|
24
|
+
const ReadmeExamplesTest = cmp(function ReadmeExamplesTest(props: any) {
|
|
25
|
+
const { model } = props.ctx$
|
|
26
|
+
|
|
27
|
+
File({ name: 'readme_examples_test.cpp' }, () => {
|
|
28
|
+
Content(`// Structural gate over every \`\`\`cpp block in the ${model.const.Name} SDK docs
|
|
29
|
+
// (root README.md, cpp/README.md, cpp/REFERENCE.md). Generated by
|
|
30
|
+
// @voxgig/sdkgen — do not edit by hand.
|
|
31
|
+
//
|
|
32
|
+
// Validates that each documented C++ block is present, non-empty, and has
|
|
33
|
+
// balanced delimiters. Missing docs are tolerated. See ReadmeExamplesTest_cpp
|
|
34
|
+
// for why this is a structural gate rather than a full compile harness.
|
|
35
|
+
|
|
36
|
+
#include "testlib.hpp"
|
|
37
|
+
|
|
38
|
+
#include <fstream>
|
|
39
|
+
#include <sstream>
|
|
40
|
+
#include <string>
|
|
41
|
+
#include <vector>
|
|
42
|
+
|
|
43
|
+
using namespace sdk;
|
|
44
|
+
|
|
45
|
+
// Read an entire file into a string, or "" if absent.
|
|
46
|
+
static std::string read_file(const std::string& path) {
|
|
47
|
+
std::ifstream f(path, std::ios::binary);
|
|
48
|
+
if (!f) return std::string();
|
|
49
|
+
std::ostringstream ss;
|
|
50
|
+
ss << f.rdbuf();
|
|
51
|
+
return ss.str();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Trim leading/trailing whitespace (fence lines are short).
|
|
55
|
+
static std::string trim(const std::string& s) {
|
|
56
|
+
size_t a = s.find_first_not_of(" \\t\\r\\n");
|
|
57
|
+
if (a == std::string::npos) return std::string();
|
|
58
|
+
size_t b = s.find_last_not_of(" \\t\\r\\n");
|
|
59
|
+
return s.substr(a, b - a + 1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Balanced (), [], {} outside of string literals, with each closer matching
|
|
63
|
+
// the most-recent opener (so "([)]" is rejected, not just counted). Naive
|
|
64
|
+
// quote toggle: the generated snippets never embed an escaped quote inside a
|
|
65
|
+
// string.
|
|
66
|
+
static bool is_balanced(const std::string& block) {
|
|
67
|
+
bool in_str = false;
|
|
68
|
+
std::vector<char> stack;
|
|
69
|
+
for (char c : block) {
|
|
70
|
+
if (c == '"') { in_str = !in_str; continue; }
|
|
71
|
+
if (in_str) continue;
|
|
72
|
+
if (c == '(') stack.push_back(')');
|
|
73
|
+
else if (c == '[') stack.push_back(']');
|
|
74
|
+
else if (c == '{') stack.push_back('}');
|
|
75
|
+
else if (c == ')' || c == ']' || c == '}') {
|
|
76
|
+
if (stack.empty() || stack.back() != c) return false;
|
|
77
|
+
stack.pop_back();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return stack.empty() && !in_str;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Scan one doc: for every \`\`\`cpp ... \`\`\` block, check non-empty + balanced.
|
|
84
|
+
// Returns the number of blocks seen (0 if the file is absent).
|
|
85
|
+
static int check_doc(const std::string& label, const std::string& path) {
|
|
86
|
+
std::string src = read_file(path);
|
|
87
|
+
if (src.empty()) return 0; // doc not generated in this run — tolerate
|
|
88
|
+
|
|
89
|
+
int blocks = 0;
|
|
90
|
+
bool in_block = false;
|
|
91
|
+
std::string block;
|
|
92
|
+
std::istringstream in(src);
|
|
93
|
+
std::string line;
|
|
94
|
+
while (std::getline(in, line)) {
|
|
95
|
+
std::string t = trim(line);
|
|
96
|
+
if (!in_block) {
|
|
97
|
+
if (t == "\`\`\`cpp") { in_block = true; block.clear(); }
|
|
98
|
+
} else if (t == "\`\`\`") {
|
|
99
|
+
std::string body = trim(block);
|
|
100
|
+
ASSERT_TRUE(!body.empty(), label + ": cpp block " + std::to_string(blocks + 1) + " non-empty");
|
|
101
|
+
ASSERT_TRUE(is_balanced(body), label + ": cpp block " + std::to_string(blocks + 1) + " balanced");
|
|
102
|
+
blocks++;
|
|
103
|
+
in_block = false;
|
|
104
|
+
} else {
|
|
105
|
+
block += line;
|
|
106
|
+
block += '\\n';
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// A fence opened but never closed is a malformed doc — fail rather than
|
|
110
|
+
// silently skipping the unterminated block.
|
|
111
|
+
ASSERT_TRUE(!in_block, label + ": cpp fence closed");
|
|
112
|
+
return blocks;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static void readme_examples_gate() {
|
|
116
|
+
int total = 0;
|
|
117
|
+
total += check_doc("root README", "../README.md");
|
|
118
|
+
total += check_doc("cpp/README", "README.md");
|
|
119
|
+
total += check_doc("cpp/REFERENCE", "REFERENCE.md");
|
|
120
|
+
// Missing docs are tolerated (a run may generate a subset of phases), so a
|
|
121
|
+
// zero total is not a failure — the per-block checks above carry the gate.
|
|
122
|
+
std::printf("readme_examples: scanned %d cpp block(s)\\n", total);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
int main() {
|
|
126
|
+
T_RUN(readme_examples_gate);
|
|
127
|
+
return sdktest::summary("readme_examples_test");
|
|
128
|
+
}
|
|
129
|
+
`)
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
export {
|
|
135
|
+
ReadmeExamplesTest
|
|
136
|
+
}
|
|
@@ -60,15 +60,15 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
60
60
|
|
|
61
61
|
const ProjectName = model.const.Name
|
|
62
62
|
|
|
63
|
-
const opnames = Object.keys(entity.op)
|
|
63
|
+
const opnames = Object.keys(entity.op || {})
|
|
64
64
|
const hasLoad = opnames.includes('load')
|
|
65
65
|
const hasList = opnames.includes('list')
|
|
66
66
|
if (!hasLoad && !hasList) {
|
|
67
67
|
return
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
const loadOp = (entity.op as any)
|
|
71
|
-
const listOp = (entity.op as any)
|
|
70
|
+
const loadOp = (entity.op as any)?.load
|
|
71
|
+
const listOp = (entity.op as any)?.list
|
|
72
72
|
|
|
73
73
|
const loadPoint = loadOp?.points?.[0]
|
|
74
74
|
const loadPath = loadPoint ? normalizePathParams(loadPoint.parts || [], loadPoint?.args?.params || [], loadPoint?.rename?.param) : ''
|
|
@@ -13,6 +13,7 @@ import { cmp, each, Folder } from '@voxgig/sdkgen'
|
|
|
13
13
|
|
|
14
14
|
import { TestEntity } from './TestEntity_cpp'
|
|
15
15
|
import { TestDirect } from './TestDirect_cpp'
|
|
16
|
+
import { ReadmeExamplesTest } from './ReadmeExamplesTest_cpp'
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
const Test = cmp(function Test(props: any) {
|
|
@@ -27,6 +28,9 @@ const Test = cmp(function Test(props: any) {
|
|
|
27
28
|
TestEntity({ target, entity })
|
|
28
29
|
TestDirect({ target, entity })
|
|
29
30
|
})
|
|
31
|
+
|
|
32
|
+
// Validate the documented C++ examples in the READMEs are well-formed.
|
|
33
|
+
ReadmeExamplesTest({ target })
|
|
30
34
|
})
|
|
31
35
|
})
|
|
32
36
|
|