fragment-ts 1.2.1 → 1.2.3

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 (309) hide show
  1. package/API.md +624 -64
  2. package/DOCS.md +738 -134
  3. package/README.md +477 -72
  4. package/SETUP.md +571 -48
  5. package/USAGE.md +525 -192
  6. package/dist/core/container/di-container.d.ts.map +1 -1
  7. package/dist/core/container/di-container.js +8 -7
  8. package/dist/core/container/di-container.js.map +1 -1
  9. package/dist/core/decorators/frontend.decorator.d.ts +9 -8
  10. package/dist/core/decorators/frontend.decorator.d.ts.map +1 -1
  11. package/dist/core/decorators/frontend.decorator.js +17 -10
  12. package/dist/core/decorators/frontend.decorator.js.map +1 -1
  13. package/dist/core/decorators/http.decorators.d.ts.map +1 -1
  14. package/dist/core/decorators/http.decorators.js +2 -1
  15. package/dist/core/decorators/http.decorators.js.map +1 -1
  16. package/dist/core/decorators/request-context.decorator.d.ts.map +1 -1
  17. package/dist/core/decorators/request-context.decorator.js +2 -1
  18. package/dist/core/decorators/request-context.decorator.js.map +1 -1
  19. package/dist/core/metadata/metadata-keys.d.ts +1 -1
  20. package/dist/core/metadata/metadata-keys.js +1 -1
  21. package/dist/core/metadata/metadata-keys.js.map +1 -1
  22. package/dist/core/metadata/metadata-storage.d.ts +1 -1
  23. package/dist/core/metadata/metadata-storage.d.ts.map +1 -1
  24. package/dist/core/metadata/metadata-storage.js.map +1 -1
  25. package/dist/core/scanner/component-scanner.d.ts.map +1 -1
  26. package/dist/core/scanner/component-scanner.js +4 -4
  27. package/dist/core/scanner/component-scanner.js.map +1 -1
  28. package/dist/index.d.ts +2 -2
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +4 -25
  31. package/dist/index.js.map +1 -1
  32. package/dist/integrations/ai/ai.module.d.ts.map +1 -1
  33. package/dist/integrations/ai/ai.module.js +4 -3
  34. package/dist/integrations/ai/ai.module.js.map +1 -1
  35. package/dist/integrations/frontend/frontend-module.d.ts +2 -4
  36. package/dist/integrations/frontend/frontend-module.d.ts.map +1 -1
  37. package/dist/integrations/frontend/frontend-module.js +1 -32
  38. package/dist/integrations/frontend/frontend-module.js.map +1 -1
  39. package/dist/integrations/frontend/frontend-registry.d.ts.map +1 -1
  40. package/dist/integrations/frontend/frontend-registry.js +31 -20
  41. package/dist/integrations/frontend/frontend-registry.js.map +1 -1
  42. package/dist/integrations/frontend/frontend-router.d.ts.map +1 -1
  43. package/dist/integrations/frontend/frontend-router.js +18 -9
  44. package/dist/integrations/frontend/frontend-router.js.map +1 -1
  45. package/dist/integrations/frontend/frontend.types.d.ts +7 -10
  46. package/dist/integrations/frontend/frontend.types.d.ts.map +1 -1
  47. package/dist/integrations/frontend/store-manager.d.ts.map +1 -1
  48. package/dist/integrations/frontend/store-manager.js +41 -5
  49. package/dist/integrations/frontend/store-manager.js.map +1 -1
  50. package/dist/integrations/jobs/cron.utils.d.ts.map +1 -1
  51. package/dist/integrations/jobs/cron.utils.js +2 -1
  52. package/dist/integrations/jobs/cron.utils.js.map +1 -1
  53. package/dist/integrations/jobs/job-registry.d.ts.map +1 -1
  54. package/dist/integrations/jobs/job-registry.js +4 -3
  55. package/dist/integrations/jobs/job-registry.js.map +1 -1
  56. package/dist/integrations/jobs/job-scheduler.d.ts.map +1 -1
  57. package/dist/integrations/jobs/job-scheduler.js +3 -2
  58. package/dist/integrations/jobs/job-scheduler.js.map +1 -1
  59. package/dist/integrations/jobs/queue/inline-queue.d.ts.map +1 -1
  60. package/dist/integrations/jobs/queue/inline-queue.js +2 -1
  61. package/dist/integrations/jobs/queue/inline-queue.js.map +1 -1
  62. package/dist/integrations/mail/mail-manager.d.ts.map +1 -1
  63. package/dist/integrations/mail/mail-manager.js +3 -2
  64. package/dist/integrations/mail/mail-manager.js.map +1 -1
  65. package/dist/integrations/mail/mail-registry.d.ts.map +1 -1
  66. package/dist/integrations/mail/mail-registry.js +5 -4
  67. package/dist/integrations/mail/mail-registry.js.map +1 -1
  68. package/dist/integrations/mail/mail-template-registry.d.ts.map +1 -1
  69. package/dist/integrations/mail/mail-template-registry.js +4 -3
  70. package/dist/integrations/mail/mail-template-registry.js.map +1 -1
  71. package/dist/integrations/mail/mail-transport-registry.d.ts.map +1 -1
  72. package/dist/integrations/mail/mail-transport-registry.js +2 -1
  73. package/dist/integrations/mail/mail-transport-registry.js.map +1 -1
  74. package/dist/integrations/mail/transports/unsupported.transport.d.ts.map +1 -1
  75. package/dist/integrations/mail/transports/unsupported.transport.js +2 -1
  76. package/dist/integrations/mail/transports/unsupported.transport.js.map +1 -1
  77. package/dist/integrations/notifications/notification-manager.d.ts.map +1 -1
  78. package/dist/integrations/notifications/notification-manager.js +3 -2
  79. package/dist/integrations/notifications/notification-manager.js.map +1 -1
  80. package/dist/integrations/notifications/notification-registry.d.ts.map +1 -1
  81. package/dist/integrations/notifications/notification-registry.js +4 -3
  82. package/dist/integrations/notifications/notification-registry.js.map +1 -1
  83. package/dist/integrations/notifications/notification.utils.d.ts.map +1 -1
  84. package/dist/integrations/notifications/notification.utils.js +2 -1
  85. package/dist/integrations/notifications/notification.utils.js.map +1 -1
  86. package/dist/integrations/typeorm/config/DatabaseConfigLoader.d.ts.map +1 -1
  87. package/dist/integrations/typeorm/config/DatabaseConfigLoader.js +3 -2
  88. package/dist/integrations/typeorm/config/DatabaseConfigLoader.js.map +1 -1
  89. package/dist/integrations/typeorm/config/builders/CloudDatabaseBuilders.d.ts.map +1 -1
  90. package/dist/integrations/typeorm/config/builders/CloudDatabaseBuilders.js +7 -6
  91. package/dist/integrations/typeorm/config/builders/CloudDatabaseBuilders.js.map +1 -1
  92. package/dist/integrations/typeorm/config/builders/MobileDatabaseBuilders.d.ts.map +1 -1
  93. package/dist/integrations/typeorm/config/builders/MobileDatabaseBuilders.js +4 -3
  94. package/dist/integrations/typeorm/config/builders/MobileDatabaseBuilders.js.map +1 -1
  95. package/dist/integrations/typeorm/typeorm-module.d.ts.map +1 -1
  96. package/dist/integrations/typeorm/typeorm-module.js +2 -1
  97. package/dist/integrations/typeorm/typeorm-module.js.map +1 -1
  98. package/dist/platform/cli/commands/base/command-registry.d.ts.map +1 -1
  99. package/dist/platform/cli/commands/base/command-registry.js +2 -1
  100. package/dist/platform/cli/commands/base/command-registry.js.map +1 -1
  101. package/dist/platform/cli/commands/build/build.utils.d.ts +3 -0
  102. package/dist/platform/cli/commands/build/build.utils.d.ts.map +1 -0
  103. package/dist/platform/cli/commands/build/build.utils.js +86 -0
  104. package/dist/platform/cli/commands/build/build.utils.js.map +1 -0
  105. package/dist/platform/cli/commands/build/command.d.ts +8 -0
  106. package/dist/platform/cli/commands/build/command.d.ts.map +1 -0
  107. package/dist/platform/cli/commands/build/command.js +102 -0
  108. package/dist/platform/cli/commands/build/command.js.map +1 -0
  109. package/dist/platform/cli/commands/lint/command.d.ts.map +1 -1
  110. package/dist/platform/cli/commands/lint/command.js +2 -1
  111. package/dist/platform/cli/commands/lint/command.js.map +1 -1
  112. package/dist/platform/cli/commands/make/command.d.ts.map +1 -1
  113. package/dist/platform/cli/commands/make/command.js +0 -1
  114. package/dist/platform/cli/commands/make/command.js.map +1 -1
  115. package/dist/platform/cli/commands/migrate/command.d.ts.map +1 -1
  116. package/dist/platform/cli/commands/migrate/command.js +2 -1
  117. package/dist/platform/cli/commands/migrate/command.js.map +1 -1
  118. package/dist/platform/cli/commands/migrate/migrate.utils.d.ts.map +1 -1
  119. package/dist/platform/cli/commands/migrate/migrate.utils.js +2 -1
  120. package/dist/platform/cli/commands/migrate/migrate.utils.js.map +1 -1
  121. package/dist/platform/cli/scaffold/generate/component-generator.d.ts +1 -2
  122. package/dist/platform/cli/scaffold/generate/component-generator.d.ts.map +1 -1
  123. package/dist/platform/cli/scaffold/generate/component-generator.js +8 -30
  124. package/dist/platform/cli/scaffold/generate/component-generator.js.map +1 -1
  125. package/dist/platform/cli/scaffold/init/init.scaffold.d.ts.map +1 -1
  126. package/dist/platform/cli/scaffold/init/init.scaffold.js +67 -30
  127. package/dist/platform/cli/scaffold/init/init.scaffold.js.map +1 -1
  128. package/dist/platform/cli/scaffold/init/prompts.js +25 -0
  129. package/dist/platform/cli/scaffold/init/prompts.js.map +1 -1
  130. package/dist/platform/cli/scaffold/init/types.d.ts +2 -1
  131. package/dist/platform/cli/scaffold/init/types.d.ts.map +1 -1
  132. package/dist/platform/testing/runner.d.ts.map +1 -1
  133. package/dist/platform/testing/runner.js +22 -21
  134. package/dist/platform/testing/runner.js.map +1 -1
  135. package/dist/platform/web/bootstrap/ComponentRegistrar.d.ts.map +1 -1
  136. package/dist/platform/web/bootstrap/ComponentRegistrar.js +0 -2
  137. package/dist/platform/web/bootstrap/ComponentRegistrar.js.map +1 -1
  138. package/dist/plugins/plugin-manager.d.ts.map +1 -1
  139. package/dist/plugins/plugin-manager.js +2 -1
  140. package/dist/plugins/plugin-manager.js.map +1 -1
  141. package/dist/plugins/plugin-registry.d.ts.map +1 -1
  142. package/dist/plugins/plugin-registry.js +8 -7
  143. package/dist/plugins/plugin-registry.js.map +1 -1
  144. package/dist/shared/config.utils.d.ts +10 -0
  145. package/dist/shared/config.utils.d.ts.map +1 -1
  146. package/dist/shared/config.utils.js.map +1 -1
  147. package/dist/shared/errors.d.ts +147 -0
  148. package/dist/shared/errors.d.ts.map +1 -1
  149. package/dist/shared/errors.js +299 -1
  150. package/dist/shared/errors.js.map +1 -1
  151. package/examples/blog-api/.env.example +14 -0
  152. package/examples/blog-api/.eslintignore +3 -0
  153. package/examples/blog-api/.eslintrc.json +25 -0
  154. package/examples/blog-api/.prettierrc +6 -0
  155. package/examples/blog-api/fragment.json +56 -0
  156. package/examples/blog-api/package-lock.json +7062 -0
  157. package/examples/blog-api/package.json +33 -0
  158. package/examples/blog-api/postcss.config.js +6 -0
  159. package/examples/blog-api/src/entities/user.entity.ts +19 -0
  160. package/examples/blog-api/src/frontend/styles/tailwind.css +3 -0
  161. package/examples/blog-api/src/main.ts +15 -0
  162. package/examples/blog-api/src/modules/app/components/header.component.ts +4 -0
  163. package/examples/blog-api/src/modules/app/controllers/app.controller.ts +18 -0
  164. package/examples/blog-api/src/modules/app/services/app.service.ts +8 -0
  165. package/examples/blog-api/src/modules/app/stores/home.store.ts +12 -0
  166. package/examples/blog-api/src/modules/app/templates/app.template.ts +8 -0
  167. package/examples/blog-api/src/modules/app/views/home.view.ts +9 -0
  168. package/examples/blog-api/src/modules/jobs/example.job.ts +9 -0
  169. package/examples/blog-api/src/modules/mail/primary.mail.ts +13 -0
  170. package/examples/blog-api/src/test/app.spec.ts +20 -0
  171. package/examples/blog-api/tailwind.config.js +8 -0
  172. package/examples/blog-api/tsconfig.json +24 -0
  173. package/package.json +12 -1
  174. package/src/core/container/di-container.ts +0 -488
  175. package/src/core/context/request-context.ts +0 -16
  176. package/src/core/decorators/DECORATOR_USAGE.md +0 -314
  177. package/src/core/decorators/api.decorator.ts +0 -97
  178. package/src/core/decorators/application.decorator.ts +0 -25
  179. package/src/core/decorators/auto-configuration.decorator.ts +0 -16
  180. package/src/core/decorators/conditional.decorators.ts +0 -19
  181. package/src/core/decorators/controller.decorator.ts +0 -17
  182. package/src/core/decorators/exception-filter.decorator.ts +0 -42
  183. package/src/core/decorators/frontend.decorator.ts +0 -199
  184. package/src/core/decorators/guard.decorator.ts +0 -42
  185. package/src/core/decorators/http.decorators.ts +0 -70
  186. package/src/core/decorators/injectable.decorator.ts +0 -17
  187. package/src/core/decorators/injection.decorators.ts +0 -180
  188. package/src/core/decorators/interceptor.decorator.ts +0 -45
  189. package/src/core/decorators/job.decorator.ts +0 -51
  190. package/src/core/decorators/lifecycle.decorator.ts +0 -41
  191. package/src/core/decorators/mail.decorator.ts +0 -103
  192. package/src/core/decorators/middleware.decorator.ts +0 -49
  193. package/src/core/decorators/notification.decorator.ts +0 -27
  194. package/src/core/decorators/plugin-lifecycle.decorator.ts +0 -45
  195. package/src/core/decorators/plugin.decorator.ts +0 -75
  196. package/src/core/decorators/repository.decorator.ts +0 -16
  197. package/src/core/decorators/request-context.decorator.ts +0 -20
  198. package/src/core/decorators/service.decorator.ts +0 -16
  199. package/src/core/index.ts +0 -21
  200. package/src/core/metadata/metadata-keys.ts +0 -82
  201. package/src/core/metadata/metadata-storage.ts +0 -266
  202. package/src/core/scanner/component-scanner.ts +0 -323
  203. package/src/core/types/decoration.types.ts +0 -40
  204. package/src/index.ts +0 -124
  205. package/src/integrations/ai/ai.module.ts +0 -110
  206. package/src/integrations/auth/auth.module.ts +0 -77
  207. package/src/integrations/docs/doc-generator.ts +0 -480
  208. package/src/integrations/docs/index.ts +0 -1
  209. package/src/integrations/frontend/frontend-module.ts +0 -217
  210. package/src/integrations/frontend/frontend-registry.ts +0 -275
  211. package/src/integrations/frontend/frontend-router.ts +0 -47
  212. package/src/integrations/frontend/frontend.types.ts +0 -85
  213. package/src/integrations/frontend/index.ts +0 -6
  214. package/src/integrations/frontend/store-manager.ts +0 -84
  215. package/src/integrations/frontend/theme-manager.ts +0 -25
  216. package/src/integrations/jobs/cron.utils.ts +0 -118
  217. package/src/integrations/jobs/index.ts +0 -8
  218. package/src/integrations/jobs/job-manager.ts +0 -32
  219. package/src/integrations/jobs/job-registry.ts +0 -107
  220. package/src/integrations/jobs/job-scheduler.ts +0 -219
  221. package/src/integrations/jobs/job.ts +0 -40
  222. package/src/integrations/jobs/job.types.ts +0 -42
  223. package/src/integrations/jobs/job.utils.ts +0 -12
  224. package/src/integrations/jobs/queue/inline-queue.ts +0 -16
  225. package/src/integrations/jobs/scheduled-job.ts +0 -34
  226. package/src/integrations/mail/configured-mail-provider.ts +0 -19
  227. package/src/integrations/mail/index.ts +0 -7
  228. package/src/integrations/mail/mail-manager.ts +0 -74
  229. package/src/integrations/mail/mail-registry.ts +0 -159
  230. package/src/integrations/mail/mail-template-registry.ts +0 -113
  231. package/src/integrations/mail/mail-transport-registry.ts +0 -29
  232. package/src/integrations/mail/mail.types.ts +0 -67
  233. package/src/integrations/mail/queue/inline-queue.ts +0 -14
  234. package/src/integrations/mail/transports/console.transport.ts +0 -22
  235. package/src/integrations/mail/transports/unsupported.transport.ts +0 -13
  236. package/src/integrations/notifications/channels/mail.channel.ts +0 -42
  237. package/src/integrations/notifications/index.ts +0 -6
  238. package/src/integrations/notifications/notification-channel.ts +0 -31
  239. package/src/integrations/notifications/notification-manager.ts +0 -66
  240. package/src/integrations/notifications/notification-registry.ts +0 -106
  241. package/src/integrations/notifications/notification.types.ts +0 -23
  242. package/src/integrations/notifications/notification.utils.ts +0 -52
  243. package/src/integrations/typeorm/config/DatabaseConfigLoader.ts +0 -205
  244. package/src/integrations/typeorm/config/builders/CloudDatabaseBuilders.ts +0 -117
  245. package/src/integrations/typeorm/config/builders/MobileDatabaseBuilders.ts +0 -148
  246. package/src/integrations/typeorm/config/builders/NoSQLDatabaseBuilders.ts +0 -17
  247. package/src/integrations/typeorm/config/builders/SQLDatabaseBuilders.ts +0 -189
  248. package/src/integrations/typeorm/config/index.ts +0 -0
  249. package/src/integrations/typeorm/typeorm-module.ts +0 -53
  250. package/src/integrations/typeorm/types/SupportedDatabaseConfig.ts +0 -42
  251. package/src/integrations/typeorm/types/SupportedDatabaseOptions.ts +0 -42
  252. package/src/platform/cli/commands/add/add.utils.ts +0 -37
  253. package/src/platform/cli/commands/add/command.ts +0 -29
  254. package/src/platform/cli/commands/base/command-registry.ts +0 -29
  255. package/src/platform/cli/commands/base/command-runner.ts +0 -22
  256. package/src/platform/cli/commands/base/fragment-command.ts +0 -52
  257. package/src/platform/cli/commands/cache/command.ts +0 -14
  258. package/src/platform/cli/commands/config/command.ts +0 -26
  259. package/src/platform/cli/commands/diagnostics/command.ts +0 -35
  260. package/src/platform/cli/commands/diagnostics/diagnostics.actions.ts +0 -415
  261. package/src/platform/cli/commands/docs/command.ts +0 -18
  262. package/src/platform/cli/commands/docs/docs.actions.ts +0 -50
  263. package/src/platform/cli/commands/env/command.ts +0 -195
  264. package/src/platform/cli/commands/env/env.utils.ts +0 -27
  265. package/src/platform/cli/commands/generate/command.ts +0 -48
  266. package/src/platform/cli/commands/init/command.ts +0 -122
  267. package/src/platform/cli/commands/lint/command.ts +0 -128
  268. package/src/platform/cli/commands/make/command.ts +0 -97
  269. package/src/platform/cli/commands/migrate/command.ts +0 -566
  270. package/src/platform/cli/commands/migrate/migrate.utils.ts +0 -75
  271. package/src/platform/cli/commands/plugin/command.ts +0 -59
  272. package/src/platform/cli/commands/plugin/plugin.actions.ts +0 -285
  273. package/src/platform/cli/commands/register.ts +0 -40
  274. package/src/platform/cli/commands/route/command.ts +0 -11
  275. package/src/platform/cli/commands/serve/command.ts +0 -118
  276. package/src/platform/cli/commands/serve/serve.utils.ts +0 -49
  277. package/src/platform/cli/commands/test/command.ts +0 -152
  278. package/src/platform/cli/commands/test/test.utils.ts +0 -100
  279. package/src/platform/cli/index.ts +0 -30
  280. package/src/platform/cli/scaffold/generate/component-generator.ts +0 -801
  281. package/src/platform/cli/scaffold/generate/validation.ts +0 -19
  282. package/src/platform/cli/scaffold/init/init.scaffold.ts +0 -1164
  283. package/src/platform/cli/scaffold/init/prompts.ts +0 -285
  284. package/src/platform/cli/scaffold/init/types.ts +0 -50
  285. package/src/platform/cli/scaffold/naming.ts +0 -37
  286. package/src/platform/testing/TEST.md +0 -381
  287. package/src/platform/testing/runner.ts +0 -419
  288. package/src/platform/web/application.ts +0 -26
  289. package/src/platform/web/bootstrap/ApplicationBootstrapper.ts +0 -314
  290. package/src/platform/web/bootstrap/ComponentRegistrar.ts +0 -153
  291. package/src/platform/web/bootstrap/ComponentScanner.ts +0 -30
  292. package/src/platform/web/bootstrap/RouteRegistrar.ts +0 -204
  293. package/src/platform/web/interfaces.ts +0 -26
  294. package/src/platform/web/middleware/ErrorHandler.ts +0 -55
  295. package/src/platform/web/middleware/MiddlewareSetup.ts +0 -25
  296. package/src/platform/web/middleware/RouteExecutor.ts +0 -133
  297. package/src/platform/web/utils/ConsoleLogger.ts +0 -37
  298. package/src/platform/web/utils/RouteUtils.ts +0 -27
  299. package/src/plugins/interface.ts +0 -10
  300. package/src/plugins/plugin-manager.ts +0 -50
  301. package/src/plugins/plugin-registry.ts +0 -311
  302. package/src/shared/config.utils.ts +0 -386
  303. package/src/shared/env.utils.ts +0 -50
  304. package/src/shared/errors.ts +0 -224
  305. package/src/shared/logger.ts +0 -143
  306. package/src/shared/runtime.resolver.ts +0 -192
  307. package/src/shared/tsconfig.utils.ts +0 -73
  308. package/tsconfig.json +0 -24
  309. package/working_momory/possible-updates.md +0 -98
