@xrystal/core 3.6.6 → 3.6.7
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/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import SystemService from '../system/index';
|
|
2
2
|
export default class ConfigsService {
|
|
3
|
-
|
|
3
|
+
private config;
|
|
4
4
|
protected _systemService: SystemService;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
load: ({ tmpFolderPath, systemService, envLoadPath, globalEnvFileName }: {
|
|
8
|
-
tmpFolderPath: string;
|
|
5
|
+
load: ({ tmp, systemService }: {
|
|
6
|
+
tmp: any;
|
|
9
7
|
systemService: SystemService;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}) => any;
|
|
8
|
+
}) => void;
|
|
9
|
+
get all(): Record<string, any>;
|
|
13
10
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
export default class ConfigsService {
|
|
2
|
-
|
|
2
|
+
config = {};
|
|
3
3
|
_systemService;
|
|
4
|
-
|
|
5
|
-
_envLoadPath = '';
|
|
6
|
-
load = ({ tmpFolderPath, systemService, envLoadPath, globalEnvFileName }) => {
|
|
7
|
-
ConfigsService.tmpFolderPath = tmpFolderPath;
|
|
4
|
+
load = ({ tmp, systemService }) => {
|
|
8
5
|
this._systemService = systemService;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
const rawConfigs = tmp?.configs || tmp?.configs || {};
|
|
7
|
+
this.config = {
|
|
8
|
+
rootFolderPath: rawConfigs.rootFolderPath || 'x',
|
|
9
|
+
projectName: rawConfigs.projectName,
|
|
10
|
+
port: process.env.PORT || rawConfigs.port || 3000,
|
|
11
|
+
env: process.env.NODE_ENV,
|
|
12
|
+
...rawConfigs
|
|
13
|
+
};
|
|
16
14
|
};
|
|
15
|
+
get all() {
|
|
16
|
+
return this.config;
|
|
17
|
+
}
|
|
17
18
|
}
|
package/source/project/index.js
CHANGED
|
@@ -33,9 +33,8 @@ const coreLoader = async () => {
|
|
|
33
33
|
tmp: { _: r }
|
|
34
34
|
});
|
|
35
35
|
await configService.load({
|
|
36
|
-
|
|
36
|
+
tmp: r,
|
|
37
37
|
systemService: system,
|
|
38
|
-
envLoadPath: path.join(rootFolderPath, configs.loaders.configs.envLoadPath),
|
|
39
38
|
...(configs.loaders.configs.globalEnvFileName && { globalEnvFileName: configs.loaders.configs.globalEnvFileName })
|
|
40
39
|
});
|
|
41
40
|
await logger.load({
|