@teambit/mdx 0.0.566 → 0.0.570

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.
@@ -1,4 +1,8 @@
1
- const presets = [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react')];
1
+ const presets = [
2
+ require.resolve('@babel/preset-env'),
3
+ require.resolve('@babel/preset-react'),
4
+ require.resolve('@babel/preset-typescript'),
5
+ ];
2
6
  const plugins = [require.resolve('@babel/plugin-proposal-class-properties')];
3
7
 
4
8
  export const babelConfig = {
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.babelConfig = void 0;
7
- const presets = [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react')];
7
+ const presets = [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react'), require.resolve('@babel/preset-typescript')];
8
8
  const plugins = [require.resolve('@babel/plugin-proposal-class-properties')];
9
9
  const babelConfig = {
10
10
  presets,
@@ -1 +1 @@
1
- {"version":3,"sources":["babel.config.ts"],"names":["presets","require","resolve","plugins","babelConfig","sourceMaps"],"mappings":";;;;;;AAAA,MAAMA,OAAO,GAAG,CAACC,OAAO,CAACC,OAAR,CAAgB,mBAAhB,CAAD,EAAuCD,OAAO,CAACC,OAAR,CAAgB,qBAAhB,CAAvC,CAAhB;AACA,MAAMC,OAAO,GAAG,CAACF,OAAO,CAACC,OAAR,CAAgB,yCAAhB,CAAD,CAAhB;AAEO,MAAME,WAAW,GAAG;AACzBJ,EAAAA,OADyB;AAEzBG,EAAAA,OAFyB;AAGzBE,EAAAA,UAAU,EAAE;AAHa,CAApB","sourcesContent":["const presets = [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react')];\nconst plugins = [require.resolve('@babel/plugin-proposal-class-properties')];\n\nexport const babelConfig = {\n presets,\n plugins,\n sourceMaps: true,\n};\n"]}
1
+ {"version":3,"sources":["babel.config.ts"],"names":["presets","require","resolve","plugins","babelConfig","sourceMaps"],"mappings":";;;;;;AAAA,MAAMA,OAAO,GAAG,CACdC,OAAO,CAACC,OAAR,CAAgB,mBAAhB,CADc,EAEdD,OAAO,CAACC,OAAR,CAAgB,qBAAhB,CAFc,EAGdD,OAAO,CAACC,OAAR,CAAgB,0BAAhB,CAHc,CAAhB;AAKA,MAAMC,OAAO,GAAG,CAACF,OAAO,CAACC,OAAR,CAAgB,yCAAhB,CAAD,CAAhB;AAEO,MAAME,WAAW,GAAG;AACzBJ,EAAAA,OADyB;AAEzBG,EAAAA,OAFyB;AAGzBE,EAAAA,UAAU,EAAE;AAHa,CAApB","sourcesContent":["const presets = [\n require.resolve('@babel/preset-env'),\n require.resolve('@babel/preset-react'),\n require.resolve('@babel/preset-typescript'),\n];\nconst plugins = [require.resolve('@babel/plugin-proposal-class-properties')];\n\nexport const babelConfig = {\n presets,\n plugins,\n sourceMaps: true,\n};\n"]}
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.regexp.exec.js");
4
+
5
+ require("core-js/modules/es.string.replace.js");
6
+
3
7
  Object.defineProperty(exports, "__esModule", {
4
8
  value: true
5
9
  });
6
10
  exports.componentFile = void 0;
11
+ const regex = /([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g;
7
12
 
8
13
  const componentFile = context => {
9
14
  const {
@@ -12,7 +17,7 @@ const componentFile = context => {
12
17
  } = context;
13
18
  return {
14
19
  relativePath: `${name}.mdx`,
15
- content: `# Title - ${Name}
20
+ content: `# ${Name.replace(regex, '$1$4 $2$3$5')}
16
21
 
17
22
  This is markdown.
18
23
 
@@ -1 +1 @@
1
- {"version":3,"sources":["component.ts"],"names":["componentFile","context","name","namePascalCase","Name","relativePath","content"],"mappings":";;;;;;;AAEO,MAAMA,aAAa,GAAIC,OAAD,IAA+B;AAC1D,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,cAAc,EAAEC;AAAxB,MAAiCH,OAAvC;AACA,SAAO;AACLI,IAAAA,YAAY,EAAG,GAAEH,IAAK,MADjB;AAELI,IAAAA,OAAO,EAAG,aAAYF,IAAK;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXS,GAAP;AAaD,CAfM","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const componentFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n return {\n relativePath: `${name}.mdx`,\n content: `# Title - ${Name}\n\nThis is markdown.\n\n<p>This is HTML</p>\n\n# Import a React Component or use HTML\n\n<button>Button 👋 </button>\n`,\n };\n};\n"]}
1
+ {"version":3,"sources":["component.ts"],"names":["regex","componentFile","context","name","namePascalCase","Name","relativePath","content","replace"],"mappings":";;;;;;;;;;AAEA,MAAMA,KAAK,GAAG,uCAAd;;AAEO,MAAMC,aAAa,GAAIC,OAAD,IAA+B;AAC1D,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,cAAc,EAAEC;AAAxB,MAAiCH,OAAvC;AACA,SAAO;AACLI,IAAAA,YAAY,EAAG,GAAEH,IAAK,MADjB;AAELI,IAAAA,OAAO,EAAG,KAAIF,IAAI,CAACG,OAAL,CAAaR,KAAb,EAAoB,aAApB,CAAmC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXS,GAAP;AAaD,CAfM","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nconst regex = /([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g;\n\nexport const componentFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n return {\n relativePath: `${name}.mdx`,\n content: `# ${Name.replace(regex, '$1$4 $2$3$5')}\n\nThis is markdown.\n\n<p>This is HTML</p>\n\n# Import a React Component or use HTML\n\n<button>Button 👋 </button>\n`,\n };\n};\n"]}
@@ -28,7 +28,7 @@ import { ${Name} } from './index';
28
28
 
29
29
  \`\`\`js
30
30
  import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'
31
- import { MDXLayout } from '@teambit/ui.mdx-layout'
31
+ import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'
32
32
  import { ${Name} } from './index'
33
33
 
34
34
  <ThemeCompositions>
@@ -1 +1 @@
1
- {"version":3,"sources":["docs.ts"],"names":["docsFile","context","name","namePascalCase","Name","relativePath","content"],"mappings":";;;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAD,IAA+B;AACrD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,cAAc,EAAEC;AAAxB,MAAiCH,OAAvC;AAEA,SAAO;AACLI,IAAAA,YAAY,EAAG,GAAEH,IAAK,WADjB;AAELI,IAAAA,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA,WAAWF,IAAK;AAChB;AACA;AACA;AACA,GAAGA,IAAK;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAWA,IAAK;AAChB;AACA;AACA;AACA,OAAOA,IAAK;AACZ;AACA;AACA;AACA;AA3BS,GAAP;AA6BD,CAhCM","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const docsFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.docs.mdx`,\n content: `---\ndescription: 'An MDX component.'\nlabels: ['content', 'mdx']\n---\n\nimport { ${Name} } from './index';\n\n### Component usage\n\\`\\`\\`js\n<${Name} />\n\\`\\`\\`\n\n### Render with theme and MDX providers\n\n\\`\\`\\`js\nimport { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'\nimport { MDXLayout } from '@teambit/ui.mdx-layout'\nimport { ${Name} } from './index'\n\n<ThemeCompositions>\n <MDXLayout>\n <${Name} />\n </MDXLayout>\n</ThemeCompositions>\n\\`\\`\\`\n`,\n };\n};\n"]}
1
+ {"version":3,"sources":["docs.ts"],"names":["docsFile","context","name","namePascalCase","Name","relativePath","content"],"mappings":";;;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAD,IAA+B;AACrD,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,cAAc,EAAEC;AAAxB,MAAiCH,OAAvC;AAEA,SAAO;AACLI,IAAAA,YAAY,EAAG,GAAEH,IAAK,WADjB;AAELI,IAAAA,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA,WAAWF,IAAK;AAChB;AACA;AACA;AACA,GAAGA,IAAK;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAWA,IAAK;AAChB;AACA;AACA;AACA,OAAOA,IAAK;AACZ;AACA;AACA;AACA;AA3BS,GAAP;AA6BD,CAhCM","sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const docsFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.docs.mdx`,\n content: `---\ndescription: 'An MDX component.'\nlabels: ['content', 'mdx']\n---\n\nimport { ${Name} } from './index';\n\n### Component usage\n\\`\\`\\`js\n<${Name} />\n\\`\\`\\`\n\n### Render with theme and MDX providers\n\n\\`\\`\\`js\nimport { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'\nimport { MDXLayout } from '@teambit/mdx.ui.mdx-layout'\nimport { ${Name} } from './index'\n\n<ThemeCompositions>\n <MDXLayout>\n <${Name} />\n </MDXLayout>\n</ThemeCompositions>\n\\`\\`\\`\n`,\n };\n};\n"]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/mdx",
3
- "version": "0.0.566",
3
+ "version": "0.0.570",
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.566"
9
+ "version": "0.0.570"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.2.11",
@@ -15,24 +15,24 @@
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.586",
19
- "@teambit/compilation.modules.babel-compiler": "0.0.117",
20
- "@teambit/compiler": "0.0.586",
21
- "@teambit/mdx.modules.mdx-compiler": "0.0.479",
22
- "@teambit/dependency-resolver": "0.0.586",
23
- "@teambit/docs": "0.0.586",
24
- "@teambit/babel": "0.0.586",
25
- "@teambit/cli": "0.0.402",
26
- "@teambit/envs": "0.0.586",
27
- "@teambit/generator": "0.0.586",
28
- "@teambit/multi-compiler": "0.0.586",
29
- "@teambit/react": "0.0.586",
30
- "@teambit/typescript.modules.ts-config-mutator": "0.0.59",
31
- "@teambit/typescript": "0.0.586",
32
- "@teambit/compositions": "0.0.586",
18
+ "@teambit/builder": "0.0.590",
19
+ "@teambit/compilation.modules.babel-compiler": "0.0.120",
20
+ "@teambit/compiler": "0.0.590",
21
+ "@teambit/mdx.modules.mdx-compiler": "0.0.482",
22
+ "@teambit/dependency-resolver": "0.0.590",
23
+ "@teambit/docs": "0.0.590",
24
+ "@teambit/babel": "0.0.590",
25
+ "@teambit/cli": "0.0.405",
26
+ "@teambit/envs": "0.0.590",
27
+ "@teambit/generator": "0.0.590",
28
+ "@teambit/multi-compiler": "0.0.590",
29
+ "@teambit/react": "0.0.590",
30
+ "@teambit/typescript.modules.ts-config-mutator": "0.0.62",
31
+ "@teambit/typescript": "0.0.590",
32
+ "@teambit/compositions": "0.0.590",
33
33
  "@teambit/design.ui.empty-box": "0.0.352",
34
- "@teambit/tester": "0.0.586",
35
- "@teambit/ui": "0.0.586"
34
+ "@teambit/tester": "0.0.590",
35
+ "@teambit/ui": "0.0.590"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/fs-extra": "9.0.7",
@@ -43,10 +43,10 @@
43
43
  "@types/jest": "^26.0.0",
44
44
  "@types/react-dom": "^17.0.5",
45
45
  "@types/node": "12.20.4",
46
- "@teambit/mdx.aspect-docs.mdx": "0.0.124"
46
+ "@teambit/mdx.aspect-docs.mdx": "0.0.127"
47
47
  },
48
48
  "peerDependencies": {
49
- "@teambit/legacy": "1.0.188",
49
+ "@teambit/legacy": "1.0.191",
50
50
  "react-dom": "^16.8.0 || ^17.0.0",
51
51
  "react": "^16.8.0 || ^17.0.0"
52
52
  },
@@ -74,7 +74,7 @@
74
74
  "react": "-"
75
75
  },
76
76
  "peerDependencies": {
77
- "@teambit/legacy": "1.0.188",
77
+ "@teambit/legacy": "1.0.191",
78
78
  "react-dom": "^16.8.0 || ^17.0.0",
79
79
  "react": "^16.8.0 || ^17.0.0"
80
80
  }
@@ -1,10 +1,12 @@
1
1
  import { ComponentContext } from '@teambit/generator';
2
2
 
3
+ const regex = /([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g;
4
+
3
5
  export const componentFile = (context: ComponentContext) => {
4
6
  const { name, namePascalCase: Name } = context;
5
7
  return {
6
8
  relativePath: `${name}.mdx`,
7
- content: `# Title - ${Name}
9
+ content: `# ${Name.replace(regex, '$1$4 $2$3$5')}
8
10
 
9
11
  This is markdown.
10
12
 
@@ -21,7 +21,7 @@ import { ${Name} } from './index';
21
21
 
22
22
  \`\`\`js
23
23
  import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'
24
- import { MDXLayout } from '@teambit/ui.mdx-layout'
24
+ import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'
25
25
  import { ${Name} } from './index'
26
26
 
27
27
  <ThemeCompositions>
Binary file