@teambit/mdx 0.0.1090 → 0.0.1092

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 (33) hide show
  1. package/artifacts/env-template/public/{383.467873c94ffd6f6dc489.js → 182.d10a2300a3c6d2196e7b.js} +56 -49
  2. package/artifacts/env-template/public/{924.f496add3c3d5bdf0bc41.js → 924.acac6a784d5974a50d8a.js} +19 -19
  3. package/artifacts/env-template/public/assets-manifest.json +14 -14
  4. package/artifacts/env-template/public/{compositions.9822b0ba9db83ea58811.js → compositions.b813e8655ee052993ba7.js} +3 -3
  5. package/artifacts/env-template/public/compositions.html +1 -1
  6. package/artifacts/env-template/public/{overview.1c9a13c511e9c92c2bc5.js → overview.cd5db46314d4f776905e.js} +1 -1
  7. package/artifacts/env-template/public/overview.html +1 -1
  8. package/artifacts/env-template/public/{peers.8a2dbf55b098b5f3b8f8.js → peers.6e11f11ac7cf884032ab.js} +1 -1
  9. package/artifacts/env-template/public/{preview-root.b1ea3fdc09f4983f7afd.js → preview-root.4193777f3c98e63dccba.js} +1 -1
  10. package/artifacts/env-template/public/static/css/{924.b8931f51.css → 924.491f0cdf.css} +1 -1
  11. package/dist/babel/babel.config.js.map +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/mdx.aspect.js.map +1 -1
  14. package/dist/mdx.compiler.js.map +1 -1
  15. package/dist/mdx.composition.js.map +1 -1
  16. package/dist/mdx.detector.js.map +1 -1
  17. package/dist/mdx.detector.spec.js.map +1 -1
  18. package/dist/mdx.doc-reader.js.map +1 -1
  19. package/dist/mdx.env.js.map +1 -1
  20. package/dist/mdx.main.runtime.js.map +1 -1
  21. package/dist/mdx.templates.js.map +1 -1
  22. package/dist/mdx.ui.runtime.js.map +1 -1
  23. package/dist/{preview-1689736586631.js → preview-1689909446382.js} +2 -2
  24. package/dist/templates/mdx-component/files/component.js.map +1 -1
  25. package/dist/templates/mdx-component/files/composition.js.map +1 -1
  26. package/dist/templates/mdx-component/files/docs.js.map +1 -1
  27. package/dist/templates/mdx-component/files/test.js.map +1 -1
  28. package/dist/templates/mdx-component/index.js.map +1 -1
  29. package/package-tar/teambit-mdx-0.0.1092.tgz +0 -0
  30. package/package.json +16 -16
  31. package/package-tar/teambit-mdx-0.0.1090.tgz +0 -0
  32. /package/{compositions-1689736586631.js → compositions-1689909446382.js} +0 -0
  33. /package/{overview-1689736586631.js → overview-1689909446382.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_docs","data","require","_mdxModules","MDXDocReader","constructor","extensions","read","path","contents","output","compile","toString","filepath","metadata","getMetadata","doc","Doc","from","isFormatSupported","format","includes","exports"],"sources":["mdx.doc-reader.ts"],"sourcesContent":["import { DocReader, Doc } from '@teambit/docs';\nimport { compile } from '@teambit/mdx.modules.mdx-compiler';\n\nexport class MDXDocReader implements DocReader {\n constructor(private extensions: string[]) {}\n\n async read(path: string, contents: Buffer) {\n const output = await compile(contents.toString('utf-8'), { filepath: path });\n const metadata = output.getMetadata();\n\n const doc = Doc.from(path, metadata);\n return doc;\n }\n\n isFormatSupported(format: string) {\n return this.extensions.includes(format);\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,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,YAAY,CAAsB;EAC7CC,WAAWA,CAASC,UAAoB,EAAE;IAAA,KAAtBA,UAAoB,GAApBA,UAAoB;EAAG;EAE3C,MAAMC,IAAIA,CAACC,IAAY,EAAEC,QAAgB,EAAE;IACzC,MAAMC,MAAM,GAAG,MAAM,IAAAC,qBAAO,EAACF,QAAQ,CAACG,QAAQ,CAAC,OAAO,CAAC,EAAE;MAAEC,QAAQ,EAAEL;IAAK,CAAC,CAAC;IAC5E,MAAMM,QAAQ,GAAGJ,MAAM,CAACK,WAAW,CAAC,CAAC;IAErC,MAAMC,GAAG,GAAGC,WAAG,CAACC,IAAI,CAACV,IAAI,EAAEM,QAAQ,CAAC;IACpC,OAAOE,GAAG;EACZ;EAEAG,iBAAiBA,CAACC,MAAc,EAAE;IAChC,OAAO,IAAI,CAACd,UAAU,CAACe,QAAQ,CAACD,MAAM,CAAC;EACzC;AACF;AAACE,OAAA,CAAAlB,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"names":["MDXDocReader","constructor","extensions","read","path","contents","output","compile","toString","filepath","metadata","getMetadata","doc","Doc","from","isFormatSupported","format","includes"],"sources":["mdx.doc-reader.ts"],"sourcesContent":["import { DocReader, Doc } from '@teambit/docs';\nimport { compile } from '@teambit/mdx.modules.mdx-compiler';\n\nexport class MDXDocReader implements DocReader {\n constructor(private extensions: string[]) {}\n\n async read(path: string, contents: Buffer) {\n const output = await compile(contents.toString('utf-8'), { filepath: path });\n const metadata = output.getMetadata();\n\n const doc = Doc.from(path, metadata);\n return doc;\n }\n\n isFormatSupported(format: string) {\n return this.extensions.includes(format);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,YAAY,CAAsB;EAC7CC,WAAW,CAASC,UAAoB,EAAE;IAAA,KAAtBA,UAAoB,GAApBA,UAAoB;EAAG;EAE3C,MAAMC,IAAI,CAACC,IAAY,EAAEC,QAAgB,EAAE;IACzC,MAAMC,MAAM,GAAG,MAAM,IAAAC,qBAAO,EAACF,QAAQ,CAACG,QAAQ,CAAC,OAAO,CAAC,EAAE;MAAEC,QAAQ,EAAEL;IAAK,CAAC,CAAC;IAC5E,MAAMM,QAAQ,GAAGJ,MAAM,CAACK,WAAW,EAAE;IAErC,MAAMC,GAAG,GAAGC,WAAG,CAACC,IAAI,CAACV,IAAI,EAAEM,QAAQ,CAAC;IACpC,OAAOE,GAAG;EACZ;EAEAG,iBAAiB,CAACC,MAAc,EAAE;IAChC,OAAO,IAAI,CAACd,UAAU,CAACe,QAAQ,CAACD,MAAM,CAAC;EACzC;AACF;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["MdxEnvType","exports","MdxEnv"],"sources":["mdx.env.ts"],"sourcesContent":["import { Environment } from '@teambit/envs';\n\nexport const MdxEnvType = 'mdx';\n\nexport class MdxEnv implements Environment {\n // TODO: add the env here properly.\n}\n"],"mappings":";;;;;;AAEO,MAAMA,UAAU,GAAG,KAAK;AAACC,OAAA,CAAAD,UAAA,GAAAA,UAAA;AAEzB,MAAME,MAAM,CAAwB;EACzC;AAAA;AACDD,OAAA,CAAAC,MAAA,GAAAA,MAAA"}
1
+ {"version":3,"names":["MdxEnvType","MdxEnv"],"sources":["mdx.env.ts"],"sourcesContent":["import { Environment } from '@teambit/envs';\n\nexport const MdxEnvType = 'mdx';\n\nexport class MdxEnv implements Environment {\n // TODO: add the env here properly.\n}\n"],"mappings":";;;;;;AAEO,MAAMA,UAAU,GAAG,KAAK;AAAC;AAEzB,MAAMC,MAAM,CAAwB;EACzC;AAAA;AACD"}
@@ -1 +1 @@
1
- {"version":3,"names":["_babel","data","require","_cli","_compiler","_dependencyResolver","_docs","_interopRequireDefault","_envs","_multiCompiler","_react","_generator","_mdx","_mdx2","_mdx3","_mdx4","_mdx5","_babel2","MDXMain","constructor","_defineProperty2","default","icon","createCompiler","opts","mdxCompiler","MDXCompiler","MDXAspect","id","mdxEnv","_mdxEnv","value","provider","docs","depResolver","react","envs","multiCompiler","babel","compiler","generator","config","mdx","tsTransformer","tsconfig","setCompileJs","setCompileJsx","setShouldCopyNonSupportedFiles","tsCompiler","env","getCompiler","babelTransformOptions","babelConfig","shouldCopyNonSupportedFiles","ignoredPatterns","getPatterns","compose","reactEnv","overrideCompiler","overrideDependencies","dependencies","overrideCompilerTasks","createTask","override","__getDescriptor","type","registerEnv","registerDetector","MDXDependencyDetector","extensions","registerDocReader","MDXDocReader","registerComponentTemplate","componentTemplates","exports","MainRuntime","DocsAspect","DependencyResolverAspect","ReactAspect","EnvsAspect","MultiCompilerAspect","BabelAspect","CompilerAspect","GeneratorAspect","addRuntime"],"sources":["mdx.main.runtime.ts"],"sourcesContent":["import { TypescriptConfigMutator } from '@teambit/typescript.modules.ts-config-mutator';\nimport { TsConfigTransformer } from '@teambit/typescript';\nimport { BabelAspect, BabelMain } from '@teambit/babel';\nimport { MainRuntime } from '@teambit/cli';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport DocsAspect, { DocsMain } from '@teambit/docs';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport MultiCompilerAspect, { MultiCompilerMain } from '@teambit/multi-compiler';\nimport ReactAspect, { ReactEnv, ReactMain } from '@teambit/react';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { MDXAspect } from './mdx.aspect';\nimport { MDXCompiler, MDXCompilerOpts } from './mdx.compiler';\nimport { MDXDependencyDetector } from './mdx.detector';\nimport { MDXDocReader } from './mdx.doc-reader';\nimport { componentTemplates } from './mdx.templates';\nimport { babelConfig } from './babel/babel.config';\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 const mdxCompiler = new MDXCompiler(MDXAspect.id, opts);\n return mdxCompiler;\n }\n\n _mdxEnv: ReactEnv;\n get mdxEnv() {\n return this._mdxEnv;\n }\n private set mdxEnv(value: ReactEnv) {\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 BabelAspect,\n CompilerAspect,\n GeneratorAspect,\n ];\n\n static defaultConfig = {\n extensions: ['.md', '.mdx'],\n };\n\n static async provider(\n [docs, depResolver, react, envs, multiCompiler, babel, compiler, generator]: [\n DocsMain,\n DependencyResolverMain,\n ReactMain,\n EnvsMain,\n MultiCompilerMain,\n BabelMain,\n CompilerMain,\n GeneratorMain\n ],\n config: MDXConfig\n ) {\n const mdx = new MDXMain();\n const tsTransformer: TsConfigTransformer = (tsconfig: TypescriptConfigMutator) => {\n // set the shouldCopyNonSupportedFiles to false since we don't want ts to copy the .mdx file to the dist folder (it will conflict with the .mdx.js file created by the mdx compiler)\n tsconfig.setCompileJs(false).setCompileJsx(false).setShouldCopyNonSupportedFiles(false);\n return tsconfig;\n };\n const tsCompiler = react.env.getCompiler([tsTransformer]);\n\n const mdxCompiler = multiCompiler.createCompiler(\n [\n // set the shouldCopyNonSupportedFiles to false since we don't want babel to copy the .mdx file to the dist folder (it will conflict with the .mdx.js file created by the mdx compiler)\n babel.createCompiler({ babelTransformOptions: babelConfig, shouldCopyNonSupportedFiles: false }),\n mdx.createCompiler({ ignoredPatterns: docs.getPatterns(), babelTransformOptions: babelConfig }),\n tsCompiler,\n ],\n {}\n );\n const mdxEnv = envs.compose(react.reactEnv, [\n react.overrideCompiler(mdxCompiler),\n react.overrideDependencies({\n dependencies: {\n '@teambit/mdx.ui.mdx-scope-context': '0.0.498',\n '@mdx-js/react': '1.6.22',\n },\n }),\n react.overrideCompilerTasks([compiler.createTask('MDXCompiler', mdxCompiler)]),\n envs.override({\n __getDescriptor: async () => {\n return {\n type: 'mdx',\n };\n },\n }),\n ]);\n envs.registerEnv(mdxEnv);\n depResolver.registerDetector(new MDXDependencyDetector(config.extensions));\n docs.registerDocReader(new MDXDocReader(config.extensions));\n if (generator) generator.registerComponentTemplate(componentTemplates);\n\n mdx.mdxEnv = mdxEnv as ReactEnv;\n return mdx;\n }\n}\n\nMDXA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E,MAAAA,CAAA,KAAY;QAC3B,OAAO;UACLC,IAAI,EAAE;QACR,CAAC;MACH;IACF,CAAC,CAAC,CACH,CAAC;IACF7B,IAAI,CAAC8B,WAAW,CAACrC,MAAM,CAAC;IACxBK,WAAW,CAACiC,gBAAgB,CAAC,KAAIC,6BAAqB,EAAC3B,MAAM,CAAC4B,UAAU,CAAC,CAAC;IAC1EpC,IAAI,CAACqC,iBAAiB,CAAC,KAAIC,oBAAY,EAAC9B,MAAM,CAAC4B,UAAU,CAAC,CAAC;IAC3D,IAAI7B,SAAS,EAAEA,SAAS,CAACgC,yBAAyB,CAACC,0BAAkB,CAAC;IAEtE/B,GAAG,CAACb,MAAM,GAAGA,MAAkB;IAC/B,OAAOa,GAAG;EACZ;AACF;AAACgC,OAAA,CAAAxD,OAAA,GAAAA,OAAA;AAAA,IAAAE,gBAAA,GAAAC,OAAA,EA7FYH,OAAO,aAqBDyD,kBAAW;AAAA,IAAAvD,gBAAA,GAAAC,OAAA,EArBjBH,OAAO,kBAuBI,CACpB0D,eAAU,EACVC,8CAAwB,EACxBC,gBAAW,EACXC,kBAAU,EACVC,wBAAmB,EACnBC,oBAAW,EACXC,0BAAc,EACdC,4BAAe,CAChB;AAAA,IAAA/D,gBAAA,GAAAC,OAAA,EAhCUH,OAAO,mBAkCK;EACrBmD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM;AAC5B,CAAC;AA2DH1C,gBAAS,CAACyD,UAAU,CAAClE,OAAO,CAAC"}
1
+ {"version":3,"names":["MDXMain","icon","createCompiler","opts","mdxCompiler","MDXCompiler","MDXAspect","id","mdxEnv","_mdxEnv","value","provider","docs","depResolver","react","envs","multiCompiler","babel","compiler","generator","config","mdx","tsTransformer","tsconfig","setCompileJs","setCompileJsx","setShouldCopyNonSupportedFiles","tsCompiler","env","getCompiler","babelTransformOptions","babelConfig","shouldCopyNonSupportedFiles","ignoredPatterns","getPatterns","compose","reactEnv","overrideCompiler","overrideDependencies","dependencies","overrideCompilerTasks","createTask","override","__getDescriptor","type","registerEnv","registerDetector","MDXDependencyDetector","extensions","registerDocReader","MDXDocReader","registerComponentTemplate","componentTemplates","MainRuntime","DocsAspect","DependencyResolverAspect","ReactAspect","EnvsAspect","MultiCompilerAspect","BabelAspect","CompilerAspect","GeneratorAspect","addRuntime"],"sources":["mdx.main.runtime.ts"],"sourcesContent":["import { TypescriptConfigMutator } from '@teambit/typescript.modules.ts-config-mutator';\nimport { TsConfigTransformer } from '@teambit/typescript';\nimport { BabelAspect, BabelMain } from '@teambit/babel';\nimport { MainRuntime } from '@teambit/cli';\nimport { CompilerAspect, CompilerMain } from '@teambit/compiler';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport DocsAspect, { DocsMain } from '@teambit/docs';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport MultiCompilerAspect, { MultiCompilerMain } from '@teambit/multi-compiler';\nimport ReactAspect, { ReactEnv, ReactMain } from '@teambit/react';\nimport { GeneratorAspect, GeneratorMain } from '@teambit/generator';\nimport { MDXAspect } from './mdx.aspect';\nimport { MDXCompiler, MDXCompilerOpts } from './mdx.compiler';\nimport { MDXDependencyDetector } from './mdx.detector';\nimport { MDXDocReader } from './mdx.doc-reader';\nimport { componentTemplates } from './mdx.templates';\nimport { babelConfig } from './babel/babel.config';\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 const mdxCompiler = new MDXCompiler(MDXAspect.id, opts);\n return mdxCompiler;\n }\n\n _mdxEnv: ReactEnv;\n get mdxEnv() {\n return this._mdxEnv;\n }\n private set mdxEnv(value: ReactEnv) {\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 BabelAspect,\n CompilerAspect,\n GeneratorAspect,\n ];\n\n static defaultConfig = {\n extensions: ['.md', '.mdx'],\n };\n\n static async provider(\n [docs, depResolver, react, envs, multiCompiler, babel, compiler, generator]: [\n DocsMain,\n DependencyResolverMain,\n ReactMain,\n EnvsMain,\n MultiCompilerMain,\n BabelMain,\n CompilerMain,\n GeneratorMain\n ],\n config: MDXConfig\n ) {\n const mdx = new MDXMain();\n const tsTransformer: TsConfigTransformer = (tsconfig: TypescriptConfigMutator) => {\n // set the shouldCopyNonSupportedFiles to false since we don't want ts to copy the .mdx file to the dist folder (it will conflict with the .mdx.js file created by the mdx compiler)\n tsconfig.setCompileJs(false).setCompileJsx(false).setShouldCopyNonSupportedFiles(false);\n return tsconfig;\n };\n const tsCompiler = react.env.getCompiler([tsTransformer]);\n\n const mdxCompiler = multiCompiler.createCompiler(\n [\n // set the shouldCopyNonSupportedFiles to false since we don't want babel to copy the .mdx file to the dist folder (it will conflict with the .mdx.js file created by the mdx compiler)\n babel.createCompiler({ babelTransformOptions: babelConfig, shouldCopyNonSupportedFiles: false }),\n mdx.createCompiler({ ignoredPatterns: docs.getPatterns(), babelTransformOptions: babelConfig }),\n tsCompiler,\n ],\n {}\n );\n const mdxEnv = envs.compose(react.reactEnv, [\n react.overrideCompiler(mdxCompiler),\n react.overrideDependencies({\n dependencies: {\n '@teambit/mdx.ui.mdx-scope-context': '0.0.498',\n '@mdx-js/react': '1.6.22',\n },\n }),\n react.overrideCompilerTasks([compiler.createTask('MDXCompiler', mdxCompiler)]),\n envs.override({\n __getDescriptor: async () => {\n return {\n type: 'mdx',\n };\n },\n }),\n ]);\n envs.registerEnv(mdxEnv);\n depResolver.registerDetector(new MDXDependencyDetector(config.extensions));\n docs.registerDocReader(new MDXDocReader(config.extensions));\n if (generator) generator.registerComponentTemplate(componentTemplates);\n\n mdx.mdxEnv = mdxEnv as ReactEnv;\n return mdx;\n }\n}\n\nMDXAspect.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M,CAAC4B,UAAU,CAAC,CAAC;IAC1EpC,IAAI,CAACqC,iBAAiB,CAAC,KAAIC,oBAAY,EAAC9B,MAAM,CAAC4B,UAAU,CAAC,CAAC;IAC3D,IAAI7B,SAAS,EAAEA,SAAS,CAACgC,yBAAyB,CAACC,0BAAkB,CAAC;IAEtE/B,GAAG,CAACb,MAAM,GAAGA,MAAkB;IAC/B,OAAOa,GAAG;EACZ;AACF;AAAC;AAAA,gCA7FYrB,OAAO,aAqBDqD,kBAAW;AAAA,gCArBjBrD,OAAO,kBAuBI,CACpBsD,eAAU,EACVC,8CAAwB,EACxBC,gBAAW,EACXC,kBAAU,EACVC,wBAAmB,EACnBC,oBAAW,EACXC,0BAAc,EACdC,4BAAe,CAChB;AAAA,gCAhCU7D,OAAO,mBAkCK;EACrBgD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM;AAC5B,CAAC;AA2DH1C,gBAAS,CAACwD,UAAU,CAAC9D,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["_mdxComponent","data","require","componentTemplates","MDXComponent","deprecatedMDXComponent","exports"],"sources":["mdx.templates.ts"],"sourcesContent":["import { ComponentTemplate } from '@teambit/generator';\nimport { MDXComponent, deprecatedMDXComponent } from './templates/mdx-component';\n\nexport const componentTemplates: ComponentTemplate[] = [MDXComponent, deprecatedMDXComponent];\n"],"mappings":";;;;;;AACA,SAAAA,cAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,aAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,kBAAuC,GAAG,CAACC,4BAAY,EAAEC,sCAAsB,CAAC;AAACC,OAAA,CAAAH,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["componentTemplates","MDXComponent","deprecatedMDXComponent"],"sources":["mdx.templates.ts"],"sourcesContent":["import { ComponentTemplate } from '@teambit/generator';\nimport { MDXComponent, deprecatedMDXComponent } from './templates/mdx-component';\n\nexport const componentTemplates: ComponentTemplate[] = [MDXComponent, deprecatedMDXComponent];\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,kBAAuC,GAAG,CAACC,4BAAY,EAAEC,sCAAsB,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireDefault","require","_compositions","_ui","_tester","_designUi","_mdx","MDXEnvUI","provider","compositionsUI","testerUi","mdxEnvUI","registerEmptyState","default","createElement","EmptyBox","title","linkText","link","exports","_defineProperty2","UIRuntime","CompositionsAspect","TesterAspect","MDXAspect","addRuntime","_default"],"sources":["mdx.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { CompositionsAspect, CompositionsUI } from '@teambit/compositions';\nimport { UIRuntime } from '@teambit/ui';\nimport { TesterAspect, TesterUI } from '@teambit/tester';\nimport { EmptyBox } from '@teambit/design.ui.empty-box';\nimport { MDXAspect } from './mdx.aspect';\n\nexport class MDXEnvUI {\n static runtime = UIRuntime;\n static slots = [];\n static dependencies = [CompositionsAspect, TesterAspect];\n\n static async provider([compositionsUI, testerUi]: [CompositionsUI, TesterUI]) {\n const mdxEnvUI = new MDXEnvUI();\n\n // TODO: get the docs domain from the community aspect and pass it here as a prop\n testerUi.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any tests.\"\n linkText=\"Learn how to add tests to your MDX components\"\n link={`https://bit.dev/docs/dev-services-overview/tester/tester-overview`}\n />\n );\n });\n\n // TODO: get the docs domain from the community aspect and pass it here as a prop\n compositionsUI.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any compositions.\"\n linkText=\"Learn how to add compositions to your MDX components\"\n link={`https://bit.dev/docs/dev-services-overview/compositions/compositions-overview`}\n />\n );\n });\n\n return mdxEnvUI;\n }\n}\n\nMDXAspect.addRuntime(MDXEnvUI);\n\nexport default MDXEnvUI;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAA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AA,CAAAC,aAAA,CAACT,SAAA,GAAAU,QAAQ;QACPC,KAAK,EAAC,oDAA+C;QACrDC,QAAQ,EAAC,sDAAsD;QAC/DC,IAAI,EAAG;MAA+E,CACvF,CAAC;IAEN,CAAC,CAAC;IAEF,OAAOP,QAAQ;EACjB;AACF;AAACQ,OAAA,CAAAZ,QAAA,GAAAA,QAAA;AAAA,IAAAa,gBAAA,GAAAP,OAAA,EAhCYN,QAAQ,aACFc,eAAS;AAAA,IAAAD,gBAAA,GAAAP,OAAA,EADfN,QAAQ,WAEJ,EAAE;AAAA,IAAAa,gBAAA,GAAAP,OAAA,EAFNN,QAAQ,kBAGG,CAACe,kCAAkB,EAAEC,sBAAY,CAAC;AA+B1DC,gBAAS,CAACC,UAAU,CAAClB,QAAQ,CAAC;AAAC,IAAAmB,QAAA,GAEhBnB,QAAQ;AAAAY,OAAA,CAAAN,OAAA,GAAAa,QAAA"}
1
+ {"version":3,"names":["MDXEnvUI","provider","compositionsUI","testerUi","mdxEnvUI","registerEmptyState","UIRuntime","CompositionsAspect","TesterAspect","MDXAspect","addRuntime"],"sources":["mdx.ui.runtime.tsx"],"sourcesContent":["import React from 'react';\nimport { CompositionsAspect, CompositionsUI } from '@teambit/compositions';\nimport { UIRuntime } from '@teambit/ui';\nimport { TesterAspect, TesterUI } from '@teambit/tester';\nimport { EmptyBox } from '@teambit/design.ui.empty-box';\nimport { MDXAspect } from './mdx.aspect';\n\nexport class MDXEnvUI {\n static runtime = UIRuntime;\n static slots = [];\n static dependencies = [CompositionsAspect, TesterAspect];\n\n static async provider([compositionsUI, testerUi]: [CompositionsUI, TesterUI]) {\n const mdxEnvUI = new MDXEnvUI();\n\n // TODO: get the docs domain from the community aspect and pass it here as a prop\n testerUi.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any tests.\"\n linkText=\"Learn how to add tests to your MDX components\"\n link={`https://bit.dev/docs/dev-services-overview/tester/tester-overview`}\n />\n );\n });\n\n // TODO: get the docs domain from the community aspect and pass it here as a prop\n compositionsUI.registerEmptyState(() => {\n return (\n <EmptyBox\n title=\"This component doesn’t have any compositions.\"\n linkText=\"Learn how to add compositions to your MDX components\"\n link={`https://bit.dev/docs/dev-services-overview/compositions/compositions-overview`}\n />\n );\n });\n\n return mdxEnvUI;\n }\n}\n\nMDXAspect.addRuntime(MDXEnvUI);\n\nexport default MDXEnvUI;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,QAAQ,CAAC;EAKpB,aAAaC,QAAQ,CAAC,CAACC,cAAc,EAAEC,QAAQ,CAA6B,EAAE;IAC5E,MAAMC,QAAQ,GAAG,IAAIJ,QAAQ,EAAE;;IAE/B;IACAG,QAAQ,CAACE,kBAAkB,CAAC,MAAM;MAChC,oBACE,+BAAC,oBAAQ;QACP,KAAK,EAAC,6CAAwC;QAC9C,QAAQ,EAAC,+CAA+C;QACxD,IAAI,EAAG;MAAmE,EAC1E;IAEN,CAAC,CAAC;;IAEF;IACAH,cAAc,CAACG,kBAAkB,CAAC,MAAM;MACtC,oBACE,+BAAC,oBAAQ;QACP,KAAK,EAAC,oDAA+C;QACrD,QAAQ,EAAC,sDAAsD;QAC/D,IAAI,EAAG;MAA+E,EACtF;IAEN,CAAC,CAAC;IAEF,OAAOD,QAAQ;EACjB;AACF;AAAC;AAAA,gCAhCYJ,QAAQ,aACFM,eAAS;AAAA,gCADfN,QAAQ,WAEJ,EAAE;AAAA,gCAFNA,QAAQ,kBAGG,CAACO,kCAAkB,EAAEC,sBAAY,CAAC;AA+B1DC,gBAAS,CAACC,UAAU,CAACV,QAAQ,CAAC;AAAC,eAEhBA,QAAQ;AAAA"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.mdx_mdx@0.0.1090/dist/mdx.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.mdx_mdx@0.0.1090/dist/mdx.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.mdx_mdx@0.0.1092/dist/mdx.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.mdx_mdx@0.0.1092/dist/mdx.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1 +1 @@
1
- {"version":3,"names":["regex","componentFile","context","name","namePascalCase","Name","relativePath","content","replace","exports"],"sources":["component.ts"],"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"],"mappings":";;;;;;;;AAEA,MAAMA,KAAK,GAAG,uCAAuC;AAE9C,MAAMC,aAAa,GAAIC,OAAyB,IAAK;EAC1D,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAC9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,MAAK;IAC3BI,OAAO,EAAG,KAAIF,IAAI,CAACG,OAAO,CAACR,KAAK,EAAE,aAAa,CAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH,CAAC;AAACS,OAAA,CAAAR,aAAA,GAAAA,aAAA"}
1
+ {"version":3,"names":["regex","componentFile","context","name","namePascalCase","Name","relativePath","content","replace"],"sources":["component.ts"],"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"],"mappings":";;;;;;;;AAEA,MAAMA,KAAK,GAAG,uCAAuC;AAE9C,MAAMC,aAAa,GAAIC,OAAyB,IAAK;EAC1D,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAC9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,MAAK;IAC3BI,OAAO,EAAG,KAAIF,IAAI,CAACG,OAAO,CAACR,KAAK,EAAE,aAAa,CAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content","exports"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const compositionFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${Name} } from './index';\n\nexport const Basic${Name} = () => (\n <${Name} />\n);\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,eAAe,GAAIC,OAAyB,IAAK;EAC5D,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,kBAAiB;IACvCI,OAAO,EAAG;AACd,WAAWF,IAAK;AAChB;AACA,oBAAoBA,IAAK;AACzB,KAAKA,IAAK;AACV;AACA;EACE,CAAC;AACH,CAAC;AAACG,OAAA,CAAAP,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["compositionFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["composition.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const compositionFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.composition.tsx`,\n content: `import React from 'react';\nimport { ${Name} } from './index';\n\nexport const Basic${Name} = () => (\n <${Name} />\n);\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,eAAe,GAAIC,OAAyB,IAAK;EAC5D,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,kBAAiB;IACvCI,OAAO,EAAG;AACd,WAAWF,IAAK;AAChB;AACA,oBAAoBA,IAAK;AACzB,KAAKA,IAAK;AACV;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content","exports"],"sources":["docs.ts"],"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"],"mappings":";;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAyB,IAAK;EACrD,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,WAAU;IAChCI,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;EACE,CAAC;AACH,CAAC;AAACG,OAAA,CAAAP,QAAA,GAAAA,QAAA"}
1
+ {"version":3,"names":["docsFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["docs.ts"],"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"],"mappings":";;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAyB,IAAK;EACrD,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,WAAU;IAChCI,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;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["testFile","context","name","namePascalCase","Name","relativePath","content","exports"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const testFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.spec.tsx`,\n content: `import React from 'react';\nimport { render } from '@testing-library/react';\nimport { Basic${Name} } from './${name}.composition';\n\nit('should render with the correct text', () => {\n const { getByText } = render(<Basic${Name} />);\n const rendered = getByText('${Name}');\n expect(rendered).toBeTruthy();\n});\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAyB,IAAK;EACrD,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,WAAU;IAChCI,OAAO,EAAG;AACd;AACA,gBAAgBF,IAAK,cAAaF,IAAK;AACvC;AACA;AACA,uCAAuCE,IAAK;AAC5C,gCAAgCA,IAAK;AACrC;AACA;AACA;EACE,CAAC;AACH,CAAC;AAACG,OAAA,CAAAP,QAAA,GAAAA,QAAA"}
1
+ {"version":3,"names":["testFile","context","name","namePascalCase","Name","relativePath","content"],"sources":["test.ts"],"sourcesContent":["import { ComponentContext } from '@teambit/generator';\n\nexport const testFile = (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n\n return {\n relativePath: `${name}.spec.tsx`,\n content: `import React from 'react';\nimport { render } from '@testing-library/react';\nimport { Basic${Name} } from './${name}.composition';\n\nit('should render with the correct text', () => {\n const { getByText } = render(<Basic${Name} />);\n const rendered = getByText('${Name}');\n expect(rendered).toBeTruthy();\n});\n`,\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,QAAQ,GAAIC,OAAyB,IAAK;EACrD,MAAM;IAAEC,IAAI;IAAEC,cAAc,EAAEC;EAAK,CAAC,GAAGH,OAAO;EAE9C,OAAO;IACLI,YAAY,EAAG,GAAEH,IAAK,WAAU;IAChCI,OAAO,EAAG;AACd;AACA,gBAAgBF,IAAK,cAAaF,IAAK;AACvC;AACA;AACA,uCAAuCE,IAAK;AAC5C,gCAAgCA,IAAK;AACrC;AACA;AACA;EACE,CAAC;AACH,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["_component","data","require","_composition","_docs","MDXComponent","name","description","generateFiles","context","namePascalCase","Name","indexFile","relativePath","content","componentFile","compositionFile","docsFile","config","env","exports","deprecatedMDXComponent","hidden"],"sources":["index.ts"],"sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { componentFile } from './files/component';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\n// TODO @ranm8 Tests won't work in MDX until we add a Jest Transformer for the MDX env.\n// import { testFile } from './files/test';\n\nexport const MDXComponent: ComponentTemplate = {\n name: 'mdx',\n description: 'MDX-file compiled by Bit to a reuseable component',\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.ts',\n content: `export { default as ${Name}, default } from './${name}.mdx';\n`,\n };\n\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context)];\n },\n config: {\n 'teambit.mdx/mdx': {},\n 'teambit.envs/envs': {\n env: 'teambit.mdx/mdx',\n },\n },\n};\n\nexport const deprecatedMDXComponent: ComponentTemplate = {\n name: 'mdx-component',\n description: 'MDX-file compiled by Bit to a reuseable component',\n hidden: true,\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.ts',\n content: `export { default as ${Name} } from './${name}.mdx';\n`,\n };\n\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context)];\n },\n config: {\n 'teambit.mdx/mdx': {},\n 'teambit.envs/envs': {\n env: 'teambit.mdx/mdx',\n },\n },\n};\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,aAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,YAAA,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;AACA;AACA;;AAEO,MAAMI,YAA+B,GAAG;EAC7CC,IAAI,EAAE,KAAK;EACXC,WAAW,EAAE,mDAAmD;EAEhEC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,MAAM;MAAEH,IAAI;MAAEI,cAAc,EAAEC;IAAK,CAAC,GAAGF,OAAO;IAC9C,MAAMG,SAAS,GAAG;MAChBC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAG,uBAAsBH,IAAK,uBAAsBL,IAAK;AACtE;IACI,CAAC;IAED,OAAO,CAACM,SAAS,EAAE,IAAAG,0BAAa,EAACN,OAAO,CAAC,EAAE,IAAAO,8BAAe,EAACP,OAAO,CAAC,EAAE,IAAAQ,gBAAQ,EAACR,OAAO,CAAC,CAAC;EACzF,CAAC;EACDS,MAAM,EAAE;IACN,iBAAiB,EAAE,CAAC,CAAC;IACrB,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAACC,OAAA,CAAAf,YAAA,GAAAA,YAAA;AAEK,MAAMgB,sBAAyC,GAAG;EACvDf,IAAI,EAAE,eAAe;EACrBC,WAAW,EAAE,mDAAmD;EAChEe,MAAM,EAAE,IAAI;EAEZd,aAAa,EAAGC,OAAyB,IAAK;IAC5C,MAAM;MAAEH,IAAI;MAAEI,cAAc,EAAEC;IAAK,CAAC,GAAGF,OAAO;IAC9C,MAAMG,SAAS,GAAG;MAChBC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAG,uBAAsBH,IAAK,cAAaL,IAAK;AAC7D;IACI,CAAC;IAED,OAAO,CAACM,SAAS,EAAE,IAAAG,0BAAa,EAACN,OAAO,CAAC,EAAE,IAAAO,8BAAe,EAACP,OAAO,CAAC,EAAE,IAAAQ,gBAAQ,EAACR,OAAO,CAAC,CAAC;EACzF,CAAC;EACDS,MAAM,EAAE;IACN,iBAAiB,EAAE,CAAC,CAAC;IACrB,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAACC,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"names":["MDXComponent","name","description","generateFiles","context","namePascalCase","Name","indexFile","relativePath","content","componentFile","compositionFile","docsFile","config","env","deprecatedMDXComponent","hidden"],"sources":["index.ts"],"sourcesContent":["import { ComponentTemplate, ComponentContext } from '@teambit/generator';\nimport { componentFile } from './files/component';\nimport { compositionFile } from './files/composition';\nimport { docsFile } from './files/docs';\n// TODO @ranm8 Tests won't work in MDX until we add a Jest Transformer for the MDX env.\n// import { testFile } from './files/test';\n\nexport const MDXComponent: ComponentTemplate = {\n name: 'mdx',\n description: 'MDX-file compiled by Bit to a reuseable component',\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.ts',\n content: `export { default as ${Name}, default } from './${name}.mdx';\n`,\n };\n\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context)];\n },\n config: {\n 'teambit.mdx/mdx': {},\n 'teambit.envs/envs': {\n env: 'teambit.mdx/mdx',\n },\n },\n};\n\nexport const deprecatedMDXComponent: ComponentTemplate = {\n name: 'mdx-component',\n description: 'MDX-file compiled by Bit to a reuseable component',\n hidden: true,\n\n generateFiles: (context: ComponentContext) => {\n const { name, namePascalCase: Name } = context;\n const indexFile = {\n relativePath: 'index.ts',\n content: `export { default as ${Name} } from './${name}.mdx';\n`,\n };\n\n return [indexFile, componentFile(context), compositionFile(context), docsFile(context)];\n },\n config: {\n 'teambit.mdx/mdx': {},\n 'teambit.envs/envs': {\n env: 'teambit.mdx/mdx',\n },\n },\n};\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AACA;;AAEO,MAAMA,YAA+B,GAAG;EAC7CC,IAAI,EAAE,KAAK;EACXC,WAAW,EAAE,mDAAmD;EAEhEC,aAAa,EAAGC,OAAyB,IAAK;IAC5C,MAAM;MAAEH,IAAI;MAAEI,cAAc,EAAEC;IAAK,CAAC,GAAGF,OAAO;IAC9C,MAAMG,SAAS,GAAG;MAChBC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAG,uBAAsBH,IAAK,uBAAsBL,IAAK;AACtE;IACI,CAAC;IAED,OAAO,CAACM,SAAS,EAAE,IAAAG,0BAAa,EAACN,OAAO,CAAC,EAAE,IAAAO,8BAAe,EAACP,OAAO,CAAC,EAAE,IAAAQ,gBAAQ,EAACR,OAAO,CAAC,CAAC;EACzF,CAAC;EACDS,MAAM,EAAE;IACN,iBAAiB,EAAE,CAAC,CAAC;IACrB,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAAC;AAEK,MAAMC,sBAAyC,GAAG;EACvDd,IAAI,EAAE,eAAe;EACrBC,WAAW,EAAE,mDAAmD;EAChEc,MAAM,EAAE,IAAI;EAEZb,aAAa,EAAGC,OAAyB,IAAK;IAC5C,MAAM;MAAEH,IAAI;MAAEI,cAAc,EAAEC;IAAK,CAAC,GAAGF,OAAO;IAC9C,MAAMG,SAAS,GAAG;MAChBC,YAAY,EAAE,UAAU;MACxBC,OAAO,EAAG,uBAAsBH,IAAK,cAAaL,IAAK;AAC7D;IACI,CAAC;IAED,OAAO,CAACM,SAAS,EAAE,IAAAG,0BAAa,EAACN,OAAO,CAAC,EAAE,IAAAO,8BAAe,EAACP,OAAO,CAAC,EAAE,IAAAQ,gBAAQ,EAACR,OAAO,CAAC,CAAC;EACzF,CAAC;EACDS,MAAM,EAAE;IACN,iBAAiB,EAAE,CAAC,CAAC;IACrB,mBAAmB,EAAE;MACnBC,GAAG,EAAE;IACP;EACF;AACF,CAAC;AAAC"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/mdx",
3
- "version": "0.0.1090",
3
+ "version": "0.0.1092",
4
4
  "homepage": "https://bit.cloud/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.1090"
9
+ "version": "0.0.1092"
10
10
  },
11
11
  "dependencies": {
12
12
  "@babel/core": "7.19.6",
@@ -17,23 +17,23 @@
17
17
  "@babel/runtime": "7.20.0",
18
18
  "@teambit/harmony": "0.4.6",
19
19
  "@teambit/design.ui.empty-box": "0.0.363",
20
- "@teambit/builder": "0.0.1110",
20
+ "@teambit/builder": "0.0.1112",
21
21
  "@teambit/compilation.modules.babel-compiler": "0.0.133",
22
- "@teambit/compiler": "0.0.1110",
22
+ "@teambit/compiler": "0.0.1112",
23
23
  "@teambit/mdx.modules.mdx-compiler": "0.0.500",
24
- "@teambit/dependency-resolver": "0.0.1110",
25
- "@teambit/docs": "0.0.1110",
26
- "@teambit/envs": "0.0.1110",
27
- "@teambit/babel": "0.0.1110",
28
- "@teambit/cli": "0.0.742",
29
- "@teambit/generator": "0.0.1110",
30
- "@teambit/multi-compiler": "0.0.1110",
31
- "@teambit/react": "0.0.1110",
24
+ "@teambit/dependency-resolver": "0.0.1112",
25
+ "@teambit/docs": "0.0.1112",
26
+ "@teambit/envs": "0.0.1112",
27
+ "@teambit/babel": "0.0.1112",
28
+ "@teambit/cli": "0.0.744",
29
+ "@teambit/generator": "0.0.1112",
30
+ "@teambit/multi-compiler": "0.0.1112",
31
+ "@teambit/react": "0.0.1112",
32
32
  "@teambit/typescript.modules.ts-config-mutator": "0.0.76",
33
- "@teambit/typescript": "0.0.1110",
34
- "@teambit/compositions": "0.0.1110",
35
- "@teambit/tester": "0.0.1110",
36
- "@teambit/ui": "0.0.1110"
33
+ "@teambit/typescript": "0.0.1112",
34
+ "@teambit/compositions": "0.0.1112",
35
+ "@teambit/tester": "0.0.1112",
36
+ "@teambit/ui": "0.0.1112"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/fs-extra": "9.0.7",