moost 0.6.39 → 0.6.41
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/dist/index.cjs +12 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +8 -12
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -48,7 +48,7 @@ let stamped = false;
|
|
|
48
48
|
if (stamped) return;
|
|
49
49
|
stamped = true;
|
|
50
50
|
stampModuleIdentity({
|
|
51
|
-
version: "0.6.
|
|
51
|
+
version: "0.6.41",
|
|
52
52
|
path: typeof __filename === "string" ? __filename : require("url").pathToFileURL(__filename).href
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -139,19 +139,15 @@ let sourceRefs = [];
|
|
|
139
139
|
/**
|
|
140
140
|
* Scans the registered apps' controllers for a class-scoped `@Provide`
|
|
141
141
|
* carrying `token` and returns the provider controller class names. Both
|
|
142
|
-
* string and symbol keys are checked —
|
|
143
|
-
*
|
|
142
|
+
* string and symbol keys are checked — a class token matches because
|
|
143
|
+
* `@Inject(Class)` and `@Provide(Class)` both key it via infact's `getClassKey`.
|
|
144
144
|
*/ function findTokenProviders(token) {
|
|
145
145
|
const providers = [];
|
|
146
146
|
for (const source of scanLiveSources()) for (const entry of source.getControllersOverview()) if (Reflect.ownKeys(entry.meta?.provide ?? {}).includes(token) && !providers.includes(entry.type.name)) providers.push(entry.type.name);
|
|
147
147
|
return providers;
|
|
148
148
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
if (typeof token === "string") return token;
|
|
152
|
-
const description = token.description ?? token.toString();
|
|
153
|
-
const match = CLASS_SOURCE_RE.exec(description);
|
|
154
|
-
return match ? match[1] : description;
|
|
149
|
+
/** Renders a provide token readably: strings as-is, symbols (class keys carry the class name) by description. */ function stringifyToken(token) {
|
|
150
|
+
return typeof token === "string" ? token : token.description || token.toString();
|
|
155
151
|
}
|
|
156
152
|
/**
|
|
157
153
|
* D4: when an unresolved `@Inject(token)` IS provided somewhere — via a
|
|
@@ -1307,7 +1303,7 @@ var TInterceptorPriority = /* @__PURE__ */ function(TInterceptorPriority) {
|
|
|
1307
1303
|
* (For optional values use with @Optional())
|
|
1308
1304
|
* @param type - string or class constructor
|
|
1309
1305
|
*/ function Inject(type) {
|
|
1310
|
-
const key = typeof type === "string" ? type :
|
|
1306
|
+
const key = typeof type === "string" ? type : (0, _prostojs_infact.getClassKey)(type);
|
|
1311
1307
|
return getMoostMate().decorate("inject", key);
|
|
1312
1308
|
}
|
|
1313
1309
|
/**
|
|
@@ -2671,6 +2667,12 @@ Object.defineProperty(exports, 'eventTypeKey', {
|
|
|
2671
2667
|
return _wooksjs_event_core.eventTypeKey;
|
|
2672
2668
|
}
|
|
2673
2669
|
});
|
|
2670
|
+
Object.defineProperty(exports, 'getClassKey', {
|
|
2671
|
+
enumerable: true,
|
|
2672
|
+
get: function () {
|
|
2673
|
+
return _prostojs_infact.getClassKey;
|
|
2674
|
+
}
|
|
2675
|
+
});
|
|
2674
2676
|
Object.defineProperty(exports, 'getConstructor', {
|
|
2675
2677
|
enumerable: true,
|
|
2676
2678
|
get: function () {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _wooksjs_event_core from '@wooksjs/event-core';
|
|
|
2
2
|
import { EventContext, Logger, Key } from '@wooksjs/event-core';
|
|
3
3
|
export { Cached, ContextInjector, EventContext, EventContextOptions, Key, Logger, cached, createEventContext, current, eventTypeKey, getContextInjector, key, replaceContextInjector, resetContextInjector, run, useLogger } from '@wooksjs/event-core';
|
|
4
4
|
import { TProvideRegistry, TReplaceRegistry, Infact, TProvideFn } from '@prostojs/infact';
|
|
5
|
-
export { TProvideRegistry, createProvideRegistry, createReplaceRegistry } from '@prostojs/infact';
|
|
5
|
+
export { TProvideRegistry, createProvideRegistry, createReplaceRegistry, getClassKey } from '@prostojs/infact';
|
|
6
6
|
import * as _prostojs_mate from '@prostojs/mate';
|
|
7
7
|
import { TMateParamMeta, Mate } from '@prostojs/mate';
|
|
8
8
|
export { Mate, TMateParamMeta, getConstructor, isConstructor } from '@prostojs/mate';
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextInjector, cached, createEventContext, createEventContext as createEventContext$1, current, current as current$1, defineWook, eventTypeKey, getContextInjector, getContextInjector as getContextInjector$1, key, key as key$1, replaceContextInjector, resetContextInjector, run, useLogger, useLogger as useLogger$1, useRouteParams } from "@wooksjs/event-core";
|
|
2
|
-
import { Infact, createProvideRegistry, createProvideRegistry as createProvideRegistry$1, createReplaceRegistry, createReplaceRegistry as createReplaceRegistry$1 } from "@prostojs/infact";
|
|
2
|
+
import { Infact, createProvideRegistry, createProvideRegistry as createProvideRegistry$1, createReplaceRegistry, createReplaceRegistry as createReplaceRegistry$1, getClassKey, getClassKey as getClassKey$1 } from "@prostojs/infact";
|
|
3
3
|
import { Mate, getConstructor, getConstructor as getConstructor$1, isConstructor, isConstructor as isConstructor$1 } from "@prostojs/mate";
|
|
4
4
|
import { ProstoLogger, ProstoLogger as ProstoLogger$1, coloredConsole, createConsoleTransort } from "@prostojs/logger";
|
|
5
5
|
import { Hookable } from "hookable";
|
|
@@ -47,7 +47,7 @@ let stamped = false;
|
|
|
47
47
|
if (stamped) return;
|
|
48
48
|
stamped = true;
|
|
49
49
|
stampModuleIdentity({
|
|
50
|
-
version: "0.6.
|
|
50
|
+
version: "0.6.41",
|
|
51
51
|
path: typeof __filename === "string" ? __filename : import.meta.url
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -138,19 +138,15 @@ let sourceRefs = [];
|
|
|
138
138
|
/**
|
|
139
139
|
* Scans the registered apps' controllers for a class-scoped `@Provide`
|
|
140
140
|
* carrying `token` and returns the provider controller class names. Both
|
|
141
|
-
* string and symbol keys are checked —
|
|
142
|
-
*
|
|
141
|
+
* string and symbol keys are checked — a class token matches because
|
|
142
|
+
* `@Inject(Class)` and `@Provide(Class)` both key it via infact's `getClassKey`.
|
|
143
143
|
*/ function findTokenProviders(token) {
|
|
144
144
|
const providers = [];
|
|
145
145
|
for (const source of scanLiveSources()) for (const entry of source.getControllersOverview()) if (Reflect.ownKeys(entry.meta?.provide ?? {}).includes(token) && !providers.includes(entry.type.name)) providers.push(entry.type.name);
|
|
146
146
|
return providers;
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
if (typeof token === "string") return token;
|
|
151
|
-
const description = token.description ?? token.toString();
|
|
152
|
-
const match = CLASS_SOURCE_RE.exec(description);
|
|
153
|
-
return match ? match[1] : description;
|
|
148
|
+
/** Renders a provide token readably: strings as-is, symbols (class keys carry the class name) by description. */ function stringifyToken(token) {
|
|
149
|
+
return typeof token === "string" ? token : token.description || token.toString();
|
|
154
150
|
}
|
|
155
151
|
/**
|
|
156
152
|
* D4: when an unresolved `@Inject(token)` IS provided somewhere — via a
|
|
@@ -1306,7 +1302,7 @@ var TInterceptorPriority = /* @__PURE__ */ function(TInterceptorPriority) {
|
|
|
1306
1302
|
* (For optional values use with @Optional())
|
|
1307
1303
|
* @param type - string or class constructor
|
|
1308
1304
|
*/ function Inject(type) {
|
|
1309
|
-
const key = typeof type === "string" ? type :
|
|
1305
|
+
const key = typeof type === "string" ? type : getClassKey$1(type);
|
|
1310
1306
|
return getMoostMate().decorate("inject", key);
|
|
1311
1307
|
}
|
|
1312
1308
|
/**
|
|
@@ -2565,4 +2561,4 @@ function _define_property(obj, key, value) {
|
|
|
2565
2561
|
}
|
|
2566
2562
|
|
|
2567
2563
|
//#endregion
|
|
2568
|
-
export { After, ApplyDecorators, Before, Circular, Const, ConstFactory, ContextInjector, Controller, Description, HandlerPaths, Id, ImportController, Inherit, Inject, InjectEventLogger, InjectFromScope, InjectMoost, InjectMoostLogger, InjectScopeVars, Injectable, Intercept, Interceptor, InterceptorHandler, Label, LoggerTopic, MOOST_MODULE_IDENTITY_KEY, Moost, MoostDispose, MoostInit, OnError, Optional, Overtake, Param, Params, Pipe, ProstoLogger, Provide, Replace, Required, Resolve, Response, TInterceptorPriority, TPipePriority, Value, cached, clearGlobalWooks, createEventContext, createLogger, createProvideRegistry, createReplaceRegistry, current, defineAfterInterceptor, defineBeforeInterceptor, defineErrorInterceptor, defineInfactScope, defineInterceptor, defineMoostEventHandler, definePipeFn, disposeInstances, eventTypeKey, getConstructor, getContextInjector, getGlobalWooks, getHandlerPaths, getInfactScopeVars, getInfactSingletonInstances, getInstanceOwnMethods, getInstanceOwnProps, getMoostInfact, getMoostMate, getNewMoostInfact, globalKey, isConstructor, isThenable, key, loggerConsoleTransport, mergeSorted, registerEventScope, replaceContextInjector, resetContextInjector, resolvePipe, run, setControllerContext, setInfactLoggingOptions, setInterceptResult, setOvertake, stampModuleIdentity, stampOnce, useControllerContext, useHandlerPaths, useInterceptResult, useLogger, useOvertake, useScopeId };
|
|
2564
|
+
export { After, ApplyDecorators, Before, Circular, Const, ConstFactory, ContextInjector, Controller, Description, HandlerPaths, Id, ImportController, Inherit, Inject, InjectEventLogger, InjectFromScope, InjectMoost, InjectMoostLogger, InjectScopeVars, Injectable, Intercept, Interceptor, InterceptorHandler, Label, LoggerTopic, MOOST_MODULE_IDENTITY_KEY, Moost, MoostDispose, MoostInit, OnError, Optional, Overtake, Param, Params, Pipe, ProstoLogger, Provide, Replace, Required, Resolve, Response, TInterceptorPriority, TPipePriority, Value, cached, clearGlobalWooks, createEventContext, createLogger, createProvideRegistry, createReplaceRegistry, current, defineAfterInterceptor, defineBeforeInterceptor, defineErrorInterceptor, defineInfactScope, defineInterceptor, defineMoostEventHandler, definePipeFn, disposeInstances, eventTypeKey, getClassKey, getConstructor, getContextInjector, getGlobalWooks, getHandlerPaths, getInfactScopeVars, getInfactSingletonInstances, getInstanceOwnMethods, getInstanceOwnProps, getMoostInfact, getMoostMate, getNewMoostInfact, globalKey, isConstructor, isThenable, key, loggerConsoleTransport, mergeSorted, registerEventScope, replaceContextInjector, resetContextInjector, resolvePipe, run, setControllerContext, setInfactLoggingOptions, setInterceptResult, setOvertake, stampModuleIdentity, stampOnce, useControllerContext, useHandlerPaths, useInterceptResult, useLogger, useOvertake, useScopeId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moost",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.41",
|
|
4
4
|
"description": "moost",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"composables",
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@prostojs/infact": "^0.
|
|
41
|
+
"@prostojs/infact": "^0.6.0",
|
|
42
42
|
"@prostojs/logger": "^0.4.3",
|
|
43
43
|
"@prostojs/mate": "^0.5.0",
|
|
44
|
-
"@wooksjs/event-core": "^0.7.
|
|
44
|
+
"@wooksjs/event-core": "^0.7.24",
|
|
45
45
|
"hookable": "^5.5.3",
|
|
46
|
-
"wooks": "^0.7.
|
|
46
|
+
"wooks": "^0.7.24"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@wooksjs/event-http": "^0.7.
|
|
50
|
-
"@wooksjs/http-body": "^0.7.
|
|
49
|
+
"@wooksjs/event-http": "^0.7.24",
|
|
50
|
+
"@wooksjs/http-body": "^0.7.24",
|
|
51
51
|
"vitest": "3.2.7",
|
|
52
|
-
"@moostjs/event-http": "^0.6.
|
|
52
|
+
"@moostjs/event-http": "^0.6.41"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"pub": "pnpm publish --access public",
|