@hedystia/types 1.10.0 → 1.10.1

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 (2) hide show
  1. package/package.json +27 -16
  2. package/readme.md +172 -0
package/package.json CHANGED
@@ -1,23 +1,11 @@
1
1
  {
2
2
  "name": "@hedystia/types",
3
- "version": "1.10.0",
4
- "description": "Type definition generator for multiple frameworks",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "exports": {
8
- ".": "./dist/index.js"
9
- },
10
- "private": false,
11
- "license": "MIT",
12
- "scripts": {
13
- "build": "tsup",
14
- "dev": "bun --watch --no-clear-screen run src/index.ts"
15
- },
3
+ "version": "1.10.1",
4
+ "description": "Next-gen TypeScript framework for building type-safe APIs at lightspeed",
16
5
  "dependencies": {
17
- "@hedystia/validations": "^1.10.0"
6
+ "@hedystia/validations": "^1.10.1"
18
7
  },
19
8
  "devDependencies": {
20
- "@standard-schema/spec": "^1.0.0",
21
9
  "@types/bun": "^1.3.3",
22
10
  "tsup": "^8.3.5"
23
11
  },
@@ -28,8 +16,28 @@
28
16
  "peerDependenciesMeta": {
29
17
  "typescript": {
30
18
  "optional": true
19
+ },
20
+ "@hedystia/validations": {
21
+ "optional": false
31
22
  }
32
23
  },
24
+ "private": false,
25
+ "keywords": [
26
+ "hedystia",
27
+ "framework",
28
+ "typescript",
29
+ "api",
30
+ "type-safe",
31
+ "bun",
32
+ "server",
33
+ "backend",
34
+ "web"
35
+ ],
36
+ "license": "MIT",
37
+ "scripts": {
38
+ "build": "tsup",
39
+ "dev": "bun --watch --no-clear-screen run src/index.ts"
40
+ },
33
41
  "repository": {
34
42
  "type": "git",
35
43
  "url": "https://github.com/Hedystia/Framework"
@@ -39,5 +47,8 @@
39
47
  "email": "contact@zastinian.com",
40
48
  "url": "https://github.com/Zastinian"
41
49
  },
42
- "type": "commonjs"
50
+ "type": "commonjs",
51
+ "types": "./dist/index.d.ts",
52
+ "main": "./dist/index.js",
53
+ "module": "./dist/index.js"
43
54
  }
