@kosmojs/dev 0.0.11 → 0.0.21

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 (225) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +13 -45
  3. package/pkg/{src/base-plugin/ast.d.ts → ast.d.ts} +11 -16
  4. package/pkg/{src/base-plugin → base-plugin}/api-handler.d.ts +2 -2
  5. package/pkg/{src/base-plugin → base-plugin}/index.d.ts +1 -1
  6. package/pkg/{src/base-plugin → base-plugin}/worker.d.ts +2 -3
  7. package/pkg/base-plugin/worker.js +614 -196
  8. package/pkg/base-plugin/worker.js.map +4 -4
  9. package/pkg/{src/base-plugin/cache.d.ts → cache.d.ts} +3 -3
  10. package/pkg/defaults.d.ts +13 -0
  11. package/pkg/fs.d.ts +1 -0
  12. package/pkg/index.d.ts +9 -0
  13. package/pkg/index.js +991 -313
  14. package/pkg/index.js.map +4 -4
  15. package/pkg/paths.d.ts +13 -0
  16. package/pkg/render.d.ts +28 -0
  17. package/pkg/routes-factory/base.d.ts +47 -0
  18. package/pkg/routes-factory/index.d.ts +9 -0
  19. package/pkg/routes-factory/nesting.d.ts +3 -0
  20. package/pkg/{src/base-plugin/routes → routes-factory}/resolve.d.ts +3 -3
  21. package/pkg/{src/stub-generator → stub-generator}/index.d.ts +1 -1
  22. package/pkg/stub-generator/index.js +155 -24
  23. package/pkg/stub-generator/index.js.map +4 -4
  24. package/pkg/typebox.d.ts +2 -0
  25. package/pkg/types.d.ts +305 -0
  26. package/pkg/base-plugin/routes.js +0 -819
  27. package/pkg/base-plugin/routes.js.map +0 -7
  28. package/pkg/cli/cli.js +0 -583
  29. package/pkg/cli/cli.js.map +0 -7
  30. package/pkg/cli/index.js +0 -422
  31. package/pkg/cli/index.js.map +0 -7
  32. package/pkg/cli/templates/.env +0 -1
  33. package/pkg/cli/templates/@src/api/app.hbs +0 -32
  34. package/pkg/cli/templates/@src/api/router.hbs +0 -11
  35. package/pkg/cli/templates/@src/api/server.hbs +0 -4
  36. package/pkg/cli/templates/@src/api/use.hbs +0 -6
  37. package/pkg/cli/templates/@src/config/index.hbs +0 -2
  38. package/pkg/cli/templates/@src/index.html +0 -4
  39. package/pkg/cli/templates/@src/vite.config.hbs +0 -29
  40. package/pkg/cli/templates/core/api/app.ts +0 -6
  41. package/pkg/cli/templates/core/api/env.d.ts +0 -4
  42. package/pkg/cli/templates/core/api/errors.ts +0 -18
  43. package/pkg/cli/templates/core/api/router.ts +0 -6
  44. package/pkg/cli/templates/core/api/server.ts +0 -63
  45. package/pkg/cli/templates/core/api/use.ts +0 -25
  46. package/pkg/cli/templates/vite.base.hbs +0 -44
  47. package/pkg/src/base-plugin/routes/nesting.d.ts +0 -5
  48. package/pkg/src/base-plugin/routes.d.ts +0 -9
  49. package/pkg/src/cli/base.d.ts +0 -30
  50. package/pkg/src/cli/cli.d.ts +0 -2
  51. package/pkg/src/cli/factory.d.ts +0 -12
  52. package/pkg/src/cli/index.d.ts +0 -2
  53. package/pkg/src/cli/templates/core/api/app.d.ts +0 -3
  54. package/pkg/src/cli/templates/core/api/errors.d.ts +0 -1
  55. package/pkg/src/cli/templates/core/api/router.d.ts +0 -3
  56. package/pkg/src/cli/templates/core/api/server.d.ts +0 -3
  57. package/pkg/src/cli/templates/core/api/use.d.ts +0 -2
  58. package/pkg/src/index.d.ts +0 -6
  59. package/pkg/test/@fixtures/app/@src/api/articles/[...path]/index.d.ts +0 -0
  60. package/pkg/test/@fixtures/app/@src/api/books/[category]/[[author]]/index.d.ts +0 -0
  61. package/pkg/test/@fixtures/app/@src/api/books/[category]/index.d.ts +0 -0
  62. package/pkg/test/@fixtures/app/@src/api/books/index.d.ts +0 -0
  63. package/pkg/test/@fixtures/app/@src/api/files/[[folder]]/[[id]].json/index.d.ts +0 -0
  64. package/pkg/test/@fixtures/app/@src/api/files/[[folder]]/index.d.ts +0 -0
  65. package/pkg/test/@fixtures/app/@src/api/index/index.d.ts +0 -0
  66. package/pkg/test/@fixtures/app/@src/api/pages/[...path].html/index.d.ts +0 -0
  67. package/pkg/test/@fixtures/app/@src/api/users/[id].json/index.d.ts +0 -0
  68. package/pkg/test/@fixtures/app/@src/pages/about/careers/[jobId]/index.d.ts +0 -0
  69. package/pkg/test/@fixtures/app/@src/pages/about/careers/layout.d.ts +0 -0
  70. package/pkg/test/@fixtures/app/@src/pages/about/index.d.ts +0 -0
  71. package/pkg/test/@fixtures/app/@src/pages/about/layout.d.ts +0 -0
  72. package/pkg/test/@fixtures/app/@src/pages/about/team/index.d.ts +0 -0
  73. package/pkg/test/@fixtures/app/@src/pages/account/layout.d.ts +0 -0
  74. package/pkg/test/@fixtures/app/@src/pages/account/profile/index.d.ts +0 -0
  75. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/index.d.ts +0 -0
  76. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/resources/[[type]]/[...path]/index.d.ts +0 -0
  77. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/resources/[[type]]/index.d.ts +0 -0
  78. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/resources/[[type]]/layout.d.ts +0 -0
  79. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/resources/index.d.ts +0 -0
  80. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/resources/layout.d.ts +0 -0
  81. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/settings/general/index.d.ts +0 -0
  82. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/settings/index.d.ts +0 -0
  83. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/settings/layout.d.ts +0 -0
  84. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/settings/permissions/index.d.ts +0 -0
  85. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/users/[userId]/index.d.ts +0 -0
  86. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/users/index.d.ts +0 -0
  87. package/pkg/test/@fixtures/app/@src/pages/admin/[tenant]/users/layout.d.ts +0 -0
  88. package/pkg/test/@fixtures/app/@src/pages/admin/index.d.ts +0 -0
  89. package/pkg/test/@fixtures/app/@src/pages/admin/layout.d.ts +0 -0
  90. package/pkg/test/@fixtures/app/@src/pages/blog/[[category]]/[[tag]]/index.d.ts +0 -0
  91. package/pkg/test/@fixtures/app/@src/pages/blog/[[category]]/index.d.ts +0 -0
  92. package/pkg/test/@fixtures/app/@src/pages/blog/index.d.ts +0 -0
  93. package/pkg/test/@fixtures/app/@src/pages/blog/layout.d.ts +0 -0
  94. package/pkg/test/@fixtures/app/@src/pages/blog/post/[slug]/index.d.ts +0 -0
  95. package/pkg/test/@fixtures/app/@src/pages/blog/post/[slug]/layout.d.ts +0 -0
  96. package/pkg/test/@fixtures/app/@src/pages/contact/index.d.ts +0 -0
  97. package/pkg/test/@fixtures/app/@src/pages/contact/layout.d.ts +0 -0
  98. package/pkg/test/@fixtures/app/@src/pages/courses/[courseId]/layout.d.ts +0 -0
  99. package/pkg/test/@fixtures/app/@src/pages/courses/[courseId]/lessons/[[lessonId]]/assignments/[...assignmentPath]/index.d.ts +0 -0
  100. package/pkg/test/@fixtures/app/@src/pages/dashboard/[view]/index.d.ts +0 -0
  101. package/pkg/test/@fixtures/app/@src/pages/dashboard/analytics/index.d.ts +0 -0
  102. package/pkg/test/@fixtures/app/@src/pages/dashboard/index.d.ts +0 -0
  103. package/pkg/test/@fixtures/app/@src/pages/dashboard/layout.d.ts +0 -0
  104. package/pkg/test/@fixtures/app/@src/pages/dashboard/settings/billing/index.d.ts +0 -0
  105. package/pkg/test/@fixtures/app/@src/pages/dashboard/settings/index.d.ts +0 -0
  106. package/pkg/test/@fixtures/app/@src/pages/dashboard/settings/layout.d.ts +0 -0
  107. package/pkg/test/@fixtures/app/@src/pages/dashboard/settings/notifications/index.d.ts +0 -0
  108. package/pkg/test/@fixtures/app/@src/pages/dashboard/settings/profile/index.d.ts +0 -0
  109. package/pkg/test/@fixtures/app/@src/pages/dashboard/settings/security/index.d.ts +0 -0
  110. package/pkg/test/@fixtures/app/@src/pages/dashboard/settings/security/layout.d.ts +0 -0
  111. package/pkg/test/@fixtures/app/@src/pages/docs/[...path]/index.d.ts +0 -0
  112. package/pkg/test/@fixtures/app/@src/pages/docs/index.d.ts +0 -0
  113. package/pkg/test/@fixtures/app/@src/pages/docs/layout.d.ts +0 -0
  114. package/pkg/test/@fixtures/app/@src/pages/files/[...filePath]/index.d.ts +0 -0
  115. package/pkg/test/@fixtures/app/@src/pages/files/[...filePath]/layout.d.ts +0 -0
  116. package/pkg/test/@fixtures/app/@src/pages/legal/layout.d.ts +0 -0
  117. package/pkg/test/@fixtures/app/@src/pages/legal/privacy/index.d.ts +0 -0
  118. package/pkg/test/@fixtures/app/@src/pages/legal/terms/index.d.ts +0 -0
  119. package/pkg/test/@fixtures/app/@src/pages/news/[category]/articles/[...articlePath]/index.d.ts +0 -0
  120. package/pkg/test/@fixtures/app/@src/pages/news/[category]/layout.d.ts +0 -0
  121. package/pkg/test/@fixtures/app/@src/pages/portal/[clientId]/layout.d.ts +0 -0
  122. package/pkg/test/@fixtures/app/@src/pages/portal/[clientId]/reports/[reportType]/data/[dataView]/index.d.ts +0 -0
  123. package/pkg/test/@fixtures/app/@src/pages/portal/[clientId]/reports/[reportType]/data/[dataView]/layout.d.ts +0 -0
  124. package/pkg/test/@fixtures/app/@src/pages/portal/[clientId]/reports/[reportType]/layout.d.ts +0 -0
  125. package/pkg/test/@fixtures/app/@src/pages/portal/[clientId]/reports/layout.d.ts +0 -0
  126. package/pkg/test/@fixtures/app/@src/pages/portal/layout.d.ts +0 -0
  127. package/pkg/test/@fixtures/app/@src/pages/products/[id]/index.d.ts +0 -0
  128. package/pkg/test/@fixtures/app/@src/pages/products/index.d.ts +0 -0
  129. package/pkg/test/@fixtures/app/@src/pages/profile/[username]/layout.d.ts +0 -0
  130. package/pkg/test/@fixtures/app/@src/pages/profile/[username]/posts/[postId]/comments/[...thread]/index.d.ts +0 -0
  131. package/pkg/test/@fixtures/app/@src/pages/profile/[username]/posts/[postId]/layout.d.ts +0 -0
  132. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/files/[...path]/index.d.ts +0 -0
  133. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/files/index.d.ts +0 -0
  134. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/files/layout.d.ts +0 -0
  135. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/index.d.ts +0 -0
  136. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/layout.d.ts +0 -0
  137. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/tasks/[taskId]/comments/[commentId]/index.d.ts +0 -0
  138. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/tasks/[taskId]/comments/index.d.ts +0 -0
  139. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/tasks/[taskId]/comments/layout.d.ts +0 -0
  140. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/tasks/[taskId]/index.d.ts +0 -0
  141. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/tasks/[taskId]/layout.d.ts +0 -0
  142. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/tasks/index.d.ts +0 -0
  143. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/tasks/layout.d.ts +0 -0
  144. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/team/[userId]/index.d.ts +0 -0
  145. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/team/index.d.ts +0 -0
  146. package/pkg/test/@fixtures/app/@src/pages/projects/[projectId]/team/layout.d.ts +0 -0
  147. package/pkg/test/@fixtures/app/@src/pages/projects/index.d.ts +0 -0
  148. package/pkg/test/@fixtures/app/@src/pages/projects/layout.d.ts +0 -0
  149. package/pkg/test/@fixtures/app/@src/pages/properties/[[city]]/filters/[...filters]/index.d.ts +0 -0
  150. package/pkg/test/@fixtures/app/@src/pages/properties/filters/index.d.ts +0 -0
  151. package/pkg/test/@fixtures/app/@src/pages/properties/layout.d.ts +0 -0
  152. package/pkg/test/@fixtures/app/@src/pages/search/[[query]]/[[page]]/index.d.ts +0 -0
  153. package/pkg/test/@fixtures/app/@src/pages/search/[[query]]/layout.d.ts +0 -0
  154. package/pkg/test/@fixtures/app/@src/pages/search/index.d.ts +0 -0
  155. package/pkg/test/@fixtures/app/@src/pages/shop/[category]/[productId]/index.d.ts +0 -0
  156. package/pkg/test/@fixtures/app/@src/pages/shop/[category]/[productId]/layout.d.ts +0 -0
  157. package/pkg/test/@fixtures/app/@src/pages/shop/cart/index.d.ts +0 -0
  158. package/pkg/test/@fixtures/app/@src/pages/shop/checkout/confirm/index.d.ts +0 -0
  159. package/pkg/test/@fixtures/app/@src/pages/shop/checkout/layout.d.ts +0 -0
  160. package/pkg/test/@fixtures/app/@src/pages/shop/checkout/payment/index.d.ts +0 -0
  161. package/pkg/test/@fixtures/app/@src/pages/shop/checkout/shipping/index.d.ts +0 -0
  162. package/pkg/test/@fixtures/app/@src/pages/shop/checkout/shipping/layout.d.ts +0 -0
  163. package/pkg/test/@fixtures/app/@src/pages/shop/index.d.ts +0 -0
  164. package/pkg/test/@fixtures/app/@src/pages/shop/layout.d.ts +0 -0
  165. package/pkg/test/@fixtures/app/@src/pages/shop/orders/[orderId]/index.d.ts +0 -0
  166. package/pkg/test/@fixtures/app/@src/pages/shop/orders/index.d.ts +0 -0
  167. package/pkg/test/@fixtures/app/@src/pages/shop/orders/layout.d.ts +0 -0
  168. package/pkg/test/@fixtures/app/@src/pages/shop/product/[id]/index.d.ts +0 -0
  169. package/pkg/test/@fixtures/app/@src/pages/shop/product/[id]/layout.d.ts +0 -0
  170. package/pkg/test/@fixtures/app/@src/pages/shop/product/[id]/reviews/index.d.ts +0 -0
  171. package/pkg/test/@fixtures/app/@src/pages/shop/products/[[category]]/index.d.ts +0 -0
  172. package/pkg/test/@fixtures/app/@src/pages/shop/products/index.d.ts +0 -0
  173. package/pkg/test/@fixtures/app/@src/pages/shop/products/layout.d.ts +0 -0
  174. package/pkg/test/@fixtures/app/@src/pages/signup/index.d.ts +0 -0
  175. package/pkg/test/@fixtures/app/@src/pages/store/[category]/filters/[...filters]/index.d.ts +0 -0
  176. package/pkg/test/@fixtures/app/@src/pages/store/[category]/sort/[sortBy]/index.d.ts +0 -0
  177. package/pkg/test/@fixtures/app/@src/pages/store/[category]/sort/layout.d.ts +0 -0
  178. package/pkg/test/@fixtures/app/@src/pages/store/layout.d.ts +0 -0
  179. package/pkg/test/@fixtures/app/@src/pages/users/[username]/followers/index.d.ts +0 -0
  180. package/pkg/test/@fixtures/app/@src/pages/users/[username]/following/index.d.ts +0 -0
  181. package/pkg/test/@fixtures/app/@src/pages/users/[username]/index.d.ts +0 -0
  182. package/pkg/test/@fixtures/app/@src/pages/users/[username]/layout.d.ts +0 -0
  183. package/pkg/test/@fixtures/app/@src/pages/users/[username]/posts/[postId]/index.d.ts +0 -0
  184. package/pkg/test/@fixtures/app/@src/pages/users/[username]/posts/[postId]/layout.d.ts +0 -0
  185. package/pkg/test/@fixtures/app/@src/pages/users/[username]/posts/index.d.ts +0 -0
  186. package/pkg/test/@fixtures/app/@src/pages/users/[username]/posts/layout.d.ts +0 -0
  187. package/pkg/test/@fixtures/app/@src/pages/users/index.d.ts +0 -0
  188. package/pkg/test/@fixtures/app/@src/pages/users/layout.d.ts +0 -0
  189. package/pkg/test/@fixtures/app/@src/pages/workspace/[workspaceId]/analytics/[range]/index.d.ts +0 -0
  190. package/pkg/test/@fixtures/app/@src/pages/workspace/[workspaceId]/analytics/[range]/layout.d.ts +0 -0
  191. package/pkg/test/@fixtures/app/@src/pages/workspace/[workspaceId]/analytics/index.d.ts +0 -0
  192. package/pkg/test/@fixtures/app/@src/pages/workspace/[workspaceId]/analytics/layout.d.ts +0 -0
  193. package/pkg/test/@fixtures/app/@src/pages/workspace/[workspaceId]/team/[memberId]/permissions/[...permissionPath]/index.d.ts +0 -0
  194. package/pkg/test/@fixtures/app/@src/pages/workspace/[workspaceId]/team/layout.d.ts +0 -0
  195. package/pkg/test/@fixtures/app/lib/@src/{api}/articles/[...path]/index.ts/types.d.ts +0 -3
  196. package/pkg/test/@fixtures/app/lib/@src/{api}/articles/[...path]/types.d.ts +0 -3
  197. package/pkg/test/@fixtures/app/lib/@src/{api}/books/[category]/[[author]]/index.ts/types.d.ts +0 -4
  198. package/pkg/test/@fixtures/app/lib/@src/{api}/books/[category]/[[author]]/types.d.ts +0 -4
  199. package/pkg/test/@fixtures/app/lib/@src/{api}/books/[category]/index.ts/types.d.ts +0 -3
  200. package/pkg/test/@fixtures/app/lib/@src/{api}/books/[category]/types.d.ts +0 -3
  201. package/pkg/test/@fixtures/app/lib/@src/{api}/books/index.ts/types.d.ts +0 -1
  202. package/pkg/test/@fixtures/app/lib/@src/{api}/books/types.d.ts +0 -1
  203. package/pkg/test/@fixtures/app/lib/@src/{api}/files/[[folder]]/[[id]].json/index.ts/types.d.ts +0 -4
  204. package/pkg/test/@fixtures/app/lib/@src/{api}/files/[[folder]]/[[id]].json/types.d.ts +0 -4
  205. package/pkg/test/@fixtures/app/lib/@src/{api}/files/[[folder]]/index.ts/types.d.ts +0 -3
  206. package/pkg/test/@fixtures/app/lib/@src/{api}/files/[[folder]]/types.d.ts +0 -3
  207. package/pkg/test/@fixtures/app/lib/@src/{api}/index/index.ts/types.d.ts +0 -1
  208. package/pkg/test/@fixtures/app/lib/@src/{api}/index/types.d.ts +0 -1
  209. package/pkg/test/@fixtures/app/lib/@src/{api}/pages/[...path].html/index.ts/types.d.ts +0 -3
  210. package/pkg/test/@fixtures/app/lib/@src/{api}/pages/[...path].html/types.d.ts +0 -3
  211. package/pkg/test/@fixtures/app/lib/@src/{api}/users/[id].json/index.ts/types.d.ts +0 -3
  212. package/pkg/test/@fixtures/app/lib/@src/{api}/users/[id].json/types.d.ts +0 -3
  213. package/pkg/test/@fixtures/ast/extractTypeDeclarations/exports/with-referenced-files.d.ts +0 -1
  214. package/pkg/test/@fixtures/ast/extractTypeDeclarations/imports/with-referenced-files.d.ts +0 -1
  215. package/pkg/test/ast/extractParamsRefinements.test.d.ts +0 -1
  216. package/pkg/test/ast/extractRouteMethods.test.d.ts +0 -1
  217. package/pkg/test/ast/extractTypeDeclarations.test.d.ts +0 -1
  218. package/pkg/test/cli/create.test.d.ts +0 -1
  219. package/pkg/test/routes/base.d.ts +0 -4
  220. package/pkg/test/routes/nesting.test.d.ts +0 -1
  221. package/pkg/test/routes/resolver.test.d.ts +0 -1
  222. package/pkg/test/setup.d.ts +0 -1
  223. /package/pkg/{src/alias-plugin → alias-plugin}/index.d.ts +0 -0
  224. /package/pkg/{src/base-plugin → base-plugin}/spinner.d.ts +0 -0
  225. /package/pkg/{src/define-plugin → define-plugin}/index.d.ts +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-present, Slee Woo and KosmoJS 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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@kosmojs/dev",
