@lakutata/core 3.1.4 → 3.1.5
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 +2 -2
- package/README.zh-CN.md +1 -1
- package/dist/cjs/lib/app/Application.d.ts +1 -1
- package/dist/cjs/lib/app/Application.js +1 -1
- package/dist/cjs/lib/app/ApplicationConfigLoader.js +5 -1
- package/dist/cjs/options/ApplicationOptions.d.ts +2 -2
- package/dist/esm/lib/app/Application.js +1 -1
- package/dist/esm/lib/app/ApplicationConfigLoader.js +5 -1
- package/dist/types/lib/app/Application.d.ts +1 -1
- package/dist/types/options/ApplicationOptions.d.ts +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -19,8 +19,8 @@ npm install lakutata # the framework
|
|
|
19
19
|
npm install @lakutata/core # or the core only
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
The package needs Node.js
|
|
23
|
-
CommonJS builds. The decorators need these TypeScript options:
|
|
22
|
+
The package needs Node.js 18.10 or later (`>=18.10.0`). Projects use ES modules (`"type": "module"`); the package also
|
|
23
|
+
ships CommonJS builds. The decorators need these TypeScript options:
|
|
24
24
|
|
|
25
25
|
```json
|
|
26
26
|
{
|
package/README.zh-CN.md
CHANGED
|
@@ -13,7 +13,7 @@ npm install lakutata # 框架
|
|
|
13
13
|
npm install @lakutata/core # 或者只安装核心
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
这个包需要 Node.js
|
|
16
|
+
这个包需要 Node.js 18.10 或更高版本(`>=18.10.0`)。项目使用 ES 模块(`"type": "module"`);包里也带有 CommonJS 构建。装饰器需要以下 TypeScript 选项:
|
|
17
17
|
|
|
18
18
|
```json
|
|
19
19
|
{
|
|
@@ -49,7 +49,7 @@ export declare enum ApplicationState {
|
|
|
49
49
|
* and `run()` have no effect then):
|
|
50
50
|
* 1. the environment variables are set, the aliases registered (`@runtime` being the working directory);
|
|
51
51
|
* 2. the options are read (from the getter given to `run()`, which may be async) and validated, the identity applied
|
|
52
|
-
* (`process.title` is the application ID, the time zone and the mode set);
|
|
52
|
+
* (`process.title` is the application ID, except in NW.js; the time zone and the mode set);
|
|
53
53
|
* 3. the application is created in a new root container: its objects are registered and its bootstrap runs in order;
|
|
54
54
|
* 4. the `onLaunched()` handlers and the objects' `launched()` hooks run.
|
|
55
55
|
*
|
|
@@ -51,7 +51,7 @@ var ApplicationState;
|
|
|
51
51
|
* and `run()` have no effect then):
|
|
52
52
|
* 1. the environment variables are set, the aliases registered (`@runtime` being the working directory);
|
|
53
53
|
* 2. the options are read (from the getter given to `run()`, which may be async) and validated, the identity applied
|
|
54
|
-
* (`process.title` is the application ID, the time zone and the mode set);
|
|
54
|
+
* (`process.title` is the application ID, except in NW.js; the time zone and the mode set);
|
|
55
55
|
* 3. the application is created in a new root container: its objects are registered and its bootstrap runs in order;
|
|
56
56
|
* 4. the `onLaunched()` handlers and the objects' `launched()` hooks run.
|
|
57
57
|
*
|
|
@@ -16,13 +16,17 @@ class ApplicationConfigLoader extends ModuleConfigLoader_js_1.ModuleConfigLoader
|
|
|
16
16
|
*/
|
|
17
17
|
constructor(app, applicationOptions, presetLoadOptions = []) {
|
|
18
18
|
if (ApplicationOptions_js_1.ApplicationOptions.isValid(applicationOptions)) {
|
|
19
|
-
|
|
19
|
+
const appId = (0, BasicInfo_js_1.setBasicInfo)({
|
|
20
20
|
appId: applicationOptions.id,
|
|
21
21
|
appName: applicationOptions.name,
|
|
22
22
|
timezone: applicationOptions.timezone ? applicationOptions.timezone : 'auto',
|
|
23
23
|
//MODE, NODE_ENV, the options, development
|
|
24
24
|
mode: (0, BasicInfo_js_1.resolveMode)(applicationOptions.mode)
|
|
25
25
|
}).appId;
|
|
26
|
+
//The process is named after the application, except in NW.js: its Node.js runs in a renderer process of
|
|
27
|
+
//Chromium, whose title would make it an application of its own (an icon in the Dock of macOS)
|
|
28
|
+
if (!process.versions.nw)
|
|
29
|
+
process.title = appId;
|
|
26
30
|
}
|
|
27
31
|
super(app, applicationOptions, presetLoadOptions);
|
|
28
32
|
}
|
|
@@ -27,8 +27,8 @@ import { ModuleOptions } from './ModuleOptions.js';
|
|
|
27
27
|
*/
|
|
28
28
|
export declare class ApplicationOptions extends ModuleOptions {
|
|
29
29
|
/**
|
|
30
|
-
* The ID of the application (`'shop.app'`)
|
|
31
|
-
*
|
|
30
|
+
* The ID of the application (`'shop.app'`), read by `Application.appId` and stamped on the exceptions; the
|
|
31
|
+
* `process.title` too, except in NW.js. Required.
|
|
32
32
|
*/
|
|
33
33
|
readonly id: string;
|
|
34
34
|
/**
|
|
@@ -45,7 +45,7 @@ export var ApplicationState;
|
|
|
45
45
|
* and `run()` have no effect then):
|
|
46
46
|
* 1. the environment variables are set, the aliases registered (`@runtime` being the working directory);
|
|
47
47
|
* 2. the options are read (from the getter given to `run()`, which may be async) and validated, the identity applied
|
|
48
|
-
* (`process.title` is the application ID, the time zone and the mode set);
|
|
48
|
+
* (`process.title` is the application ID, except in NW.js; the time zone and the mode set);
|
|
49
49
|
* 3. the application is created in a new root container: its objects are registered and its bootstrap runs in order;
|
|
50
50
|
* 4. the `onLaunched()` handlers and the objects' `launched()` hooks run.
|
|
51
51
|
*
|
|
@@ -13,13 +13,17 @@ export class ApplicationConfigLoader extends ModuleConfigLoader {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(app, applicationOptions, presetLoadOptions = []) {
|
|
15
15
|
if (ApplicationOptions.isValid(applicationOptions)) {
|
|
16
|
-
|
|
16
|
+
const appId = setBasicInfo({
|
|
17
17
|
appId: applicationOptions.id,
|
|
18
18
|
appName: applicationOptions.name,
|
|
19
19
|
timezone: applicationOptions.timezone ? applicationOptions.timezone : 'auto',
|
|
20
20
|
//MODE, NODE_ENV, the options, development
|
|
21
21
|
mode: resolveMode(applicationOptions.mode)
|
|
22
22
|
}).appId;
|
|
23
|
+
//The process is named after the application, except in NW.js: its Node.js runs in a renderer process of
|
|
24
|
+
//Chromium, whose title would make it an application of its own (an icon in the Dock of macOS)
|
|
25
|
+
if (!process.versions.nw)
|
|
26
|
+
process.title = appId;
|
|
23
27
|
}
|
|
24
28
|
super(app, applicationOptions, presetLoadOptions);
|
|
25
29
|
}
|
|
@@ -49,7 +49,7 @@ export declare enum ApplicationState {
|
|
|
49
49
|
* and `run()` have no effect then):
|
|
50
50
|
* 1. the environment variables are set, the aliases registered (`@runtime` being the working directory);
|
|
51
51
|
* 2. the options are read (from the getter given to `run()`, which may be async) and validated, the identity applied
|
|
52
|
-
* (`process.title` is the application ID, the time zone and the mode set);
|
|
52
|
+
* (`process.title` is the application ID, except in NW.js; the time zone and the mode set);
|
|
53
53
|
* 3. the application is created in a new root container: its objects are registered and its bootstrap runs in order;
|
|
54
54
|
* 4. the `onLaunched()` handlers and the objects' `launched()` hooks run.
|
|
55
55
|
*
|
|
@@ -27,8 +27,8 @@ import { ModuleOptions } from './ModuleOptions.js';
|
|
|
27
27
|
*/
|
|
28
28
|
export declare class ApplicationOptions extends ModuleOptions {
|
|
29
29
|
/**
|
|
30
|
-
* The ID of the application (`'shop.app'`)
|
|
31
|
-
*
|
|
30
|
+
* The ID of the application (`'shop.app'`), read by `Application.appId` and stamped on the exceptions; the
|
|
31
|
+
* `process.title` too, except in NW.js. Required.
|
|
32
32
|
*/
|
|
33
33
|
readonly id: string;
|
|
34
34
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lakutata/core",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "The core of the lakutata framework: the IoC container and dependency injection, the object model with asynchronous construction, and DTO schema validation with the API of joi.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lakutata",
|
|
@@ -107,11 +107,11 @@
|
|
|
107
107
|
"test:engine-types": "node scripts/check-engine-types.mjs"
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@lakutata/utils": "3.1.
|
|
110
|
+
"@lakutata/utils": "3.1.5",
|
|
111
111
|
"reflect-metadata": "0.2.2"
|
|
112
112
|
},
|
|
113
113
|
"engines": {
|
|
114
|
-
"node": "
|
|
114
|
+
"node": ">=18.10.0"
|
|
115
115
|
},
|
|
116
116
|
"files": [
|
|
117
117
|
"dist",
|