From a0b1d4d322daf5739448fae65b7ee2a58a89561d Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Thu, 29 Aug 2019 16:38:37 -0400 Subject: [PATCH 1/4] fix config --- test/typescript/tsconfig.json | 2 +- tsconfig.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/typescript/tsconfig.json b/test/typescript/tsconfig.json index be426fdcac..497fa459db 100644 --- a/test/typescript/tsconfig.json +++ b/test/typescript/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "lib": ["es2015", "dom"], + "lib": ["es2017", "dom"], "strict": true, "baseUrl": "../..", "paths": { diff --git a/tsconfig.json b/tsconfig.json index 052d09d209..0abee9b5c3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,11 +7,11 @@ "dom", "es2017" ] /* Specify library files to be included in the compilation. */, - "allowJs": true /* Allow javascript files to be compiled. */, + // "allowJs": true /* Allow javascript files to be compiled. */, // "checkJs": true, /* Report errors in .js files. */ "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "declaration": true /* Generates corresponding '.d.ts' file. */, + // "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, "sourceMap": true /* Generates corresponding '.map' file. */, // "outFile": "./", /* Concatenate and emit output to single file. */ // "outDir": "." /* Redirect output structure to the directory. */, @@ -21,7 +21,7 @@ "noEmit": true /* Do not emit outputs. */, // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - "isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */, + // "isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */, /* Strict Type-Checking Options */ "strict": true /* Enable all strict type-checking options. */, From 78a95f632ac63960ff8be7dfcadc11585672ff9c Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Thu, 29 Aug 2019 16:43:06 -0400 Subject: [PATCH 2/4] export types --- src/index.ts | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/index.ts b/src/index.ts index efedbc4fed..d3f1161ecc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,31 @@ +import { + Dispatch, + Unsubscribe, + Observable, + Observer, + Store, + DeepPartial, + StoreCreator, + StoreEnhancer +} from '..' import createStore from './createStore' +import { + CombinedState, + PreloadedState, + Reducer, + ReducerFromReducersMapObject, + StateFromReducersMapObject, + ActionFromReducer, + ActionFromReducersMapObject +} from '..' import combineReducers from './combineReducers' +import { ActionCreator, ActionCreatorsMapObject } from '..' import bindActionCreators from './bindActionCreators' +import { MiddlewareAPI, Middleware } from '..' import applyMiddleware from './applyMiddleware' import compose from './compose' import warning from './utils/warning' +import { Action, AnyAction } from '..' import __DO_NOT_USE__ActionTypes from './utils/actionTypes' /* @@ -27,6 +49,34 @@ if ( } export { + // types + // actions + Action, + AnyAction, + // action creators + ActionCreator, + ActionCreatorsMapObject, + // reducers + CombinedState, + PreloadedState, + Reducer, + ReducerFromReducersMapObject, + StateFromReducersMapObject, + ActionFromReducer, + ActionFromReducersMapObject, + // middleware + MiddlewareAPI, + Middleware, + // store + Dispatch, + Unsubscribe, + Observable, + Observer, + Store, + DeepPartial, + StoreCreator, + StoreEnhancer, + // things createStore, combineReducers, bindActionCreators, From c38e86eab36d4b82153bd5e3c6e84050649649f4 Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Fri, 30 Aug 2019 09:54:45 -0400 Subject: [PATCH 3/4] use export from, reorganize --- src/index.ts | 47 +++++++++++++---------------------------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/src/index.ts b/src/index.ts index d3f1161ecc..949d025700 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,6 @@ -import { +// types +// store +export { Dispatch, Unsubscribe, Observable, @@ -8,8 +10,8 @@ import { StoreCreator, StoreEnhancer } from '..' -import createStore from './createStore' -import { +// reducers +export { CombinedState, PreloadedState, Reducer, @@ -18,14 +20,19 @@ import { ActionFromReducer, ActionFromReducersMapObject } from '..' +// action creators +export { ActionCreator, ActionCreatorsMapObject } from '..' +// middleware +export { MiddlewareAPI, Middleware } from '..' +// actions +export { Action, AnyAction } from '..' +// functions +import createStore from './createStore' import combineReducers from './combineReducers' -import { ActionCreator, ActionCreatorsMapObject } from '..' import bindActionCreators from './bindActionCreators' -import { MiddlewareAPI, Middleware } from '..' import applyMiddleware from './applyMiddleware' import compose from './compose' import warning from './utils/warning' -import { Action, AnyAction } from '..' import __DO_NOT_USE__ActionTypes from './utils/actionTypes' /* @@ -49,34 +56,6 @@ if ( } export { - // types - // actions - Action, - AnyAction, - // action creators - ActionCreator, - ActionCreatorsMapObject, - // reducers - CombinedState, - PreloadedState, - Reducer, - ReducerFromReducersMapObject, - StateFromReducersMapObject, - ActionFromReducer, - ActionFromReducersMapObject, - // middleware - MiddlewareAPI, - Middleware, - // store - Dispatch, - Unsubscribe, - Observable, - Observer, - Store, - DeepPartial, - StoreCreator, - StoreEnhancer, - // things createStore, combineReducers, bindActionCreators, From 6378591711965985a124e7e5b9065300b5e43a7a Mon Sep 17 00:00:00 2001 From: Gregory Beaver Date: Fri, 30 Aug 2019 10:24:48 -0400 Subject: [PATCH 4/4] fix stupid eslint rule breakage --- src/index.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 949d025700..f0c0703107 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,12 @@ +// functions +import createStore from './createStore' +import combineReducers from './combineReducers' +import bindActionCreators from './bindActionCreators' +import applyMiddleware from './applyMiddleware' +import compose from './compose' +import warning from './utils/warning' +import __DO_NOT_USE__ActionTypes from './utils/actionTypes' + // types // store export { @@ -26,14 +35,6 @@ export { ActionCreator, ActionCreatorsMapObject } from '..' export { MiddlewareAPI, Middleware } from '..' // actions export { Action, AnyAction } from '..' -// functions -import createStore from './createStore' -import combineReducers from './combineReducers' -import bindActionCreators from './bindActionCreators' -import applyMiddleware from './applyMiddleware' -import compose from './compose' -import warning from './utils/warning' -import __DO_NOT_USE__ActionTypes from './utils/actionTypes' /* * This is a dummy function to check if the function name has been altered by minification.