Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use babel standalone package #723

Merged
merged 2 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/mdx/mdx-hast-to-jsx.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {transformSync} = require('@babel/core')
const {transform} = require('@babel/standalone')
const styleToObject = require('style-to-object')
const camelCaseCSS = require('camelcase-css')
const uniq = require('lodash.uniq')
Expand Down Expand Up @@ -102,7 +102,7 @@ MDXContent.isMDXComponent = true`

// Check JSX nodes against imports
const babelPluginExptractImportNamesInstance = new BabelPluginExtractImportNames()
transformSync(importStatements, {
transform(importStatements, {
configFile: false,
babelrc: false,
plugins: [
Expand All @@ -116,7 +116,7 @@ MDXContent.isMDXComponent = true`
const babelPluginApplyMdxPropInstance = new BabelPluginApplyMdxProp()
const babelPluginApplyMdxPropToExportsInstance = new BabelPluginApplyMdxProp()

const fnPostMdxTypeProp = transformSync(fn, {
const fnPostMdxTypeProp = transform(fn, {
configFile: false,
babelrc: false,
plugins: [
Expand All @@ -126,7 +126,7 @@ MDXContent.isMDXComponent = true`
]
}).code

const exportStatementsPostMdxTypeProps = transformSync(exportStatements, {
const exportStatementsPostMdxTypeProps = transform(exportStatements, {
configFile: false,
babelrc: false,
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion packages/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"mdx-hast-to-jsx.js"
],
"dependencies": {
"@babel/core": "7.6.0",
"@babel/plugin-syntax-jsx": "7.2.0",
"@babel/plugin-syntax-object-rest-spread": "7.2.0",
"@babel/standalone": "7.6.0",
"@mdx-js/util": "^1.4.5",
"babel-plugin-apply-mdx-type-prop": "^1.4.5",
"babel-plugin-extract-import-names": "^1.4.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/remark-mdx/extract-imports-and-exports.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {transformSync} = require('@babel/core')
const {transform} = require('@babel/standalone')
const declare = require('@babel/helper-plugin-utils').declare

const syntaxJsxPlugin = require('@babel/plugin-syntax-jsx')
Expand Down Expand Up @@ -48,7 +48,7 @@ const partitionString = (str, indices) =>
module.exports = (value, vfile) => {
const instance = new BabelPluginExtractImportsAndExports()

transformSync(value, {
transform(value, {
plugins: [syntaxJsxPlugin, proposalObjectRestSpreadPlugin, instance.plugin],
filename: vfile.path,
configFile: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/remark-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"extract-imports-and-exports.js"
],
"dependencies": {
"@babel/core": "7.6.0",
"@babel/helper-plugin-utils": "7.0.0",
"@babel/plugin-proposal-object-rest-spread": "7.5.5",
"@babel/plugin-syntax-jsx": "7.2.0",
"@babel/standalone": "^7.5.5",
"@mdx-js/util": "^1.4.5",
"is-alphabetical": "1.0.3",
"remark-parse": "7.0.1",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,11 @@
dependencies:
regenerator-runtime "^0.12.0"

"@babel/standalone@^7.5.5":
version "7.5.5"
resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.5.5.tgz#9d3143f6078ff408db694a4254bd6f03c5c33962"
integrity sha512-YIp5taErC4uvp4d5urJtWMui3cpvZt83x57l4oVJNvFtDzumf3pMgRmoTSpGuEzh1yzo7jHhg3mbQmMhmKPbjA==

"@babel/template@^7.0.0 <7.4.0":
version "7.2.2"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907"
Expand Down