From 7dbef9f3232bbf2539ffee3dd9cc4f5b66fb6f6e Mon Sep 17 00:00:00 2001 From: hardfist <1562502418@qq.com> Date: Wed, 31 Mar 2021 14:13:08 +0800 Subject: [PATCH] fix: fix api-extractor && type export problem --- package-lock.json | 211 ++++++++++++++++++++++++++++------------------ package.json | 2 +- src/index.ts | 32 +++++-- 3 files changed, 153 insertions(+), 92 deletions(-) diff --git a/package-lock.json b/package-lock.json index a16d631623..f3800fb631 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3277,29 +3277,31 @@ } }, "@microsoft/api-extractor": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.7.0.tgz", - "integrity": "sha512-1ngy95VA1s7GTE+bkS7QoYTg/TZs54CdJ46uAhl6HlyDJut4p/aH46W70g2XQs9VniIymW1Qe6fqNmcQUx5CVg==", + "version": "7.13.2", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.13.2.tgz", + "integrity": "sha512-2fD0c8OxZW+e6NTaxbtrdNxXVuX7aqil3+cqig3pKsHymvUuRJVCEAcAJmZrJ/ENqYXNiB265EyqOT6VxbMysw==", "dev": true, "requires": { - "@microsoft/api-extractor-model": "7.7.0", - "@microsoft/node-core-library": "3.18.0", - "@microsoft/ts-command-line": "4.3.5", - "@microsoft/tsdoc": "0.12.14", + "@microsoft/api-extractor-model": "7.12.2", + "@microsoft/tsdoc": "0.12.24", + "@rushstack/node-core-library": "3.36.0", + "@rushstack/rig-package": "0.2.10", + "@rushstack/ts-command-line": "4.7.8", "colors": "~1.2.1", "lodash": "~4.17.15", - "resolve": "1.8.1", + "resolve": "~1.17.0", + "semver": "~7.3.0", "source-map": "~0.6.1", - "typescript": "~3.7.2" + "typescript": "~4.1.3" }, "dependencies": { "resolve": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", - "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { - "path-parse": "^1.0.5" + "path-parse": "^1.0.6" } }, "source-map": { @@ -3309,78 +3311,27 @@ "dev": true }, "typescript": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz", - "integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz", + "integrity": "sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA==", "dev": true } } }, "@microsoft/api-extractor-model": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.7.0.tgz", - "integrity": "sha512-9yrSr9LpdNnx7X8bXVb/YbcQopizsr43McAG7Xno5CMNFzbSkmIr8FJL0L+WGfrSWSTms9Bngfz7d1ScP6zbWQ==", + "version": "7.12.2", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.12.2.tgz", + "integrity": "sha512-EU+U09Mj65zUH0qwPF4PFJiL6Y+PQQE/RRGEHEDGJJzab/mRQDpKOyrzSdb00xvcd/URehIHJqC55cY2Y4jGOA==", "dev": true, "requires": { - "@microsoft/node-core-library": "3.18.0", - "@microsoft/tsdoc": "0.12.14" - } - }, - "@microsoft/node-core-library": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/@microsoft/node-core-library/-/node-core-library-3.18.0.tgz", - "integrity": "sha512-VzzSHtcwgHVW1xbHqpngfn+OS1trAZ1Tw3XXBlMsEKe7Wz7FF2gLr0hZa6x9Pemk5pkd4tu4+GTSOJjCKGjrgg==", - "dev": true, - "requires": { - "@types/node": "8.10.54", - "colors": "~1.2.1", - "fs-extra": "~7.0.1", - "jju": "~1.4.0", - "semver": "~5.3.0", - "timsort": "~0.3.0", - "z-schema": "~3.18.3" - }, - "dependencies": { - "@types/node": { - "version": "8.10.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.54.tgz", - "integrity": "sha512-kaYyLYf6ICn6/isAyD4K1MyWWd5Q3JgH6bnMN089LUx88+s4W8GvK9Q6JMBVu5vsFFp7pMdSxdKmlBXwH/VFRg==", - "dev": true - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "dev": true - } - } - }, - "@microsoft/ts-command-line": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@microsoft/ts-command-line/-/ts-command-line-4.3.5.tgz", - "integrity": "sha512-CN3j86apNOmllUmeJ0AyRfTYA2BP2xlnfgmnyp1HWLqcJmR/zLe/fk/+gohGnNt7o5/qHta3681LQhO2Yy3GFw==", - "dev": true, - "requires": { - "@types/argparse": "1.0.33", - "argparse": "~1.0.9", - "colors": "~1.2.1" + "@microsoft/tsdoc": "0.12.24", + "@rushstack/node-core-library": "3.36.0" } }, "@microsoft/tsdoc": { - "version": "0.12.14", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.12.14.tgz", - "integrity": "sha512-518yewjSga1jLdiLrcmpMFlaba5P+50b0TWNFUpC+SL9Yzf0kMi57qw+bMl+rQ08cGqH1vLx4eg9YFUbZXgZ0Q==", + "version": "0.12.24", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.12.24.tgz", + "integrity": "sha512-Mfmij13RUTmHEMi9vRUhMXD7rnGR2VvxeNYtaGtaJ4redwwjT4UXYJ+nzmVJF7hhd4pn/Fx5sncDKxMVFJSWPg==", "dev": true }, "@rollup/plugin-babel": { @@ -3452,6 +3403,84 @@ "picomatch": "^2.2.2" } }, + "@rushstack/node-core-library": { + "version": "3.36.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.36.0.tgz", + "integrity": "sha512-bID2vzXpg8zweXdXgQkKToEdZwVrVCN9vE9viTRk58gqzYaTlz4fMId6V3ZfpXN6H0d319uGi2KDlm+lUEeqCg==", + "dev": true, + "requires": { + "@types/node": "10.17.13", + "colors": "~1.2.1", + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "timsort": "~0.3.0", + "z-schema": "~3.18.3" + }, + "dependencies": { + "@types/node": { + "version": "10.17.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz", + "integrity": "sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg==", + "dev": true + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "@rushstack/rig-package": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.2.10.tgz", + "integrity": "sha512-WXYerEJEPf8bS3ruqfM57NnwXtA7ehn8VJjLjrjls6eSduE5CRydcob/oBTzlHKsQ7N196XKlqQl9P6qIyYG2A==", + "dev": true, + "requires": { + "resolve": "~1.17.0", + "strip-json-comments": "~3.1.1" + }, + "dependencies": { + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "@rushstack/ts-command-line": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.7.8.tgz", + "integrity": "sha512-8ghIWhkph7NnLCMDJtthpsb7TMOsVGXVDvmxjE/CeklTqjbbUFBjGXizJfpbEkRQTELuZQ2+vGn7sGwIWKN2uA==", + "dev": true, + "requires": { + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "colors": "~1.2.1", + "string-argv": "~0.3.1" + } + }, "@sinonjs/commons": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.2.tgz", @@ -3462,9 +3491,9 @@ } }, "@types/argparse": { - "version": "1.0.33", - "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.33.tgz", - "integrity": "sha512-VQgHxyPMTj3hIlq9SY1mctqx+Jj8kpQfoLvDlVSDNOyuYs8JYfkuY3OW/4+dO657yPmNhHpePRx0/Tje5ImNVQ==", + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", + "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", "dev": true }, "@types/babel__core": { @@ -4612,7 +4641,8 @@ "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true }, "builtin-modules": { "version": "3.2.0", @@ -6425,6 +6455,12 @@ "resolve-from": "^4.0.0" } }, + "import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true + }, "import-local": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", @@ -12976,6 +13012,12 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, "string-length": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-length/-/string-length-3.1.0.tgz", @@ -13258,6 +13300,7 @@ "version": "5.6.1", "resolved": "https://registry.npmjs.org/terser/-/terser-5.6.1.tgz", "integrity": "sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw==", + "dev": true, "requires": { "commander": "^2.20.0", "source-map": "~0.7.2", @@ -13267,17 +13310,20 @@ "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true }, "source-map": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true }, "source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -13286,7 +13332,8 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true } } } diff --git a/package.json b/package.json index 85c28761aa..2648570f0e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "author": "Mark Erikson ", "license": "MIT", "devDependencies": { - "@microsoft/api-extractor": "^7.7.0", + "@microsoft/api-extractor": "^7.13.2", "@types/jest": "^24.0.11", "@types/json-stringify-safe": "^5.0.0", "@types/nanoid": "^2.1.0", diff --git a/src/index.ts b/src/index.ts index 8f44779977..d87f52b53a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 @@ -27,6 +27,8 @@ enableES5() export { // js configureStore, +} from './configureStore' +export type { // types ConfigureEnhancersCallback, ConfigureStoreOptions, @@ -36,6 +38,8 @@ export { // js createAction, getType, +} from './createAction' +export type { // types PayloadAction, PayloadActionCreator, @@ -49,6 +53,8 @@ export { export { // js createReducer, +} from './createReducer' +export type { // types Actions, CaseReducer, @@ -57,6 +63,9 @@ export { export { // js createSlice, +} from './createSlice' + +export type { // types CreateSliceOptions, Slice, @@ -70,6 +79,8 @@ export { // js createImmutableStateInvariantMiddleware, isImmutableDefault, +} from './immutableStateInvariantMiddleware' +export type { // types ImmutableStateInvariantMiddlewareOptions, } from './immutableStateInvariantMiddleware' @@ -78,6 +89,8 @@ export { createSerializableStateInvariantMiddleware, findNonSerializableValue, isPlain, +} from './serializableStateInvariantMiddleware' +export type { // types SerializableStateInvariantMiddlewareOptions, } from './serializableStateInvariantMiddleware' @@ -85,14 +98,14 @@ 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, @@ -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' @@ -124,6 +136,8 @@ export { isFulfilled, isAsyncThunkAction, isRejectedWithValue, +} from './matchers' +export type { // types ActionMatchingAllOf, ActionMatchingAnyOf,