raiton 1.0.0-alpha.1 → 1.0.0-alpha.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 (72) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +87 -11
  3. package/build/bin/index.mjs +3831 -3649
  4. package/build/raiton-1.0.0-alpha.3.tgz +0 -0
  5. package/deno.json +9 -0
  6. package/package.json +4 -1
  7. package/source/bin/cli-tools.ts +34 -9
  8. package/source/bin/constants.ts +5 -0
  9. package/source/bin/index.ts +1 -1
  10. package/source/commands/develop.command.ts +3 -3
  11. package/source/commands/start.command.ts +1 -1
  12. package/source/core/application.ts +66 -18
  13. package/source/core/builder.ts +27 -21
  14. package/source/core/controller/builder.ts +8 -5
  15. package/source/core/controller/metadata.ts +1 -1
  16. package/source/core/directories.ts +1 -1
  17. package/source/core/index.ts +0 -1
  18. package/source/core/injection/injection.ts +67 -5
  19. package/source/core/middleware/compose.ts +1 -1
  20. package/source/core/raiton.ts +2 -3
  21. package/source/core/router/handler.ts +100 -44
  22. package/source/core/thread.ts +18 -8
  23. package/source/sdk/artifacts.ts +65 -41
  24. package/source/sdk/constants/decorators.constant.ts +1 -0
  25. package/source/sdk/data-transfer-object.ts +11 -3
  26. package/source/sdk/decorators/parametrable.ts +19 -15
  27. package/source/sdk/decorators/routable.decorator.ts +0 -3
  28. package/source/sdk/encryption.ts +5 -6
  29. package/source/sdk/enums/encrypted.enum.ts +10 -0
  30. package/source/sdk/enums/http-status.enum.ts +73 -0
  31. package/source/sdk/enums/index.ts +2 -1
  32. package/source/sdk/exceptions/http-exception.ts +28 -0
  33. package/source/sdk/exceptions/index.ts +2 -0
  34. package/source/sdk/index.ts +7 -0
  35. package/source/sdk/parameter-bag.ts +55 -0
  36. package/source/sdk/repositories.ts +1 -1
  37. package/source/sdk/responses/error.ts +52 -0
  38. package/source/sdk/responses/helpers.ts +28 -0
  39. package/source/sdk/responses/http-throwable.ts +28 -0
  40. package/source/sdk/responses/http.ts +48 -0
  41. package/source/sdk/responses/index.ts +4 -0
  42. package/source/sdk/runtime/bun/server.ts +2 -1
  43. package/source/sdk/runtime/deno/server.ts +2 -2
  44. package/source/sdk/runtime/node/server.ts +2 -2
  45. package/source/sdk/utilities/artifact.util.ts +18 -0
  46. package/source/sdk/utilities/index.ts +1 -3
  47. package/source/types/application.ts +3 -3
  48. package/source/types/artifact.ts +36 -32
  49. package/source/types/builder.ts +0 -4
  50. package/source/types/config.ts +2 -2
  51. package/source/types/controller.ts +1 -2
  52. package/source/types/index.ts +2 -3
  53. package/source/types/lifecycle.ts +11 -0
  54. package/source/types/responses.ts +17 -7
  55. package/source/types/runtime.ts +1 -1
  56. package/build/raiton-1.0.0-alpha.1.tgz +0 -0
  57. package/source/core/artifacts/artifact.ts +0 -109
  58. package/source/core/artifacts/artifacts.ts +0 -10
  59. package/source/core/artifacts/index.ts +0 -1
  60. package/source/core/artifacts/runner.ts +0 -3
  61. package/source/core/hmr.ts +0 -106
  62. package/source/sdk/decorators/payload.decorator.ts +0 -77
  63. package/source/sdk/json.ts +0 -55
  64. package/source/sdk/request.ts +0 -3
  65. package/source/sdk/responses.ts +0 -45
  66. package/source/sdk/schemes.ts +0 -178
  67. package/source/sdk/utilities/artifacts.util.ts +0 -62
  68. package/source/sdk/utilities/controller.util.ts +0 -8
  69. package/source/types/data-transfer-object.ts +0 -4
  70. package/source/types/hmr.ts +0 -39
  71. /package/source/sdk/enums/{http.enum.ts → http-method.enum.ts} +0 -0
  72. /package/source/sdk/{throwable.ts → exceptions/throwable.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # [1.0.0-alpha.3](https://github.com/protorians/raiton/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2026-02-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * extend `ChildProcess` types to include `ChildProcessWithoutNullStreams` and adjust `Logger` for optional child process PID ([e1e7e17](https://github.com/protorians/raiton/commit/e1e7e17ddd921da5f09cf3240f06a64fddd274f5))
7
+ * refactor runtime detection in `CliTools` and streamline imports in bin files ([b431aa3](https://github.com/protorians/raiton/commit/b431aa31d86e2ef480fbafa8a2cfbb5ae6a4c640))
8
+ * remove unused HMR and artifact modules, refactor thread lifecycle, and optimize artifact initialization in application core ([af88e34](https://github.com/protorians/raiton/commit/af88e341ba8c695b3a9817d450845e25bb004b9e))
9
+ * remove unused SDK modules, rework artifacts handling, and enhance parametrable decorators ([ddc6d35](https://github.com/protorians/raiton/commit/ddc6d35cd070e25f0da19185e776feead0843ad0))
10
+ * remove unused types, streamline imports, and enhance type definitions with Lifecycle interfaces ([5ef2e46](https://github.com/protorians/raiton/commit/5ef2e46ecec191c1e51d79c997ebe2f8244dc7fc))
11
+
12
+
13
+ ### Features
14
+
15
+ * add `class-validator` dependency and update README to remove Deno beta references ([a616086](https://github.com/protorians/raiton/commit/a616086652d437d0763d7c8313150c56ee4d11d9))
16
+ * add basic `deno.json` with imports and tasks configuration ([e31b024](https://github.com/protorians/raiton/commit/e31b02414bc4378a7125678fe88268f57367c646))
17
+ * add global runtime detection constants for Bun and Deno in `constants.ts` ([c63ac8e](https://github.com/protorians/raiton/commit/c63ac8e36089e58856c180706c89b51390ae850f))
18
+ * 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))
19
+
20
+ # [1.0.0-alpha.2](https://github.com/protorians/raiton/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2026-02-16)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * `CliTools`: add support for Deno runtime, improve runtime detection, and adjust spawn logic for `.ts` file handling ([71c506a](https://github.com/protorians/raiton/commit/71c506afcbb4ec3acffec8d4b36934afa8d0b6b3))
26
+
1
27
  # 1.0.0-alpha.1 (2026-02-16)
2
28
 
3
29
 
package/README.md CHANGED
@@ -1,22 +1,98 @@
1
1
  # Protorians Raiton
2
- Protorians Raiton development kit for backend microservice
3
2
 
4
- ## Bun Optimization
5
- Raiton is optimized for Bun. It automatically detects the Bun runtime and uses `Bun.serve` for maximum performance.
3
+ [![Version](https://img.shields.io/npm/v/raiton.svg)](https://www.npmjs.com/package/raiton)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
5
 
7
- ### Usage with Bun
8
- To run your project with Bun:
6
+ **Protorians Raiton** est un kit de développement (SDK) backend moderne et performant,
7
+ conçu pour construire des microservices TypeScript. Optimisé pour **Bun**,
8
+ il offre également un support complet pour **Node.js** et **Deno**.
9
+
10
+ ## Caractéristiques
11
+
12
+ - **Optimisé pour Bun** : Utilise `Bun.serve` nativement pour des performances maximales.
13
+ - **Multi-Runtime** : Compatible avec Bun (recommandé), Node.js et les environnements Web.
14
+ - **Architecture Décorative** : Utilise les décorateurs TypeScript pour définir contrôleurs, routes et injections.
15
+ - **Modulaire** : Système de plugins et de middlewares flexible.
16
+ - **CLI Puissant** : Outils intégrés pour le développement, le build et le déploiement.
17
+
18
+ ## Installation
9
19
 
10
20
  ```bash
11
- bun run source/bin/index.ts
21
+ bun add raiton reflect-metadata
22
+ # ou
23
+ npm install raiton reflect-metadata
24
+ ```
25
+
26
+ > **Note :** Raiton nécessite `reflect-metadata` pour fonctionner avec les décorateurs. Importez-le au début de votre point d'entrée.
27
+
28
+ ## Démarrage Rapide
29
+
30
+ ### 1. Créez un contrôleur (`source/controllers/hello.controller.ts`)
31
+
32
+ ```typescript
33
+ import { Controllable, Get, Param } from "raiton/sdk";
34
+
35
+ @Controllable('/hello')
36
+ export class HelloController {
37
+ @Get('/')
38
+ index() {
39
+ return { message: "Bonjour de Raiton !" };
40
+ }
41
+
42
+ @Get('/:name')
43
+ greet(@Param("name") name?: string) {
44
+ return { message: `Bonjour, ${name} !` };
45
+ }
46
+ }
47
+ ```
48
+
49
+ ### 2. Configurez votre application (`source/main.ts`)
50
+
51
+ ```typescript
52
+ import "reflect-metadata";
53
+ import {ThreadInterface} from "raiton/types";
54
+ import {Application} from "raiton/core";
55
+
56
+ export default async function (thread: ThreadInterface) {
57
+ const app = new Application({
58
+ port: 3000,
59
+ prefix: '/api'
60
+ });
61
+
62
+ // Enregistrez vos plugins, middlewares et contrôleurs ici
63
+ // ...
64
+
65
+ // Lier son application au thread
66
+ return await thread.setup({application: app}).run()
67
+ }
12
68
  ```
13
69
 
14
- Or using the provided scripts:
70
+ ## Utilisation du CLI
71
+
72
+ Raiton est livré avec une interface en ligne de commande pour faciliter le développement.
15
73
 
16
74
  ```bash
17
- # Development mode with hot reload
18
- bun run bun:dev
75
+ # Lancer en mode développement (avec hot reload)
76
+ bun raiton develop
77
+
78
+ # Builder le projet
79
+ bun raiton build
19
80
 
20
- # Start built project
21
- bun run bun:start
81
+ # Démarrer le projet buildé
82
+ bun raiton start
22
83
  ```
84
+
85
+ ## 🛠 Runtimes supportés
86
+
87
+ Raiton détecte automatiquement l'environnement d'exécution et adapte son serveur :
88
+
89
+ - **Bun** : Utilisation de `Bun.serve`.
90
+ - **Node.js** : Adaptateur pour serveurs HTTP Node.
91
+ - **Web** : Compatible avec les environnements basés sur les standards Web (Fetch API).
92
+
93
+ ## 📄 Licence
94
+
95
+ Ce projet est sous licence MIT. Voir le fichier [LICENSE](LICENSE) pour plus de détails.
96
+
97
+ ---
98
+ Développé avec ❤️ par **Y. Yannick GOBOU**