4
- "version": "0.0.11",
4
+ "version": "0.0.21",
5
5
  "cacheVersion": "001",
6
6
  "author": "Slee Woo",
7
7
  "license": "MIT",
@@ -11,71 +11,39 @@
11
11
  "files": [
12
12
  "pkg/*"
13
13
  ],
14
- "bin": {
15
- "kosmo": "pkg/cli/cli.js"
16
- },
17
14
  "exports": {
18
15
  ".": {
19
- "types": "./pkg/src/index.d.ts",
16
+ "types": "./pkg/index.d.ts",
20
17
  "default": "./pkg/index.js"
21
18
  },
22
- "./routes": {
23
- "types": "./pkg/src/base-plugin/routes.d.ts",
24
- "default": "./pkg/base-plugin/routes.js"
25
- },
26
19
  "./stub-generator": {
27
- "types": "./pkg/src/stub-generator/index.d.ts",
20
+ "types": "./pkg/stub-generator/index.d.ts",
28
21
  "default": "./pkg/stub-generator/index.js"
29
22
  },
30
- "./cli": {
31
- "types": "./pkg/src/cli/index.d.ts",
32
- "default": "./pkg/cli/index.js"
33
- },
34
23
  "./package.json": "./package.json"
35
24
  },
36
25
  "dependencies": {
26
+ "@topcli/spinner": "^4.2.1",
37
27
  "chokidar": "^5.0.0",
38
- "concurrently": "^9.2.1",
39
28
  "crc": "^4.3.2",
40
- "dotenv": "^17.2.3",
41
- "esbuild": "^0.27.2",
42
- "ora": "^9.0.0",
29
+ "dotenv": "^17.3.1",
30
+ "esbuild": "^0.27.3",
31
+ "handlebars": "^4.7.8",
32
+ "mime-types": "^3.0.2",
33
+ "path-to-regexp": "^8.3.0",
43
34
  "picomatch": "^4.0.3",
44
- "prompts": "^2.4.2",
45
35
  "tfusion": "^0.0.23",
46
36
  "tinyglobby": "^0.2.15",
47
37
  "ts-morph": "^27.0.2",
48
- "typescript": "^5.9.3",
49
- "@kosmojs/api": "^0.0.11",
50
- "@kosmojs/devlib": "^0.0.11",
51
- "@kosmojs/fetch-generator": "^0.0.11",
52
- "@kosmojs/api-generator": "^0.0.11"
38
+ "typescript": "^5.9.3"
53
39
  },
