Skip to content

Commit

Permalink
fixes to config
Browse files Browse the repository at this point in the history
  • Loading branch information
cellog committed Aug 19, 2019
1 parent 99a5e24 commit be9c395
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dist
lib
es
coverage
# used by rollup-plugin-typescript2
.rpt2_cache/

website/translated_docs
website/build/
Expand Down
38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
"clean": "rimraf lib dist es coverage",
"format": "prettier --write \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
"format:check": "prettier --list-different \"{src,test}/**/*.{js,ts}\" index.d.ts \"**/*.md\"",
"lint": "eslint src test",
"lint": "eslint --ext js,ts src test",
"pretest": "npm run build",
"test": "jest",
"test:watch": "npm test -- --watch",
"test:cov": "npm test -- --coverage",
"build": "rollup -c",
"prepare": "npm run clean && npm run check-types && npm run format:check && npm run lint && npm test",
"check-types": "tsc",
"examples:lint": "eslint examples",
"examples:lint": "eslint --ext js,ts examples",
"examples:test": "cross-env CI=true babel-node examples/testAll.js"
},
"dependencies": {
Expand Down Expand Up @@ -87,6 +87,7 @@
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-typescript2": "^0.22.1",
"rxjs": "^6.5.2",
"typescript": "^3.5.3",
"typings-tester": "^0.3.2"
Expand Down
6 changes: 6 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import nodeResolve from 'rollup-plugin-node-resolve'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import { terser } from 'rollup-plugin-terser'
import typescript from 'rollup-plugin-typescript2'

import pkg from './package.json'

Expand All @@ -18,6 +19,7 @@ export default [
nodeResolve({
extensions: ['.ts']
}),
typescript(),
babel()
]
},
Expand All @@ -34,6 +36,7 @@ export default [
nodeResolve({
extensions: ['.ts']
}),
typescript(),
babel()
]
},
Expand All @@ -46,6 +49,7 @@ export default [
nodeResolve({
extensions: ['.ts']
}),
typescript(),
replace({
'process.env.NODE_ENV': JSON.stringify('production')
}),
Expand Down Expand Up @@ -76,6 +80,7 @@ export default [
nodeResolve({
extensions: ['.ts']
}),
typescript(),
babel({
exclude: 'node_modules/**'
}),
Expand All @@ -98,6 +103,7 @@ export default [
nodeResolve({
extensions: ['.ts']
}),
typescript(),
babel({
exclude: 'node_modules/**'
}),
Expand Down
50 changes: 50 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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'

/*
Expand All @@ -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,
Expand Down
9 changes: 1 addition & 8 deletions test/applyMiddleware.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
createStore,
applyMiddleware,
Middleware,
Dispatch,
AnyAction,
Action
} from '..'
import { createStore, applyMiddleware, Middleware, AnyAction, Action } from '..'
import * as reducers from './helpers/reducers'
import { addTodo, addTodoAsync, addTodoIfEmpty } from './helpers/actionCreators'
import { thunk } from './helpers/middleware'
Expand Down
7 changes: 7 additions & 0 deletions test/typescript/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
rules: {
'no-unused-expressions': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unused-vars': 'off'
}
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// "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. */,
Expand Down

0 comments on commit be9c395

Please sign in to comment.