@voxgig/sdkgen 1.2.0 → 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 +13 -6
  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
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content } from '@voxgig/sdkgen'
2
+ import { cmp, Content, entityIdField, entityPrimaryOp, opRequestShape, safeVarName } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -7,6 +7,8 @@ import {
7
7
  nom,
8
8
  } from '@voxgig/apidef'
9
9
 
10
+ import { exampleValue } from './utility_ts'
11
+
10
12
 
11
13
  const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
12
14
  const { target, ctx$: { model } } = props
@@ -20,8 +22,26 @@ const client = ${model.const.Name}SDK.test()
20
22
 
21
23
  if (exampleEntity) {
22
24
  const eName = nom(exampleEntity, 'Name')
23
- Content(`const result = await client.${eName}().load({ id: 'test01' })
24
- // result.ok === true, result.data contains mock data
25
+ const eVar = safeVarName(eName.toLowerCase(), 'ts')
26
+ // Drive the test-mode example off the entity's PRIMARY op (never a
27
+ // hardcoded `load` a create-only entity lacks).
28
+ const primaryOp = entityPrimaryOp(exampleEntity) || 'load'
29
+ const primaryOpDef = exampleEntity.op && exampleEntity.op[primaryOp]
30
+ const idF = entityIdField(exampleEntity)
31
+ let arg = ''
32
+ if ('load' === primaryOp || 'remove' === primaryOp) {
33
+ arg = idF ? `{ ${idF}: ${exampleValue(exampleEntity, primaryOpDef, idF, 'test01')} }` : ''
34
+ } else if ('create' === primaryOp || 'update' === primaryOp) {
35
+ const items = opRequestShape(exampleEntity, primaryOp).items
36
+ .filter((it: any) => it.name !== idF && it.name !== 'id')
37
+ const required = items.filter((it: any) => !it.optional)
38
+ const chosen = required.length ? required : items.slice(0, 3)
39
+ arg = `{ ${chosen.map((it: any) =>
40
+ `${it.name}: ${exampleValue(exampleEntity, primaryOpDef, it.name, 'example_' + it.name)}`).join(', ')} }`
41
+ }
42
+ Content(`const ${eVar} = await client.${eName}().${primaryOp}(${arg})
43
+ // ${eVar} is a bare ${eName} populated with mock data
44
+ console.log(${eVar})
25
45
  `)
26
46
  }
27
47
 
@@ -398,7 +398,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
398
398
  const fieldvalue = spec.def.mark
399
399
  Content(`
400
400
  const ${markdefvar} = { name: '${fieldname}', value: '${fieldvalue}_' + setup.now }
401
- ${datavar} [${markdefvar}.name] = ${markdefvar}.value
401
+ ;(${datavar} as any)[${markdefvar}.name] = ${markdefvar}.value
402
402
  `)
403
403
  }
404
404
  }
@@ -419,7 +419,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
419
419
  const spec = step.spec[sI]
420
420
  if ('TextFieldMark' === spec.apply && null != step.input.textfield) {
421
421
  Content(`
422
- assert(${resdatavar}[${markdefvar}.name] === ${markdefvar}.value)
422
+ assert((${resdatavar} as any)[${markdefvar}.name] === ${markdefvar}.value)
423
423
  `)
424
424
  }
425
425
  }
@@ -15,6 +15,8 @@ import { cmp, each, Folder } from '@voxgig/sdkgen'
15
15
  // import { TestMain } from './TestMain_ts'
16
16
  import { TestDirect } from './TestDirect_ts'
17
17
  import { TestEntity } from './TestEntity_ts'
18
+ import { ReadmeExampleTest } from './ReadmeExampleTest_ts'
19
+ import { ReadmeExamplesTest } from './ReadmeExamplesTest_ts'
18
20
 
19
21
 
20
22
  const Test = cmp(function Test(props: any) {
@@ -25,6 +27,9 @@ const Test = cmp(function Test(props: any) {
25
27
  // Quick({ target })
26
28
  // TestMain({ target })
27
29
 
30
+ ReadmeExampleTest({ target })
31
+ ReadmeExamplesTest({ target })
32
+
28
33
  Folder({ name: 'entity' }, () => {
29
34
  each(model.main[KIT].entity, (entity: ModelEntity) => {
30
35
  TestEntity({ target, entity })
@@ -14,9 +14,11 @@ import type {
14
14
  Control,
15
15
  } from '../types'
16
16
 
17
+ // #TypeImports
18
+
17
19
 
18
20
  // TODO: needs Entity superclass
19
- class EntityNameEntity extends ProjectNameEntityBase {
21
+ class EntityNameEntity extends ProjectNameEntityBase<EntityName> {
20
22
 
21
23
  constructor(client: ProjectNameSDK, entopts: any) {
22
24
  super(client, entopts)
@@ -15,7 +15,9 @@ import type {
15
15
 
16
16
 
17
17
  // TODO: needs Entity superclass
18
- class ProjectNameEntityBase {
18
+ // `D` is the entity's typed data model (e.g. Advice); subclasses bind it via
19
+ // `class AdviceEntity extends ProjectNameEntityBase<Advice>`.
20
+ class ProjectNameEntityBase<D = any> {
19
21
  name = ''
20
22
  name_ = ''
21
23
  Name = ''
@@ -23,8 +25,11 @@ class ProjectNameEntityBase {
23
25
  _client: ProjectNameSDK
24
26
  _utility: Utility
25
27
  _entopts: any
26
- _data: any
27
- _match: any
28
+ // `_data`/`_match` hold accreted partial state (they start `{}` and fill in
29
+ // as ops resolve), so they are `Partial<D>` — the full `D` is only asserted
30
+ // at the `data()` return boundary.
31
+ _data: Partial<D>
32
+ _match: Partial<D>
28
33
  _entctx: Context
29
34
 
30
35
 
@@ -58,7 +63,7 @@ class ProjectNameEntityBase {
58
63
  }
59
64
 
60
65
 
61
- data(this: any, data?: any) {
66
+ data(this: any, data?: Partial<D>): D {
62
67
  const struct = this._utility.struct
63
68
  const featureHook = this._utility.featureHook
64
69
 
@@ -74,7 +79,7 @@ class ProjectNameEntityBase {
74
79
  }
75
80
 
76
81
 
77
- match(match?: any) {
82
+ match(this: any, match?: Partial<D>): Partial<D> {
78
83
  const struct = this._utility.struct
79
84
  const featureHook = this._utility.featureHook
80
85
 
@@ -10,7 +10,7 @@ class EntityOperation {
10
10
 
11
11
  // EJECT-START
12
12
 
13
- async create(this: any, reqdata?: any, ctrl?: Control) {
13
+ async create(this: any, reqdata?: EntityNameCreateData, ctrl?: Control): Promise<EntityName> {
14
14
 
15
15
  const utility = this._utility
16
16
  const {
@@ -95,7 +95,9 @@ class EntityOperation {
95
95
  throw err
96
96
  }
97
97
  else {
98
- return undefined
98
+ // Off-happy-path (throw disabled): typed as any so the method's
99
+ // Promise<EntityName> return stays clean under strict null checks.
100
+ return undefined as any
99
101
  }
100
102
  }
101
103
  }
@@ -10,7 +10,7 @@ class EntityOperation {
10
10
 
11
11
  // EJECT-START
12
12
 
13
- async list(this: any, reqmatch?: any, ctrl?: Control) {
13
+ async list(this: any, reqmatch?: EntityNameListMatch, ctrl?: Control): Promise<EntityName[]> {
14
14
 
15
15
  const utility = this._utility
16
16
 
@@ -96,7 +96,9 @@ class EntityOperation {
96
96
  throw err
97
97
  }
98
98
  else {
99
- return undefined
99
+ // Off-happy-path (throw disabled): typed as any so the method's
100
+ // Promise<EntityName[]> return stays clean under strict null checks.
101
+ return undefined as any
100
102
  }
101
103
  }
102
104
  }
@@ -10,7 +10,7 @@ class EntityOperation {
10
10
 
11
11
  // EJECT-START
12
12
 
13
- async load(this: any, reqmatch?: any, ctrl?: Control) {
13
+ async load(this: any, reqmatch?: EntityNameLoadMatch, ctrl?: Control): Promise<EntityName> {
14
14
 
15
15
  const utility = this._utility
16
16
 
@@ -100,7 +100,9 @@ class EntityOperation {
100
100
  throw err
101
101
  }
102
102
  else {
103
- return undefined
103
+ // Off-happy-path (throw disabled): typed as any so the method's
104
+ // Promise<EntityName> return stays clean under strict null checks.
105
+ return undefined as any
104
106
  }
105
107
  }
106
108
  }
@@ -10,7 +10,7 @@ class EntityOperation {
10
10
 
11
11
  // EJECT-START
12
12
 
13
- async remove(this: any, reqmatch?: any, ctrl?: Control) {
13
+ async remove(this: any, reqmatch?: EntityNameRemoveMatch, ctrl?: Control): Promise<EntityName> {
14
14
 
15
15
  const utility = this._utility
16
16
 
@@ -101,7 +101,9 @@ class EntityOperation {
101
101
  throw err
102
102
  }
103
103
  else {
104
- return undefined
104
+ // Off-happy-path (throw disabled): typed as any so the method's
105
+ // Promise<EntityName> return stays clean under strict null checks.
106
+ return undefined as any
105
107
  }
106
108
  }
107
109
  }
@@ -10,7 +10,7 @@ class EntityOperation {
10
10
 
11
11
  // EJECT-START
12
12
 
13
- async update(this: any, reqdata?: any, ctrl?: Control) {
13
+ async update(this: any, reqdata?: EntityNameUpdateData, ctrl?: Control): Promise<EntityName> {
14
14
 
15
15
  const utility = this._utility
16
16
 
@@ -101,7 +101,9 @@ class EntityOperation {
101
101
  throw err
102
102
  }
103
103
  else {
104
- return undefined
104
+ // Off-happy-path (throw disabled): typed as any so the method's
105
+ // Promise<EntityName> return stays clean under strict null checks.
106
+ return undefined as any
105
107
  }
106
108
  }
107
109
  }
@@ -2,12 +2,70 @@
2
2
  import * as Path from 'node:path'
3
3
 
4
4
 
5
+ import {
6
+ canonKey,
7
+ each,
8
+ } from '@voxgig/sdkgen'
9
+
5
10
  import {
6
11
  clone,
7
12
  walk,
8
13
  } from '@voxgig/struct'
9
14
 
10
15
 
16
+ // --- Model-driven example literals -----------------------------------------
17
+ // Doc snippets must use example values whose TYPE matches the generated
18
+ // TypeScript types, or the snippet does not compile. The id/match params of
19
+ // load/remove/update are the common trap: their generated
20
+ // `<Name><Op>Match` / `<Name><Op>Data` type is built from the op's params
21
+ // (see EntityTypes_ts.ts), so a `number` id shown as a quoted string is a
22
+ // TS2322 error. These helpers derive the example literal from the SAME model
23
+ // source, so the docs and the generated types can never disagree.
24
+
25
+ // The declared canon-type sentinel of a named parameter of an op — looked up
26
+ // in the op's `points[].args.params[]` exactly as the typed-model generator
27
+ // does. Falls back to the entity field of the same name (used when the op
28
+ // has no params and the generated match type is `Partial<Entity>`). Returns
29
+ // undefined when neither is present.
30
+ function paramCanonType(entity: any, op: any, paramName: string): unknown {
31
+ const points = op && op.points ? each(op.points) : []
32
+ for (const pt of points as any[]) {
33
+ const params = pt && pt.args && pt.args.params ? each(pt.args.params) : []
34
+ const found = (params as any[]).find((p: any) => p && p.name === paramName)
35
+ if (found) {
36
+ return found.type
37
+ }
38
+ }
39
+ const field = (entity && entity.fields ? each(entity.fields) : [])
40
+ .find((f: any) => f && f.name === paramName) as any
41
+ return field && field.type
42
+ }
43
+
44
+
45
+ // A type-correct example literal for a named match/data parameter of an op,
46
+ // derived entirely from the model. INTEGER/NUMBER render as the bare number
47
+ // `1` (a quoted string on a `number` field is a compile error), BOOLEAN as
48
+ // `true`, ARRAY as the empty `[]` and OBJECT as the empty `{}` (a quoted
49
+ // string is not assignable to `any[]` / `Record<string, any>`), everything
50
+ // else (STRING, unknown, missing) as the quoted `placeholder`.
51
+ function exampleValue(entity: any, op: any, paramName: string, placeholder: string): string {
52
+ const key = canonKey(paramCanonType(entity, op, paramName))
53
+ if ('INTEGER' === key || 'NUMBER' === key) {
54
+ return '1'
55
+ }
56
+ if ('BOOLEAN' === key) {
57
+ return 'true'
58
+ }
59
+ if ('ARRAY' === key) {
60
+ return '[]'
61
+ }
62
+ if ('OBJECT' === key) {
63
+ return '{}'
64
+ }
65
+ return `'${placeholder}'`
66
+ }
67
+
68
+
11
69
  function projectPath(suffix?: string): string {
12
70
  return Path.normalize(Path.join(__dirname, '../../..', suffix ?? ''))
13
71
  }
@@ -61,4 +119,5 @@ export {
61
119
  formatJSONSrc,
62
120
  formatJson,
63
121
  projectPath,
122
+ exampleValue,
64
123
  }
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) $$const.year$$ $$const.Name$$
3
+ Copyright (c) $$const.year$$ Voxgig
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- .PHONY: test build clean
1
+ .PHONY: test build clean publish
2
2
 
3
3
  test:
4
4
  go test ./... -v
@@ -8,3 +8,38 @@ build:
8
8
 
9
9
  clean:
10
10
  go clean ./...
11
+
12
+ # --- Release: tag for the Go module proxy (pkg.go.dev) --------------------
13
+ # Go modules have no registry upload — publishing a version means pushing the
14
+ # tag go/vX.Y.Z (this module is the go/ subdir, and Go's submodule-tag
15
+ # convention is <subdir>/vX.Y.Z), which the module proxy + pkg.go.dev pick up on
16
+ # first fetch. Run headless under the aql key vault, which injects the GitHub
17
+ # token so nothing lands on disk or argv:
18
+ # aql vault exec --for=github=<alias> -- make publish
19
+ # aql `--dry-run` injects a filler token we detect to rehearse (no tag/push).
20
+ # set -e + tag-last: a failed push never leaves a tag behind.
21
+ #
22
+ # NOTE: publishing the git tag is deliberately NOT gated on `go test` (every
23
+ # other target's deploy just pushes its tag; a generated-test quirk must not
24
+ # block the module tag). Run `make test` separately in CI to gate quality.
25
+ VERSION := $(shell cat VERSION)
26
+ TAG := go/v$(VERSION)
27
+ AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
28
+ publish:
29
+ @if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
30
+ echo "tag $(TAG) already exists — bump VERSION first"; exit 1; fi
31
+ @set -e; \
32
+ token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
33
+ if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ]; then \
34
+ echo "[dry-run] aql filler token detected: would tag $(TAG) for pkg.go.dev; nothing pushed."; \
35
+ exit 0; \
36
+ fi; \
37
+ git tag -a "$(TAG)" -m "go v$(VERSION)"; \
38
+ url=$$(git remote get-url origin | sed -E 's#^git@github.com:#https://github.com/#'); \
39
+ if [ -n "$$token" ] && printf '%s' "$$url" | grep -q '^https://github.com/'; then \
40
+ hdr="AUTHORIZATION: basic $$(printf 'x-access-token:%s' "$$token" | base64 | tr -d '\n')"; \
41
+ git -c http.extraheader="$$hdr" push "$$url" "$(TAG)"; \
42
+ else \
43
+ git push origin "$(TAG)"; \
44
+ fi; \
45
+ echo "Tagged $(TAG) for pkg.go.dev."
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -217,7 +217,17 @@ func NewContext(ctxmap map[string]any, basectx *Context) *Context {
217
217
  }
218
218
 
219
219
  func (ctx *Context) resolveOp(opname string) *Operation {
220
- if op, ok := ctx.Opmap[opname]; ok && op != nil {
220
+ // Cache key is `<entity>:<opname>` so two entities with the same op
221
+ // (e.g. both have a "list") get distinct cached Operations. Keying on
222
+ // opname alone caused the first-resolved entity's points to be served
223
+ // to every subsequent entity's call.
224
+ entname := ""
225
+ if ctx.Entity != nil {
226
+ entname = ctx.Entity.GetName()
227
+ }
228
+ cacheKey := entname + ":" + opname
229
+
230
+ if op, ok := ctx.Opmap[cacheKey]; ok && op != nil {
221
231
  return op
222
232
  }
223
233
 
@@ -225,11 +235,6 @@ func (ctx *Context) resolveOp(opname string) *Operation {
225
235
  return NewOperation(map[string]any{})
226
236
  }
227
237
 
228
- entname := ""
229
- if ctx.Entity != nil {
230
- entname = ctx.Entity.GetName()
231
- }
232
-
233
238
  opcfg := vs.GetPath([]any{"entity", entname, "op", opname}, ctx.Config)
234
239
 
235
240
  input := "match"
@@ -258,7 +263,7 @@ func (ctx *Context) resolveOp(opname string) *Operation {
258
263
  "points": targets,
259
264
  })
260
265
 
261
- ctx.Opmap[opname] = op
266
+ ctx.Opmap[cacheKey] = op
262
267
  return op
263
268
  }
264
269
 
@@ -0,0 +1,6 @@
1
+ # go-cli features
2
+
3
+ The go-cli target does not generate per-feature source. Features are
4
+ applied to the sibling Go SDK by the `go` target; the CLI consumes
5
+ that SDK as a single dependency. This file exists only to satisfy
6
+ the standard tm/<target>/src/feature/ folder convention.
@@ -0,0 +1,6 @@
1
+ # go-cli features
2
+
3
+ The go-cli target does not generate per-feature source. Features are
4
+ applied to the sibling Go SDK by the `go` target; the CLI consumes
5
+ that SDK as a single dependency. This file exists only to satisfy
6
+ the standard tm/<target>/src/feature/ folder convention.
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) $$const.year$$ $$const.Name$$
3
+ Copyright (c) $$const.year$$ Voxgig
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,41 @@
1
+ .PHONY: test build clean publish
2
+
3
+ test:
4
+ npm test
5
+
6
+ build:
7
+ @echo "No build step for JavaScript"
8
+
9
+ clean:
10
+ rm -rf node_modules
11
+
12
+ # --- Release: publish to npm ----------------------------------------------
13
+ # Publish this package to npm, then tag js/vX.Y.Z. Run headless under the aql
14
+ # key vault, which injects the npm auth token + the GitHub token (never on disk
15
+ # or argv):
16
+ # aql vault exec --for=npm=<alias> --for=github=<alias> -- make publish
17
+ # aql `--dry-run` injects a filler token we detect to rehearse (no publish/tag).
18
+ # set -e + tag-last: a failed publish never leaves a tag behind.
19
+ SHELL := /bin/bash
20
+ VERSION := $(shell node -p "require('./package.json').version")
21
+ TAG := js/v$(VERSION)
22
+ AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
23
+ publish: test
24
+ @if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
25
+ echo "tag $(TAG) already exists — bump package.json version first"; exit 1; fi
26
+ @set -e; \
27
+ token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
28
+ if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ]; then \
29
+ echo "[dry-run] aql filler token detected: would publish to npm and tag $(TAG); nothing pushed."; \
30
+ exit 0; \
31
+ fi; \
32
+ npm publish --access public --registry https://registry.npmjs.org; \
33
+ git tag -a "$(TAG)" -m "js v$(VERSION)"; \
34
+ url=$$(git remote get-url origin | sed -E 's#^git@github.com:#https://github.com/#'); \
35
+ if [ -n "$$token" ] && printf '%s' "$$url" | grep -q '^https://github.com/'; then \
36
+ hdr="AUTHORIZATION: basic $$(printf 'x-access-token:%s' "$$token" | base64 | tr -d '\n')"; \
37
+ git -c http.extraheader="$$hdr" push "$$url" "$(TAG)"; \
38
+ else \
39
+ git push origin "$(TAG)"; \
40
+ fi; \
41
+ echo "Published to npm + tag $(TAG)."
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) $$const.year$$ $$const.Name$$
3
+ Copyright (c) $$const.year$$ Voxgig
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- .PHONY: test build clean
1
+ .PHONY: test build clean publish
2
2
 
3
3
  test:
4
4
  busted -p _test test/
@@ -8,3 +8,42 @@ build:
8
8
 
9
9
  clean:
10
10
  @echo "No clean step for Lua"
11
+
12
+ # --- Release: publish to LuaRocks -----------------------------------------
13
+ # Upload the rockspec to LuaRocks, then tag lua/vX.Y.Z. LuaRocks has no aql
14
+ # recipe, so inject its API key + the GitHub token as custom env vars
15
+ # (all-positional — aql cannot mix --for recipes with positional env):
16
+ # aql vault exec '<alias>=LUAROCKS_API_KEY,<gh-alias>=GITHUB_TOKEN' -- make publish
17
+ # --skip-pack uploads only the rockspec (its git+https source is fetched at the
18
+ # lua/vX.Y.Z tag on install; that tag is pushed in the LAST step, so we must not
19
+ # pack here). LuaRocks requires the rockspec filename to be
20
+ # <package>-<version>.rockspec, so we upload a canonically-named copy. aql
21
+ # `--dry-run` rehearses (no upload/tag). set -e + tag-last: a failed upload
22
+ # never leaves a tag behind.
23
+ VERSION := $(shell sed -nE 's/^version *= *"([0-9.]+).*/\1/p' *.rockspec | head -1)
24
+ TAG := lua/v$(VERSION)
25
+ AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
26
+ publish: test
27
+ @if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
28
+ echo "tag $(TAG) already exists — bump the rockspec version first"; exit 1; fi
29
+ @set -e; \
30
+ token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
31
+ if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ] || [ "$$LUAROCKS_API_KEY" = "$(AQL_DRY_RUN_FILLER)" ]; then \
32
+ echo "[dry-run] aql filler token detected: would upload to LuaRocks and tag $(TAG); nothing pushed."; \
33
+ exit 0; \
34
+ fi; \
35
+ rock=$$(ls *.rockspec | head -1); \
36
+ pkg=$$(sed -nE 's/^package *= *"([^"]+)".*/\1/p' "$$rock" | head -1); \
37
+ rev=$$(sed -nE 's/^version *= *"([^"]+)".*/\1/p' "$$rock" | head -1); \
38
+ cp "$$rock" "$$pkg-$$rev.rockspec"; \
39
+ luarocks upload --skip-pack "$$pkg-$$rev.rockspec" --temp-key="$$LUAROCKS_API_KEY"; \
40
+ rm -f "$$pkg-$$rev.rockspec"; \
41
+ git tag -a "$(TAG)" -m "lua v$(VERSION)"; \
42
+ url=$$(git remote get-url origin | sed -E 's#^git@github.com:#https://github.com/#'); \
43
+ if [ -n "$$token" ] && printf '%s' "$$url" | grep -q '^https://github.com/'; then \
44
+ hdr="AUTHORIZATION: basic $$(printf 'x-access-token:%s' "$$token" | base64 | tr -d '\n')"; \
45
+ git -c http.extraheader="$$hdr" push "$$url" "$(TAG)"; \
46
+ else \
47
+ git push origin "$(TAG)"; \
48
+ fi; \
49
+ echo "Published to LuaRocks + tag $(TAG)."
@@ -160,17 +160,22 @@ end
160
160
 
161
161
 
162
162
  function Context:resolve_op(opname)
163
- if self.opmap[opname] ~= nil then
164
- return self.opmap[opname]
163
+ -- Cache key is `<entity>:<opname>` so two entities with the same op
164
+ -- (e.g. both have a "list") get distinct cached Operations. Keying
165
+ -- on opname alone caused the first-resolved entity's points to be
166
+ -- served to every subsequent entity's call.
167
+ local entname = "_"
168
+ if self.entity ~= nil and type(self.entity.get_name) == "function" then
169
+ entname = self.entity:get_name()
165
170
  end
171
+ local cache_key = entname .. ":" .. opname
166
172
 
167
- if opname == "" then
168
- return Operation.new({})
173
+ if self.opmap[cache_key] ~= nil then
174
+ return self.opmap[cache_key]
169
175
  end
170
176
 
171
- local entname = "_"
172
- if self.entity ~= nil and type(self.entity.get_name) == "function" then
173
- entname = self.entity:get_name()
177
+ if opname == "" then
178
+ return Operation.new({})
174
179
  end
175
180
 
176
181
  local opcfg = vs.getpath(self.config, "entity." .. entname .. ".op." .. opname)
@@ -195,7 +200,7 @@ function Context:resolve_op(opname)
195
200
  points = points,
196
201
  })
197
202
 
198
- self.opmap[opname] = op
203
+ self.opmap[cache_key] = op
199
204
  return op
200
205
  end
201
206
 
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) $$const.year$$ $$const.Name$$
3
+ Copyright (c) $$const.year$$ Voxgig
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- .PHONY: test build clean
1
+ .PHONY: test build clean publish
2
2
 
3
3
  test:
4
4
  ./vendor/bin/phpunit test
@@ -8,3 +8,33 @@ build:
8
8
 
9
9
  clean:
10
10
  @echo "No clean step for PHP"
11
+
12
+ # --- Release: tag for Packagist -------------------------------------------
13
+ # Packagist has no upload — it tracks the repo and indexes each git tag
14
+ # php/vX.Y.Z (a configured GitHub webhook, or the Packagist "Update" API,
15
+ # refreshes the package). So publishing a version means pushing the tag. Run
16
+ # headless under the aql key vault, which injects the GitHub token:
17
+ # aql vault exec --for=github=<alias> -- make publish
18
+ # aql `--dry-run` injects a filler token we detect to rehearse (no tag/push).
19
+ # set -e + tag-last: a failed push never leaves a tag behind.
20
+ VERSION := $(shell cat VERSION)
21
+ TAG := php/v$(VERSION)
22
+ AQL_DRY_RUN_FILLER := AQL-DRY-RUN-FILLER-NOT-A-REAL-SECRET
23
+ publish: test
24
+ @if git rev-parse -q --verify "refs/tags/$(TAG)" >/dev/null; then \
25
+ echo "tag $(TAG) already exists — bump VERSION first"; exit 1; fi
26
+ @set -e; \
27
+ token="$${GITHUB_TOKEN:-$$GH_TOKEN}"; \
28
+ if [ "$$token" = "$(AQL_DRY_RUN_FILLER)" ]; then \
29
+ echo "[dry-run] aql filler token detected: would tag $(TAG) for Packagist; nothing pushed."; \
30
+ exit 0; \
31
+ fi; \
32
+ git tag -a "$(TAG)" -m "php v$(VERSION)"; \
33
+ url=$$(git remote get-url origin | sed -E 's#^git@github.com:#https://github.com/#'); \
34
+ if [ -n "$$token" ] && printf '%s' "$$url" | grep -q '^https://github.com/'; then \
35
+ hdr="AUTHORIZATION: basic $$(printf 'x-access-token:%s' "$$token" | base64 | tr -d '\n')"; \
36
+ git -c http.extraheader="$$hdr" push "$$url" "$(TAG)"; \
37
+ else \
38
+ git push origin "$(TAG)"; \
39
+ fi; \
40
+ echo "Tagged $(TAG) for Packagist."
@@ -0,0 +1 @@
1
+ 0.0.1