@teambit/mdx 0.0.572 → 0.0.576
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/dist/mdx.detector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["mdx.detector.ts"],"names":["MDXDependencyDetector","constructor","supportedExtensions","isSupported","context","includes","ext","detect","source","output","imports","getImportSpecifiers","files","map","importSpec","fromModule"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,qBAAN,CAA0D;AAC/DC,EAAAA,WAAW,CAASC,mBAAT,EAAwC;AAAA,SAA/BA,mBAA+B,GAA/BA,mBAA+B;AAAE;;AAErDC,EAAAA,WAAW,CAACC,OAAD,
|
|
1
|
+
{"version":3,"sources":["mdx.detector.ts"],"names":["MDXDependencyDetector","constructor","supportedExtensions","isSupported","context","includes","ext","detect","source","output","imports","getImportSpecifiers","files","map","importSpec","fromModule"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,qBAAN,CAA0D;AAC/DC,EAAAA,WAAW,CAASC,mBAAT,EAAwC;AAAA,SAA/BA,mBAA+B,GAA/BA,mBAA+B;AAAE;;AAErDC,EAAAA,WAAW,CAACC,OAAD,EAAgC;AACzC,WAAO,KAAKF,mBAAL,CAAyBG,QAAzB,CAAkCD,OAAO,CAACE,GAA1C,CAAP;AACD;;AAEDC,EAAAA,MAAM,CAACC,MAAD,EAA2B;AAC/B,UAAMC,MAAM,GAAG,+BAAYD,MAAZ,CAAf;AACA,UAAME,OAAO,GAAGD,MAAM,CAACE,mBAAP,EAAhB;AACA,QAAI,CAACD,OAAL,EAAc,OAAO,EAAP;AACd,UAAME,KAAe,GAAGF,OAAO,CAACG,GAAR,CAAaC,UAAD,IAAgB;AAClD,aAAOA,UAAU,CAACC,UAAlB;AACD,KAFuB,CAAxB;AAIA,WAAOH,KAAP;AACD;;AAhB8D","sourcesContent":["import { DependencyDetector, FileContext } from '@teambit/dependency-resolver';\nimport { compileSync } from '@teambit/mdx.modules.mdx-compiler';\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);\n const imports = output.getImportSpecifiers();\n if (!imports) return [];\n const files: string[] = imports.map((importSpec) => {\n return importSpec.fromModule;\n });\n\n return files;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _chai() {
|
|
4
|
+
const data = require("chai");
|
|
5
|
+
|
|
6
|
+
_chai = function () {
|
|
7
|
+
return data;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
return data;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function _mdx() {
|
|
14
|
+
const data = require("./mdx.detector");
|
|
15
|
+
|
|
16
|
+
_mdx = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
describe('MDXDependencyDetector', () => {
|
|
24
|
+
function expectDependencies(src, expectedDeps) {
|
|
25
|
+
(0, _chai().expect)(new (_mdx().MDXDependencyDetector)(['mdx']).detect(src)).to.deep.equal(expectedDeps);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
describe('detect', () => {
|
|
29
|
+
it('should correctly detect default import', () => {
|
|
30
|
+
const src = 'import x from "y";';
|
|
31
|
+
expectDependencies(src, ['y']);
|
|
32
|
+
});
|
|
33
|
+
it('should correctly detect star import', () => {
|
|
34
|
+
const src = 'import * as y from "y";';
|
|
35
|
+
expectDependencies(src, ['y']);
|
|
36
|
+
});
|
|
37
|
+
it('should correctly detect named import', () => {
|
|
38
|
+
const src = 'import { x } from "y";';
|
|
39
|
+
expectDependencies(src, ['y']);
|
|
40
|
+
});
|
|
41
|
+
it('should correctly detect import with no identifier', () => {
|
|
42
|
+
const src = 'import "y";';
|
|
43
|
+
expectDependencies(src, ['y']);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=mdx.detector.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["mdx.detector.spec.ts"],"names":["describe","expectDependencies","src","expectedDeps","MDXDependencyDetector","detect","to","deep","equal","it"],"mappings":";;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEAA,QAAQ,CAAC,uBAAD,EAA0B,MAAM;AACtC,WAASC,kBAAT,CAA4BC,GAA5B,EAAyCC,YAAzC,EAAiE;AAC/D,wBAAO,KAAIC,4BAAJ,EAA0B,CAAC,KAAD,CAA1B,EAAmCC,MAAnC,CAA0CH,GAA1C,CAAP,EAAuDI,EAAvD,CAA0DC,IAA1D,CAA+DC,KAA/D,CAAqEL,YAArE;AACD;;AACDH,EAAAA,QAAQ,CAAC,QAAD,EAAW,MAAM;AACvBS,IAAAA,EAAE,CAAC,wCAAD,EAA2C,MAAM;AACjD,YAAMP,GAAG,GAAG,oBAAZ;AACAD,MAAAA,kBAAkB,CAACC,GAAD,EAAM,CAAC,GAAD,CAAN,CAAlB;AACD,KAHC,CAAF;AAIAO,IAAAA,EAAE,CAAC,qCAAD,EAAwC,MAAM;AAC9C,YAAMP,GAAG,GAAG,yBAAZ;AACAD,MAAAA,kBAAkB,CAACC,GAAD,EAAM,CAAC,GAAD,CAAN,CAAlB;AACD,KAHC,CAAF;AAIAO,IAAAA,EAAE,CAAC,sCAAD,EAAyC,MAAM;AAC/C,YAAMP,GAAG,GAAG,wBAAZ;AACAD,MAAAA,kBAAkB,CAACC,GAAD,EAAM,CAAC,GAAD,CAAN,CAAlB;AACD,KAHC,CAAF;AAIAO,IAAAA,EAAE,CAAC,mDAAD,EAAsD,MAAM;AAC5D,YAAMP,GAAG,GAAG,aAAZ;AACAD,MAAAA,kBAAkB,CAACC,GAAD,EAAM,CAAC,GAAD,CAAN,CAAlB;AACD,KAHC,CAAF;AAID,GAjBO,CAAR;AAkBD,CAtBO,CAAR","sourcesContent":["import { expect } from 'chai';\nimport { MDXDependencyDetector } from './mdx.detector';\n\ndescribe('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"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/mdx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.576",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/mdx/mdx",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.mdx",
|
|
8
8
|
"name": "mdx",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.576"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -15,38 +15,40 @@
|
|
|
15
15
|
"minimatch": "3.0.4",
|
|
16
16
|
"@babel/runtime": "7.12.18",
|
|
17
17
|
"core-js": "^3.0.0",
|
|
18
|
-
"@teambit/builder": "0.0.
|
|
19
|
-
"@teambit/compilation.modules.babel-compiler": "0.0.
|
|
20
|
-
"@teambit/compiler": "0.0.
|
|
21
|
-
"@teambit/mdx.modules.mdx-compiler": "0.0.
|
|
22
|
-
"@teambit/dependency-resolver": "0.0.
|
|
23
|
-
"@teambit/docs": "0.0.
|
|
24
|
-
"@teambit/babel": "0.0.
|
|
25
|
-
"@teambit/cli": "0.0.
|
|
26
|
-
"@teambit/envs": "0.0.
|
|
27
|
-
"@teambit/generator": "0.0.
|
|
28
|
-
"@teambit/multi-compiler": "0.0.
|
|
29
|
-
"@teambit/react": "0.0.
|
|
30
|
-
"@teambit/typescript.modules.ts-config-mutator": "0.0.
|
|
31
|
-
"@teambit/typescript": "0.0.
|
|
32
|
-
"@teambit/compositions": "0.0.
|
|
18
|
+
"@teambit/builder": "0.0.596",
|
|
19
|
+
"@teambit/compilation.modules.babel-compiler": "0.0.123",
|
|
20
|
+
"@teambit/compiler": "0.0.596",
|
|
21
|
+
"@teambit/mdx.modules.mdx-compiler": "0.0.486",
|
|
22
|
+
"@teambit/dependency-resolver": "0.0.596",
|
|
23
|
+
"@teambit/docs": "0.0.596",
|
|
24
|
+
"@teambit/babel": "0.0.596",
|
|
25
|
+
"@teambit/cli": "0.0.409",
|
|
26
|
+
"@teambit/envs": "0.0.596",
|
|
27
|
+
"@teambit/generator": "0.0.596",
|
|
28
|
+
"@teambit/multi-compiler": "0.0.596",
|
|
29
|
+
"@teambit/react": "0.0.596",
|
|
30
|
+
"@teambit/typescript.modules.ts-config-mutator": "0.0.65",
|
|
31
|
+
"@teambit/typescript": "0.0.596",
|
|
32
|
+
"@teambit/compositions": "0.0.596",
|
|
33
33
|
"@teambit/design.ui.empty-box": "0.0.352",
|
|
34
|
-
"@teambit/tester": "0.0.
|
|
35
|
-
"@teambit/ui": "0.0.
|
|
34
|
+
"@teambit/tester": "0.0.596",
|
|
35
|
+
"@teambit/ui": "0.0.596"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/fs-extra": "9.0.7",
|
|
39
39
|
"@types/minimatch": "3.0.4",
|
|
40
40
|
"@types/react": "^17.0.8",
|
|
41
|
+
"chai": "4.3.0",
|
|
42
|
+
"@types/chai": "4.2.15",
|
|
41
43
|
"@types/mocha": "5.2.7",
|
|
42
44
|
"@types/testing-library__jest-dom": "5.9.5",
|
|
43
45
|
"@types/jest": "^26.0.0",
|
|
44
46
|
"@types/react-dom": "^17.0.5",
|
|
45
47
|
"@types/node": "12.20.4",
|
|
46
|
-
"@teambit/mdx.aspect-docs.mdx": "0.0.
|
|
48
|
+
"@teambit/mdx.aspect-docs.mdx": "0.0.130"
|
|
47
49
|
},
|
|
48
50
|
"peerDependencies": {
|
|
49
|
-
"@teambit/legacy": "1.0.
|
|
51
|
+
"@teambit/legacy": "1.0.196",
|
|
50
52
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
51
53
|
"react": "^16.8.0 || ^17.0.0"
|
|
52
54
|
},
|
|
@@ -74,7 +76,7 @@
|
|
|
74
76
|
"react": "-"
|
|
75
77
|
},
|
|
76
78
|
"peerDependencies": {
|
|
77
|
-
"@teambit/legacy": "1.0.
|
|
79
|
+
"@teambit/legacy": "1.0.196",
|
|
78
80
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
79
81
|
"react": "^16.8.0 || ^17.0.0"
|
|
80
82
|
}
|
|
Binary file
|