@teambit/mdx 1.0.873 → 1.0.875

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 (24) hide show
  1. package/artifacts/env-template/public/{252.a39dd47690eab9167170.js → 109.9609f5b547c3df95058d.js} +2 -2
  2. package/artifacts/env-template/public/{130.fd2769bf3230b204a5d1.js → 748.16dc13641be0d7939e29.js} +1 -1
  3. package/artifacts/env-template/public/assets-manifest.json +14 -14
  4. package/artifacts/env-template/public/compositions.483d6c0fd7e3260a4d27.js +13 -0
  5. package/artifacts/env-template/public/compositions.html +1 -1
  6. package/artifacts/env-template/public/overview.5968177b3aa538089c1f.js +2 -0
  7. package/artifacts/env-template/public/overview.html +1 -1
  8. package/artifacts/env-template/public/peers.1539e1a677bebcba0cb3.js +1 -0
  9. package/artifacts/env-template/public/{preview-root.17e7740f9d736e233ce9.js → preview-root.52056787c16e4e9319ce.js} +1 -1
  10. package/{compositions-1769133677839.js → compositions-1770145450170.js} +2 -2
  11. package/dist/mdx.detector.d.ts +12 -1
  12. package/dist/mdx.detector.js +108 -9
  13. package/dist/mdx.detector.js.map +1 -1
  14. package/dist/mdx.detector.spec.js +246 -28
  15. package/dist/mdx.detector.spec.js.map +1 -1
  16. package/dist/mdx.main.runtime.js +1 -1
  17. package/dist/mdx.main.runtime.js.map +1 -1
  18. package/dist/{preview-1769133677839.js → preview-1770145450170.js} +2 -2
  19. package/{overview-1769133677839.js → overview-1770145450170.js} +2 -2
  20. package/package.json +15 -15
  21. package/artifacts/env-template/public/compositions.c75ba7de5a9add96e0d5.js +0 -13
  22. package/artifacts/env-template/public/overview.346c56606d1da48244b8.js +0 -2
  23. package/artifacts/env-template/public/peers.3b83d1fcc7ea8644d4c9.js +0 -1
  24. /package/artifacts/env-template/public/static/css/{252.7feb48c6.css → 109.7feb48c6.css} +0 -0
@@ -1,5 +1,5 @@
1
1
 
2
- import { linkModules } from '/home/circleci/.bvm/versions/1.13.42/bit-1.13.42/node_modules/@teambit/preview/dist/preview-modules.js';
2
+ import { linkModules } from '/home/circleci/.bvm/versions/1.13.45/bit-1.13.45/node_modules/@teambit/preview/dist/preview-modules.js';
3
3
 
4
4
  // strip leading/trailing slashes from any id we compare
5
5
  function __bitNormalizeId(id) {
@@ -44,7 +44,7 @@ function __bitSurfaceToOverlay(err, componentId) {
44
44
  }, 0);
45
45
  }
46
46
 