package/readme.md ADDED
@@ -0,0 +1,172 @@
1
+ <div align="center">
2
+ <p>
3
+ <strong>🚀 Hedystia Framework</strong>
4
+ </p>
5
+
6
+ <p>
7
+ <strong>Next-gen TypeScript framework for building type-safe APIs at lightspeed! ⚡</strong>
8
+ </p>
9
+
10
+ <p>
11
+ <a href="https://docs.hedystia.com"><img src="https://img.shields.io/badge/Docs-blue?style=flat-square" alt="Documentation"></a>
12
+ <a href="https://www.npmjs.com/package/hedystia"><img src="https://img.shields.io/npm/v/hedystia.svg?style=flat-square" alt="npm version"></a>
13
+ <a href="https://www.npmjs.com/package/hedystia"><img src="https://img.shields.io/npm/dm/hedystia.svg?style=flat-square" alt="npm downloads"></a>
14
+ <a href="LICENSE"><img src="https://img.shields.io/github/license/Hedystia/Framework.svg?style=flat-square" alt="license"></a>
15
+ <img src="https://img.shields.io/badge/Bun-powered-FFD43B?style=flat-square&logo=bun" alt="Bun powered">
16
+ </p>
17
+ </div>
18
+
19
+ ## 🌟 Superpowers
20
+
21
+ - 🌐 **Multi-runtime support** - Bun (default), Deno, Node.js, Vercel, Cloudflare Workers, Fastly Compute, Lambda, etc.
22
+ - 🔒 **End-to-end type safety** - From params to response, full TypeScript integration
23
+ - ⚡ **Bun-native performance** - Built for Bun runtime with native validation
24
+ - 🧩 **Client integration** - Auto-generated type-safe HTTP client
25
+ - 🛡️ **Validation built-in** - Zod integration for runtime safety
26
+ - 🔌 **Extensible architecture** - Middleware, hooks and macros system
27
+ - 📝 **Standard Schema** - Compatibility with the standard schema so you can use it with Zod, Arktype, etc.
28
+
29
+ ## 🚀 Launch in 30 Seconds
30
+
31
+ 1. Install with Bun:
32
+ ```bash
33
+ bun add hedystia
34
+ ```
35
+
36
+ 2. Create your first API:
37
+ ```typescript
38
+ import { Hedystia, h } from "hedystia";
39
+
40
+ const app = new Hedystia()
41
+ .get("/hello/:name", (ctx) => `Hello ${ctx.params.name}!`, {
42
+ params: h.object({ name: h.string() }),
43
+ response: h.string()
44
+ })
45
+ .listen(3000);
46
+ ```
47
+
48
+ 3. Generate client and consume API:
49
+ ```typescript
50
+ import { createClient } from "@hedystia/client";
51
+
52
+ const client = createClient<typeof app>("http://localhost:3000");
53
+
54
+ // Fully typed request!
55
+ const { data } = await client.hello.name("World").get();
56
+ console.log(data); // "Hello World!"
57
+ ```
58
+
59
+ ## 💡 Why Developers Love Hedystia
60
+
61
+ ### 🔄 Full-stack Type Safety
62
+ ```typescript
63
+ // Server-side validation
64
+ .post("/users", (ctx) => {...}, {
65
+ body: h.object({
66
+ email: h.email(),
67
+ age: h.number()
68
+ })
69
+ })
70
+
71
+ // Client-side types
72
+ await client.users.post({
73
+ body: {
74
+ email: "user@example.com", // Autocompletes!
75
+ age: 25 // Type-checked
76
+ }
77
+ });
78
+ ```
79
+
80
+ ### 📖 Swagger Integration
81
+
82
+ ```typescript
83
+ import { swagger } from "@hedystia/swagger";
84
+
85
+ const swaggerPlugin = swagger({
86
+ title: "My API",
87
+ description: "An example API with Swagger",
88
+ version: "1.0.0",
89
+ tags: [
90
+ { name: "users", description: "User operations" },
91
+ ],
92
+ });
93
+
94
+ app.use("/swagger", swaggerPlugin.plugin(app));
95
+
96
+ app.listen(3000);
97
+ ```
98
+
99
+ ### ⚡ Performance First
100
+ - Bun runtime optimized
101
+ - Faster by default
102
+ - Own type validation system
103
+ - Faster than Express
104
+ - Built-in response compression
105
+
106
+ ### 🧩 Modern Feature Set
107
+ ```typescript
108
+ // File uploads
109
+ .post("/upload", async (ctx) => {
110
+ const formData = await ctx.body; // FormData type
111
+ })
112
+
113
+ // Binary responses
114
+ .get("/pdf", () => new Blob([...]), {
115
+ response: h.instanceof(Blob)
116
+ })
117
+
118
+ // Nested routing
119
+ .group("/api/v1", (v1) => v1
120
+ .group("/users", (users) => users
121
+ .get("/:id", ...)
122
+ )
123
+ )
124
+ ```
125
+
126
+ ## 🛠️ Development Roadmap
127
+
128
+ ### Core Features
129
+ - ✅ HTTP Methods: GET, POST, PUT, PATCH, DELETE
130
+ - ✅ Response Types: JSON, Text, FormData, Blob, ArrayBuffer
131
+ - ✅ Router Groups & Middleware
132
+ - ✅ Type-safe Client Generation
133
+ - ✅ WebSocket Support
134
+ - ✅ Adapter System to work with other frameworks
135
+
136
+ ### Advanced Capabilities
137
+ - ✅ Standard Schema Compatibility
138
+ - ✅ Hooks System (onRequest, onError, etc)
139
+ - ✅ Macro System for Auth/Rate Limiting
140
+ - ✅ OpenAPI - Swagger Integration
141
+
142
+ ## 💼 Production Ready
143
+ ```typescript
144
+ // Error handling
145
+ .onError((err, ctx) => {
146
+ ctx.set.status(500);
147
+ return {
148
+ error: err.message
149
+ };
150
+ })
151
+
152
+ // Rate limiting macro
153
+ .macro({
154
+ rateLimit: () => ({
155
+ resolve: async (ctx) => {
156
+ // Implement your logic
157
+ }
158
+ })
159
+ })
160
+ ```
161
+
162
+ ## 📜 License
163
+ MIT License © 2026 Hedystia
164
+
165
+ ## 📖 Documentation
166
+ - [Full Documentation](https://docs.hedystia.com)
167
+ - [Getting Started Guide](https://docs.hedystia.com/framework/getting-started)
168
+ - [API Reference](https://docs.hedystia.com/framework/overview)
169
+
170
+ ## 🗣️ Community
171
+ - [GitHub Issues](https://github.com/Hedystia/Framework/issues)
172
+ - [Discord Server](https://hedystia.com/support)