vona-core 5.0.108 → 5.0.110
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.js
CHANGED
|
@@ -318,8 +318,9 @@ function prepareEnv(env) {
|
|
|
318
318
|
function beanFullNameFromOnionName(onionName, sceneName) {
|
|
319
319
|
return onionName.replace(':', `.${sceneName}.`);
|
|
320
320
|
}
|
|
321
|
-
function onionNameFromBeanFullName(beanFullName
|
|
322
|
-
|
|
321
|
+
function onionNameFromBeanFullName(beanFullName) {
|
|
322
|
+
const parts = beanFullName.split('.');
|
|
323
|
+
return `${parts[0]}:${parts[2]}`;
|
|
323
324
|
}
|
|
324
325
|
function filterHeaders(headers, whitelist) {
|
|
325
326
|
if (!headers) return;
|
|
@@ -695,8 +696,7 @@ class BeanBaseSimple extends BeanSimple {
|
|
|
695
696
|
return appResource.getBean(this[SymbolBeanFullName]);
|
|
696
697
|
}
|
|
697
698
|
get $onionName() {
|
|
698
|
-
|
|
699
|
-
return `${parts[0]}:${parts[2]}`;
|
|
699
|
+
return onionNameFromBeanFullName(this.$beanFullName);
|
|
700
700
|
}
|
|
701
701
|
get $onionOptions() {
|
|
702
702
|
return this.$beanOptions.options;
|
|
@@ -1729,6 +1729,7 @@ class AppLocale extends BeanSimple {
|
|
|
1729
1729
|
}
|
|
1730
1730
|
getText(supportCustomMessage, moduleScope, locale, key, ...args) {
|
|
1731
1731
|
if (!key) return key;
|
|
1732
|
+
if (typeof key === 'object') key = String(key);
|
|
1732
1733
|
if (typeof key !== 'string') throw new Error(`${key} should be string`);
|
|
1733
1734
|
const pos = key.indexOf(LocaleModuleNameSeparator);
|
|
1734
1735
|
if (pos > -1) {
|
|
@@ -1756,7 +1757,19 @@ class BeanScopeLocale extends BeanSimple {
|
|
|
1756
1757
|
}
|
|
1757
1758
|
|
|
1758
1759
|
function $localeScope(moduleName, key) {
|
|
1759
|
-
return `${moduleName}::${String(key)}
|
|
1760
|
+
return $makeLocaleMagic(`${moduleName}::${String(key)}`);
|
|
1761
|
+
}
|
|
1762
|
+
function $makeLocaleMagic(str) {
|
|
1763
|
+
return {
|
|
1764
|
+
toString() {
|
|
1765
|
+
return str;
|
|
1766
|
+
},
|
|
1767
|
+
toJSON() {
|
|
1768
|
+
if (!str || !str.includes(LocaleModuleNameSeparator)) return str;
|
|
1769
|
+
const app = useApp();
|
|
1770
|
+
return app.meta.text(str);
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1760
1773
|
}
|
|
1761
1774
|
|
|
1762
1775
|
const BeanModuleScope$1 = Symbol('BeanScopeScene#ModuleScope');
|
|
@@ -2998,6 +3011,14 @@ function handleProcessMaster(workers) {
|
|
|
2998
3011
|
// console.log(`----------------- worker ${_worker.process.pid} died`, _code, _signal);
|
|
2999
3012
|
if (cluster.workers && Object.keys(cluster.workers).length === 0) {
|
|
3000
3013
|
clearTimeout(__timeout);
|
|
3014
|
+
// log
|
|
3015
|
+
const app = useApp();
|
|
3016
|
+
if (app.meta.env.LOGGER_DUMMY !== 'true') {
|
|
3017
|
+
const message = `Master shutdown gracefully: ${process.pid}`;
|
|
3018
|
+
// eslint-disable-next-line
|
|
3019
|
+
console.log(chalk.cyan(message));
|
|
3020
|
+
}
|
|
3021
|
+
// exit
|
|
3001
3022
|
process.exit(0);
|
|
3002
3023
|
}
|
|
3003
3024
|
});
|
|
@@ -3216,4 +3237,4 @@ function prepareNativeBinding(nativeBinding) {
|
|
|
3216
3237
|
|
|
3217
3238
|
zodExtendOpenApi();
|
|
3218
3239
|
|
|
3219
|
-
export { $Class, $customKey, $localeScope, AppHmr, AppHmrDeps, AppLocale, AppLogger, AppMeta, AppMetadata, AppResource, AppUtil, BeanAopBase, BeanAopMethodBase, BeanBase, BeanBaseSimple, BeanContainer, BeanInfo, BeanScopeBase, BeanScopeContainer, BeanScopeError, BeanScopeErrorImpl, BeanScopeLocale, BeanScopeScene, BeanScopeUtil, BeanSimple, EnumAppEvent, ErrorClass, LocaleModuleNameSeparator, PickClassInner, ProxyDisable, SymbolBeanContainerInstances, SymbolBeanFullName, SymbolBeanInstanceKey, SymbolBeanInstancePropsLazy, SymbolCacheAopChains, SymbolCacheAopChainsKey, SymbolDecoratorBeanFullName, SymbolDecoratorBeanInfo, SymbolDecoratorProxyDisable, SymbolDecoratorUse, SymbolDecoratorVirtual, SymbolHmrStateLoad, SymbolHmrStateSave, SymbolMappedClassMetadataKeys, SymbolModuleBelong, SymbolModuleName, Use, Virtual, VonaApplication, __prepareInjectSelectorInfo, appHmrDeps, appMetadata, appResource, beanFullNameFromOnionName, bootstrap, cast, closeApp, combineConfigDefault, combineFilePathSafe, compose, copyMetadataOfClasses, copyProperties, copyPropertiesOfClasses, copySqlite3NativeBinding, createApp, createAppMaster, createBeanDecorator, createGeneralApp, createHash, deepExtend, disposeInstance, errorsInternal, filterHeaders, formatLoggerAxiosError, formatLoggerConsole, formatLoggerCtx, formatLoggerDummy, formatLoggerFilter, functionNoop, getLoggerPathPhysicalRoot, getMappedClassMetadataKeys, getPublicPathPhysicalRoot, getRuntimePathPhysicalRoot, getSqlite3DatabaseNameDefault, getSqlite3NativeBinding, instanceDesp, loadJSONFile, localeDefault, onionNameFromBeanFullName, pathToHref, polyfillDispose, prepareEnv, registerMappedClassMetadataKey, requireDynamic, retry, saveJSONFile, setMappedClassMetadataKeys, useApp, usePrepareArg, usePrepareArgs, uuidv4 };
|
|
3240
|
+
export { $Class, $customKey, $localeScope, $makeLocaleMagic, AppHmr, AppHmrDeps, AppLocale, AppLogger, AppMeta, AppMetadata, AppResource, AppUtil, BeanAopBase, BeanAopMethodBase, BeanBase, BeanBaseSimple, BeanContainer, BeanInfo, BeanScopeBase, BeanScopeContainer, BeanScopeError, BeanScopeErrorImpl, BeanScopeLocale, BeanScopeScene, BeanScopeUtil, BeanSimple, EnumAppEvent, ErrorClass, LocaleModuleNameSeparator, PickClassInner, ProxyDisable, SymbolBeanContainerInstances, SymbolBeanFullName, SymbolBeanInstanceKey, SymbolBeanInstancePropsLazy, SymbolCacheAopChains, SymbolCacheAopChainsKey, SymbolDecoratorBeanFullName, SymbolDecoratorBeanInfo, SymbolDecoratorProxyDisable, SymbolDecoratorUse, SymbolDecoratorVirtual, SymbolHmrStateLoad, SymbolHmrStateSave, SymbolMappedClassMetadataKeys, SymbolModuleBelong, SymbolModuleName, Use, Virtual, VonaApplication, __prepareInjectSelectorInfo, appHmrDeps, appMetadata, appResource, beanFullNameFromOnionName, bootstrap, cast, closeApp, combineConfigDefault, combineFilePathSafe, compose, copyMetadataOfClasses, copyProperties, copyPropertiesOfClasses, copySqlite3NativeBinding, createApp, createAppMaster, createBeanDecorator, createGeneralApp, createHash, deepExtend, disposeInstance, errorsInternal, filterHeaders, formatLoggerAxiosError, formatLoggerConsole, formatLoggerCtx, formatLoggerDummy, formatLoggerFilter, functionNoop, getLoggerPathPhysicalRoot, getMappedClassMetadataKeys, getPublicPathPhysicalRoot, getRuntimePathPhysicalRoot, getSqlite3DatabaseNameDefault, getSqlite3NativeBinding, instanceDesp, loadJSONFile, localeDefault, onionNameFromBeanFullName, pathToHref, polyfillDispose, prepareEnv, registerMappedClassMetadataKey, requireDynamic, retry, saveJSONFile, setMappedClassMetadataKeys, useApp, usePrepareArg, usePrepareArgs, uuidv4 };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { IBeanScopeLocale } from '../../type.ts';
|
|
2
|
-
|
|
2
|
+
import type { ILocaleMagic } from './type.ts';
|
|
3
|
+
export declare function $localeScope<M extends keyof IBeanScopeLocale, K extends keyof IBeanScopeLocale[M]>(moduleName: M, key: K): ILocaleMagic<`${M}::${K extends string ? K : never}`>;
|
|
4
|
+
export declare function $makeLocaleMagic<T extends string>(str: T): ILocaleMagic<T>;
|
package/dist/lib/utils/util.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export declare function polyfillDispose(instance: any): void;
|
|
|
59
59
|
export declare function pathToHref(fileName: string): string;
|
|
60
60
|
export declare function prepareEnv(env: Partial<NodeJS.ProcessEnv>): VonaConfigEnv;
|
|
61
61
|
export declare function beanFullNameFromOnionName(onionName: string, sceneName: keyof IBeanSceneRecord): keyof IBeanRecord;
|
|
62
|
-
export declare function onionNameFromBeanFullName(beanFullName: string
|
|
62
|
+
export declare function onionNameFromBeanFullName(beanFullName: string): string;
|
|
63
63
|
export declare function filterHeaders(headers: object | undefined, whitelist: string[]): {} | undefined;
|
|
64
64
|
export declare function combineFilePathSafe(dir: string, file: string): string;
|
|
65
65
|
export declare function loadJSONFile(fileName: string): Promise<any>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.110",
|
|
5
5
|
"description": "vona",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"@cabloy/utils": "^1.0.49",
|
|
37
37
|
"@cabloy/word-utils": "^2.0.1",
|
|
38
38
|
"@cabloy/zod-errors-custom": "^2.0.4",
|
|
39
|
-
"@cabloy/zod-openapi": "^1.0.
|
|
39
|
+
"@cabloy/zod-openapi": "^1.0.8",
|
|
40
40
|
"@cabloy/zod-query": "^2.0.4",
|
|
41
|
-
"@cabloy/zod-to-openapi": "^8.1.
|
|
41
|
+
"@cabloy/zod-to-openapi": "^8.1.5",
|
|
42
42
|
"chalk": "^5.3.0",
|
|
43
43
|
"fs-extra": "^10.1.0",
|
|
44
44
|
"koa": "^3.0.0",
|