Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

Commit

Permalink
Initial commit on fork, working install, now need to do bsb integrati…
Browse files Browse the repository at this point in the history
…on into start
  • Loading branch information
brentvatne committed Dec 3, 2017
0 parents commit 5809361
Show file tree
Hide file tree
Showing 29 changed files with 5,834 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sourceMaps": true,
"presets": ["es2015", "stage-1"],
"plugins": ["transform-runtime", "add-module-exports", "transform-flow-strip-types"]
}
13 changes: 13 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "exponent/react",
"plugins": [
"flowtype",
],
"globals": {
"document": false,
},
"rules": {
"flowtype/define-flow-type": 1,
"flowtype/use-flow-type": 1,
},
}
7 changes: 7 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ignore]

[include]

[libs]

[options]
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
build/
yarn-error.log
*.tgz
.DS_Store
*.log
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2017, Create React Native App Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# react-native-scripts

The README for this package is hosted at https://github.com/react-community/create-react-native-app.

## Development

`yarn && yarn start` will start a watcher that will build artifacts and place them in the build directory.

*Warning*: if you change the template project's dependencies, make sure to update `checkAppName` in `create-react-native-app/src/index.js`.
56 changes: 56 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "reason-react-native-scripts",
"version": "0.1.1",
"description": "Configuration and scripts for Create React Native App using ReasonML.",
"license": "BSD-3-Clause",
"keywords": [
"react-native",
"react"
],
"homepage": "https://github.com/react-community/reason-react-native-scripts",
"bugs": "https://github.com/react-community/reason-react-native-scripts",
"engines": {
"node": ">=6"
},
"files": [
"build",
"template"
],
"bin": {
"react-native-scripts": "./build/bin/react-native-scripts.js"
},
"scripts": {
"start": "taskr",
"build": "taskr build"
},
"dependencies": {
"@expo/bunyan": "1.8.10",
"babel-runtime": "^6.9.2",
"chalk": "^2.0.1",
"cross-spawn": "^5.0.1",
"fs-extra": "^3.0.1",
"indent-string": "^3.0.0",
"inquirer": "^3.0.1",
"lodash": "^4.17.4",
"match-require": "^2.0.0",
"minimist": "^1.2.0",
"path-exists": "^3.0.0",
"progress": "^2.0.0",
"qrcode-terminal": "^0.11.0",
"rimraf": "^2.6.1",
"xdl": "47.0.4"
},
"devDependencies": {
"@taskr/babel": "^1.0.6",
"@taskr/clear": "^1.0.6",
"@taskr/esnext": "^1.0.0",
"@taskr/shell": "^1.0.6",
"@taskr/watch": "^1.0.6",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-flow-strip-types": "^6.8.0",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-1": "^6.5.0",
"taskr": "^1.0.6"
}
}
23 changes: 23 additions & 0 deletions src/bin/crna-entry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Expo from 'expo';
import React, { Component } from 'react';
import { View } from 'react-native';

const { app } = require('../../../../lib/js/src/App');

// we don't want this to require transformation
class AwakeInDevApp extends Component {
render() {
return React.createElement(
View,
{
style: {
flex: 1,
},
},
React.createElement(app, this.props),
React.createElement(process.env.NODE_ENV === 'development' ? Expo.KeepAwake : View)
);
}
}

Expo.registerRootComponent(AwakeInDevApp);
22 changes: 22 additions & 0 deletions src/bin/react-native-scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env node
// @flow
import spawn from 'cross-spawn';

const script = process.argv[2];
const args = process.argv.slice(3);

const validCommands = ['eject', 'android', 'ios', 'start', 'test'];

if (validCommands.indexOf(script) !== -1) {
// the command is valid
const result = spawn.sync(
'node',
['--no-deprecation', require.resolve('../scripts/' + script)].concat(args),
{ stdio: 'inherit' }
);
process.exit(result.status);
} else {
console.log(
`Invalid command '${script}'. Please check if you need to update react-native-scripts.`
);
}
51 changes: 51 additions & 0 deletions src/scripts/android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// @flow

import { Android, Config, ProjectSettings, UrlUtils } from 'xdl';

import chalk from 'chalk';
import indent from 'indent-string';
import path from 'path';
import pathExists from 'path-exists';
import qr from 'qrcode-terminal';
import log from '../util/log';

import packager from '../util/packager';

Config.validation.reactNativeVersionWarnings = false;
Config.developerTool = 'crna';
Config.offline = true;

packager.run(startAndroidAndPrintInfo);

// print a nicely formatted message with setup information
async function startAndroidAndPrintInfo() {
const address = await UrlUtils.constructManifestUrlAsync(process.cwd());
log.withTimestamp('Starting Android...');

const { success, error } = await Android.openProjectAsync(process.cwd());

qr.generate(address, qrCode => {
log.withTimestamp(`${chalk.green('Packager started!')}`);
log(
`
To view your app with live reloading, point the Expo app to this QR code.
You'll find the QR scanner on the Projects tab of the app.
${indent(qrCode, 2)}
Or enter this address in the Expo app's search bar:
${chalk.underline(chalk.cyan(address))}
Your phone will need to be on the same local network as this computer.
For links to install the Expo app, please visit ${chalk.underline(chalk.cyan('https://expo.io'))}.
Logs from serving your app will appear here. Press Ctrl+C at any time to stop.
`
);
});

if (!success) {
log(chalk.red(error.message));
}
}
Loading

0 comments on commit 5809361

Please sign in to comment.