54
40
  "devDependencies": {
55
- "@solidjs/router": "^0.15.4",
56
- "@types/koa": "^3.0.1",
57
- "@types/koa__router": "^12.0.5",
58
- "@types/node": "^25.0.3",
41
+ "@types/mime-types": "^3.0.1",
59
42
  "@types/picomatch": "^4.0.2",
60
- "@types/prompts": "^2.4.9",
61
- "@types/react": "^19.2.7",
62
- "@types/react-dom": "^19.2.3",
63
- "@vitejs/plugin-react": "^5.1.2",
64
- "@vitejs/plugin-vue": "^6.0.3",
65
- "react": "^19.2.3",
66
- "react-dom": "^19.2.3",
67
- "react-router": "^7.10.1",
68
- "solid-js": "^1.9.10",
69
- "tslib": "^2.8.1",
70
- "vite": "^7.3.0",
71
- "vite-plugin-solid": "^2.11.10",
72
- "vue": "^3.5.25",
73
- "vue-router": "^4.6.4",
74
- "@kosmojs/config": "^0.0.11"
43
+ "@kosmojs/api": "^0.0.21"
75
44
  },
76
45
  "scripts": {
77
- "build": "esbuilder src/index.ts src/base-plugin/routes.ts src/base-plugin/worker.ts src/stub-generator/index.ts src/cli/cli.ts src/cli/index.ts",
78
- "postbuild": "rsync -av --delete src/cli/templates/ pkg/cli/templates",
46
+ "build": "esbuilder src/index.ts src/base-plugin/worker.ts src/stub-generator/index.ts",
79
47
  "test": "vitest --root ../../.. --project core/dev"
80
48
  }
