@adaas/a-concept 0.0.28 → 0.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.
- package/dist/src/base/A-Config/components/ConfigReader.component.d.ts +2 -1
- package/dist/src/base/A-Config/components/ConfigReader.component.js +12 -12
- package/dist/src/base/A-Config/components/ConfigReader.component.js.map +1 -1
- package/package.json +1 -1
- package/src/base/A-Config/components/ConfigReader.component.ts +12 -11
|
@@ -21,8 +21,9 @@ export declare class ConfigReader extends A_Component {
|
|
|
21
21
|
read<T extends string>(variables?: Array<T>): Promise<Record<T, any>>;
|
|
22
22
|
/**
|
|
23
23
|
* Finds the root directory of the project by locating the folder containing package.json
|
|
24
|
+
*
|
|
24
25
|
* @param {string} startPath - The initial directory to start searching from (default is __dirname)
|
|
25
26
|
* @returns {string|null} - The path to the root directory or null if package.json is not found
|
|
26
27
|
*/
|
|
27
|
-
protected getProjectRoot(startPath?: string): Promise<string
|
|
28
|
+
protected getProjectRoot(startPath?: string): Promise<string>;
|
|
28
29
|
}
|
|
@@ -22,7 +22,6 @@ exports.ConfigReader = void 0;
|
|
|
22
22
|
const A_Scope_class_1 = require("../../../global/A-Scope/A-Scope.class");
|
|
23
23
|
const A_Inject_decorator_1 = require("../../../decorators/A-Inject/A-Inject.decorator");
|
|
24
24
|
const A_Component_class_1 = require("../../../global/A-Component/A-Component.class");
|
|
25
|
-
const a_utils_1 = require("@adaas/a-utils");
|
|
26
25
|
const A_Concept_class_1 = require("../../../global/A-Concept/A_Concept.class");
|
|
27
26
|
const A_Config_context_1 = require("../A-Config.context");
|
|
28
27
|
/**
|
|
@@ -60,22 +59,23 @@ let ConfigReader = class ConfigReader extends A_Component_class_1.A_Component {
|
|
|
60
59
|
}
|
|
61
60
|
/**
|
|
62
61
|
* Finds the root directory of the project by locating the folder containing package.json
|
|
62
|
+
*
|
|
63
63
|
* @param {string} startPath - The initial directory to start searching from (default is __dirname)
|
|
64
64
|
* @returns {string|null} - The path to the root directory or null if package.json is not found
|
|
65
65
|
*/
|
|
66
66
|
getProjectRoot() {
|
|
67
67
|
return __awaiter(this, arguments, void 0, function* (startPath = __dirname) {
|
|
68
|
-
let currentPath = startPath;
|
|
69
|
-
const fs =
|
|
70
|
-
while (!fs.existsSync(`${currentPath}/package.json`)) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
return
|
|
68
|
+
// let currentPath = startPath;
|
|
69
|
+
// const fs = await A_Polyfills.fs();
|
|
70
|
+
// while (!fs.existsSync(`${currentPath}/package.json`)) {
|
|
71
|
+
// const parentPath = currentPath.substring(0, currentPath.lastIndexOf('/'));
|
|
72
|
+
// if (parentPath === currentPath || parentPath === '') {
|
|
73
|
+
// // Reached the root of the filesystem without finding package.json
|
|
74
|
+
// return null;
|
|
75
|
+
// }
|
|
76
|
+
// currentPath = parentPath;
|
|
77
|
+
// }
|
|
78
|
+
return process.cwd();
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigReader.component.js","sourceRoot":"","sources":["../../../../../src/base/A-Config/components/ConfigReader.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,iFAAwE;AACxE,gGAAmF;AACnF,6FAAoF;
|
|
1
|
+
{"version":3,"file":"ConfigReader.component.js","sourceRoot":"","sources":["../../../../../src/base/A-Config/components/ConfigReader.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,iFAAwE;AACxE,gGAAmF;AACnF,6FAAoF;AAEpF,uFAA8E;AAC9E,0DAA+C;AAI/C;;GAEG;AACI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,+BAAW;IAEzC,YACiC,KAAc;QAE3C,KAAK,EAAE,CAAC;QAFqB,UAAK,GAAL,KAAK,CAAS;IAG/C,CAAC;IAIK,MAAM,CACY,MAAgB;;YAEpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;YAEjD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAEjB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;YAE5C,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;IAGD;;;OAGG;IACH,OAAO,CAAoB,QAAgB;QACvC,OAAO,QAAuB,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACG,IAAI;6DACN,YAAsB,EAAE;YAExB,OAAO,EAAoB,CAAC;QAChC,CAAC;KAAA;IAGD;;;;;OAKG;IACa,cAAc;6DAAC,SAAS,GAAG,SAAS;YAChD,+BAA+B;YAE/B,qCAAqC;YAErC,0DAA0D;YAC1D,iFAAiF;YACjF,6DAA6D;YAC7D,6EAA6E;YAC7E,uBAAuB;YACvB,QAAQ;YACR,gCAAgC;YAChC,IAAI;YAEJ,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;QACzB,CAAC;KAAA;CACJ,CAAA;AAjEY,oCAAY;AAUf;IADL,2BAAS,CAAC,IAAI,EAAE;IAEZ,WAAA,IAAA,6BAAQ,EAAC,2BAAQ,CAAC,CAAA;0CAStB;uBApBQ,YAAY;IAGhB,WAAA,IAAA,6BAAQ,EAAC,uBAAO,CAAC,CAAA;GAHb,YAAY,CAiExB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaas/a-concept",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "A-Concept is a framework to build new Applications within or outside the ADAAS ecosystem. This framework is designed to be modular structure regardless environment and program goal.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -55,23 +55,24 @@ export class ConfigReader extends A_Component {
|
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Finds the root directory of the project by locating the folder containing package.json
|
|
58
|
+
*
|
|
58
59
|
* @param {string} startPath - The initial directory to start searching from (default is __dirname)
|
|
59
60
|
* @returns {string|null} - The path to the root directory or null if package.json is not found
|
|
60
61
|
*/
|
|
61
62
|
protected async getProjectRoot(startPath = __dirname) {
|
|
62
|
-
let currentPath = startPath;
|
|
63
|
+
// let currentPath = startPath;
|
|
63
64
|
|
|
64
|
-
const fs = await A_Polyfills.fs();
|
|
65
|
+
// const fs = await A_Polyfills.fs();
|
|
65
66
|
|
|
66
|
-
while (!fs.existsSync(`${currentPath}/package.json`)) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
67
|
+
// while (!fs.existsSync(`${currentPath}/package.json`)) {
|
|
68
|
+
// const parentPath = currentPath.substring(0, currentPath.lastIndexOf('/'));
|
|
69
|
+
// if (parentPath === currentPath || parentPath === '') {
|
|
70
|
+
// // Reached the root of the filesystem without finding package.json
|
|
71
|
+
// return null;
|
|
72
|
+
// }
|
|
73
|
+
// currentPath = parentPath;
|
|
74
|
+
// }
|
|
74
75
|
|
|
75
|
-
return
|
|
76
|
+
return process.cwd();
|
|
76
77
|
}
|
|
77
78
|
}
|