@xeno-js/core 0.1.13 → 1.1.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.
- package/README.md +20 -21
- package/dist/index.cjs +499 -408
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -11
- package/dist/index.d.ts +24 -11
- package/dist/index.js +358 -278
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="logo/logo.png" alt="Xeno Logo" width="140" />
|
|
2
|
+
<img src="logo/logo.png" alt="Xeno.JS Logo" width="140" />
|
|
3
3
|
|
|
4
4
|
<h1>Xeno.JS</h1>
|
|
5
5
|
<p><strong>The application architecture framework for TypeScript.</strong></p>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
## What is Xeno?
|
|
21
21
|
|
|
22
|
-
Xeno is a TypeScript application architecture framework for Node.js.
|
|
22
|
+
Xeno.JS is a TypeScript application architecture framework for Node.js.
|
|
23
23
|
|
|
24
24
|
It provides explicit building blocks for applications organized around:
|
|
25
25
|
|
|
@@ -34,7 +34,7 @@ It provides explicit building blocks for applications organized around:
|
|
|
34
34
|
|
|
35
35
|
The goal is simple: **make application architecture explicit in code.**
|
|
36
36
|
|
|
37
|
-
Xeno is not tied to a specific HTTP server. Your application layer can remain
|
|
37
|
+
Xeno.JS is not tied to a specific HTTP server. Your application layer can remain
|
|
38
38
|
independent from the transport that delivers a request.
|
|
39
39
|
|
|
40
40
|
---
|
|
@@ -45,7 +45,7 @@ independent from the transport that delivers a request.
|
|
|
45
45
|
|
|
46
46
|
**Your dependency graph is code.**
|
|
47
47
|
|
|
48
|
-
Xeno does not require decorators, runtime scanning, or implicit dependency
|
|
48
|
+
Xeno.JS does not require decorators, runtime scanning, or implicit dependency
|
|
49
49
|
discovery. Services are registered explicitly, and their lifetimes are visible
|
|
50
50
|
at the composition root.
|
|
51
51
|
|
|
@@ -65,9 +65,9 @@ reason about.
|
|
|
65
65
|
|
|
66
66
|
Business logic should not belong to your HTTP framework.
|
|
67
67
|
|
|
68
|
-
Xeno keeps application concerns separate from delivery mechanisms, allowing
|
|
69
|
-
same application architecture to be hosted behind transports such as
|
|
70
|
-
Hono, Express, or other adapters.
|
|
68
|
+
Xeno.JS keeps application concerns separate from delivery mechanisms, allowing
|
|
69
|
+
the same application architecture to be hosted behind transports such as
|
|
70
|
+
Fastify, Hono, Express, or other adapters.
|
|
71
71
|
|
|
72
72
|
```text
|
|
73
73
|
HTTP / CLI / Worker / Lambda
|
|
@@ -104,7 +104,7 @@ This keeps cross-cutting concerns out of individual handlers.
|
|
|
104
104
|
|
|
105
105
|
### 04 — Explicit Lifetimes and Request Boundaries
|
|
106
106
|
|
|
107
|
-
Xeno distinguishes service lifetimes such as singleton, scoped, and transient
|
|
107
|
+
Xeno.JS distinguishes service lifetimes such as singleton, scoped, and transient
|
|
108
108
|
services.
|
|
109
109
|
|
|
110
110
|
Request-scoped dependencies are resolved inside an explicit application scope,
|
|
@@ -127,7 +127,7 @@ infrastructure.
|
|
|
127
127
|
|
|
128
128
|
## Architecture
|
|
129
129
|
|
|
130
|
-
A typical Xeno application can be organized like this:
|
|
130
|
+
A typical Xeno.JS application can be organized like this:
|
|
131
131
|
|
|
132
132
|
```text
|
|
133
133
|
+------------------------------------------+
|
|
@@ -181,7 +181,7 @@ Infrastructure capabilities can be enabled only when they are needed.
|
|
|
181
181
|
npm install @xeno-js/core
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
Install only the integrations your application uses. Xeno exposes optional
|
|
184
|
+
Install only the integrations your application uses. Xeno.JS exposes optional
|
|
185
185
|
infrastructure dependencies for capabilities such as databases, Redis, logging,
|
|
186
186
|
resilience, and authentication.
|
|
187
187
|
|
|
@@ -201,8 +201,7 @@ The composition root is explicit:
|
|
|
201
201
|
// src/bootstrap.ts
|
|
202
202
|
import { AppBuilder } from '@xeno-js/core'
|
|
203
203
|
|
|
204
|
-
const app = new AppBuilder()
|
|
205
|
-
.addServices((services) => {
|
|
204
|
+
const app = new AppBuilder().addServices((services) => {
|
|
206
205
|
services.addScoped('USER_REPOSITORY', (container) => {
|
|
207
206
|
return new UserRepository(container.resolve('USER_DATA_SOURCE'))
|
|
208
207
|
})
|
|
@@ -302,7 +301,7 @@ application.
|
|
|
302
301
|
|
|
303
302
|
## Infrastructure & Integrations
|
|
304
303
|
|
|
305
|
-
Xeno Core can be composed with infrastructure such as:
|
|
304
|
+
Xeno.JS Core can be composed with infrastructure such as:
|
|
306
305
|
|
|
307
306
|
- **Database:** Drizzle ORM, PostgreSQL, LibSQL
|
|
308
307
|
- **Cache / distributed coordination:** Redis
|
|
@@ -319,7 +318,7 @@ architecture.
|
|
|
319
318
|
|
|
320
319
|
## CLI
|
|
321
320
|
|
|
322
|
-
Use the official CLI to scaffold a Xeno application:
|
|
321
|
+
Use the official CLI to scaffold a Xeno.JS application:
|
|
323
322
|
|
|
324
323
|
```bash
|
|
325
324
|
npm install @xeno-js/cli
|
|
@@ -351,7 +350,7 @@ Recommended starting points:
|
|
|
351
350
|
|
|
352
351
|
## Ecosystem
|
|
353
352
|
|
|
354
|
-
Xeno is designed as an ecosystem rather than a single monolithic package:
|
|
353
|
+
Xeno.JS is designed as an ecosystem rather than a single monolithic package:
|
|
355
354
|
|
|
356
355
|
| Package | Role |
|
|
357
356
|
| ----------------- | ----------------------------------------- |
|
|
@@ -362,15 +361,15 @@ Xeno is designed as an ecosystem rather than a single monolithic package:
|
|
|
362
361
|
|
|
363
362
|
---
|
|
364
363
|
|
|
365
|
-
## What Xeno Is Not
|
|
364
|
+
## What Xeno.JS Is Not
|
|
366
365
|
|
|
367
|
-
Xeno is not primarily an HTTP framework.
|
|
366
|
+
Xeno.JS is not primarily an HTTP framework.
|
|
368
367
|
|
|
369
368
|
If you are looking for a framework centered on routing, controllers, middleware,
|
|
370
369
|
and server lifecycle, there are excellent options already available in the
|
|
371
370
|
Node.js ecosystem.
|
|
372
371
|
|
|
373
|
-
Xeno focuses on the layer above transport:
|
|
372
|
+
Xeno.JS focuses on the layer above transport:
|
|
374
373
|
|
|
375
374
|
> **How should a TypeScript application be structured so that its business
|
|
376
375
|
> logic, dependencies, and infrastructure boundaries remain explicit as the
|
|
@@ -380,7 +379,7 @@ Xeno focuses on the layer above transport:
|
|
|
380
379
|
|
|
381
380
|
## Production Considerations
|
|
382
381
|
|
|
383
|
-
Xeno provides architectural primitives, but application correctness still
|
|
382
|
+
Xeno.JS provides architectural primitives, but application correctness still
|
|
384
383
|
depends on how those primitives are composed.
|
|
385
384
|
|
|
386
385
|
Before deploying an application, test the behaviors that matter to your
|
|
@@ -443,8 +442,8 @@ npm run check
|
|
|
443
442
|
|
|
444
443
|
## Support
|
|
445
444
|
|
|
446
|
-
If Xeno is useful to you, you can support the project through the community
|
|
447
|
-
sponsorship channels documented on the website:
|
|
445
|
+
If Xeno.JS is useful to you, you can support the project through the community
|
|
446
|
+
and sponsorship channels documented on the website:
|
|
448
447
|
|
|
449
448
|
**[Support Xeno](https://www.xeno-js.it/docs/support-us)**
|
|
450
449
|
|