81
49
  }
@@ -1,10 +1,10 @@
1
1
  import { flattener } from "tfusion";
2
- import { type CallExpression, Project, type ProjectOptions, type SourceFile } from "ts-morph";
2
+ import { type CallExpression, Project, type ProjectOptions, type SourceFile, type TypeNode } from "ts-morph";
3
3
  import { type HTTPMethod } from "@kosmojs/api";
4
- import type { ApiRoute, PayloadType, PluginOptionsResolved, ResponseType, TypeDeclaration } from "@kosmojs/devlib";
4
+ import type { ApiRoute, PluginOptionsResolved, TypeDeclaration, ValidationDefinition } from "./types";
5
5
  type PathResolver = (path: string) => string;
6
6
  export declare const createProject: (opts?: ProjectOptions) => Project;
7
- export declare const resolveRouteSignature: (route: Pick<ApiRoute, "importName" | "fileFullpath" | "optionalParams">, opts?: {
7
+ export declare const resolveRouteSignature: (route: Pick<ApiRoute, "id" | "name" | "fileFullpath" | "optionalParams">, opts?: {
8
8
  relpathResolver?: PathResolver;
9
9
  sourceFile?: SourceFile;
10
10
  withReferencedFiles?: boolean;
@@ -15,12 +15,7 @@ export declare const resolveRouteSignature: (route: Pick<ApiRoute, "importName"
15
15
  text: string;
16
16
  }[] | undefined;
17
17
  methods: ("HEAD" | "OPTIONS" | "GET" | "PUT" | "PATCH" | "POST" | "DELETE")[];
18
- payloadTypes: (PayloadType & {
19
- text: string;
20
- })[];
21
- responseTypes: (ResponseType & {
22
- text: string;
23
- })[];
18
+ validationDefinitions: ValidationDefinition[];
24
19
  referencedFiles: string[] | undefined;
25
20
  }>;
26
21
  export declare const extractDefaultExport: (sourceFile: SourceFile) => CallExpression | undefined;
@@ -28,15 +23,15 @@ export declare const extractParamsRefinements: (callExpression: CallExpression)
28
23
  index: number;
29
24
  text: string;
30
25
  }> | undefined;
31
- export declare const extractRouteMethods: (callExpression: CallExpression, route: Pick<ApiRoute, "importName" | "optionalParams">) => Array<{
26
+ export declare const extractRouteMethods: (route: Pick<ApiRoute, "id" | "name">, callExpression: CallExpression) => Array<{
32
27
  method: HTTPMethod;
33
- payloadType: (PayloadType & {
34
- text: string;
35
- }) | undefined;
36
- responseType: (ResponseType & {
37
- text: string;
38
- }) | undefined;
28
+ validationDefinitions: Array<ValidationDefinition>;
39
29
  }>;
30
+ /**
31
+ * Extract validation definitions from route handler generics.
32
+ * Merges defs (schemas) and opts (validation options) into a flat array.
33
+ * */
34
+ export declare const extractValidationDefinitions: (route: Pick<ApiRoute, "id" | "name">, method: HTTPMethod, defsNode: TypeNode, optsNode: TypeNode | undefined) => ValidationDefinition[];
40
35
  export declare const extractTypeDeclarations: (sourceFile: SourceFile, opts?: {
41
36
  relpathResolver?: PathResolver;
42
37
  withReferencedFiles?: boolean;
@@ -1,10 +1,10 @@
1
1
  import type { IncomingMessage, ServerResponse } from "node:http";
2
- import { type PluginOptionsResolved } from "@kosmojs/devlib";
2
+ import type { PluginOptionsResolved } from "../types";
3
3
  declare const _default: (options: PluginOptionsResolved) => Promise<{
4
4
  watcher: () => Promise<{
5
5
  start(): Promise<void>;
6
6
  stop(): Promise<void>;
7
7
  }>;
8
- devMiddleware: (req: IncomingMessage, res: ServerResponse, viteHandler: () => void) => Promise<void>;
8
+ devMiddleware: (req: IncomingMessage, res: ServerResponse, next: () => void | Promise<void>) => Promise<void>;
9
9
  }>;
10
10
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import type { Plugin } from "vite";
2
- import type { PluginOptions } from "@kosmojs/devlib";
2
+ import type { PluginOptions } from "../types";
3
3
  declare const _default: (apiurl: string, pluginOptions?: PluginOptions) => Plugin;
4
4
  export default _default;
@@ -1,8 +1,7 @@
1
- import { type PluginOptionsResolved } from "@kosmojs/devlib";
1
+ import type { PluginOptionsResolved } from "../types";
2
2
  import type { SpinnerFactory } from "./spinner";
3
- export type WorkerData = Omit<PluginOptionsResolved, "generators" | "formatters"> & {
3
+ export type WorkerData = Omit<PluginOptionsResolved, "generators"> & {
4
4
  generatorModules: Array<[string, unknown]>;
5
- formatterModules: Array<[string, unknown]>;
6
5
  };
7
6
  export type WorkerSpinner = {
8
7
  id: string;