47
- import {defaultMainModule} from "/home/circleci/bit/bit/node_modules/@teambit/_local/preview-modules-aa880bdba40b9af1d8fe895dca476e207182accb.mjs";
47
+ import {defaultMainModule} from "/home/circleci/bit/bit/node_modules/@teambit/_local/preview-modules-139de64abf5d134f0b08ed2465dac768a4bea720.mjs";
48
48
  (async function initializeModules() {
49
49
 
50
50
 
@@ -1,7 +1,18 @@
1
1
  import type { DependencyDetector, FileContext } from '@teambit/dependency-resolver';
2
+ import type { Logger } from '@teambit/logger';
3
+ /**
4
+ * Regex-based fallback for extracting import sources from MDX files.
5
+ * Used when compileSync fails due to MDX v3 syntax incompatibilities in user content
6
+ * (e.g. HTML comments, escaped characters, bare variable declarations, unclosed tags).
7
+ *
8
+ * Matches both standard imports (import x from "y") and side-effect imports (import "y").
9
+ */
10
+ export declare function detectImportsWithRegex(source: string): string[];
2
11
  export declare class MDXDependencyDetector implements DependencyDetector {
3
12
  private supportedExtensions;
4
- constructor(supportedExtensions: string[]);
13
+ private logger?;
14
+ private currentFilename?;
15
+ constructor(supportedExtensions: string[], logger?: Logger);
5
16
  isSupported(context: FileContext): boolean;
6
17
  detect(source: string): string[];
7
18
  }
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.MDXDependencyDetector = void 0;
7
+ exports.detectImportsWithRegex = detectImportsWithRegex;
7
8
  function _mdx() {
8
9
  const data = require("@mdx-js/mdx");
9
10
  _mdx = function () {
@@ -18,22 +19,120 @@ function _mdxModules() {
18
19
  };
19
20
  return data;
20
21
  }
22
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
+ 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; }
25
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
26
+ 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); }
27
+ /**
28
+ * MDX options for dependency detection only.
29
+ * Uses the remark plugins from mdxOptions (for frontmatter and import extraction)
30
+ * but excludes rehype plugins like rehypeMdxCodeProps that fail on legacy
31
+ * code fence meta syntax (e.g. `live=true`).
32
+ *
33
+ * Computed lazily to avoid triggering the mdx-v3-options dependency chain
34
+ * (~180 files) during bootstrap for commands that don't need MDX processing.
35
+ */
36
+ let _detectorMdxOptions;
37
+ function getDetectorMdxOptions() {
38
+ if (!_detectorMdxOptions) {
39
+ _detectorMdxOptions = _objectSpread(_objectSpread({}, _mdxModules().mdxOptions.remarkPlugins && {
40
+ remarkPlugins: _mdxModules().mdxOptions.remarkPlugins
41
+ }), _mdxModules().mdxOptions.jsxImportSource && {
42
+ jsxImportSource: _mdxModules().mdxOptions.jsxImportSource
43
+ });
44
+ }
45
+ return _detectorMdxOptions;
46
+ }
47
+
48
+ /**
49
+ * Regex pattern for matching import statements in JavaScript/TypeScript.
50
+ *
51
+ * Structure: /import\s+(?:PATTERN_A|PATTERN_B)/g
52
+ * - The `import\s+` prefix is OUTSIDE the alternation, so both patterns require the import keyword
53
+ *
54
+ * This regex matches two import patterns in an alternation:
55
+ *
56
+ * PATTERN_A (captured in group 1): [type] <specifiers> from "module"
57
+ * - Optional "type" keyword for TypeScript type imports
58
+ * - Specifiers can be: default (x), named ({x}), namespace (* as x), or mixed (x, {y})
59
+ * - Followed by the `from` keyword and quoted module path
60
+ * - Module path is captured in group 1
61
+ *
62
+ * PATTERN_B (captured in group 2): "module"
63
+ * - Side-effect only imports with no specifiers, just quoted module path
64
+ * - The quotes directly follow `import` with only whitespace in between
65
+ * - Module path is captured in group 2
66
+ * - Note: This will NOT match random quoted strings in code (e.g., const x = "foo")
67
+ * because the `import\s+` prefix is required
68
+ *
69
+ * Example matches:
70
+ * import x from "y" -> group 1: "y"
71
+ * import { x } from "y" -> group 1: "y"
72
+ * import * as x from "y" -> group 1: "y"
73
+ * import x, { y } from "z" -> group 1: "z"
74
+ * import type { T } from "y" -> group 1: "y"
75
+ * import "y" -> group 2: "y"
76
+ *
77
+ * Limitations:
78
+ * - Will match imports in comments (e.g., // import "x")
79
+ * - Will match imports in code blocks/strings if they appear to be syntactically valid
80
+ * - These are acceptable trade-offs for the fallback mode
81
+ */
82
+ const IMPORT_STATEMENT_REGEX = /import\s+(?:(?:type\s+)?(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)(?:\s*,\s*\{[^}]*\}|\s*,\s*\w+)?\s+from\s+['"]([^'"]+)['"]|['"]([^'"]+)['"])/g;
83
+
84
+ /**
85
+ * Regex-based fallback for extracting import sources from MDX files.
86
+ * Used when compileSync fails due to MDX v3 syntax incompatibilities in user content
87
+ * (e.g. HTML comments, escaped characters, bare variable declarations, unclosed tags).
88
+ *
89
+ * Matches both standard imports (import x from "y") and side-effect imports (import "y").
90
+ */
91
+ function detectImportsWithRegex(source) {
92
+ const modules = [];
93
+ let match;
94
+ // Reset regex state before use
95
+ IMPORT_STATEMENT_REGEX.lastIndex = 0;
96
+ while ((match = IMPORT_STATEMENT_REGEX.exec(source)) !== null) {
97
+ // Use whichever capture group matched (group 1 for "from" imports, group 2 for side-effect imports)
98
+ const moduleName = match[1] || match[2];
99
+ if (moduleName) modules.push(moduleName);
100
+ }
101
+ return modules;
102
+ }
21
103
  class MDXDependencyDetector {
22
- constructor(supportedExtensions) {
104
+ constructor(supportedExtensions, logger) {
23
105
  this.supportedExtensions = supportedExtensions;
106
+ _defineProperty(this, "logger", void 0);
107
+ _defineProperty(this, "currentFilename", void 0);
108
+ this.logger = logger;
109
+ // Bind detect to preserve `this` context when passed as a detached function.
110
+ this.detect = this.detect.bind(this);
24
111
  }
25
112
  isSupported(context) {
113
+ // Capture filename for use in detect() warning messages.
114
+ // isSupported is always called immediately before detect() for the same file.
115
+ this.currentFilename = context.filename;
26
116
  return this.supportedExtensions.includes(context.ext);
27
117
  }
28
118
  detect(source) {
29
- var _output$data;
30
- const output = (0, _mdx().compileSync)(source, _mdxModules().mdxOptions);
31
- const imports = ((_output$data = output.data) === null || _output$data === void 0 ? void 0 : _output$data.imports) || [];
32
- if (!imports.length) return [];
33
- const files = imports.map(importSpec => {
34
- return importSpec.fromModule;
35
- });
36
- return files;
119
+ const filename = this.currentFilename;
120
+ try {
121
+ var _output$data;
122
+ const output = (0, _mdx().compileSync)(source, getDetectorMdxOptions());
123
+ const imports = ((_output$data = output.data) === null || _output$data === void 0 ? void 0 : _output$data.imports) || [];
124
+ if (!imports.length) return [];
125
+ return imports.map(importSpec => importSpec.fromModule);
126
+ } catch (err) {
127
+ var _this$logger;
128
+ // MDX v3 may fail to compile files with legacy syntax (HTML comments, escaped
129
+ // characters in prose, bare variable declarations, unclosed tags, etc.).
130
+ // Fall back to regex-based import detection which is sufficient for dependency resolution.
131
+ const fileRef = filename ? ` File: ${filename}` : '';
132
+ const msg = `MDX compilation failed, falling back to regex-based import detection.${fileRef} Error: ${err.message}`;
133
+ (_this$logger = this.logger) === null || _this$logger === void 0 || _this$logger.consoleWarning(msg);
134
+ return detectImportsWithRegex(source);
135
+ }
37
136
  }
38
137
  }
39
138
  exports.MDXDependencyDetector = MDXDependencyDetector;
@@ -1 +1 @@
1
- {"version":3,"names":["_mdx","data","require","_mdxModules","MDXDependencyDetector","constructor","supportedExtensions","isSupported","context","includes","ext","detect","source","_output$data","output","compileSync","mdxOptions","imports","length","files","map","importSpec","fromModule","exports"],"sources":["mdx.detector.ts"],"sourcesContent":["import type { DependencyDetector, FileContext } from '@teambit/dependency-resolver';\nimport { compileSync } from '@mdx-js/mdx';\nimport { mdxOptions } from '@teambit/mdx.modules.mdx-v3-options';\n\ntype ImportSpecifier = {\n /**\n * relative/absolute or module name. e.g. the `y` in the example of `import x from 'y';`\n */\n fromModule: string;\n\n /**\n * is default import (e.g. `import x from 'y';`)\n */\n isDefault?: boolean;\n\n /**\n * the name used to identify the module, e.g. the `x` in the example of `import x from 'y';`\n */\n identifier?: string;\n};\n\nexport class MDXDependencyDetector implements DependencyDetector {\n constructor(private supportedExtensions: string[]) {}\n\n isSupported(context: FileContext): boolean {\n return this.supportedExtensions.includes(context.ext);\n }\n\n detect(source: string): string[] {\n const output = compileSync(source, mdxOptions);\n const imports = (output.data?.imports as ImportSpecifier[]) || [];\n if (!imports.length) return [];\n const files: string[] = imports.map((importSpec) => {\n return importSpec.fromModule;\n });\n\n return files;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAmBO,MAAMG,qBAAqB,CAA+B;EAC/DC,WAAWA,CAASC,mBAA6B,EAAE;IAAA,KAA/BA,mBAA6B,GAA7BA,mBAA6B;EAAG;EAEpDC,WAAWA,CAACC,OAAoB,EAAW;IACzC,OAAO,IAAI,CAACF,mBAAmB,CAACG,QAAQ,CAACD,OAAO,CAACE,GAAG,CAAC;EACvD;EAEAC,MAAMA,CAACC,MAAc,EAAY;IAAA,IAAAC,YAAA;IAC/B,MAAMC,MAAM,GAAG,IAAAC,kBAAW,EAACH,MAAM,EAAEI,wBAAU,CAAC;IAC9C,MAAMC,OAAO,GAAG,EAAAJ,YAAA,GAACC,MAAM,CAACb,IAAI,cAAAY,YAAA,uBAAXA,YAAA,CAAaI,OAAO,KAA0B,EAAE;IACjE,IAAI,CAACA,OAAO,CAACC,MAAM,EAAE,OAAO,EAAE;IAC9B,MAAMC,KAAe,GAAGF,OAAO,CAACG,GAAG,CAAEC,UAAU,IAAK;MAClD,OAAOA,UAAU,CAACC,UAAU;IAC9B,CAAC,CAAC;IAEF,OAAOH,KAAK;EACd;AACF;AAACI,OAAA,CAAAnB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_mdx","data","require","_mdxModules","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","_detectorMdxOptions","getDetectorMdxOptions","mdxOptions","remarkPlugins","jsxImportSource","IMPORT_STATEMENT_REGEX","detectImportsWithRegex","source","modules","match","lastIndex","exec","moduleName","MDXDependencyDetector","constructor","supportedExtensions","logger","detect","bind","isSupported","context","currentFilename","filename","includes","ext","_output$data","output","compileSync","imports","map","importSpec","fromModule","err","_this$logger","fileRef","msg","message","consoleWarning","exports"],"sources":["mdx.detector.ts"],"sourcesContent":["import type { DependencyDetector, FileContext } from '@teambit/dependency-resolver';\nimport { compileSync } from '@mdx-js/mdx';\nimport { mdxOptions } from '@teambit/mdx.modules.mdx-v3-options';\nimport type { Logger } from '@teambit/logger';\n\ntype ImportSpecifier = {\n /**\n * relative/absolute or module name. e.g. the `y` in the example of `import x from 'y';`\n */\n fromModule: string;\n\n /**\n * is default import (e.g. `import x from 'y';`)\n */\n isDefault?: boolean;\n\n /**\n * the name used to identify the module, e.g. the `x` in the example of `import x from 'y';`\n */\n identifier?: string;\n};\n\n/**\n * MDX options for dependency detection only.\n * Uses the remark plugins from mdxOptions (for frontmatter and import extraction)\n * but excludes rehype plugins like rehypeMdxCodeProps that fail on legacy\n * code fence meta syntax (e.g. `live=true`).\n *\n * Computed lazily to avoid triggering the mdx-v3-options dependency chain\n * (~180 files) during bootstrap for commands that don't need MDX processing.\n */\nlet _detectorMdxOptions: Record<string, any> | undefined;\nfunction getDetectorMdxOptions() {\n if (!_detectorMdxOptions) {\n _detectorMdxOptions = {\n ...(mdxOptions.remarkPlugins && { remarkPlugins: mdxOptions.remarkPlugins }),\n ...(mdxOptions.jsxImportSource && { jsxImportSource: mdxOptions.jsxImportSource }),\n };\n }\n return _detectorMdxOptions;\n}\n\n/**\n * Regex pattern for matching import statements in JavaScript/TypeScript.\n *\n * Structure: /import\\s+(?:PATTERN_A|PATTERN_B)/g\n * - The `import\\s+` prefix is OUTSIDE the alternation, so both patterns require the import keyword\n *\n * This regex matches two import patterns in an alternation:\n *\n * PATTERN_A (captured in group 1): [type] <specifiers> from \"module\"\n * - Optional \"type\" keyword for TypeScript type imports\n * - Specifiers can be: default (x), named ({x}), namespace (* as x), or mixed (x, {y})\n * - Followed by the `from` keyword and quoted module path\n * - Module path is captured in group 1\n *\n * PATTERN_B (captured in group 2): \"module\"\n * - Side-effect only imports with no specifiers, just quoted module path\n * - The quotes directly follow `import` with only whitespace in between\n * - Module path is captured in group 2\n * - Note: This will NOT match random quoted strings in code (e.g., const x = \"foo\")\n * because the `import\\s+` prefix is required\n *\n * Example matches:\n * import x from \"y\" -> group 1: \"y\"\n * import { x } from \"y\" -> group 1: \"y\"\n * import * as x from \"y\" -> group 1: \"y\"\n * import x, { y } from \"z\" -> group 1: \"z\"\n * import type { T } from \"y\" -> group 1: \"y\"\n * import \"y\" -> group 2: \"y\"\n *\n * Limitations:\n * - Will match imports in comments (e.g., // import \"x\")\n * - Will match imports in code blocks/strings if they appear to be syntactically valid\n * - These are acceptable trade-offs for the fallback mode\n */\nconst IMPORT_STATEMENT_REGEX =\n /import\\s+(?:(?:type\\s+)?(?:\\{[^}]*\\}|\\*\\s+as\\s+\\w+|\\w+)(?:\\s*,\\s*\\{[^}]*\\}|\\s*,\\s*\\w+)?\\s+from\\s+['\"]([^'\"]+)['\"]|['\"]([^'\"]+)['\"])/g;\n\n/**\n * Regex-based fallback for extracting import sources from MDX files.\n * Used when compileSync fails due to MDX v3 syntax incompatibilities in user content\n * (e.g. HTML comments, escaped characters, bare variable declarations, unclosed tags).\n *\n * Matches both standard imports (import x from \"y\") and side-effect imports (import \"y\").\n */\nexport function detectImportsWithRegex(source: string): string[] {\n const modules: string[] = [];\n let match: RegExpExecArray | null;\n // Reset regex state before use\n IMPORT_STATEMENT_REGEX.lastIndex = 0;\n while ((match = IMPORT_STATEMENT_REGEX.exec(source)) !== null) {\n // Use whichever capture group matched (group 1 for \"from\" imports, group 2 for side-effect imports)\n const moduleName = match[1] || match[2];\n if (moduleName) modules.push(moduleName);\n }\n return modules;\n}\n\nexport class MDXDependencyDetector implements DependencyDetector {\n private logger?: Logger;\n private currentFilename?: string;\n\n constructor(\n private supportedExtensions: string[],\n logger?: Logger\n ) {\n this.logger = logger;\n // Bind detect to preserve `this` context when passed as a detached function.\n this.detect = this.detect.bind(this);\n }\n\n isSupported(context: FileContext): boolean {\n // Capture filename for use in detect() warning messages.\n // isSupported is always called immediately before detect() for the same file.\n this.currentFilename = context.filename;\n return this.supportedExtensions.includes(context.ext);\n }\n\n detect(source: string): string[] {\n const filename = this.currentFilename;\n try {\n const output = compileSync(source, getDetectorMdxOptions());\n const imports = (output.data?.imports as ImportSpecifier[]) || [];\n if (!imports.length) return [];\n return imports.map((importSpec) => importSpec.fromModule);\n } catch (err: any) {\n // MDX v3 may fail to compile files with legacy syntax (HTML comments, escaped\n // characters in prose, bare variable declarations, unclosed tags, etc.).\n // Fall back to regex-based import detection which is sufficient for dependency resolution.\n const fileRef = filename ? ` File: ${filename}` : '';\n const msg = `MDX compilation failed, falling back to regex-based import detection.${fileRef} Error: ${err.message}`;\n this.logger?.consoleWarning(msg);\n return detectImportsWithRegex(source);\n }\n }\n}\n"],"mappings":";;;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiE,SAAAG,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,C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;EAEAC,WAAWA,CAACC,OAAoB,EAAW;IACzC;IACA;IACA,IAAI,CAACC,eAAe,GAAGD,OAAO,CAACE,QAAQ;IACvC,OAAO,IAAI,CAACP,mBAAmB,CAACQ,QAAQ,CAACH,OAAO,CAACI,GAAG,CAAC;EACvD;EAEAP,MAAMA,CAACV,MAAc,EAAY;IAC/B,MAAMe,QAAQ,GAAG,IAAI,CAACD,eAAe;IACrC,IAAI;MAAA,IAAAI,YAAA;MACF,MAAMC,MAAM,GAAG,IAAAC,kBAAW,EAACpB,MAAM,EAAEN,qBAAqB,CAAC,CAAC,CAAC;MAC3D,MAAM2B,OAAO,GAAG,EAAAH,YAAA,GAACC,MAAM,CAAC9D,IAAI,cAAA6D,YAAA,uBAAXA,YAAA,CAAaG,OAAO,KAA0B,EAAE;MACjE,IAAI,CAACA,OAAO,CAAC9C,MAAM,EAAE,OAAO,EAAE;MAC9B,OAAO8C,OAAO,CAACC,GAAG,CAAEC,UAAU,IAAKA,UAAU,CAACC,UAAU,CAAC;IAC3D,CAAC,CAAC,OAAOC,GAAQ,EAAE;MAAA,IAAAC,YAAA;MACjB;MACA;MACA;MACA,MAAMC,OAAO,GAAGZ,QAAQ,GAAG,UAAUA,QAAQ,EAAE,GAAG,EAAE;MACpD,MAAMa,GAAG,GAAG,wEAAwED,OAAO,WAAWF,GAAG,CAACI,OAAO,EAAE;MACnH,CAAAH,YAAA,OAAI,CAACjB,MAAM,cAAAiB,YAAA,eAAXA,YAAA,CAAaI,cAAc,CAACF,GAAG,CAAC;MAChC,OAAO7B,sBAAsB,CAACC,MAAM,CAAC;IACvC;EACF;AACF;AAAC+B,OAAA,CAAAzB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -7,35 +7,253 @@ function _chai() {
7
7
  };
8
8
  return data;
9
9
  }
