vona-core 5.1.15 → 5.1.17
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 +14 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/core/config.d.ts +1 -0
- package/dist/lib/core/config.d.ts.map +1 -1
- package/dist/lib/core/context.d.ts.map +1 -1
- package/dist/lib/core/logger/utils.d.ts.map +1 -1
- package/dist/lib/utils/sqlite3.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/lib/core/config.ts +7 -3
- package/src/lib/core/context.ts +2 -1
- package/src/lib/core/logger/utils.ts +2 -1
- package/src/lib/utils/sqlite3.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -2079,7 +2079,9 @@ const contextBase = {
|
|
|
2079
2079
|
const self = cast(this);
|
|
2080
2080
|
if (self.path.endsWith('.json')) return true;
|
|
2081
2081
|
if (self.response.type && self.response.type.includes('json')) return true;
|
|
2082
|
-
if (self.request.headers['content-type']?.includes('application/json') && self.accepts('json') === 'json')
|
|
2082
|
+
if (self.request.headers['content-type']?.includes('application/json') && self.accepts('json') === 'json') {
|
|
2083
|
+
return true;
|
|
2084
|
+
}
|
|
2083
2085
|
if (self.accepts('html', 'text', 'json') === 'json') return true;
|
|
2084
2086
|
return false;
|
|
2085
2087
|
},
|
|
@@ -2519,7 +2521,7 @@ function getLoggerPathPhysicalRoot(app) {
|
|
|
2519
2521
|
if (mode === 'test' || mode === 'dev') {
|
|
2520
2522
|
loggerDir = path.join(app.projectPath, '.app/logs');
|
|
2521
2523
|
} else {
|
|
2522
|
-
loggerDir = path.join(
|
|
2524
|
+
loggerDir = path.join(getHomeVonaAppDir(app), 'logs');
|
|
2523
2525
|
}
|
|
2524
2526
|
fse.ensureDirSync(loggerDir);
|
|
2525
2527
|
return loggerDir;
|
|
@@ -2530,7 +2532,7 @@ function getPublicPathPhysicalRoot(app) {
|
|
|
2530
2532
|
if (mode === 'test' || mode === 'dev') {
|
|
2531
2533
|
publicDir = path.join(app.projectPath, '.app/public');
|
|
2532
2534
|
} else {
|
|
2533
|
-
publicDir = path.join(
|
|
2535
|
+
publicDir = path.join(getHomeVonaAppDir(app), 'public');
|
|
2534
2536
|
}
|
|
2535
2537
|
fse.ensureDirSync(publicDir);
|
|
2536
2538
|
return publicDir;
|
|
@@ -2541,11 +2543,14 @@ function getRuntimePathPhysicalRoot(app) {
|
|
|
2541
2543
|
if (mode === 'test' || mode === 'dev') {
|
|
2542
2544
|
runtimeDir = path.join(app.options.projectPath, '.app/runtime');
|
|
2543
2545
|
} else {
|
|
2544
|
-
runtimeDir = path.join(
|
|
2546
|
+
runtimeDir = path.join(getHomeVonaAppDir(app), 'runtime');
|
|
2545
2547
|
}
|
|
2546
2548
|
fse.ensureDirSync(runtimeDir);
|
|
2547
2549
|
return runtimeDir;
|
|
2548
2550
|
}
|
|
2551
|
+
function getHomeVonaAppDir(app) {
|
|
2552
|
+
return path.join(os.homedir(), '.vona', app.name);
|
|
2553
|
+
}
|
|
2549
2554
|
|
|
2550
2555
|
var enUs = {
|
|
2551
2556
|
...errorsInternal,
|
|
@@ -2679,7 +2684,9 @@ const formatLoggerFilter = Winston.format((info, opts) => {
|
|
|
2679
2684
|
if (Winston.config.npm.levels[info.level] === Winston.config.npm.levels[level]) return __formatLoggerFilterCheckInfo(info);
|
|
2680
2685
|
return false;
|
|
2681
2686
|
}
|
|
2682
|
-
if (Winston.config.npm.levels[info.level] <= Winston.config.npm.levels[level] || opts.silly && info.level === 'silly')
|
|
2687
|
+
if (Winston.config.npm.levels[info.level] <= Winston.config.npm.levels[level] || opts.silly && info.level === 'silly') {
|
|
2688
|
+
return __formatLoggerFilterCheckInfo(info);
|
|
2689
|
+
}
|
|
2683
2690
|
return false;
|
|
2684
2691
|
});
|
|
2685
2692
|
const formatLoggerConsole = clientInfo => {
|
|
@@ -3309,7 +3316,7 @@ async function retry(options, fn) {
|
|
|
3309
3316
|
function getSqlite3DatabaseNameDefault(app) {
|
|
3310
3317
|
const mode = app.meta.env.META_MODE;
|
|
3311
3318
|
if (mode !== 'prod') return '';
|
|
3312
|
-
const dbPath = path.join(
|
|
3319
|
+
const dbPath = path.join(getHomeVonaAppDir(app), 'sqlite3');
|
|
3313
3320
|
fse.ensureDirSync(dbPath);
|
|
3314
3321
|
return path.join(dbPath, `${app.name}.db`);
|
|
3315
3322
|
}
|
|
@@ -3342,5 +3349,5 @@ function prepareNativeBinding(nativeBinding) {
|
|
|
3342
3349
|
|
|
3343
3350
|
zodExtendOpenApi();
|
|
3344
3351
|
|
|
3345
|
-
export { $Class, $localeScope, $makeLocaleMagic, $protocolKey, AppHmr, AppHmrDeps, AppLocale, AppLogger, AppMeta, AppMetadata, AppResource, AppUtil, BeanAopBase, BeanAopMethodBase, BeanBase, BeanBaseSimple, BeanContainer, BeanInfo, BeanScopeBase, BeanScopeContainer, BeanScopeError, BeanScopeErrorImpl, BeanScopeLocale, BeanScopeScene, BeanScopeUtil, BeanSimple, EnumAppEvent, ErrorClass, Global, LocaleModuleNameSeparator, PickClassInner, ProxyDisable, SymbolBeanContainerInstances, SymbolBeanFullName, SymbolBeanInstanceKey, SymbolBeanInstancePropsLazy, SymbolCacheAopChains, SymbolCacheAopChainsKey, SymbolDecoratorBeanFullName, SymbolDecoratorBeanInfo, SymbolDecoratorGlobal, 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, formatLoggerErrors, formatLoggerFilter, functionNoop, getLoggerPathPhysicalRoot, getMappedClassMetadataKeys, getPublicPathPhysicalRoot, getRuntimePathPhysicalRoot, getSqlite3DatabaseNameDefault, getSqlite3NativeBinding, instanceDesp, isLocaleMagic, loadJSONFile, onionNameFromBeanFullName, pathToHref, polyfillDispose, prepareEnv, registerMappedClassMetadataKey, requireDynamic, retry, saveJSONFile, setMappedClassMetadataKeys, text, useApp, usePrepareArg, usePrepareArgs, uuidv4 };
|
|
3352
|
+
export { $Class, $localeScope, $makeLocaleMagic, $protocolKey, AppHmr, AppHmrDeps, AppLocale, AppLogger, AppMeta, AppMetadata, AppResource, AppUtil, BeanAopBase, BeanAopMethodBase, BeanBase, BeanBaseSimple, BeanContainer, BeanInfo, BeanScopeBase, BeanScopeContainer, BeanScopeError, BeanScopeErrorImpl, BeanScopeLocale, BeanScopeScene, BeanScopeUtil, BeanSimple, EnumAppEvent, ErrorClass, Global, LocaleModuleNameSeparator, PickClassInner, ProxyDisable, SymbolBeanContainerInstances, SymbolBeanFullName, SymbolBeanInstanceKey, SymbolBeanInstancePropsLazy, SymbolCacheAopChains, SymbolCacheAopChainsKey, SymbolDecoratorBeanFullName, SymbolDecoratorBeanInfo, SymbolDecoratorGlobal, 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, formatLoggerErrors, formatLoggerFilter, functionNoop, getHomeVonaAppDir, getLoggerPathPhysicalRoot, getMappedClassMetadataKeys, getPublicPathPhysicalRoot, getRuntimePathPhysicalRoot, getSqlite3DatabaseNameDefault, getSqlite3NativeBinding, instanceDesp, isLocaleMagic, loadJSONFile, onionNameFromBeanFullName, pathToHref, polyfillDispose, prepareEnv, registerMappedClassMetadataKey, requireDynamic, retry, saveJSONFile, setMappedClassMetadataKeys, text, useApp, usePrepareArg, usePrepareArgs, uuidv4 };
|
|
3346
3353
|
//# sourceMappingURL=index.js.map
|