package/API.md CHANGED
@@ -1,25 +1,24 @@
1
1
  # Fragment TS API Reference
2
2
 
3
3
  This document lists public exports and their intended usage.
4
+ Each item is documented on its own line for easy search and indexing.
4
5
 
5
- **Core Application**
6
- - `FragmentApplication(options)` class decorator.
7
- - `FragmentWebApplication` bootstrap class.
8
- - `DIContainer` for manual DI usage.
9
- - `MetadataStorage` for metadata inspection.
10
- - `ComponentScanner` for manual component scanning.
6
+ ## Core Application
7
+ - `FragmentApplication(options)` class decorator
8
+ - `FragmentWebApplication` bootstrap class
9
+ - `DIContainer` dependency injection container
10
+ - `MetadataStorage` metadata registry
11
+ - `ComponentScanner` manual component scanning
11
12
 
12
- **Core Decorators**
13
+ ## Core Decorators
14
+ - `@FragmentApplication(options)`
13
15
  - `@Controller(path?)`
14
16
  - `@Service()`
15
17
  - `@FragmentRepository()`
16
18
  - `@Injectable(scope?)`
17
19
  - `@AutoConfiguration()`
18
- - `@ConditionalOnClass(classRef)`
19
- - `@ConditionalOnMissingBean(token)`
20
- - `@ConditionalOnProperty(key, expectedValue?)`
21
20
 