10
- it('should work', () => {
11
- (0, _chai().expect)(true).to.equal(true);
10
+ function _mdx() {
11
+ const data = require("@mdx-js/mdx");
12
+ _mdx = function () {
13
+ return data;
14
+ };
15
+ return data;
16
+ }
17
+ function _mdx2() {
18
+ const data = require("./mdx.detector");
19
+ _mdx2 = function () {
20
+ return data;
21
+ };
22
+ return data;
23
+ }
24
+ // Mock @mdx-js/mdx and @teambit/mdx.modules.mdx-v3-options to avoid loading ESM-only
25
+ // modules (100+ packages in the unified/remark/rehype ecosystem) that Jest cannot
26
+ // handle in CJS mode due to missing require export conditions and ESM syntax.
27
+ jest.mock('@mdx-js/mdx', () => ({
28
+ compileSync: jest.fn()
29
+ }));
30
+ jest.mock('@teambit/mdx.modules.mdx-v3-options', () => ({
31
+ mdxOptions: {
32
+ remarkPlugins: [],
33
+ jsxImportSource: 'react'
34
+ }
35
+ }));
36
+ const mockCompileSync = _mdx().compileSync;
37
+ describe('MDXDependencyDetector', () => {
38
+ beforeEach(() => {
39
+ mockCompileSync.mockReset();
40
+ });
41
+ describe('detect - compileSync path', () => {
42
+ it('should return modules from compileSync imports data', () => {
43
+ mockCompileSync.mockReturnValue({
44
+ data: {
45
+ imports: [{
46
+ fromModule: 'react'
47
+ }, {
48
+ fromModule: '@teambit/design.ui.button'
49
+ }]
50
+ }
51
+ });
52
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx']);
53
+ (0, _chai().expect)(detector.detect('any source')).to.deep.equal(['react', '@teambit/design.ui.button']);
54
+ });
55
+ it('should return empty array when compileSync returns no imports', () => {
56
+ mockCompileSync.mockReturnValue({
57
+ data: {
58
+ imports: []
59
+ }
60
+ });
61
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx']);
62
+ (0, _chai().expect)(detector.detect('# Just markdown')).to.deep.equal([]);
63
+ });
64
+ it('should return empty array when imports data is undefined', () => {
65
+ mockCompileSync.mockReturnValue({
66
+ data: {}
67
+ });
68
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx']);
69
+ (0, _chai().expect)(detector.detect('# No imports')).to.deep.equal([]);
70
+ });
71
+ it('should pass source and options to compileSync', () => {
72
+ mockCompileSync.mockReturnValue({
73
+ data: {
74
+ imports: []
75
+ }
76
+ });
77
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx']);
78
+ detector.detect('test source');
79
+ (0, _chai().expect)(mockCompileSync.mock.calls.length).to.equal(1);
80
+ (0, _chai().expect)(mockCompileSync.mock.calls[0][0]).to.equal('test source');
81
+ });
82
+ });
83
+ describe('detect - regex fallback on compileSync failure', () => {
84
+ beforeEach(() => {
85
+ mockCompileSync.mockImplementation(() => {
86
+ throw new Error('MDX compilation failed');
87
+ });
88
+ });
89
+ it('should fallback to regex when compileSync throws', () => {
90
+ const src = `import React from 'react';`;
91
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx']);
92
+ (0, _chai().expect)(detector.detect(src)).to.deep.equal(['react']);
93
+ });
94
+ it('should detect imports when MDX contains HTML comments', () => {
95
+ const src = `
96
+ import React from 'react';
97
+ import { Button } from '@teambit/base-ui.inputs.button';
98
+
99
+ <!-- This is an HTML comment that breaks MDX v3 -->
100
+ # Hello World
101
+ `;
102
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx']);
103
+ (0, _chai().expect)(detector.detect(src)).to.deep.equal(['react', '@teambit/base-ui.inputs.button']);
104
+ });
105
+ it('should detect imports when MDX contains unclosed tags', () => {
106
+ const src = `
107
+ import { Card } from '@teambit/design.ui.card';
108
+
109
+ <div>
110
+ # Content
111
+ `;
112
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx']);
113
+ (0, _chai().expect)(detector.detect(src)).to.deep.equal(['@teambit/design.ui.card']);
114
+ });
115
+ it('should detect imports when MDX contains escaped characters', () => {
116
+ const src = `
117
+ import Component from './component';
118
+
119
+ Here's some text with \\escaped\\characters that MDX v3 doesn't like
120
+ `;
121
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx']);
122
+ (0, _chai().expect)(detector.detect(src)).to.deep.equal(['./component']);
123
+ });
124
+ });
125
+ describe('isSupported', () => {
126
+ it('should return true for supported extensions', () => {
127
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx', 'md']);
128
+ (0, _chai().expect)(detector.isSupported({
129
+ ext: 'mdx',
130
+ filename: 'test.mdx'
131
+ })).to.be.true;
132
+ (0, _chai().expect)(detector.isSupported({
133
+ ext: 'md',
134
+ filename: 'test.md'
135
+ })).to.be.true;
136
+ });
137
+ it('should return false for unsupported extensions', () => {
138
+ const detector = new (_mdx2().MDXDependencyDetector)(['mdx']);
139
+ (0, _chai().expect)(detector.isSupported({
140
+ ext: 'ts',
141
+ filename: 'test.ts'
142
+ })).to.be.false;
143
+ });
144
+ });
12
145
  });
146
+ describe('detectImportsWithRegex', () => {
147
+ it('should detect default import', () => {
148
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)('import x from "y";')).to.deep.equal(['y']);
149
+ });
150
+ it('should detect star import', () => {
151
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)('import * as y from "y";')).to.deep.equal(['y']);
152
+ });
153
+ it('should detect named import', () => {
154
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)('import { x } from "y";')).to.deep.equal(['y']);
155
+ });
156
+ it('should detect side-effect import', () => {
157
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)('import "y";')).to.deep.equal(['y']);
158
+ });
159
+ it('should detect multiple imports', () => {
160
+ const src = `
161
+ import React from 'react';
162
+ import { Button } from '@teambit/design.ui.button';
163
+ import * as utils from './utils';
164
+ `;
165
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(src)).to.deep.equal(['react', '@teambit/design.ui.button', './utils']);
166
+ });
167
+ it('should detect imports with single quotes', () => {
168
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(`import x from 'single-quotes';`)).to.deep.equal(['single-quotes']);
169
+ });
170
+ it('should detect imports with double quotes', () => {
171
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(`import x from "double-quotes";`)).to.deep.equal(['double-quotes']);
172
+ });
173
+ it('should detect imports with mixed quote styles', () => {
174
+ const src = `
175
+ import a from 'single';
176
+ import b from "double";
177
+ `;
178
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(src)).to.deep.equal(['single', 'double']);
179
+ });
180
+ it('should detect TypeScript type imports', () => {
181
+ const src = `
182
+ import type { MyType } from 'my-types';
183
+ import { Component } from 'my-component';
184
+ `;
185
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(src)).to.deep.equal(['my-types', 'my-component']);
186
+ });
187
+ it('should detect default and named imports combined', () => {
188
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(`import React, { useState } from 'react';`)).to.deep.equal(['react']);
189
+ });
190
+ it('should detect imports with multiple named imports', () => {
191
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(`import { foo, bar, baz } from 'multi-named';`)).to.deep.equal(['multi-named']);
192
+ });
193
+ it('should detect side-effect only imports', () => {
194
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(`import 'side-effect';`)).to.deep.equal(['side-effect']);
195
+ });
196
+ it('should detect scoped package imports', () => {
197
+ const src = `
198
+ import { Button } from '@scope/package';
199
+ import Utils from '@company/utils';
200
+ `;
201
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(src)).to.deep.equal(['@scope/package', '@company/utils']);
202
+ });
203
+ it('should detect relative path imports', () => {
204
+ const src = `
205
+ import Local from './local';
206
+ import Parent from '../parent';
207
+ import Deep from '../../deep/path';
208
+ `;
209
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(src)).to.deep.equal(['./local', '../parent', '../../deep/path']);
210
+ });
211
+ it('should handle imports with extra whitespace', () => {
212
+ const src = `
213
+ import { foo , bar } from 'whitespace' ;
214
+ import * as util from 'util' ;
215
+ `;
216
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(src)).to.deep.equal(['whitespace', 'util']);
217
+ });
218
+ it('should detect imports mixed with complex MDX content', () => {
219
+ const src = `
220
+ import React from 'react';
221
+ import { Button } from '@teambit/design.ui.button';
222
+
223
+ <!-- HTML comment -->
224
+ # Title
13
225
 
14
- // // Skip these mdx detector test cases since esm imports are not well-supported in jest tester
15
- // import { MDXDependencyDetector } from './mdx.detector';
16
- //
17
- // describe('MDXDependencyDetector', () => {
18
- // function expectDependencies(src: string, expectedDeps: string[]) {
19
- // expect(new MDXDependencyDetector(['mdx']).detect(src)).to.deep.equal(expectedDeps);
20
- // }
21
- // describe('detect', () => {
22
- // it('should correctly detect default import', () => {
23
- // const src = 'import x from "y";';
24
- // expectDependencies(src, ['y']);
25
- // });
26
- // it('should correctly detect star import', () => {
27
- // const src = 'import * as y from "y";';
28
- // expectDependencies(src, ['y']);
29
- // });
30
- // it('should correctly detect named import', () => {
31
- // const src = 'import { x } from "y";';
32
- // expectDependencies(src, ['y']);
33
- // });
34
- // it('should correctly detect import with no identifier', () => {
35
- // const src = 'import "y";';
36
- // expectDependencies(src, ['y']);
37
- // });
38
- // });
39
- // });
226
+ Some text with \\escaped characters
227
+
228
+ <Button>Click me</Button>
229
+ `;
230
+ const detected = (0, _mdx2().detectImportsWithRegex)(src);
231
+ (0, _chai().expect)(detected).to.include('react');
232
+ (0, _chai().expect)(detected).to.include('@teambit/design.ui.button');
233
+ });
234
+ it('should match imports in code blocks (known limitation)', () => {
235
+ const src = `
236
+ import React from 'react';
237
+
238
+ \`\`\`jsx
239
+ import Example from 'example-in-code-block';
240
+ \`\`\`
241
+ `;
242
+ const detected = (0, _mdx2().detectImportsWithRegex)(src);
243
+ (0, _chai().expect)(detected).to.include('react');
244
+ (0, _chai().expect)(detected).to.include('example-in-code-block');
245
+ });
246
+ it('should return empty array for file with no imports', () => {
247
+ const src = `
248
+ # Just a title
249
+
250
+ Some content without any imports.
251
+ `;
252
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)(src)).to.deep.equal([]);
253
+ });
254
+ it('should return empty array for empty file', () => {
255
+ (0, _chai().expect)((0, _mdx2().detectImportsWithRegex)('')).to.deep.equal([]);
256
+ });
257
+ });
40
258
 
