@xeno-js/core 3.0.3 → 3.0.5
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 +14 -2
- package/dist/index.cjs +22 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
## What is Xeno?
|
|
23
|
+
## What is Xeno.JS?
|
|
24
24
|
|
|
25
25
|
Xeno.JS is a TypeScript application architecture framework for Node.js.
|
|
26
26
|
|
|
@@ -42,7 +42,7 @@ independent from the transport that delivers a request.
|
|
|
42
42
|
|
|
43
43
|
---
|
|
44
44
|
|
|
45
|
-
## Why Xeno?
|
|
45
|
+
## Why Xeno.JS?
|
|
46
46
|
|
|
47
47
|
### 01 — Explicit Architecture
|
|
48
48
|
|
|
@@ -274,6 +274,7 @@ const app = new AppBuilder<AppRegistry>()
|
|
|
274
274
|
export const container = await app.build()
|
|
275
275
|
|
|
276
276
|
// src/main.ts
|
|
277
|
+
import { TOKENS } from '@xeno-js/core'
|
|
277
278
|
import { container } from './bootstrap'
|
|
278
279
|
|
|
279
280
|
async function Main(args: string[]) {
|
|
@@ -399,6 +400,17 @@ for the use case.
|
|
|
399
400
|
|
|
400
401
|
---
|
|
401
402
|
|
|
403
|
+
### One Application. Multiple Entry Points
|
|
404
|
+
|
|
405
|
+
Build your application once and expose it through different entry points. With
|
|
406
|
+
Xeno.JS, CLI commands and HTTP APIs can share the same application core, keeping
|
|
407
|
+
business logic independent from the transport layer.
|
|
408
|
+
|
|
409
|
+
Adding Fastify does not require rewriting your use cases. Changing how your
|
|
410
|
+
application is exposed should not force changes to what your application does.
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
402
414
|
## CQRS & Pipelines
|
|
403
415
|
|
|
404
416
|
Cross-cutting behavior can be composed around commands and queries:
|
package/dist/index.cjs
CHANGED
|
@@ -5164,10 +5164,28 @@ var AppBuilder = class {
|
|
|
5164
5164
|
* @since 2025-09-30
|
|
5165
5165
|
* @link https://github.com/xeno-js/xeno-js
|
|
5166
5166
|
*/
|
|
5167
|
-
|
|
5168
|
-
if (import_shared74.Guards.isDefined(this._buildPromise))
|
|
5169
|
-
|
|
5170
|
-
|
|
5167
|
+
build() {
|
|
5168
|
+
if (import_shared74.Guards.isDefined(this._buildPromise)) {
|
|
5169
|
+
return this._buildPromise;
|
|
5170
|
+
}
|
|
5171
|
+
const attempt = this._executeBuild();
|
|
5172
|
+
this._buildPromise = attempt;
|
|
5173
|
+
void attempt.then(
|
|
5174
|
+
() => {
|
|
5175
|
+
},
|
|
5176
|
+
async () => {
|
|
5177
|
+
if (this._buildPromise === attempt) {
|
|
5178
|
+
this._buildPromise = null;
|
|
5179
|
+
await this._resetContainer();
|
|
5180
|
+
}
|
|
5181
|
+
}
|
|
5182
|
+
);
|
|
5183
|
+
return attempt;
|
|
5184
|
+
}
|
|
5185
|
+
async _resetContainer() {
|
|
5186
|
+
await this._container.dispose();
|
|
5187
|
+
this._container = new ServiceContainer();
|
|
5188
|
+
this._container.addSingleton(import_shared74.TOKENS.CONFIGURATION_SERVICE, () => this._configuration);
|
|
5171
5189
|
}
|
|
5172
5190
|
/**
|
|
5173
5191
|
* @description Executes the build process by initializing all registered modules in the container.
|