@teambit/dependencies 1.0.675 → 1.0.677

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.
Files changed (29) hide show
  1. package/dependencies-loader/auto-detect-deps.ts +1 -2
  2. package/dist/dependencies-loader/auto-detect-deps.d.ts +1 -2
  3. package/dist/dependencies-loader/auto-detect-deps.js.map +1 -1
  4. package/dist/esm.mjs +0 -1
  5. package/dist/files-dependency-builder/filing-cabinet/index.d.ts +1 -1
  6. package/dist/files-dependency-builder/filing-cabinet/index.js +4 -4
  7. package/dist/files-dependency-builder/filing-cabinet/index.js.map +1 -1
  8. package/dist/files-dependency-builder/filing-cabinet/index.spec.js.map +1 -1
  9. package/dist/files-dependency-builder/precinct/index.d.ts +1 -1
  10. package/dist/files-dependency-builder/precinct/index.js +4 -4
  11. package/dist/files-dependency-builder/precinct/index.js.map +1 -1
  12. package/dist/files-dependency-builder/precinct/index.spec.js.map +1 -1
  13. package/dist/files-dependency-builder/types/dependency-tree-type.d.ts +1 -1
  14. package/dist/files-dependency-builder/types/dependency-tree-type.js.map +1 -1
  15. package/dist/index.d.ts +0 -1
  16. package/dist/index.js +0 -25
  17. package/dist/index.js.map +1 -1
  18. package/esm.mjs +0 -1
  19. package/files-dependency-builder/filing-cabinet/index.spec.ts +1 -1
  20. package/files-dependency-builder/filing-cabinet/index.ts +2 -2
  21. package/files-dependency-builder/precinct/index.spec.ts +1 -1
  22. package/files-dependency-builder/precinct/index.ts +2 -2
  23. package/files-dependency-builder/types/dependency-tree-type.ts +1 -1
  24. package/package.json +21 -21
  25. package/dist/files-dependency-builder/detector-hook.d.ts +0 -48
  26. package/dist/files-dependency-builder/detector-hook.js +0 -31
  27. package/dist/files-dependency-builder/detector-hook.js.map +0 -1
  28. package/files-dependency-builder/detector-hook.ts +0 -73
  29. /package/dist/{preview-1753990279797.js → preview-1753998672851.js} +0 -0
