Revert "Merge pull request #8 from horacioh/feature/typescript"

This reverts commit 27ed333c6d09734579d7db2ae1f11e15c283dbdf, reversing
changes made to a4da6ffa471fab2412f54569d2f48fe3a5d14b4f.

# Conflicts:
#	package.json
This commit is contained in:
Eric Vicenti
2018-10-29 18:33:50 -07:00
parent 17e1fb1874
commit 145100d012
15 changed files with 1287 additions and 329 deletions

View File

@@ -1,4 +1,3 @@
node_modules/
dist/
jest-setup.js
coverage/

View File

@@ -7,6 +7,7 @@
# VSCode
.vscode/
tsconfig.json
jsconfig.json
# Xcode
@@ -50,6 +51,3 @@ android/keystores/debug.keystore
# Build
dist/
# Code coverage files
coverage/

View File

@@ -11,13 +11,10 @@
],
"react-native": "src/index.js",
"scripts": {
"pretest": "yarn lint && yarn build",
"test": "jest",
"lint": "eslint .",
"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__/**'",
"tsc": "tsc",
"build": "yarn babel && yarn tsc",
"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__/**'",
"prepare": "yarn build",
"release": "release-it"
},
@@ -62,7 +59,7 @@
"eslint": "^4.12.1",
"eslint-config-satya164": "^1.0.1",
"eslint-plugin-react-native-globals": "^0.1.0",
"husky": "^1.1.2",
"husky": "^0.14.3",
"jest": "^22.1.3",
"jest-expo": "^30.0.0",
"prettier": "^1.8.2",
@@ -70,41 +67,26 @@
"react-dom": "16.3.1",
"react-native": "^0.55.4",
"react-test-renderer": "16.3.1",
"release-it": "^7.6.1",
"ts-jest": "^23.10.4",
"typescript": "^3.1.3"
"release-it": "^7.6.1"
},
"peerDependencies": {
"react": "*"
},
"jest": {
"preset": "react-native",
"testRegex": "/__tests__/[^/]+-test\\.(js|tsx?)$",
"testRegex": "/__tests__/[^/]+-test\\.js$",
"setupFiles": [
"<rootDir>/jest-setup.js"
],
"coveragePathIgnorePatterns": [
"jest-setup.js"
],
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element)"
],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"modulePathIgnorePatterns": [
"<rootDir>/example/"
],
"globals": {
"ts-jest": {
"tsConfig": "./tsconfig.test.json",
"diagnostics": {
"ignoreCodes": [
151001
]
}
}
}
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?react-native|react-clone-referenced-element)"
]
},
"prettier": {
"trailingComma": "es5",

View File

@@ -1,5 +1,5 @@
import getChildEventSubscriber from './getChildEventSubscriber';
import getChildRouter from './getChildRouter.ts';
import getChildRouter from './getChildRouter';
import getNavigationActionCreators from './routers/getNavigationActionCreators';
import getChildrenNavigationCache from './getChildrenNavigationCache';

View File

@@ -1,4 +1,4 @@
export default function getChildRouter(router: any, routeName: string) {
export default function getChildRouter(router, routeName) {
if (router.childRouters && router.childRouters[routeName]) {
return router.childRouters[routeName];
}

View File

@@ -0,0 +1,11 @@
let uniqueBaseId = `id-${Date.now()}`;
let uuidCount = 0;
export function _TESTING_ONLY_normalize_keys() {
uniqueBaseId = 'id';
uuidCount = 0;
}
export function generateKey() {
return `${uniqueBaseId}-${uuidCount++}`;
}

View File

@@ -1,11 +0,0 @@
let uniqueBaseId: string = `id-${Date.now()}`;
let uuidCount: number = 0;
export function _TESTING_ONLY_normalize_keys(): void {
uniqueBaseId = 'id';
uuidCount = 0;
}
export function generateKey(): string {
return `${uniqueBaseId}-${uuidCount++}`;
}

View File

@@ -5,7 +5,7 @@ import getScreenForRouteName from './getScreenForRouteName';
import StateUtils from '../StateUtils';
import validateRouteConfigMap from './validateRouteConfigMap';
import invariant from '../utils/invariant';
import { generateKey } from './KeyGenerator.ts';
import { generateKey } from './KeyGenerator';
import { createPathParser } from './pathUtils';
function behavesLikePushAction(action) {

View File

@@ -6,7 +6,7 @@ import SwitchRouter from '../SwitchRouter';
import StackRouter from '../StackRouter';
import TabRouter from '../TabRouter';
import NavigationActions from '../../NavigationActions';
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator.ts';
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator';
beforeEach(() => {
_TESTING_ONLY_normalize_keys();

View File

@@ -7,7 +7,7 @@ import TabRouter from '../TabRouter';
import SwitchRouter from '../SwitchRouter';
import NavigationActions from '../../NavigationActions';
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator.ts';
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator';
beforeEach(() => {
_TESTING_ONLY_normalize_keys();

View File

@@ -5,7 +5,7 @@ import React from 'react';
import StackRouter from '../StackRouter';
import StackActions from '../StackActions';
import NavigationActions from '../../NavigationActions';
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator.ts';
import { _TESTING_ONLY_normalize_keys } from '../KeyGenerator';
beforeEach(() => {
_TESTING_ONLY_normalize_keys();

View File

@@ -1,31 +0,0 @@
{
"compilerOptions": {
"module": "es2015",
"target": "esnext",
"lib": ["dom", "es2015", "es2016"],
"sourceMap": false,
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"declaration": true,
"pretty": true,
"jsx": "react-native",
"noEmitHelpers": true,
"importHelpers": true,
"strict": true,
"outDir": "dist",
"declarationDir": "./types",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},
"typeAcquisition": {
"enable": true,
"include": ["prop-types", "react", "react-native"]
}
}

View File

@@ -1,7 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"sourceMap": true
}
}

View File

@@ -1,15 +0,0 @@
{
"extends": "tslint:recommended",
"rules": {
"arrow-parens": [true, "ban-single-arg-parens"],
"arrow-return-shorthand": [true, "multiline"],
"trailing-comma": false,
"quotemark": {
"options": [
"single",
"avoid-escape"
]
},
"object-literal-sort-keys": false
}
}

File diff suppressed because it is too large Load Diff