metro-babel-register: node 6 compat

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
This commit is contained in:
David Aurelio 2018-04-27 06:59:08 -07:00 committed by Facebook Github Bot
parent b09a4e376d
commit 768183db2b
9 changed files with 13 additions and 6 deletions

View File

@ -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');

View File

@ -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",
@ -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"
}
}

View File

@ -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": "git@github.com:facebook/metro.git"
@ -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"
}
}

View File

@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';

View File

@ -176,7 +176,7 @@ function getBabelRegisterConfig7() {
*/
'use strict';
require('metro-babel-register/node-polyfills');
require('metro-babel-register/src/node-polyfills');
var _only = [];

View File

@ -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');