22
- **Injection Decorators**
21
+ ## Injection Decorators
23
22
  - `@Autowired()`
24
23
  - `@Inject(token)`
25
24
  - `@InjectRepository(entity)`
@@ -28,7 +27,7 @@ This document lists public exports and their intended usage.
28
27
  - `@Optional()`
29
28
  - `@Lazy()`
30
29
 
31
- **HTTP Decorators**
30
+ ## HTTP Decorators
32
31
  - `@Get(path?)`
33
32
  - `@Post(path?)`
34
33
  - `@Put(path?)`
@@ -41,99 +40,660 @@ This document lists public exports and their intended usage.
41
40
  - `@Req()`
42
41
  - `@Res()`
43
42
 
44
- **Lifecycle Decorators**
43
+ ## Lifecycle Decorators
45
44
  - `@PostConstruct()`
46
45
  - `@PreDestroy()`
47
46
  - `@OnStartup(order?)`
48
47
  - `@OnShutdown(order?)`
49
48
 
50
- **Pipeline Decorators**
49
+ ## Pipeline Decorators
51
50
  - `@FragmentMiddleware(MiddlewareClass)`
52
51
  - `@FragmentGuard(GuardClass)`
53
52
  - `@FragmentInterceptor(InterceptorClass)`
54
53
  - `@FragmentExceptionFilter(ExceptionFilterClass)`
