@docouno/devkit 0.0.0-stage → 0.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 (310) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -2
  3. package/devkit +0 -0
  4. package/notices/NOTICE.txt +395 -0
  5. package/notices/cargo/adler2-2.0.1-238207d3/notice-001.txt +12 -0
  6. package/notices/cargo/adler2-2.0.1-238207d3/notice-002.txt +201 -0
  7. package/notices/cargo/adler2-2.0.1-238207d3/notice-003.txt +23 -0
  8. package/notices/cargo/aho-corasick-1.1.5-90cd2b64/notice-001.txt +3 -0
  9. package/notices/cargo/aho-corasick-1.1.5-90cd2b64/notice-002.txt +21 -0
  10. package/notices/cargo/aho-corasick-1.1.5-90cd2b64/notice-003.txt +24 -0
  11. package/notices/cargo/annotate-snippets-0.12.17-e17d8c74/notice-001.txt +202 -0
  12. package/notices/cargo/annotate-snippets-0.12.17-e17d8c74/notice-002.txt +19 -0
  13. package/notices/cargo/anstyle-1.0.14-f65811ba/notice-001.txt +202 -0
  14. package/notices/cargo/anstyle-1.0.14-f65811ba/notice-002.txt +19 -0
  15. package/notices/cargo/anyhow-1.0.104-dc6381fb/notice-001.txt +176 -0
  16. package/notices/cargo/anyhow-1.0.104-dc6381fb/notice-002.txt +23 -0
  17. package/notices/cargo/arraydeque-0.5.1-42a9cc56/notice-001.txt +21 -0
  18. package/notices/cargo/autocfg-1.5.1-41f0cbe6/notice-001.txt +201 -0
  19. package/notices/cargo/autocfg-1.5.1-41f0cbe6/notice-002.txt +25 -0
  20. package/notices/cargo/base64-0.22.1-26575a7c/notice-001.txt +201 -0
  21. package/notices/cargo/base64-0.22.1-26575a7c/notice-002.txt +21 -0
  22. package/notices/cargo/base64-0.23.1-9f42fcbf/notice-001.txt +201 -0
  23. package/notices/cargo/base64-0.23.1-9f42fcbf/notice-002.txt +21 -0
  24. package/notices/cargo/bitflags-2.13.2-a49cf0c5/notice-001.txt +201 -0
  25. package/notices/cargo/bitflags-2.13.2-a49cf0c5/notice-002.txt +25 -0
  26. package/notices/cargo/block-buffer-0.10.4-0a748df3/notice-001.txt +201 -0
  27. package/notices/cargo/block-buffer-0.10.4-0a748df3/notice-002.txt +25 -0
  28. package/notices/cargo/bytes-1.12.1-e3524fe6/notice-001.txt +25 -0
  29. package/notices/cargo/cc-1.10.0-cda055ec/notice-001.txt +201 -0
  30. package/notices/cargo/cc-1.10.0-cda055ec/notice-002.txt +25 -0
  31. package/notices/cargo/cfg-if-1.0.5-cd0760fa/notice-001.txt +201 -0
  32. package/notices/cargo/cfg-if-1.0.5-cd0760fa/notice-002.txt +25 -0
  33. package/notices/cargo/core_detect-1.0.0-7ba90a69/notice-001.txt +201 -0
  34. package/notices/cargo/core_detect-1.0.0-7ba90a69/notice-002.txt +25 -0
  35. package/notices/cargo/cpufeatures-0.2.17-bcd8b7c7/notice-001.txt +201 -0
  36. package/notices/cargo/cpufeatures-0.2.17-bcd8b7c7/notice-002.txt +25 -0
  37. package/notices/cargo/crc32fast-1.5.3-6de55ffd/notice-001.txt +202 -0
  38. package/notices/cargo/crc32fast-1.5.3-6de55ffd/notice-002.txt +21 -0
  39. package/notices/cargo/crypto-common-0.1.7-d182dd5c/notice-001.txt +201 -0
  40. package/notices/cargo/crypto-common-0.1.7-d182dd5c/notice-002.txt +25 -0
  41. package/notices/cargo/digest-0.10.7-c92dfead/notice-001.txt +201 -0
  42. package/notices/cargo/digest-0.10.7-c92dfead/notice-002.txt +25 -0
  43. package/notices/cargo/encoding_rs-0.8.42-46195b9c/notice-001.txt +17 -0
  44. package/notices/cargo/encoding_rs-0.8.42-46195b9c/notice-002.txt +202 -0
  45. package/notices/cargo/encoding_rs-0.8.42-46195b9c/notice-003.txt +25 -0
  46. package/notices/cargo/encoding_rs-0.8.42-46195b9c/notice-004.txt +26 -0
  47. package/notices/cargo/encoding_rs_io-0.1.8-60e8f178/notice-001.txt +8 -0
  48. package/notices/cargo/encoding_rs_io-0.1.8-60e8f178/notice-002.txt +201 -0
  49. package/notices/cargo/encoding_rs_io-0.1.8-60e8f178/notice-003.txt +21 -0
  50. package/notices/cargo/equivalent-1.0.3-2193bbe7/notice-001.txt +201 -0
  51. package/notices/cargo/equivalent-1.0.3-2193bbe7/notice-002.txt +25 -0
  52. package/notices/cargo/errno-0.3.14-3ca95530/notice-001.txt +201 -0
  53. package/notices/cargo/errno-0.3.14-3ca95530/notice-002.txt +25 -0
  54. package/notices/cargo/fastrand-2.5.0-f2fd8a52/notice-001.txt +201 -0
  55. package/notices/cargo/fastrand-2.5.0-f2fd8a52/notice-002.txt +23 -0
  56. package/notices/cargo/filetime-0.2.29-d64063cd/notice-001.txt +201 -0
  57. package/notices/cargo/filetime-0.2.29-d64063cd/notice-002.txt +25 -0
  58. package/notices/cargo/find-msvc-tools-0.1.15-7bf23a75/notice-001.txt +201 -0
  59. package/notices/cargo/find-msvc-tools-0.1.15-7bf23a75/notice-002.txt +25 -0
  60. package/notices/cargo/flate2-1.1.10-8985ab4e/notice-001.txt +201 -0
  61. package/notices/cargo/flate2-1.1.10-8985ab4e/notice-002.txt +25 -0
  62. package/notices/cargo/foldhash-0.2.0-3ee6d7fb/notice-001.txt +19 -0
  63. package/notices/cargo/generic-array-0.14.7-31bd8478/notice-001.txt +21 -0
  64. package/notices/cargo/getrandom-0.2.17-766fa84f/notice-001.txt +201 -0
  65. package/notices/cargo/getrandom-0.2.17-766fa84f/notice-002.txt +26 -0
  66. package/notices/cargo/getrandom-0.4.3-4f1c9ebb/notice-001.txt +201 -0
  67. package/notices/cargo/getrandom-0.4.3-4f1c9ebb/notice-002.txt +26 -0
  68. package/notices/cargo/granit-parser-2.0.0-65bc2836/notice-001.txt +15 -0
  69. package/notices/cargo/hashbrown-0.17.1-97fc3cc1/notice-001.txt +201 -0
  70. package/notices/cargo/hashbrown-0.17.1-97fc3cc1/notice-002.txt +25 -0
  71. package/notices/cargo/http-1.5.0-6a40d4c4/notice-001.txt +201 -0
  72. package/notices/cargo/http-1.5.0-6a40d4c4/notice-002.txt +25 -0
  73. package/notices/cargo/httparse-1.10.1-cfa5aaf5/notice-001.txt +201 -0
  74. package/notices/cargo/httparse-1.10.1-cfa5aaf5/notice-002.txt +20 -0
  75. package/notices/cargo/indexmap-2.14.2-a08229e1/notice-001.txt +201 -0
  76. package/notices/cargo/indexmap-2.14.2-a08229e1/notice-002.txt +25 -0
  77. package/notices/cargo/itoa-1.0.18-b22a1f7a/notice-001.txt +176 -0
  78. package/notices/cargo/itoa-1.0.18-b22a1f7a/notice-002.txt +23 -0
  79. package/notices/cargo/libc-0.2.191-18856c2b/notice-001.txt +176 -0
  80. package/notices/cargo/libc-0.2.191-18856c2b/notice-002.txt +25 -0
  81. package/notices/cargo/linux-raw-sys-0.12.1-270748a5/notice-001.txt +29 -0
  82. package/notices/cargo/linux-raw-sys-0.12.1-270748a5/notice-002.txt +201 -0
  83. package/notices/cargo/linux-raw-sys-0.12.1-270748a5/notice-003.txt +220 -0
  84. package/notices/cargo/linux-raw-sys-0.12.1-270748a5/notice-004.txt +23 -0
  85. package/notices/cargo/log-0.4.34-23464387/notice-001.txt +201 -0
  86. package/notices/cargo/log-0.4.34-23464387/notice-002.txt +25 -0
  87. package/notices/cargo/memchr-2.8.3-9c6980a5/notice-001.txt +3 -0
  88. package/notices/cargo/memchr-2.8.3-9c6980a5/notice-002.txt +21 -0
  89. package/notices/cargo/memchr-2.8.3-9c6980a5/notice-003.txt +24 -0
  90. package/notices/cargo/miniz_oxide-0.9.1-d0d7eacf/notice-001.txt +25 -0
  91. package/notices/cargo/miniz_oxide-0.9.1-d0d7eacf/notice-002.txt +177 -0
  92. package/notices/cargo/miniz_oxide-0.9.1-d0d7eacf/notice-003.txt +24 -0
  93. package/notices/cargo/miniz_oxide-0.9.1-d0d7eacf/notice-004.txt +14 -0
  94. package/notices/cargo/multiversion_no_op-1.0.0-1ef14dda/notice-001.txt +15 -0
  95. package/notices/cargo/multiversion_no_op-1.0.0-1ef14dda/notice-002.txt +202 -0
  96. package/notices/cargo/multiversion_no_op-1.0.0-1ef14dda/notice-003.txt +25 -0
  97. package/notices/cargo/nohash-hasher-0.2.0-8ab2027b/notice-001.txt +202 -0
  98. package/notices/cargo/nohash-hasher-0.2.0-8ab2027b/notice-002.txt +18 -0
  99. package/notices/cargo/num-traits-0.2.19-d58f8d42/notice-001.txt +201 -0
  100. package/notices/cargo/num-traits-0.2.19-d58f8d42/notice-002.txt +25 -0
  101. package/notices/cargo/once_cell-1.21.4-4a678fe2/notice-001.txt +201 -0
  102. package/notices/cargo/once_cell-1.21.4-4a678fe2/notice-002.txt +23 -0
  103. package/notices/cargo/percent-encoding-2.3.2-9472d0b5/notice-001.txt +201 -0
  104. package/notices/cargo/percent-encoding-2.3.2-9472d0b5/notice-002.txt +25 -0
  105. package/notices/cargo/proc-macro2-1.0.107-ccabd92a/notice-001.txt +176 -0
  106. package/notices/cargo/proc-macro2-1.0.107-ccabd92a/notice-002.txt +23 -0
  107. package/notices/cargo/quote-1.0.47-0f6442d5/notice-001.txt +176 -0
  108. package/notices/cargo/quote-1.0.47-0f6442d5/notice-002.txt +23 -0
  109. package/notices/cargo/regex-1.13.1-3a9e4453/notice-001.txt +201 -0
  110. package/notices/cargo/regex-1.13.1-3a9e4453/notice-002.txt +25 -0
  111. package/notices/cargo/regex-automata-0.4.18-8f2fdfe1/notice-001.txt +201 -0
  112. package/notices/cargo/regex-automata-0.4.18-8f2fdfe1/notice-002.txt +25 -0
  113. package/notices/cargo/regex-syntax-0.8.11-22c58573/notice-001.txt +201 -0
  114. package/notices/cargo/regex-syntax-0.8.11-22c58573/notice-002.txt +25 -0
  115. package/notices/cargo/regex-syntax-0.8.11-22c58573/notice-003.txt +57 -0
  116. package/notices/cargo/ring-0.17.14-a2ecd079/notice-001.txt +9 -0
  117. package/notices/cargo/ring-0.17.14-a2ecd079/notice-002.txt +272 -0
  118. package/notices/cargo/ring-0.17.14-a2ecd079/notice-003.txt +13 -0
  119. package/notices/cargo/ring-0.17.14-a2ecd079/notice-004.txt +201 -0
  120. package/notices/cargo/ring-0.17.14-a2ecd079/notice-005.txt +23 -0
  121. package/notices/cargo/ring-0.17.14-a2ecd079/notice-006.txt +15 -0
  122. package/notices/cargo/rustix-1.1.5-75031891/notice-001.txt +29 -0
  123. package/notices/cargo/rustix-1.1.5-75031891/notice-002.txt +201 -0
  124. package/notices/cargo/rustix-1.1.5-75031891/notice-003.txt +220 -0
  125. package/notices/cargo/rustix-1.1.5-75031891/notice-004.txt +23 -0
  126. package/notices/cargo/rustls-0.23.46-d439923c/notice-001.txt +201 -0
  127. package/notices/cargo/rustls-0.23.46-d439923c/notice-002.txt +15 -0
  128. package/notices/cargo/rustls-0.23.46-d439923c/notice-003.txt +25 -0
  129. package/notices/cargo/rustls-pki-types-1.15.1-0cee9399/notice-001.txt +201 -0
  130. package/notices/cargo/rustls-pki-types-1.15.1-0cee9399/notice-002.txt +25 -0
  131. package/notices/cargo/rustls-webpki-0.103.16-8f5bb5a5/notice-001.txt +19 -0
  132. package/notices/cargo/rustversion-1.0.23-84eb0e4f/notice-001.txt +176 -0
  133. package/notices/cargo/rustversion-1.0.23-84eb0e4f/notice-002.txt +23 -0
  134. package/notices/cargo/scopeguard-1.2.0-ccdf1abe/notice-001.txt +201 -0
  135. package/notices/cargo/scopeguard-1.2.0-ccdf1abe/notice-002.txt +25 -0
  136. package/notices/cargo/serde-1.0.229-f2b8eb6e/notice-001.txt +176 -0
  137. package/notices/cargo/serde-1.0.229-f2b8eb6e/notice-002.txt +23 -0
  138. package/notices/cargo/serde-saphyr-2.0.0-6dbd70ad/notice-001.txt +176 -0
  139. package/notices/cargo/serde-saphyr-2.0.0-6dbd70ad/notice-002.txt +23 -0
  140. package/notices/cargo/serde_core-1.0.229-08cccc74/notice-001.txt +176 -0
  141. package/notices/cargo/serde_core-1.0.229-08cccc74/notice-002.txt +23 -0
  142. package/notices/cargo/serde_derive-1.0.229-db09cb76/notice-001.txt +176 -0
  143. package/notices/cargo/serde_derive-1.0.229-db09cb76/notice-002.txt +23 -0
  144. package/notices/cargo/serde_json-1.0.154-084efbf1/notice-001.txt +176 -0
  145. package/notices/cargo/serde_json-1.0.154-084efbf1/notice-002.txt +23 -0
  146. package/notices/cargo/serde_spanned-1.1.2-13274efe/notice-001.txt +202 -0
  147. package/notices/cargo/serde_spanned-1.1.2-13274efe/notice-002.txt +19 -0
  148. package/notices/cargo/sha1-0.10.7-be2212b4/notice-001.txt +201 -0
  149. package/notices/cargo/sha1-0.10.7-be2212b4/notice-002.txt +27 -0
  150. package/notices/cargo/sha2-0.10.9-be6ca6b4/notice-001.txt +201 -0
  151. package/notices/cargo/sha2-0.10.9-be6ca6b4/notice-002.txt +27 -0
  152. package/notices/cargo/shell-words-1.1.1-0d55474b/notice-001.txt +201 -0
  153. package/notices/cargo/shell-words-1.1.1-0d55474b/notice-002.txt +25 -0
  154. package/notices/cargo/shlex-2.0.1-39c59096/notice-001.txt +13 -0
  155. package/notices/cargo/shlex-2.0.1-39c59096/notice-002.txt +21 -0
  156. package/notices/cargo/signal-hook-0.3.18-a332e163/notice-001.txt +201 -0
  157. package/notices/cargo/signal-hook-0.3.18-a332e163/notice-002.txt +25 -0
  158. package/notices/cargo/signal-hook-registry-1.4.8-497004d4/notice-001.txt +201 -0
  159. package/notices/cargo/signal-hook-registry-1.4.8-497004d4/notice-002.txt +25 -0
  160. package/notices/cargo/simd-adler32-0.3.10-938489e4/notice-001.txt +21 -0
  161. package/notices/cargo/simdutf8-0.1.5-2b987c0c/notice-001.txt +177 -0
  162. package/notices/cargo/simdutf8-0.1.5-2b987c0c/notice-002.txt +19 -0
  163. package/notices/cargo/smallvec-1.16.4-cc422042/notice-001.txt +201 -0
  164. package/notices/cargo/smallvec-1.16.4-cc422042/notice-002.txt +25 -0
  165. package/notices/cargo/subtle-2.6.1-380cc33b/notice-001.txt +29 -0
  166. package/notices/cargo/syn-3.0.9-7a98808e/notice-001.txt +176 -0
  167. package/notices/cargo/syn-3.0.9-7a98808e/notice-002.txt +23 -0
  168. package/notices/cargo/tar-0.4.46-d72ec350/notice-001.txt +201 -0
  169. package/notices/cargo/tar-0.4.46-d72ec350/notice-002.txt +25 -0
  170. package/notices/cargo/tempfile-3.27.0-1f0bd317/notice-001.txt +201 -0
  171. package/notices/cargo/tempfile-3.27.0-1f0bd317/notice-002.txt +25 -0
  172. package/notices/cargo/toml-1.1.8-spec-1.1.0-ee8a4c7b/notice-001.txt +202 -0
  173. package/notices/cargo/toml-1.1.8-spec-1.1.0-ee8a4c7b/notice-002.txt +19 -0
  174. package/notices/cargo/toml_datetime-1.1.2-spec-1.1.0-f08fbf1e/notice-001.txt +202 -0
  175. package/notices/cargo/toml_datetime-1.1.2-spec-1.1.0-f08fbf1e/notice-002.txt +19 -0
  176. package/notices/cargo/toml_parser-1.1.5-spec-1.1.0-a11a62b2/notice-001.txt +202 -0
  177. package/notices/cargo/toml_parser-1.1.5-spec-1.1.0-a11a62b2/notice-002.txt +19 -0
  178. package/notices/cargo/toml_writer-1.1.3-spec-1.1.0-62b81a9a/notice-001.txt +202 -0
  179. package/notices/cargo/toml_writer-1.1.3-spec-1.1.0-62b81a9a/notice-002.txt +19 -0
  180. package/notices/cargo/typenum-1.20.1-6cdf3ca9/notice-001.txt +1 -0
  181. package/notices/cargo/typenum-1.20.1-6cdf3ca9/notice-002.txt +201 -0
  182. package/notices/cargo/typenum-1.20.1-6cdf3ca9/notice-003.txt +21 -0
  183. package/notices/cargo/unicode-ident-1.0.27-0f0691b5/notice-001.txt +176 -0
  184. package/notices/cargo/unicode-ident-1.0.27-0f0691b5/notice-002.txt +23 -0
  185. package/notices/cargo/unicode-ident-1.0.27-0f0691b5/notice-003.txt +39 -0
  186. package/notices/cargo/unicode-width-0.2.2-39fb3891/notice-001.txt +7 -0
  187. package/notices/cargo/unicode-width-0.2.2-39fb3891/notice-002.txt +201 -0
  188. package/notices/cargo/unicode-width-0.2.2-39fb3891/notice-003.txt +25 -0
  189. package/notices/cargo/untrusted-0.9.0-67ed8671/notice-001.txt +13 -0
  190. package/notices/cargo/ureq-3.5.0-13110b1a/notice-001.txt +201 -0
  191. package/notices/cargo/ureq-3.5.0-13110b1a/notice-002.txt +21 -0
  192. package/notices/cargo/ureq-proto-0.6.5-5c45f89a/notice-001.txt +202 -0
  193. package/notices/cargo/ureq-proto-0.6.5-5c45f89a/notice-002.txt +7 -0
  194. package/notices/cargo/utf8-zero-0.8.1-cf839cb2/notice-001.txt +176 -0
  195. package/notices/cargo/utf8-zero-0.8.1-cf839cb2/notice-002.txt +23 -0
  196. package/notices/cargo/uuid-1.29.0-9339a6aa/notice-001.txt +201 -0
  197. package/notices/cargo/uuid-1.29.0-9339a6aa/notice-002.txt +26 -0
  198. package/notices/cargo/version_check-0.9.5-13f5a7bf/notice-001.txt +201 -0
  199. package/notices/cargo/version_check-0.9.5-13f5a7bf/notice-002.txt +19 -0
  200. package/notices/cargo/webpki-roots-1.0.11-98a8d969/notice-001.txt +61 -0
  201. package/notices/cargo/winnow-1.0.4-06523b18/notice-001.txt +18 -0
  202. package/notices/cargo/zeroize-1.9.1-23ddc90c/notice-001.txt +202 -0
  203. package/notices/cargo/zeroize-1.9.1-23ddc90c/notice-002.txt +25 -0
  204. package/notices/cargo/zmij-1.0.23-bfa80998/notice-001.txt +23 -0
  205. package/notices/notice-set.json +2779 -0
  206. package/notices/rust/COPYRIGHT-library.html +29357 -0
  207. package/notices/rust/licenses/Apache-2.0.txt +73 -0
  208. package/notices/rust/licenses/BSD-2-Clause.txt +9 -0
  209. package/notices/rust/licenses/CC-BY-SA-4.0.txt +427 -0
  210. package/notices/rust/licenses/GCC-exception-3.1.txt +30 -0
  211. package/notices/rust/licenses/GPL-2.0-only.txt +133 -0
  212. package/notices/rust/licenses/GPL-3.0-or-later.txt +202 -0
  213. package/notices/rust/licenses/ISC.txt +7 -0
  214. package/notices/rust/licenses/LLVM-exception.txt +15 -0
  215. package/notices/rust/licenses/MIT.txt +9 -0
  216. package/notices/rust/licenses/NCSA.txt +29 -0
  217. package/notices/rust/licenses/OFL-1.1.txt +43 -0
  218. package/notices/rust/licenses/Unicode-3.0.txt +39 -0
  219. package/npm/docouno-env-0.3.1.tgz +0 -0
  220. package/package.json +27 -4
  221. package/release.json +1249 -0
  222. package/runtime/LICENSE +21 -0
  223. package/runtime/compose.tools.yaml +102 -0
  224. package/runtime/desktop-seccomp.json +1262 -0
  225. package/runtime/desktop.Dockerfile +29 -0
  226. package/runtime/devkit.mk +81 -0
  227. package/runtime/devkit.sh +87 -0
  228. package/runtime/licenses/Apache-2.0.txt +202 -0
  229. package/runtime/licenses/moby-profiles.NOTICE +4 -0
  230. package/runtime/rust.Dockerfile +8 -0
  231. package/runtime/toolchains.env +8 -0
  232. package/templates/electron-react/LICENSE +21 -0
  233. package/templates/electron-react/electron-builder.config.cjs +11 -0
  234. package/templates/electron-react/electron.vite.config.cjs +20 -0
  235. package/templates/electron-react/eslint.config.mjs +2 -0
  236. package/templates/electron-react/package-lock.json +7106 -0
  237. package/templates/electron-react/package.json +57 -0
  238. package/templates/electron-react/prettier.config.mjs +1 -0
  239. package/templates/electron-react/src/bridge.ts +10 -0
  240. package/templates/electron-react/src/main/api.test.ts +26 -0
  241. package/templates/electron-react/src/main/api.ts +38 -0
  242. package/templates/electron-react/src/main/index.ts +118 -0
  243. package/templates/electron-react/src/main/renderer-url.test.ts +18 -0
  244. package/templates/electron-react/src/main/renderer-url.ts +21 -0
  245. package/templates/electron-react/src/preload/index.ts +7 -0
  246. package/templates/electron-react/src/renderer/index.html +16 -0
  247. package/templates/electron-react/src/renderer/src/ClientApp.test.tsx +41 -0
  248. package/templates/electron-react/src/renderer/src/ClientApp.tsx +75 -0
  249. package/templates/electron-react/src/renderer/src/api.test.ts +15 -0
  250. package/templates/electron-react/src/renderer/src/api.ts +17 -0
  251. package/templates/electron-react/src/renderer/src/env.d.ts +6 -0
  252. package/templates/electron-react/src/renderer/src/main.tsx +24 -0
  253. package/templates/electron-react/src/renderer/src/style.css +71 -0
  254. package/templates/electron-react/tsconfig.json +8 -0
  255. package/templates/electron-react/tsconfig.node.json +13 -0
  256. package/templates/electron-react/tsconfig.test.json +7 -0
  257. package/templates/electron-react/variants/shared/files/src/renderer/src/main.tsx +24 -0
  258. package/templates/electron-react/variants/shared/variant.json +7 -0
  259. package/templates/electron-react/vitest.config.mjs +19 -0
  260. package/templates/node-api/LICENSE +21 -0
  261. package/templates/node-api/eslint.config.mjs +2 -0
  262. package/templates/node-api/package-lock.json +1989 -0
  263. package/templates/node-api/package.json +41 -0
  264. package/templates/node-api/prettier.config.mjs +1 -0
  265. package/templates/node-api/src/greeting.test.ts +14 -0
  266. package/templates/node-api/src/greeting.ts +8 -0
  267. package/templates/node-api/src/http.test.ts +64 -0
  268. package/templates/node-api/src/http.ts +46 -0
  269. package/templates/node-api/src/index.ts +26 -0
  270. package/templates/node-api/tsconfig.build.json +5 -0
  271. package/templates/node-api/tsconfig.json +9 -0
  272. package/templates/react-client/LICENSE +21 -0
  273. package/templates/react-client/eslint.config.mjs +2 -0
  274. package/templates/react-client/package-lock.json +3758 -0
  275. package/templates/react-client/package.json +68 -0
  276. package/templates/react-client/prettier.config.mjs +1 -0
  277. package/templates/react-client/src/ClientApp.test.tsx +41 -0
  278. package/templates/react-client/src/ClientApp.tsx +75 -0
  279. package/templates/react-client/src/index.ts +2 -0
  280. package/templates/react-client/src/style.css +71 -0
  281. package/templates/react-client/tsconfig.build.json +10 -0
  282. package/templates/react-client/tsconfig.json +8 -0
  283. package/templates/react-client/tsconfig.test.json +7 -0
  284. package/templates/react-client/vitest.config.mjs +19 -0
  285. package/templates/react-web/LICENSE +21 -0
  286. package/templates/react-web/eslint.config.mjs +2 -0
  287. package/templates/react-web/index.html +12 -0
  288. package/templates/react-web/package-lock.json +3754 -0
  289. package/templates/react-web/package.json +50 -0
  290. package/templates/react-web/prettier.config.mjs +1 -0
  291. package/templates/react-web/src/ClientApp.test.tsx +41 -0
  292. package/templates/react-web/src/ClientApp.tsx +75 -0
  293. package/templates/react-web/src/api.test.ts +24 -0
  294. package/templates/react-web/src/api.ts +29 -0
  295. package/templates/react-web/src/main.tsx +15 -0
  296. package/templates/react-web/src/style.css +71 -0
  297. package/templates/react-web/tsconfig.json +8 -0
  298. package/templates/react-web/tsconfig.test.json +7 -0
  299. package/templates/react-web/variants/shared/files/src/main.tsx +15 -0
  300. package/templates/react-web/variants/shared/variant.json +3 -0
  301. package/templates/react-web/vite.config.mjs +14 -0
  302. package/templates/react-web/vitest.config.mjs +19 -0
  303. package/templates/rust-api/Cargo.lock +476 -0
  304. package/templates/rust-api/Cargo.toml +22 -0
  305. package/templates/rust-api/LICENSE +21 -0
  306. package/templates/rust-api/rust-toolchain.toml +3 -0
  307. package/templates/rust-api/rustfmt.toml +2 -0
  308. package/templates/rust-api/src/lib.rs +68 -0
  309. package/templates/rust-api/src/main.rs +23 -0
  310. package/templates/rust-api/tests/api.rs +85 -0