41
259
  //# sourceMappingURL=mdx.detector.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_chai","data","require","it","expect","to","equal"],"sources":["mdx.detector.spec.ts"],"sourcesContent":["import { expect } from 'chai';\n\nit('should work', () => {\n expect(true).to.equal(true);\n});\n\n// // Skip these mdx detector test cases since esm imports are not well-supported in jest tester\n// import { MDXDependencyDetector } from './mdx.detector';\n//\n// describe('MDXDependencyDetector', () => {\n// function expectDependencies(src: string, expectedDeps: string[]) {\n// expect(new MDXDependencyDetector(['mdx']).detect(src)).to.deep.equal(expectedDeps);\n// }\n// describe('detect', () => {\n// it('should correctly detect default import', () => {\n// const src = 'import x from \"y\";';\n// expectDependencies(src, ['y']);\n// });\n// it('should correctly detect star import', () => {\n// const src = 'import * as y from \"y\";';\n// expectDependencies(src, ['y']);\n// });\n// it('should correctly detect named import', () => {\n// const src = 'import { x } from \"y\";';\n// expectDependencies(src, ['y']);\n// });\n// it('should correctly detect import with no identifier', () => {\n// const src = 'import \"y\";';\n// expectDependencies(src, ['y']);\n// });\n// });\n// });\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEAE,EAAE,CAAC,aAAa,EAAE,MAAM;EACtB,IAAAC,cAAM,EAAC,IAAI,CAAC,CAACC,EAAE,CAACC,KAAK,CAAC,IAAI,CAAC;AAC7B,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["_chai","data","require","_mdx","_mdx2","jest","mock","compileSync","fn","mdxOptions","remarkPlugins","jsxImportSource","mockCompileSync","describe","beforeEach","mockReset","it","mockReturnValue","imports","fromModule","detector","MDXDependencyDetector","expect","detect","to","deep","equal","calls","length","mockImplementation","Error","src","isSupported","ext","filename","be","true","false","detectImportsWithRegex","detected","include"],"sources":["mdx.detector.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { compileSync } from '@mdx-js/mdx';\n\n// Mock @mdx-js/mdx and @teambit/mdx.modules.mdx-v3-options to avoid loading ESM-only\n// modules (100+ packages in the unified/remark/rehype ecosystem) that Jest cannot\n// handle in CJS mode due to missing require export conditions and ESM syntax.\njest.mock('@mdx-js/mdx', () => ({\n compileSync: jest.fn(),\n}));\njest.mock('@teambit/mdx.modules.mdx-v3-options', () => ({\n mdxOptions: { remarkPlugins: [], jsxImportSource: 'react' },\n}));\n\nconst mockCompileSync = compileSync as jest.Mock;\n\nimport { MDXDependencyDetector, detectImportsWithRegex } from './mdx.detector';\n\ndescribe('MDXDependencyDetector', () => {\n beforeEach(() => {\n mockCompileSync.mockReset();\n });\n\n describe('detect - compileSync path', () => {\n it('should return modules from compileSync imports data', () => {\n mockCompileSync.mockReturnValue({\n data: { imports: [{ fromModule: 'react' }, { fromModule: '@teambit/design.ui.button' }] },\n });\n const detector = new MDXDependencyDetector(['mdx']);\n expect(detector.detect('any source')).to.deep.equal(['react', '@teambit/design.ui.button']);\n });\n\n it('should return empty array when compileSync returns no imports', () => {\n mockCompileSync.mockReturnValue({ data: { imports: [] } });\n const detector = new MDXDependencyDetector(['mdx']);\n expect(detector.detect('# Just markdown')).to.deep.equal([]);\n });\n\n it('should return empty array when imports data is undefined', () => {\n mockCompileSync.mockReturnValue({ data: {} });\n const detector = new MDXDependencyDetector(['mdx']);\n expect(detector.detect('# No imports')).to.deep.equal([]);\n });\n\n it('should pass source and options to compileSync', () => {\n mockCompileSync.mockReturnValue({ data: { imports: [] } });\n const detector = new MDXDependencyDetector(['mdx']);\n detector.detect('test source');\n expect(mockCompileSync.mock.calls.length).to.equal(1);\n expect(mockCompileSync.mock.calls[0][0]).to.equal('test source');\n });\n });\n\n describe('detect - regex fallback on compileSync failure', () => {\n beforeEach(() => {\n mockCompileSync.mockImplementation(() => {\n throw new Error('MDX compilation failed');\n });\n });\n\n it('should fallback to regex when compileSync throws', () => {\n const src = `import React from 'react';`;\n const detector = new MDXDependencyDetector(['mdx']);\n expect(detector.detect(src)).to.deep.equal(['react']);\n });\n\n it('should detect imports when MDX contains HTML comments', () => {\n const src = `\nimport React from 'react';\nimport { Button } from '@teambit/base-ui.inputs.button';\n\n<!-- This is an HTML comment that breaks MDX v3 -->\n# Hello World\n `;\n const detector = new MDXDependencyDetector(['mdx']);\n expect(detector.detect(src)).to.deep.equal(['react', '@teambit/base-ui.inputs.button']);\n });\n\n it('should detect imports when MDX contains unclosed tags', () => {\n const src = `\nimport { Card } from '@teambit/design.ui.card';\n\n<div>\n# Content\n `;\n const detector = new MDXDependencyDetector(['mdx']);\n expect(detector.detect(src)).to.deep.equal(['@teambit/design.ui.card']);\n });\n\n it('should detect imports when MDX contains escaped characters', () => {\n const src = `\nimport Component from './component';\n\nHere's some text with \\\\escaped\\\\characters that MDX v3 doesn't like\n `;\n const detector = new MDXDependencyDetector(['mdx']);\n expect(detector.detect(src)).to.deep.equal(['./component']);\n });\n });\n\n describe('isSupported', () => {\n it('should return true for supported extensions', () => {\n const detector = new MDXDependencyDetector(['mdx', 'md']);\n expect(detector.isSupported({ ext: 'mdx', filename: 'test.mdx' } as any)).to.be.true;\n expect(detector.isSupported({ ext: 'md', filename: 'test.md' } as any)).to.be.true;\n });\n\n it('should return false for unsupported extensions', () => {\n const detector = new MDXDependencyDetector(['mdx']);\n expect(detector.isSupported({ ext: 'ts', filename: 'test.ts' } as any)).to.be.false;\n });\n });\n});\n\ndescribe('detectImportsWithRegex', () => {\n it('should detect default import', () => {\n expect(detectImportsWithRegex('import x from \"y\";')).to.deep.equal(['y']);\n });\n\n it('should detect star import', () => {\n expect(detectImportsWithRegex('import * as y from \"y\";')).to.deep.equal(['y']);\n });\n\n it('should detect named import', () => {\n expect(detectImportsWithRegex('import { x } from \"y\";')).to.deep.equal(['y']);\n });\n\n it('should detect side-effect import', () => {\n expect(detectImportsWithRegex('import \"y\";')).to.deep.equal(['y']);\n });\n\n it('should detect multiple imports', () => {\n const src = `\nimport React from 'react';\nimport { Button } from '@teambit/design.ui.button';\nimport * as utils from './utils';\n `;\n expect(detectImportsWithRegex(src)).to.deep.equal(['react', '@teambit/design.ui.button', './utils']);\n });\n\n it('should detect imports with single quotes', () => {\n expect(detectImportsWithRegex(`import x from 'single-quotes';`)).to.deep.equal(['single-quotes']);\n });\n\n it('should detect imports with double quotes', () => {\n expect(detectImportsWithRegex(`import x from \"double-quotes\";`)).to.deep.equal(['double-quotes']);\n });\n\n it('should detect imports with mixed quote styles', () => {\n const src = `\nimport a from 'single';\nimport b from \"double\";\n `;\n expect(detectImportsWithRegex(src)).to.deep.equal(['single', 'double']);\n });\n\n it('should detect TypeScript type imports', () => {\n const src = `\nimport type { MyType } from 'my-types';\nimport { Component } from 'my-component';\n `;\n expect(detectImportsWithRegex(src)).to.deep.equal(['my-types', 'my-component']);\n });\n\n it('should detect default and named imports combined', () => {\n expect(detectImportsWithRegex(`import React, { useState } from 'react';`)).to.deep.equal(['react']);\n });\n\n it('should detect imports with multiple named imports', () => {\n expect(detectImportsWithRegex(`import { foo, bar, baz } from 'multi-named';`)).to.deep.equal(['multi-named']);\n });\n\n it('should detect side-effect only imports', () => {\n expect(detectImportsWithRegex(`import 'side-effect';`)).to.deep.equal(['side-effect']);\n });\n\n it('should detect scoped package imports', () => {\n const src = `\nimport { Button } from '@scope/package';\nimport Utils from '@company/utils';\n `;\n expect(detectImportsWithRegex(src)).to.deep.equal(['@scope/package', '@company/utils']);\n });\n\n it('should detect relative path imports', () => {\n const src = `\nimport Local from './local';\nimport Parent from '../parent';\nimport Deep from '../../deep/path';\n `;\n expect(detectImportsWithRegex(src)).to.deep.equal(['./local', '../parent', '../../deep/path']);\n });\n\n it('should handle imports with extra whitespace', () => {\n const src = `\nimport { foo , bar } from 'whitespace' ;\nimport * as util from 'util' ;\n `;\n expect(detectImportsWithRegex(src)).to.deep.equal(['whitespace', 'util']);\n });\n\n it('should detect imports mixed with complex MDX content', () => {\n const src = `\nimport React from 'react';\nimport { Button } from '@teambit/design.ui.button';\n\n<!-- HTML comment -->\n# Title\n\nSome text with \\\\escaped characters\n\n<Button>Click me</Button>\n `;\n const detected = detectImportsWithRegex(src);\n expect(detected).to.include('react');\n expect(detected).to.include('@teambit/design.ui.button');\n });\n\n it('should match imports in code blocks (known limitation)', () => {\n const src = `\nimport React from 'react';\n\n\\`\\`\\`jsx\nimport Example from 'example-in-code-block';\n\\`\\`\\`\n `;\n const detected = detectImportsWithRegex(src);\n expect(detected).to.include('react');\n expect(detected).to.include('example-in-code-block');\n });\n\n it('should return empty array for file with no imports', () => {\n const src = `\n# Just a title\n\nSome content without any imports.\n `;\n expect(detectImportsWithRegex(src)).to.deep.equal([]);\n });\n\n it('should return empty array for empty file', () => {\n expect(detectImportsWithRegex('')).to.deep.equal([]);\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAcA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAZA;AACA;AACA;AACAI,IAAI,CAACC,IAAI,CAAC,aAAa,EAAE,OAAO;EAC9BC,WAAW,EAAEF,IAAI,CAACG,EAAE,CAAC;AACvB,CAAC,CAAC,CAAC;AACHH,IAAI,CAACC,IAAI,CAAC,qCAAqC,EAAE,OAAO;EACtDG,UAAU,EAAE;IAAEC,aAAa,EAAE,EAAE;IAAEC,eAAe,EAAE;EAAQ;AAC5D,CAAC,CAAC,CAAC;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,EAAE,CAAC;EACtD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -144,7 +144,7 @@ class MDXMain {
