@voxgig/sdkgen 4.10.0 → 4.11.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 +1 -1
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +330 -0
- package/project/.sdk/model/target/c.aon +15 -2
- package/project/.sdk/model/target/cpp.aon +18 -0
- package/project/.sdk/model/target/lua.aon +17 -0
- package/project/.sdk/model/target/ocaml.aon +48 -5
- package/project/.sdk/model/target/zig.aon +30 -4
- package/project/.sdk/src/cmp/c/Config_c.ts +338 -1
- package/project/.sdk/src/cmp/c/Main_c.ts +57 -2
- package/project/.sdk/src/cmp/c/Package_c.ts +12 -2
- package/project/.sdk/src/cmp/cpp/Config_cpp.ts +324 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +2 -0
- package/project/.sdk/src/cmp/cpp/Main_cpp.ts +62 -4
- package/project/.sdk/src/cmp/cpp/Package_cpp.ts +10 -0
- package/project/.sdk/src/cmp/lua/Config_lua.ts +88 -0
- package/project/.sdk/src/cmp/lua/Gitignore_lua.ts +4 -0
- package/project/.sdk/src/cmp/lua/Main_lua.ts +93 -3
- package/project/.sdk/src/cmp/lua/Package_lua.ts +60 -0
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +10 -0
- package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +183 -5
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +160 -3
- package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +25 -1
- package/project/.sdk/src/cmp/zig/Config_zig.ts +130 -9
- package/project/.sdk/src/cmp/zig/Main_zig.ts +208 -4
- package/project/.sdk/{tm/zig/build.zig → src/cmp/zig/fragment/Build.fragment.zig} +7 -0
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +25 -0
- package/project/.sdk/{tm/zig/root.zig → src/cmp/zig/fragment/Root.fragment.zig} +9 -0
- package/project/.sdk/tm/c/Makefile +58 -9
- package/project/.sdk/tm/c/core/sdk.h +10 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/capability.c +133 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/capability.h +39 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/catalog.c +83 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/catalog.h +48 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/config.c +413 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/config.h +24 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/depend.c +264 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/depend.h +29 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/env.c +220 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/env.h +19 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/export.c +97 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/export.h +19 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/graph.c +237 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/graph.h +17 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/host.c +1494 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/host.h +135 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/order.c +288 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/order.h +18 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/point.c +141 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/point.h +80 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/ref.c +170 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/ref.h +52 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/resolve.c +98 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/resolve.h +18 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/types.c +150 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/types.h +104 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/value.c +649 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/value.h +135 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/version.c +151 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/version.h +34 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/aws.c +281 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/azuresecrets.c +207 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/boru.c +164 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/clock.c +75 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/doppler.c +141 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/encode.c +144 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/gcpsecrets.c +177 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/hashicorp.c +239 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/httpjson.c +599 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/infisical.c +165 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/onepassword.c +194 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/proc.c +233 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/secretspec.c +125 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/sekretoplugins.h +125 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/sha256.c +270 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/sigv4.c +382 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/support.h +153 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/tls.c +420 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/internal.h +86 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/json.c +721 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/providers.c +813 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.c +944 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.h +490 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/util.c +442 -0
- package/project/.sdk/tm/c/feature/secrets.c +797 -0
- package/project/.sdk/tm/c/feature/secrets.h +46 -0
- package/project/.sdk/tm/c/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/c/tests/feature/secrets/secrets_test.c +802 -0
- package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +38 -11
- package/project/.sdk/tm/clojure/test/sdk/test/feature/secrets.clj +40 -6
- package/project/.sdk/tm/cpp/Makefile +48 -4
- package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.cpp +121 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.hpp +41 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.cpp +60 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.hpp +66 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/config.cpp +376 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/config.hpp +29 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.cpp +230 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.hpp +31 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/env.cpp +205 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/env.hpp +25 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/export.cpp +84 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/export.hpp +24 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.cpp +222 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.hpp +21 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/host.cpp +1200 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/host.hpp +250 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/order.cpp +250 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/order.hpp +22 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/point.cpp +110 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/point.hpp +79 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.cpp +136 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.hpp +60 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.cpp +82 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.hpp +25 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/types.cpp +90 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/types.hpp +65 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/value.cpp +491 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/value.hpp +120 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/version.cpp +143 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/version.hpp +36 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.cpp +248 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.hpp +30 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.cpp +149 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.cpp +117 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.hpp +27 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.cpp +180 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.hpp +52 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.cpp +87 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.cpp +121 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.cpp +153 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.cpp +666 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.hpp +160 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.cpp +123 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.cpp +125 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.cpp +223 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.hpp +47 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.cpp +104 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.hpp +27 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.cpp +242 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.hpp +58 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.cpp +260 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.hpp +47 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.cpp +476 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.hpp +89 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.cpp +312 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.hpp +263 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.cpp +354 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.hpp +111 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.cpp +613 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.hpp +227 -0
- package/project/.sdk/tm/cpp/feature/secrets.hpp +745 -0
- package/project/.sdk/tm/cpp/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/test/feature/secrets/secrets_test.cpp +808 -0
- package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +34 -8
- package/project/.sdk/tm/csharp/test/feature/secrets/SecretsFeatureTest.cs +85 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +17 -2
- package/project/.sdk/tm/elixir/test/feature/secrets/secrets_test.exs +41 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +32 -10
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +116 -0
- package/project/.sdk/tm/java/feature/SecretsFeature.java +33 -8
- package/project/.sdk/tm/java/test/feature/secrets/SecretsFeatureTest.java +64 -0
- package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +34 -11
- package/project/.sdk/tm/js/test/feature/secrets/Secrets.test.js +73 -0
- package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +32 -7
- package/project/.sdk/tm/kotlin/test/feature/secrets/SecretsTest.kt +69 -0
- package/project/.sdk/tm/lua/Makefile +15 -4
- package/project/.sdk/tm/lua/feature/secrets/native/sekretonet.c +806 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/capability.lua +135 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/catalog.lua +63 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/config.lua +361 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/depend.lua +232 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/env.lua +168 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/export.lua +66 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/graph.lua +194 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/host.lua +1190 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/json.lua +169 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/order.lua +207 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/point.lua +106 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/ref.lua +115 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/resolve.lua +78 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/types.lua +275 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/version.lua +131 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin.lua +76 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/addr.lua +124 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/err.lua +47 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/name.lua +315 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/aws.lua +228 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/azuresecrets.lua +137 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/boru.lua +124 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/crypto.lua +212 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/doppler.lua +89 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/gcpsecrets.lua +129 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/hashicorp.lua +154 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/httpjson.lua +248 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/infisical.lua +113 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/json.lua +449 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/net.lua +198 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/onepassword.lua +126 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/secretspec.lua +93 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/sigv4.lua +269 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/support.lua +146 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/providers.lua +346 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto.lua +479 -0
- package/project/.sdk/tm/lua/feature/secrets_feature.lua +690 -0
- package/project/.sdk/tm/lua/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/lua/test/extend_test.lua +105 -0
- package/project/.sdk/tm/lua/test/feature/secrets/secrets_feature_test.lua +862 -0
- package/project/.sdk/tm/ocaml/Makefile +52 -8
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/capability.ml +106 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/catalog.ml +43 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/config.ml +349 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/defs.ml +143 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/depend.ml +217 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/env.ml +197 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/export.ml +89 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/graph.ml +227 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/host.ml +1112 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/order.ml +202 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/point.ml +138 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/ref.ml +126 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/resolve.ml +62 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/types.ml +97 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/value.ml +387 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/version.ml +139 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/aws.ml +171 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/azuresecrets.ml +116 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/boru.ml +95 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/crypto.ml +149 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/doppler.ml +61 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/gcpsecrets.ml +93 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/hashicorp.ml +120 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/http.ml +421 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/httpjson.ml +66 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/infisical.ml +85 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/onepassword.ml +112 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/runcmd.ml +97 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/secretspec.ml +68 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/sigv4.ml +259 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls.ml +44 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls_stubs.c +358 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/json.ml +376 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/provider.ml +647 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/secret.ml +299 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/sekreto.ml +347 -0
- package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +453 -0
- package/project/.sdk/tm/ocaml/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/test/feature/secrets/t_secrets.ml +670 -0
- package/project/.sdk/tm/perl/feature/secrets_feature.pm +33 -12
- package/project/.sdk/tm/perl/t/feature/secrets/secrets.t +47 -0
- package/project/.sdk/tm/php/feature/SecretsFeature.php +30 -6
- package/project/.sdk/tm/php/test/feature/secrets/SecretsTest.php +98 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +28 -6
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +114 -0
- package/project/.sdk/tm/rb/feature/secrets_feature.rb +28 -6
- package/project/.sdk/tm/rb/test/feature/secrets/secrets_feature_test.rb +93 -0
- package/project/.sdk/tm/rust/feature/secrets.rs +33 -10
- package/project/.sdk/tm/rust/tests/feature/secrets/main.rs +96 -0
- package/project/.sdk/tm/scala/feature/SecretsFeature.scala +29 -7
- package/project/.sdk/tm/scala/sdktest/feature/secrets/SecretsTestMain.scala +71 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +35 -12
- package/project/.sdk/tm/ts/test/feature/secrets/Secrets.test.ts +73 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/capability.zig +137 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/catalog.zig +90 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/config.zig +346 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/depend.zig +244 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/env.zig +201 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/export.zig +83 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/graph.zig +212 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/host.zig +1224 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/inst.zig +126 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/order.zig +228 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/plugin.zig +34 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/point.zig +166 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/ref.zig +147 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/resolve.zig +74 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/types.zig +140 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/value.zig +662 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/version.zig +139 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/aws.zig +294 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/azuresecrets.zig +222 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/boru.zig +188 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/doppler.zig +135 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/gcpsecrets.zig +170 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/hashicorp.zig +242 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/httpjson.zig +535 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/infisical.zig +167 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/onepassword.zig +202 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/secretspec.zig +160 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/sigv4.zig +336 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/addr.zig +148 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/builtins.zig +259 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/provider.zig +440 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/sekreto.zig +944 -0
- package/project/.sdk/tm/zig/feature/secrets.zig +854 -0
- package/project/.sdk/tm/zig/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/zig/test/feature/secrets/secrets_test.zig +891 -0
- package/project/sdkgen-package.json +1 -1
|
@@ -9,17 +9,41 @@ import {
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
import { packageName } from './utility_ocaml'
|
|
12
|
+
import { secretsBuild } from './Config_ocaml'
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
// <name>.opam — opam package metadata (publish is declared pending in the
|
|
15
16
|
// model; the build itself is stock ocamlc via the Makefile and needs no opam
|
|
16
17
|
// packages). Twin of rust Cargo.toml, but the runtime is dependency-free so
|
|
17
18
|
// there is no depends list beyond the OCaml compiler.
|
|
19
|
+
//
|
|
20
|
+
// The secrets feature's build model is NOT emitted from here, unlike
|
|
21
|
+
// Package_rust's rustls dependency table: the Makefile reads the generated
|
|
22
|
+
// feature/secrets/feature.mk (Main_ocaml), which lists the vendored modules
|
|
23
|
+
// in dependency order and turns the OpenSSL binding on only when a plugin
|
|
24
|
+
// group needing a transport is active. What this manifest CAN state is the
|
|
25
|
+
// system dependency that binding introduces - `depexts`, opam's word for a
|
|
26
|
+
// distribution package - and it states it on exactly the same condition,
|
|
27
|
+
// read from the same helper, so the two cannot drift.
|
|
18
28
|
const Package = cmp(async function Package(props: any) {
|
|
19
29
|
const ctx$ = props.ctx$
|
|
20
30
|
const target = props.target
|
|
21
31
|
const model = ctx$.model
|
|
22
32
|
|
|
33
|
+
const secrets = secretsBuild(model, target)
|
|
34
|
+
const depexts = null != secrets && secrets.tls
|
|
35
|
+
? `# The secrets feature's plugin groups (${secrets.tlsGroups.join(', ')}) bind
|
|
36
|
+
# OpenSSL through the vendored plugins/tls_stubs.c (-lssl -lcrypto), the
|
|
37
|
+
# one external dependency an ocaml SDK can have. Linked only because those
|
|
38
|
+
# groups are active - see feature/secrets/feature.mk.
|
|
39
|
+
depexts: [
|
|
40
|
+
["libssl-dev"] {os-family = "debian"}
|
|
41
|
+
["openssl-devel"] {os-family = "rhel"}
|
|
42
|
+
["openssl"] {os = "macos" & os-distribution = "homebrew"}
|
|
43
|
+
]
|
|
44
|
+
`
|
|
45
|
+
: ''
|
|
46
|
+
|
|
23
47
|
// WHO WROTE THIS PACKAGE. Per target, falling back to the model-wide value
|
|
24
48
|
// and then to the publisher — so a manifest cannot go on naming Voxgig
|
|
25
49
|
// while the model names someone else, which is exactly what the hardcoded
|
|
@@ -46,7 +70,7 @@ depends: [
|
|
|
46
70
|
build: [
|
|
47
71
|
[make "build"]
|
|
48
72
|
]
|
|
49
|
-
`)
|
|
73
|
+
${depexts}`)
|
|
50
74
|
})
|
|
51
75
|
})
|
|
52
76
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Content,
|
|
4
4
|
File,
|
|
5
|
+
Folder,
|
|
5
6
|
cmp,
|
|
6
7
|
configDefinition,
|
|
7
8
|
configReprSetting,
|
|
@@ -156,14 +157,11 @@ pub fn make_feature(name: []const u8) Feature {
|
|
|
156
157
|
// the API def does not list it. The built-in set mirrors the feature
|
|
157
158
|
// templates in tm/zig/feature/ (excluding `base`, the fallback, and
|
|
158
159
|
// `support`, a helper module). Any model feature not already built in is
|
|
159
|
-
// appended so bespoke features still resolve
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
]
|
|
165
|
-
|
|
166
|
-
const featureNames: string[] = [...builtinFeatures]
|
|
160
|
+
// appended so bespoke features still resolve - and so does a GATED one
|
|
161
|
+
// (`secrets`), whose source ships with the tree but whose `@import`s name
|
|
162
|
+
// build modules that exist only when the model activates it: naming it
|
|
163
|
+
// here unconditionally would make every zig SDK fail to build.
|
|
164
|
+
const featureNames: string[] = [...BUILTIN_FEATURES]
|
|
167
165
|
each(feature, (f: any) => {
|
|
168
166
|
if (f.name !== 'base' && !featureNames.includes(f.name)) {
|
|
169
167
|
featureNames.push(f.name)
|
|
@@ -183,6 +181,129 @@ pub fn make_feature(name: []const u8) Feature {
|
|
|
183
181
|
})
|
|
184
182
|
|
|
185
183
|
|
|
184
|
+
// The features tm/zig/feature/ ships UNGATED: every zig SDK has their source
|
|
185
|
+
// and root.zig exports their types statically, so Config's factory can name
|
|
186
|
+
// them whatever the model says. Shared with Main_zig, which uses the same
|
|
187
|
+
// list to decide which ACTIVE features still need a root.zig export.
|
|
188
|
+
const BUILTIN_FEATURES = [
|
|
189
|
+
'audit', 'cache', 'clienttrack', 'cost', 'debug', 'idempotency', 'log',
|
|
190
|
+
'metrics', 'netsim', 'paging', 'proxy', 'ratelimit', 'rbac',
|
|
191
|
+
'retry', 'streaming', 'telemetry', 'test', 'timeout',
|
|
192
|
+
]
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
// THE PLUGIN DEFINITIONS, as the root of the `sekretoplugins` build module:
|
|
196
|
+
// feature/<name>/plugins.zig (the zig peer of Config_go's featurePlugins map
|
|
197
|
+
// and of the plugins.rs index Main_rust emits).
|
|
198
|
+
//
|
|
199
|
+
// Upstream sekreto's contract since its registry was retired: a provider
|
|
200
|
+
// kind not handed to the constructor is unknown to that Sekreto. So this
|
|
201
|
+
// file IS the SDK's provider vocabulary - and in zig it is also what makes
|
|
202
|
+
// the plugin trim REAL: a module root reaches only what it names, so a kind
|
|
203
|
+
// missing here is neither in the vocabulary nor compiled, and a kind named
|
|
204
|
+
// here whose file the trim removed is a compile error rather than a silent
|
|
205
|
+
// one. That is exactly the shape upstream recommends for a lean consumer
|
|
206
|
+
// (plugins/all.zig: "roots its plugins module at the one file it needs").
|
|
207
|
+
//
|
|
208
|
+
// It sits one level ABOVE the vendored `plugins/` directory, deliberately:
|
|
209
|
+
// the vendoring guard fails any non-vendored file inside a vendored dir, and
|
|
210
|
+
// a zig module root reaches its whole SUBTREE, so `plugins/<kind>.zig` is
|
|
211
|
+
// within reach from here while the file itself is outside the guarded tree.
|
|
212
|
+
//
|
|
213
|
+
// Emitted only for a feature that is ACTIVE for this target (targetFeatures),
|
|
214
|
+
// which is also exactly when build.zig declares the module that roots here -
|
|
215
|
+
// an inactive model gets neither, so nothing dangles.
|
|
216
|
+
const FeaturePlugins = cmp(async function FeaturePlugins(props: any) {
|
|
217
|
+
const ctx$ = props.ctx$
|
|
218
|
+
const target = props.target
|
|
219
|
+
const model: Model = ctx$.model
|
|
220
|
+
|
|
221
|
+
const feature = targetFeatures(model, target)
|
|
222
|
+
|
|
223
|
+
each(feature, (feat: any) => {
|
|
224
|
+
// `only_active: false`, the subtlety pluginExcludesFor documents: the
|
|
225
|
+
// feature object a component is handed has already been filtered, so a
|
|
226
|
+
// feature whose plugins are ALL inactive would arrive with nothing here
|
|
227
|
+
// and the module root build.zig points at would not be emitted at all.
|
|
228
|
+
const declared = getModelPath(model,
|
|
229
|
+
`main.${KIT}.feature.${feat.name}.plugin`,
|
|
230
|
+
{ required: false, only_active: false }) || {}
|
|
231
|
+
|
|
232
|
+
if (0 === Object.keys(declared).length) {
|
|
233
|
+
return
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// symbol -> the file (target-root-relative) that exports it.
|
|
237
|
+
const defs: Record<string, string> = {}
|
|
238
|
+
|
|
239
|
+
each(declared, (plugin: any) => {
|
|
240
|
+
// Filter on `active` HERE (Config_go's note): getting this wrong names
|
|
241
|
+
// a file the trim just removed, which is a compile error.
|
|
242
|
+
if (true !== plugin.active) return
|
|
243
|
+
|
|
244
|
+
for (const [sym, one] of Object.entries(plugin.def?.zig || {})) {
|
|
245
|
+
defs[sym] = String(one)
|
|
246
|
+
}
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
Folder({ name: 'feature' }, () => {
|
|
250
|
+
Folder({ name: feat.name }, () => {
|
|
251
|
+
File({ name: 'plugins.' + target.ext }, () => {
|
|
252
|
+
Content(`// The plugin definitions the model selected for the \`${feat.name}\`
|
|
253
|
+
// feature (generated - see Config_zig FeaturePlugins). The ROOT of the
|
|
254
|
+
// \`sekretoplugins\` build module: zig analyses only what a module root
|
|
255
|
+
// reaches, so a kind this file does not name is neither in the provider
|
|
256
|
+
// vocabulary nor compiled - this file IS the plugin trim.
|
|
257
|
+
//
|
|
258
|
+
// Upstream sekreto's contract since its registry was retired: a provider
|
|
259
|
+
// kind not handed to the constructor is unknown to that Sekreto.
|
|
260
|
+
|
|
261
|
+
const sekreto = @import("sekreto");
|
|
262
|
+
|
|
263
|
+
// The shared HTTP round-trip the vault kinds import by relative path, and
|
|
264
|
+
// the exchange's fetch of last resort (feature/${feat.name}.zig). In NO
|
|
265
|
+
// plugin group, so it is always reachable from here - which is what
|
|
266
|
+
// upstream's own all.zig does.
|
|
267
|
+
pub const httpjson = @import("plugins/httpjson.zig");
|
|
268
|
+
|
|
269
|
+
`)
|
|
270
|
+
const syms = Object.keys(defs).sort()
|
|
271
|
+
|
|
272
|
+
for (const sym of syms) {
|
|
273
|
+
// 'feature/secrets/plugins/aws.zig' -> 'plugins/aws.zig', relative
|
|
274
|
+
// to this file's directory (feature/<name>/).
|
|
275
|
+
const rel = defs[sym].replace(new RegExp('^feature/' +
|
|
276
|
+
feat.name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '/'), '')
|
|
277
|
+
Content(`pub const ${sym} = @import("${rel}").${sym};
|
|
278
|
+
`)
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (0 < syms.length) {
|
|
282
|
+
Content(`
|
|
283
|
+
pub const SELECTED = [_]sekreto.Definition{
|
|
284
|
+
`)
|
|
285
|
+
for (const sym of syms) {
|
|
286
|
+
Content(` ${sym},
|
|
287
|
+
`)
|
|
288
|
+
}
|
|
289
|
+
Content(`};
|
|
290
|
+
`)
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
Content(`// No plugin group is active: the chain can name the four built-in kinds
|
|
294
|
+
// (env, memory, dotenv, file) and nothing else.
|
|
295
|
+
pub const SELECTED = [_]sekreto.Definition{};
|
|
296
|
+
`)
|
|
297
|
+
}
|
|
298
|
+
})
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
})
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
|
|
186
305
|
export {
|
|
187
|
-
Config
|
|
306
|
+
Config,
|
|
307
|
+
FeaturePlugins,
|
|
308
|
+
BUILTIN_FEATURES,
|
|
188
309
|
}
|
|
@@ -3,7 +3,9 @@ import * as Path from 'node:path'
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
cmp, each,
|
|
6
|
-
File, Copy, Folder, Fragment,
|
|
6
|
+
File, Content, Copy, Folder, Fragment,
|
|
7
|
+
pluginExcludes,
|
|
8
|
+
targetFeatures,
|
|
7
9
|
} from '@voxgig/sdkgen'
|
|
8
10
|
|
|
9
11
|
|
|
@@ -18,18 +20,124 @@ import {
|
|
|
18
20
|
} from '@voxgig/apidef'
|
|
19
21
|
|
|
20
22
|
|
|
21
|
-
import { Config } from './Config_zig'
|
|
23
|
+
import { Config, FeaturePlugins, BUILTIN_FEATURES } from './Config_zig'
|
|
22
24
|
import { Gitignore } from './Gitignore_zig'
|
|
23
25
|
import { MainEntity } from './MainEntity_zig'
|
|
24
26
|
import { Package } from './Package_zig'
|
|
25
27
|
|
|
26
28
|
|
|
29
|
+
// Which features ship a zig test suite under test/feature/<name>/, and the
|
|
30
|
+
// file build.zig must NAME to run it. zig has no test auto-discovery: a
|
|
31
|
+
// suite the build file does not list exists and never runs. A map rather
|
|
32
|
+
// than a convention because the file has to EXIST - `zig build` fails the
|
|
33
|
+
// whole build on a test path it cannot find - so this may only name suites
|
|
34
|
+
// the templates actually carry.
|
|
35
|
+
//
|
|
36
|
+
// The suite sits under test/feature/<name>/ so that it belongs to the
|
|
37
|
+
// feature (helpers/featureSource), exactly as go's tm/go/test/feature/
|
|
38
|
+
// secrets/ and rust's tests/feature/secrets/ do; and it is wired only for
|
|
39
|
+
// a feature that is ACTIVE for this target, which is when its build modules
|
|
40
|
+
// (below) exist for the suite to reach.
|
|
41
|
+
//
|
|
42
|
+
// Each suite gets its OWN build step (`zig build test-<name>`) as well as a
|
|
43
|
+
// place in the all-tests `test` step: the corpus suites need a project's
|
|
44
|
+
// compiled `.sdk/test/test.json` beside the SDK, so a checker that has the
|
|
45
|
+
// feature but no corpus (sdkgen's own generatedcompile lane) can still run
|
|
46
|
+
// the feature suite alone and read its count.
|
|
47
|
+
const FEATURE_TESTS: Record<string, string> = {
|
|
48
|
+
secrets: 'test/feature/secrets/secrets_test.zig',
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// The GATED features' build modules: what a feature's `@import("<name>")`
|
|
53
|
+
// lines resolve to, declared only when the feature is active. Each entry is
|
|
54
|
+
// the block of build.zig statements that wires one feature; `secrets` is
|
|
55
|
+
// the first and, today, the only one.
|
|
56
|
+
//
|
|
57
|
+
// Upstream's own three-module boundary (sekreto's zig Makefile builds
|
|
58
|
+
// exactly these): `plugin` (voxgig/plugin, rooted at its consumer root),
|
|
59
|
+
// `sekreto` (the core, which imports `plugin` by name and nothing under
|
|
60
|
+
// plugins/), and `sekretoplugins`, rooted at the GENERATED
|
|
61
|
+
// feature/secrets/plugins.zig (Config_zig FeaturePlugins) so that only the
|
|
62
|
+
// selected kinds are compiled. The sdk module gets `sekreto` and
|
|
63
|
+
// `sekretoplugins`; the feature file reaches `plugin` through
|
|
64
|
+
// `sekreto.plugin`, so it needs no import of its own.
|
|
65
|
+
const FEATURE_MODULES: Record<string, string> = {
|
|
66
|
+
secrets: `// The secrets feature's vendored libraries (@voxgig/sekreto and
|
|
67
|
+
// voxgig/plugin at the shared vendor tag), as the three named modules
|
|
68
|
+
// upstream builds them as. Declared ONLY when the model activates the
|
|
69
|
+
// feature: feature/secrets.zig is the sole importer, and an inactive SDK
|
|
70
|
+
// never analyses it (zig compiles only what a module root reaches).
|
|
71
|
+
const plugin_mod = b.addModule("plugin", .{
|
|
72
|
+
.root_source_file = b.path("feature/secrets/plugin/plugin.zig"),
|
|
73
|
+
.target = target,
|
|
74
|
+
.optimize = optimize,
|
|
75
|
+
});
|
|
76
|
+
const sekreto_mod = b.addModule("sekreto", .{
|
|
77
|
+
.root_source_file = b.path("feature/secrets/sekreto/sekreto.zig"),
|
|
78
|
+
.target = target,
|
|
79
|
+
.optimize = optimize,
|
|
80
|
+
});
|
|
81
|
+
sekreto_mod.addImport("plugin", plugin_mod);
|
|
82
|
+
// Rooted at the GENERATED selection (feature/secrets/plugins.zig), never
|
|
83
|
+
// at upstream's full-set all.zig: the root decides which kinds compile.
|
|
84
|
+
const sekretoplugins_mod = b.addModule("sekretoplugins", .{
|
|
85
|
+
.root_source_file = b.path("feature/secrets/plugins.zig"),
|
|
86
|
+
.target = target,
|
|
87
|
+
.optimize = optimize,
|
|
88
|
+
});
|
|
89
|
+
sekretoplugins_mod.addImport("sekreto", sekreto_mod);
|
|
90
|
+
sekretoplugins_mod.addImport("plugin", plugin_mod);
|
|
91
|
+
sdk_mod.addImport("sekreto", sekreto_mod);
|
|
92
|
+
sdk_mod.addImport("sekretoplugins", sekretoplugins_mod);
|
|
93
|
+
`,
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
27
97
|
const Main = cmp(async function Main(props: any) {
|
|
28
98
|
|
|
29
99
|
const { target } = props
|
|
30
100
|
const { model } = props.ctx$
|
|
31
101
|
|
|
32
102
|
const entity: ModelEntity = getModelPath(model, `main.${KIT}.entity`)
|
|
103
|
+
// Gated by the applicability tags, so this target never imports or
|
|
104
|
+
// registers a feature it has no source for. One rule, one place:
|
|
105
|
+
// helpers/applicability.
|
|
106
|
+
const feature = targetFeatures(model, target)
|
|
107
|
+
|
|
108
|
+
// THE PLUGIN TRIM FOR AN INACTIVE FEATURE (the scala shape, for the same
|
|
109
|
+
// reason). pluginExcludes(model) walks only the model's ACTIVE features,
|
|
110
|
+
// which is right for a target whose feature trim is on: an inactive
|
|
111
|
+
// feature's whole tree is already gone at `target add`. zig's feature trim
|
|
112
|
+
// is OFF (model/target/zig.aon `feature: { trim: false }` - root.zig's
|
|
113
|
+
// built-in exports are static), so an inactive feature's tree is all still
|
|
114
|
+
// here, and its provider plugins are the part that costs the most. EVERY
|
|
115
|
+
// declared group of an inactive feature goes, not just the groups marked
|
|
116
|
+
// inactive: a feature that is off has no active plugins whatever its
|
|
117
|
+
// `plugin` map says, because targetFeatures drops the feature before
|
|
118
|
+
// Config ever reads a group. What stays is the two vendored cores and the
|
|
119
|
+
// ungrouped httpjson/sigv4 helpers - dead files zig never analyses, since
|
|
120
|
+
// build.zig declares no module rooted in them (FEATURE_MODULES).
|
|
121
|
+
//
|
|
122
|
+
// Rooting matches pluginExcludes': zig's declared paths are
|
|
123
|
+
// target-root-relative, which is this Copy's root, and the other targets'
|
|
124
|
+
// paths in the same list cannot match anything in a zig tree.
|
|
125
|
+
const esc = (s: string) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
126
|
+
const allfeature = getModelPath(model, `main.${KIT}.feature`,
|
|
127
|
+
{ required: false, only_active: false }) || {}
|
|
128
|
+
const inactivePluginExcludes: RegExp[] = []
|
|
129
|
+
for (const fname of Object.keys(allfeature)) {
|
|
130
|
+
if (null != (feature as any)[fname]) continue
|
|
131
|
+
const groups = getModelPath(model, `main.${KIT}.feature.${fname}.plugin`,
|
|
132
|
+
{ required: false, only_active: false }) || {}
|
|
133
|
+
for (const gname of Object.keys(groups)) {
|
|
134
|
+
for (const one of (groups[gname].path || [])) {
|
|
135
|
+
const pat = esc(String(one))
|
|
136
|
+
inactivePluginExcludes.push(new RegExp('(^|/)' +
|
|
137
|
+
pat.replace(/\\\/$/, '') + (/\/$/.test(String(one)) ? '/' : '$')))
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
33
141
|
|
|
34
142
|
// build.zig.zon — the package manifest, stamped with the model package name.
|
|
35
143
|
Package({ target })
|
|
@@ -43,14 +151,110 @@ const Main = cmp(async function Main(props: any) {
|
|
|
43
151
|
// the tree root (core/, feature/, utility/, entity/, test/) — Zig's
|
|
44
152
|
// idiomatic src/ is not used, to keep the exclude rule identical to the
|
|
45
153
|
// reference targets.
|
|
154
|
+
//
|
|
155
|
+
// build.zig and root.zig are NOT in tm/zig any more: both carry
|
|
156
|
+
// model-driven slots (a gated feature's build modules, test step and root
|
|
157
|
+
// export) and are emitted below from src/cmp/zig/fragment/, the way
|
|
158
|
+
// core/sdk.zig always was.
|
|
46
159
|
Copy({
|
|
47
160
|
from: 'tm/' + target.name,
|
|
48
|
-
|
|
161
|
+
// pluginExcludes: the generate-time plugin trim for an ACTIVE feature's
|
|
162
|
+
// inactive groups (the model's `path` entries are target-root-relative,
|
|
163
|
+
// which is this Copy's root); inactivePluginExcludes (above) for the
|
|
164
|
+
// groups of a feature that is itself off.
|
|
165
|
+
exclude: [
|
|
166
|
+
/src\//,
|
|
167
|
+
/build\.zig\.zon$/,
|
|
168
|
+
...pluginExcludes(model),
|
|
169
|
+
...inactivePluginExcludes,
|
|
170
|
+
],
|
|
49
171
|
replace: {
|
|
50
172
|
...props.ctx$.stdrep,
|
|
51
173
|
}
|
|
52
174
|
})
|
|
53
175
|
|
|
176
|
+
// The active features that root.zig does not export statically: the
|
|
177
|
+
// BUILT-IN set is in the template, so this is the gated ones (`secrets`)
|
|
178
|
+
// and any bespoke feature the model adds. Config_zig names the same
|
|
179
|
+
// features in make_feature, from the same list, so the two cannot drift.
|
|
180
|
+
const extraFeatures = each(feature)
|
|
181
|
+
.filter((f: any) => 'base' !== f.name && !BUILTIN_FEATURES.includes(f.name))
|
|
182
|
+
.map((f: any) => f.name)
|
|
183
|
+
.sort()
|
|
184
|
+
|
|
185
|
+
const fragdir = Path.normalize(__dirname + '/../../../src/cmp/zig/fragment/')
|
|
186
|
+
|
|
187
|
+
// build.zig: the template with its two slots filled - a gated feature's
|
|
188
|
+
// modules after the sdk module, and its test suite as a step of its own
|
|
189
|
+
// that the all-tests step also depends on. Both empty for a model that
|
|
190
|
+
// activates no gated feature, which leaves the file byte-identical to the
|
|
191
|
+
// fragment minus the marker lines.
|
|
192
|
+
File({ name: 'build.zig' }, () => {
|
|
193
|
+
Fragment({
|
|
194
|
+
from: fragdir + 'Build.fragment.zig',
|
|
195
|
+
replace: {
|
|
196
|
+
...props.ctx$.stdrep,
|
|
197
|
+
|
|
198
|
+
'#FeatureModules': ({ indent }: any) => {
|
|
199
|
+
for (const fname of extraFeatures) {
|
|
200
|
+
const block = FEATURE_MODULES[fname]
|
|
201
|
+
if (null != block) Content({ indent }, block)
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
'#FeatureTestSteps': ({ indent }: any) => {
|
|
206
|
+
for (const fname of extraFeatures) {
|
|
207
|
+
const suite = FEATURE_TESTS[fname]
|
|
208
|
+
if (null == suite) continue
|
|
209
|
+
Content({ indent }, `// The ${fname} feature suite: part of \`zig build test\`, and alone as
|
|
210
|
+
// \`zig build test-${fname}\` (see FEATURE_TESTS in Main_zig).
|
|
211
|
+
{
|
|
212
|
+
const ${fname}_mod = b.createModule(.{
|
|
213
|
+
.root_source_file = b.path("${suite}"),
|
|
214
|
+
.target = target,
|
|
215
|
+
.optimize = optimize,
|
|
216
|
+
});
|
|
217
|
+
${fname}_mod.addImport("voxgig-struct", struct_mod);
|
|
218
|
+
${fname}_mod.addImport("sdk", sdk_mod);
|
|
219
|
+
${fname}_mod.addImport("omni", omni_mod);
|
|
220
|
+
const ${fname}_test = b.addTest(.{ .root_module = ${fname}_mod });
|
|
221
|
+
const run_${fname} = b.addRunArtifact(${fname}_test);
|
|
222
|
+
run_${fname}.has_side_effects = true;
|
|
223
|
+
test_step.dependOn(&run_${fname}.step);
|
|
224
|
+
const ${fname}_step = b.step("test-${fname}", "Run the ${fname} feature suite alone");
|
|
225
|
+
${fname}_step.dependOn(&run_${fname}.step);
|
|
226
|
+
}
|
|
227
|
+
`)
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
}
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
// root.zig: the module root, with the gated features' type exports
|
|
235
|
+
// appended to the static built-in ones.
|
|
236
|
+
File({ name: 'root.zig' }, () => {
|
|
237
|
+
Fragment({
|
|
238
|
+
from: fragdir + 'Root.fragment.zig',
|
|
239
|
+
replace: {
|
|
240
|
+
...props.ctx$.stdrep,
|
|
241
|
+
|
|
242
|
+
'#FeatureExports': ({ indent }: any) => {
|
|
243
|
+
for (const fname of extraFeatures) {
|
|
244
|
+
// MUST match Config_zig's make_feature spelling of the type.
|
|
245
|
+
const tname = fname.charAt(0).toUpperCase() + fname.slice(1)
|
|
246
|
+
Content({ indent },
|
|
247
|
+
`pub const ${tname}Feature = @import("feature/${fname}.zig").${tname}Feature;\n`)
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
// feature/<name>/plugins.zig: the selected plugin definitions, as the root
|
|
255
|
+
// of the `sekretoplugins` module build.zig declares above (active only).
|
|
256
|
+
FeaturePlugins({ target })
|
|
257
|
+
|
|
54
258
|
// Generated core files: the client (sdk.zig) and the API config. The
|
|
55
259
|
// branded error type (error.zig) is a plain template (copied above).
|
|
56
260
|
Folder({ name: 'core' }, () => {
|
|
@@ -59,7 +263,7 @@ const Main = cmp(async function Main(props: any) {
|
|
|
59
263
|
|
|
60
264
|
Fragment(
|
|
61
265
|
{
|
|
62
|
-
from:
|
|
266
|
+
from: fragdir + 'Main.fragment.zig',
|
|
63
267
|
replace: {
|
|
64
268
|
...props.ctx$.stdrep,
|
|
65
269
|
}
|
|
@@ -15,6 +15,11 @@ const std = @import("std");
|
|
|
15
15
|
// The Zig test framework can crash with signal 11 during cleanup *after* all
|
|
16
16
|
// tests pass, due to *MapRef/*ListRef cross-references in arena teardown. The
|
|
17
17
|
// Makefile filters the output: "N/N tests passed" with N==total is success.
|
|
18
|
+
//
|
|
19
|
+
// GENERATED from src/cmp/zig/fragment/Build.fragment.zig (Main_zig): the
|
|
20
|
+
// `// #...` marker lines there are slots the generator fills from the model -
|
|
21
|
+
// a GATED feature's build modules and its test step appear only when the
|
|
22
|
+
// feature is active, so an SDK without that feature declares none of them.
|
|
18
23
|
pub fn build(b: *std.Build) void {
|
|
19
24
|
const target = b.standardTargetOptions(.{});
|
|
20
25
|
const optimize = b.standardOptimizeOption(.{});
|
|
@@ -44,6 +49,7 @@ pub fn build(b: *std.Build) void {
|
|
|
44
49
|
.optimize = optimize,
|
|
45
50
|
});
|
|
46
51
|
sdk_mod.addImport("voxgig-struct", struct_mod);
|
|
52
|
+
// #FeatureModules
|
|
47
53
|
|
|
48
54
|
const test_step = b.step("test", "Run all tests");
|
|
49
55
|
|
|
@@ -73,4 +79,5 @@ pub fn build(b: *std.Build) void {
|
|
|
73
79
|
run_t.has_side_effects = true;
|
|
74
80
|
test_step.dependOn(&run_t.step);
|
|
75
81
|
}
|
|
82
|
+
// #FeatureTestSteps
|
|
76
83
|
}
|
|
@@ -40,6 +40,22 @@ pub const ProjectNameSDK = struct {
|
|
|
40
40
|
rootctx: ?*Context = null,
|
|
41
41
|
|
|
42
42
|
pub fn new(options: Value) *ProjectNameSDK {
|
|
43
|
+
return new_with(options, &.{});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// The `extend` seam, in zig's spelling. go/ts/py read live Feature
|
|
47
|
+
// objects off `options.extend`; a zig Value is a CLOSED data union that
|
|
48
|
+
// cannot carry a Feature, so the extension list is a second argument
|
|
49
|
+
// instead - same meaning, same position in construction (added after the
|
|
50
|
+
// config-driven features, before any init runs).
|
|
51
|
+
//
|
|
52
|
+
// DELIBERATE DIVERGENCE: an extension whose NAME the config already
|
|
53
|
+
// installed is skipped. go adds it regardless and the kotlin/java suites
|
|
54
|
+
// work around the resulting double install (two transport wraps, two
|
|
55
|
+
// purchases) by probing the config first; here the seam itself keeps the
|
|
56
|
+
// set to one feature per name, so a suite can always hand in the feature
|
|
57
|
+
// it needs and hold in any generated tree.
|
|
58
|
+
pub fn new_with(options: Value, extend: []const Feature) *ProjectNameSDK {
|
|
43
59
|
const sdk = h.A().create(ProjectNameSDK) catch unreachable;
|
|
44
60
|
sdk.* = .{
|
|
45
61
|
.mode = "live",
|
|
@@ -92,6 +108,15 @@ pub const ProjectNameSDK = struct {
|
|
|
92
108
|
}
|
|
93
109
|
}
|
|
94
110
|
|
|
111
|
+
// Add extension features (see new_with).
|
|
112
|
+
for (extend) |f| {
|
|
113
|
+
var present = false;
|
|
114
|
+
for (sdk.features.items) |have| {
|
|
115
|
+
if (std.mem.eql(u8, have.name(), f.name())) present = true;
|
|
116
|
+
}
|
|
117
|
+
if (!present) sdk.sdkUtility.feature_add(rootctx, f);
|
|
118
|
+
}
|
|
119
|
+
|
|
95
120
|
// Initialize features.
|
|
96
121
|
var snap: std.ArrayList(Feature) = .empty;
|
|
97
122
|
for (sdk.features.items) |f| snap.append(h.A(), f) catch {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// ProjectName SDK for Zig (generated by @voxgig/sdkgen).
|
|
2
2
|
//
|
|
3
|
+
// GENERATED from src/cmp/zig/fragment/Root.fragment.zig (Main_zig) - see the
|
|
4
|
+
// FeatureExports marker below for the one model-driven slot.
|
|
5
|
+
//
|
|
3
6
|
// The module root: it re-exports the public surface and pulls in the whole
|
|
4
7
|
// SDK graph (core -> config -> features/utility/entities) so `@import("sdk")`
|
|
5
8
|
// from the test suite sees everything. Layout mirrors the other targets:
|
|
@@ -59,6 +62,12 @@ pub const DebugFeature = @import("feature/debug.zig").DebugFeature;
|
|
|
59
62
|
pub const AuditFeature = @import("feature/audit.zig").AuditFeature;
|
|
60
63
|
pub const ClienttrackFeature = @import("feature/clienttrack.zig").ClienttrackFeature;
|
|
61
64
|
pub const RbacFeature = @import("feature/rbac.zig").RbacFeature;
|
|
65
|
+
// GATED features (model/feature/<name>.aon `needs:`), exported ONLY when the
|
|
66
|
+
// model activates them: their source reaches a named build module (the
|
|
67
|
+
// vendored sekreto for `secrets`) that build.zig declares under the same
|
|
68
|
+
// condition, so a static export here would name a module an inactive SDK
|
|
69
|
+
// does not have. Filled by Main_zig from this marker.
|
|
70
|
+
// #FeatureExports
|
|
62
71
|
|
|
63
72
|
// Value helpers, re-exported so tests/consumers can build data.
|
|
64
73
|
pub const h = helpers;
|