@fastcar/core 0.2.55 → 0.2.56
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 +1 -1
- package/src/FastCarApplication.ts +6 -1
- package/src/annotation/scan/ComponentInjection.ts +1 -1
- package/src/annotation/scan/ComponentScanExclusion.ts +1 -1
- package/target/FastCarApplication.js +5 -1
- package/target/annotation/scan/ComponentInjection.js +1 -1
- package/target/annotation/scan/ComponentScanExclusion.js +1 -1
package/package.json
CHANGED
|
@@ -268,7 +268,9 @@ class FastCarApplication extends Events {
|
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
let includeFinalList: string[] = [...tmpFilePath];
|
|
271
272
|
let filePathList = FileUtil.getFilePathList(this.basePath);
|
|
273
|
+
|
|
272
274
|
filePathList = tmpFilePath.concat(filePathList);
|
|
273
275
|
filePathList = [...new Set(filePathList)];
|
|
274
276
|
|
|
@@ -286,6 +288,9 @@ class FastCarApplication extends Events {
|
|
|
286
288
|
});
|
|
287
289
|
|
|
288
290
|
filePathList = filePathList.filter((item) => {
|
|
291
|
+
if (includeFinalList.includes(item)) {
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
289
294
|
return !excludAllPath.includes(item);
|
|
290
295
|
});
|
|
291
296
|
}
|
|
@@ -551,7 +556,7 @@ class FastCarApplication extends Events {
|
|
|
551
556
|
*/
|
|
552
557
|
init() {
|
|
553
558
|
//加载配置
|
|
554
|
-
this.basePath = (Reflect.get(this, CommonConstant.BasePath) || require.main?.path || module.path) as string;
|
|
559
|
+
this.basePath = (Reflect.get(this, CommonConstant.BasePath) || require.main?.path || module.path || process.cwd()) as string;
|
|
555
560
|
this.baseFileName = (Reflect.get(this, CommonConstant.BaseFileName) || require.main?.filename || module.filename) as string;
|
|
556
561
|
|
|
557
562
|
this.beforeStartServer();
|
|
@@ -8,7 +8,7 @@ export default function ComponentInjection(target: any, ...names: string[]) {
|
|
|
8
8
|
|
|
9
9
|
for (let name of names) {
|
|
10
10
|
//可支持绝对路径
|
|
11
|
-
let p = path.join(require.main?.path || "", name);
|
|
11
|
+
let p = path.join(require.main?.path || process.cwd() || "", name);
|
|
12
12
|
if (fs.existsSync(name)) {
|
|
13
13
|
p = name;
|
|
14
14
|
}
|
|
@@ -11,7 +11,7 @@ export default function ComponentScanExclusion(...names: string[]) {
|
|
|
11
11
|
|
|
12
12
|
for (let name of names) {
|
|
13
13
|
//可支持绝对路径
|
|
14
|
-
let p = path.join(require.main?.path || "", name);
|
|
14
|
+
let p = path.join(require.main?.path || process.cwd() || "", name);
|
|
15
15
|
if (fs.existsSync(name)) {
|
|
16
16
|
p = name;
|
|
17
17
|
}
|
|
@@ -226,6 +226,7 @@ let FastCarApplication = FastCarApplication_1 = class FastCarApplication extends
|
|
|
226
226
|
tmpFilePath = tmpFilePath.concat(tmpList);
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
+
let includeFinalList = [...tmpFilePath];
|
|
229
230
|
let filePathList = FileUtil_1.default.getFilePathList(this.basePath);
|
|
230
231
|
filePathList = tmpFilePath.concat(filePathList);
|
|
231
232
|
filePathList = [...new Set(filePathList)];
|
|
@@ -240,6 +241,9 @@ let FastCarApplication = FastCarApplication_1 = class FastCarApplication extends
|
|
|
240
241
|
excludAllPath = [...excludAllPath, ...exlist];
|
|
241
242
|
});
|
|
242
243
|
filePathList = filePathList.filter((item) => {
|
|
244
|
+
if (includeFinalList.includes(item)) {
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
243
247
|
return !excludAllPath.includes(item);
|
|
244
248
|
});
|
|
245
249
|
}
|
|
@@ -475,7 +479,7 @@ let FastCarApplication = FastCarApplication_1 = class FastCarApplication extends
|
|
|
475
479
|
*/
|
|
476
480
|
init() {
|
|
477
481
|
//加载配置
|
|
478
|
-
this.basePath = (Reflect.get(this, CommonConstant_1.CommonConstant.BasePath) || require.main?.path || module.path);
|
|
482
|
+
this.basePath = (Reflect.get(this, CommonConstant_1.CommonConstant.BasePath) || require.main?.path || module.path || process.cwd());
|
|
479
483
|
this.baseFileName = (Reflect.get(this, CommonConstant_1.CommonConstant.BaseFileName) || require.main?.filename || module.filename);
|
|
480
484
|
this.beforeStartServer();
|
|
481
485
|
this.startServer();
|
|
@@ -8,7 +8,7 @@ function ComponentInjection(target, ...names) {
|
|
|
8
8
|
let list = Reflect.get(target.prototype, ScanPathList) || [];
|
|
9
9
|
for (let name of names) {
|
|
10
10
|
//可支持绝对路径
|
|
11
|
-
let p = path.join(require.main?.path || "", name);
|
|
11
|
+
let p = path.join(require.main?.path || process.cwd() || "", name);
|
|
12
12
|
if (fs.existsSync(name)) {
|
|
13
13
|
p = name;
|
|
14
14
|
}
|
|
@@ -11,7 +11,7 @@ function ComponentScanExclusion(...names) {
|
|
|
11
11
|
let list = Reflect.get(target.prototype, ScanPathList) || [];
|
|
12
12
|
for (let name of names) {
|
|
13
13
|
//可支持绝对路径
|
|
14
|
-
let p = path.join(require.main?.path || "", name);
|
|
14
|
+
let p = path.join(require.main?.path || process.cwd() || "", name);
|
|
15
15
|
if (fs.existsSync(name)) {
|
|
16
16
|
p = name;
|
|
17
17
|
}
|