144
144
  const logger = loggerAspect.createLogger(_mdx().MDXAspect.id);
145
145
  const mdxEnv = envs.merge(new (_mdx5().MdxEnv)(react, logger, multiCompiler, compiler, docs), react.reactEnv);
146
146
  envs.registerEnv(mdxEnv);
147
- depResolver.registerDetector(new (_mdx2().MDXDependencyDetector)(config.extensions));
147
+ depResolver.registerDetector(new (_mdx2().MDXDependencyDetector)(config.extensions, logger));
148
148
  docs.registerDocReader(new (_mdx3().MDXDocReader)(config.extensions));
149
149
  if (generator) {
150
150
  const envContext = new (_envs().EnvContext)(_componentId().ComponentID.fromString(_react().ReactAspect.id), loggerAspect, workerMain, harmony);
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_compiler","_dependencyResolver","_docs","_componentId","_logger","_worker","_envs","_multiCompiler","_react","_generator","_mdx","_mdx2","_mdx3","_mdx4","_mdx5","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MDXMain","constructor","icon","createCompiler","opts","mdxEnv","createMdxCompiler","_mdxEnv","provider","docs","depResolver","react","envs","multiCompiler","compiler","generator","loggerAspect","workerMain","config","slots","harmony","mdx","logger","createLogger","MDXAspect","id","merge","MdxEnv","reactEnv","registerEnv","registerDetector","MDXDependencyDetector","extensions","registerDocReader","MDXDocReader","envContext","EnvContext","ComponentID","fromString","ReactAspect","registerComponentTemplate","getTemplates","exports","MainRuntime","DocsAspect","DependencyResolverAspect","EnvsAspect","MultiCompilerAspect","CompilerAspect","GeneratorAspect","LoggerAspect","WorkerAspect","addRuntime"],"sources":["mdx.main.runtime.ts"],"sourcesContent":["import type { Harmony } from '@teambit/harmony';\nimport { MainRuntime } from '@teambit/cli';\nimport type { CompilerMain } from '@teambit/compiler';\nimport { CompilerAspect } from '@teambit/compiler';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport type { DocsMain } from '@teambit/docs';\nimport { DocsAspect } from '@teambit/docs';\nimport { ComponentID } from '@teambit/component-id';\nimport type { LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { WorkerMain } from '@teambit/worker';\nimport { WorkerAspect } from '@teambit/worker';\nimport type { EnvsMain } from '@teambit/envs';\nimport { EnvContext, EnvsAspect } from '@teambit/envs';\nimport type { MultiCompilerMain } from '@teambit/multi-compiler';\nimport { MultiCompilerAspect } from '@teambit/multi-compiler';\nimport type { ReactEnv, ReactMain } from '@teambit/react';\nimport { ReactAspect } from '@teambit/react';\nimport type { GeneratorMain } from '@teambit/generator';\nimport { GeneratorAspect } from '@teambit/generator';\nimport { MDXAspect } from './mdx.aspect';\nimport type { MDXCompilerOpts } from './mdx.compiler';\nimport { MDXDependencyDetector } from './mdx.detector';\nimport { MDXDocReader } from './mdx.doc-reader';\nimport { getTemplates } from './mdx.templates';\nimport { MdxEnv } from './mdx.env';\n\nexport type MDXConfig = {\n /**\n * list of file extensions to consider as MDX files.\n */\n extensions: string[];\n};\n\nexport class MDXMain {\n icon() {\n return 'https://static.bit.dev/extensions-icons/mdx-icon-small.svg';\n }\n\n /**\n * create an instance of the MDX compiler.\n */\n createCompiler(opts: MDXCompilerOpts = {}) {\n return this.mdxEnv.createMdxCompiler(opts);\n }\n\n _mdxEnv: MdxEnv;\n get mdxEnv() {\n return this._mdxEnv;\n }\n private set mdxEnv(value: MdxEnv) {\n this._mdxEnv = value;\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [\n DocsAspect,\n DependencyResolverAspect,\n ReactAspect,\n EnvsAspect,\n MultiCompilerAspect,\n CompilerAspect,\n GeneratorAspect,\n LoggerAspect,\n WorkerAspect,\n ];\n\n static defaultConfig = {\n extensions: ['.md', '.mdx'],\n };\n\n static async provider(\n [docs, depResolver, react, envs, multiCompiler, compiler, generator, loggerAspect, workerMain]: [\n DocsMain,\n DependencyResolverMain,\n ReactMain,\n EnvsMain,\n MultiCompilerMain,\n CompilerMain,\n GeneratorMain,\n LoggerMain,\n WorkerMain,\n ],\n config: MDXConfig,\n slots,\n harmony: Harmony\n ) {\n const mdx = new MDXMain();\n const logger = loggerAspect.createLogger(MDXAspect.id);\n\n const mdxEnv = envs.merge<MdxEnv, ReactEnv>(\n new MdxEnv(react, logger, multiCompiler, compiler, docs),\n react.reactEnv\n );\n\n envs.registerEnv(mdxEnv);\n depResolver.registerDetector(new MDXDependencyDetector(config.extensions));\n docs.registerDocReader(new MDXDocReader(config.extensions));\n if (generator) {\n const envContext = new EnvContext(ComponentID.fromString(ReactAspect.id), loggerAspect, workerMain, harmony);\n generator.registerComponentTemplate(() => getTemplates(envContext));\n }\n\n mdx.mdxEnv = mdxEnv;\n return mdx;\n }\n}\n\nMDXAspect.addRuntime(MDXMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,oBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,mBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAA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BI,CACpB4C,kBAAU,EACVC,8CAAwB,EACxBN,oBAAW,EACXO,kBAAU,EACVC,oCAAmB,EACnBC,0BAAc,EACdC,4BAAe,EACfC,sBAAY,EACZC,sBAAY,CACb;AAAAtE,eAAA,CAhCUmB,OAAO,mBAkCK;EACrBgC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM;AAC5B,CAAC;AAuCHR,gBAAS,CAAC4B,UAAU,CAACpD,OAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_compiler","_dependencyResolver","_docs","_componentId","_logger","_worker","_envs","_multiCompiler","_react","_generator","_mdx","_mdx2","_mdx3","_mdx4","_mdx5","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MDXMain","constructor","icon","createCompiler","opts","mdxEnv","createMdxCompiler","_mdxEnv","provider","docs","depResolver","react","envs","multiCompiler","compiler","generator","loggerAspect","workerMain","config","slots","harmony","mdx","logger","createLogger","MDXAspect","id","merge","MdxEnv","reactEnv","registerEnv","registerDetector","MDXDependencyDetector","extensions","registerDocReader","MDXDocReader","envContext","EnvContext","ComponentID","fromString","ReactAspect","registerComponentTemplate","getTemplates","exports","MainRuntime","DocsAspect","DependencyResolverAspect","EnvsAspect","MultiCompilerAspect","CompilerAspect","GeneratorAspect","LoggerAspect","WorkerAspect","addRuntime"],"sources":["mdx.main.runtime.ts"],"sourcesContent":["import type { Harmony } from '@teambit/harmony';\nimport { MainRuntime } from '@teambit/cli';\nimport type { CompilerMain } from '@teambit/compiler';\nimport { CompilerAspect } from '@teambit/compiler';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport type { DocsMain } from '@teambit/docs';\nimport { DocsAspect } from '@teambit/docs';\nimport { ComponentID } from '@teambit/component-id';\nimport type { LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { WorkerMain } from '@teambit/worker';\nimport { WorkerAspect } from '@teambit/worker';\nimport type { EnvsMain } from '@teambit/envs';\nimport { EnvContext, EnvsAspect } from '@teambit/envs';\nimport type { MultiCompilerMain } from '@teambit/multi-compiler';\nimport { MultiCompilerAspect } from '@teambit/multi-compiler';\nimport type { ReactEnv, ReactMain } from '@teambit/react';\nimport { ReactAspect } from '@teambit/react';\nimport type { GeneratorMain } from '@teambit/generator';\nimport { GeneratorAspect } from '@teambit/generator';\nimport { MDXAspect } from './mdx.aspect';\nimport type { MDXCompilerOpts } from './mdx.compiler';\nimport { MDXDependencyDetector } from './mdx.detector';\nimport { MDXDocReader } from './mdx.doc-reader';\nimport { getTemplates } from './mdx.templates';\nimport { MdxEnv } from './mdx.env';\n\nexport type MDXConfig = {\n /**\n * list of file extensions to consider as MDX files.\n */\n extensions: string[];\n};\n\nexport class MDXMain {\n icon() {\n return 'https://static.bit.dev/extensions-icons/mdx-icon-small.svg';\n }\n\n /**\n * create an instance of the MDX compiler.\n */\n createCompiler(opts: MDXCompilerOpts = {}) {\n return this.mdxEnv.createMdxCompiler(opts);\n }\n\n _mdxEnv: MdxEnv;\n get mdxEnv() {\n return this._mdxEnv;\n }\n private set mdxEnv(value: MdxEnv) {\n this._mdxEnv = value;\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [\n DocsAspect,\n DependencyResolverAspect,\n ReactAspect,\n EnvsAspect,\n MultiCompilerAspect,\n CompilerAspect,\n GeneratorAspect,\n LoggerAspect,\n WorkerAspect,\n ];\n\n static defaultConfig = {\n extensions: ['.md', '.mdx'],\n };\n\n static async provider(\n [docs, depResolver, react, envs, multiCompiler, compiler, generator, loggerAspect, workerMain]: [\n DocsMain,\n DependencyResolverMain,\n ReactMain,\n EnvsMain,\n MultiCompilerMain,\n CompilerMain,\n GeneratorMain,\n LoggerMain,\n WorkerMain,\n ],\n config: MDXConfig,\n slots,\n harmony: Harmony\n ) {\n const mdx = new MDXMain();\n const logger = loggerAspect.createLogger(MDXAspect.id);\n\n const mdxEnv = envs.merge<MdxEnv, ReactEnv>(\n new MdxEnv(react, logger, multiCompiler, compiler, docs),\n react.reactEnv\n );\n\n envs.registerEnv(mdxEnv);\n depResolver.registerDetector(new MDXDependencyDetector(config.extensions, logger));\n docs.registerDocReader(new MDXDocReader(config.extensions));\n if (generator) {\n const envContext = new EnvContext(ComponentID.fromString(ReactAspect.id), loggerAspect, workerMain, harmony);\n generator.registerComponentTemplate(() => getTemplates(envContext));\n }\n\n mdx.mdxEnv = mdxEnv;\n return mdx;\n }\n}\n\nMDXAspect.addRuntime(MDXMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,oBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,mBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,OAAA,YA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EAAE,CAAC,KAAK,EAAE,MAAM;AAC5B,CAAC;AAuCHR,gBAAS,CAAC4B,UAAU,CAACpD,OAAO,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.mdx_mdx@1.0.873/dist/mdx.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.mdx_mdx@1.0.873/dist/mdx.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.mdx_mdx@1.0.875/dist/mdx.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.mdx_mdx@1.0.875/dist/mdx.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1,5 +1,5 @@
1
1
 
2
- import { linkModules } from '/home/circleci/.bvm/versions/1.13.42/bit-1.13.42/node_modules/@teambit/preview/dist/preview-modules.js';
2
+ import { linkModules } from '/home/circleci/.bvm/versions/1.13.45/bit-1.13.45/node_modules/@teambit/preview/dist/preview-modules.js';
3
3
 
4
4
  // strip leading/trailing slashes from any id we compare
5
5
  function __bitNormalizeId(id) {
@@ -44,7 +44,7 @@ function __bitSurfaceToOverlay(err, componentId) {
44
44
  }, 0);
45
45
  }
46
46
 
47
- import {defaultMainModule} from "/home/circleci/bit/bit/node_modules/@teambit/_local/preview-modules-0557d705b67dd1e1bccbac0bd34835a41036cf72.mjs";
47
+ import {defaultMainModule} from "/home/circleci/bit/bit/node_modules/@teambit/_local/preview-modules-98cf30a024475b337e2db75aec661313311da841.mjs";
48
48
  (async function initializeModules() {
49
49
 
50
50