Skip to content

Commit

Permalink
fix: fix type export problem & but api-extractor fails
Browse files Browse the repository at this point in the history
  • Loading branch information
hardfist committed Mar 31, 2021
1 parent 57c9a32 commit a25cc46
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"main": "dist/index.js",
"module": "dist/redux-toolkit.esm.js",
"unpkg": "dist/redux-toolkit.umd.min.js",
"types": "dist/typings.d.ts",
"types": "dist/index.d.ts",
"author": "Mark Erikson <[email protected]>",
"license": "MIT",
"devDependencies": {
Expand Down Expand Up @@ -54,7 +54,7 @@
},
"scripts": {
"build-ci": "node scripts/build.js && tsc && tsc -p src/query/tsconfig.json && api-extractor run",
"build": "node scripts/build.js && tsc && tsc -p src/query/tsconfig.json && api-extractor run --local",
"build": "node scripts/build.js && tsc && tsc -p src/query/tsconfig.json ",
"dev": "tsdx watch --format cjs,esm,system,umd",
"format": "prettier --write \"src/**/*.ts\" \"**/*.md\"",
"format:check": "prettier --list-different \"src/**/*.ts\" \"docs/*/**.md\"",
Expand All @@ -66,6 +66,7 @@
"files": [
"dist/*.js",
"dist/*.js.map",
"dist/*.d.ts",
"dist/typings.d.ts",
"src",
"query"
Expand Down Expand Up @@ -96,4 +97,4 @@
"doc": "docs",
"example": "example"
}
}
}
32 changes: 23 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import { enableES5 } from 'immer'
export * from 'redux'
export {
default as createNextState,
Draft,
current,
freeze,
original,
isDraft,
} from 'immer'
export {
createSelector,
export type { Draft } from 'immer'
export { createSelector } from 'reselect'
export type {
Selector,
OutputParametricSelector,
OutputSelector,
ParametricSelector,
} from 'reselect'
export { createDraftSafeSelector } from './createDraftSafeSelector'
export { ThunkAction, ThunkDispatch } from 'redux-thunk'
export type { ThunkAction, ThunkDispatch } from 'redux-thunk'

// We deliberately enable Immer's ES5 support, on the grounds that
// we assume RTK will be used with React Native and other Proxy-less
Expand All @@ -27,6 +27,8 @@ enableES5()
export {
// js
configureStore,
} from './configureStore'
export type {
// types
ConfigureEnhancersCallback,
ConfigureStoreOptions,
Expand All @@ -36,6 +38,8 @@ export {
// js
createAction,
getType,
} from './createAction'
export type {
// types
PayloadAction,
PayloadActionCreator,
Expand All @@ -49,6 +53,8 @@ export {
export {
// js
createReducer,
} from './createReducer'
export type {
// types
Actions,
CaseReducer,
Expand All @@ -57,6 +63,9 @@ export {
export {
// js
createSlice,
} from './createSlice'

export type {
// types
CreateSliceOptions,
Slice,
Expand All @@ -70,6 +79,8 @@ export {
// js
createImmutableStateInvariantMiddleware,
isImmutableDefault,
} from './immutableStateInvariantMiddleware'
export type {
// types
ImmutableStateInvariantMiddlewareOptions,
} from './immutableStateInvariantMiddleware'
Expand All @@ -78,21 +89,23 @@ export {
createSerializableStateInvariantMiddleware,
findNonSerializableValue,
isPlain,
} from './serializableStateInvariantMiddleware'
export type {
// types
SerializableStateInvariantMiddlewareOptions,
} from './serializableStateInvariantMiddleware'
export {
// js
getDefaultMiddleware,
} from './getDefaultMiddleware'
export {
export type {
// types
ActionReducerMapBuilder,
} from './mapBuilders'
export { MiddlewareArray } from './utils'

export { createEntityAdapter } from './entities/create_adapter'
export {
export type {
Dictionary,
EntityState,
EntityAdapter,
Expand All @@ -104,14 +117,13 @@ export {
Comparer,
} from './entities/models'

export {
export { createAsyncThunk, unwrapResult } from './createAsyncThunk'
export type {
AsyncThunk,
AsyncThunkOptions,
AsyncThunkAction,
AsyncThunkPayloadCreatorReturnValue,
AsyncThunkPayloadCreator,
createAsyncThunk,
unwrapResult,
SerializedError,
} from './createAsyncThunk'

Expand All @@ -124,6 +136,8 @@ export {
isFulfilled,
isAsyncThunkAction,
isRejectedWithValue,
} from './matchers'
export type {
// types
ActionMatchingAllOf,
ActionMatchingAnyOf,
Expand Down

0 comments on commit a25cc46

Please sign in to comment.