@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.
Files changed (403) hide show
  1. package/bin/voxgig-sdkgen +22 -2
  2. package/dist/action/doctor.d.ts +14 -0
  3. package/dist/action/doctor.js +351 -0
  4. package/dist/action/doctor.js.map +1 -0
  5. package/dist/action/feature.js +48 -9
  6. package/dist/action/feature.js.map +1 -1
  7. package/dist/action/target.d.ts +6 -1
  8. package/dist/action/target.js +134 -22
  9. package/dist/action/target.js.map +1 -1
  10. package/dist/cmp/Entity.js +5 -0
  11. package/dist/cmp/Entity.js.map +1 -1
  12. package/dist/cmp/ExternalTarget.d.ts +2 -0
  13. package/dist/cmp/ExternalTarget.js +104 -0
  14. package/dist/cmp/ExternalTarget.js.map +1 -0
  15. package/dist/cmp/Feature.js +2 -1
  16. package/dist/cmp/Feature.js.map +1 -1
  17. package/dist/cmp/Main.js +5 -1
  18. package/dist/cmp/Main.js.map +1 -1
  19. package/dist/cmp/ReadmeExplanation.js +1 -1
  20. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  21. package/dist/cmp/ReadmeTop.js +16 -6
  22. package/dist/cmp/ReadmeTop.js.map +1 -1
  23. package/dist/cmp/Registered.d.ts +7 -0
  24. package/dist/cmp/Registered.js +70 -0
  25. package/dist/cmp/Registered.js.map +1 -0
  26. package/dist/cmp/Test.js +3 -1
  27. package/dist/cmp/Test.js.map +1 -1
  28. package/dist/helpers/dryrun.d.ts +10 -0
  29. package/dist/helpers/dryrun.js +35 -0
  30. package/dist/helpers/dryrun.js.map +1 -0
  31. package/dist/helpers/featureSource.d.ts +13 -0
  32. package/dist/helpers/featureSource.js +156 -0
  33. package/dist/helpers/featureSource.js.map +1 -0
  34. package/dist/helpers/naming.d.ts +9 -1
  35. package/dist/helpers/naming.js +66 -2
  36. package/dist/helpers/naming.js.map +1 -1
  37. package/dist/helpers/opExample.js +23 -3
  38. package/dist/helpers/opExample.js.map +1 -1
  39. package/dist/helpers/opShape.d.ts +11 -1
  40. package/dist/helpers/opShape.js +51 -0
  41. package/dist/helpers/opShape.js.map +1 -1
  42. package/dist/helpers/packageMeta.d.ts +16 -1
  43. package/dist/helpers/packageMeta.js +181 -10
  44. package/dist/helpers/packageMeta.js.map +1 -1
  45. package/dist/helpers/stdrep.d.ts +3 -0
  46. package/dist/helpers/stdrep.js +47 -0
  47. package/dist/helpers/stdrep.js.map +1 -0
  48. package/dist/helpers/testPolicy.d.ts +2 -0
  49. package/dist/helpers/testPolicy.js +46 -0
  50. package/dist/helpers/testPolicy.js.map +1 -0
  51. package/dist/sdkgen.d.ts +15 -6
  52. package/dist/sdkgen.js +273 -5
  53. package/dist/sdkgen.js.map +1 -1
  54. package/dist/tsconfig.tsbuildinfo +1 -1
  55. package/dist/types.d.ts +12 -0
  56. package/dist/utility.js +10 -1
  57. package/dist/utility.js.map +1 -1
  58. package/model/sdkgen.aontu +245 -0
  59. package/package.json +5 -3
  60. package/project/.sdk/model/target/c.aontu +28 -3
  61. package/project/.sdk/model/target/clojure.aontu +24 -3
  62. package/project/.sdk/model/target/cpp.aontu +25 -3
  63. package/project/.sdk/model/target/csharp.aontu +25 -3
  64. package/project/.sdk/model/target/dart.aontu +15 -3
  65. package/project/.sdk/model/target/elixir.aontu +15 -3
  66. package/project/.sdk/model/target/go-cli.aontu +16 -1
  67. package/project/.sdk/model/target/go-mcp.aontu +16 -1
  68. package/project/.sdk/model/target/go.aontu +14 -4
  69. package/project/.sdk/model/target/haskell.aontu +24 -3
  70. package/project/.sdk/model/target/java.aontu +25 -3
  71. package/project/.sdk/model/target/js.aontu +15 -3
  72. package/project/.sdk/model/target/kotlin.aontu +25 -3
  73. package/project/.sdk/model/target/lean.aontu +24 -3
  74. package/project/.sdk/model/target/lua.aontu +15 -3
  75. package/project/.sdk/model/target/ocaml.aontu +24 -3
  76. package/project/.sdk/model/target/perl.aontu +15 -3
  77. package/project/.sdk/model/target/php.aontu +15 -3
  78. package/project/.sdk/model/target/py-data.aontu +15 -3
  79. package/project/.sdk/model/target/py.aontu +15 -3
  80. package/project/.sdk/model/target/rb.aontu +15 -3
  81. package/project/.sdk/model/target/rust.aontu +25 -3
  82. package/project/.sdk/model/target/scala.aontu +24 -3
  83. package/project/.sdk/model/target/seneca-provider.aontu +118 -0
  84. package/project/.sdk/model/target/swift.aontu +25 -3
  85. package/project/.sdk/model/target/ts.aontu +15 -3
  86. package/project/.sdk/model/target/zig.aontu +25 -3
  87. package/project/.sdk/src/cmp/c/Config_c.ts +10 -11
  88. package/project/.sdk/src/cmp/c/Entity_c.ts +5 -1
  89. package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +23 -5
  90. package/project/.sdk/src/cmp/c/fragment/EntityCreateOp.fragment.c +9 -2
  91. package/project/.sdk/src/cmp/c/fragment/EntityListOp.fragment.c +19 -2
  92. package/project/.sdk/src/cmp/c/fragment/EntityLoadOp.fragment.c +9 -2
  93. package/project/.sdk/src/cmp/c/fragment/EntityRemoveOp.fragment.c +12 -2
  94. package/project/.sdk/src/cmp/c/fragment/EntityUpdateOp.fragment.c +9 -2
  95. package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +1 -0
  96. package/project/.sdk/src/cmp/clojure/TestEntity_clojure.ts +6 -3
  97. package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
  98. package/project/.sdk/src/cmp/clojure/fragment/EntityCreateOp.fragment.clj +2 -2
  99. package/project/.sdk/src/cmp/clojure/fragment/EntityLoadOp.fragment.clj +2 -2
  100. package/project/.sdk/src/cmp/clojure/fragment/EntityRemoveOp.fragment.clj +12 -8
  101. package/project/.sdk/src/cmp/clojure/fragment/EntityUpdateOp.fragment.clj +2 -2
  102. package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +5 -1
  103. package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +12 -9
  104. package/project/.sdk/src/cmp/cpp/fragment/EntityCreateOp.fragment.cpp +8 -2
  105. package/project/.sdk/src/cmp/cpp/fragment/EntityListOp.fragment.cpp +18 -2
  106. package/project/.sdk/src/cmp/cpp/fragment/EntityLoadOp.fragment.cpp +8 -2
  107. package/project/.sdk/src/cmp/cpp/fragment/EntityRemoveOp.fragment.cpp +11 -2
  108. package/project/.sdk/src/cmp/cpp/fragment/EntityUpdateOp.fragment.cpp +8 -2
  109. package/project/.sdk/src/cmp/csharp/Package_csharp.ts +2 -1
  110. package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +3 -3
  111. package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +6 -6
  112. package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +38 -1
  113. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +42 -33
  114. package/project/.sdk/src/cmp/dart/Package_dart.ts +2 -1
  115. package/project/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +13 -2
  116. package/project/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +2 -1
  117. package/project/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +3 -3
  118. package/project/.sdk/src/cmp/dart/ReadmeModel_dart.ts +1 -1
  119. package/project/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +17 -6
  120. package/project/.sdk/src/cmp/dart/ReadmeRef_dart.ts +13 -2
  121. package/project/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +13 -2
  122. package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +3 -3
  123. package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +8 -8
  124. package/project/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +18 -1
  125. package/project/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +9 -1
  126. package/project/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +9 -1
  127. package/project/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +15 -1
  128. package/project/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +9 -1
  129. package/project/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +8 -0
  130. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +3 -1
  131. package/project/.sdk/src/cmp/elixir/ReadmeInstall_elixir.ts +2 -2
  132. package/project/.sdk/src/cmp/elixir/TestEntity_elixir.ts +11 -2
  133. package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +2 -1
  134. package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +1 -0
  135. package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +2 -1
  136. package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +4 -1
  137. package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +2 -1
  138. package/project/.sdk/src/cmp/go/EntityTypes_go.ts +38 -8
  139. package/project/.sdk/src/cmp/go/Entity_go.ts +2 -2
  140. package/project/.sdk/src/cmp/go/Main_go.ts +4 -5
  141. package/project/.sdk/src/cmp/go/Package_go.ts +8 -5
  142. package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +2 -2
  143. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +2 -2
  144. package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +4 -2
  145. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +2 -2
  146. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +2 -2
  147. package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +2 -2
  148. package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +2 -2
  149. package/project/.sdk/src/cmp/go/TestDirect_go.ts +21 -15
  150. package/project/.sdk/src/cmp/go/TestEntity_go.ts +9 -9
  151. package/project/.sdk/src/cmp/go/Test_go.ts +2 -2
  152. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -1
  153. package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +4 -4
  154. package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +4 -4
  155. package/project/.sdk/src/cmp/haskell/Package_haskell.ts +2 -1
  156. package/project/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +10 -5
  157. package/project/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +10 -8
  158. package/project/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +14 -10
  159. package/project/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +21 -18
  160. package/project/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +4 -4
  161. package/project/.sdk/src/cmp/haskell/Test_haskell.ts +23 -11
  162. package/project/.sdk/src/cmp/java/Package_java.ts +2 -1
  163. package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +2 -1
  164. package/project/.sdk/src/cmp/java/ReadmeInstall_java.ts +2 -2
  165. package/project/.sdk/src/cmp/java/ReadmeModel_java.ts +1 -1
  166. package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +3 -3
  167. package/project/.sdk/src/cmp/java/TestDirect_java.ts +3 -3
  168. package/project/.sdk/src/cmp/java/TestEntity_java.ts +6 -6
  169. package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +34 -1
  170. package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +12 -0
  171. package/project/.sdk/src/cmp/js/Main_js.ts +4 -1
  172. package/project/.sdk/src/cmp/js/Package_js.ts +7 -1
  173. package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -2
  174. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +2 -1
  175. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +13 -2
  176. package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +13 -2
  177. package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +2 -1
  178. package/project/.sdk/src/cmp/js/TestDirect_js.ts +3 -3
  179. package/project/.sdk/src/cmp/js/TestEntity_js.ts +8 -8
  180. package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +22 -1
  181. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +9 -1
  182. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +9 -1
  183. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +15 -1
  184. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +9 -1
  185. package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +13 -0
  186. package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +2 -1
  187. package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +2 -1
  188. package/project/.sdk/src/cmp/kotlin/ReadmeInstall_kotlin.ts +2 -2
  189. package/project/.sdk/src/cmp/kotlin/ReadmeModel_kotlin.ts +1 -1
  190. package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +3 -3
  191. package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +3 -3
  192. package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +6 -6
  193. package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +32 -1
  194. package/project/.sdk/src/cmp/lean/Package_lean.ts +3 -1
  195. package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +9 -4
  196. package/project/.sdk/src/cmp/lua/Package_lua.ts +4 -3
  197. package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +11 -3
  198. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +1 -1
  199. package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +3 -3
  200. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +9 -9
  201. package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +37 -1
  202. package/project/.sdk/src/cmp/lua/fragment/SdkError.fragment.lua +12 -0
  203. package/project/.sdk/src/cmp/ocaml/EntityOperation_ocaml.ts +30 -3
  204. package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +11 -5
  205. package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +3 -1
  206. package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +10 -5
  207. package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +6 -2
  208. package/project/.sdk/src/cmp/ocaml/ReadmeModel_ocaml.ts +10 -8
  209. package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +14 -13
  210. package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +20 -18
  211. package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +4 -4
  212. package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +8 -2
  213. package/project/.sdk/src/cmp/ocaml/TestEntity_ocaml.ts +8 -5
  214. package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +2 -1
  215. package/project/.sdk/src/cmp/perl/ReadmeModel_perl.ts +1 -1
  216. package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +3 -3
  217. package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +1 -1
  218. package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +3 -3
  219. package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +6 -6
  220. package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +36 -1
  221. package/project/.sdk/src/cmp/php/MainEntity_php.ts +21 -16
  222. package/project/.sdk/src/cmp/php/Package_php.ts +2 -2
  223. package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +6 -6
  224. package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +4 -3
  225. package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +2 -2
  226. package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +1 -1
  227. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +12 -12
  228. package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +6 -6
  229. package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +4 -4
  230. package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +2 -2
  231. package/project/.sdk/src/cmp/php/TestDirect_php.ts +3 -3
  232. package/project/.sdk/src/cmp/php/TestEntity_php.ts +17 -15
  233. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +20 -1
  234. package/project/.sdk/src/cmp/php/fragment/SdkError.fragment.php +11 -0
  235. package/project/.sdk/src/cmp/py/Package_py.ts +4 -3
  236. package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +13 -2
  237. package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +2 -1
  238. package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +1 -1
  239. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +17 -6
  240. package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +14 -3
  241. package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +13 -2
  242. package/project/.sdk/src/cmp/py/TestDirect_py.ts +3 -3
  243. package/project/.sdk/src/cmp/py/TestEntity_py.ts +9 -9
  244. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +29 -1
  245. package/project/.sdk/src/cmp/py/fragment/SdkError.fragment.py +11 -0
  246. package/project/.sdk/src/cmp/py-data/Main_py-data.ts +2 -1
  247. package/project/.sdk/src/cmp/rb/Package_rb.ts +4 -3
  248. package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +1 -1
  249. package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +2 -1
  250. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +5 -5
  251. package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +1 -1
  252. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +3 -3
  253. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +9 -9
  254. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +31 -1
  255. package/project/.sdk/src/cmp/rb/fragment/SdkError.fragment.rb +10 -1
  256. package/project/.sdk/src/cmp/rust/Entity_rust.ts +5 -1
  257. package/project/.sdk/src/cmp/rust/Main_rust.ts +21 -0
  258. package/project/.sdk/src/cmp/rust/Package_rust.ts +2 -1
  259. package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +3 -3
  260. package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +12 -12
  261. package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +18 -0
  262. package/project/.sdk/src/cmp/rust/fragment/EntityCreateOp.fragment.rs +8 -2
  263. package/project/.sdk/src/cmp/rust/fragment/EntityListOp.fragment.rs +20 -3
  264. package/project/.sdk/src/cmp/rust/fragment/EntityLoadOp.fragment.rs +8 -2
  265. package/project/.sdk/src/cmp/rust/fragment/EntityRemoveOp.fragment.rs +10 -2
  266. package/project/.sdk/src/cmp/rust/fragment/EntityUpdateOp.fragment.rs +8 -2
  267. package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +10 -0
  268. package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +2 -1
  269. package/project/.sdk/src/cmp/scala/ReadmeInstall_scala.ts +3 -3
  270. package/project/.sdk/src/cmp/scala/ReadmeModel_scala.ts +1 -1
  271. package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +3 -3
  272. package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +3 -3
  273. package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +27 -1
  274. package/project/.sdk/src/cmp/seneca-provider/Extras_seneca-provider.ts +3915 -0
  275. package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +960 -0
  276. package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +2 -1
  277. package/project/.sdk/src/cmp/swift/ReadmeInstall_swift.ts +3 -3
  278. package/project/.sdk/src/cmp/swift/ReadmeModel_swift.ts +1 -1
  279. package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +3 -3
  280. package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +34 -1
  281. package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +9 -1
  282. package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +18 -1
  283. package/project/.sdk/src/cmp/ts/Gitignore_ts.ts +5 -2
  284. package/project/.sdk/src/cmp/ts/Main_ts.ts +4 -1
  285. package/project/.sdk/src/cmp/ts/Package_ts.ts +10 -1
  286. package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -2
  287. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +2 -1
  288. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +21 -6
  289. package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +52 -2
  290. package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +14 -3
  291. package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +34 -2
  292. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +64 -43
  293. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +8 -8
  294. package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +2 -2
  295. package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +2 -2
  296. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +25 -1
  297. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +10 -2
  298. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +1 -1
  299. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +10 -2
  300. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +27 -3
  301. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +10 -2
  302. package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +15 -0
  303. package/project/.sdk/src/cmp/zig/Entity_zig.ts +5 -1
  304. package/project/.sdk/src/cmp/zig/Package_zig.ts +3 -1
  305. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +39 -0
  306. package/project/.sdk/src/cmp/zig/fragment/EntityCreateOp.fragment.zig +2 -2
  307. package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +21 -2
  308. package/project/.sdk/src/cmp/zig/fragment/EntityLoadOp.fragment.zig +2 -2
  309. package/project/.sdk/src/cmp/zig/fragment/EntityRemoveOp.fragment.zig +5 -2
  310. package/project/.sdk/src/cmp/zig/fragment/EntityUpdateOp.fragment.zig +2 -2
  311. package/project/.sdk/tm/c/VERSION +1 -1
  312. package/project/.sdk/tm/c/core/helpers.c +1 -0
  313. package/project/.sdk/tm/c/core/sdk.h +22 -6
  314. package/project/.sdk/tm/c/tests/feature_harness.h +1 -0
  315. package/project/.sdk/tm/c/tests/primary_utility_test.c +4 -1
  316. package/project/.sdk/tm/c/utility/make_url.c +1 -0
  317. package/project/.sdk/tm/c/utility/param.c +1 -0
  318. package/project/.sdk/tm/clojure/VERSION +1 -1
  319. package/project/.sdk/tm/cpp/VERSION +1 -1
  320. package/project/.sdk/tm/cpp/core/types.hpp +33 -8
  321. package/project/.sdk/tm/cpp/test/pipeline_test.cpp +5 -0
  322. package/project/.sdk/tm/cpp/test/runner_support.hpp +4 -4
  323. package/project/.sdk/tm/csharp/VERSION +1 -1
  324. package/project/.sdk/tm/csharp/core/Types.cs +6 -0
  325. package/project/.sdk/tm/csharp/test/FeatureHarness.cs +396 -0
  326. package/project/.sdk/tm/csharp/test/FeatureTest.cs +7 -385
  327. package/project/.sdk/tm/csharp/test/Runner.cs +4 -4
  328. package/project/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +4 -0
  329. package/project/.sdk/tm/dart/test/utility.dart +4 -4
  330. package/project/.sdk/tm/elixir/VERSION +1 -1
  331. package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +26 -0
  332. package/project/.sdk/tm/go/VERSION +1 -1
  333. package/project/.sdk/tm/go/core/types.go +6 -0
  334. package/project/.sdk/tm/go/test/feature_harness_test.go +361 -0
  335. package/project/.sdk/tm/go/test/feature_test.go +7 -350
  336. package/project/.sdk/tm/go/test/pipeline_test.go +6 -0
  337. package/project/.sdk/tm/go/test/runner_test.go +16 -4
  338. package/project/.sdk/tm/haskell/VERSION +1 -1
  339. package/project/.sdk/tm/haskell/src/SdkFeatures.hs +28 -5
  340. package/project/.sdk/tm/haskell/src/SdkTypes.hs +14 -5
  341. package/project/.sdk/tm/java/VERSION +1 -1
  342. package/project/.sdk/tm/java/test/RunnerSupport.java +4 -4
  343. package/project/.sdk/tm/java/utility/MakeError.java +4 -0
  344. package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +4 -0
  345. package/project/.sdk/tm/js/test/utility.js +3 -3
  346. package/project/.sdk/tm/kotlin/VERSION +1 -1
  347. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +3 -3
  348. package/project/.sdk/tm/lean/VERSION +1 -1
  349. package/project/.sdk/tm/lean/test/TFeature.lean +27 -14
  350. package/project/.sdk/tm/lua/test/runner.lua +4 -4
  351. package/project/.sdk/tm/lua/utility/make_error.lua +4 -0
  352. package/project/.sdk/tm/ocaml/VERSION +1 -1
  353. package/project/.sdk/tm/ocaml/sdk_types.ml +14 -5
  354. package/project/.sdk/tm/ocaml/test/t_pipeline.ml +5 -2
  355. package/project/.sdk/tm/perl/t/runner.pm +4 -4
  356. package/project/.sdk/tm/php/VERSION +1 -1
  357. package/project/.sdk/tm/php/test/Runner.php +4 -4
  358. package/project/.sdk/tm/php/utility/MakeError.php +5 -0
  359. package/project/.sdk/tm/py/pkg/utility/make_error.py +4 -0
  360. package/project/.sdk/tm/py/test/runner.py +19 -4
  361. package/project/.sdk/tm/rb/test/runner.rb +4 -4
  362. package/project/.sdk/tm/rb/utility/make_error.rb +4 -0
  363. package/project/.sdk/tm/rust/VERSION +1 -1
  364. package/project/.sdk/tm/rust/core/types.rs +22 -6
  365. package/project/.sdk/tm/rust/tests/common/mod.rs +6 -6
  366. package/project/.sdk/tm/rust/tests/pipeline_test.rs +6 -0
  367. package/project/.sdk/tm/rust/utility/make_error.rs +4 -0
  368. package/project/.sdk/tm/scala/VERSION +1 -1
  369. package/project/.sdk/tm/seneca-provider/CODE_OF_CONDUCT.md +132 -0
  370. package/project/.sdk/tm/seneca-provider/LICENSE +21 -0
  371. package/project/.sdk/tm/seneca-provider/Makefile +15 -0
  372. package/project/.sdk/tm/seneca-provider/src/tsconfig.json +18 -0
  373. package/project/.sdk/tm/seneca-provider/test/tsconfig.json +16 -0
  374. package/project/.sdk/tm/seneca-provider/tsfmt.json +3 -0
  375. package/project/.sdk/tm/swift/VERSION +1 -1
  376. package/project/.sdk/tm/ts/src/tsconfig.json +1 -0
  377. package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +4 -0
  378. package/project/.sdk/tm/ts/test/tsconfig.json +1 -0
  379. package/project/.sdk/tm/ts/test/utility.ts +3 -3
  380. package/project/.sdk/tm/zig/VERSION +1 -1
  381. package/src/action/doctor.ts +475 -0
  382. package/src/action/feature.ts +54 -16
  383. package/src/action/target.ts +174 -25
  384. package/src/cmp/Entity.ts +7 -0
  385. package/src/cmp/ExternalTarget.ts +125 -0
  386. package/src/cmp/Feature.ts +3 -1
  387. package/src/cmp/Main.ts +7 -1
  388. package/src/cmp/ReadmeExplanation.ts +2 -2
  389. package/src/cmp/ReadmeTop.ts +22 -9
  390. package/src/cmp/Registered.ts +100 -0
  391. package/src/cmp/Test.ts +4 -1
  392. package/src/helpers/dryrun.ts +57 -0
  393. package/src/helpers/featureSource.ts +208 -0
  394. package/src/helpers/naming.ts +73 -2
  395. package/src/helpers/opExample.ts +19 -2
  396. package/src/helpers/opShape.ts +65 -0
  397. package/src/helpers/packageMeta.ts +211 -10
  398. package/src/helpers/stdrep.ts +56 -0
  399. package/src/helpers/testPolicy.ts +52 -0
  400. package/src/sdkgen.ts +350 -5
  401. package/src/types.ts +24 -1
  402. package/src/utility.ts +10 -1
  403. package/project/.sdk/tm/rust/feature/mod.rs +0 -24
