Skip to content

Commit

Permalink
feat(babel-preset-commitlint): add jsx tranform (#163)
Browse files Browse the repository at this point in the history
JSX transform is needed to enable ink as CLI tool.
Plugin and plugin options are recommended by ink as part of the package
setup process.
<https://github.com/vadimdemedes/ink#getting-started>

first step toward #86
  • Loading branch information
ChristianMurphy authored and marionebl committed Nov 29, 2017
1 parent a6e1bab commit 5190241
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
17 changes: 11 additions & 6 deletions @packages/babel-preset-commitlint/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const addModuleExports = require('babel-plugin-add-module-exports');
const fastAsync = require('fast-async');
const jsx = require('babel-plugin-transform-react-jsx');
const istanbul = require('babel-plugin-istanbul').default;
const transformRuntime = require('babel-plugin-transform-runtime').default;
const env = require('babel-preset-env').default;
Expand All @@ -9,6 +10,7 @@ module.exports = preset;
function preset() {
const plugins = [
addModuleExports,
[jsx, {pragma: 'h'}],
[fastAsync, {spec: true}],
[transformRuntime, {polyfill: false, regenerator: false}]
];
Expand All @@ -21,11 +23,14 @@ function preset() {
},
plugins,
presets: [
[env, {
debug: process.env.DEBUG === 'true',
exclude: ['transform-regenerator', 'transform-async-to-generator'],
targets: {node: '4.8'}
}]
],
[
env,
{
debug: process.env.DEBUG === 'true',
exclude: ['transform-regenerator', 'transform-async-to-generator'],
targets: {node: '4.8'}
}
]
]
};
}
1 change: 1 addition & 0 deletions @packages/babel-preset-commitlint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"dependencies": {
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-istanbul": "^4.1.4",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.0",
"fast-async": "^6.3.0"
Expand Down
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,14 @@ babel-helper-builder-binary-assignment-operator-visitor@^6.24.1:
babel-runtime "^6.22.0"
babel-types "^6.24.1"

babel-helper-builder-react-jsx@^6.24.1:
version "6.26.0"
resolved "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz#39ff8313b75c8b65dceff1f31d383e0ff2a408a0"
dependencies:
babel-runtime "^6.26.0"
babel-types "^6.26.0"
esutils "^2.0.2"

babel-helper-call-delegate@^6.24.1:
version "6.24.1"
resolved "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d"
Expand Down Expand Up @@ -845,6 +853,10 @@ babel-plugin-syntax-exponentiation-operator@^6.8.0:
version "6.13.0"
resolved "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de"

babel-plugin-syntax-jsx@^6.8.0:
version "6.18.0"
resolved "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"

babel-plugin-syntax-trailing-function-commas@^6.20.0, babel-plugin-syntax-trailing-function-commas@^6.22.0:
version "6.22.0"
resolved "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"
Expand Down Expand Up @@ -1033,6 +1045,14 @@ babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-e
babel-plugin-syntax-exponentiation-operator "^6.8.0"
babel-runtime "^6.22.0"

babel-plugin-transform-react-jsx@^6.24.1:
version "6.24.1"
resolved "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3"
dependencies:
babel-helper-builder-react-jsx "^6.24.1"
babel-plugin-syntax-jsx "^6.8.0"
babel-runtime "^6.22.0"

babel-plugin-transform-regenerator@^6.22.0:
version "6.26.0"
resolved "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f"
Expand Down

0 comments on commit 5190241

Please sign in to comment.