@voxgig/sdkgen 2.0.2 → 3.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/bin/voxgig-sdkgen +22 -2
- package/dist/action/doctor.d.ts +14 -0
- package/dist/action/doctor.js +351 -0
- package/dist/action/doctor.js.map +1 -0
- package/dist/action/feature.js +48 -9
- package/dist/action/feature.js.map +1 -1
- package/dist/action/target.d.ts +6 -1
- package/dist/action/target.js +134 -22
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/Entity.js +5 -0
- package/dist/cmp/Entity.js.map +1 -1
- package/dist/cmp/ExternalTarget.d.ts +2 -0
- package/dist/cmp/ExternalTarget.js +104 -0
- package/dist/cmp/ExternalTarget.js.map +1 -0
- package/dist/cmp/Feature.js +2 -1
- package/dist/cmp/Feature.js.map +1 -1
- package/dist/cmp/Main.js +5 -1
- package/dist/cmp/Main.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.js +1 -1
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +16 -6
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/cmp/Registered.d.ts +7 -0
- package/dist/cmp/Registered.js +70 -0
- package/dist/cmp/Registered.js.map +1 -0
- package/dist/cmp/Test.js +3 -1
- package/dist/cmp/Test.js.map +1 -1
- package/dist/helpers/dryrun.d.ts +10 -0
- package/dist/helpers/dryrun.js +35 -0
- package/dist/helpers/dryrun.js.map +1 -0
- package/dist/helpers/featureSource.d.ts +13 -0
- package/dist/helpers/featureSource.js +156 -0
- package/dist/helpers/featureSource.js.map +1 -0
- package/dist/helpers/naming.d.ts +9 -1
- package/dist/helpers/naming.js +66 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/helpers/opExample.js +23 -3
- package/dist/helpers/opExample.js.map +1 -1
- package/dist/helpers/opShape.d.ts +11 -1
- package/dist/helpers/opShape.js +51 -0
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/helpers/packageMeta.d.ts +16 -1
- package/dist/helpers/packageMeta.js +181 -10
- package/dist/helpers/packageMeta.js.map +1 -1
- package/dist/helpers/stdrep.d.ts +3 -0
- package/dist/helpers/stdrep.js +47 -0
- package/dist/helpers/stdrep.js.map +1 -0
- package/dist/helpers/testPolicy.d.ts +2 -0
- package/dist/helpers/testPolicy.js +46 -0
- package/dist/helpers/testPolicy.js.map +1 -0
- package/dist/sdkgen.d.ts +15 -6
- package/dist/sdkgen.js +273 -5
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/utility.js +10 -1
- package/dist/utility.js.map +1 -1
- package/model/sdkgen.aontu +245 -0
- package/package.json +5 -3
- package/project/.sdk/model/target/c.aontu +28 -3
- package/project/.sdk/model/target/clojure.aontu +24 -3
- package/project/.sdk/model/target/cpp.aontu +25 -3
- package/project/.sdk/model/target/csharp.aontu +25 -3
- package/project/.sdk/model/target/dart.aontu +15 -3
- package/project/.sdk/model/target/elixir.aontu +15 -3
- package/project/.sdk/model/target/go-cli.aontu +16 -1
- package/project/.sdk/model/target/go-mcp.aontu +16 -1
- package/project/.sdk/model/target/go.aontu +14 -4
- package/project/.sdk/model/target/haskell.aontu +24 -3
- package/project/.sdk/model/target/java.aontu +25 -3
- package/project/.sdk/model/target/js.aontu +15 -3
- package/project/.sdk/model/target/kotlin.aontu +25 -3
- package/project/.sdk/model/target/lean.aontu +24 -3
- package/project/.sdk/model/target/lua.aontu +15 -3
- package/project/.sdk/model/target/ocaml.aontu +24 -3
- package/project/.sdk/model/target/perl.aontu +15 -3
- package/project/.sdk/model/target/php.aontu +15 -3
- package/project/.sdk/model/target/py-data.aontu +15 -3
- package/project/.sdk/model/target/py.aontu +15 -3
- package/project/.sdk/model/target/rb.aontu +15 -3
- package/project/.sdk/model/target/rust.aontu +25 -3
- package/project/.sdk/model/target/scala.aontu +24 -3
- package/project/.sdk/model/target/seneca-provider.aontu +118 -0
- package/project/.sdk/model/target/swift.aontu +25 -3
- package/project/.sdk/model/target/ts.aontu +15 -3
- package/project/.sdk/model/target/zig.aontu +25 -3
- package/project/.sdk/src/cmp/c/Config_c.ts +10 -11
- package/project/.sdk/src/cmp/c/Entity_c.ts +5 -1
- package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +23 -5
- package/project/.sdk/src/cmp/c/fragment/EntityCreateOp.fragment.c +9 -2
- package/project/.sdk/src/cmp/c/fragment/EntityListOp.fragment.c +19 -2
- package/project/.sdk/src/cmp/c/fragment/EntityLoadOp.fragment.c +9 -2
- package/project/.sdk/src/cmp/c/fragment/EntityRemoveOp.fragment.c +12 -2
- package/project/.sdk/src/cmp/c/fragment/EntityUpdateOp.fragment.c +9 -2
- package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +1 -0
- package/project/.sdk/src/cmp/clojure/TestEntity_clojure.ts +6 -3
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
- package/project/.sdk/src/cmp/clojure/fragment/EntityCreateOp.fragment.clj +2 -2
- package/project/.sdk/src/cmp/clojure/fragment/EntityLoadOp.fragment.clj +2 -2
- package/project/.sdk/src/cmp/clojure/fragment/EntityRemoveOp.fragment.clj +12 -8
- package/project/.sdk/src/cmp/clojure/fragment/EntityUpdateOp.fragment.clj +2 -2
- package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +5 -1
- package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +12 -9
- package/project/.sdk/src/cmp/cpp/fragment/EntityCreateOp.fragment.cpp +8 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityListOp.fragment.cpp +18 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityLoadOp.fragment.cpp +8 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityRemoveOp.fragment.cpp +11 -2
- package/project/.sdk/src/cmp/cpp/fragment/EntityUpdateOp.fragment.cpp +8 -2
- package/project/.sdk/src/cmp/csharp/Package_csharp.ts +2 -1
- package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +3 -3
- package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +6 -6
- package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +38 -1
- package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +42 -33
- package/project/.sdk/src/cmp/dart/Package_dart.ts +2 -1
- package/project/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +13 -2
- package/project/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +2 -1
- package/project/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +3 -3
- package/project/.sdk/src/cmp/dart/ReadmeModel_dart.ts +1 -1
- package/project/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +17 -6
- package/project/.sdk/src/cmp/dart/ReadmeRef_dart.ts +13 -2
- package/project/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +13 -2
- package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +3 -3
- package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +8 -8
- package/project/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +18 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +9 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +9 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +15 -1
- package/project/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +9 -1
- package/project/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +8 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +3 -1
- package/project/.sdk/src/cmp/elixir/ReadmeInstall_elixir.ts +2 -2
- package/project/.sdk/src/cmp/elixir/TestEntity_elixir.ts +11 -2
- package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +2 -1
- package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +1 -0
- package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +2 -1
- package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -1
- package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +2 -1
- package/project/.sdk/src/cmp/go/EntityTypes_go.ts +38 -8
- package/project/.sdk/src/cmp/go/Entity_go.ts +2 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +4 -5
- package/project/.sdk/src/cmp/go/Package_go.ts +8 -5
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +4 -2
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +2 -2
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +2 -2
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +21 -15
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +9 -9
- package/project/.sdk/src/cmp/go/Test_go.ts +2 -2
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -1
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +4 -4
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +4 -4
- package/project/.sdk/src/cmp/haskell/Package_haskell.ts +2 -1
- package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +10 -5
- package/project/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +10 -8
- package/project/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +14 -10
- package/project/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +21 -18
- package/project/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +4 -4
- package/project/.sdk/src/cmp/haskell/Test_haskell.ts +23 -11
- package/project/.sdk/src/cmp/java/Package_java.ts +2 -1
- package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +2 -1
- package/project/.sdk/src/cmp/java/ReadmeInstall_java.ts +2 -2
- package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +1 -1
- package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +3 -3
- package/project/.sdk/src/cmp/java/TestDirect_java.ts +3 -3
- package/project/.sdk/src/cmp/java/TestEntity_java.ts +6 -6
- package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +34 -1
- package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +12 -0
- package/project/.sdk/src/cmp/js/Main_js.ts +4 -1
- package/project/.sdk/src/cmp/js/Package_js.ts +7 -1
- package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -2
- package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +2 -1
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +13 -2
- package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +13 -2
- package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +2 -1
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +3 -3
- package/project/.sdk/src/cmp/js/TestEntity_js.ts +8 -8
- package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +22 -1
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +9 -1
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +9 -1
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +15 -1
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +9 -1
- package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +13 -0
- package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +2 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +2 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeInstall_kotlin.ts +2 -2
- package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +1 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +3 -3
- package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +6 -6
- package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +32 -1
- package/project/.sdk/src/cmp/lean/Package_lean.ts +3 -1
- package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +9 -4
- package/project/.sdk/src/cmp/lua/Package_lua.ts +4 -3
- package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +11 -3
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +1 -1
- package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -3
- package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +9 -9
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +37 -1
- package/project/.sdk/src/cmp/lua/fragment/SdkError.fragment.lua +12 -0
- package/project/.sdk/src/cmp/ocaml/EntityOperation_ocaml.ts +30 -3
- package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +11 -5
- package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +3 -1
- package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +10 -5
- package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +6 -2
- package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +10 -8
- package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +14 -13
- package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +20 -18
- package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -4
- package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +8 -2
- package/project/.sdk/src/cmp/ocaml/TestEntity_ocaml.ts +8 -5
- package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +2 -1
- package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +1 -1
- package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -3
- package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +6 -6
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +36 -1
- package/project/.sdk/src/cmp/php/MainEntity_php.ts +21 -16
- package/project/.sdk/src/cmp/php/Package_php.ts +2 -2
- package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +6 -6
- package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +4 -3
- package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +2 -2
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +12 -12
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +6 -6
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +4 -4
- package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +2 -2
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -3
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +17 -15
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +20 -1
- package/project/.sdk/src/cmp/php/fragment/SdkError.fragment.php +11 -0
- package/project/.sdk/src/cmp/py/Package_py.ts +4 -3
- package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +13 -2
- package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +2 -1
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +17 -6
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +14 -3
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +13 -2
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -3
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +9 -9
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +29 -1
- package/project/.sdk/src/cmp/py/fragment/SdkError.fragment.py +11 -0
- package/project/.sdk/src/cmp/py-data/Main_py-data.ts +2 -1
- package/project/.sdk/src/cmp/rb/Package_rb.ts +4 -3
- package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +2 -1
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +5 -5
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -3
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +9 -9
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +31 -1
- package/project/.sdk/src/cmp/rb/fragment/SdkError.fragment.rb +10 -1
- package/project/.sdk/src/cmp/rust/Entity_rust.ts +5 -1
- package/project/.sdk/src/cmp/rust/Main_rust.ts +21 -0
- package/project/.sdk/src/cmp/rust/Package_rust.ts +2 -1
- package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -3
- package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +12 -12
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +18 -0
- package/project/.sdk/src/cmp/rust/fragment/EntityCreateOp.fragment.rs +8 -2
- package/project/.sdk/src/cmp/rust/fragment/EntityListOp.fragment.rs +20 -3
- package/project/.sdk/src/cmp/rust/fragment/EntityLoadOp.fragment.rs +8 -2
- package/project/.sdk/src/cmp/rust/fragment/EntityRemoveOp.fragment.rs +10 -2
- package/project/.sdk/src/cmp/rust/fragment/EntityUpdateOp.fragment.rs +8 -2
- package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +10 -0
- package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +2 -1
- package/project/.sdk/src/cmp/scala/ReadmeInstall_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +1 -1
- package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +3 -3
- package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +27 -1
- package/project/.sdk/src/cmp/seneca-provider/Extras_seneca-provider.ts +3915 -0
- package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +960 -0
- package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +2 -1
- package/project/.sdk/src/cmp/swift/ReadmeInstall_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +1 -1
- package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +3 -3
- package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +34 -1
- package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +9 -1
- package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +18 -1
- package/project/.sdk/src/cmp/ts/Gitignore_ts.ts +5 -2
- package/project/.sdk/src/cmp/ts/Main_ts.ts +4 -1
- package/project/.sdk/src/cmp/ts/Package_ts.ts +10 -1
- package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -2
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +2 -1
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +21 -6
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +52 -2
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +14 -3
- package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +34 -2
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +64 -43
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +8 -8
- package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +2 -2
- package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +2 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +25 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +10 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +10 -2
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +27 -3
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +10 -2
- package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +15 -0
- package/project/.sdk/src/cmp/zig/Entity_zig.ts +5 -1
- package/project/.sdk/src/cmp/zig/Package_zig.ts +3 -1
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +39 -0
- package/project/.sdk/src/cmp/zig/fragment/EntityCreateOp.fragment.zig +2 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +21 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityLoadOp.fragment.zig +2 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityRemoveOp.fragment.zig +5 -2
- package/project/.sdk/src/cmp/zig/fragment/EntityUpdateOp.fragment.zig +2 -2
- package/project/.sdk/tm/c/VERSION +1 -1
- package/project/.sdk/tm/c/core/helpers.c +1 -0
- package/project/.sdk/tm/c/core/sdk.h +22 -6
- package/project/.sdk/tm/c/tests/feature_harness.h +1 -0
- package/project/.sdk/tm/c/tests/primary_utility_test.c +4 -1
- package/project/.sdk/tm/c/utility/make_url.c +1 -0
- package/project/.sdk/tm/c/utility/param.c +1 -0
- package/project/.sdk/tm/clojure/VERSION +1 -1
- package/project/.sdk/tm/cpp/VERSION +1 -1
- package/project/.sdk/tm/cpp/core/types.hpp +33 -8
- package/project/.sdk/tm/cpp/test/pipeline_test.cpp +5 -0
- package/project/.sdk/tm/cpp/test/runner_support.hpp +4 -4
- package/project/.sdk/tm/csharp/VERSION +1 -1
- package/project/.sdk/tm/csharp/core/Types.cs +6 -0
- package/project/.sdk/tm/csharp/test/FeatureHarness.cs +396 -0
- package/project/.sdk/tm/csharp/test/FeatureTest.cs +7 -385
- package/project/.sdk/tm/csharp/test/Runner.cs +4 -4
- package/project/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +4 -0
- package/project/.sdk/tm/dart/test/utility.dart +4 -4
- package/project/.sdk/tm/elixir/VERSION +1 -1
- package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +26 -0
- package/project/.sdk/tm/go/VERSION +1 -1
- package/project/.sdk/tm/go/core/types.go +6 -0
- package/project/.sdk/tm/go/test/feature_harness_test.go +361 -0
- package/project/.sdk/tm/go/test/feature_test.go +7 -350
- package/project/.sdk/tm/go/test/pipeline_test.go +6 -0
- package/project/.sdk/tm/go/test/runner_test.go +16 -4
- package/project/.sdk/tm/haskell/VERSION +1 -1
- package/project/.sdk/tm/haskell/src/SdkFeatures.hs +28 -5
- package/project/.sdk/tm/haskell/src/SdkTypes.hs +14 -5
- package/project/.sdk/tm/java/VERSION +1 -1
- package/project/.sdk/tm/java/test/RunnerSupport.java +4 -4
- package/project/.sdk/tm/java/utility/MakeError.java +4 -0
- package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +4 -0
- package/project/.sdk/tm/js/test/utility.js +3 -3
- package/project/.sdk/tm/kotlin/VERSION +1 -1
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +3 -3
- package/project/.sdk/tm/lean/VERSION +1 -1
- package/project/.sdk/tm/lean/test/TFeature.lean +27 -14
- package/project/.sdk/tm/lua/test/runner.lua +4 -4
- package/project/.sdk/tm/lua/utility/make_error.lua +4 -0
- package/project/.sdk/tm/ocaml/VERSION +1 -1
- package/project/.sdk/tm/ocaml/sdk_types.ml +14 -5
- package/project/.sdk/tm/ocaml/test/t_pipeline.ml +5 -2
- package/project/.sdk/tm/perl/t/runner.pm +4 -4
- package/project/.sdk/tm/php/VERSION +1 -1
- package/project/.sdk/tm/php/test/Runner.php +4 -4
- package/project/.sdk/tm/php/utility/MakeError.php +5 -0
- package/project/.sdk/tm/py/pkg/utility/make_error.py +4 -0
- package/project/.sdk/tm/py/test/runner.py +19 -4
- package/project/.sdk/tm/rb/test/runner.rb +4 -4
- package/project/.sdk/tm/rb/utility/make_error.rb +4 -0
- package/project/.sdk/tm/rust/VERSION +1 -1
- package/project/.sdk/tm/rust/core/types.rs +22 -6
- package/project/.sdk/tm/rust/tests/common/mod.rs +6 -6
- package/project/.sdk/tm/rust/tests/pipeline_test.rs +6 -0
- package/project/.sdk/tm/rust/utility/make_error.rs +4 -0
- package/project/.sdk/tm/scala/VERSION +1 -1
- package/project/.sdk/tm/seneca-provider/CODE_OF_CONDUCT.md +132 -0
- package/project/.sdk/tm/seneca-provider/LICENSE +21 -0
- package/project/.sdk/tm/seneca-provider/Makefile +15 -0
- package/project/.sdk/tm/seneca-provider/src/tsconfig.json +18 -0
- package/project/.sdk/tm/seneca-provider/test/tsconfig.json +16 -0
- package/project/.sdk/tm/seneca-provider/tsfmt.json +3 -0
- package/project/.sdk/tm/swift/VERSION +1 -1
- package/project/.sdk/tm/ts/src/tsconfig.json +1 -0
- package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +4 -0
- package/project/.sdk/tm/ts/test/tsconfig.json +1 -0
- package/project/.sdk/tm/ts/test/utility.ts +3 -3
- package/project/.sdk/tm/zig/VERSION +1 -1
- package/src/action/doctor.ts +475 -0
- package/src/action/feature.ts +54 -16
- package/src/action/target.ts +174 -25
- package/src/cmp/Entity.ts +7 -0
- package/src/cmp/ExternalTarget.ts +125 -0
- package/src/cmp/Feature.ts +3 -1
- package/src/cmp/Main.ts +7 -1
- package/src/cmp/ReadmeExplanation.ts +2 -2
- package/src/cmp/ReadmeTop.ts +22 -9
- package/src/cmp/Registered.ts +100 -0
- package/src/cmp/Test.ts +4 -1
- package/src/helpers/dryrun.ts +57 -0
- package/src/helpers/featureSource.ts +208 -0
- package/src/helpers/naming.ts +73 -2
- package/src/helpers/opExample.ts +19 -2
- package/src/helpers/opShape.ts +65 -0
- package/src/helpers/packageMeta.ts +211 -10
- package/src/helpers/stdrep.ts +56 -0
- package/src/helpers/testPolicy.ts +52 -0
- package/src/sdkgen.ts +350 -5
- package/src/types.ts +24 -1
- package/src/utility.ts +10 -1
- package/project/.sdk/tm/rust/feature/mod.rs +0 -24
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
// Every value here is derived from the resolved model (model.name, model.origin,
|
|
15
15
|
// main.kit.info.title) — no new inputs required.
|
|
16
16
|
|
|
17
|
+
import { each } from 'jostraca'
|
|
18
|
+
|
|
17
19
|
import { KIT, nom } from '@voxgig/apidef'
|
|
18
20
|
|
|
19
21
|
const PUBLISHER = 'Voxgig'
|
|
@@ -38,15 +40,42 @@ function langLabel(target: string): string {
|
|
|
38
40
|
return LANG_LABEL[target] || target
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
//
|
|
43
|
+
// Git host, org/repo path, and the canonical repo URLs.
|
|
44
|
+
//
|
|
45
|
+
// `<origin>/<slug>-sdk` is a DERIVATION, not a law. A project whose repo is
|
|
46
|
+
// named anything else — `voxgig-sdk/voxgig-solardemo-sdk`, say, where the slug
|
|
47
|
+
// is `solardemo` — used to have no way to say so, and got a `go.mod` module
|
|
48
|
+
// path that 404s on `go get` plus `homepage`/`repository`/`bugs` URLs pointing
|
|
49
|
+
// at a repo that does not exist. The only escape was renaming the slug, which
|
|
50
|
+
// also renames the SDK classes: a public-API break, and no help at all to a
|
|
51
|
+
// project that has already published.
|
|
52
|
+
//
|
|
53
|
+
// main: kit: repo: {
|
|
54
|
+
// path: 'voxgig-sdk/voxgig-solardemo-sdk' # overrides <origin>/<slug>-sdk
|
|
55
|
+
// host: 'github.com' # default
|
|
56
|
+
// }
|
|
42
57
|
function repoInfo(model: any) {
|
|
43
58
|
const slug = model.name
|
|
44
59
|
const origin = model.origin || 'voxgig-sdk'
|
|
45
|
-
|
|
46
|
-
const
|
|
60
|
+
|
|
61
|
+
const declared = (model && model.main && model.main[KIT] && model.main[KIT].repo) || {}
|
|
62
|
+
|
|
63
|
+
const host = '' === (declared.host || '') ? 'github.com' : (declared.host || 'github.com')
|
|
64
|
+
const path = '' === (declared.path || '') ? `${origin}/${slug}-sdk` : String(declared.path)
|
|
65
|
+
|
|
66
|
+
// Last segment is the repo; everything before it is the org (which may
|
|
67
|
+
// itself contain slashes on hosts that allow subgroups, e.g. GitLab).
|
|
68
|
+
const seg = path.split('/')
|
|
69
|
+
const repo = seg[seg.length - 1]
|
|
70
|
+
|
|
71
|
+
const repoUrl = `https://${host}/${path}`
|
|
72
|
+
|
|
47
73
|
return {
|
|
48
74
|
slug,
|
|
49
75
|
origin,
|
|
76
|
+
host,
|
|
77
|
+
// 'org/repo' — the path under the host, and the base of a go module path.
|
|
78
|
+
path,
|
|
50
79
|
repo,
|
|
51
80
|
repoUrl,
|
|
52
81
|
issuesUrl: `${repoUrl}/issues`,
|
|
@@ -58,6 +87,94 @@ function repoInfo(model: any) {
|
|
|
58
87
|
}
|
|
59
88
|
|
|
60
89
|
|
|
90
|
+
// The go module path for a go-family target: the declared override, else the
|
|
91
|
+
// repo path plus the target's subdirectory.
|
|
92
|
+
//
|
|
93
|
+
// main: kit: target: go: module: path: 'github.com/acme/legacy-sdk/go'
|
|
94
|
+
//
|
|
95
|
+
// THE ONLY implementation. Twelve go components used to re-derive
|
|
96
|
+
// `github.com/${origin}/${name}-sdk/go` inline, so fixing the path in one
|
|
97
|
+
// place fixed nothing — and `ReadmeTop`, which prints the module in the root
|
|
98
|
+
// README's package table, lives inside node_modules where a consumer cannot
|
|
99
|
+
// patch it at all.
|
|
100
|
+
function goModule(model: any, target: string): string {
|
|
101
|
+
const declared = model?.main?.[KIT]?.target?.[target]?.module?.path
|
|
102
|
+
if (null != declared && '' !== declared) {
|
|
103
|
+
return String(declared)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const { host, path } = repoInfo(model)
|
|
107
|
+
return `${host}/${path}/${target}`
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
// The SDK's OWN release version, for this target's manifest and release tag.
|
|
112
|
+
//
|
|
113
|
+
// main: kit: target: ts: publish: version: '0.0.2'
|
|
114
|
+
//
|
|
115
|
+
// Defaults to '0.0.1' (the schema default), which is what every manifest
|
|
116
|
+
// emitter used to HARDCODE. That is why regeneration reset a published
|
|
117
|
+
// version: the value lived only in the generated output, so overwriting the
|
|
118
|
+
// output threw it away, and a project that had shipped 0.0.2 silently got a
|
|
119
|
+
// 0.0.1 manifest back. Declaring it in the model makes the manifest, the
|
|
120
|
+
// install docs and the port's VERSION file agree, and survive.
|
|
121
|
+
function packageVersion(model: any, target: string): string {
|
|
122
|
+
const declared = model?.main?.[KIT]?.target?.[target]?.publish?.version
|
|
123
|
+
return null != declared && '' !== declared ? String(declared) : '0.0.1'
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
// The Go language version for a go-family target's go.mod.
|
|
128
|
+
//
|
|
129
|
+
// main: kit: target: go: module: goversion: '1.23'
|
|
130
|
+
//
|
|
131
|
+
// Defaults to 1.21, the release that introduced `log/slog` — which sdkgen's
|
|
132
|
+
// own `log` feature template imports. The previous hardcoded `go 1.20` meant a
|
|
133
|
+
// generated SDK could not compile the feature source sdkgen had just written
|
|
134
|
+
// into it.
|
|
135
|
+
function goVersion(model: any, target: string, fallback?: string): string {
|
|
136
|
+
const declared = model?.main?.[KIT]?.target?.[target]?.module?.goversion
|
|
137
|
+
if (null != declared && '' !== declared) {
|
|
138
|
+
return String(declared)
|
|
139
|
+
}
|
|
140
|
+
return fallback || '1.21'
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
// The root Go package IDENTIFIER — `package voxgigsolardemosdk`. Go requires
|
|
145
|
+
// a plain identifier here, so unlike the module path it must be concatenated
|
|
146
|
+
// from the slug rather than taken from the repo.
|
|
147
|
+
//
|
|
148
|
+
// main: kit: target: go: module: package: 'acmesdk'
|
|
149
|
+
//
|
|
150
|
+
// The default concatenates `<origin><slug>sdk`, which DOUBLES the org prefix
|
|
151
|
+
// whenever the slug already carries it: slug `voxgig-solardemo` under origin
|
|
152
|
+
// `voxgig-sdk` produced `package voxgigvoxgigsolardemosdk`. A slug repeating
|
|
153
|
+
// its org is the natural shape for a repo named `<org>-<product>`, so the
|
|
154
|
+
// default now drops a leading origin prefix instead of restating it.
|
|
155
|
+
//
|
|
156
|
+
// This was the last of the four things the slug derives that had no override,
|
|
157
|
+
// and the only one that came out wrong — see the identity note at the top of
|
|
158
|
+
// model/sdkgen.aontu.
|
|
159
|
+
function goPackageIdent(model: any, target: string): string {
|
|
160
|
+
const declared = model?.main?.[KIT]?.target?.[target]?.module?.package
|
|
161
|
+
if (null != declared && '' !== declared) {
|
|
162
|
+
return String(declared)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const ident = (s: string) => String(s || '').replace(/[^a-z0-9]/gi, '').toLowerCase()
|
|
166
|
+
|
|
167
|
+
const org = ident((model.origin || 'voxgig-sdk').replace(/-sdk$/, ''))
|
|
168
|
+
let slug = ident(model.name)
|
|
169
|
+
|
|
170
|
+
if ('' !== org && slug.startsWith(org)) {
|
|
171
|
+
slug = slug.slice(org.length)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return org + slug + 'sdk'
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
61
178
|
// Publication state of a target's package registry, tri-state + tag-only:
|
|
62
179
|
// 'tag' — no registry (the go family); resolved from the git tag.
|
|
63
180
|
// 'pending' — registry declared but the package is not uploaded yet
|
|
@@ -130,6 +247,25 @@ function packageName(model: any, eco: string): string {
|
|
|
130
247
|
const origin = model.origin || 'voxgig-sdk'
|
|
131
248
|
const base = origin.endsWith('-sdk') ? slug : `${slug}-sdk`
|
|
132
249
|
const npmScoped = `@${origin}/${slug}${origin.endsWith('-sdk') ? '' : '-sdk'}`
|
|
250
|
+
|
|
251
|
+
// A target may name its published package outright — the escape hatch for a
|
|
252
|
+
// project whose registry name is not what the slug derives, and which cannot
|
|
253
|
+
// rename the slug without renaming its SDK classes:
|
|
254
|
+
//
|
|
255
|
+
// main: kit: target: ts: publish: registry: package: '@acme/legacy-client'
|
|
256
|
+
//
|
|
257
|
+
// The key already existed in the schema ("registry package name ('' ->
|
|
258
|
+
// derived)") and was simply never read. Keyed by TARGET, so the ecosystem
|
|
259
|
+
// aliases ('npm', 'pypi', ...) resolve to the target that publishes to them.
|
|
260
|
+
const ECO_TARGET: Record<string, string> = {
|
|
261
|
+
npm: 'ts', pypi: 'py', gem: 'rb', luarocks: 'lua', composer: 'php',
|
|
262
|
+
}
|
|
263
|
+
const declared = model?.main?.[KIT]?.target?.[ECO_TARGET[eco] || eco]
|
|
264
|
+
?.publish?.registry?.package
|
|
265
|
+
if (null != declared && '' !== declared) {
|
|
266
|
+
return String(declared)
|
|
267
|
+
}
|
|
268
|
+
|
|
133
269
|
switch (eco) {
|
|
134
270
|
case 'npm':
|
|
135
271
|
case 'ts':
|
|
@@ -147,11 +283,11 @@ function packageName(model: any, eco: string): string {
|
|
|
147
283
|
case 'php':
|
|
148
284
|
return `${origin}/${base}`
|
|
149
285
|
case 'go':
|
|
150
|
-
return
|
|
286
|
+
return goModule(model, 'go')
|
|
151
287
|
case 'go-cli':
|
|
152
|
-
return
|
|
288
|
+
return goModule(model, 'go-cli')
|
|
153
289
|
case 'go-mcp':
|
|
154
|
-
return
|
|
290
|
+
return goModule(model, 'go-mcp')
|
|
155
291
|
// The notebook/analyst package layered on `py`. Distinct PyPI name so it
|
|
156
292
|
// can version and publish independently of the SDK it wraps.
|
|
157
293
|
case 'py-data':
|
|
@@ -214,11 +350,69 @@ function keywords(model: any): string[] {
|
|
|
214
350
|
return ['voxgig', 'sdk', 'generated-sdk', 'openapi', 'api-client', model.name]
|
|
215
351
|
}
|
|
216
352
|
|
|
217
|
-
|
|
218
|
-
//
|
|
219
|
-
//
|
|
353
|
+
|
|
354
|
+
// WHO WROTE THE PACKAGE — `main: kit: author` / `main: kit: contributor`.
|
|
355
|
+
//
|
|
356
|
+
// Attribution cannot be derived: it is not a function of the slug, the repo or
|
|
357
|
+
// the API. And because generated output is OVERWRITTEN, a name hand-edited
|
|
358
|
+
// into a manifest is deleted by the next regeneration — silently, because no
|
|
359
|
+
// build step can tell that a person is missing. The seneca-provider target
|
|
360
|
+
// dropped a hand-written provider's author and both its named contributors
|
|
361
|
+
// exactly that way. So attribution is declared in the model and read here.
|
|
362
|
+
//
|
|
363
|
+
// An unset author is the PUBLISHER, which is what every generated SDK manifest
|
|
364
|
+
// has always carried (Package_ts hardcoded it); a project that has never
|
|
365
|
+
// thought about authorship keeps the previous behaviour.
|
|
366
|
+
function authorInfo(model: any): { name: string, url: string } {
|
|
367
|
+
const declared = model?.main?.[KIT]?.author || {}
|
|
368
|
+
|
|
369
|
+
const name = null != declared.name && '' !== declared.name ?
|
|
370
|
+
String(declared.name) : PUBLISHER
|
|
371
|
+
|
|
372
|
+
// A declared author with no url gets none — inventing PUBLISHER_URL for a
|
|
373
|
+
// named human would credit them to Voxgig's homepage.
|
|
374
|
+
const url = null != declared.url && '' !== declared.url ? String(declared.url) :
|
|
375
|
+
(PUBLISHER === name ? PUBLISHER_URL : '')
|
|
376
|
+
|
|
377
|
+
return { name, url }
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
// Contributors, in sorted-key order so the manifest is byte-stable. `each`
|
|
382
|
+
// rather than Object.keys: the model is an aontu map and carries metadata
|
|
383
|
+
// keys alongside its entries.
|
|
384
|
+
//
|
|
385
|
+
// An entry with no name is DROPPED rather than rendered as `{}` — the schema
|
|
386
|
+
// makes `name` required, but a partially-unified model can still reach here
|
|
387
|
+
// during a dry run.
|
|
388
|
+
function contributorList(model: any): { name: string, url: string }[] {
|
|
389
|
+
return each(model?.main?.[KIT]?.contributor || {})
|
|
390
|
+
.filter((c: any) => null != c && null != c.name && '' !== c.name)
|
|
391
|
+
.map((c: any) => ({
|
|
392
|
+
name: String(c.name),
|
|
393
|
+
url: null != c.url && '' !== c.url ? String(c.url) : '',
|
|
394
|
+
}))
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// A VALID uppercase env-var token: 'unsolicited-advice' -> 'UNSOLICITED_ADVICE'.
|
|
398
|
+
//
|
|
399
|
+
// THE ONLY WAY to build an env-var name segment. There used to be three
|
|
400
|
+
// spellings of this in the components — `envToken(name)`,
|
|
401
|
+
// `nom(x, 'NAME')` (the camel form uppercased, which SWALLOWS the hyphen) and
|
|
402
|
+
// `x.name.toUpperCase().replace(...)` — and they agree only while the name has
|
|
403
|
+
// no hyphen in it. A slug like `voxgig-solardemo` produced both
|
|
404
|
+
// `VOXGIG_SOLARDEMO_TEST_LIVE` and `VOXGIGSOLARDEMO_TEST_LIVE` in the SAME
|
|
405
|
+
// generated SDK: `test/utility.ts` read one, `PlanetEntity.test.ts` the other,
|
|
406
|
+
// so setting either sent half the suite live and left the rest mocked — with
|
|
407
|
+
// the suite reporting green either way.
|
|
408
|
+
function envToken(name: any): string {
|
|
409
|
+
return String(name || '').toUpperCase().replace(/[^A-Z0-9]+/g, '_').replace(/^_+|_+$/g, '')
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
// The env-var base for this SDK: <NAME>_APIKEY, <NAME>_TEST_LIVE, ...
|
|
220
414
|
function envName(model: any): string {
|
|
221
|
-
return
|
|
415
|
+
return envToken(model.name)
|
|
222
416
|
}
|
|
223
417
|
|
|
224
418
|
export {
|
|
@@ -239,5 +433,12 @@ export {
|
|
|
239
433
|
pkgDescription,
|
|
240
434
|
nonAffiliation,
|
|
241
435
|
keywords,
|
|
436
|
+
authorInfo,
|
|
437
|
+
contributorList,
|
|
242
438
|
envName,
|
|
439
|
+
envToken,
|
|
440
|
+
goModule,
|
|
441
|
+
goVersion,
|
|
442
|
+
goPackageIdent,
|
|
443
|
+
packageVersion,
|
|
243
444
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Replacement keys the GENERATOR owns, merged into the project's `ctx$.stdrep`.
|
|
2
|
+
//
|
|
3
|
+
// `stdrep` itself is built by the consumer's `Root.ts`
|
|
4
|
+
// (`names(ctx$.stdrep, model.Name, 'ProjectName')`), which lives outside this
|
|
5
|
+
// package and is frozen at project-init time — so a new placeholder cannot be
|
|
6
|
+
// added there without every existing project resyncing its root wiring. These
|
|
7
|
+
// are added here instead, immediately before the templates that use them are
|
|
8
|
+
// copied, so an old project gets them without touching its scaffold.
|
|
9
|
+
|
|
10
|
+
import { envName, packageVersion } from './packageMeta'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// PROJECTENV — the env-var base for this SDK's `<BASE>_TEST_LIVE`,
|
|
14
|
+
// `<BASE>_APIKEY` and friends.
|
|
15
|
+
//
|
|
16
|
+
// NOT `PROJECTNAME`. That one is the camel-cased class name uppercased, which
|
|
17
|
+
// SWALLOWS a hyphen: `voxgig-solardemo` becomes `VOXGIGSOLARDEMO`, while every
|
|
18
|
+
// component-generated env var reads `VOXGIG_SOLARDEMO`. Both spellings used to
|
|
19
|
+
// reach the same generated SDK — `test/utility.ts` (a template) read one and
|
|
20
|
+
// `PlanetEntity.test.ts` (a component) the other — so setting either variable
|
|
21
|
+
// sent half the suite live and left the rest mocked, green either way.
|
|
22
|
+
function ensureStdrep(ctx$: any): any {
|
|
23
|
+
const stdrep = ctx$.stdrep = (ctx$.stdrep || {})
|
|
24
|
+
|
|
25
|
+
if (null == stdrep.PROJECTENV) {
|
|
26
|
+
stdrep.PROJECTENV = envName(ctx$.model)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return stdrep
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// The substitutions `target add` applies when it copies a target's TEMPLATE
|
|
34
|
+
// tree (tm/<t>).
|
|
35
|
+
//
|
|
36
|
+
// ONE definition, because two consumers must agree exactly: `target add`
|
|
37
|
+
// writes the files, and `doctor` re-applies these to the scaffold before
|
|
38
|
+
// comparing, to tell a substitution artefact from a real hand-edit. When
|
|
39
|
+
// PROJECTVERSION was added to the writer alone, every project's VERSION file
|
|
40
|
+
// immediately read as an edited master.
|
|
41
|
+
function templateReplacements(model: any, tname: string): Record<string, string> {
|
|
42
|
+
return {
|
|
43
|
+
ProjectName: model?.const?.Name,
|
|
44
|
+
|
|
45
|
+
// The port's release version, read by its Makefile to build the
|
|
46
|
+
// `<target>/v<version>` tag. It comes from the same model field the
|
|
47
|
+
// generated manifest uses, so the tag and the package cannot disagree.
|
|
48
|
+
PROJECTVERSION: packageVersion(model, tname),
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
ensureStdrep,
|
|
55
|
+
templateReplacements,
|
|
56
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// How strict the generated LIVE tests are.
|
|
2
|
+
//
|
|
3
|
+
// WHY THIS IS A MODEL DECISION
|
|
4
|
+
//
|
|
5
|
+
// The generated direct tests are deliberately lenient in live mode:
|
|
6
|
+
//
|
|
7
|
+
// if (setup.live) {
|
|
8
|
+
// // Live mode is lenient: synthetic IDs frequently 4xx.
|
|
9
|
+
// if (!result.ok || result.status < 200 || result.status >= 300) {
|
|
10
|
+
// return // <-- passes
|
|
11
|
+
// }
|
|
12
|
+
// } else {
|
|
13
|
+
// assert(result.ok === true)
|
|
14
|
+
// ...
|
|
15
|
+
// }
|
|
16
|
+
//
|
|
17
|
+
// That is CORRECT for sdkgen's default case — a fleet SDK generated against
|
|
18
|
+
// an arbitrary third-party public API, where synthetic IDs 4xx constantly and
|
|
19
|
+
// list response shapes vary wildly. Asserting there would mean permanent red.
|
|
20
|
+
//
|
|
21
|
+
// It is WRONG for a project that owns the server it tests against, and those
|
|
22
|
+
// projects had no way to say so. Measured on voxgig-solardemo-sdk: the live
|
|
23
|
+
// TypeScript suite reports 186 pass / 0 fail against the local test app —
|
|
24
|
+
// and 184 pass / 2 fail with the server STOPPED. Only the two entity `basic`
|
|
25
|
+
// flows noticed. A green live run said almost nothing.
|
|
26
|
+
//
|
|
27
|
+
// Gaps that announce themselves as a passing test suite are worse than the
|
|
28
|
+
// ones that break a build.
|
|
29
|
+
|
|
30
|
+
import { KIT } from '../types'
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// True when live assertions should match the offline ones. Per-target
|
|
34
|
+
// override first, then the SDK-wide default, then false.
|
|
35
|
+
//
|
|
36
|
+
// main: kit: test: live: strict: true
|
|
37
|
+
// main: kit: target: go: test: live: strict: true
|
|
38
|
+
function liveStrict(model: any, target?: string): boolean {
|
|
39
|
+
const perTarget = null == target ? undefined :
|
|
40
|
+
model?.main?.[KIT]?.target?.[target]?.test?.live?.strict
|
|
41
|
+
|
|
42
|
+
if (null != perTarget) {
|
|
43
|
+
return true === perTarget
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return true === model?.main?.[KIT]?.test?.live?.strict
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
liveStrict,
|
|
52
|
+
}
|