package/src/sdkgen.ts CHANGED
@@ -22,6 +22,9 @@ import type {
22
22
  import { SdkGenError, requirePath, isAuthActive, resolveAuthPrefix } from './utility'
23
23
 
24
24
  import { Main } from './cmp/Main'
25
+ import { ExternalTarget } from './cmp/ExternalTarget'
26
+
27
+ import { KIT } from '@voxgig/apidef'
25
28
  import { Deploy } from './cmp/Deploy'
26
29
  import { Entity } from './cmp/Entity'
27
30
  import { Feature } from './cmp/Feature'
@@ -45,15 +48,29 @@ import { ReadmeHowto } from './cmp/ReadmeHowto'
45
48
  import { ReadmeExplanation } from './cmp/ReadmeExplanation'
46
49
  import { ReadmeRef } from './cmp/ReadmeRef'
47
50
  import { FeatureHook } from './cmp/FeatureHook'
51
+ import { registerComponent } from './cmp/Registered'
52
+ import type { RegisterOptions } from './cmp/Registered'
48
53
 
49
54
  import { buildIdNames } from './helpers/buildIdNames'
50
55
  import { getMatchEntries } from './helpers/getMatchEntries'
51
56
  import { collectDeps } from './helpers/collectDeps'
52
57
  import type { DepEntry } from './helpers/collectDeps'
53
58
  import { canonToType, canonToDtype, canonKey } from './helpers/canonType'
54
- import { OP_SUFFIX, opTypeName, opParams, opRequestShape, entityIdField, entityDataIdField, entityOps, entityPrimaryOp, pickExampleEntity, entityClassName, entityTypeCollisions, warnEntityTypeCollisions, deriveEntityNames, entityCollection } from './helpers/opShape'
55
- import { isReservedName, safeVarName, exampleVarName, isRbCoreConstant, rbSafeTypeName, isSwiftSdkType, swiftSafeTypeName, jsProp, jsOptProp, jsKey } from './helpers/naming'
59
+ import { OP_SUFFIX, opTypeName, opParams, opActions, entityActions, entityPath, opRequestShape, entityIdField, entityDataIdField, entityOps, entityPrimaryOp, pickExampleEntity, entityClassName, entityTypeCollisions, warnEntityTypeCollisions, deriveEntityNames, entityCollection } from './helpers/opShape'
60
+ import { isReservedName, safeVarName, exampleVarName, phpEntityAccessor, entityCacheField, isRbCoreConstant, rbSafeTypeName, isSwiftSdkType, swiftSafeTypeName, jsProp, jsOptProp, jsKey } from './helpers/naming'
56
61
  import { serverVariables, hasServerVariables } from './helpers/serverVars'
62
+ import { primaryOpCall, idLiteral, matchArg, dataArg, litFor } from './helpers/opExample'
63
+ import type { ExampleLang } from './helpers/opExample'
64
+ import { liveStrict } from './helpers/testPolicy'
65
+ import {
66
+ featureOf,
67
+ availableFeatures,
68
+ findFeatureSources,
69
+ featureExcludes,
70
+ fullsetExcludes,
71
+ srcFeatureExcludes,
72
+ } from './helpers/featureSource'
73
+ import type { FeatureSource } from './helpers/featureSource'
57
74
  import {
58
75
  packageName,
59
76
  installCommand,
@@ -64,7 +81,14 @@ import {
64
81
  pkgDescription,
65
82
  nonAffiliation,
66
83
  keywords,
84
+ authorInfo,
85
+ contributorList,
67
86
  envName,
87
+ envToken,
88
+ goModule,
89
+ goVersion,
90
+ goPackageIdent,
91
+ packageVersion,
68
92
  repoInfo,
69
93
  apiName,
70
94
  langLabel,
@@ -85,6 +109,12 @@ import {
85
109
  feature_add,
86
110
  } from './action/feature'
87
111
 
112
+ import {
113
+ action_doctor,
114
+ doctor,
115
+ } from './action/doctor'
116
+ import type { DoctorReport } from './action/doctor'
117
+
88
118
 
89
119
 
90
120
  // TODO: use shape
@@ -120,6 +150,7 @@ const { Jostraca } = JostracaModule
120
150
  const ACTION_MAP: any = {
121
151
  target: action_target,
122
152
  feature: action_feature,
153
+ doctor: action_doctor,
123
154
  }
124
155
 
125
156
 
@@ -190,12 +221,70 @@ function SdkGen(opts: SdkGenOptions) {
190
221
  // at the scaffold source (create-sdkgen build/sdkgen.js: existing.txt =
191
222
  // { write:true, merge:false }); see docs/explanation/regeneration-overwrite.md.
192
223
  existing: opts.existing,
224
+ // Per-call, for the same reason the actions pass it: jostraca applies
225
+ // OptionsShape to `generate`'s own options first, so its
226
+ // `control.dryrun: false` default wins over the instance-level flag.
227
+ control: {
228
+ dryrun: !!opts.dryrun
229
+ },
193
230
  }
194
231
 
195
- const jres = await jostraca.generate(jopts, () => Root({ model }))
232
+ // Targets that write OUTSIDE the SDK repo (`output: path`) are generated
233
+ // by their own pass, rooted at that path — see cmp/ExternalTarget for why
234
+ // a folder name cannot do this. The in-tree pass must not see them, or
235
+ // the consumer Root would also emit them into `<sdk-repo>/<target>/`.
236
+ //
237
+ // `folder` may be relative (a consumer's build passes '..' from `.sdk`),
238
+ // so resolve it ONCE: every destination is compared against it, and a
239
+ // comparison between a relative and an absolute path is meaningless.
240
+ const root = Path.resolve(folder)
241
+ const external = externalTargets(model, root)
242
+
243
+ // Before ANY file is written, in-tree included: a destination that turns
244
+ // out to be wrong must abort the whole generation, not leave half of it
245
+ // done. See checkExternalFolders.
246
+ checkExternalFolders(external, root, fs)
247
+
248
+ const jres = await jostraca.generate(
249
+ jopts, () => Root({ model: 0 === external.length ? model : withoutTargets(model, external) }))
196
250
 
197
251
  showChanges(jopts.log, 'generate-result', jres, Path.dirname(process.cwd()))
198
252
 
253
+ for (const ext of external) {
254
+ // `active: false` is the project's only lever to stop the generator
255
+ // writing into a repo it does not own, so it has to be honoured HERE —
256
+ // the consumer Root iterates targets raw and does not check it. The
257
+ // target is still removed from the in-tree model above (withoutTargets
258
+ // takes every `output: path` target, active or not), so switching one
259
+ // off generates it nowhere rather than relocating it into
260
+ // `<sdk-repo>/<target>/`.
261
+ if (!ext.active) {
262
+ log.info({
263
+ point: 'generate-external-skip', target: ext.name, folder: ext.folder,
264
+ note: ext.name + ' inactive, not generated'
265
+ })
266
+ continue
267
+ }
268
+
269
+ log.info({
270
+ point: 'generate-external', target: ext.name, folder: ext.folder,
271
+ note: ext.name + ' -> ' + ext.folder
272
+ })
273
+
274
+ const eres = await jostraca.generate(
275
+ { ...jopts, folder: ext.folder },
276
+ () => ExternalTarget({
277
+ model, target: ext.target, cmpfolder: folder,
278
+ // How to walk BACK to the SDK project from the destination. A
279
+ // target generating out of tree usually sits beside the SDK in a
280
+ // known layout, and its own docs, scripts and live tests need to
281
+ // name that path.
282
+ sdkrelpath: externalSdkRel(ext, root, log),
283
+ }))
284
+
285
+ showChanges(jopts.log, 'generate-result', eres, Path.dirname(process.cwd()))
286
+ }
287
+
199
288
  const dlogs = dlog.log()
200
289
  if (0 < dlogs.length) {
201
290
  for (let dlogentry of dlogs) {
@@ -209,7 +298,7 @@ function SdkGen(opts: SdkGenOptions) {
209
298
  }
210
299
 
211
300
 
212
- async function action(args: string[]) {
301
+ async function action(args: string[]): Promise<any> {
213
302
  const pargs = args.map(arg => Jsonic(arg))
214
303
 
215
304
  const actname = args[0]
@@ -221,7 +310,7 @@ function SdkGen(opts: SdkGenOptions) {
221
310
 
222
311
  const ctx = resolveActionContext()
223
312
 
224
- await actionFunc(pargs, ctx)
313
+ return await actionFunc(pargs, ctx)
225
314
  }
226
315
 
227
316
 
@@ -297,12 +386,19 @@ function SdkGen(opts: SdkGenOptions) {
297
386
  }
298
387
  }
299
388
 
389
+ // Has this project's `.sdk/` drifted from the scaffold? See action/doctor.
390
+ const check = async (): Promise<ActionResult> => {
391
+ const ctx = resolveActionContext()
392
+ return doctor(ctx)
393
+ }
394
+
300
395
 
301
396
 
302
397
  return {
303
398
  pino: pino as any,
304
399
  generate,
305
400
  action,
401
+ check,
306
402
  target,
307
403
  feature,
308
404
  }
@@ -338,6 +434,226 @@ SdkGen.makeBuild = async function(opts: SdkGenOptions) {
338
434
 
339
435
 
340
436
 
437
+ type ExternalSpec = {
438
+ name: string
439
+ target: any
440
+ folder: string
441
+ active: boolean
442
+ }
443
+
444
+
445
+ // Targets declaring `output: path` — generated into their own repo rather
446
+ // than into `<sdk-repo>/<target>/`.
447
+ //
448
+ // A relative path resolves against the SDK repo root, so a sibling checkout
449
+ // is '../<repo>'. That is deliberately the SAME base the generator writes
450
+ // everything else against: a path in the model should not depend on the
451
+ // directory the command happened to be run from.
452
+ //
453
+ // An INACTIVE target is still listed: it must be taken out of the in-tree
454
+ // model (see withoutTargets) so that switching it off does not silently
455
+ // relocate it into `<sdk-repo>/<target>/`. The generate loop skips it.
456
+ function externalTargets(model: any, folder: string): ExternalSpec[] {
457
+ const targets = model?.main?.[KIT]?.target || {}
458
+
459
+ return Object.keys(targets).sort()
460
+ .map((name: string) => ({ name, target: targets[name] }))
461
+ .filter((t: any) => {
462
+ const path = t.target?.output?.path
463
+ return null != path && '' !== path
464
+ })
465
+ .map((t: any) => ({
466
+ ...t,
467
+ folder: Path.resolve(folder, String(t.target.output.path)),
468
+ active: false !== t.target.active,
469
+ }))
470
+ }
471
+
472
+
473
+ // The `.jostraca` bookkeeping tree (meta log + a duplicate of the last
474
+ // generated output) that jostraca leaves at an output root. It is the only
475
+ // on-disk evidence that this toolchain has generated into a directory
476
+ // before, so it doubles as the OWNERSHIP MARKER: a destination carrying one
477
+ // has been generated into already, whoever set it up.
478
+ const EXTERNAL_MARKER = '.jostraca'
479
+
480
+ // Entries that do not count as content when deciding whether a destination
481
+ // is empty. A `git init` (or a clone of an empty repo) leaves only `.git`,
482
+ // and that is exactly the destination a FIRST generation is aimed at.
483
+ const EXTERNAL_EMPTY = ['.git', '.DS_Store']
484
+
485
+
486
+ // Refuse a destination the project cannot have meant.
487
+ //
488
+ // The external pass is the one code path that writes outside the repo it was
489
+ // pointed at, at a filesystem path taken verbatim from the model — and
490
+ // generation is overwrite, not merge, while jostraca's ensureDir creates
491
+ // missing parents. So a mistyped `output: path` does not fail: it fabricates
492
+ // a package tree at an arbitrary location, or overwrites an unrelated repo's
493
+ // package.json, README.md, LICENSE and CI workflow in place. The only trace
494
+ // was one INFO line naming the resolved folder.
495
+ //
496
+ // A destination must therefore be:
497
+ // - outside the SDK project, in BOTH directions — inside it is what a
498
+ // typo like '.' or 'ts' produces (and the external pass runs SECOND, so
499
+ // it wins over what the in-tree pass just wrote), while a destination
500
+ // that CONTAINS the project is what '..' produces;
501
+ // - claimed by no other target;
502
+ // - and either absent, empty, or carrying the marker a previous
503
+ // generation left there.
504
+ //
505
+ // Anything else is refused with both paths named. NOT skipped: a project
506
+ // generating somewhere other than it believes must be told. A destination
507
+ // that legitimately holds other content first (a repo seeded with a README
508
+ // and LICENCE) says so once in the model, with `output: adopt: true`.
509
+ function checkExternalFolders(external: ExternalSpec[], root: string, fs: any) {
510
+ const claimed: Record<string, string> = {}
511
+
512
+ for (const ext of external) {
513
+ // An inactive target writes nothing, so its destination is not a hazard —
514
+ // and switching a target off must not require keeping its now-unused
515
+ // path valid.
516
+ if (!ext.active) continue
517
+
518
+ const where = 'Target "' + ext.name + '" has output path "' +
519
+ ext.target.output.path + '", which resolves to: ' + ext.folder +
520
+ '\n (SDK project: ' + root + ')'
521
+
522
+ if (ext.folder === root || folderContains(root, ext.folder)) {
523
+ throw new SdkGenError(
524
+ 'External target output path is inside the SDK project.\n ' + where +
525
+ '\n A target generating into the SDK project must leave `output: ' +
526
+ 'path` unset — it is then generated in-tree, as <sdk-project>/' +
527
+ ext.name + '/.')
528
+ }
529
+
530
+ if (folderContains(ext.folder, root)) {
531
+ throw new SdkGenError(
532
+ 'External target output path contains the SDK project.\n ' + where +
533
+ '\n Generation would write this package over the directory holding ' +
534
+ 'the SDK project itself.')
535
+ }
536
+
537
+ if (null != claimed[ext.folder]) {
538
+ throw new SdkGenError(
539
+ 'External target output path is already claimed by target "' +
540
+ claimed[ext.folder] + '".\n ' + where +
541
+ '\n Two targets generating into the same folder overwrite each ' +
542
+ 'other, in target-name order.')
543
+ }
544
+ claimed[ext.folder] = ext.name
545
+
546
+ if (!fs.existsSync(ext.folder)) continue
547
+
548
+ if (!fs.statSync(ext.folder).isDirectory()) {
549
+ throw new SdkGenError(
550
+ 'External target output path is not a folder.\n ' + where)
551
+ }
552
+
553
+ if (true === ext.target.output.adopt) continue
554
+
555
+ const entries: string[] = fs.readdirSync(ext.folder)
556
+ .map((entry: any) => String(entry))
557
+
558
+ if (entries.includes(EXTERNAL_MARKER)) continue
559
+
560
+ const content = entries.filter((entry) => !EXTERNAL_EMPTY.includes(entry))
561
+
562
+ if (0 < content.length) {
563
+ throw new SdkGenError(
564
+ 'External target output folder already holds content this generator ' +
565
+ 'did not write.\n ' + where +
566
+ '\n Found: ' + content.slice(0, 8).join(', ') +
567
+ (8 < content.length ? ', ...' : '') +
568
+ '\n Generation OVERWRITES, so this would replace that content. ' +
569
+ 'Check the path;\n if the folder is right, declare it: `main: kit: ' +
570
+ 'target: \'' + ext.name + '\': output: adopt: true`.')
571
+ }
572
+ }
573
+ }
574
+
575
+
576
+ // Is `path` inside `folder`? Both must already be resolved. Path.relative
577
+ // rather than a string prefix, so that a sibling whose name merely STARTS
578
+ // with the folder's ('/x/sdk' vs '/x/sdk-provider') is not read as nested.
579
+ function folderContains(folder: string, path: string): boolean {
580
+ const rel = Path.relative(folder, path)
581
+ return '' !== rel && !rel.startsWith('..' + Path.sep) && '..' !== rel &&
582
+ !Path.isAbsolute(rel)
583
+ }
584
+
585
+
586
+ // The path from the destination back to the SDK project, which the target's
587
+ // own docs, scripts and live tests name (the companion test server lives in
588
+ // the SDK repo and is not published).
589
+ //
590
+ // It is DERIVED from the two resolved folders by default, which is only
591
+ // honest while the walk back crosses nothing the model does not name. It
592
+ // does not for `output: path: '../<repo>'`; it does for anything ascending
593
+ // further. voxgig-solardemo-sdk declares '../../seneca/solardemo-provider'
594
+ // and the derived inverse came out as '../../voxgig-sdk/voxgig-solardemo-sdk'
595
+ // — where `voxgig-sdk` is the name of the WORKSPACE DIRECTORY holding the SDK
596
+ // checkout on one machine, no part of the model. That string is committed
597
+ // into the destination's README.md and three test files, so a second
598
+ // developer with the same two repos under a differently named parent
599
+ // regenerates a spurious diff in tracked files and an instruction path that
600
+ // is wrong on the first machine.
601
+ //
602
+ // So a project that ascends further declares the walk back explicitly, as
603
+ // `output: sdkrel`, and is warned until it does.
604
+ function externalSdkRel(ext: ExternalSpec, root: string, log: any): string {
605
+ const declared = String(ext.target.output?.sdkrel || '')
606
+ if ('' !== declared) return declared
607
+
608
+ const derived = Path.relative(ext.folder, root).split(Path.sep).join('/')
609
+
610
+ // Every segment that is not '..' is a real directory name on the way back
611
+ // down to the SDK project. The LAST is the project's own folder; any
612
+ // earlier one is a directory ABOVE it, which nothing in the model declares.
613
+ const named = derived.split('/').filter((seg) => '..' !== seg)
614
+
615
+ if (1 < named.length) {
616
+ log.warn({
617
+ point: 'external-sdkrel-derived', target: ext.name, sdkrel: derived,
618
+ note: ext.name + ': path back to the SDK project derived as \'' +
619
+ derived + '\', which names ' + (named.length - 1) +
620
+ ' directory(s) above the SDK project that the model does not ' +
621
+ 'declare — this machine\'s layout will be committed to the ' +
622
+ 'generated files. Declare `output: sdkrel` instead.'
623
+ })
624
+ }
625
+
626
+ return derived
627
+ }
628
+
629
+
630
+ // The model the IN-TREE pass sees: the same model with the out-of-tree
631
+ // targets taken out.
632
+ //
633
+ // A shallow clone down to `target` only — the model is large, entities and
634
+ // features are shared with the external pass, and a deep copy would both
635
+ // cost and quietly break identity comparisons.
636
+ function withoutTargets(model: any, external: { name: string }[]): any {
637
+ const drop = new Set(external.map((e) => e.name))
638
+ const targets = model?.main?.[KIT]?.target || {}
639
+
640
+ const kept: any = {}
641
+ for (const name of Object.keys(targets)) {
642
+ if (!drop.has(name)) {
643
+ kept[name] = targets[name]
644
+ }
645
+ }
646
+
647
+ return {
648
+ ...model,
649
+ main: {
650
+ ...model.main,
651
+ [KIT]: { ...model.main[KIT], target: kept },
652
+ },
653
+ }
654
+ }
655
+
656
+
341
657
  // Adapted from https://github.com/sindresorhus/import-fresh - Thanks!
342
658
  function clear(path: string) {
343
659
  if (null == path) {
@@ -375,7 +691,11 @@ function clear(path: string) {
375
691
 
376
692
  export type {
377
693
  SdkGenOptions,
694
+ ExampleLang,
378
695
  DepEntry,
696
+ FeatureSource,
697
+ DoctorReport,
698
+ RegisterOptions,
379
699
  }
380
700
 
381
701
  export type {
@@ -448,6 +768,7 @@ export {
448
768
  ReadmeExplanation,
449
769
  ReadmeRef,
450
770
  FeatureHook,
771
+ registerComponent,
451
772
 
452
773
  Jostraca,
453
774
  SdkGen,
@@ -470,6 +791,9 @@ export {
470
791
  OP_SUFFIX,
471
792
  opTypeName,
472
793
  opParams,
794
+ opActions,
795
+ entityActions,
796
+ entityPath,
473
797
  opRequestShape,
474
798
  entityIdField,
475
799
  entityDataIdField,
@@ -484,12 +808,26 @@ export {
484
808
  isReservedName,
485
809
  safeVarName,
486
810
  exampleVarName,
811
+ phpEntityAccessor,
812
+ entityCacheField,
487
813
  isRbCoreConstant,
488
814
  rbSafeTypeName,
489
815
  isSwiftSdkType,
490
816
  swiftSafeTypeName,
491
817
  serverVariables,
492
818
  hasServerVariables,
819
+ liveStrict,
820
+ primaryOpCall,
821
+ idLiteral,
822
+ matchArg,
823
+ dataArg,
824
+ litFor,
825
+ featureOf,
826
+ availableFeatures,
827
+ findFeatureSources,
828
+ featureExcludes,
829
+ fullsetExcludes,
830
+ srcFeatureExcludes,
493
831
  jsProp,
494
832
  jsOptProp,
495
833
  jsKey,
@@ -503,7 +841,14 @@ export {
503
841
  pkgDescription,
504
842
  nonAffiliation,
505
843
  keywords,
844
+ authorInfo,
845
+ contributorList,
506
846
  envName,
847
+ envToken,
848
+ goModule,
849
+ goVersion,
850
+ goPackageIdent,
851
+ packageVersion,
507
852
  repoInfo,
508
853
  apiName,
509
854
  langLabel,
package/src/types.ts CHANGED
@@ -56,8 +56,31 @@ type ModelTarget = NameCases & {
56
56
  active?: boolean
57
57
  title?: string
58
58
  base?: string
59
- module?: { name?: string }
59
+ module?: { name?: string, path?: string, package?: string, goversion?: string }
60
60
  srcfeature?: boolean
61
+
62
+ // Where this target's files land. Present means OUT OF TREE: the target
63
+ // gets its own generate() pass rooted at `path` rather than a folder inside
64
+ // the SDK repo — see cmp/ExternalTarget and
65
+ // docs/explanation/out-of-tree-targets.
66
+ //
67
+ // Typed rather than left to the index signature because `externalTargets()`
68
+ // decides from these keys whether to write OUTSIDE the repo, and a
69
+ // destination path read off a bare `any` is one a rename can silently
70
+ // change to undefined.
71
+ output?: {
72
+ path?: string
73
+ repo?: string
74
+ adopt?: boolean
75
+ sdkrel?: string
76
+ }
77
+
78
+ // Per-generation-phase activation. A consumer target (go-cli, go-mcp,
79
+ // py-data, seneca-provider) switches every phase off and emits its whole
80
+ // package from Main. Absent — or present with no `active` — means the phase
81
+ // runs: the defaults are inclusive.
82
+ phase?: Record<string, { active?: boolean }>
83
+
61
84
  [extra: string]: any
62
85
  }
63
86
 
package/src/utility.ts CHANGED
@@ -6,8 +6,17 @@ import { JostracaResult } from 'jostraca'
6
6
  import { KIT, getModelPath } from '@voxgig/apidef'
7
7
 
8
8
 
9
+ // Where a per-target component is loaded from: `<project>/.sdk/dist/<path>`.
10
+ //
11
+ // `ctx$.folder` is jostraca's OUTPUT folder, which is the project for an
12
+ // ordinary target but the destination repo for one generating out of tree
13
+ // (`output: path`). Components always live in the project that owns the
14
+ // model, never in the place its files land, so an external pass sets
15
+ // `ctx$.cmpfolder` and this prefers it. Without that, generating out of tree
16
+ // looks for `<destination>/.sdk/dist/cmp/...` and fails to resolve.
9
17
  function resolvePath(ctx$: any, path: string): any {
10
- const fullpath = Path.join(ctx$.folder, '.sdk', 'dist', path)
18
+ const base = null == ctx$.cmpfolder ? ctx$.folder : ctx$.cmpfolder
19
+ const fullpath = Path.join(base, '.sdk', 'dist', path)
11
20
  return fullpath
12
21
  }
13
22
 
@@ -1,24 +0,0 @@
1
- // ProjectName SDK features (mirrors tm/go/feature). Each feature is a
2
- // Feature trait object registered on the client; `support` carries the
3
- // shared option readers (go feature_options.go).
4
-
5
- pub mod support;
6
-
7
- pub mod audit;
8
- pub mod base;
9
- pub mod cache;
10
- pub mod clienttrack;
11
- pub mod debug;
12
- pub mod idempotency;
13
- pub mod log;
14
- pub mod metrics;
15
- pub mod netsim;
16
- pub mod paging;
17
- pub mod proxy;
18
- pub mod ratelimit;
19
- pub mod rbac;
20
- pub mod retry;
21
- pub mod streaming;
22
- pub mod telemetry;
23
- pub mod test;
24
- pub mod timeout;