Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit 1897b32

Browse files
committed
Revert "Merge pull request #8 from horacioh/feature/typescript"
This reverts commit 27ed333, reversing changes made to a4da6ff. # Conflicts: # package.json
1 parent fa8b320 commit 1897b32

15 files changed

+1288
-330
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules/
22
dist/
33
jest-setup.js
4-
coverage/

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# VSCode
99
.vscode/
10+
tsconfig.json
1011
jsconfig.json
1112

1213
# Xcode
@@ -50,6 +51,3 @@ android/keystores/debug.keystore
5051

5152
# Build
5253
dist/
53-
54-
# Code coverage files
55-
coverage/

package.json

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@
1111
],
1212
"react-native": "src/index.js",
1313
"scripts": {
14-
"pretest": "yarn lint && yarn build",
1514
"test": "jest",
1615
"lint": "eslint .",
1716
"format": "eslint . --fix",
18-
"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__/**'",
19-
"tsc": "tsc",
20-
"build": "yarn babel && yarn tsc",
17+
"build": "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__/**'",
2118
"prepare": "yarn build",
2219
"release": "release-it"
2320
},
@@ -62,49 +59,34 @@
6259
"eslint": "^4.12.1",
6360
"eslint-config-satya164": "^1.0.1",
6461
"eslint-plugin-react-native-globals": "^0.1.0",
65-
"husky": "^1.1.2",
62+
"husky": "^0.14.3",
6663
"jest": "^22.1.3",
6764
"jest-expo": "^30.0.0",
6865
"prettier": "^1.8.2",
6966
"react": "16.3.1",
7067
"react-dom": "16.3.1",
7168
"react-native": "^0.55.4",
7269
"react-test-renderer": "16.3.1",
73-
"release-it": "^7.6.1",
74-
"ts-jest": "^23.10.4",
75-
"typescript": "^3.1.3"
70+
"release-it": "^7.6.1"
7671
},
7772
"peerDependencies": {
7873
"react": "*"
7974
},
8075
"jest": {
8176
"preset": "react-native",
82-
"testRegex": "/__tests__/[^/]+-test\\.(js|tsx?)$",
77+
"testRegex": "/__tests__/[^/]+-test\\.js$",
8378
"setupFiles": [
8479
"<rootDir>/jest-setup.js"
8580
],
8681
"coveragePathIgnorePatterns": [
8782
"jest-setup.js"
8883
],
89-
"transformIgnorePatterns": [
90-
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element)"
91-
],
92-
"transform": {
93-
"^.+\\.tsx?$": "ts-jest"
94-
},
9584
"modulePathIgnorePatterns": [
9685
"<rootDir>/example/"
9786
],
98-
"globals": {
99-
"ts-jest": {
100-
"tsConfig": "./tsconfig.test.json",
101-
"diagnostics": {
102-
"ignoreCodes": [
103-
151001
104-
]
105-
}
106-
}
107-
}
87+
"transformIgnorePatterns": [
88+
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element)"
89+
]
10890
},
10991
"prettier": {
11092
"trailingComma": "es5",

src/getChildNavigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import getChildEventSubscriber from './getChildEventSubscriber';
2-
import getChildRouter from './getChildRouter.ts';
2+
import getChildRouter from './getChildRouter';
33
import getNavigationActionCreators from './routers/getNavigationActionCreators';
44
import getChildrenNavigationCache from './getChildrenNavigationCache';
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function getChildRouter(router: any, routeName: string) {
1+
export default function getChildRouter(router, routeName) {
22
if (router.childRouters && router.childRouters[routeName]) {
33
return router.childRouters[routeName];
44
}

src/routers/KeyGenerator.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
let uniqueBaseId = `id-${Date.now()}`;
2+
let uuidCount = 0;
3+
4+
export function _TESTING_ONLY_normalize_keys() {
5+
uniqueBaseId = 'id';
6+
uuidCount = 0;
7+
}
8+
9+
export function generateKey() {
10+
return `${uniqueBaseId}-${uuidCount++}`;
11+
}

src/routers/KeyGenerator.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/routers/StackRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import getScreenForRouteName from './getScreenForRouteName';
55
import StateUtils from '../StateUtils';
66
import validateRouteConfigMap from './validateRouteConfigMap';
77
import invariant from '../utils/invariant';
8-
import { generateKey } from './KeyGenerator.ts';
8+
import { generateKey } from './KeyGenerator';
99
import { createPathParser } from './pathUtils';
1010

1111
function behavesLikePushAction(action) {

src/routers/__tests__/PathHandling-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import SwitchRouter from '../SwitchRouter';
66
import StackRouter from '../StackRouter';
77
import TabRouter from '../TabRouter';
88
import NavigationActions from '../../NavigationActions';
9-
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator.ts';
9+
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator';
1010

1111
beforeEach(() => {
1212
_TESTING_ONLY_normalize_keys();

src/routers/__tests__/Routers-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import TabRouter from '../TabRouter';
77
import SwitchRouter from '../SwitchRouter';
88

99
import NavigationActions from '../../NavigationActions';
10-
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator.ts';
10+
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator';
1111

1212
beforeEach(() => {
1313
_TESTING_ONLY_normalize_keys();

0 commit comments

Comments
 (0)