react-navigation/package.json

116 lines
4.0 KiB
JSON
Raw Normal View History

{
"name": "react-navigation",
2018-01-16 11:12:52 -08:00
"version": "1.0.0-beta.27",
"description": "React Navigation",
"main": "src/react-navigation.js",
"sources": {
"react-native-v1": "lib-rn/react-navigation.js",
"web": "lib/react-navigation.web.js"
},
2017-02-09 02:30:58 +05:30
"module": "lib/react-navigation.web.js",
"webpack": "lib/react-navigation.web.js",
"repository": {
"url": "git@github.com:react-navigation/react-navigation.git",
"type": "git"
},
"author": "Adam Miskiewicz <adam@sk3vy.com>",
"license": "BSD-2-Clause",
"scripts": {
"clean": "rm -rf lib/ lib-rn/",
"build": "npm run build-docs && npm run build-web && npm run build-rn && npm run build-dot-flow",
"watch-rn": "mkdir -p lib-rn/views/ && cp -R src/views/assets lib/views/assets && BABEL_ENV=publish-rn babel -w src -d lib-rn",
"watch-web": "mkdir -p lib/views/ && cp -R src/views/assets lib/views/assets && BABEL_ENV=publish-web babel -w src -d lib",
"build-rn": "mkdir -p lib-rn/views/ && cp -R src/views/assets lib-rn/views/assets && BABEL_ENV=publish-rn babel src -d lib-rn --ignore __tests__",
"build-web": "mkdir -p lib/views/ && cp -R src/views/assets lib/views/assets && BABEL_ENV=publish-web babel src -d lib --ignore __tests__",
"build-dot-flow": "find ./src -name '*.js' -not -path '*/__tests__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\/src\\//\\/lib\\//g'`.flow && cp $filepath `echo $filepath | sed 's/\\/src\\//\\/lib-rn\\//g'`.flow; done",
"build-docs": "node scripts/compile-docs",
"start": "npm run run-playground-ios",
"run-playground-ios": "cd examples/NavigationPlayground && npm run ios",
"run-playground-android": "cd examples/NavigationPlayground && npm run android",
"run-redux-android": "cd examples/ReduxExample && react-native run-android",
"run-redux-ios": "cd examples/ReduxExample && react-native run-ios",
"test": "npm run lint && npm run flow-check && npm run jest",
2017-05-14 14:33:39 -07:00
"codecov": "codecov",
"jest": "jest",
"lint": "eslint .",
"format": "eslint --fix .",
"flow": "flow",
"flow-check": "flow check --show-all-errors",
"precommit": "lint-staged",
"prepublish": "npm run clean && npm run build"
},
"files": [
"lib",
"lib-rn",
"src"
],
"peerDependencies": {
"react": "*",
"react-native": "*"
},
"dependencies": {
"babel-plugin-transform-define": "^1.3.0",
"clamp": "^1.0.1",
2017-07-19 13:03:46 -07:00
"hoist-non-react-statics": "^2.2.0",
"path-to-regexp": "^1.7.0",
"prop-types": "^15.5.10",
2017-07-03 21:36:47 -07:00
"react-native-drawer-layout-polyfill": "^1.3.2",
2018-01-04 19:45:35 +05:30
"react-native-tab-view": "^0.0.74"
},
"devDependencies": {
"babel-cli": "^6.24.1",
2017-07-03 21:36:47 -07:00
"babel-core": "^6.25.0",
"babel-eslint": "^7.2.3",
2017-07-03 21:36:47 -07:00
"babel-jest": "^20.0.3",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
2017-07-19 13:03:46 -07:00
"babel-preset-react-native": "^2.1.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"babel-preset-react-native-syntax": "^1.0.0",
"babel-preset-stage-1": "^6.24.1",
2017-05-14 14:33:39 -07:00
"codecov": "^2.2.0",
2017-07-19 13:03:46 -07:00
"eslint": "^4.2.0",
2017-07-03 21:36:47 -07:00
"eslint-config-prettier": "^2.3.0",
2017-07-19 13:03:46 -07:00
"eslint-plugin-flowtype": "^2.35.0",
"eslint-plugin-import": "^2.7.0",
2017-07-03 21:36:47 -07:00
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-prettier": "^2.1.2",
"eslint-plugin-react": "^7.1.0",
Update to react-native@0.50 and flow-bin@0.56 (#2998) * Update to React Native 0.50 * Type Promise used in PlatformHelpers.web.js * Move $FlowFixMe in CardStack.js The line number Flow is using for this error changed. The underlying problem has not, but I don't have time to fix it now unfortunately. * Type TouchableItem's children prop as React.Node This was my bad. `React.ChildrenArray` should only really be used in the case of having multiple of the same type of child. * Type HeaderTitle's children prop as React.Node Same as last commit. * Add assertion in StackRouter that StateUtils.indexOf returns valid index Flow doesn't realize that `StateUtils.indexOf` is guaranteed to return a valid index, so we use `invariant` to assert it. * Remove unused type DrawerNavigationState from TypeDefinition * Remove unused type parameter T in DrawerView * Type NavigationStateRoute as NavigationLeafRoute & NavigationState * Don't constrain generic action types to NavigationAction By constraining to subtypes of `NavigationAction`, we actually are requiring that any router satisfying our type constraints has to take all of the `NavigationAction` types. Instead, we want to say that it will only take some of them. Changing the types here to be inferred. * Fix types of NavigationScreenProp and withCachedChildNavigation 1. `NavigationScreenProp` needs to have its type parameter annotated with a `+` to actually indicate covariance on that type parameter, apparently 2. `withCachedChildNavigation` needs to thread through more-specific `NavigationState`s, and right now it just discards that specificity, which breaks `DrawerSidebar` because it needs a `NavigationStateRoute` * Ignore website/build from Flow * Fix type of DrawerItems activeItemKey prop - Even when specified, it can be `null` - Use a ternary expression instead of `x && x.param` approach * Get rid of NavigationRouter & NavigationNavigator parameterization on NavigationAction Since `NavigationRouter`'s `getStateForAction` functionality is a standard Redux reducer, it knows to forward on any actions it doesn't know how to deal with. We can widen the types of these functions to be `NavigationAction` without any negative consequence. * Explicitly specify null navigationOptions in createNavigator Not sure why, but Flow doesn't like us leaving it unspecified * Fix createNavigationContainer/createNavigator/StackNavigator types * Fix up flow types for TabNavigator and DrawerNavigator * Properly type defaultContentComponent * Fix more flow errors in createNavigationContainer * Replace NavigatorProps with NavigationNavigatorProps * Type SceneView's navigation prop as NavigationScreenProp<any> There is an unavoidable* type problem here. A `NavigationComponent` is either a navigator with a `NavigationStateRoute` or a scene with a `NavigationRoute`. The navigation prop it gets passed must match the component's `NavigationState`. However, there's no way for us to say that "`this.props.router.getComponentForRouteName` will have a `NavigationNavigator` iff the corresponding `childNavigationProps` is a `NavigationStateRoute`". The cleanest way to make this work is to throw an "any" specifically for the navigation prop's state type param. * We could probably avoid it with sufficient refactoring. If the routers were charged with keeping track of `childNavigationProps` instead of leaving it to the views, they could return the child navigation prop and child `NavigationComponent` in pairs whose types were coupled. * Pass in screenProps to NavigationComponent in NavigationPlayground's CustomTabs Flow wants `screenProps` to be passed in here for some reason... It cites `SceneView`, but that doesn't really make much sense to me. But this is some custom logic that most people aren't likely to run into, so I'm not gonna worry too much about it. * Patch mismatch with react-native-tab-view type for now * Use generic NavigationState in createNavigationContainer's _nav var We made the NavigationState generic while #1313 added a new instance variable. This updates the new instance variable to be generic. * Fix failing tests
2017-11-20 11:53:48 -08:00
"flow-bin": "^0.56.0",
"husky": "^0.14.3",
2017-07-03 21:36:47 -07:00
"jest": "^20.0.4",
"lint-staged": "^4.2.1",
2017-07-19 13:03:46 -07:00
"prettier": "^1.5.3",
"prettier-eslint": "^6.4.2",
Update to react-native@0.50 and flow-bin@0.56 (#2998) * Update to React Native 0.50 * Type Promise used in PlatformHelpers.web.js * Move $FlowFixMe in CardStack.js The line number Flow is using for this error changed. The underlying problem has not, but I don't have time to fix it now unfortunately. * Type TouchableItem's children prop as React.Node This was my bad. `React.ChildrenArray` should only really be used in the case of having multiple of the same type of child. * Type HeaderTitle's children prop as React.Node Same as last commit. * Add assertion in StackRouter that StateUtils.indexOf returns valid index Flow doesn't realize that `StateUtils.indexOf` is guaranteed to return a valid index, so we use `invariant` to assert it. * Remove unused type DrawerNavigationState from TypeDefinition * Remove unused type parameter T in DrawerView * Type NavigationStateRoute as NavigationLeafRoute & NavigationState * Don't constrain generic action types to NavigationAction By constraining to subtypes of `NavigationAction`, we actually are requiring that any router satisfying our type constraints has to take all of the `NavigationAction` types. Instead, we want to say that it will only take some of them. Changing the types here to be inferred. * Fix types of NavigationScreenProp and withCachedChildNavigation 1. `NavigationScreenProp` needs to have its type parameter annotated with a `+` to actually indicate covariance on that type parameter, apparently 2. `withCachedChildNavigation` needs to thread through more-specific `NavigationState`s, and right now it just discards that specificity, which breaks `DrawerSidebar` because it needs a `NavigationStateRoute` * Ignore website/build from Flow * Fix type of DrawerItems activeItemKey prop - Even when specified, it can be `null` - Use a ternary expression instead of `x && x.param` approach * Get rid of NavigationRouter & NavigationNavigator parameterization on NavigationAction Since `NavigationRouter`'s `getStateForAction` functionality is a standard Redux reducer, it knows to forward on any actions it doesn't know how to deal with. We can widen the types of these functions to be `NavigationAction` without any negative consequence. * Explicitly specify null navigationOptions in createNavigator Not sure why, but Flow doesn't like us leaving it unspecified * Fix createNavigationContainer/createNavigator/StackNavigator types * Fix up flow types for TabNavigator and DrawerNavigator * Properly type defaultContentComponent * Fix more flow errors in createNavigationContainer * Replace NavigatorProps with NavigationNavigatorProps * Type SceneView's navigation prop as NavigationScreenProp<any> There is an unavoidable* type problem here. A `NavigationComponent` is either a navigator with a `NavigationStateRoute` or a scene with a `NavigationRoute`. The navigation prop it gets passed must match the component's `NavigationState`. However, there's no way for us to say that "`this.props.router.getComponentForRouteName` will have a `NavigationNavigator` iff the corresponding `childNavigationProps` is a `NavigationStateRoute`". The cleanest way to make this work is to throw an "any" specifically for the navigation prop's state type param. * We could probably avoid it with sufficient refactoring. If the routers were charged with keeping track of `childNavigationProps` instead of leaving it to the views, they could return the child navigation prop and child `NavigationComponent` in pairs whose types were coupled. * Pass in screenProps to NavigationComponent in NavigationPlayground's CustomTabs Flow wants `screenProps` to be passed in here for some reason... It cites `SceneView`, but that doesn't really make much sense to me. But this is some custom logic that most people aren't likely to run into, so I'm not gonna worry too much about it. * Patch mismatch with react-native-tab-view type for now * Use generic NavigationState in createNavigationContainer's _nav var We made the NavigationState generic while #1313 added a new instance variable. This updates the new instance variable to be generic. * Fix failing tests
2017-11-20 11:53:48 -08:00
"react": "16.0.0",
"react-native": "^0.50.3",
2017-07-03 21:36:47 -07:00
"react-native-vector-icons": "^4.2.0",
"react-test-renderer": "^16.0.0"
},
"jest": {
"notify": true,
"preset": "react-native",
"testRegex": "./src/.*\\-test\\.js$",
"setupFiles": [
"<rootDir>/jest-setup.js"
],
2017-05-14 14:33:39 -07:00
"coverageDirectory": "./coverage/",
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.js"
],
"coveragePathIgnorePatterns": [
"jest-setup.js"
],
"modulePathIgnorePatterns": [
"examples"
]
},
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
]
}
}