@tsed/components-scan 7.0.0-beta.1 → 7.0.0-beta.10
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/lib/cjs/{data → __mock__}/Test1.js +0 -0
- package/lib/cjs/__mock__/Test1.js.map +1 -0
- package/lib/cjs/{data → __mock__}/Test2.js +0 -0
- package/lib/cjs/__mock__/Test2.js.map +1 -0
- package/lib/cjs/importFiles.js +5 -1
- package/lib/cjs/importFiles.js.map +1 -1
- package/lib/cjs/index.js +8 -5
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/isTsEnv.js +9 -1
- package/lib/cjs/isTsEnv.js.map +1 -1
- package/lib/cjs/normalizePath.js +3 -2
- package/lib/cjs/normalizePath.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/esm/{data → __mock__}/Test1.js +0 -0
- package/lib/esm/__mock__/Test1.js.map +1 -0
- package/lib/esm/{data → __mock__}/Test2.js +0 -0
- package/lib/esm/__mock__/Test2.js.map +1 -0
- package/lib/esm/cleanGlobPatterns.js +2 -2
- package/lib/esm/importComponents.js +1 -1
- package/lib/esm/importFiles.js +1 -1
- package/lib/esm/index.js +8 -5
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/isTsEnv.js +9 -1
- package/lib/esm/isTsEnv.js.map +1 -1
- package/lib/esm/normalizePath.js +1 -1
- package/lib/esm/normalizePath.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/types/{data → __mock__}/Test1.d.ts +0 -0
- package/lib/types/{data → __mock__}/Test2.d.ts +0 -0
- package/lib/types/index.d.ts +6 -3
- package/lib/types/isTsEnv.d.ts +1 -2
- package/package.json +9 -10
- package/readme.md +0 -2
- package/tsconfig.compile.esm.json +1 -12
- package/lib/cjs/data/Test1.js.map +0 -1
- package/lib/cjs/data/Test2.js.map +0 -1
- package/lib/cjs/importProviders.js +0 -29
- package/lib/cjs/importProviders.js.map +0 -1
- package/lib/esm/data/Test1.js.map +0 -1
- package/lib/esm/data/Test2.js.map +0 -1
- package/lib/esm/importProviders.js +0 -25
- package/lib/esm/importProviders.js.map +0 -1
- package/lib/types/importProviders.d.ts +0 -10
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Test1.js","sourceRoot":"","sources":["../../../src/__mock__/Test1.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAa,KAAK;CAAG;AAArB,sBAAqB","sourcesContent":["export const value1 = \"value\";\n\nexport class Test1 {}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Test2.js","sourceRoot":"","sources":["../../../src/__mock__/Test2.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAa,KAAK;CAAG;AAArB,sBAAqB","sourcesContent":["export const value2 = \"value\";\n\nexport class Test2 {}\n"]}
|
package/lib/cjs/importFiles.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importFiles.js","sourceRoot":"","sources":["../../src/importFiles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"importFiles.js","sourceRoot":"","sources":["../../src/importFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyC;AACzC,2DAAsD;AAE/C,KAAK,UAAU,WAAW,CAAC,QAA2B,EAAE,OAAiB;IAC9E,MAAM,EAAC,OAAO,EAAE,MAAM,EAAC,GAAG,wDAAa,QAAQ,GAAC,CAAC;IACjD,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,IAAA,qCAAiB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IACjE,MAAM,OAAO,GAAU,EAAE,CAAC;IAE1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC3B,wEAAwE;YACxE,IAAI;gBACF,MAAM,OAAO,GAAG,MAAM,IAAA,oBAAa,EAAC,IAAI,CAAC,CAAC;gBAC1C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACnE;YAAC,OAAO,EAAE,EAAE;gBACX,uBAAuB;gBACvB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAClB,uBAAuB;gBACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACjB;SACF;KACF;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AArBD,kCAqBC","sourcesContent":["import {importPackage} from \"@tsed/core\";\nimport {cleanGlobPatterns} from \"./cleanGlobPatterns\";\n\nexport async function importFiles(patterns: string | string[], exclude: string[]): Promise<any[]> {\n const {default: globby} = await import(\"globby\");\n const files = await globby(cleanGlobPatterns(patterns, exclude));\n const symbols: any[] = [];\n\n for (const file of files) {\n if (!file.endsWith(\".d.ts\")) {\n // prevent .d.ts import if the global pattern isn't correctly configured\n try {\n const exports = await importPackage(file);\n Object.keys(exports).forEach((key) => symbols.push(exports[key]));\n } catch (er) {\n // istanbul ignore next\n console.error(er);\n // istanbul ignore next\n process.exit(1);\n }\n }\n }\n\n return symbols;\n}\n"]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Automatically generated by barrelsby.
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
tslib_1.__exportStar(require("./cleanGlobPatterns"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./importComponents"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./importFiles"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./isTsEnv"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./normalizePath"), exports);
|
|
9
12
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8DAAoC;AACpC,6DAAmC;AACnC,wDAA8B;AAC9B,oDAA0B;AAC1B,0DAAgC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./cleanGlobPatterns\";\nexport * from \"./importComponents\";\nexport * from \"./importFiles\";\nexport * from \"./isTsEnv\";\nexport * from \"./normalizePath\";\n"]}
|
package/lib/cjs/isTsEnv.js
CHANGED
|
@@ -2,7 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isTsEnv = void 0;
|
|
4
4
|
function isTsEnv() {
|
|
5
|
-
|
|
5
|
+
var _a;
|
|
6
|
+
try {
|
|
7
|
+
if (require && require.extensions && require.extensions[".ts"]) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
catch (er) { }
|
|
12
|
+
return (process.env["TS_NODE_DEV"] ||
|
|
13
|
+
((_a = process.env["_"]) === null || _a === void 0 ? void 0 : _a.includes("ts-node")) ||
|
|
6
14
|
process.env["TS_TEST"] ||
|
|
7
15
|
process.env.JEST_WORKER_ID !== undefined ||
|
|
8
16
|
process.env.NODE_ENV === "test");
|
package/lib/cjs/isTsEnv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTsEnv.js","sourceRoot":"","sources":["../../src/isTsEnv.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO
|
|
1
|
+
{"version":3,"file":"isTsEnv.js","sourceRoot":"","sources":["../../src/isTsEnv.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO;;IACrB,IAAI;QACF,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YAC9D,OAAO,IAAI,CAAC;SACb;KACF;IAAC,OAAO,EAAE,EAAE,GAAE;IACf,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;SAC1B,MAAA,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,0CAAE,QAAQ,CAAC,SAAS,CAAC,CAAA;QACrC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS;QACxC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAChC,CAAC;AACJ,CAAC;AAbD,0BAaC","sourcesContent":["export function isTsEnv() {\n try {\n if (require && require.extensions && require.extensions[\".ts\"]) {\n return true;\n }\n } catch (er) {}\n return (\n process.env[\"TS_NODE_DEV\"] ||\n process.env[\"_\"]?.includes(\"ts-node\") ||\n process.env[\"TS_TEST\"] ||\n process.env.JEST_WORKER_ID !== undefined ||\n process.env.NODE_ENV === \"test\"\n );\n}\n"]}
|
package/lib/cjs/normalizePath.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizePath = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const core_1 = require("@tsed/core");
|
|
5
6
|
const path_1 = require("path");
|
|
6
|
-
const
|
|
7
|
+
const normalize_path_1 = tslib_1.__importDefault(require("normalize-path"));
|
|
7
8
|
function normalizePath(item, ...paths) {
|
|
8
9
|
if ((0, core_1.isString)(item)) {
|
|
9
10
|
const path = (0, path_1.join)(item, ...paths);
|
|
10
|
-
return
|
|
11
|
+
return (0, normalize_path_1.default)(path);
|
|
11
12
|
}
|
|
12
13
|
if ((0, core_1.isArray)(item)) {
|
|
13
14
|
return item.map((item) => normalizePath(item));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizePath.js","sourceRoot":"","sources":["../../src/normalizePath.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalizePath.js","sourceRoot":"","sources":["../../src/normalizePath.ts"],"names":[],"mappings":";;;;AAAA,qCAA6C;AAC7C,+BAA0B;AAC1B,4EAAqC;AAIrC,SAAgB,aAAa,CAAC,IAAS,EAAE,GAAG,KAAe;IACzD,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAE;QAClB,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;QAClC,OAAO,IAAA,wBAAO,EAAC,IAAI,CAAC,CAAC;KACtB;IAED,IAAI,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;KACrD;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,sCAWC","sourcesContent":["import {isArray, isString} from \"@tsed/core\";\nimport {join} from \"path\";\nimport fixPath from \"normalize-path\";\n\nexport function normalizePath(item: string, ...paths: string[]): string;\nexport function normalizePath(item: (string | any)[]): (string | any)[];\nexport function normalizePath(item: any, ...paths: string[]) {\n if (isString(item)) {\n const path = join(item, ...paths);\n return fixPath(path);\n }\n\n if (isArray(item)) {\n return item.map((item: any) => normalizePath(item));\n }\n\n return item;\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Test1.js","sourceRoot":"","sources":["../../../src/__mock__/Test1.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAM,OAAO,KAAK;CAAG","sourcesContent":["export const value1 = \"value\";\n\nexport class Test1 {}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Test2.js","sourceRoot":"","sources":["../../../src/__mock__/Test2.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAM,OAAO,KAAK;CAAG","sourcesContent":["export const value2 = \"value\";\n\nexport class Test2 {}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolve } from "path";
|
|
2
|
-
import { isTsEnv } from "./isTsEnv";
|
|
3
|
-
import { normalizePath } from "./normalizePath";
|
|
2
|
+
import { isTsEnv } from "./isTsEnv.js";
|
|
3
|
+
import { normalizePath } from "./normalizePath.js";
|
|
4
4
|
function mapExcludes(excludes) {
|
|
5
5
|
return excludes.map((s) => `!${s.replace(/!/gi, "")}`);
|
|
6
6
|
}
|
package/lib/esm/importFiles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { importPackage } from "@tsed/core";
|
|
2
|
-
import { cleanGlobPatterns } from "./cleanGlobPatterns";
|
|
2
|
+
import { cleanGlobPatterns } from "./cleanGlobPatterns.js";
|
|
3
3
|
export async function importFiles(patterns, exclude) {
|
|
4
4
|
const { default: globby } = await import("globby");
|
|
5
5
|
const files = await globby(cleanGlobPatterns(patterns, exclude));
|
package/lib/esm/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from "./cleanGlobPatterns";
|
|
5
|
-
export * from "./
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./cleanGlobPatterns.js";
|
|
5
|
+
export * from "./importComponents.js";
|
|
6
|
+
export * from "./importFiles.js";
|
|
7
|
+
export * from "./isTsEnv.js";
|
|
8
|
+
export * from "./normalizePath.js";
|
|
6
9
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./cleanGlobPatterns\";\nexport * from \"./importComponents\";\nexport * from \"./importFiles\";\nexport * from \"./isTsEnv\";\nexport * from \"./normalizePath\";\n"]}
|
package/lib/esm/isTsEnv.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export function isTsEnv() {
|
|
2
|
-
|
|
2
|
+
var _a;
|
|
3
|
+
try {
|
|
4
|
+
if (require && require.extensions && require.extensions[".ts"]) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
catch (er) { }
|
|
9
|
+
return (process.env["TS_NODE_DEV"] ||
|
|
10
|
+
((_a = process.env["_"]) === null || _a === void 0 ? void 0 : _a.includes("ts-node")) ||
|
|
3
11
|
process.env["TS_TEST"] ||
|
|
4
12
|
process.env.JEST_WORKER_ID !== undefined ||
|
|
5
13
|
process.env.NODE_ENV === "test");
|
package/lib/esm/isTsEnv.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTsEnv.js","sourceRoot":"","sources":["../../src/isTsEnv.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO
|
|
1
|
+
{"version":3,"file":"isTsEnv.js","sourceRoot":"","sources":["../../src/isTsEnv.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO;;IACrB,IAAI;QACF,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YAC9D,OAAO,IAAI,CAAC;SACb;KACF;IAAC,OAAO,EAAE,EAAE,GAAE;IACf,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;SAC1B,MAAA,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,0CAAE,QAAQ,CAAC,SAAS,CAAC,CAAA;QACrC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS;QACxC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAChC,CAAC;AACJ,CAAC","sourcesContent":["export function isTsEnv() {\n try {\n if (require && require.extensions && require.extensions[\".ts\"]) {\n return true;\n }\n } catch (er) {}\n return (\n process.env[\"TS_NODE_DEV\"] ||\n process.env[\"_\"]?.includes(\"ts-node\") ||\n process.env[\"TS_TEST\"] ||\n process.env.JEST_WORKER_ID !== undefined ||\n process.env.NODE_ENV === \"test\"\n );\n}\n"]}
|
package/lib/esm/normalizePath.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isArray, isString } from "@tsed/core";
|
|
2
2
|
import { join } from "path";
|
|
3
|
-
|
|
3
|
+
import fixPath from "normalize-path";
|
|
4
4
|
export function normalizePath(item, ...paths) {
|
|
5
5
|
if (isString(item)) {
|
|
6
6
|
const path = join(item, ...paths);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizePath.js","sourceRoot":"","sources":["../../src/normalizePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"normalizePath.js","sourceRoot":"","sources":["../../src/normalizePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAIrC,MAAM,UAAU,aAAa,CAAC,IAAS,EAAE,GAAG,KAAe;IACzD,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;QAClB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;KACtB;IAED,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;KACrD;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {isArray, isString} from \"@tsed/core\";\nimport {join} from \"path\";\nimport fixPath from \"normalize-path\";\n\nexport function normalizePath(item: string, ...paths: string[]): string;\nexport function normalizePath(item: (string | any)[]): (string | any)[];\nexport function normalizePath(item: any, ...paths: string[]) {\n if (isString(item)) {\n const path = join(item, ...paths);\n return fixPath(path);\n }\n\n if (isArray(item)) {\n return item.map((item: any) => normalizePath(item));\n }\n\n return item;\n}\n"]}
|
|
File without changes
|
|
File without changes
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
4
|
export * from "./cleanGlobPatterns";
|
|
5
|
+
export * from "./importComponents";
|
|
6
|
+
export * from "./importFiles";
|
|
7
|
+
export * from "./isTsEnv";
|
|
5
8
|
export * from "./normalizePath";
|
package/lib/types/isTsEnv.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function isTsEnv(): string | boolean | ((m: NodeJS.Module, filename: string) => any);
|
|
1
|
+
export declare function isTsEnv(): string | boolean;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/components-scan",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.10",
|
|
4
4
|
"description": "Components scan utilities for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/cjs/index.js",
|
|
8
|
+
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
"types": "./lib/types/index.d.ts",
|
|
@@ -13,29 +14,27 @@
|
|
|
13
14
|
"default": "./lib/esm/index.js"
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|
|
16
|
-
"build": "yarn run build:esm && yarn run build:cjs",
|
|
17
|
+
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
|
|
17
18
|
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
18
19
|
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
20
|
+
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
|
|
19
21
|
"test": "cross-env NODE_ENV=test jest"
|
|
20
22
|
},
|
|
21
23
|
"dependencies": {
|
|
22
|
-
"@tsed/core": "7.0.0-beta.1",
|
|
23
|
-
"@tsed/di": "7.0.0-beta.1",
|
|
24
24
|
"globby": "11.0.3",
|
|
25
25
|
"normalize-path": "3.0.0",
|
|
26
|
-
"tslib": "2.
|
|
26
|
+
"tslib": "2.3.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@tsed/
|
|
30
|
-
|
|
31
|
-
"peerDependencies": {
|
|
32
|
-
"@tsed/logger": ">=6.0.0"
|
|
29
|
+
"@tsed/core": "7.0.0-beta.10",
|
|
30
|
+
"@types/normalize-path": "^3.0.0"
|
|
33
31
|
},
|
|
32
|
+
"peerDependencies": {},
|
|
34
33
|
"repository": "https://github.com/tsedio/tsed",
|
|
35
34
|
"bugs": {
|
|
36
35
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
37
36
|
},
|
|
38
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
37
|
+
"homepage": "https://github.com/tsedio/tsed/tree/beta/packages/utils/components-scan",
|
|
39
38
|
"author": "Romain Lenzotti",
|
|
40
39
|
"license": "MIT"
|
|
41
40
|
}
|
package/readme.md
CHANGED
|
@@ -35,14 +35,12 @@ A package of Ts.ED framework. See website: https://tsed.io/
|
|
|
35
35
|
npm install --save @tsed/components-scan
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
39
38
|
## Backers
|
|
40
39
|
|
|
41
40
|
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
|
|
42
41
|
|
|
43
42
|
<a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a>
|
|
44
43
|
|
|
45
|
-
|
|
46
44
|
## Sponsors
|
|
47
45
|
|
|
48
46
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
|
|
@@ -8,16 +8,5 @@
|
|
|
8
8
|
"declaration": true,
|
|
9
9
|
"declarationDir": "./lib/types"
|
|
10
10
|
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"node_modules",
|
|
13
|
-
"test",
|
|
14
|
-
"lib",
|
|
15
|
-
"benchmark",
|
|
16
|
-
"coverage",
|
|
17
|
-
"spec",
|
|
18
|
-
"**/*.benchmark.ts",
|
|
19
|
-
"**/*.spec.ts",
|
|
20
|
-
"keys",
|
|
21
|
-
"jest.config.js"
|
|
22
|
-
]
|
|
11
|
+
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
|
|
23
12
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Test1.js","sourceRoot":"","sources":["../../../src/data/Test1.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAa,KAAK;CAAG;AAArB,sBAAqB","sourcesContent":["export const value1 = \"value\";\n\nexport class Test1 {}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Test2.js","sourceRoot":"","sources":["../../../src/data/Test2.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAa,KAAK;CAAG;AAArB,sBAAqB","sourcesContent":["export const value2 = \"value\";\n\nexport class Test2 {}\n"]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.importProviders = void 0;
|
|
4
|
-
const di_1 = require("@tsed/di");
|
|
5
|
-
const importComponents_1 = require("./importComponents");
|
|
6
|
-
async function recursiveImports(providers, settings, properties) {
|
|
7
|
-
const { exclude = [] } = settings;
|
|
8
|
-
const promises = providers
|
|
9
|
-
.map(({ token }) => di_1.GlobalProviders.get(token))
|
|
10
|
-
.filter((provider) => (provider === null || provider === void 0 ? void 0 : provider.type) === di_1.ProviderType.MODULE && provider.configuration)
|
|
11
|
-
.map((provider) => importProviders({ exclude, ...provider.configuration }, properties));
|
|
12
|
-
return (await Promise.all(promises)).flat();
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Import providers from given patterns.
|
|
16
|
-
*
|
|
17
|
-
* @param settings
|
|
18
|
-
* @param properties
|
|
19
|
-
*/
|
|
20
|
-
async function importProviders(settings, properties = ["imports"]) {
|
|
21
|
-
const { exclude = [] } = settings;
|
|
22
|
-
const disableComponentsScan = settings.disableComponentsScan || !!process.env.WEBPACK;
|
|
23
|
-
const promises = properties.map((key) => (0, importComponents_1.importComponents)(settings[key], exclude, disableComponentsScan));
|
|
24
|
-
const providers = (await Promise.all(promises)).flat();
|
|
25
|
-
const children = await recursiveImports(providers, settings, properties);
|
|
26
|
-
return [...children, ...providers];
|
|
27
|
-
}
|
|
28
|
-
exports.importProviders = importProviders;
|
|
29
|
-
//# sourceMappingURL=importProviders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"importProviders.js","sourceRoot":"","sources":["../../src/importProviders.ts"],"names":[],"mappings":";;;AAAA,iCAAiE;AACjE,yDAAoD;AAEpD,KAAK,UAAU,gBAAgB,CAAC,SAA4C,EAAE,QAAqC,EAAE,UAAoB;IACvI,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,QAAQ,CAAC;IAEhC,MAAM,QAAQ,GAAG,SAAS;SACvB,GAAG,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,oBAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC5C,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,iBAAY,CAAC,MAAM,IAAI,QAAQ,CAAC,aAAa,CAAC;SACtF,GAAG,CAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,eAAe,CAAC,EAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,aAAa,EAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IAElG,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,eAAe,CACnC,QAAqC,EACrC,aAAuB,CAAC,SAAS,CAAC;IAElC,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,QAAQ,CAAC;IAChC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,qBAAqB,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAEtF,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,mCAAgB,EAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC1G,MAAM,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEzE,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,SAAS,CAAC,CAAC;AACrC,CAAC;AAZD,0CAYC","sourcesContent":["import {GlobalProviders, Provider, ProviderType} from \"@tsed/di\";\nimport {importComponents} from \"./importComponents\";\n\nasync function recursiveImports(providers: {token: string; route?: string}[], settings: Partial<TsED.Configuration>, properties: string[]) {\n const {exclude = []} = settings;\n\n const promises = providers\n .map(({token}) => GlobalProviders.get(token))\n .filter((provider) => provider?.type === ProviderType.MODULE && provider.configuration)\n .map((provider: Provider) => importProviders({exclude, ...provider.configuration}, properties));\n\n return (await Promise.all(promises)).flat();\n}\n\n/**\n * Import providers from given patterns.\n *\n * @param settings\n * @param properties\n */\nexport async function importProviders(\n settings: Partial<TsED.Configuration>,\n properties: string[] = [\"imports\"]\n): Promise<{token: string; route?: string}[]> {\n const {exclude = []} = settings;\n const disableComponentsScan = settings.disableComponentsScan || !!process.env.WEBPACK;\n\n const promises = properties.map((key) => importComponents(settings[key], exclude, disableComponentsScan));\n const providers = (await Promise.all(promises)).flat();\n const children = await recursiveImports(providers, settings, properties);\n\n return [...children, ...providers];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Test1.js","sourceRoot":"","sources":["../../../src/data/Test1.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAM,OAAO,KAAK;CAAG","sourcesContent":["export const value1 = \"value\";\n\nexport class Test1 {}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Test2.js","sourceRoot":"","sources":["../../../src/data/Test2.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAM,OAAO,KAAK;CAAG","sourcesContent":["export const value2 = \"value\";\n\nexport class Test2 {}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { GlobalProviders, ProviderType } from "@tsed/di";
|
|
2
|
-
import { importComponents } from "./importComponents";
|
|
3
|
-
async function recursiveImports(providers, settings, properties) {
|
|
4
|
-
const { exclude = [] } = settings;
|
|
5
|
-
const promises = providers
|
|
6
|
-
.map(({ token }) => GlobalProviders.get(token))
|
|
7
|
-
.filter((provider) => (provider === null || provider === void 0 ? void 0 : provider.type) === ProviderType.MODULE && provider.configuration)
|
|
8
|
-
.map((provider) => importProviders({ exclude, ...provider.configuration }, properties));
|
|
9
|
-
return (await Promise.all(promises)).flat();
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Import providers from given patterns.
|
|
13
|
-
*
|
|
14
|
-
* @param settings
|
|
15
|
-
* @param properties
|
|
16
|
-
*/
|
|
17
|
-
export async function importProviders(settings, properties = ["imports"]) {
|
|
18
|
-
const { exclude = [] } = settings;
|
|
19
|
-
const disableComponentsScan = settings.disableComponentsScan || !!process.env.WEBPACK;
|
|
20
|
-
const promises = properties.map((key) => importComponents(settings[key], exclude, disableComponentsScan));
|
|
21
|
-
const providers = (await Promise.all(promises)).flat();
|
|
22
|
-
const children = await recursiveImports(providers, settings, properties);
|
|
23
|
-
return [...children, ...providers];
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=importProviders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"importProviders.js","sourceRoot":"","sources":["../../src/importProviders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAY,YAAY,EAAC,MAAM,UAAU,CAAC;AACjE,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAEpD,KAAK,UAAU,gBAAgB,CAAC,SAA4C,EAAE,QAAqC,EAAE,UAAoB;IACvI,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,QAAQ,CAAC;IAEhC,MAAM,QAAQ,GAAG,SAAS;SACvB,GAAG,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC5C,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,YAAY,CAAC,MAAM,IAAI,QAAQ,CAAC,aAAa,CAAC;SACtF,GAAG,CAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,eAAe,CAAC,EAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,aAAa,EAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IAElG,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAqC,EACrC,aAAuB,CAAC,SAAS,CAAC;IAElC,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,QAAQ,CAAC;IAChC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,qBAAqB,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAEtF,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAC1G,MAAM,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEzE,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,SAAS,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import {GlobalProviders, Provider, ProviderType} from \"@tsed/di\";\nimport {importComponents} from \"./importComponents\";\n\nasync function recursiveImports(providers: {token: string; route?: string}[], settings: Partial<TsED.Configuration>, properties: string[]) {\n const {exclude = []} = settings;\n\n const promises = providers\n .map(({token}) => GlobalProviders.get(token))\n .filter((provider) => provider?.type === ProviderType.MODULE && provider.configuration)\n .map((provider: Provider) => importProviders({exclude, ...provider.configuration}, properties));\n\n return (await Promise.all(promises)).flat();\n}\n\n/**\n * Import providers from given patterns.\n *\n * @param settings\n * @param properties\n */\nexport async function importProviders(\n settings: Partial<TsED.Configuration>,\n properties: string[] = [\"imports\"]\n): Promise<{token: string; route?: string}[]> {\n const {exclude = []} = settings;\n const disableComponentsScan = settings.disableComponentsScan || !!process.env.WEBPACK;\n\n const promises = properties.map((key) => importComponents(settings[key], exclude, disableComponentsScan));\n const providers = (await Promise.all(promises)).flat();\n const children = await recursiveImports(providers, settings, properties);\n\n return [...children, ...providers];\n}\n"]}
|