55
54
 
56
- **Request Context**
57
- - `@RequestContext()` property decorator.
58
- - `RequestContextStorage` for manual access.
55
+ ## Plugin Decorators
56
+ - `@Plugin(options)`
57
+ - `@Plugin(token, qualifier?) (property)`
58
+ - `@OnPluginInit(order?)`
59
+ - `@OnPluginShutdown(order?)`
59
60
 
60
- **Plugins**
61
- - `@Plugin(options)` class decorator.
62
- - `@Plugin(token, qualifier?)` property decorator.
63
- - `@OnPluginInit(order?)` and `@OnPluginShutdown(order?)`.
64
- - `PluginRegistry` and `PluginManager`.
65
-
66
- **Mail**
61
+ ## Mail Decorators
67
62
  - `@Mailer(options)`
68
- - `@Mail(qualifier?)` property decorator
63
+ - `@Mail(qualifier?) (property)`
69
64
  - `@MailTemplate(options)`
70
- - `MailManager`
71
- - `MailTemplateRegistry`
72
- - `MailTransportRegistry`
73
- - `MailProvider`, `MailMessage`, `MailTransport`, `MailQueueAdapter`
74
65
 
75
- **Notifications**
66
+ ## Notification Decorators
76
67
  - `@NotificationChannel(options)`
77
- - `NotificationManager`
78
- - `NotificationChannel`
79
- - `Notification`, `MailNotification`, `NotificationChannelSelection`
80
68
 
81
- **Jobs and Cron**
69
+ ## Jobs Decorators
82
70
  - `@Job(options)`
83
71
  - `@Cron(expression, options?)`
84
- - `Job`
85
- - `ScheduledJob`
86
- - `JobManager`
87
- - `JobScheduler`
88
- - `JobQueueAdapter`, `JobContext`, `JobRunOptions`, `ScheduleOptions`
89
72
 
90
- **Frontend**
73
+ ## Frontend Decorators
91
74
  - `@View(options)`
92
- - `@Views(options)` (alias)
93
- - `@ViewModel(options)`
75
+ - `@Views(options)`
94
76
  - `@Store(options)`
95
77
  - `@UIComponent(options)`
78
+ - `@Template(options)`
79
+ - `@Templates(options)`
96
80
  - `@Action(options)`
97
- - `@Actions(options)` (alias)
81
+ - `@Actions(options)`
98
82
  - `@Effect(options)`
99
- - `@Effects(options)` (alias)
83
+ - `@Effects(options)`
84
+ - `@State(options?)`
85
+ - `@States(options?)`
86
+
87
+ ## Docs Decorators
88
+ - `@ApiTag(tag)`
89
+ - `@ApiOperation({ summary, description })`
90
+ - `@ApiResponse({ status, description, type, isArray, example })`
91
+ - `@ApiProperty({ description, required, example, type })`
92
+ ## Frontend Classes
100
93
  - `FrontendModule`
101
94
  - `FrontendRegistry`
102
95
  - `FrontendRouter`
103
96
  - `StoreManager`
104
97
  - `ThemeManager`
105
- - `StoreAdapter`, `FrontendRoute`, and frontend descriptor types
98
+ - `MobXStoreAdapter`
106
99
 
