raiton 4.0.0 → 5.5.0-beta.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 (62) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +54 -2
  3. package/build/bin/index.mjs +568 -275
  4. package/examples/user-controller.example.ts +53 -0
  5. package/package.json +6 -8
  6. package/source/bin/cli-tools.ts +2 -0
  7. package/source/commands/build.command.ts +2 -1
  8. package/source/commands/develop.command.ts +1 -0
  9. package/source/commands/start.command.ts +15 -10
  10. package/source/core/application.ts +40 -31
  11. package/source/core/artifacts/artifact.ts +10 -0
  12. package/source/core/artifacts/index.ts +1 -0
  13. package/source/core/artifacts/runner.ts +3 -0
  14. package/source/core/builder.ts +42 -13
  15. package/source/core/hooks.ts +0 -8
  16. package/source/core/index.ts +15 -15
  17. package/source/core/injection/injection.ts +7 -4
  18. package/source/core/middleware/pipeline.ts +2 -8
  19. package/source/core/plugins/scope.ts +18 -6
  20. package/source/core/router/handler.ts +24 -78
  21. package/source/core/router/handler.utils.ts +135 -0
  22. package/source/core/router/matcher.ts +13 -9
  23. package/source/core/router/router.ts +5 -1
  24. package/source/core/thread.ts +19 -16
  25. package/source/framework/artifacts.ts +7 -1
  26. package/source/framework/constants/decorators.constant.ts +7 -0
  27. package/source/framework/decorators/api-response.decorator.ts +127 -0
  28. package/source/framework/decorators/api.decorator.ts +219 -0
  29. package/source/framework/decorators/index.ts +4 -2
  30. package/source/framework/decorators/{parametrable.ts → parametrable.decorator.ts} +1 -1
  31. package/source/framework/encryption.ts +2 -1
  32. package/source/framework/enums/encrypted.enum.ts +2 -2
  33. package/source/framework/enums/http-parameters.enum.ts +1 -0
  34. package/source/framework/enums/runtime.enum.ts +2 -2
  35. package/source/framework/env.ts +2 -2
  36. package/source/framework/exceptions/http-exception.ts +1 -1
  37. package/source/framework/index.ts +1 -0
  38. package/source/framework/plugins/body-parser.plugin.ts +28 -11
  39. package/source/framework/plugins/index.ts +3 -2
  40. package/source/framework/plugins/openapi.plugin.ts +98 -0
  41. package/source/framework/plugins/security/cors.ts +59 -25
  42. package/source/framework/responses/helpers.ts +4 -3
  43. package/source/framework/responses/http-throwable.ts +2 -2
  44. package/source/framework/responses/http.ts +3 -3
  45. package/source/framework/runtime/bun/server.ts +6 -2
  46. package/source/framework/runtime/deno/server.ts +93 -42
  47. package/source/framework/runtime/index.ts +18 -13
  48. package/source/framework/runtime/node/reply.ts +37 -0
  49. package/source/framework/runtime/node/request.ts +47 -0
  50. package/source/framework/runtime/node/server.ts +5 -33
  51. package/source/framework/runtime/web/server.ts +73 -57
  52. package/source/framework/utilities/cookie.util.ts +11 -0
  53. package/source/framework/utilities/index.ts +3 -1
  54. package/source/framework/utilities/openapi.utils.ts +497 -0
  55. package/source/framework/view-model.ts +4 -0
  56. package/source/types/access-guards.ts +4 -0
  57. package/source/types/artifact.ts +42 -1
  58. package/source/types/builder.ts +6 -1
  59. package/source/types/http-responses.ts +8 -0
  60. package/source/types/runtime.ts +4 -2
  61. package/source/types/scheme.ts +153 -0
  62. package/source/types/thread.ts +3 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,40 @@
