Skip to content

Commit

Permalink
Merge pull request #7823 from storybookjs/tech/stop-using-babel_register
Browse files Browse the repository at this point in the history
CLI: Remove babel-register in favor of esm
  • Loading branch information
shilman committed Aug 20, 2019
2 parents 87ad181 + 8fde590 commit bd2aa03
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
8 changes: 1 addition & 7 deletions lib/cli/bin/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#!/usr/bin/env node
const path = require('path');

require('@babel/register')({
// see https://github.com/babel/babel/issues/7701#issuecomment-389720069
cwd: path.resolve(__dirname, '..'),
only: [new RegExp(`(@storybook|lib)${path.sep === '\\' ? '\\\\' : path.sep}cli`)],
});
require('./generate');
require('esm')(module)('./generate.js');
2 changes: 1 addition & 1 deletion lib/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"dependencies": {
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"@babel/register": "^7.0.0",
"@storybook/codemod": "5.2.0-beta.37",
"chalk": "^2.4.1",
"commander": "^2.19.0",
"core-js": "^3.0.1",
"cross-spawn": "^6.0.5",
"esm": "3.2.25",
"didyoumean": "^1.2.1",
"envinfo": "^7.3.1",
"fs-extra": "^8.0.1",
Expand Down
4 changes: 2 additions & 2 deletions lib/cli/test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ do
if [ $dir == *"native"* ]
then
# run @storybook/cli
../../../bin/index.js init --skip-install --yes --install-server
yarn sb init --skip-install --yes --install-server
else
# run @storybook/cli
../../../bin/index.js init --skip-install --yes
yarn sb init --skip-install --yes
fi

cd ..
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11768,7 +11768,7 @@ eslint@^5.10.0, eslint@^5.14.1, eslint@^5.16.0:
table "^5.2.3"
text-table "^0.2.0"

esm@^3.2.25, esm@^3.2.4:
esm@3.2.25, esm@^3.2.25, esm@^3.2.4:
version "3.2.25"
resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.25.tgz#342c18c29d56157688ba5ce31f8431fbb795cc10"
integrity sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==
Expand Down

0 comments on commit bd2aa03

Please sign in to comment.