@@ -1,48 +0,0 @@
1
- export type FileContext = {
2
- /**
3
- * extension of the file. (e.g. `.js`, '.jsx', '.ts', etc.)
4
- */
5
- ext: string;
6
- filename: string;
7
- };
8
- export type DependencyContext = {
9
- /**
10
- * name of the dependency.
11
- * e.g. `lodash` in `import _ from 'lodash'`
12
- */
13
- dependency: string;
14
- /**
15
- * name of the file.
16
- */
17
- filename: string;
18
- /**
19
- * directory of the file.
20
- */
21
- directory: string;
22
- };
23
- export interface DependencyDetector {
24
- /**
25
- * determine whether to apply on given file.
26
- */
27
- isSupported(context: FileContext): boolean;
28
- /**
29
- * determine what type of content the detector is for.
30
- * by default, the type is the extension name of the file (without the dot)
31
- * if no type provided.
32
- */
33
- type?: string;
34
- /**
35
- * detect file dependencies. list of file dependencies of the module.
36
- */
37
- detect(fileContent: string): string[];
38
- /**
39
- * resolve the imported file location
40
- * @param file
41
- */
42
- dependencyLookup?(file: DependencyContext): string;
43
- }
44
- export declare class DetectorHook {
45
- static hooks: DependencyDetector[];
46
- isSupported(ext: string, filename: string): boolean;
47
- getDetector(ext: string, filename: string): DependencyDetector | undefined;
48
- }
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DetectorHook = void 0;
7
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
- class DetectorHook {
11
- isSupported(ext, filename) {
12
- return !!DetectorHook.hooks.find(hook => {
13
- return hook.isSupported({
14
- ext,
15
- filename
16
- });
17
- });
18
- }
19
- getDetector(ext, filename) {
20
- return DetectorHook.hooks.find(hook => {
21
- return hook.isSupported({
22
- ext,
23
- filename
24
- });
25
- });
26
- }
27
- }
28
- exports.DetectorHook = DetectorHook;
29
- _defineProperty(DetectorHook, "hooks", []);
30
-
31
- //# sourceMappingURL=detector-hook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["DetectorHook","isSupported","ext","filename","hooks","find","hook","getDetector","exports","_defineProperty"],"sources":["detector-hook.ts"],"sourcesContent":["export type FileContext = {\n /**\n * extension of the file. (e.g. `.js`, '.jsx', '.ts', etc.)\n */\n ext: string;\n\n filename: string;\n};\n\nexport type DependencyContext = {\n /**\n * name of the dependency.\n * e.g. `lodash` in `import _ from 'lodash'`\n */\n dependency: string;\n\n /**\n * name of the file.\n */\n filename: string;\n\n /**\n * directory of the file.\n */\n directory: string;\n};\n\nexport interface DependencyDetector {\n /**\n * determine whether to apply on given file.\n */\n isSupported(context: FileContext): boolean;\n\n /**\n * determine what type of content the detector is for.\n * by default, the type is the extension name of the file (without the dot)\n * if no type provided.\n */\n type?: string;\n\n /**\n * detect file dependencies. list of file dependencies of the module.\n */\n detect(fileContent: string): string[];\n\n /**\n * resolve the imported file location\n * @param file\n */\n dependencyLookup?(file: DependencyContext): string;\n}\n\nexport class DetectorHook {\n static hooks: DependencyDetector[] = [];\n\n isSupported(ext: string, filename: string): boolean {\n return !!DetectorHook.hooks.find((hook) => {\n return hook.isSupported({\n ext,\n filename,\n });\n });\n }\n\n getDetector(ext: string, filename: string): DependencyDetector | undefined {\n return DetectorHook.hooks.find((hook) => {\n return hook.isSupported({\n ext,\n filename,\n });\n });\n }\n}\n"],"mappings":";;;;;;;;;AAoDO,MAAMA,YAAY,CAAC;EAGxBC,WAAWA,CAACC,GAAW,EAAEC,QAAgB,EAAW;IAClD,OAAO,CAAC,CAACH,YAAY,CAACI,KAAK,CAACC,IAAI,CAAEC,IAAI,IAAK;MACzC,OAAOA,IAAI,CAACL,WAAW,CAAC;QACtBC,GAAG;QACHC;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EAEAI,WAAWA,CAACL,GAAW,EAAEC,QAAgB,EAAkC;IACzE,OAAOH,YAAY,CAACI,KAAK,CAACC,IAAI,CAAEC,IAAI,IAAK;MACvC,OAAOA,IAAI,CAACL,WAAW,CAAC;QACtBC,GAAG;QACHC;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF;AAACK,OAAA,CAAAR,YAAA,GAAAA,YAAA;AAAAS,eAAA,CApBYT,YAAY,WACc,EAAE","ignoreList":[]}
@@ -1,73 +0,0 @@
1
- export type FileContext = {
2
- /**
3
- * extension of the file. (e.g. `.js`, '.jsx', '.ts', etc.)
4
- */
5
- ext: string;
6
-
7
- filename: string;
8
- };
9
-
10
- export type DependencyContext = {
11
- /**
12
- * name of the dependency.
13
- * e.g. `lodash` in `import _ from 'lodash'`
14
- */
15
- dependency: string;
16
-
17
- /**
18
- * name of the file.
19
- */
20
- filename: string;
21
-
22
- /**
23
- * directory of the file.
24
- */
25
- directory: string;
26
- };
27
-
28
- export interface DependencyDetector {
29
- /**
30
- * determine whether to apply on given file.
31
- */
32
- isSupported(context: FileContext): boolean;
33
-
34
- /**
35
- * determine what type of content the detector is for.
36
- * by default, the type is the extension name of the file (without the dot)
37
- * if no type provided.
38
- */
39
- type?: string;
40
-
41
- /**
42
- * detect file dependencies. list of file dependencies of the module.
43
- */
44
- detect(fileContent: string): string[];
45
-
46
- /**
47
- * resolve the imported file location
48
- * @param file
49
- */
50
- dependencyLookup?(file: DependencyContext): string;
51
- }
52
-
53
- export class DetectorHook {
54
- static hooks: DependencyDetector[] = [];
55
-
56
- isSupported(ext: string, filename: string): boolean {
57
- return !!DetectorHook.hooks.find((hook) => {
58
- return hook.isSupported({
59
- ext,
60
- filename,
61
- });
62
- });
63
- }
64
-
65
- getDetector(ext: string, filename: string): DependencyDetector | undefined {
66
- return DetectorHook.hooks.find((hook) => {
67
- return hook.isSupported({
68
- ext,
69
- filename,
70
- });
71
- });
72
- }
73
- }