@@ -0,0 +1,476 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "atomic-waker"
7
+ version = "1.1.2"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
10
+
11
+ [[package]]
12
+ name = "axum"
13
+ version = "0.8.9"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90"
16
+ dependencies = [
17
+ "axum-core",
18
+ "bytes",
19
+ "form_urlencoded",
20
+ "futures-util",
21
+ "http",
22
+ "http-body",
23
+ "http-body-util",
24
+ "hyper",
25
+ "hyper-util",
26
+ "itoa",
27
+ "matchit",
28
+ "memchr",
29
+ "mime",
30
+ "percent-encoding",
31
+ "pin-project-lite",
32
+ "serde_core",
33
+ "serde_json",
34
+ "serde_path_to_error",
35
+ "serde_urlencoded",
36
+ "sync_wrapper",
37
+ "tokio",
38
+ "tower",
39
+ "tower-layer",
40
+ "tower-service",
41
+ ]
42
+
43
+ [[package]]
44
+ name = "axum-core"
45
+ version = "0.5.6"
46
+ source = "registry+https://github.com/rust-lang/crates.io-index"
47
+ checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1"
48
+ dependencies = [
49
+ "bytes",
50
+ "futures-core",
51
+ "http",
52
+ "http-body",
53
+ "http-body-util",
54
+ "mime",
55
+ "pin-project-lite",
56
+ "sync_wrapper",
57
+ "tower-layer",
58
+ "tower-service",
59
+ ]
60
+
61
+ [[package]]
62
+ name = "bytes"
63
+ version = "1.12.1"
64
+ source = "registry+https://github.com/rust-lang/crates.io-index"
65
+ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
66
+
67
+ [[package]]
68
+ name = "devkit-api"
69
+ version = "0.1.0"
70
+ dependencies = [
71
+ "axum",
72
+ "serde",
73
+ "serde_json",
74
+ "tokio",
75
+ "tower",
76
+ ]
77
+
78
+ [[package]]
79
+ name = "errno"
80
+ version = "0.3.14"
81
+ source = "registry+https://github.com/rust-lang/crates.io-index"
82
+ checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
83
+ dependencies = [
84
+ "libc",
85
+ "windows-sys",
86
+ ]
87
+
88
+ [[package]]
89
+ name = "form_urlencoded"
90
+ version = "1.2.2"
91
+ source = "registry+https://github.com/rust-lang/crates.io-index"
92
+ checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
93
+ dependencies = [
94
+ "percent-encoding",
95
+ ]
96
+
97
+ [[package]]
98
+ name = "futures-core"
99
+ version = "0.3.34"
100
+ source = "registry+https://github.com/rust-lang/crates.io-index"
101
+ checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
102
+
103
+ [[package]]
104
+ name = "futures-task"
105
+ version = "0.3.34"
106
+ source = "registry+https://github.com/rust-lang/crates.io-index"
107
+ checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
108
+
109
+ [[package]]
110
+ name = "futures-util"
111
+ version = "0.3.34"
112
+ source = "registry+https://github.com/rust-lang/crates.io-index"
113
+ checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
114
+ dependencies = [
115
+ "futures-core",
116
+ "futures-task",
117
+ "pin-project-lite",
118
+ "slab",
119
+ ]
120
+
121
+ [[package]]
122
+ name = "http"
123
+ version = "1.5.0"
124
+ source = "registry+https://github.com/rust-lang/crates.io-index"
125
+ checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"
126
+ dependencies = [
127
+ "bytes",
128
+ "itoa",
129
+ ]
130
+
131
+ [[package]]
132
+ name = "http-body"
133
+ version = "1.1.0"
134
+ source = "registry+https://github.com/rust-lang/crates.io-index"
135
+ checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c"
136
+ dependencies = [
137
+ "bytes",
138
+ "http",
139
+ ]
140
+
141
+ [[package]]
142
+ name = "http-body-util"
143
+ version = "0.1.5"
144
+ source = "registry+https://github.com/rust-lang/crates.io-index"
145
+ checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c"
146
+ dependencies = [
147
+ "bytes",
148
+ "futures-core",
149
+ "http",
150
+ "http-body",
151
+ "pin-project-lite",
152
+ ]
153
+
154
+ [[package]]
155
+ name = "httparse"
156
+ version = "1.10.1"
157
+ source = "registry+https://github.com/rust-lang/crates.io-index"
158
+ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
159
+
160
+ [[package]]
161
+ name = "httpdate"
162
+ version = "1.0.3"
163
+ source = "registry+https://github.com/rust-lang/crates.io-index"
164
+ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
165
+
166
+ [[package]]
167
+ name = "hyper"
168
+ version = "1.12.0"
169
+ source = "registry+https://github.com/rust-lang/crates.io-index"
170
+ checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c"
171
+ dependencies = [
172
+ "atomic-waker",
173
+ "bytes",
174
+ "futures-core",
175
+ "http",
176
+ "http-body",
177
+ "httparse",
178
+ "httpdate",
179
+ "itoa",
180
+ "pin-project-lite",
181
+ "smallvec",
182
+ "tokio",
183
+ ]
184
+
185
+ [[package]]
186
+ name = "hyper-util"
187
+ version = "0.1.21"
188
+ source = "registry+https://github.com/rust-lang/crates.io-index"
189
+ checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff"
190
+ dependencies = [
191
+ "bytes",
192
+ "http",
193
+ "http-body",
194
+ "hyper",
195
+ "pin-project-lite",
196
+ "tokio",
197
+ "tower-service",
198
+ ]
199
+
200
+ [[package]]
201
+ name = "itoa"
202
+ version = "1.0.18"
203
+ source = "registry+https://github.com/rust-lang/crates.io-index"
204
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
205
+
206
+ [[package]]
207
+ name = "libc"
208
+ version = "0.2.191"
209
+ source = "registry+https://github.com/rust-lang/crates.io-index"
210
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
211
+
212
+ [[package]]
213
+ name = "matchit"
214
+ version = "0.8.4"
215
+ source = "registry+https://github.com/rust-lang/crates.io-index"
216
+ checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
217
+
218
+ [[package]]
219
+ name = "memchr"
220
+ version = "2.8.3"
221
+ source = "registry+https://github.com/rust-lang/crates.io-index"
222
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
223
+
224
+ [[package]]
225
+ name = "mime"
226
+ version = "0.3.17"
227
+ source = "registry+https://github.com/rust-lang/crates.io-index"
228
+ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
229
+
230
+ [[package]]
231
+ name = "mio"
232
+ version = "1.2.4"
233
+ source = "registry+https://github.com/rust-lang/crates.io-index"
234
+ checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee"
235
+ dependencies = [
236
+ "libc",
237
+ "wasi",
238
+ "windows-sys",
239
+ ]
240
+
241
+ [[package]]
242
+ name = "percent-encoding"
243
+ version = "2.3.2"
244
+ source = "registry+https://github.com/rust-lang/crates.io-index"
245
+ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
246
+
247
+ [[package]]
248
+ name = "pin-project-lite"
249
+ version = "0.2.17"
250
+ source = "registry+https://github.com/rust-lang/crates.io-index"
251
+ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
252
+
253
+ [[package]]
254
+ name = "proc-macro2"
255
+ version = "1.0.107"
256
+ source = "registry+https://github.com/rust-lang/crates.io-index"
257
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
258
+ dependencies = [
259
+ "unicode-ident",
260
+ ]
261
+
262
+ [[package]]
263
+ name = "quote"
264
+ version = "1.0.47"
265
+ source = "registry+https://github.com/rust-lang/crates.io-index"
266
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
267
+ dependencies = [
268
+ "proc-macro2",
269
+ ]
270
+
271
+ [[package]]
272
+ name = "ryu"
273
+ version = "1.0.23"
274
+ source = "registry+https://github.com/rust-lang/crates.io-index"
275
+ checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
276
+
277
+ [[package]]
278
+ name = "serde"
279
+ version = "1.0.229"
280
+ source = "registry+https://github.com/rust-lang/crates.io-index"
281
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
282
+ dependencies = [
283
+ "serde_core",
284
+ "serde_derive",
285
+ ]
286
+
287
+ [[package]]
288
+ name = "serde_core"
289
+ version = "1.0.229"
290
+ source = "registry+https://github.com/rust-lang/crates.io-index"
291
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
292
+ dependencies = [
293
+ "serde_derive",
294
+ ]
295
+
296
+ [[package]]
297
+ name = "serde_derive"
298
+ version = "1.0.229"
299
+ source = "registry+https://github.com/rust-lang/crates.io-index"
300
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
301
+ dependencies = [
302
+ "proc-macro2",
303
+ "quote",
304
+ "syn",
305
+ ]
306
+
307
+ [[package]]
308
+ name = "serde_json"
309
+ version = "1.0.154"
310
+ source = "registry+https://github.com/rust-lang/crates.io-index"
311
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
312
+ dependencies = [
313
+ "itoa",
314
+ "memchr",
315
+ "serde",
316
+ "serde_core",
317
+ "zmij",
318
+ ]
319
+
320
+ [[package]]
321
+ name = "serde_path_to_error"
322
+ version = "0.1.20"
323
+ source = "registry+https://github.com/rust-lang/crates.io-index"
324
+ checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457"
325
+ dependencies = [
326
+ "itoa",
327
+ "serde",
328
+ "serde_core",
329
+ ]
330
+
331
+ [[package]]
332
+ name = "serde_urlencoded"
333
+ version = "0.7.1"
334
+ source = "registry+https://github.com/rust-lang/crates.io-index"
335
+ checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
336
+ dependencies = [
337
+ "form_urlencoded",
338
+ "itoa",
339
+ "ryu",
340
+ "serde",
341
+ ]
342
+
343
+ [[package]]
344
+ name = "signal-hook-registry"
345
+ version = "1.4.8"
346
+ source = "registry+https://github.com/rust-lang/crates.io-index"
347
+ checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
348
+ dependencies = [
349
+ "errno",
350
+ "libc",
351
+ ]
352
+
353
+ [[package]]
354
+ name = "slab"
355
+ version = "0.4.12"
356
+ source = "registry+https://github.com/rust-lang/crates.io-index"
357
+ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
358
+
359
+ [[package]]
360
+ name = "smallvec"
361
+ version = "1.16.3"
362
+ source = "registry+https://github.com/rust-lang/crates.io-index"
363
+ checksum = "5b3dc8af474f516a851ff4bd12db780f948b9250ad37211e4eec0bccea54e01b"
364
+
365
+ [[package]]
366
+ name = "socket2"
367
+ version = "0.6.5"
368
+ source = "registry+https://github.com/rust-lang/crates.io-index"
369
+ checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
370
+ dependencies = [
371
+ "libc",
372
+ "windows-sys",
373
+ ]
374
+
375
+ [[package]]
376
+ name = "syn"
377
+ version = "3.0.9"
378
+ source = "registry+https://github.com/rust-lang/crates.io-index"
379
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
380
+ dependencies = [
381
+ "proc-macro2",
382
+ "quote",
383
+ "unicode-ident",
384
+ ]
385
+
386
+ [[package]]
387
+ name = "sync_wrapper"
388
+ version = "1.0.2"
389
+ source = "registry+https://github.com/rust-lang/crates.io-index"
390
+ checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
391
+
392
+ [[package]]
393
+ name = "tokio"
394
+ version = "1.54.1"
395
+ source = "registry+https://github.com/rust-lang/crates.io-index"
396
+ checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"
397
+ dependencies = [
398
+ "libc",
399
+ "mio",
400
+ "pin-project-lite",
401
+ "signal-hook-registry",
402
+ "socket2",
403
+ "tokio-macros",
404
+ "windows-sys",
405
+ ]
406
+
407
+ [[package]]
408
+ name = "tokio-macros"
409
+ version = "2.7.2"
410
+ source = "registry+https://github.com/rust-lang/crates.io-index"
411
+ checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
412
+ dependencies = [
413
+ "proc-macro2",
414
+ "quote",
415
+ "syn",
416
+ ]
417
+
418
+ [[package]]
419
+ name = "tower"
420
+ version = "0.5.3"
421
+ source = "registry+https://github.com/rust-lang/crates.io-index"
422
+ checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
423
+ dependencies = [
424
+ "futures-core",
425
+ "futures-util",
426
+ "pin-project-lite",
427
+ "sync_wrapper",
428
+ "tokio",
429
+ "tower-layer",
430
+ "tower-service",
431
+ ]
432
+
433
+ [[package]]
434
+ name = "tower-layer"
435
+ version = "0.3.3"
436
+ source = "registry+https://github.com/rust-lang/crates.io-index"
437
+ checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
438
+
439
+ [[package]]
440
+ name = "tower-service"
441
+ version = "0.3.3"
442
+ source = "registry+https://github.com/rust-lang/crates.io-index"
443
+ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
444
+
445
+ [[package]]
446
+ name = "unicode-ident"
447
+ version = "1.0.27"
448
+ source = "registry+https://github.com/rust-lang/crates.io-index"
449
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
450
+
451
+ [[package]]
452
+ name = "wasi"
453
+ version = "0.11.1+wasi-snapshot-preview1"
454
+ source = "registry+https://github.com/rust-lang/crates.io-index"
455
+ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
456
+
457
+ [[package]]
458
+ name = "windows-link"
459
+ version = "0.2.1"
460
+ source = "registry+https://github.com/rust-lang/crates.io-index"
461
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
462
+
463
+ [[package]]
464
+ name = "windows-sys"
465
+ version = "0.61.2"
466
+ source = "registry+https://github.com/rust-lang/crates.io-index"
467
+ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
468
+ dependencies = [
469
+ "windows-link",
470
+ ]
471
+
472
+ [[package]]
473
+ name = "zmij"
474
+ version = "1.0.23"
475
+ source = "registry+https://github.com/rust-lang/crates.io-index"
476
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
@@ -0,0 +1,22 @@
1
+ [package]
2
+ name = "devkit-api"
3
+ version = "0.1.0"
4
+ edition = "2024"
5
+ rust-version = "1.99.1"
6
+ publish = false
7
+ license = "MIT"
8
+
9
+ [dependencies]
10
+ axum = { version = "=0.8.9", default-features = false, features = ["http1", "json", "query", "tokio"] }
11
+ serde = { version = "=1.0.229", features = ["derive"] }
12
+ tokio = { version = "=1.54.1", features = ["macros", "net", "rt-multi-thread", "signal"] }
13
+
14
+ [dev-dependencies]
15
+ serde_json = "=1.0.154"
16
+ tower = { version = "=0.5.3", features = ["util"] }
17
+
18
+ [lints.rust]
19
+ unsafe_code = "forbid"
20
+
21
+ [lints.clippy]
22
+ all = { level = "warn", priority = -1 }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Devkit contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ [toolchain]
2
+ channel = "1.99.1"
3
+ components = ["rustfmt", "clippy"]
@@ -0,0 +1,2 @@
1
+ edition = "2024"
2
+ style_edition = "2024"
@@ -0,0 +1,68 @@
1
+ //! A small HTTP API shared by the standalone and mixed-project examples.
2
+
3
+ use axum::{Json, Router, extract::Query, routing::get};
4
+ use serde::{Deserialize, Serialize};
5
+
6
+ #[derive(Deserialize)]
7
+ struct GreetingQuery {
8
+ name: Option<String>,
9
+ }
10
+
11
+ #[derive(Serialize)]
12
+ struct Greeting {
13
+ message: String,
14
+ }
15
+
16
+ #[derive(Serialize)]
17
+ struct Health {
18
+ status: &'static str,
19
+ }
20
+
21
+ /// Build a greeting from an optional human-provided name.
22
+ ///
23
+ /// ```
24
+ /// assert_eq!(devkit_api::greeting(Some(" Ada ")), "Hello, Ada!");
25
+ /// assert_eq!(devkit_api::greeting(None), "Hello, world!");
26
+ /// ```
27
+ pub fn greeting(name: Option<&str>) -> String {
28
+ let name = name.map(str::trim).filter(|value| !value.is_empty());
29
+ format!("Hello, {}!", name.unwrap_or("world"))
30
+ }
31
+
32
+ /// Construct the API without binding a socket, so routing can be tested in process.
33
+ pub fn router() -> Router {
34
+ Router::new()
35
+ .route("/health", get(health))
36
+ .route("/api/greeting", get(greet))
37
+ }
38
+
39
+ async fn health() -> Json<Health> {
40
+ Json(Health { status: "ok" })
41
+ }
42
+
43
+ async fn greet(Query(query): Query<GreetingQuery>) -> Json<Greeting> {
44
+ Json(Greeting {
45
+ message: greeting(query.name.as_deref()),
46
+ })
47
+ }
48
+
49
+ #[cfg(test)]
50
+ mod tests {
51
+ use super::greeting;
52
+
53
+ #[test]
54
+ fn defaults_missing_and_blank_names() {
55
+ assert_eq!(greeting(None), "Hello, world!");
56
+ assert_eq!(greeting(Some(" \t\n")), "Hello, world!");
57
+ }
58
+
59
+ #[test]
60
+ fn trims_names_without_losing_unicode() {
61
+ assert_eq!(greeting(Some(" 世界 ")), "Hello, 世界!");
62
+ }
63
+
64
+ #[test]
65
+ fn treats_name_as_literal_text() {
66
+ assert_eq!(greeting(Some("<Ada & Bob>")), "Hello, <Ada & Bob>!");
67
+ }
68
+ }
@@ -0,0 +1,23 @@
1
+ use std::io;
2
+
3
+ use tokio::{
4
+ net::TcpListener,
5
+ signal::unix::{SignalKind, signal},
6
+ };
7
+
8
+ #[tokio::main]
9
+ async fn main() -> io::Result<()> {
10
+ let mut interrupt = signal(SignalKind::interrupt())?;
11
+ let mut terminate = signal(SignalKind::terminate())?;
12
+ let listener = TcpListener::bind(("0.0.0.0", 8080)).await?;
13
+ println!("devkit-api listening on http://0.0.0.0:8080");
14
+
15
+ axum::serve(listener, devkit_api::router())
16
+ .with_graceful_shutdown(async move {
17
+ tokio::select! {
18
+ _ = interrupt.recv() => {},
19
+ _ = terminate.recv() => {},
20
+ }
21
+ })
22
+ .await
23
+ }
@@ -0,0 +1,85 @@
1
+ use axum::{
2
+ body::{Body, to_bytes},
3
+ http::{Request, StatusCode, header},
4
+ };
5
+ use serde_json::{Value, json};
6
+ use tower::ServiceExt;
7
+
8
+ async fn get_json(uri: &str) -> (StatusCode, Value) {
9
+ let response = devkit_api::router()
10
+ .oneshot(Request::builder().uri(uri).body(Body::empty()).unwrap())
11
+ .await
12
+ .unwrap();
13
+ assert_eq!(response.headers()[header::CONTENT_TYPE], "application/json");
14
+ let status = response.status();
15
+ let body = to_bytes(response.into_body(), 4096).await.unwrap();
16
+ (status, serde_json::from_slice(&body).unwrap())
17
+ }
18
+
19
+ #[tokio::test]
20
+ async fn health_is_json_and_successful() {
21
+ assert_eq!(
22
+ get_json("/health").await,
23
+ (StatusCode::OK, json!({ "status": "ok" }))
24
+ );
25
+ }
26
+
27
+ #[tokio::test]
28
+ async fn greeting_uses_default_and_decodes_names() {
29
+ assert_eq!(
30
+ get_json("/api/greeting").await,
31
+ (StatusCode::OK, json!({ "message": "Hello, world!" }))
32
+ );
33
+ assert_eq!(
34
+ get_json("/api/greeting?name=%20Ada%20%26%20Bob%20").await,
35
+ (StatusCode::OK, json!({ "message": "Hello, Ada & Bob!" }))
36
+ );
37
+ assert_eq!(
38
+ get_json("/api/greeting?name=%E4%B8%96%E7%95%8C").await,
39
+ (StatusCode::OK, json!({ "message": "Hello, 世界!" }))
40
+ );
41
+ assert_eq!(
42
+ get_json("/api/greeting?name=%20%20").await,
43
+ (StatusCode::OK, json!({ "message": "Hello, world!" }))
44
+ );
45
+ }
46
+
47
+ #[tokio::test]
48
+ async fn rejects_duplicate_name_parameters() {
49
+ let response = devkit_api::router()
50
+ .oneshot(
51
+ Request::builder()
52
+ .uri("/api/greeting?name=Ada&name=Bob")
53
+ .body(Body::empty())
54
+ .unwrap(),
55
+ )
56
+ .await
57
+ .unwrap();
58
+ assert_eq!(response.status(), StatusCode::BAD_REQUEST);
59
+ }
60
+
61
+ #[tokio::test]
62
+ async fn rejects_unknown_routes_and_unsupported_methods() {
63
+ let not_found = devkit_api::router()
64
+ .oneshot(
65
+ Request::builder()
66
+ .uri("/missing")
67
+ .body(Body::empty())
68
+ .unwrap(),
69
+ )
70
+ .await
71
+ .unwrap();
72
+ assert_eq!(not_found.status(), StatusCode::NOT_FOUND);
73
+
74
+ let method = devkit_api::router()
75
+ .oneshot(
76
+ Request::builder()
77
+ .method("POST")
78
+ .uri("/api/greeting")
79
+ .body(Body::empty())
80
+ .unwrap(),
81
+ )
82
+ .await
83
+ .unwrap();
84
+ assert_eq!(method.status(), StatusCode::METHOD_NOT_ALLOWED);
85
+ }