@teambit/mdx 1.0.52 → 1.0.54
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/artifacts/env-template/public/{811.76fe077a470a33c57e9f.js → 123.0379725f0d49592c683b.js} +7 -6
- package/artifacts/env-template/public/{29.533f916771d2af665d08.js → 29.a29fb10662330fb31244.js} +6 -6
- package/artifacts/env-template/public/assets-manifest.json +14 -14
- package/artifacts/env-template/public/{compositions.f8efd63cedd000a86f63.js → compositions.069b6d5a8fa7905b31bf.js} +1 -1
- package/artifacts/env-template/public/compositions.html +1 -1
- package/artifacts/env-template/public/{overview.f026dba35145ce6953d3.js → overview.afb2fe7ef1838b688eff.js} +1 -1
- package/artifacts/env-template/public/overview.html +1 -1
- package/artifacts/env-template/public/{peers.aee4d5f6eac7a7a5fc54.js → peers.a2fff61246ceced892e4.js} +1 -1
- package/artifacts/env-template/public/{preview-root.178f0a215f9d026322f4.js → preview-root.8150279c959134150680.js} +1 -1
- package/artifacts/env-template/public/static/css/{29.d8f1bc2b.css → 29.854a98c7.css} +1 -1
- package/dist/mdx.compiler.js +4 -4
- package/dist/mdx.compiler.js.map +1 -1
- package/dist/mdx.detector.js +4 -4
- package/dist/mdx.detector.js.map +1 -1
- package/dist/mdx.doc-reader.js +4 -4
- package/dist/mdx.doc-reader.js.map +1 -1
- package/dist/{preview-1699870861945.js → preview-1700018329169.js} +2 -2
- package/package.json +20 -20
- /package/{compositions-1699870861945.js → compositions-1700018329169.js} +0 -0
- /package/{overview-1699870861945.js → overview-1700018329169.js} +0 -0
package/dist/mdx.compiler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_path","data","require","_fsExtra","_mdxModules","_minimatch","_interopRequireDefault","_compilationModules","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","MDXCompiler","constructor","id","config","displayConfig","JSON","stringify","getDistDir","distDir","transpileFile","fileContent","options","afterMdxCompile","mdxCompileSync","filepath","filePath","bitFlavour","filePathAfterMdxCompile","replaceFileExtToJs","afterBabelCompile","babelTranspileFileContent","contents","rootDir","componentDir","babelTransformOptions","build","context","capsules","capsuleNetwork","seedersCapsules","componentsResults","map","capsule","srcFiles","component","filesystem","files","filter","file","isFileSupported","relative","errors","srcFile","transpiled","toString","path","outputFileSync","join","getDistPathBySrcPath","outputPath","outputText","length","err","artifacts","name","globPatterns","srcPath","fileWithNewExt","replace","ignoredExtensions","ignoredExt","find","ext","endsWith","ignoredPatterns","ignoredPattern","pattern","minimatch","version","exports"],"sources":["mdx.compiler.ts"],"sourcesContent":["import { join } from 'path';\nimport { outputFileSync } from 'fs-extra';\nimport { Compiler, TranspileFileOutput, TranspileFileParams } from '@teambit/compiler';\nimport { BuiltTaskResult, BuildContext } from '@teambit/builder';\nimport { compileSync as mdxCompileSync } from '@teambit/mdx.modules.mdx-compiler';\nimport minimatch from 'minimatch';\nimport { transpileFileContent as babelTranspileFileContent } from '@teambit/compilation.modules.babel-compiler';\nimport type { TransformOptions } from '@babel/core';\n\nexport type MDXCompilerOpts = {\n ignoredExtensions?: string[];\n ignoredPatterns?: string[];\n babelTransformOptions?: TransformOptions;\n};\nexport class MDXCompiler implements Compiler {\n displayName = 'MDX';\n\n shouldCopyNonSupportedFiles = true;\n\n distDir = 'dist';\n\n constructor(readonly id: string, readonly config: MDXCompilerOpts) {}\n\n displayConfig() {\n return JSON.stringify(this.config, null, 2);\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n const afterMdxCompile = mdxCompileSync(fileContent, {\n filepath: options.filePath,\n // this compiler is not indented to compile according to the bit flavour.\n bitFlavour: false,\n });\n const filePathAfterMdxCompile = this.replaceFileExtToJs(options.filePath);\n const afterBabelCompile = babelTranspileFileContent(\n afterMdxCompile.contents,\n {\n rootDir: options.componentDir,\n filePath: filePathAfterMdxCompile,\n },\n this.config.babelTransformOptions || {}\n );\n\n return afterBabelCompile;\n }\n\n /**\n * compile components inside isolated capsules. this being used during tag for the release.\n * meaning, the final package of the component has the dists generated by this method.\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const componentsResults = capsules.map((capsule) => {\n const srcFiles = capsule.component.filesystem.files.filter((file) => {\n return this.isFileSupported(file.relative);\n });\n\n const errors = srcFiles.map((srcFile) => {\n try {\n const transpiled = this.transpileFile(srcFile.contents.toString('utf-8'), {\n filePath: this.replaceFileExtToJs(srcFile.relative),\n componentDir: capsule.path,\n });\n\n if (!transpiled) {\n return undefined;\n }\n\n outputFileSync(\n join(capsule.path, this.getDistPathBySrcPath(transpiled[0].outputPath)),\n transpiled[0].outputText\n );\n if (transpiled.length > 1) {\n outputFileSync(join(capsule.path, this.distDir, transpiled[1].outputPath), transpiled[1].outputText);\n }\n return undefined;\n } catch (err: any) {\n return err;\n }\n });\n\n return {\n errors: errors.filter((err) => !!err),\n component: capsule.component,\n };\n });\n\n return {\n componentsResults,\n artifacts: [\n {\n name: 'dist',\n globPatterns: [`${this.distDir}/**`],\n },\n ],\n };\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string {\n const fileWithNewExt = this.replaceFileExtToJs(srcPath);\n return join(this.distDir, fileWithNewExt);\n }\n\n private replaceFileExtToJs(srcPath: string): string {\n let fileWithNewExt = srcPath;\n if (this.isFileSupported(srcPath)) {\n fileWithNewExt = srcPath.replace('.mdx', '.mdx.js');\n }\n return fileWithNewExt;\n }\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean {\n const ignoredExtensions = this.config.ignoredExtensions ?? [];\n const ignoredExt = ignoredExtensions.find((ext) => filePath.endsWith(ext));\n const ignoredPatterns = this.config.ignoredPatterns ?? [];\n const ignoredPattern = ignoredPatterns.find((pattern) => minimatch(filePath, pattern));\n return !ignoredExt && !ignoredPattern && (filePath.endsWith('.mdx') || filePath.endsWith('.md'));\n }\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string {\n return '';\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,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,oBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,mBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgH,SAAAK,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,o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,MAAME,eAAe,GAAG,IAAI,CAAC7D,MAAM,CAAC6D,eAAe,IAAI,EAAE;IACzD,MAAMC,cAAc,GAAGD,eAAe,CAACH,IAAI,CAAEK,OAAO,IAAK,IAAAC,oBAAS,EAACpD,QAAQ,EAAEmD,OAAO,CAAC,CAAC;IACtF,OAAO,CAACN,UAAU,IAAI,CAACK,cAAc,KAAKlD,QAAQ,CAACgD,QAAQ,CAAC,MAAM,CAAC,IAAIhD,QAAQ,CAACgD,QAAQ,CAAC,KAAK,CAAC,CAAC;EAClG;;EAEA;AACF;AACA;EACEK,OAAOA,CAAA,EAAW;IAChB,OAAO,EAAE;EACX;AACF;AAACC,OAAA,CAAArE,WAAA,GAAAA,WAAA"}
|
|
1
|
+
{"version":3,"names":["_path","data","require","_fsExtra","_mdxCompilers","_minimatch","_interopRequireDefault","_compilationModules","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","MDXCompiler","constructor","id","config","displayConfig","JSON","stringify","getDistDir","distDir","transpileFile","fileContent","options","afterMdxCompile","mdxCompileSync","filepath","filePath","bitFlavour","filePathAfterMdxCompile","replaceFileExtToJs","afterBabelCompile","babelTranspileFileContent","contents","rootDir","componentDir","babelTransformOptions","build","context","capsules","capsuleNetwork","seedersCapsules","componentsResults","map","capsule","srcFiles","component","filesystem","files","filter","file","isFileSupported","relative","errors","srcFile","transpiled","toString","path","outputFileSync","join","getDistPathBySrcPath","outputPath","outputText","length","err","artifacts","name","globPatterns","srcPath","fileWithNewExt","replace","ignoredExtensions","ignoredExt","find","ext","endsWith","ignoredPatterns","ignoredPattern","pattern","minimatch","version","exports"],"sources":["mdx.compiler.ts"],"sourcesContent":["import { join } from 'path';\nimport { outputFileSync } from 'fs-extra';\nimport { Compiler, TranspileFileOutput, TranspileFileParams } from '@teambit/compiler';\nimport { BuiltTaskResult, BuildContext } from '@teambit/builder';\nimport { compileSync as mdxCompileSync } from '@teambit/mdx.compilers.mdx-transpiler';\nimport minimatch from 'minimatch';\nimport { transpileFileContent as babelTranspileFileContent } from '@teambit/compilation.modules.babel-compiler';\nimport type { TransformOptions } from '@babel/core';\n\nexport type MDXCompilerOpts = {\n ignoredExtensions?: string[];\n ignoredPatterns?: string[];\n babelTransformOptions?: TransformOptions;\n};\nexport class MDXCompiler implements Compiler {\n displayName = 'MDX';\n\n shouldCopyNonSupportedFiles = true;\n\n distDir = 'dist';\n\n constructor(readonly id: string, readonly config: MDXCompilerOpts) {}\n\n displayConfig() {\n return JSON.stringify(this.config, null, 2);\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n const afterMdxCompile = mdxCompileSync(fileContent, {\n filepath: options.filePath,\n // this compiler is not indented to compile according to the bit flavour.\n bitFlavour: false,\n });\n const filePathAfterMdxCompile = this.replaceFileExtToJs(options.filePath);\n const afterBabelCompile = babelTranspileFileContent(\n afterMdxCompile.contents,\n {\n rootDir: options.componentDir,\n filePath: filePathAfterMdxCompile,\n },\n this.config.babelTransformOptions || {}\n );\n\n return afterBabelCompile;\n }\n\n /**\n * compile components inside isolated capsules. this being used during tag for the release.\n * meaning, the final package of the component has the dists generated by this method.\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const componentsResults = capsules.map((capsule) => {\n const srcFiles = capsule.component.filesystem.files.filter((file) => {\n return this.isFileSupported(file.relative);\n });\n\n const errors = srcFiles.map((srcFile) => {\n try {\n const transpiled = this.transpileFile(srcFile.contents.toString('utf-8'), {\n filePath: this.replaceFileExtToJs(srcFile.relative),\n componentDir: capsule.path,\n });\n\n if (!transpiled) {\n return undefined;\n }\n\n outputFileSync(\n join(capsule.path, this.getDistPathBySrcPath(transpiled[0].outputPath)),\n transpiled[0].outputText\n );\n if (transpiled.length > 1) {\n outputFileSync(join(capsule.path, this.distDir, transpiled[1].outputPath), transpiled[1].outputText);\n }\n return undefined;\n } catch (err: any) {\n return err;\n }\n });\n\n return {\n errors: errors.filter((err) => !!err),\n component: capsule.component,\n };\n });\n\n return {\n componentsResults,\n artifacts: [\n {\n name: 'dist',\n globPatterns: [`${this.distDir}/**`],\n },\n ],\n };\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string {\n const fileWithNewExt = this.replaceFileExtToJs(srcPath);\n return join(this.distDir, fileWithNewExt);\n }\n\n private replaceFileExtToJs(srcPath: string): string {\n let fileWithNewExt = srcPath;\n if (this.isFileSupported(srcPath)) {\n fileWithNewExt = srcPath.replace('.mdx', '.mdx.js');\n }\n return fileWithNewExt;\n }\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean {\n const ignoredExtensions = this.config.ignoredExtensions ?? [];\n const ignoredExt = ignoredExtensions.find((ext) => filePath.endsWith(ext));\n const ignoredPatterns = this.config.ignoredPatterns ?? [];\n const ignoredPattern = ignoredPatterns.find((pattern) => minimatch(filePath, pattern));\n return !ignoredExt && !ignoredPattern && (filePath.endsWith('.mdx') || filePath.endsWith('.md'));\n }\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string {\n return '';\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,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAA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ector = void 0;
|
|
7
|
-
function
|
|
8
|
-
const data = require("@teambit/mdx.
|
|
9
|
-
|
|
7
|
+
function _mdxCompilers() {
|
|
8
|
+
const data = require("@teambit/mdx.compilers.mdx-transpiler");
|
|
9
|
+
_mdxCompilers = function () {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
@@ -19,7 +19,7 @@ class MDXDependencyDetector {
|
|
|
19
19
|
return this.supportedExtensions.includes(context.ext);
|
|
20
20
|
}
|
|
21
21
|
detect(source) {
|
|
22
|
-
const output = (0,
|
|
22
|
+
const output = (0, _mdxCompilers().compileSync)(source);
|
|
23
23
|
const imports = output.getImportSpecifiers();
|
|
24
24
|
if (!imports) return [];
|
|
25
25
|
const files = imports.map(importSpec => {
|
package/dist/mdx.detector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_mdxCompilers","data","require","MDXDependencyDetector","constructor","supportedExtensions","isSupported","context","includes","ext","detect","source","output","compileSync","imports","getImportSpecifiers","files","map","importSpec","fromModule","exports"],"sources":["mdx.detector.ts"],"sourcesContent":["import { DependencyDetector, FileContext } from '@teambit/dependency-resolver';\nimport { compileSync } from '@teambit/mdx.compilers.mdx-transpiler';\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"],"mappings":";;;;;;AACA,SAAAA,cAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,aAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,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;IAC/B,MAAMC,MAAM,GAAG,IAAAC,2BAAW,EAACF,MAAM,CAAC;IAClC,MAAMG,OAAO,GAAGF,MAAM,CAACG,mBAAmB,CAAC,CAAC;IAC5C,IAAI,CAACD,OAAO,EAAE,OAAO,EAAE;IACvB,MAAME,KAAe,GAAGF,OAAO,CAACG,GAAG,CAAEC,UAAU,IAAK;MAClD,OAAOA,UAAU,CAACC,UAAU;IAC9B,CAAC,CAAC;IAEF,OAAOH,KAAK;EACd;AACF;AAACI,OAAA,CAAAjB,qBAAA,GAAAA,qBAAA"}
|
package/dist/mdx.doc-reader.js
CHANGED
|
@@ -11,9 +11,9 @@ function _docs() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data = require("@teambit/mdx.
|
|
16
|
-
|
|
14
|
+
function _mdxCompilers() {
|
|
15
|
+
const data = require("@teambit/mdx.compilers.mdx-transpiler");
|
|
16
|
+
_mdxCompilers = function () {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
@@ -23,7 +23,7 @@ class MDXDocReader {
|
|
|
23
23
|
this.extensions = extensions;
|
|
24
24
|
}
|
|
25
25
|
async read(path, contents) {
|
|
26
|
-
const output = await (0,
|
|
26
|
+
const output = await (0, _mdxCompilers().compile)(contents.toString('utf-8'), {
|
|
27
27
|
filepath: path
|
|
28
28
|
});
|
|
29
29
|
const metadata = output.getMetadata();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_docs","data","require","
|
|
1
|
+
{"version":3,"names":["_docs","data","require","_mdxCompilers","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.compilers.mdx-transpiler';\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,cAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,aAAA,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,uBAAO,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,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.mdx_mdx@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.mdx_mdx@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.mdx_mdx@1.0.54/dist/mdx.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.mdx_mdx@1.0.54/dist/mdx.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/mdx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
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": "1.0.
|
|
9
|
+
"version": "1.0.54"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@babel/core": "7.19.6",
|
|
@@ -22,28 +22,28 @@
|
|
|
22
22
|
"react": "^16.8.0 || ^17.0.0",
|
|
23
23
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
24
24
|
"@teambit/harmony": "0.4.6",
|
|
25
|
-
"@teambit/
|
|
25
|
+
"@teambit/mdx.compilers.mdx-transpiler": "1.0.6",
|
|
26
|
+
"@teambit/component-id": "1.2.0",
|
|
26
27
|
"@teambit/mdx.generator.mdx-templates": "1.0.9",
|
|
27
28
|
"@teambit/design.ui.empty-box": "0.0.363",
|
|
28
|
-
"@teambit/builder": "1.0.
|
|
29
|
+
"@teambit/builder": "1.0.54",
|
|
29
30
|
"@teambit/compilation.modules.babel-compiler": "0.0.137",
|
|
30
|
-
"@teambit/compiler": "1.0.
|
|
31
|
-
"@teambit/
|
|
32
|
-
"@teambit/
|
|
33
|
-
"@teambit/
|
|
34
|
-
"@teambit/
|
|
35
|
-
"@teambit/
|
|
36
|
-
"@teambit/
|
|
37
|
-
"@teambit/
|
|
38
|
-
"@teambit/
|
|
39
|
-
"@teambit/
|
|
40
|
-
"@teambit/react": "1.0.52",
|
|
31
|
+
"@teambit/compiler": "1.0.54",
|
|
32
|
+
"@teambit/dependency-resolver": "1.0.54",
|
|
33
|
+
"@teambit/docs": "1.0.54",
|
|
34
|
+
"@teambit/envs": "1.0.54",
|
|
35
|
+
"@teambit/babel": "1.0.54",
|
|
36
|
+
"@teambit/cli": "0.0.814",
|
|
37
|
+
"@teambit/generator": "1.0.55",
|
|
38
|
+
"@teambit/logger": "0.0.907",
|
|
39
|
+
"@teambit/multi-compiler": "1.0.54",
|
|
40
|
+
"@teambit/react": "1.0.54",
|
|
41
41
|
"@teambit/typescript.modules.ts-config-mutator": "0.0.80",
|
|
42
|
-
"@teambit/typescript": "1.0.
|
|
43
|
-
"@teambit/worker": "0.0.
|
|
44
|
-
"@teambit/compositions": "1.0.
|
|
45
|
-
"@teambit/tester": "1.0.
|
|
46
|
-
"@teambit/ui": "1.0.
|
|
42
|
+
"@teambit/typescript": "1.0.54",
|
|
43
|
+
"@teambit/worker": "0.0.1118",
|
|
44
|
+
"@teambit/compositions": "1.0.54",
|
|
45
|
+
"@teambit/tester": "1.0.54",
|
|
46
|
+
"@teambit/ui": "1.0.54"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/fs-extra": "9.0.7",
|
|
File without changes
|
|
File without changes
|