removed react-native-renderer package and made build make a react-native build dir instead

This commit is contained in:
Dominic Gannaway
2017-03-24 18:01:18 +00:00
parent b5bdf70036
commit 0fd8aa604f
4 changed files with 19 additions and 42 deletions
-5
View File
@@ -1,5 +0,0 @@
# `react-native-renderer`
This package is the renderer that is used by the react-native package.
It is intended to be used inside the react-native environment. It is not
intended to be used stand alone.
-3
View File
@@ -1,3 +0,0 @@
'use strict';
module.exports = require('./ReactNative');
@@ -1,30 +0,0 @@
{
"name": "react-native-renderer",
"version": "16.0.0-alpha.5",
"description": "React package for use inside react-native.",
"main": "index.js",
"repository": "facebook/react",
"keywords": [
"react",
"react-native"
],
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/facebook/react/issues"
},
"homepage": "https://facebook.github.io/react-native/",
"dependencies": {
"fbjs": "^0.8.9",
"object-assign": "^4.1.0"
},
"peerDependencies": {
"react": "^16.0.0-alpha.5"
},
"files": [
"LICENSE",
"PATENTS",
"README.md",
"index.js",
"lib/"
]
}
+19 -4
View File
@@ -111,9 +111,11 @@ function updateBundleConfig(config, filename, format, bundleType, hastName) {
let dest = config.destDir + filename;
if (bundleType === bundleTypes.FB) {
dest = `${config.destDir}/${facebookWWW}/${filename}`;
dest = `${config.destDir}${facebookWWW}/${filename}`;
} else if (bundleType === bundleTypes.UMD_DEV || bundleType === bundleTypes.UMD_PROD) {
dest = `${config.destDir}/dist/${filename}`;
dest = `${config.destDir}dist/${filename}`;
} else if (bundleType === bundleTypes.RN) {
dest = `${config.destDir}react-native/${filename}`;
}
return Object.assign({}, config, {
banner: getBanner(bundleType, hastName),
@@ -207,12 +209,24 @@ function asyncCopyTo(from, to) {
});
}
async function createReactNativeBuild() {
// create the react-native folder for FB bundles
mkdirSync(join('build', 'react-native'));
// create the react-native shims folder for FB shims
mkdirSync(join('build', 'react-native', 'shims'));
// copy in all the shims from build/rollup/shims/react-native
const from = join('scripts', 'rollup', 'shims', 'react-native');
const to = join('build', 'react-native', 'shims');
await asyncCopyTo(from, to);
}
async function createFacebookWWWBuild() {
// create the facebookWWW folder for FB bundles
mkdirSync(join('build', facebookWWW));
// create the facebookWWW shims folder for FB shims
mkdirSync(join('build', facebookWWW, 'shims'));
// copy in all the shims from build/rollup/shims/facebook-ww to the FB shims build
// copy in all the shims from build/rollup/shims/facebook-www
const from = join('scripts', 'rollup', 'shims', facebookWWW);
const to = join('build', facebookWWW, 'shims');
@@ -361,8 +375,9 @@ rimraf('build', async () => {
mkdirSync(join('build', 'packages'));
// create the dist folder for UMD bundles
mkdirSync(join('build', 'dist'));
// we make this sync so it doesn't cause IO issues
// we make these in sync so it doesn't cause IO issues
await createFacebookWWWBuild();
await createReactNativeBuild();
// rather than run concurently, opt to run them serially
// this helps improve console/warning/error output
// and fixes a bunch of IO failures that sometimes occured