Socket
Socket
Sign inDemoInstall

@mdx-js/mdx

Package Overview
Dependencies
Maintainers
4
Versions
210
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdx-js/mdx - npm Package Compare versions

Comparing version 2.0.0-next.1 to 2.0.0-next.3

32

mdx-hast-to-jsx.js

@@ -9,2 +9,3 @@ const {transformSync} = require('@babel/core')

const BabelPluginExtractImportNames = require('babel-plugin-extract-import-names')
const BabelPluginExtractExportNames = require('babel-plugin-extract-export-names')

@@ -83,9 +84,2 @@ function toJSX(node, parentNode = {}, options = {}) {

const exportNames = groups.export
.map(node =>
node.value.match(/^export\s*(var|const|let|class|function)?\s*(\w+)/)
)
.map(match => (Array.isArray(match) ? match[2] : null))
.filter(Boolean)
const importStatements = groups.import

@@ -99,10 +93,2 @@ .map(childNode => toJSX(childNode, node))

let layoutProps = 'const layoutProps = {'
if (exportNames.length !== 0) {
layoutProps += '\n ' + exportNames.join(',\n ') + '\n'
}
layoutProps += '};'
const mdxLayout = `const MDXLayout = ${layout ? layout : '"wrapper"'}`

@@ -126,3 +112,5 @@

const babelPluginExtractImportNamesInstance = new BabelPluginExtractImportNames()
transformSync(importStatements, {
const babelPluginExtractExportNamesInstance = new BabelPluginExtractExportNames()
const importsAndExports = [importStatements, exportStatements].join('\n')
transformSync(importsAndExports, {
configFile: false,

@@ -133,6 +121,8 @@ babelrc: false,

require('@babel/plugin-syntax-object-rest-spread'),
babelPluginExtractImportNamesInstance.plugin
babelPluginExtractImportNamesInstance.plugin,
babelPluginExtractExportNamesInstance.plugin
]
})
const importNames = babelPluginExtractImportNamesInstance.state.names
const exportNames = babelPluginExtractExportNamesInstance.state.names

@@ -162,2 +152,10 @@ const babelPluginApplyMdxPropInstance = new BabelPluginApplyMdxProp()

let layoutProps = 'const layoutProps = {'
if (exportNames.length !== 0) {
layoutProps += '\n ' + exportNames.join(',\n ') + '\n'
}
layoutProps += '};'
const allJsxNames = [

@@ -164,0 +162,0 @@ ...babelPluginApplyMdxPropInstance.state.names,

{
"name": "@mdx-js/mdx",
"version": "2.0.0-next.1",
"version": "2.0.0-next.3",
"description": "Parse MDX and transpile to JSX",

@@ -42,24 +42,25 @@ "repository": "mdx-js/mdx",

"dependencies": {
"@babel/core": "7.9.6",
"@babel/plugin-syntax-jsx": "7.8.3",
"@babel/core": "7.10.5",
"@babel/plugin-syntax-jsx": "7.10.4",
"@babel/plugin-syntax-object-rest-spread": "7.8.3",
"@mdx-js/util": "^2.0.0-next.1",
"babel-plugin-apply-mdx-type-prop": "^2.0.0-next.1",
"babel-plugin-extract-import-names": "^2.0.0-next.1",
"@mdx-js/util": "^2.0.0-next.3",
"babel-plugin-apply-mdx-type-prop": "^2.0.0-next.3",
"babel-plugin-extract-export-names": "^2.0.0-next.3",
"babel-plugin-extract-import-names": "^2.0.0-next.3",
"camelcase-css": "2.0.1",
"detab": "2.0.3",
"hast-to-hyperscript": "8.1.0",
"hast-util-raw": "5.0.2",
"hast-to-hyperscript": "9.0.0",
"hast-util-raw": "6.0.0",
"lodash.uniq": "4.5.0",
"mdast-util-to-hast": "9.1.0",
"remark-footnotes": "1.0.0",
"remark-mdx": "^2.0.0-next.1",
"remark-mdxjs": "^2.0.0-next.1",
"remark-parse": "8.0.1",
"remark-mdx": "^2.0.0-next.3",
"remark-mdxjs": "^2.0.0-next.3",
"remark-parse": "8.0.2",
"remark-squeeze-paragraphs": "4.0.0",
"unified": "9.0.0",
"unist-builder": "2.0.3",
"unist-util-visit": "2.0.2"
"unist-util-visit": "2.0.3"
},
"gitHead": "166fd9d72a05bb6f09bcb1b1dadb150f4c72fbaa"
"gitHead": "d0059c8cf5147281c096e28be81d3914ad2e14e8"
}

@@ -55,4 +55,2 @@ # `@mdx-js/mdx`

<!-- Definitions -->
[build]: https://travis-ci.com/mdx-js/mdx

@@ -59,0 +57,0 @@ [build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc