@veloxts/core 0.3.3 → 0.3.4
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 +697 -16
- package/dist/app.d.ts +67 -10
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +79 -12
- package/dist/app.js.map +1 -1
- package/dist/di/container.d.ts +406 -0
- package/dist/di/container.d.ts.map +1 -0
- package/dist/di/container.js +693 -0
- package/dist/di/container.js.map +1 -0
- package/dist/di/decorators.d.ts +221 -0
- package/dist/di/decorators.d.ts.map +1 -0
- package/dist/di/decorators.js +297 -0
- package/dist/di/decorators.js.map +1 -0
- package/dist/di/index.d.ts +65 -0
- package/dist/di/index.d.ts.map +1 -0
- package/dist/di/index.js +73 -0
- package/dist/di/index.js.map +1 -0
- package/dist/di/providers.d.ts +357 -0
- package/dist/di/providers.d.ts.map +1 -0
- package/dist/di/providers.js +380 -0
- package/dist/di/providers.js.map +1 -0
- package/dist/di/scope.d.ts +209 -0
- package/dist/di/scope.d.ts.map +1 -0
- package/dist/di/scope.js +262 -0
- package/dist/di/scope.js.map +1 -0
- package/dist/di/tokens.d.ts +227 -0
- package/dist/di/tokens.d.ts.map +1 -0
- package/dist/di/tokens.js +192 -0
- package/dist/di/tokens.js.map +1 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @veloxts/core - Foundation package for the VeloxTS framework
|
|
3
3
|
*
|
|
4
|
-
* Provides the core Fastify wrapper, plugin system,
|
|
5
|
-
* that all other framework
|
|
4
|
+
* Provides the core Fastify wrapper, plugin system, base context,
|
|
5
|
+
* and dependency injection container that all other framework
|
|
6
|
+
* packages build upon.
|
|
6
7
|
*
|
|
7
8
|
* @example
|
|
8
9
|
* ```typescript
|
|
9
|
-
* import {
|
|
10
|
+
* import { veloxApp, definePlugin, Container, Injectable } from '@veloxts/core';
|
|
10
11
|
*
|
|
11
|
-
* const app = await
|
|
12
|
+
* const app = await veloxApp({ port: 3210 });
|
|
12
13
|
* await app.start();
|
|
13
14
|
* ```
|
|
14
15
|
*
|
|
15
16
|
* @module @veloxts/core
|
|
16
17
|
*/
|
|
18
|
+
import 'reflect-metadata';
|
|
17
19
|
/** VeloxTS framework version */
|
|
18
20
|
export declare const VELOX_VERSION: string;
|
|
19
|
-
export { createVeloxApp, VeloxApp } from './app.js';
|
|
21
|
+
export { veloxApp, createVeloxApp, VeloxApp } from './app.js';
|
|
20
22
|
export type { BaseContext } from './context.js';
|
|
21
23
|
export { createContext, isContext } from './context.js';
|
|
22
24
|
export type { ErrorResponse, GenericErrorResponse, NotFoundErrorResponse, ValidationErrorResponse, VeloxCoreErrorCode, VeloxErrorCode, VeloxErrorCodeRegistry, } from './errors.js';
|
|
@@ -26,4 +28,6 @@ export { definePlugin, isVeloxPlugin, validatePluginMetadata } from './plugin.js
|
|
|
26
28
|
export type { AsyncHandler, JsonArray, JsonObject, JsonPrimitive, JsonValue, LifecycleHook, ShutdownHandler, SyncHandler, } from './types.js';
|
|
27
29
|
export type { FrozenVeloxAppConfig, ValidHost, ValidPort, VeloxAppConfig, VeloxFastifyOptions, } from './utils/config.js';
|
|
28
30
|
export { isValidHost, isValidPort } from './utils/config.js';
|
|
31
|
+
export { Container, container, createContainer, Injectable, Inject, Optional, isInjectable, getInjectableScope, getConstructorTokens, getExplicitInjectTokens, getOptionalParams, makeInjectable, setInjectTokens, singleton, scoped, transient, value, factory, asClass, asFactory, asValue, asExisting, isClassProvider, isFactoryProvider, isValueProvider, isExistingProvider, validateProvider, Scope, ScopeManager, token, createStringToken, createSymbolToken, getTokenName, isClassToken, isStringToken, isSymbolToken, validateToken, } from './di/index.js';
|
|
32
|
+
export type { ContainerOptions, ResolutionContext, InjectableOptions, Provider, ClassProvider, FactoryProvider, ValueProvider, ExistingProvider, InjectionToken, ClassConstructor, AbstractClass, StringToken, SymbolToken, TokenType, } from './di/index.js';
|
|
29
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,kBAAkB,CAAC;AAQ1B,gCAAgC;AAChC,eAAO,MAAM,aAAa,EAAE,MAA+C,CAAC;AAG5E,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9D,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAExD,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAElG,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAElF,YAAY,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,eAAe,EACf,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,cAAc,EACd,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,EAEL,SAAS,EACT,SAAS,EACT,eAAe,EAEf,UAAU,EACV,MAAM,EACN,QAAQ,EAER,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAEf,SAAS,EACT,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAEP,OAAO,EACP,SAAS,EACT,OAAO,EACP,UAAU,EAEV,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAEhB,KAAK,EACL,YAAY,EAEZ,KAAK,EAEL,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,YAAY,EAEV,gBAAgB,EAChB,iBAAiB,EAEjB,iBAAiB,EAEjB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,aAAa,EACb,gBAAgB,EAEhB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @veloxts/core - Foundation package for the VeloxTS framework
|
|
3
3
|
*
|
|
4
|
-
* Provides the core Fastify wrapper, plugin system,
|
|
5
|
-
* that all other framework
|
|
4
|
+
* Provides the core Fastify wrapper, plugin system, base context,
|
|
5
|
+
* and dependency injection container that all other framework
|
|
6
|
+
* packages build upon.
|
|
6
7
|
*
|
|
7
8
|
* @example
|
|
8
9
|
* ```typescript
|
|
9
|
-
* import {
|
|
10
|
+
* import { veloxApp, definePlugin, Container, Injectable } from '@veloxts/core';
|
|
10
11
|
*
|
|
11
|
-
* const app = await
|
|
12
|
+
* const app = await veloxApp({ port: 3210 });
|
|
12
13
|
* await app.start();
|
|
13
14
|
* ```
|
|
14
15
|
*
|
|
15
16
|
* @module @veloxts/core
|
|
16
17
|
*/
|
|
18
|
+
// Import reflect-metadata for decorator support
|
|
19
|
+
import 'reflect-metadata';
|
|
17
20
|
import { createRequire } from 'node:module';
|
|
18
21
|
// Read version from package.json dynamically
|
|
19
22
|
const require = createRequire(import.meta.url);
|
|
@@ -21,10 +24,30 @@ const packageJson = require('../package.json');
|
|
|
21
24
|
/** VeloxTS framework version */
|
|
22
25
|
export const VELOX_VERSION = packageJson.version ?? '0.0.0-unknown';
|
|
23
26
|
// App creation and types
|
|
24
|
-
export { createVeloxApp, VeloxApp } from './app.js';
|
|
27
|
+
export { veloxApp, createVeloxApp, VeloxApp } from './app.js';
|
|
25
28
|
export { createContext, isContext } from './context.js';
|
|
26
29
|
export { assertNever, ConfigurationError, isConfigurationError, isNotFoundError, isNotFoundErrorResponse, isValidationError, isValidationErrorResponse, isVeloxError, NotFoundError, ValidationError, VeloxError, } from './errors.js';
|
|
27
30
|
// Plugin system
|
|
28
31
|
export { definePlugin, isVeloxPlugin, validatePluginMetadata } from './plugin.js';
|
|
29
32
|
export { isValidHost, isValidPort } from './utils/config.js';
|
|
33
|
+
// Dependency Injection
|
|
34
|
+
export {
|
|
35
|
+
// Container
|
|
36
|
+
Container, container, createContainer,
|
|
37
|
+
// Decorators
|
|
38
|
+
Injectable, Inject, Optional,
|
|
39
|
+
// Decorator utilities
|
|
40
|
+
isInjectable, getInjectableScope, getConstructorTokens, getExplicitInjectTokens, getOptionalParams, makeInjectable, setInjectTokens,
|
|
41
|
+
// Provider helpers (succinct API)
|
|
42
|
+
singleton, scoped, transient, value, factory,
|
|
43
|
+
// Provider helpers (legacy)
|
|
44
|
+
asClass, asFactory, asValue, asExisting,
|
|
45
|
+
// Provider type guards
|
|
46
|
+
isClassProvider, isFactoryProvider, isValueProvider, isExistingProvider, validateProvider,
|
|
47
|
+
// Scope
|
|
48
|
+
Scope, ScopeManager,
|
|
49
|
+
// Tokens (succinct API)
|
|
50
|
+
token,
|
|
51
|
+
// Tokens (legacy - deprecated)
|
|
52
|
+
createStringToken, createSymbolToken, getTokenName, isClassToken, isStringToken, isSymbolToken, validateToken, } from './di/index.js';
|
|
30
53
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,gDAAgD;AAChD,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,6CAA6C;AAC7C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAEtE,gCAAgC;AAChC,MAAM,CAAC,MAAM,aAAa,GAAW,WAAW,CAAC,OAAO,IAAI,eAAe,CAAC;AAE5E,yBAAyB;AACzB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWxD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAoBlF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D,uBAAuB;AACvB,OAAO;AACL,YAAY;AACZ,SAAS,EACT,SAAS,EACT,eAAe;AACf,aAAa;AACb,UAAU,EACV,MAAM,EACN,QAAQ;AACR,sBAAsB;AACtB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,eAAe;AACf,kCAAkC;AAClC,SAAS,EACT,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO;AACP,4BAA4B;AAC5B,OAAO,EACP,SAAS,EACT,OAAO,EACP,UAAU;AACV,uBAAuB;AACvB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,gBAAgB;AAChB,QAAQ;AACR,KAAK,EACL,YAAY;AACZ,wBAAwB;AACxB,KAAK;AACL,+BAA+B;AAC/B,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veloxts/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Fastify wrapper, DI container, and plugin system for VeloxTS framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"fastify": "5.6.2",
|
|
20
|
-
"fastify-plugin": "5.1.0"
|
|
20
|
+
"fastify-plugin": "5.1.0",
|
|
21
|
+
"reflect-metadata": "0.2.2"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@types/node": "24.10.1",
|