@voxgig/sdkgen 1.2.1 → 1.3.1

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 (329) hide show
  1. package/bin/voxgig-sdkgen +2 -2
  2. package/dist/action/action.d.ts +2 -1
  3. package/dist/action/action.js +15 -9
  4. package/dist/action/action.js.map +1 -1
  5. package/dist/action/feature.js +6 -3
  6. package/dist/action/feature.js.map +1 -1
  7. package/dist/action/target.d.ts +7 -1
  8. package/dist/action/target.js +13 -6
  9. package/dist/action/target.js.map +1 -1
  10. package/dist/cmp/Changelog.d.ts +2 -0
  11. package/dist/cmp/Changelog.js +30 -0
  12. package/dist/cmp/Changelog.js.map +1 -0
  13. package/dist/cmp/Deploy.d.ts +2 -0
  14. package/dist/cmp/Deploy.js +227 -0
  15. package/dist/cmp/Deploy.js.map +1 -0
  16. package/dist/cmp/FeatureHook.js +5 -6
  17. package/dist/cmp/FeatureHook.js.map +1 -1
  18. package/dist/cmp/License.d.ts +2 -0
  19. package/dist/cmp/License.js +44 -0
  20. package/dist/cmp/License.js.map +1 -0
  21. package/dist/cmp/Readme.js +2 -0
  22. package/dist/cmp/Readme.js.map +1 -1
  23. package/dist/cmp/ReadmeErrors.d.ts +2 -0
  24. package/dist/cmp/ReadmeErrors.js +210 -0
  25. package/dist/cmp/ReadmeErrors.js.map +1 -0
  26. package/dist/cmp/ReadmeExplanation.js +213 -223
  27. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  28. package/dist/cmp/ReadmeModel.js +6 -1
  29. package/dist/cmp/ReadmeModel.js.map +1 -1
  30. package/dist/cmp/ReadmeTop.js +389 -82
  31. package/dist/cmp/ReadmeTop.js.map +1 -1
  32. package/dist/cmp/Security.d.ts +2 -0
  33. package/dist/cmp/Security.js +36 -0
  34. package/dist/cmp/Security.js.map +1 -0
  35. package/dist/helpers/canonType.d.ts +7 -0
  36. package/dist/helpers/canonType.js +74 -0
  37. package/dist/helpers/canonType.js.map +1 -0
  38. package/dist/helpers/collectDeps.d.ts +3 -2
  39. package/dist/helpers/collectDeps.js.map +1 -1
  40. package/dist/helpers/naming.d.ts +3 -0
  41. package/dist/helpers/naming.js +51 -0
  42. package/dist/helpers/naming.js.map +1 -0
  43. package/dist/helpers/opExample.d.ts +13 -0
  44. package/dist/helpers/opExample.js +149 -0
  45. package/dist/helpers/opExample.js.map +1 -0
  46. package/dist/helpers/opShape.d.ts +18 -0
  47. package/dist/helpers/opShape.js +193 -0
  48. package/dist/helpers/opShape.js.map +1 -0
  49. package/dist/helpers/packageMeta.d.ts +27 -0
  50. package/dist/helpers/packageMeta.js +224 -0
  51. package/dist/helpers/packageMeta.js.map +1 -0
  52. package/dist/sdkgen.d.ts +11 -1
  53. package/dist/sdkgen.js +57 -18
  54. package/dist/sdkgen.js.map +1 -1
  55. package/dist/tsconfig.tsbuildinfo +1 -1
  56. package/dist/types.d.ts +65 -2
  57. package/dist/types.js.map +1 -1
  58. package/dist/utility.js +20 -11
  59. package/dist/utility.js.map +1 -1
  60. package/model/sdkgen.aontu +137 -0
  61. package/package.json +11 -5
  62. package/project/.sdk/model/target/go-cli.jsonic +47 -0
  63. package/project/.sdk/model/target/go-mcp.jsonic +41 -0
  64. package/project/.sdk/model/target/go.jsonic +9 -3
  65. package/project/.sdk/model/target/js.jsonic +13 -0
  66. package/project/.sdk/model/target/lua.jsonic +13 -0
  67. package/project/.sdk/model/target/php.jsonic +13 -0
  68. package/project/.sdk/model/target/py.jsonic +13 -0
  69. package/project/.sdk/model/target/rb.jsonic +13 -0
  70. package/project/.sdk/model/target/ts.jsonic +13 -0
  71. package/project/.sdk/src/cmp/go/EntityOperation_go.ts +1 -0
  72. package/project/.sdk/src/cmp/go/EntityTypes_go.ts +197 -0
  73. package/project/.sdk/src/cmp/go/Entity_go.ts +2 -1
  74. package/project/.sdk/src/cmp/go/MainEntity_go.ts +6 -0
  75. package/project/.sdk/src/cmp/go/Main_go.ts +23 -3
  76. package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
  77. package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +18 -6
  78. package/project/.sdk/src/cmp/go/ReadmeExamplesTest_go.ts +684 -0
  79. package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +1 -1
  80. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +48 -8
  81. package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +11 -6
  82. package/project/.sdk/src/cmp/go/ReadmeIntro_go.ts +40 -1
  83. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +63 -17
  84. package/project/.sdk/src/cmp/go/ReadmeOptions_go.ts +4 -3
  85. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +124 -115
  86. package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +28 -15
  87. package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +33 -9
  88. package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +35 -5
  89. package/project/.sdk/src/cmp/go/TestEntity_go.ts +1 -1
  90. package/project/.sdk/src/cmp/go/Test_go.ts +5 -1
  91. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +21 -0
  92. package/project/.sdk/src/cmp/go/fragment/EntityCreateOp.fragment.go +11 -0
  93. package/project/.sdk/src/cmp/go/fragment/EntityListOp.fragment.go +11 -0
  94. package/project/.sdk/src/cmp/go/fragment/EntityLoadOp.fragment.go +11 -0
  95. package/project/.sdk/src/cmp/go/fragment/EntityRemoveOp.fragment.go +11 -0
  96. package/project/.sdk/src/cmp/go/fragment/EntityUpdateOp.fragment.go +11 -0
  97. package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +195 -0
  98. package/project/.sdk/src/cmp/go-cli/fragment/main.fragment.go +106 -0
  99. package/project/.sdk/src/cmp/go-cli/fragment/words.fragment.go +132 -0
  100. package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +184 -0
  101. package/project/.sdk/src/cmp/go-mcp/fragment/main.fragment.go +68 -0
  102. package/project/.sdk/src/cmp/go-mcp/fragment/tools.fragment.go +114 -0
  103. package/project/.sdk/src/cmp/js/EntityTypes_js.ts +111 -0
  104. package/project/.sdk/src/cmp/js/MainEntity_js.ts +1 -0
  105. package/project/.sdk/src/cmp/js/Main_js.ts +3 -0
  106. package/project/.sdk/src/cmp/js/Package_js.ts +16 -7
  107. package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +13 -7
  108. package/project/.sdk/src/cmp/js/ReadmeExplanation_js.ts +2 -2
  109. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +52 -11
  110. package/project/.sdk/src/cmp/js/ReadmeIntro_js.ts +39 -1
  111. package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +50 -18
  112. package/project/.sdk/src/cmp/js/ReadmeOptions_js.ts +4 -3
  113. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +45 -19
  114. package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +24 -13
  115. package/project/.sdk/src/cmp/js/ReadmeTopHowto_js.ts +3 -0
  116. package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +28 -12
  117. package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +23 -3
  118. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +5 -0
  119. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +5 -0
  120. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +5 -0
  121. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +5 -0
  122. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +5 -0
  123. package/project/.sdk/src/cmp/js/utility_js.ts +57 -0
  124. package/project/.sdk/src/cmp/lua/EntityTypes_lua.ts +113 -0
  125. package/project/.sdk/src/cmp/lua/MainEntity_lua.ts +8 -0
  126. package/project/.sdk/src/cmp/lua/Main_lua.ts +4 -0
  127. package/project/.sdk/src/cmp/lua/Package_lua.ts +23 -4
  128. package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +12 -10
  129. package/project/.sdk/src/cmp/lua/ReadmeExamplesTest_lua.ts +293 -0
  130. package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +46 -8
  131. package/project/.sdk/src/cmp/lua/ReadmeInstall_lua.ts +19 -3
  132. package/project/.sdk/src/cmp/lua/ReadmeIntro_lua.ts +38 -1
  133. package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +51 -16
  134. package/project/.sdk/src/cmp/lua/ReadmeOptions_lua.ts +4 -3
  135. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +79 -18
  136. package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +25 -20
  137. package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +17 -9
  138. package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +32 -5
  139. package/project/.sdk/src/cmp/lua/Test_lua.ts +4 -0
  140. package/project/.sdk/src/cmp/lua/fragment/EntityCreateOp.fragment.lua +4 -0
  141. package/project/.sdk/src/cmp/lua/fragment/EntityListOp.fragment.lua +4 -0
  142. package/project/.sdk/src/cmp/lua/fragment/EntityLoadOp.fragment.lua +4 -0
  143. package/project/.sdk/src/cmp/lua/fragment/EntityRemoveOp.fragment.lua +4 -0
  144. package/project/.sdk/src/cmp/lua/fragment/EntityUpdateOp.fragment.lua +4 -0
  145. package/project/.sdk/src/cmp/php/EntityTypes_php.ts +142 -0
  146. package/project/.sdk/src/cmp/php/MainEntity_php.ts +18 -1
  147. package/project/.sdk/src/cmp/php/Main_php.ts +4 -0
  148. package/project/.sdk/src/cmp/php/Package_php.ts +18 -7
  149. package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +15 -11
  150. package/project/.sdk/src/cmp/php/ReadmeExamplesTest_php.ts +401 -0
  151. package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +56 -13
  152. package/project/.sdk/src/cmp/php/ReadmeInstall_php.ts +15 -3
  153. package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +40 -1
  154. package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +26 -8
  155. package/project/.sdk/src/cmp/php/ReadmeOptions_php.ts +4 -3
  156. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +80 -22
  157. package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +51 -42
  158. package/project/.sdk/src/cmp/php/ReadmeTopHowto_php.ts +1 -1
  159. package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +19 -11
  160. package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +41 -11
  161. package/project/.sdk/src/cmp/php/TestDirect_php.ts +9 -9
  162. package/project/.sdk/src/cmp/php/TestEntity_php.ts +6 -12
  163. package/project/.sdk/src/cmp/php/Test_php.ts +4 -0
  164. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +13 -1
  165. package/project/.sdk/src/cmp/php/fragment/EntityCreateOp.fragment.php +10 -1
  166. package/project/.sdk/src/cmp/php/fragment/EntityListOp.fragment.php +10 -1
  167. package/project/.sdk/src/cmp/php/fragment/EntityLoadOp.fragment.php +10 -1
  168. package/project/.sdk/src/cmp/php/fragment/EntityRemoveOp.fragment.php +10 -1
  169. package/project/.sdk/src/cmp/php/fragment/EntityUpdateOp.fragment.php +10 -1
  170. package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +22 -14
  171. package/project/.sdk/src/cmp/py/EntityTypes_py.ts +184 -0
  172. package/project/.sdk/src/cmp/py/Entity_py.ts +27 -0
  173. package/project/.sdk/src/cmp/py/MainEntity_py.ts +2 -1
  174. package/project/.sdk/src/cmp/py/Main_py.ts +35 -0
  175. package/project/.sdk/src/cmp/py/Package_py.ts +24 -3
  176. package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +27 -11
  177. package/project/.sdk/src/cmp/py/ReadmeExamplesTest_py.ts +626 -0
  178. package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +53 -14
  179. package/project/.sdk/src/cmp/py/ReadmeInstall_py.ts +19 -3
  180. package/project/.sdk/src/cmp/py/ReadmeIntro_py.ts +48 -1
  181. package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +28 -10
  182. package/project/.sdk/src/cmp/py/ReadmeOptions_py.ts +4 -3
  183. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +73 -24
  184. package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +57 -37
  185. package/project/.sdk/src/cmp/py/ReadmeTopHowto_py.ts +1 -1
  186. package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +19 -11
  187. package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +30 -5
  188. package/project/.sdk/src/cmp/py/TestDirect_py.ts +7 -9
  189. package/project/.sdk/src/cmp/py/TestEntity_py.ts +6 -14
  190. package/project/.sdk/src/cmp/py/Test_py.ts +4 -0
  191. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +5 -2
  192. package/project/.sdk/src/cmp/py/fragment/EntityCreateOp.fragment.py +1 -1
  193. package/project/.sdk/src/cmp/py/fragment/EntityListOp.fragment.py +5 -1
  194. package/project/.sdk/src/cmp/py/fragment/EntityLoadOp.fragment.py +6 -1
  195. package/project/.sdk/src/cmp/py/fragment/EntityRemoveOp.fragment.py +6 -1
  196. package/project/.sdk/src/cmp/py/fragment/EntityUpdateOp.fragment.py +1 -1
  197. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +17 -10
  198. package/project/.sdk/src/cmp/rb/EntityTypes_rb.ts +136 -0
  199. package/project/.sdk/src/cmp/rb/MainEntity_rb.ts +1 -0
  200. package/project/.sdk/src/cmp/rb/Main_rb.ts +4 -0
  201. package/project/.sdk/src/cmp/rb/Package_rb.ts +34 -7
  202. package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +26 -10
  203. package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +289 -0
  204. package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +72 -21
  205. package/project/.sdk/src/cmp/rb/ReadmeInstall_rb.ts +16 -4
  206. package/project/.sdk/src/cmp/rb/ReadmeIntro_rb.ts +40 -1
  207. package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +29 -12
  208. package/project/.sdk/src/cmp/rb/ReadmeOptions_rb.ts +4 -3
  209. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +85 -22
  210. package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +56 -37
  211. package/project/.sdk/src/cmp/rb/ReadmeTopHowto_rb.ts +1 -1
  212. package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +19 -11
  213. package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +43 -11
  214. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +9 -9
  215. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +6 -12
  216. package/project/.sdk/src/cmp/rb/Test_rb.ts +4 -0
  217. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +2 -0
  218. package/project/.sdk/src/cmp/rb/fragment/EntityCreateOp.fragment.rb +5 -0
  219. package/project/.sdk/src/cmp/rb/fragment/EntityListOp.fragment.rb +20 -2
  220. package/project/.sdk/src/cmp/rb/fragment/EntityLoadOp.fragment.rb +8 -1
  221. package/project/.sdk/src/cmp/rb/fragment/EntityRemoveOp.fragment.rb +6 -1
  222. package/project/.sdk/src/cmp/rb/fragment/EntityUpdateOp.fragment.rb +5 -0
  223. package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +24 -8
  224. package/project/.sdk/src/cmp/ts/EntityTypes_ts.ts +105 -0
  225. package/project/.sdk/src/cmp/ts/Entity_ts.ts +17 -1
  226. package/project/.sdk/src/cmp/ts/MainEntity_ts.ts +1 -0
  227. package/project/.sdk/src/cmp/ts/Main_ts.ts +6 -0
  228. package/project/.sdk/src/cmp/ts/Package_ts.ts +14 -7
  229. package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +13 -7
  230. package/project/.sdk/src/cmp/ts/ReadmeExampleTest_ts.ts +81 -0
  231. package/project/.sdk/src/cmp/ts/ReadmeExamplesTest_ts.ts +446 -0
  232. package/project/.sdk/src/cmp/ts/ReadmeExplanation_ts.ts +2 -2
  233. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +57 -11
  234. package/project/.sdk/src/cmp/ts/ReadmeInstall_ts.ts +19 -6
  235. package/project/.sdk/src/cmp/ts/ReadmeIntro_ts.ts +39 -1
  236. package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +50 -18
  237. package/project/.sdk/src/cmp/ts/ReadmeOptions_ts.ts +4 -3
  238. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +95 -40
  239. package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +24 -13
  240. package/project/.sdk/src/cmp/ts/ReadmeTopHowto_ts.ts +3 -0
  241. package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +44 -12
  242. package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +23 -3
  243. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +2 -2
  244. package/project/.sdk/src/cmp/ts/Test_ts.ts +5 -0
  245. package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +3 -1
  246. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +10 -5
  247. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +4 -2
  248. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +4 -2
  249. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +4 -2
  250. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +4 -2
  251. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +4 -2
  252. package/project/.sdk/src/cmp/ts/utility_ts.ts +59 -0
  253. package/project/.sdk/tm/go/LICENSE +1 -1
  254. package/project/.sdk/tm/go/Makefile +36 -1
  255. package/project/.sdk/tm/go/VERSION +1 -0
  256. package/project/.sdk/tm/go/core/context.go +12 -7
  257. package/project/.sdk/tm/go-cli/src/feature/README.md +6 -0
  258. package/project/.sdk/tm/go-cli/src/feature/base/.gitkeep +0 -0
  259. package/project/.sdk/tm/go-cli/src/feature/log/.gitkeep +0 -0
  260. package/project/.sdk/tm/go-cli/src/feature/test/.gitkeep +0 -0
  261. package/project/.sdk/tm/go-mcp/src/feature/README.md +6 -0
  262. package/project/.sdk/tm/go-mcp/src/feature/base/.gitkeep +0 -0
  263. package/project/.sdk/tm/go-mcp/src/feature/log/.gitkeep +0 -0
  264. package/project/.sdk/tm/go-mcp/src/feature/test/.gitkeep +0 -0
  265. package/project/.sdk/tm/js/LICENSE +1 -1
  266. package/project/.sdk/tm/js/Makefile +41 -0
  267. package/project/.sdk/tm/lua/LICENSE +1 -1
  268. package/project/.sdk/tm/lua/Makefile +40 -1
  269. package/project/.sdk/tm/lua/core/context.lua +13 -8
  270. package/project/.sdk/tm/php/LICENSE +1 -1
  271. package/project/.sdk/tm/php/Makefile +31 -1
  272. package/project/.sdk/tm/php/VERSION +1 -0
  273. package/project/.sdk/tm/php/core/Context.php +12 -6
  274. package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +13 -4
  275. package/project/.sdk/tm/php/utility/Done.php +2 -2
  276. package/project/.sdk/tm/php/utility/MakeError.php +3 -3
  277. package/project/.sdk/tm/py/LICENSE +1 -1
  278. package/project/.sdk/tm/py/Makefile +34 -1
  279. package/project/.sdk/tm/py/core/context.py +12 -7
  280. package/project/.sdk/tm/py/test/test_primary_utility.py +15 -4
  281. package/project/.sdk/tm/py/utility/done.py +3 -1
  282. package/project/.sdk/tm/py/utility/make_error.py +2 -2
  283. package/project/.sdk/tm/rb/LICENSE +1 -1
  284. package/project/.sdk/tm/rb/Makefile +33 -1
  285. package/project/.sdk/tm/rb/core/context.rb +8 -3
  286. package/project/.sdk/tm/rb/test/primary_utility_test.rb +2 -2
  287. package/project/.sdk/tm/rb/utility/done.rb +3 -1
  288. package/project/.sdk/tm/rb/utility/make_error.rb +5 -2
  289. package/project/.sdk/tm/ts/LICENSE +1 -1
  290. package/project/.sdk/tm/ts/Makefile +42 -0
  291. package/project/.sdk/tm/ts/src/Context.ts +8 -3
  292. package/src/action/action.ts +17 -10
  293. package/src/action/feature.ts +8 -6
  294. package/src/action/target.ts +17 -8
  295. package/src/cmp/Changelog.ts +34 -0
  296. package/src/cmp/Deploy.ts +258 -0
  297. package/src/cmp/FeatureHook.ts +6 -8
  298. package/src/cmp/License.ts +49 -0
  299. package/src/cmp/Readme.ts +2 -0
  300. package/src/cmp/ReadmeErrors.ts +257 -0
  301. package/src/cmp/ReadmeExplanation.ts +250 -230
  302. package/src/cmp/ReadmeModel.ts +7 -2
  303. package/src/cmp/ReadmeTop.ts +411 -95
  304. package/src/cmp/Security.ts +41 -0
  305. package/src/helpers/canonType.ts +89 -0
  306. package/src/helpers/collectDeps.ts +5 -3
  307. package/src/helpers/naming.ts +59 -0
  308. package/src/helpers/opExample.ts +170 -0
  309. package/src/helpers/opShape.ts +236 -0
  310. package/src/helpers/packageMeta.ts +236 -0
  311. package/src/sdkgen.ts +87 -20
  312. package/src/tsconfig.json +1 -0
  313. package/src/types.ts +85 -2
  314. package/src/utility.ts +22 -11
  315. package/README.md +0 -2
  316. package/dist/action/lang.d.ts +0 -2
  317. package/dist/action/lang.js +0 -68
  318. package/dist/action/lang.js.map +0 -1
  319. package/dist/cmp/Hook.d.ts +0 -2
  320. package/dist/cmp/Hook.js +0 -10
  321. package/dist/cmp/Hook.js.map +0 -1
  322. package/dist/cmp/Top.d.ts +0 -2
  323. package/dist/cmp/Top.js +0 -23
  324. package/dist/cmp/Top.js.map +0 -1
  325. package/dist/prepare-openapi.d.ts +0 -2
  326. package/dist/prepare-openapi.js +0 -37
  327. package/dist/prepare-openapi.js.map +0 -1
  328. package/model/sdkgen.jsonic +0 -74
  329. package/project/.sdk/tm/go/utility/struct/go.mod +0 -3
