@ahmadjavaiddev/aura 1.0.2 → 1.0.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 (3) hide show
  1. package/README.md +26 -7
  2. package/dist/index.js +772 -718
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -29,6 +29,7 @@ npx @ahmadjavaiddev/aura my-new-project
29
29
  | Command | Description |
30
30
  | :--- | :--- |
31
31
  | `aura [name]` | Create a new project in the specified directory |
32
+ | `aura add [feature]` | Inject a new feature (e.g. `redis`, `prisma`) into an existing Aura project |
32
33
  | `-v, --version` | Display current Aura version |
33
34
  | `-h, --help` | Show usage information |
34
35
 
@@ -55,6 +56,21 @@ Aura is modular by design. Select only the components you need for your project:
55
56
  - **Development**: Choice of **Biome** (Ultra-fast) or **ESLint + Prettier**.
56
57
  - **Email**: Integrated **Resend** or traditional **SMTP** (Nodemailer).
57
58
 
59
+ ### Infrastructure
60
+ - **Docker**: Automatically generate a production-ready `Dockerfile` and `docker-compose.yml`.
61
+ - **CI/CD**: Generate GitHub Actions workflows for seamless testing and linting pipelines.
62
+
63
+ ---
64
+
65
+ ## ⚡ Aura Add
66
+
67
+ Scaffolded a barebones project but decided you need Redis later? Use the `aura add` command to intelligently inject features into your existing project—modifying `package.json`, updating environment variables, injecting imports, and setting up initializations automatically using slot markers!
68
+
69
+ ```bash
70
+ aura add redis
71
+ aura add prisma
72
+ ```
73
+
58
74
  ---
59
75
 
60
76
  ## The Aura Blueprint
@@ -80,22 +96,25 @@ my-new-project/
80
96
 
81
97
  ## Defining Routes
82
98
 
83
- Aura makes route definition declarative and type-safe using the `defineRoute` utility:
99
+ Aura makes route definition declarative and type-safe using the `defineRoute` utility. Every route automatically returns a heavily standardized `ApiResponse<T>`:
84
100
 
85
101
  ```typescript
86
- import { defineRoute } from "../base";
102
+ import { defineRoute } from "../base/define-route";
87
103
  import { z } from "zod";
88
104
 
89
- export default defineRoute({
90
- method: "POST",
105
+ export const createUser = defineRoute({
106
+ method: "post",
91
107
  path: "/users",
92
- schema: {
108
+ input: {
93
109
  body: z.object({ name: z.string(), email: z.string().email() })
94
110
  },
95
- handler: async ({ req, res, body }) => {
111
+ output: z.object({ id: z.string(), name: z.string() }),
112
+ handler: async ({ body }) => {
96
113
  // Body is fully typed!
97
114
  const { name, email } = body;
98
- res.status(201).json({ success: true, user: { name, email } });
115
+ // Return the output according to the schema - Aura automatically wraps it in a standard response:
116
+ // { success: true, data: { ... }, metadata: { timestamp: "...", path: "/users" } }
117
+ return { id: "123", name };
99
118
  },
100
119
  });
101
120
  ```