mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 12:55:21 +08:00
Add a proper development workflow
This commit is contained in:
@@ -2,6 +2,13 @@
|
||||
|
||||
[](https://badge.fury.io/js/%40react-navigation%2Fcore) [](https://circleci.com/gh/react-navigation/react-navigation-core/tree/master) [](https://reactnavigation.org/docs/contributing.html)
|
||||
|
||||
## Development workflow
|
||||
|
||||
- Clone this repository
|
||||
- Run `yarn` in the root directory and in the `example` directory
|
||||
- Run `yarn dev` in the root directory
|
||||
- Run `yarn start` in the `example` directory
|
||||
|
||||
## Docs
|
||||
|
||||
Documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/en/getting-started.html).
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
"expo"
|
||||
],
|
||||
"plugins": [
|
||||
["module-resolver", {
|
||||
"alias": {
|
||||
"@react-navigation/core": "../src"
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import Expo from 'expo';
|
||||
import { Asset, registerRootComponent } from 'expo';
|
||||
import { FlatList, I18nManager } from 'react-native';
|
||||
import { createAppContainer } from '@react-navigation/native';
|
||||
|
||||
@@ -28,7 +28,7 @@ const data = [
|
||||
];
|
||||
|
||||
// Cache images
|
||||
Expo.Asset.loadAsync(StackAssets);
|
||||
Asset.loadAsync(StackAssets);
|
||||
|
||||
class Home extends React.Component {
|
||||
static navigationOptions = {
|
||||
@@ -82,4 +82,4 @@ const Root = createStackNavigator(
|
||||
|
||||
const App = createAppContainer(Root);
|
||||
export default App;
|
||||
Expo.registerRootComponent(App);
|
||||
registerRootComponent(App);
|
||||
|
||||
@@ -3,15 +3,8 @@
|
||||
"name": "React Navigation Core Example",
|
||||
"description": "Useful for experimenting with core and native together",
|
||||
"slug": "react-navigation-core-demo",
|
||||
"sdkVersion": "30.0.0",
|
||||
"sdkVersion": "32.0.0",
|
||||
"version": "1.0.0",
|
||||
"primaryColor": "#2196f3",
|
||||
"packagerOpts": {
|
||||
"assetExts": [
|
||||
"ttf"
|
||||
],
|
||||
"config": "./rn-cli.config.js",
|
||||
"projectRoots": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
packages/core/example/babel.config.js
Normal file
6
packages/core/example/babel.config.js
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = function(api) {
|
||||
api.cache(true);
|
||||
return {
|
||||
presets: ['babel-preset-expo'],
|
||||
};
|
||||
};
|
||||
@@ -2,33 +2,34 @@
|
||||
"name": "coreexample",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"main": "App.js",
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"android": "expo start --android",
|
||||
"ios": "expo start --ios",
|
||||
"postinstall": "rm -rf node_modules/expo-react-native-adapter/node_modules/react && rm -rf node_modules/expo-gl/node_modules/react"
|
||||
"postinstall": "rm -rf node_modules/@react-navigation/core/{.git,node_modules,example}"
|
||||
},
|
||||
"dependencies": {
|
||||
"expo": "~30.0.0",
|
||||
"@react-navigation/core": "../",
|
||||
"@react-navigation/native": "^3.1.4",
|
||||
"expo": "~32.0.0",
|
||||
"hoist-non-react-statics": "^2.5.0",
|
||||
"prop-types": "^15.6.0",
|
||||
"query-string": "^6.2.0",
|
||||
"react": "16.3.1",
|
||||
"react": "16.5.0",
|
||||
"react-is": "^16.5.2",
|
||||
"react-native": "~0.55.4",
|
||||
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
|
||||
"react-native-paper": "^2.2.8",
|
||||
"react-navigation": "^3.0.0"
|
||||
"react-navigation-stack": "^1.0.7",
|
||||
"react-navigation-tabs": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-module-resolver": "^3.0.0",
|
||||
"babel-preset-expo": "^4.0.0",
|
||||
"glob-to-regexp": "^0.3.0"
|
||||
},
|
||||
"main": "App.js",
|
||||
"resolutions": {
|
||||
"**/react": "16.3.1",
|
||||
"**/prop-types": "15.6.0",
|
||||
"**/react-lifecycles-compat": "3.0.4",
|
||||
"**/hoist-non-react-statics": "2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-preset-expo": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/* eslint-disable import/no-commonjs */
|
||||
|
||||
const path = require('path');
|
||||
const glob = require('glob-to-regexp');
|
||||
const blacklist = require('metro/src/blacklist');
|
||||
const pak = require('../package.json');
|
||||
const pak2 = require('./package.json');
|
||||
|
||||
const dependencies = Object.keys(pak.dependencies || {});
|
||||
const localDependencies = Object.keys(pak2.dependencies);
|
||||
const peerDependencies = Object.keys(pak.peerDependencies);
|
||||
|
||||
module.exports = {
|
||||
getProjectRoots() {
|
||||
return [__dirname, path.resolve(__dirname, '..')];
|
||||
},
|
||||
getProvidesModuleNodeModules() {
|
||||
return [...dependencies, ...localDependencies, ...peerDependencies];
|
||||
},
|
||||
getBlacklistRE() {
|
||||
return blacklist([glob(`${path.resolve(__dirname, '..')}/node_modules/*`)]);
|
||||
},
|
||||
getSourceExts() {
|
||||
return ['ts', 'tsx'];
|
||||
},
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,8 @@
|
||||
"format": "eslint . --fix",
|
||||
"babel": "babel --no-babelrc --plugins=transform-es2015-block-scoping,transform-es2015-modules-commonjs,transform-react-jsx,transform-class-properties,transform-object-rest-spread,transform-flow-strip-types src --copy-files --out-dir dist --ignore '**/__tests__/**','*.ts'",
|
||||
"tsc": "tsc",
|
||||
"build": "yarn babel && yarn tsc",
|
||||
"build": "yarn babel --out-dir dist && yarn tsc",
|
||||
"dev": "yarn babel --watch src --out-dir example/node_modules/@react-navigation/core/dist",
|
||||
"prepare": "yarn build",
|
||||
"release": "release-it"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* eslint-disable import/no-commonjs */
|
||||
|
||||
console.log('lol');
|
||||
|
||||
module.exports = {
|
||||
get StateUtils() {
|
||||
return require('./StateUtils').default;
|
||||
|
||||
Reference in New Issue
Block a user