107
- **Documentation**
108
- - `@ApiTag(tag)`
109
- - `@ApiOperation({ summary, description })`
110
- - `@ApiResponse({ status, description, type, isArray, example })`
111
- - `@ApiProperty({ description, required, example, type })`
100
+ ## Mail Classes
101
+ - `MailManager`
102
+ - `MailTemplateRegistry`
103
+ - `MailTransportRegistry`
104
+ - `ConfiguredMailProvider`
105
+ - `MailProvider`
106
+ - `MailMessage`
107
+ - `MailSendResult`
108
+ - `MailTransport`
109
+ - `MailQueueAdapter`
110
+
111
+ ## Notification Classes
112
+ - `NotificationManager`
113
+ - `NotificationRegistry`
114
+ - `NotificationChannel`
115
+ - `MailNotificationChannel`
116
+ - `Notification`
117
+ - `MailNotification`
118
+ - `NotificationChannelSelection`
119
+
120
+ ## Jobs Classes
121
+ - `Job`
122
+ - `ScheduledJob`
123
+ - `JobManager`
124
+ - `JobScheduler`
125
+ - `JobQueueAdapter`
126
+ - `JobContext`
127
+ - `JobRunOptions`
128
+ - `ScheduleOptions`
129
+
130
+ ## Docs Classes
112
131
  - `DocGenerator`
113
132
 
114
- **Auth Module**
115
- - `AuthModule` with `hashPassword`, `comparePassword`, `generateToken`, `verifyToken`.
116
- - `authMiddleware()` and `roleGuard()`.
133
+ ## Auth Module
134
+ - `AuthModule`
135
+ - `authMiddleware()`
136
+ - `roleGuard()`
117
137
 
118
- **AI Module**
119
- - `AIModule` with `complete`, `streamComplete`, `embeddings`.
120
- - Supports OpenAI and Ollama providers.
138
+ ## AI Module
139
+ - `AIModule`
140
+ - `AIProvider`
141
+ - `OpenAIProvider`
142
+ - `OllamaProvider`
121
143
 
122
- **Errors**
123
- - `FragmentError` plus HTTP and domain-specific subclasses.
144
+ ## Errors
145
+ - `FragmentError`
146
+ - `BadRequestError`
147
+ - `UnauthorizedError`
148
+ - `ForbiddenError`
149
+ - `NotFoundError`
150
+ - `ConflictError`
151
+ - `ValidationError`
152
+ - `InternalServerError`
124
153
 
125
- **Logging**
126
- - `FragmentLogger` and `LoggerSettings`.
154
+ ## Logging
155
+ - `FragmentLogger`
156
+ - `LoggerSettings`
157
+ - `LogLevel`
127
158
 
128
- **Testing**
129
- - `TestRunner`, `describe`, `it`, `expect`, `beforeEach`, `afterEach`.
159
+ ## Testing
160
+ - `initTestRunner()`
161
+ - `describe()`
162
+ - `it()`
163
+ - `expect()`
164
+ - `beforeEach()`
165
+ - `afterEach()`
130
166
 
131
- **CLI Programmatic API**
167
+ ## CLI Programmatic API
132
168
  - `FragmentCommand`
133
169
  - `CommandRegistry`
134
170
  - `CommandRunner`
135
171
 
136
- **Third-Party Re-exports**
172
+ ## Request Context
173
+ - `RequestContextStorage`
174
+ - `@RequestContext()`
175
+
176
+ ## Third-Party Re-exports
137
177
  - `express` (from Express)
138
178
  - `typeorm`
139
179
  - `dotenv`
