Skip to content

Commit

Permalink
metro-babel-register: node 6 compat
Browse files Browse the repository at this point in the history
Summary:
Our prettier config inserts trailing commas into function calls. This file is supposed to run on vanilla node 6.

Here, we move files into the `src/` subdirectory, which gets transformed in the package publishing process.

Reviewed By: rafeca, mjesun

Differential Revision: D7788438

fbshipit-source-id: 6a70d113a82410a60a66bba4d7564f9376bb6d0b
  • Loading branch information
davidaurelio authored and facebook-github-bot committed Apr 27, 2018
1 parent b09a4e3 commit 768183d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/buck-worker-tool/__tests__/worker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jest
.useRealTimers();

const JSONStream = require('JSONStream');
const buckWorker = require('../worker-tool');
const buckWorker = require('../');
const path = require('path');
const mkdirp = require('mkdirp');

Expand Down
6 changes: 5 additions & 1 deletion packages/buck-worker-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.36.0",
"description": "Implementation of the Buck worker protocol for Node.js.",
"license": "MIT",
"main": "worker-tool.js",
"main": "src/worker-tool.js",
"dependencies": {
"JSONStream": "^1.3.1",
"async": "^2.4.0",
Expand All @@ -14,5 +14,9 @@
"devDependencies": {
"metro-memory-fs": "0.36.0",
"mkdirp": "^0.5.1"
},
"scripts": {
"prepare-release": "test -d build && rm -rf src.real && mv src src.real && mv build src",
"cleanup-release": "test ! -e build && mv src build && mv src.real src"
}
}
File renamed without changes.
6 changes: 5 additions & 1 deletion packages/metro-babel-register/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "0.36.0",
"name": "metro-babel-register",
"description": "🚇 babel/register configuration for Metro.",
"main": "babel-register.js",
"main": "src/babel-register.js",
"repository": {
"type": "git",
"url": "[email protected]:facebook/metro.git"
Expand All @@ -17,5 +17,9 @@
"@babel/register": "7.0.0-beta.40",
"core-js": "^2.2.2",
"escape-string-regexp": "^1.0.5"
},
"scripts": {
"prepare-release": "test -d build && rm -rf src.real && mv src src.real && mv build src",
"cleanup-release": "test ! -e build && mv src build && mv src.real src"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/

'use strict';
Expand Down
2 changes: 1 addition & 1 deletion packages/metro/src/babel-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function getBabelRegisterConfig7() {
*/
'use strict';

require('metro-babel-register/node-polyfills');
require('metro-babel-register/src/node-polyfills');

var _only = [];

Expand Down
2 changes: 1 addition & 1 deletion scripts/setupJest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
'use strict';

global.Promise = require('promise');
require('../packages/metro-babel-register/node-polyfills');
require('../packages/metro-babel-register/src/node-polyfills');

0 comments on commit 768183d

Please sign in to comment.