@tsed/components-scan 6.102.4 → 6.102.8-rc.1

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/index.js CHANGED
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  (0, tslib_1.__exportStar)(require("./importFiles"), exports);
5
5
  (0, tslib_1.__exportStar)(require("./importComponents"), exports);
6
- (0, tslib_1.__exportStar)(require("./importProviders"), exports);
7
6
  (0, tslib_1.__exportStar)(require("./cleanGlobPatterns"), exports);
8
7
  (0, tslib_1.__exportStar)(require("./normalizePath"), exports);
9
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAC9B,kEAAmC;AACnC,iEAAkC;AAClC,mEAAoC;AACpC,+DAAgC","sourcesContent":["export * from \"./importFiles\";\nexport * from \"./importComponents\";\nexport * from \"./importProviders\";\nexport * from \"./cleanGlobPatterns\";\nexport * from \"./normalizePath\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAC9B,kEAAmC;AACnC,mEAAoC;AACpC,+DAAgC","sourcesContent":["export * from \"./importFiles\";\nexport * from \"./importComponents\";\nexport * from \"./cleanGlobPatterns\";\nexport * from \"./normalizePath\";\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -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
  }
@@ -1,5 +1,5 @@
1
1
  import { isArray, isClass } from "@tsed/core";
2
- import { importFiles } from "./importFiles";
2
+ import { importFiles } from "./importFiles.js";
3
3
  async function resolveSymbols(item, excludes, disableComponentsScan = false) {
4
4
  if (isClass(item)) {
5
5
  return [item];
@@ -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,5 @@
1
- export * from "./importFiles";
2
- export * from "./importComponents";
3
- export * from "./importProviders";
4
- export * from "./cleanGlobPatterns";
5
- export * from "./normalizePath";
1
+ export * from "./importFiles.js";
2
+ export * from "./importComponents.js";
3
+ export * from "./cleanGlobPatterns.js";
4
+ export * from "./normalizePath.js";
6
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./importFiles\";\nexport * from \"./importComponents\";\nexport * from \"./importProviders\";\nexport * from \"./cleanGlobPatterns\";\nexport * from \"./normalizePath\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./importFiles\";\nexport * from \"./importComponents\";\nexport * from \"./cleanGlobPatterns\";\nexport * from \"./normalizePath\";\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -1,5 +1,4 @@
1
1
  export * from "./importFiles";
2
2
  export * from "./importComponents";
3
- export * from "./importProviders";
4
3
  export * from "./cleanGlobPatterns";
5
4
  export * from "./normalizePath";
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tsed/components-scan",
3
- "version": "6.102.4",
3
+ "version": "6.102.8-rc.1",
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",
@@ -24,16 +25,17 @@
24
25
  "tslib": "2.2.0"
25
26
  },
26
27
  "devDependencies": {
27
- "@tsed/core": "6.102.4",
28
- "@tsed/di": "6.102.4",
28
+ "@tsed/core": "6.102.8-rc.1",
29
29
  "@types/normalize-path": "^3.0.0"
30
30
  },
31
- "peerDependencies": {},
31
+ "peerDependencies": {
32
+ "@tsed/core": "^6.102.8-rc.1"
33
+ },
32
34
  "repository": "https://github.com/tsedio/tsed",
33
35
  "bugs": {
34
36
  "url": "https://github.com/tsedio/tsed/issues"
35
37
  },
36
- "homepage": "https://github.com/tsedio/tsed/tree/production/packages/utils/components-scan",
38
+ "homepage": "https://github.com/tsedio/tsed/tree/rc/packages/utils/components-scan",
37
39
  "author": "Romain Lenzotti",
38
40
  "license": "MIT"
39
41
  }
@@ -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,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"]}
@@ -1,10 +0,0 @@
1
- /**
2
- * Import providers from given patterns.
3
- *
4
- * @param settings
5
- * @param properties
6
- */
7
- export declare function importProviders(settings: Partial<TsED.Configuration>, properties?: string[]): Promise<{
8
- token: string;
9
- route?: string;
10
- }[]>;