180
+
181
+ ## CLI Commands
182
+ - `fragment init [dir]`
183
+ - `fragment init --type=plugin`
184
+ - `fragment serve`
185
+ - `fragment build`
186
+ - `fragment test`
187
+ - `fragment lint`
188
+ - `fragment route:list`
189
+ - `fragment config:cache`
190
+ - `fragment cache:clear`
191
+ - `fragment env:init`
192
+ - `fragment env:list`
193
+ - `fragment env:use <file>`
194
+ - `fragment env:diff [file]`
195
+ - `fragment doc:generate`
196
+ - `fragment plugin:list`
197
+ - `fragment plugin:info <name>`
198
+ - `fragment plugin:remove <name>`
199
+ - `fragment plugin:enable <name>`
200
+ - `fragment plugin:disable <name>`
201
+ - `fragment add <package>`
202
+ - `fragment make:controller <name>`
203
+ - `fragment make:service <name>`
204
+ - `fragment make:resource <name>`
205
+ - `fragment make:dto <name>`
206
+ - `fragment make:middleware <name>`
207
+ - `fragment make:guard <name>`
208
+ - `fragment make:job <name>`
209
+ - `fragment make:mail <name>`
210
+ - `fragment make:notification <name>`
211
+ - `fragment make:view <name>`
212
+ - `fragment make:store <name>`
213
+ - `fragment make:component <name>`
214
+ - `fragment make:template <name>`
215
+ ## Configuration Keys
216
+ - `structure.type`
217
+ - `verbose`
218
+ - `logging.level`
219
+ - `logging.structured`
220
+ - `database.*`
221
+ - `database.entities`
222
+ - `database.migrations`
223
+ - `mail.default`
224
+ - `mail.mailers`
225
+ - `mail.templatesDir`
226
+ - `mail.queue.enabled`
227
+ - `notifications.defaultChannels`
228
+ - `jobs.enabled`
229
+ - `jobs.timezone`
230
+ - `docs.enabled`
231
+ - `docs.path`
232
+ - `docs.outputDir`
233
+ - `docs.template`
234
+ - `docs.perModule`
235
+ - `docs.perModuleRoutes`
236
+ - `plugins`
237
+ - `pluginAutoQualify`
238
+ - `frontend.enabled`
239
+ - `frontend.templates.default`
240
+ - `frontend.templates.system`
241
+ - `frontend.templates.custom`
242
+ - `frontend.styles.framework`
243
+ - `frontend.styles.tailwind`
244
+ - `frontend.routes.base`
245
+
246
+ ## API Notes
247
+ - `@FragmentApplication(options)` is part of the public API surface.
248
+ - `@Controller(path?)` is part of the public API surface.
249
+ - `@Service()` is part of the public API surface.
250
+ - `@FragmentRepository()` is part of the public API surface.
251
+ - `@Injectable(scope?)` is part of the public API surface.
252
+ - `@AutoConfiguration()` is part of the public API surface.
253
+ - `@Autowired()` is part of the injection API surface.
254
+ - `@Inject(token)` is part of the injection API surface.
255
+ - `@InjectRepository(entity)` is part of the injection API surface.
256
+ - `@Value(expression)` is part of the injection API surface.
257
+ - `@Qualifier(name)` is part of the injection API surface.
258
+ - `@Optional()` is part of the injection API surface.
259
+ - `@Lazy()` is part of the injection API surface.
260
+ - `@Get(path?)` is part of the HTTP routing API surface.
261
+ - `@Post(path?)` is part of the HTTP routing API surface.
262
+ - `@Put(path?)` is part of the HTTP routing API surface.
263
+ - `@Delete(path?)` is part of the HTTP routing API surface.
264
+ - `@Patch(path?)` is part of the HTTP routing API surface.
265
+ - `@Body()` is part of the HTTP routing API surface.
266
+ - `@Param(name?)` is part of the HTTP routing API surface.
267
+ - `@Query(name?)` is part of the HTTP routing API surface.
268
+ - `@Header(name?)` is part of the HTTP routing API surface.
269
+ - `@Req()` is part of the HTTP routing API surface.
270
+ - `@Res()` is part of the HTTP routing API surface.
271
+ - `@PostConstruct()` is part of the lifecycle API surface.
272
+ - `@PreDestroy()` is part of the lifecycle API surface.
273
+ - `@OnStartup(order?)` is part of the lifecycle API surface.
274
+ - `@OnShutdown(order?)` is part of the lifecycle API surface.
275
+ - `@View(options)` is part of the frontend API surface.
276
+ - `@Views(options)` is part of the frontend API surface.
277
+ - `@Store(options)` is part of the frontend API surface.
278
+ - `@UIComponent(options)` is part of the frontend API surface.
279
+ - `@Template(options)` is part of the frontend API surface.
280
+ - `@Templates(options)` is part of the frontend API surface.
281
+ - `@Action(options)` is part of the frontend API surface.
282
+ - `@Actions(options)` is part of the frontend API surface.
283
+ - `@Effect(options)` is part of the frontend API surface.
284
+ - `@Effects(options)` is part of the frontend API surface.
285
+ - `@State(options?)` is part of the frontend API surface.
286
+ - `@States(options?)` is part of the frontend API surface.
287
+ - `@ApiTag(tag)` is part of the docs API surface.
288
+ - `@ApiOperation({ summary, description })` is part of the docs API surface.
289
+ - `@ApiResponse({ status, description, type, isArray, example })` is part of the docs API surface.
290
+ - `@ApiProperty({ description, required, example, type })` is part of the docs API surface.
291
+ ## Extended API Index
292
+ - CLI: `fragment init [dir]` is supported by the framework binary.
293
+ - CLI: `fragment init --type=plugin` is supported by the framework binary.
294
+ - CLI: `fragment serve` is supported by the framework binary.
295
+ - CLI: `fragment build` is supported by the framework binary.
296
+ - CLI: `fragment test` is supported by the framework binary.
297
+ - CLI: `fragment lint` is supported by the framework binary.
298
+ - CLI: `fragment route:list` is supported by the framework binary.
299
+ - CLI: `fragment config:cache` is supported by the framework binary.
300
+ - CLI: `fragment cache:clear` is supported by the framework binary.
301
+ - CLI: `fragment env:init` is supported by the framework binary.
302
+ - CLI: `fragment env:list` is supported by the framework binary.
303
+ - CLI: `fragment env:use <file>` is supported by the framework binary.
304
+ - CLI: `fragment env:diff [file]` is supported by the framework binary.
305
+ - CLI: `fragment doc:generate` is supported by the framework binary.
306
+ - CLI: `fragment plugin:list` is supported by the framework binary.
307
+ - CLI: `fragment plugin:info <name>` is supported by the framework binary.
308
+ - CLI: `fragment plugin:remove <name>` is supported by the framework binary.
309
+ - CLI: `fragment plugin:enable <name>` is supported by the framework binary.
310
+ - CLI: `fragment plugin:disable <name>` is supported by the framework binary.
311
+ - CLI: `fragment add <package>` is supported by the framework binary.
312
+ - CLI: `fragment make:controller <name>` is supported by the framework binary.
313
+ - CLI: `fragment make:service <name>` is supported by the framework binary.
314
+ - CLI: `fragment make:resource <name>` is supported by the framework binary.
315
+ - CLI: `fragment make:dto <name>` is supported by the framework binary.
316
+ - CLI: `fragment make:middleware <name>` is supported by the framework binary.
317
+ - CLI: `fragment make:guard <name>` is supported by the framework binary.
318
+ - CLI: `fragment make:job <name>` is supported by the framework binary.
319
+ - CLI: `fragment make:mail <name>` is supported by the framework binary.
320
+ - CLI: `fragment make:notification <name>` is supported by the framework binary.
321
+ - CLI: `fragment make:view <name>` is supported by the framework binary.
322
+ - CLI: `fragment make:store <name>` is supported by the framework binary.
323
+ - CLI: `fragment make:component <name>` is supported by the framework binary.
324
+ - CLI: `fragment make:template <name>` is supported by the framework binary.
325
+ - Config: `structure.type` appears in the configuration schema.
326
+ - Config: `verbose` appears in the configuration schema.
327
+ - Config: `logging.level` appears in the configuration schema.
328
+ - Config: `logging.structured` appears in the configuration schema.
329
+ - Config: `database.*` appears in the configuration schema.
330
+ - Config: `database.entities` appears in the configuration schema.
331
+ - Config: `database.migrations` appears in the configuration schema.
332
+ - Config: `mail.default` appears in the configuration schema.
333
+ - Config: `mail.mailers` appears in the configuration schema.
334
+ - Config: `mail.templatesDir` appears in the configuration schema.
335
+ - Config: `mail.queue.enabled` appears in the configuration schema.
336
+ - Config: `notifications.defaultChannels` appears in the configuration schema.
337
+ - Config: `jobs.enabled` appears in the configuration schema.
338
+ - Config: `jobs.timezone` appears in the configuration schema.
339
+ - Config: `docs.enabled` appears in the configuration schema.
340
+ - Config: `docs.path` appears in the configuration schema.
341
+ - Config: `docs.outputDir` appears in the configuration schema.
342
+ - Config: `docs.template` appears in the configuration schema.
343
+ - Config: `docs.perModule` appears in the configuration schema.
344
+ - Config: `docs.perModuleRoutes` appears in the configuration schema.
345
+ - Config: `plugins` appears in the configuration schema.
346
+ - Config: `pluginAutoQualify` appears in the configuration schema.
347
+ - Config: `frontend.enabled` appears in the configuration schema.
348
+ - Config: `frontend.templates.default` appears in the configuration schema.
349
+ - Config: `frontend.templates.system` appears in the configuration schema.
350
+ - Config: `frontend.templates.custom` appears in the configuration schema.
351
+ - Config: `frontend.routes.base` appears in the configuration schema.
352
+ - Export note 1: Keep names aligned with file suffixes.
353
+ - Export note 2: Keep names aligned with file suffixes.
354
+ - Export note 3: Keep names aligned with file suffixes.
355
+ - Export note 4: Keep names aligned with file suffixes.
356
+ - Export note 5: Keep names aligned with file suffixes.
357
+ - Export note 6: Keep names aligned with file suffixes.
358
+ - Export note 7: Keep names aligned with file suffixes.
359
+ - Export note 8: Keep names aligned with file suffixes.
360
+ - Export note 9: Keep names aligned with file suffixes.
361
+ - Export note 10: Keep names aligned with file suffixes.
362
+ - Export note 11: Keep names aligned with file suffixes.
363
+ - Export note 12: Keep names aligned with file suffixes.
364
+ - Export note 13: Keep names aligned with file suffixes.
365
+ - Export note 14: Keep names aligned with file suffixes.
366
+ - Export note 15: Keep names aligned with file suffixes.
367
+ - Export note 16: Keep names aligned with file suffixes.
368
+ - Export note 17: Keep names aligned with file suffixes.
369
+ - Export note 18: Keep names aligned with file suffixes.
370
+ - Export note 19: Keep names aligned with file suffixes.
371
+ - Export note 20: Keep names aligned with file suffixes.
372
+ - Export note 21: Keep names aligned with file suffixes.
373
+ - Export note 22: Keep names aligned with file suffixes.
374
+ - Export note 23: Keep names aligned with file suffixes.
375
+ - Export note 24: Keep names aligned with file suffixes.
376
+ - Export note 25: Keep names aligned with file suffixes.
377
+ - Export note 26: Keep names aligned with file suffixes.
378
+ - Export note 27: Keep names aligned with file suffixes.
379
+ - Export note 28: Keep names aligned with file suffixes.
380
+ - Export note 29: Keep names aligned with file suffixes.
381
+ - Export note 30: Keep names aligned with file suffixes.
382
+ - Export note 31: Keep names aligned with file suffixes.
383
+ - Export note 32: Keep names aligned with file suffixes.
384
+ - Export note 33: Keep names aligned with file suffixes.
385
+ - Export note 34: Keep names aligned with file suffixes.
386
+ - Export note 35: Keep names aligned with file suffixes.
387
+ - Export note 36: Keep names aligned with file suffixes.
388
+ - Export note 37: Keep names aligned with file suffixes.
389
+ - Export note 38: Keep names aligned with file suffixes.
390
+ - Export note 39: Keep names aligned with file suffixes.
391
+ - Export note 40: Keep names aligned with file suffixes.
392
+ - Export note 41: Keep names aligned with file suffixes.
393
+ - Export note 42: Keep names aligned with file suffixes.
394
+ - Export note 43: Keep names aligned with file suffixes.
395
+ - Export note 44: Keep names aligned with file suffixes.
396
+ - Export note 45: Keep names aligned with file suffixes.
397
+ - Export note 46: Keep names aligned with file suffixes.
398
+ - Export note 47: Keep names aligned with file suffixes.
399
+ - Export note 48: Keep names aligned with file suffixes.
400
+ - Export note 49: Keep names aligned with file suffixes.
401
+ - Export note 50: Keep names aligned with file suffixes.
402
+ - Export note 51: Keep names aligned with file suffixes.
403
+ - Export note 52: Keep names aligned with file suffixes.
404
+ - Export note 53: Keep names aligned with file suffixes.
405
+ - Export note 54: Keep names aligned with file suffixes.
406
+ - Export note 55: Keep names aligned with file suffixes.
407
+ - Export note 56: Keep names aligned with file suffixes.
408
+ - Export note 57: Keep names aligned with file suffixes.
409
+ - Export note 58: Keep names aligned with file suffixes.
410
+ - Export note 59: Keep names aligned with file suffixes.
411
+ - Export note 60: Keep names aligned with file suffixes.
412
+ - Export note 61: Keep names aligned with file suffixes.
413
+ - Export note 62: Keep names aligned with file suffixes.
414
+ - Export note 63: Keep names aligned with file suffixes.
415
+ - Export note 64: Keep names aligned with file suffixes.
416
+ - Export note 65: Keep names aligned with file suffixes.
417
+ - Export note 66: Keep names aligned with file suffixes.
418
+ - Export note 67: Keep names aligned with file suffixes.
419
+ - Export note 68: Keep names aligned with file suffixes.
420
+ - Export note 69: Keep names aligned with file suffixes.
421
+ - Export note 70: Keep names aligned with file suffixes.
422
+ - Export note 71: Keep names aligned with file suffixes.
423
+ - Export note 72: Keep names aligned with file suffixes.
424
+ - Export note 73: Keep names aligned with file suffixes.
425
+ - Export note 74: Keep names aligned with file suffixes.
426
+ - Export note 75: Keep names aligned with file suffixes.
427
+ - Export note 76: Keep names aligned with file suffixes.
428
+ - Export note 77: Keep names aligned with file suffixes.
429
+ - Export note 78: Keep names aligned with file suffixes.
430
+ - Export note 79: Keep names aligned with file suffixes.
431
+ - Export note 80: Keep names aligned with file suffixes.
432
+ - Export note 81: Keep names aligned with file suffixes.
433
+ - Export note 82: Keep names aligned with file suffixes.
434
+ - Export note 83: Keep names aligned with file suffixes.
435
+ - Export note 84: Keep names aligned with file suffixes.
436
+ - Export note 85: Keep names aligned with file suffixes.
437
+ - Export note 86: Keep names aligned with file suffixes.
438
+ - Export note 87: Keep names aligned with file suffixes.
439
+ - Export note 88: Keep names aligned with file suffixes.
440
+ - Export note 89: Keep names aligned with file suffixes.
441
+ - Export note 90: Keep names aligned with file suffixes.
442
+ - Export note 91: Keep names aligned with file suffixes.
443
+ - Export note 92: Keep names aligned with file suffixes.
444
+ - Export note 93: Keep names aligned with file suffixes.
445
+ - Export note 94: Keep names aligned with file suffixes.
446
+ - Export note 95: Keep names aligned with file suffixes.
447
+ - Export note 96: Keep names aligned with file suffixes.
448
+ - Export note 97: Keep names aligned with file suffixes.
449
+ - Export note 98: Keep names aligned with file suffixes.
450
+ - Export note 99: Keep names aligned with file suffixes.
451
+ - Export note 100: Keep names aligned with file suffixes.
452
+ - Export note 101: Keep names aligned with file suffixes.
453
+ - Export note 102: Keep names aligned with file suffixes.
454
+ - Export note 103: Keep names aligned with file suffixes.
455
+ - Export note 104: Keep names aligned with file suffixes.
456
+ - Export note 105: Keep names aligned with file suffixes.
457
+ - Export note 106: Keep names aligned with file suffixes.
458
+ - Export note 107: Keep names aligned with file suffixes.
459
+ - Export note 108: Keep names aligned with file suffixes.
460
+ - Export note 109: Keep names aligned with file suffixes.
461
+ - Export note 110: Keep names aligned with file suffixes.
462
+ - Export note 111: Keep names aligned with file suffixes.
463
+ - Export note 112: Keep names aligned with file suffixes.
464
+ - Export note 113: Keep names aligned with file suffixes.
465
+ - Export note 114: Keep names aligned with file suffixes.
466
+ - Export note 115: Keep names aligned with file suffixes.
467
+ - Export note 116: Keep names aligned with file suffixes.
468
+ - Export note 117: Keep names aligned with file suffixes.
469
+ - Export note 118: Keep names aligned with file suffixes.
470
+ - Export note 119: Keep names aligned with file suffixes.
471
+ - Export note 120: Keep names aligned with file suffixes.
472
+
473
+ ## API Conventions
474
+ - API convention 1: Keep decorator usage near the class or method definition.
475
+ - API convention 2: Keep decorator usage near the class or method definition.
476
+ - API convention 3: Keep decorator usage near the class or method definition.
477
+ - API convention 4: Keep decorator usage near the class or method definition.
478
+ - API convention 5: Keep decorator usage near the class or method definition.
479
+ - API convention 6: Keep decorator usage near the class or method definition.
480
+ - API convention 7: Keep decorator usage near the class or method definition.
481
+ - API convention 8: Keep decorator usage near the class or method definition.
482
+ - API convention 9: Keep decorator usage near the class or method definition.
483
+ - API convention 10: Keep decorator usage near the class or method definition.
484
+ - API convention 11: Keep decorator usage near the class or method definition.
485
+ - API convention 12: Keep decorator usage near the class or method definition.
486
+ - API convention 13: Keep decorator usage near the class or method definition.
487
+ - API convention 14: Keep decorator usage near the class or method definition.
488
+ - API convention 15: Keep decorator usage near the class or method definition.
489
+ - API convention 16: Keep decorator usage near the class or method definition.
490
+ - API convention 17: Keep decorator usage near the class or method definition.
491
+ - API convention 18: Keep decorator usage near the class or method definition.
492
+ - API convention 19: Keep decorator usage near the class or method definition.
493
+ - API convention 20: Keep decorator usage near the class or method definition.
494
+ - API convention 21: Keep decorator usage near the class or method definition.
495
+ - API convention 22: Keep decorator usage near the class or method definition.
496
+ - API convention 23: Keep decorator usage near the class or method definition.
497
+ - API convention 24: Keep decorator usage near the class or method definition.
498
+ - API convention 25: Keep decorator usage near the class or method definition.
499
+ - API convention 26: Keep decorator usage near the class or method definition.
500
+ - API convention 27: Keep decorator usage near the class or method definition.
501
+ - API convention 28: Keep decorator usage near the class or method definition.
502
+ - API convention 29: Keep decorator usage near the class or method definition.
503
+ - API convention 30: Keep decorator usage near the class or method definition.
504
+ - API convention 31: Keep decorator usage near the class or method definition.
505
+ - API convention 32: Keep decorator usage near the class or method definition.
506
+ - API convention 33: Keep decorator usage near the class or method definition.
507
+ - API convention 34: Keep decorator usage near the class or method definition.
508
+ - API convention 35: Keep decorator usage near the class or method definition.
509
+ - API convention 36: Keep decorator usage near the class or method definition.
510
+ - API convention 37: Keep decorator usage near the class or method definition.
511
+ - API convention 38: Keep decorator usage near the class or method definition.
512
+ - API convention 39: Keep decorator usage near the class or method definition.
513
+ - API convention 40: Keep decorator usage near the class or method definition.
514
+ - API convention 41: Keep decorator usage near the class or method definition.
515
+ - API convention 42: Keep decorator usage near the class or method definition.
516
+ - API convention 43: Keep decorator usage near the class or method definition.
517
+ - API convention 44: Keep decorator usage near the class or method definition.
518
+ - API convention 45: Keep decorator usage near the class or method definition.
519
+ - API convention 46: Keep decorator usage near the class or method definition.
520
+ - API convention 47: Keep decorator usage near the class or method definition.
521
+ - API convention 48: Keep decorator usage near the class or method definition.
522
+ - API convention 49: Keep decorator usage near the class or method definition.
523
+ - API convention 50: Keep decorator usage near the class or method definition.
524
+
525
+ ## API Walkthrough Examples
526
+ This section gives short, implementation-oriented examples for the most-used APIs.
527
+
528
+ ### Application Bootstrapping
529
+ ```ts
530
+ import { FragmentApplication, FragmentWebApplication } from "fragment-ts";
531
+
532
+ @FragmentApplication({ port: 3000, autoScan: true })
533
+ class App {}
534
+
535
+ async function bootstrap() {
536
+ const app = new FragmentWebApplication();
537
+ await app.bootstrap(App);
538
+ }
539
+
540
+ bootstrap();
541
+ ```
542
+
543
+ ### DI and Services
544
+ ```ts
545
+ import { Service, Inject } from "fragment-ts";
546
+
547
+ @Service()
548
+ class TokenService {
549
+ generate() {
550
+ return "t_" + Date.now();
551
+ }
552
+ }
553
+
554
+ @Service()
555
+ class SessionService {
556
+ @Inject(TokenService)
557
+ private tokens!: TokenService;
558
+
559
+ create() {
560
+ return this.tokens.generate();
561
+ }
562
+ }
563
+ ```
564
+
565
+ ### FragmentError Usage
566
+ ```ts
567
+ import { FragmentError } from "fragment-ts";
568
+
569
+ class PolicyError extends FragmentError {
570
+ constructor(message: string) {
571
+ super(message, 400, { policy: "signup" });
572
+ }
573
+ }
574
+ ```
575
+
576
+ ### HTTP Controllers
577
+ ```ts
578
+ import { Controller, Get, Post, Body } from "fragment-ts";
579
+
580
+ @Controller("/tasks")
581
+ class TaskController {
582
+ @Get()
583
+ list() {
584
+ return [];
585
+ }
586
+
587
+ @Post()
588
+ create(@Body() body: any) {
589
+ return { id: "t_1", ...body };
590
+ }
591
+ }
592
+ ```
593
+
594
+ ### Plugin Lifecycle
595
+ ```ts
596
+ import { Plugin, OnPluginInit, OnPluginShutdown } from "fragment-ts";
597
+
598
+ @Plugin({ name: "AuditPlugin" })
599
+ class AuditPlugin {
600
+ @OnPluginInit()
601
+ async init() {}
602
+
603
+ @OnPluginShutdown()
604
+ async shutdown() {}
605
+ }
606
+ ```
607
+
608
+ ### Mail and Templates
609
+ ```ts
610
+ import { Mailer, MailTemplate, MailManager } from "fragment-ts";
611
+ import type { MailProvider, MailMessage } from "fragment-ts";
612
+
613
+ @Mailer({ name: "primary" })
614
+ class ConsoleMailer implements MailProvider {
615
+ async send(message: MailMessage) {
616
+ return { id: "mail_1", accepted: [String(message.to)], rejected: [] };
617
+ }
618
+ }
619
+
620
+ @MailTemplate({ name: "welcome", html: "<h1>Hello <%= name %></h1>" })
621
+ class WelcomeTemplate {}
622
+
623
+ const mail = new MailManager();
624
+ await mail.send({ to: "user@example.com", template: "welcome", data: { name: "Ada" } });
625
+ ```
626
+
627
+ ### Notifications
628
+ ```ts
629
+ import { NotificationManager, NotificationChannel } from "fragment-ts";
630
+
631
+ @NotificationChannel({ name: "sms" })
632
+ class SmsChannel extends NotificationChannel<string> {
633
+ name = "sms";
634
+ protected async send(payload: string) {}
635
+ }
636
+
637
+ class AlertNotification {
638
+ via() { return ["sms"]; }
639
+ toSms() { return "Service degraded"; }
640
+ }
641
+
642
+ const manager = new NotificationManager();
643
+ await manager.send(new AlertNotification());
644
+ ```
645
+
646
+ ### Jobs and Scheduling
647
+ ```ts
648
+ import { Job, Cron, ScheduledJob } from "fragment-ts";
649
+
650
+ @Job({ name: "metrics" })
651
+ class MetricsJob extends ScheduledJob {
652
+ async handle() {}
653
+
654
+ @Cron("0 * * * *")
655
+ async hourly() {}
656
+ }
657
+
658
+ new MetricsJob().everyHour(6);
659
+ ```
660
+
661
+ ### Frontend Metadata
662
+ ```ts
663
+ import { View, Store, Template, UIComponent, State, Action } from "fragment-ts";
664
+
665
+ @Template({ name: "app", kind: "system", components: ["TopNav"] })
666
+ class AppTemplate {}
667
+
668
+ @UIComponent({ name: "TopNav" })
669
+ class TopNav {}
670
+
671
+ @Store({ name: "home" })
672
+ class HomeStore {
673
+ @State()
674
+ count = 0;
675
+
676
+ @Action()
677
+ increment() {
678
+ this.count += 1;
679
+ }
680
+ }
681
+
682
+ @View({ path: "/", template: "app", store: "home" })
683
+ class HomeView {}
684
+ ```
685
+
686
+ ### Docs Generation
687
+ ```ts
688
+ import { DocGenerator } from "fragment-ts";
689
+
690
+ const generator = new DocGenerator();
691
+ generator.generate({ outputDir: "docs", perModule: true });
692
+ ```
693
+
694
+ ### Programmatic CLI
695
+ ```ts
696
+ import { CommandRunner } from "fragment-ts";
697
+
698
+ await CommandRunner.run("route:list");
699
+ ```