vona-core 5.0.26 → 5.0.29

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.
@@ -7,7 +7,7 @@ import { combineLoggerDefault } from "./loggerDefault.js";
7
7
  export function combineAppConfigDefault(appInfo, env) {
8
8
  let config = configDefault(appInfo, env);
9
9
  const mode = appInfo.configMeta.mode;
10
- if (mode === 'local') {
10
+ if (mode === 'dev') {
11
11
  config = deepExtend(config, configLocal(env));
12
12
  }
13
13
  else if (mode === 'prod') {
@@ -83,7 +83,7 @@ export function configTest(_env) {
83
83
  function getLoggerPathPhysicalRoot(appInfo) {
84
84
  const mode = appInfo.configMeta.mode;
85
85
  let loggerDir;
86
- if (mode === 'test' || mode === 'local') {
86
+ if (mode === 'test' || mode === 'dev') {
87
87
  loggerDir = path.join(appInfo.projectPath, '.app/logs');
88
88
  }
89
89
  else {
@@ -95,7 +95,7 @@ function getLoggerPathPhysicalRoot(appInfo) {
95
95
  function getPublicPathPhysicalRoot(appInfo) {
96
96
  const mode = appInfo.configMeta.mode;
97
97
  let publicDir;
98
- if (mode === 'test' || mode === 'local') {
98
+ if (mode === 'test' || mode === 'dev') {
99
99
  publicDir = path.join(appInfo.projectPath, '.app/public');
100
100
  }
101
101
  else {
@@ -107,7 +107,7 @@ function getPublicPathPhysicalRoot(appInfo) {
107
107
  export async function combineConfigDefault(app, configDefault, configLocal, configProd, configTest) {
108
108
  let config = await configDefault(app);
109
109
  const mode = app.config.meta.mode;
110
- if (mode === 'local' && configLocal) {
110
+ if (mode === 'dev' && configLocal) {
111
111
  config = deepExtend(config, await configLocal(app));
112
112
  }
113
113
  else if (mode === 'prod' && configProd) {
@@ -65,7 +65,7 @@ export class AppMeta extends BeanSimple {
65
65
  const mode = this.app.config.meta.mode;
66
66
  this.isProd = mode === 'prod';
67
67
  this.isTest = mode === 'test';
68
- this.isLocal = mode === 'local';
68
+ this.isLocal = mode === 'dev';
69
69
  }
70
70
  async waitAppStarted() {
71
71
  return new Promise((resolve, reject) => {
@@ -1,4 +1,4 @@
1
- import { evaluateExpressions } from '@cabloy/utils';
1
+ import { evaluateExpressions, isNilOrEmptyString } from '@cabloy/utils';
2
2
  import { appMetadata } from "../../core/metadata.js";
3
3
  import { appResource } from "../../core/resource.js";
4
4
  export function Use(options) {
@@ -44,6 +44,10 @@ export function __prepareInjectSelectorInfo(beanInstance, useOptions) {
44
44
  if (!selectorInfo) {
45
45
  selectorInfo = __prepareInjectSelectorInfo_init(beanInstance, useOptions);
46
46
  }
47
+ if (!selectorInfo && !isNilOrEmptyString(useOptions.selector)) {
48
+ const selector = evaluateExpressions(useOptions.selector, beanInstance);
49
+ return { withSelector: true, args: [selector] };
50
+ }
47
51
  return selectorInfo ?? { withSelector: false, args: [] };
48
52
  }
49
53
  function __prepareInjectSelectorInfo_descriptor(beanInstance, useOptions) {
@@ -54,7 +58,7 @@ function __prepareInjectSelectorInfo_descriptor(beanInstance, useOptions) {
54
58
  if (!res)
55
59
  return;
56
60
  const withSelector = res.withSelector ?? false;
57
- const args = res.args.map(arg => arg());
61
+ const args = res.args.map(arg => typeof arg === 'function' ? arg() : arg);
58
62
  return { withSelector, args };
59
63
  }
60
64
  function __prepareInjectSelectorInfo_init(beanInstance, useOptions) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-core",
3
3
  "type": "module",
4
- "version": "5.0.26",
4
+ "version": "5.0.29",
5
5
  "description": "vona",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -30,10 +30,10 @@
30
30
  "@cabloy/extend": "^3.1.10",
31
31
  "@cabloy/json5": "^1.0.18",
32
32
  "@cabloy/localeutil": "^2.0.10",
33
- "@cabloy/module-info": "^1.3.22",
34
- "@cabloy/module-info-pro": "^1.0.30",
33
+ "@cabloy/module-info": "^1.3.23",
34
+ "@cabloy/module-info-pro": "^1.0.31",
35
35
  "@cabloy/set": "^1.0.17",
36
- "@cabloy/utils": "^1.0.30",
36
+ "@cabloy/utils": "^1.0.31",
37
37
  "@cabloy/word-utils": "^2.0.1",
38
38
  "fs-extra": "^10.1.0",
39
39
  "koa": "^3.0.0",