1
+ # [1.0.0-alpha.4](https://github.com/protorians/raiton/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2026-02-17)
2
+
3
+ ## Breaking Changes
4
+ ### Bug Fixes
5
+
6
+ * remove emojis from README section titles for consistency ([8d604ee](https://github.com/protorians/raiton/commit/8d604eec0825bfdf172988ee9fe662076b7e46be))
7
+ * remove unused Fastify dependencies and deprecate parameter handling utilities ([282db2c](https://github.com/protorians/raiton/commit/282db2cb4baeb52b816e1444f9d618570a073443))
8
+ * update `.releaserc.json` to refine branch configurations and format `assets` array ([0f803c0](https://github.com/protorians/raiton/commit/0f803c08d03549bd28ef9e61fe9c6c121d2f781d))
9
+ * update keywords in `package.json` and reset version to `0.0.0` ([44f7c85](https://github.com/protorians/raiton/commit/44f7c858330fc5455260d66d05b78a5a33d388f8))
10
+
11
+
12
+ ### Features
13
+
14
+ * add `NODE_AUTH_TOKEN` to `publish.yml` for semantic-release environment setup ([44a561b](https://github.com/protorians/raiton/commit/44a561b60bc3f35ae59bb404c343ef56baab4d26))
15
+ * enable provenance support in `package.json` and `.releaserc.json` ([b5db171](https://github.com/protorians/raiton/commit/b5db171a84150aefc2978b37c5d3544b5769b160))
16
+ * make package public and fix `publish.yml` token variable ([0293ee6](https://github.com/protorians/raiton/commit/0293ee629e444be0d90823896ea57212743d357d))
17
+ * remove redundant comments from `publish.yml` workflow ([37ddce9](https://github.com/protorians/raiton/commit/37ddce94356dba8f2c2d5e87af7fc3ade4ca3cf5))
18
+
19
+ # [1.0.0-alpha.3](https://github.com/protorians/raiton/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2026-02-17)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * extend `ChildProcess` types to include `ChildProcessWithoutNullStreams` and adjust `Logger` for optional child process PID ([e1e7e17](https://github.com/protorians/raiton/commit/e1e7e17ddd921da5f09cf3240f06a64fddd274f5))
25
+ * refactor runtime detection in `CliTools` and streamline imports in bin files ([b431aa3](https://github.com/protorians/raiton/commit/b431aa31d86e2ef480fbafa8a2cfbb5ae6a4c640))
26
+ * remove unused HMR and artifact modules, refactor thread lifecycle, and optimize artifact initialization in application core ([af88e34](https://github.com/protorians/raiton/commit/af88e341ba8c695b3a9817d450845e25bb004b9e))
27
+ * remove unused SDK modules, rework artifacts handling, and enhance parametrable decorators ([ddc6d35](https://github.com/protorians/raiton/commit/ddc6d35cd070e25f0da19185e776feead0843ad0))
28
+ * remove unused types, streamline imports, and enhance type definitions with Lifecycle interfaces ([5ef2e46](https://github.com/protorians/raiton/commit/5ef2e46ecec191c1e51d79c997ebe2f8244dc7fc))
29
+
30
+
31
+ ### Features
32
+
33
+ * add `class-validator` dependency and update README to remove Deno beta references ([a616086](https://github.com/protorians/raiton/commit/a616086652d437d0763d7c8313150c56ee4d11d9))
34
+ * add basic `deno.json` with imports and tasks configuration ([e31b024](https://github.com/protorians/raiton/commit/e31b02414bc4378a7125678fe88268f57367c646))
35
+ * add global runtime detection constants for Bun and Deno in `constants.ts` ([c63ac8e](https://github.com/protorians/raiton/commit/c63ac8e36089e58856c180706c89b51390ae850f))
36
+ * introduce HTTP response handling modules with enums, exceptions, and utilities for streamlined error management and parameterized responses ([e1c5fa3](https://github.com/protorians/raiton/commit/e1c5fa3cc00fd7e7ce61ac44243483c2127f1dfe))
37
+
1
38
  # [1.0.0-alpha.2](https://github.com/protorians/raiton/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2026-02-16)
2
39
 
3
40
 
package/README.md CHANGED
@@ -82,7 +82,7 @@ bun raiton build
82
82
  bun raiton start
83
83
  ```
84
84
 
85
- ## 🛠 Runtimes supportés
85
+ ## Runtimes supportés
86
86
 
87
87
  Raiton détecte automatiquement l'environnement d'exécution et adapte son serveur :
88
88
 
@@ -90,7 +90,59 @@ Raiton détecte automatiquement l'environnement d'exécution et adapte son serve
90
90
  - **Node.js** : Adaptateur pour serveurs HTTP Node.
91
91
  - **Web** : Compatible avec les environnements basés sur les standards Web (Fetch API).
92
92
 
93
- ## 📄 Licence
93
+ ## Documentation API
94
+
95
+ Example
96
+ ```typescript
97
+ import { Controllable, Get, ApiOkResponse, ApiResponse } from 'raiton/framework';
98
+
99
+ @Controllable('/users')
100
+ export class UserController {
101
+ @Get()
102
+ @ApiOkResponse({
103
+ description: 'Returns a list of users',
104
+ type: Array,
105
+ isArray: true
106
+ })
107
+ async getUsers() {
108
+ return [{ id: 1, name: 'John Doe' }, { id: 2, name: 'Jane Smith' }];
109
+ }
110
+
111
+ @Get('/:id')
112
+ @ApiResponse({
113
+ status: 200,
114
+ description: 'Returns the user if found',
115
+ type: Object
116
+ })
117
+ @ApiResponse({
118
+ status: 404,
119
+ description: 'User not found'
120
+ })
121
+ async getUserById() {
122
+ // ... implementation
123
+ return { id: 1, name: 'John Doe' };
124
+ }
125
+ }
126
+ ```
127
+
128
+ ```typescript
129
+ import { Controllable, Get, ApiQuery } from "raiton/framework";
130
+
131
+ @Controllable("/users")
132
+ export class UserController {
133
+ @Get()
134
+ @ApiQuery("name", { description: "Filter by name", required: false, type:
135
+ String })
136
+ @ApiQuery("limit", { description: "Max results", required: false, type:
137
+ Number })
138
+ async getUsers(ctx) {
139
+ const { name, limit } = ctx.query;
140
+ // …
141
+ }
142
+ }
143
+ ```
144
+
145
+ ## Licence
94
146
 
95
147
  Ce projet est sous licence MIT. Voir le fichier [LICENSE](LICENSE) pour plus de détails.
96
148