@tsed/components-scan 8.38.6 → 8.38.8
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.
|
@@ -2,7 +2,9 @@ import { isTsEnv } from "./isTsEnv.js";
|
|
|
2
2
|
import { normalizePath } from "@tsed/normalize-path";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
function mapExcludes(excludes) {
|
|
5
|
-
|
|
5
|
+
// Normalize before adding "!": on Windows, normalizing "!C:\..." prefixes it with "./",
|
|
6
|
+
// so the pattern would no longer be negated.
|
|
7
|
+
return excludes.map((s) => `!${normalizePath(mapExtensions(s.replace(/!/gi, "")))}`);
|
|
6
8
|
}
|
|
7
9
|
function mapExtensions(file) {
|
|
8
10
|
if (!isTsEnv()) {
|
|
@@ -13,8 +15,6 @@ function mapExtensions(file) {
|
|
|
13
15
|
export function cleanGlobPatterns(files, excludes) {
|
|
14
16
|
return []
|
|
15
17
|
.concat(files)
|
|
16
|
-
.map((s) => resolve(s))
|
|
17
|
-
.concat(mapExcludes(excludes))
|
|
18
|
-
.map(mapExtensions)
|
|
19
|
-
.map((s) => normalizePath(s));
|
|
18
|
+
.map((s) => normalizePath(mapExtensions(resolve(s))))
|
|
19
|
+
.concat(mapExcludes(excludes));
|
|
20
20
|
}
|
package/lib/esm/importFiles.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { pathToFileURL } from "node:url";
|
|
1
2
|
import { cleanGlobPatterns } from "./cleanGlobPatterns.js";
|
|
2
3
|
export async function importFiles(patterns, exclude) {
|
|
3
4
|
const { globby } = await import("globby");
|
|
@@ -6,7 +7,8 @@ export async function importFiles(patterns, exclude) {
|
|
|
6
7
|
for (const file of files.sort((a, b) => (a < b ? -1 : 1))) {
|
|
7
8
|
if (!file.endsWith(".d.ts")) {
|
|
8
9
|
// prevent .d.ts import if the global pattern isn't correctly configured
|
|
9
|
-
|
|
10
|
+
// import() needs a file URL: on Windows an absolute path such as C:/... is rejected
|
|
11
|
+
const exports = await import(pathToFileURL(file).href);
|
|
10
12
|
Object.keys(exports).forEach((key) => symbols.push(exports[key]));
|
|
11
13
|
}
|
|
12
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/components-scan",
|
|
3
|
-
"version": "8.38.
|
|
3
|
+
"version": "8.38.8",
|
|
4
4
|
"description": "Components scan utilities for Ts.ED Framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tsed/normalize-path": "8.38.
|
|
26
|
+
"@tsed/normalize-path": "8.38.8",
|
|
27
27
|
"globby": "14.1.0",
|
|
28
28
|
"tslib": ">=2.7.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@tsed/barrels": "8.38.
|
|
32
|
-
"@tsed/core": "8.38.
|
|
33
|
-
"@tsed/di": "8.38.
|
|
34
|
-
"@tsed/typescript": "8.38.
|
|
31
|
+
"@tsed/barrels": "8.38.8",
|
|
32
|
+
"@tsed/core": "8.38.8",
|
|
33
|
+
"@tsed/di": "8.38.8",
|
|
34
|
+
"@tsed/typescript": "8.38.8",
|
|
35
35
|
"typescript": "6.0.2",
|
|
36
36
|
"vitest": "4.1.4"
|
|
37
37
|
},
|