@@ -0,0 +1,236 @@
1
+ // Single source of truth for a generated SDK's PUBLISHED identity and its
2
+ // descriptive metadata, shared by the per-language Package_<lang>.ts manifest
3
+ // generators AND the README install/heading components — so the install
4
+ // command a README prints can never drift from the real published package name
5
+ // (the #1 defect the publishing recommendations call out).
6
+ //
7
+ // The recommendations require, for every package:
8
+ // - install commands that match the real package name EXACTLY;
9
+ // - description "Unofficial generated <Lang> SDK for the <API> public API.";
10
+ // - a generic non-affiliation statement (upstream owner names are unreliable);
11
+ // - homepage / repository / issues under github.com/<origin>/<slug>-sdk;
12
+ // - the fixed keyword set [voxgig sdk generated-sdk openapi api-client <slug>].
13
+ //
14
+ // Every value here is derived from the resolved model (model.name, model.origin,
15
+ // main.kit.info.title) — no new inputs required.
16
+
17
+ import { KIT, nom } from '@voxgig/apidef'
18
+
19
+ const PUBLISHER = 'Voxgig'
20
+ const PUBLISHER_URL = 'https://voxgig.com'
21
+ const SECURITY_EMAIL = 'security@voxgig.com'
22
+ const GENERATOR_URL = 'https://github.com/voxgig/sdkgen'
23
+
24
+ const LANG_LABEL: Record<string, string> = {
25
+ ts: 'TypeScript',
26
+ js: 'JavaScript',
27
+ py: 'Python',
28
+ php: 'PHP',
29
+ rb: 'Ruby',
30
+ lua: 'Lua',
31
+ go: 'Go',
32
+ 'go-cli': 'Go CLI',
33
+ 'go-mcp': 'Go MCP server',
34
+ }
35
+
36
+ function langLabel(target: string): string {
37
+ return LANG_LABEL[target] || target
38
+ }
39
+
40
+ // GitHub org (publisher slug), repo name, and the canonical repo URLs.
41
+ function repoInfo(model: any) {
42
+ const slug = model.name
43
+ const origin = model.origin || 'voxgig-sdk'
44
+ const repo = `${slug}-sdk`
45
+ const repoUrl = `https://github.com/${origin}/${repo}`
46
+ return {
47
+ slug,
48
+ origin,
49
+ repo,
50
+ repoUrl,
51
+ issuesUrl: `${repoUrl}/issues`,
52
+ changelogUrl: `${repoUrl}/blob/main/CHANGELOG.md`,
53
+ // Version-agnostic releases page: where the `<target>/vX.Y.Z` git tags
54
+ // that a pending (not-yet-on-registry) package is installed from live.
55
+ releasesUrl: `${repoUrl}/releases`,
56
+ }
57
+ }
58
+
59
+
60
+ // Publication state of a target's package registry, tri-state + tag-only:
61
+ // 'tag' — no registry (the go family); resolved from the git tag.
62
+ // 'pending' — registry declared but the package is not uploaded yet
63
+ // (the fleet default): install from the git tag.
64
+ // 'active' — package is live on the registry: show the real install cmd.
65
+ // 'inactive' — registry deliberately disabled (tag-only, like pending).
66
+ // Reads main.kit.target.<t>.publish.registry.state (default 'pending').
67
+ // The legacy boolean `registry.active: true` is honoured as a back-compat
68
+ // alias for state === 'active'.
69
+ function registryState(model: any, target: string): 'tag' | 'pending' | 'active' | 'inactive' {
70
+ if ('go' === target || 'go-cli' === target || 'go-mcp' === target) return 'tag'
71
+ const reg = model?.main?.[KIT]?.target?.[target]?.publish?.registry
72
+ if (null == reg || '' === (reg.name || '')) return 'tag'
73
+ if (true === reg.active) return 'active' // legacy alias
74
+ const s = reg.state
75
+ if ('active' === s || 'inactive' === s || 'pending' === s) return s
76
+ return 'pending'
77
+ }
78
+
79
+ // True only when the package is actually live on its registry (so a README
80
+ // may print the real `npm install`/`pip install`/... command). Everything
81
+ // else — pending, inactive, tag-only — installs from the git tag instead.
82
+ function isPublished(model: any, target: string): boolean {
83
+ return 'active' === registryState(model, target)
84
+ }
85
+
86
+ // The registry a target uploads to (npm | pypi | packagist | ...), or ''
87
+ // for tag-only ports. Used in the "not yet on <registry>" pending message.
88
+ function registryName(model: any, target: string): string {
89
+ const reg = model?.main?.[KIT]?.target?.[target]?.publish?.registry
90
+ return (reg && reg.name) ? String(reg.name) : ''
91
+ }
92
+
93
+ // The vendor / git-tag install pointer for a NOT-yet-published target. For
94
+ // the go family this is the canonical install (`go get <module>@latest`,
95
+ // which the Go proxy resolves from the `<subdir>/vX.Y.Z` tag). For registry
96
+ // ports it is a short "not yet on <registry> — install from the git tag"
97
+ // pointer carrying the releases URL.
98
+ function vendorCommand(model: any, target: string): string {
99
+ const { releasesUrl } = repoInfo(model)
100
+ switch (target) {
101
+ case 'go':
102
+ return `go get ${packageName(model, 'go')}@latest`
103
+ case 'go-mcp':
104
+ return `go get ${packageName(model, 'go-mcp')}@latest`
105
+ case 'go-cli':
106
+ return `go install ${packageName(model, 'go-cli')}/cmd/${model.name}@latest`
107
+ default: {
108
+ const reg = registryName(model, target)
109
+ return `not yet on ${reg || 'the registry'} — install from the git tag: ${releasesUrl}`
110
+ }
111
+ }
112
+ }
113
+
114
+ // API display name for descriptions, e.g. "Aare.guru". Uses the OpenAPI
115
+ // info.title (present for ~98% of the fleet), stripping a trailing " API" so
116
+ // we don't render "... Aare.guru API public API". Falls back to the normalised
117
+ // SDK Name, then the slug.
118
+ function apiName(model: any): string {
119
+ const info = (model.main && model.main[KIT] && model.main[KIT].info) || {}
120
+ const raw = (null != info.title ? String(info.title) : '').trim()
121
+ const stripped = raw.replace(/\s*API\s*$/i, '').trim()
122
+ return stripped || nom(model, 'Name') || model.name
123
+ }
124
+
125
+ // The REAL published package name per ecosystem — mirrors the exact formula in
126
+ // each Package_<lang>.ts. This is the one canonical implementation.
127
+ function packageName(model: any, eco: string): string {
128
+ const slug = model.name
129
+ const origin = model.origin || 'voxgig-sdk'
130
+ const base = origin.endsWith('-sdk') ? slug : `${slug}-sdk`
131
+ const npmScoped = `@${origin}/${slug}${origin.endsWith('-sdk') ? '' : '-sdk'}`
132
+ switch (eco) {
133
+ case 'npm':
134
+ case 'ts':
135
+ return npmScoped
136
+ case 'js':
137
+ return `${npmScoped}-js`
138
+ case 'pypi':
139
+ case 'py':
140
+ case 'gem':
141
+ case 'rb':
142
+ case 'luarocks':
143
+ case 'lua':
144
+ return `${origin}-${base}`
145
+ case 'composer':
146
+ case 'php':
147
+ return `${origin}/${base}`
148
+ case 'go':
149
+ return `github.com/${origin}/${slug}-sdk/go`
150
+ case 'go-cli':
151
+ return `github.com/${origin}/${slug}-sdk/go-cli`
152
+ case 'go-mcp':
153
+ return `github.com/${origin}/${slug}-sdk/go-mcp`
154
+ default:
155
+ return `${origin}-${base}`
156
+ }
157
+ }
158
+
159
+ // Copy-paste install command for a target, using the REAL package name.
160
+ // Only a package that is actually live on its registry (isPublished) gets a
161
+ // registry install command; everything else (pending / inactive / tag-only,
162
+ // including the whole go family) returns the git-tag vendor command instead,
163
+ // so a README never prints a `npm install ...` that 404s.
164
+ function installCommand(model: any, target: string): string {
165
+ if (!isPublished(model, target)) {
166
+ return vendorCommand(model, target)
167
+ }
168
+ switch (target) {
169
+ case 'ts':
170
+ return `npm install ${packageName(model, 'npm')}`
171
+ case 'js':
172
+ return `npm install ${packageName(model, 'js')}`
173
+ case 'py':
174
+ return `pip install ${packageName(model, 'pypi')}`
175
+ case 'php':
176
+ return `composer require ${packageName(model, 'composer')}`
177
+ case 'rb':
178
+ return `gem install ${packageName(model, 'gem')}`
179
+ case 'lua':
180
+ return `luarocks install ${packageName(model, 'luarocks')}`
181
+ case 'go':
182
+ return `go get ${packageName(model, 'go')}`
183
+ case 'go-cli':
184
+ return `go install ${packageName(model, 'go-cli')}/cmd/${model.name}@latest`
185
+ default:
186
+ return ''
187
+ }
188
+ }
189
+
190
+ // The standard one-line package description (with the generic non-affiliation
191
+ // statement inline) used in every manifest.
192
+ function pkgDescription(model: any, target: string): string {
193
+ return `Unofficial generated ${langLabel(target)} SDK for the ${apiName(model)} public API.` +
194
+ ` Not affiliated with or endorsed by the upstream API provider.`
195
+ }
196
+
197
+ // Longer non-affiliation / generated-code disclosure for READMEs, LICENSE and
198
+ // SECURITY.md. Generic on the upstream owner (owner names are only ~45%
199
+ // reliably known across the fleet).
200
+ function nonAffiliation(model: any): string {
201
+ return `This is an unofficial SDK for the ${apiName(model)} public API, generated by ` +
202
+ `${PUBLISHER} with [\`@voxgig/sdkgen\`](${GENERATOR_URL}). ` +
203
+ `It is not affiliated with, endorsed by, or sponsored by the upstream API provider.`
204
+ }
205
+
206
+ function keywords(model: any): string[] {
207
+ return ['voxgig', 'sdk', 'generated-sdk', 'openapi', 'api-client', model.name]
208
+ }
209
+
210
+ // A VALID uppercase env-var base derived from the slug: 'unsolicited-advice' ->
211
+ // 'UNSOLICITED_ADVICE'. Use for <NAME>_APIKEY / <NAME>_TEST_LIVE so examples are
212
+ // valid identifiers (model.NAME left a hyphen in, breaking process.env.X).
213
+ function envName(model: any): string {
214
+ return String(model.name || '').toUpperCase().replace(/[^A-Z0-9]+/g, '_').replace(/^_+|_+$/g, '')
215
+ }
216
+
217
+ export {
218
+ PUBLISHER,
219
+ PUBLISHER_URL,
220
+ SECURITY_EMAIL,
221
+ GENERATOR_URL,
222
+ LANG_LABEL,
223
+ langLabel,
224
+ repoInfo,
225
+ apiName,
226
+ packageName,
227
+ installCommand,
228
+ registryState,
229
+ isPublished,
230
+ registryName,
231
+ vendorCommand,
232
+ pkgDescription,
233
+ nonAffiliation,
234
+ keywords,
235
+ envName,
236
+ }
package/src/sdkgen.ts CHANGED
@@ -22,13 +22,18 @@ import type {
22
22
  import { SdkGenError, requirePath, isAuthActive } from './utility'
23
23
 
24
24
  import { Main } from './cmp/Main'
25
+ import { Deploy } from './cmp/Deploy'
25
26
  import { Entity } from './cmp/Entity'
26
27
  import { Feature } from './cmp/Feature'
27
28
  import { Readme } from './cmp/Readme'
28
29
  import { ReadmeTop } from './cmp/ReadmeTop'
30
+ import { License } from './cmp/License'
31
+ import { Security } from './cmp/Security'
32
+ import { Changelog } from './cmp/Changelog'
29
33
  import { Test } from './cmp/Test'
30
34
  import { ReadmeInstall } from './cmp/ReadmeInstall'
31
35
  import { ReadmeQuick } from './cmp/ReadmeQuick'
36
+ import { ReadmeErrors } from './cmp/ReadmeErrors'
32
37
  import { ReadmeIntro } from './cmp/ReadmeIntro'
33
38
  import { ReadmeModel } from './cmp/ReadmeModel'
34
39
  import { ReadmeOptions } from './cmp/ReadmeOptions'
@@ -42,6 +47,28 @@ import { buildIdNames } from './helpers/buildIdNames'
42
47
  import { getMatchEntries } from './helpers/getMatchEntries'
43
48
  import { collectDeps } from './helpers/collectDeps'
44
49
  import type { DepEntry } from './helpers/collectDeps'
50
+ import { canonToType, canonKey } from './helpers/canonType'
51
+ import { OP_SUFFIX, opTypeName, opParams, opRequestShape, entityIdField, entityDataIdField, entityOps, entityPrimaryOp } from './helpers/opShape'
52
+ import { isReservedName, safeVarName } from './helpers/naming'
53
+ import {
54
+ packageName,
55
+ installCommand,
56
+ registryState,
57
+ isPublished,
58
+ registryName,
59
+ vendorCommand,
60
+ pkgDescription,
61
+ nonAffiliation,
62
+ keywords,
63
+ envName,
64
+ repoInfo,
65
+ apiName,
66
+ langLabel,
67
+ PUBLISHER,
68
+ PUBLISHER_URL,
69
+ SECURITY_EMAIL,
70
+ GENERATOR_URL,
71
+ } from './helpers/packageMeta'
45
72
 
46
73
 
47
74
  import {
@@ -95,14 +122,15 @@ const ACTION_MAP: any = {
95
122
  const dlog = getdlog('sdkgen', __filename)
96
123
 
97
124
 
98
- let aontu: any = null
99
-
100
-
101
125
  function SdkGen(opts: SdkGenOptions) {
102
126
  const fs = opts.fs || Fs
103
127
  const folder = opts.folder || '../'
104
128
  const now = opts.now || (() => Date.now())
105
129
 
130
+ // Per-instance cache of the Aontu model loader. Previously a module-level
131
+ // global, which leaked the (relative) preload across SdkGen instances.
132
+ let aontu: any = null
133
+
106
134
  const jopts = {
107
135
  now,
108
136
  control: {
@@ -130,7 +158,7 @@ function SdkGen(opts: SdkGenOptions) {
130
158
 
131
159
  let Root = spec.root
132
160
 
133
- if (null == Root && null != config.root) {
161
+ if (null == Root && null != config?.root) {
134
162
  clear(config.root)
135
163
  const rootModule: any = require(config.root)
136
164
  Root = rootModule.Root
@@ -202,13 +230,7 @@ function SdkGen(opts: SdkGenOptions) {
202
230
  const errs: any[] = []
203
231
 
204
232
  if (null == aontu) {
205
- aontu = new Aontu({
206
- preload: {
207
- folders: ['./model'],
208
- ext: ['.jsonic', '.json'],
209
- recursive: true,
210
- }
211
- })
233
+ aontu = new Aontu()
212
234
  }
213
235
 
214
236
  const aopts = { path, errs }
@@ -217,17 +239,16 @@ function SdkGen(opts: SdkGenOptions) {
217
239
  const model = aontu.generate(src, aopts)
218
240
 
219
241
  if (0 < errs.length) {
220
- for (let serr of errs) {
221
- let err: any = new SdkGenError('Model Error: ' + serr.msg)
222
- err.cause$ = [serr]
242
+ const serr = errs[0]
243
+ const err: any = new SdkGenError('Model Error: ' + serr.msg)
244
+ err.cause$ = [serr]
223
245
 
224
- if ('syntax' === serr.why) {
225
- err.uxmsg$ = true
226
- }
227
-
228
- err.rooterrs$ = errs
229
- throw err
246
+ if ('syntax' === serr.why) {
247
+ err.uxmsg$ = true
230
248
  }
249
+
250
+ err.rooterrs$ = errs
251
+ throw err
231
252
  }
232
253
 
233
254
  model.const = { name: model.name }
@@ -338,6 +359,16 @@ export type {
338
359
  DepEntry,
339
360
  }
340
361
 
362
+ export type {
363
+ SdkModel,
364
+ ModelKit,
365
+ ModelTarget,
366
+ ModelFeature,
367
+ ModelEntity,
368
+ ModelDep,
369
+ ModelHook,
370
+ } from './types'
371
+
341
372
 
342
373
 
343
374
  type Component = (props: any, children?: any) => void
@@ -375,6 +406,10 @@ export const List: Component = JostracaModule.List
375
406
 
376
407
  export {
377
408
  Main,
409
+ Deploy,
410
+ License,
411
+ Security,
412
+ Changelog,
378
413
  Entity,
379
414
  Feature,
380
415
  Test,
@@ -382,6 +417,7 @@ export {
382
417
  ReadmeTop,
383
418
  ReadmeInstall,
384
419
  ReadmeQuick,
420
+ ReadmeErrors,
385
421
  ReadmeIntro,
386
422
  ReadmeModel,
387
423
  ReadmeOptions,
@@ -400,4 +436,35 @@ export {
400
436
  buildIdNames,
401
437
  getMatchEntries,
402
438
  collectDeps,
439
+ canonToType,
440
+ canonKey,
441
+
442
+ OP_SUFFIX,
443
+ opTypeName,
444
+ opParams,
445
+ opRequestShape,
446
+ entityIdField,
447
+ entityDataIdField,
448
+ entityOps,
449
+ entityPrimaryOp,
450
+ isReservedName,
451
+ safeVarName,
452
+
453
+ packageName,
454
+ installCommand,
455
+ registryState,
456
+ isPublished,
457
+ registryName,
458
+ vendorCommand,
459
+ pkgDescription,
460
+ nonAffiliation,
461
+ keywords,
462
+ envName,
463
+ repoInfo,
464
+ apiName,
465
+ langLabel,
466
+ PUBLISHER,
467
+ PUBLISHER_URL,
468
+ SECURITY_EMAIL,
469
+ GENERATOR_URL,
403
470
  }
package/src/tsconfig.json CHANGED
@@ -3,6 +3,7 @@
3
3
  "esModuleInterop": true,
4
4
  "module": "nodenext",
5
5
  "noEmitOnError": true,
6
+ "skipLibCheck": true,
6
7
  "outDir":"../dist",
7
8
  "rootDir":".",
8
9
  "resolveJsonModule": true,
package/src/types.ts CHANGED
@@ -14,11 +14,88 @@ import {
14
14
  type FsUtil = typeof Fs
15
15
 
16
16
 
17
+ // The model is produced by aontu/apidef and carries dynamic metadata
18
+ // (key$, val$, index$, and the Name/NAME case variants injected by
19
+ // jostraca's names()). These interfaces document the fields sdkgen relies
20
+ // on while the index signatures keep the genuinely-dynamic remainder
21
+ // accessible — a pragmatic middle ground until the model is shaped with
22
+ // `shape`.
23
+
24
+ // Case variants injected by jostraca's names() helper.
25
+ type NameCases = {
26
+ name?: string
27
+ Name?: string
28
+ NAME?: string
29
+ }
30
+
31
+ // A dependency entry inside a target or feature `deps` block.
32
+ type ModelDep = {
33
+ key$?: string
34
+ version?: string
35
+ active?: boolean
36
+ kind?: string
37
+ replace?: string
38
+ [extra: string]: any
39
+ }
40
+
41
+ type ModelHook = {
42
+ active?: boolean
43
+ [extra: string]: any
44
+ }
45
+
46
+ type ModelFeature = NameCases & {
47
+ active?: boolean
48
+ title?: string
49
+ version?: string
50
+ hook?: Record<string, ModelHook>
51
+ deps?: Record<string, Record<string, ModelDep>>
52
+ [extra: string]: any
53
+ }
54
+
55
+ type ModelTarget = NameCases & {
56
+ active?: boolean
57
+ title?: string
58
+ base?: string
59
+ module?: { name?: string }
60
+ srcfeature?: boolean
61
+ [extra: string]: any
62
+ }
63
+
64
+ type ModelEntity = NameCases & {
65
+ active?: boolean
66
+ short?: string
67
+ desc?: string
68
+ op?: Record<string, any>
69
+ relations?: { ancestors?: any }
70
+ [extra: string]: any
71
+ }
72
+
73
+ type ModelKit = {
74
+ info?: Record<string, any>
75
+ config?: Record<string, any>
76
+ target?: Record<string, ModelTarget>
77
+ feature?: Record<string, ModelFeature>
78
+ entity?: Record<string, ModelEntity>
79
+ [extra: string]: any
80
+ }
81
+
82
+ type SdkModel = NameCases & {
83
+ origin?: string
84
+ const?: Record<string, any>
85
+ main: {
86
+ kit?: ModelKit
87
+ def?: Record<string, any>
88
+ [extra: string]: any
89
+ }
90
+ [extra: string]: any
91
+ }
92
+
93
+
17
94
  type ActionContext = {
18
95
  fs: () => FsUtil,
19
96
  log: any,
20
97
  folder: string,
21
- model: any,
98
+ model: SdkModel,
22
99
  url: string,
23
100
  opts: any,
24
101
  jostraca: any
@@ -38,5 +115,11 @@ export {
38
115
  export type {
39
116
  ActionContext,
40
117
  ActionResult,
118
+ SdkModel,
119
+ ModelKit,
120
+ ModelTarget,
121
+ ModelFeature,
122
+ ModelEntity,
123
+ ModelDep,
124
+ ModelHook,
41
125
  }
42
-
package/src/utility.ts CHANGED
@@ -12,10 +12,16 @@ function resolvePath(ctx$: any, path: string): any {
12
12
  }
13
13
 
14
14
 
15
- // True unless the model explicitly declares main.kit.config.auth.active: false.
16
- // Used by templates to gate apikey-related code, docs, and examples for
17
- // public APIs that need no authentication.
15
+ // True unless the model declares auth off. Templates use this to gate
16
+ // apikey-related code, docs, and examples for public APIs that need no
17
+ // authentication. Two opt-outs, in priority order:
18
+ // 1. main.kit.info.auth: false (user-facing, set in api-info.jsonic)
19
+ // 2. main.kit.config.auth.active: false
18
20
  function isAuthActive(model: any): boolean {
21
+ const info = getModelPath(model, `main.${KIT}.info`,
22
+ { only_active: false, required: false })
23
+ if (info && false === info.auth) return false
24
+
19
25
  const auth = getModelPath(model, `main.${KIT}.config.auth`,
20
26
  { only_active: false, required: false })
21
27
  return null == auth || false !== auth.active
@@ -26,17 +32,22 @@ function requirePath(ctx$: any, path: string, flags?: { ignore?: boolean }): any
26
32
  const fullpath = resolvePath(ctx$, path)
27
33
  const ignore = null == flags?.ignore ? false : flags.ignore
28
34
 
29
- try {
30
- return require(fullpath)
31
- }
32
- catch (err: any) {
33
- if (ignore) {
34
- ctx$.log.warn({ point: 'require-missing', path, note: path })
35
+ // When `ignore` is set, only swallow a genuine "module not found"
36
+ // resolution failure. A module that resolves but throws while loading
37
+ // (syntax error, runtime bug, or a missing *nested* dependency) must
38
+ // propagate otherwise the optional component silently renders nothing
39
+ // and the real failure is invisible.
40
+ if (ignore) {
41
+ try {
42
+ require.resolve(fullpath)
35
43
  }
36
- else {
37
- throw err
44
+ catch (err: any) {
45
+ ctx$.log.warn({ point: 'require-missing', path, note: path })
46
+ return undefined
38
47
  }
39
48
  }
49
+
50
+ return require(fullpath)
40
51
  }
41
52
 
42
53
 
package/README.md DELETED
@@ -1,2 +0,0 @@
1
- # sdkgen
2
- Voxgig SDK Generator
@@ -1,2 +0,0 @@
1
- declare function action_lang(args: any[], ctx: any): Promise<void>;
2
- export { action_lang };
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.action_lang = action_lang;
4
- const jostraca_1 = require("jostraca");
5
- const utility_1 = require("../utility");
6
- const CMD_MAP = {
7
- add: cmd_lang_add
8
- };
9
- async function action_lang(args, ctx) {
10
- const cmdname = args[1];
11
- const cmd = CMD_MAP[cmdname];
12
- if (null == cmd) {
13
- throw new utility_1.SdkGenError('Unknown lang cmd: ' + cmdname);
14
- }
15
- await cmd(args, ctx);
16
- }
17
- async function cmd_lang_add(args, ctx) {
18
- let langs = args[2];
19
- langs = 'string' === typeof langs ? [langs] : langs;
20
- const jostraca = (0, jostraca_1.Jostraca)();
21
- const opts = {
22
- fs: ctx.fs,
23
- folder: ctx.folder,
24
- log: ctx.log.child({ cmp: 'jostraca' }),
25
- meta: { model: ctx.model, tree: ctx.tree }
26
- };
27
- await jostraca.generate(opts, () => LangRoot({ langs }));
28
- }
29
- const LangRoot = (0, jostraca_1.cmp)(function LangRoot(props) {
30
- const { ctx$, langs } = props;
31
- // TODO: model should be a top level ctx property
32
- ctx$.model = ctx$.meta.model;
33
- (0, jostraca_1.Project)({}, () => {
34
- (0, jostraca_1.Folder)({ name: 'model/lang' }, () => {
35
- (0, jostraca_1.each)(langs, (n) => {
36
- const lang = n.val$;
37
- // TODO: validate lang is a-z0-9-_. only
38
- (0, jostraca_1.Copy)({
39
- from: 'node_modules/@voxgig/sdkgen/tm/generate/model/lang/' + lang + '.jsonic',
40
- exclude: true
41
- });
42
- });
43
- });
44
- });
45
- modifyModel({
46
- langs,
47
- model: ctx$.meta.model,
48
- tree: ctx$.meta.tree,
49
- fs: ctx$.fs
50
- });
51
- });
52
- async function modifyModel({ langs, model, tree, fs }) {
53
- // TODO: This is a kludge.
54
- // Aontu should provide option for as-is AST so that can be used
55
- // to find injection point more reliably
56
- const path = tree.url;
57
- let src = fs.readFileSync(path, 'utf8');
58
- // Inject lang file references into model
59
- langs.sort().map((lang) => {
60
- const lineRE = new RegExp(`main:\\s+sdk:\\s+lang:\\s+${lang}:\\s+@"lang/${lang}.jsonic"`);
61
- if (!src.match(lineRE)) {
62
- src = src.replace(/(main:\s+sdk:\s+lang:\s+\{\s*\}\n)/, '$1' +
63
- `main: sdk: lang: ${lang}: @"lang/${lang}.jsonic"\n`);
64
- }
65
- });
66
- fs.writeFileSync(path, src);
67
- }
68
- //# sourceMappingURL=lang.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lang.js","sourceRoot":"","sources":["../../src/action/lang.ts"],"names":[],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- declare const Hook: import("jostraca").Component;
2
- export { Hook };
package/dist/cmp/Hook.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Hook = void 0;
4
- const jostraca_1 = require("jostraca");
5
- const Hook = (0, jostraca_1.cmp)(function Hook(props) {
6
- const { ctx$ } = props;
7
- (0, jostraca_1.Content)(`// Feature Hook`);
8
- });
9
- exports.Hook = Hook;
10
- //# sourceMappingURL=Hook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Hook.js","sourceRoot":"","sources":["../../src/cmp/Hook.ts"],"names":[],"mappings":";;;AACA,uCAAuC;AAKvC,MAAM,IAAI,GAAG,IAAA,cAAG,EAAC,SAAS,IAAI,CAAC,KAAU;IACvC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAA;IAEtB,IAAA,kBAAO,EAAC,iBAAiB,CAAC,CAAA;AAC5B,CAAC,CAAC,CAAA;AAIA,oBAAI"}
package/dist/cmp/Top.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const Top: import("jostraca").Component;
2
- export { Top };