@dcloudio/vue-cli-plugin-uni 2.0.0 → 2.0.1-32920211122002
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/build.js +64 -33
- package/commands/serve.js +12 -17
- package/generator.js +6 -2
- package/index.js +5 -3
- package/lib/chain-webpack.js +8 -1
- package/lib/check-update.js +56 -0
- package/lib/commands/custom.js +7 -4
- package/lib/commands/invoke.js +5 -4
- package/lib/configure-webpack.js +35 -5
- package/lib/copy-webpack-options.js +60 -20
- package/lib/env.js +99 -51
- package/lib/error-reporting.js +9 -3
- package/lib/mp/index.js +31 -16
- package/lib/options.js +6 -3
- package/lib/util.js +5 -6
- package/package.json +3 -3
- package/packages/@vue/component-compiler-utils/MODIFY.md +5 -0
- package/packages/@vue/component-compiler-utils/dist/compileStyle.js +11 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/API.md +873 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/CHANGELOG.md +466 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/LICENSE-MIT +22 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/README.md +49 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/index.js +26 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/parser.js +1088 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/processor.js +185 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/attribute.js +468 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/className.js +67 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/combinator.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/comment.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/constructors.js +91 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/container.js +392 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/guards.js +54 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/id.js +39 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/index.js +39 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/namespace.js +98 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/nesting.js +36 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/node.js +216 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/pseudo.js +40 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/root.js +60 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/selector.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/string.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/tag.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/types.js +15 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/universal.js +36 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/sortAscending.js +10 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/tokenTypes.js +39 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/tokenize.js +271 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/ensureObject.js +20 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/getProp.js +22 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/index.js +41 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/stripComments.js +21 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/unesc.js +18 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/package.json +76 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts +499 -0
- package/packages/@vue/devtools-api/lib/cjs/api/api.d.ts +90 -0
- package/packages/@vue/devtools-api/lib/cjs/api/api.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/app.d.ts +1 -0
- package/packages/@vue/devtools-api/lib/cjs/api/app.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/component.d.ts +76 -0
- package/packages/@vue/devtools-api/lib/cjs/api/component.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/context.d.ts +5 -0
- package/packages/@vue/devtools-api/lib/cjs/api/context.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/hooks.d.ts +169 -0
- package/packages/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/index.d.ts +6 -0
- package/packages/@vue/devtools-api/lib/cjs/api/index.js +18 -0
- package/packages/@vue/devtools-api/lib/cjs/api/util.d.ts +4 -0
- package/packages/@vue/devtools-api/lib/cjs/api/util.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/const.d.ts +1 -0
- package/packages/@vue/devtools-api/lib/cjs/const.js +4 -0
- package/packages/@vue/devtools-api/lib/cjs/env.d.ts +10 -0
- package/packages/@vue/devtools-api/lib/cjs/env.js +16 -0
- package/packages/@vue/devtools-api/lib/cjs/index.d.ts +14 -0
- package/packages/@vue/devtools-api/lib/cjs/index.js +31 -0
- package/packages/@vue/devtools-api/lib/esm/api/api.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/app.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/component.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/context.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/hooks.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/index.js +6 -0
- package/packages/@vue/devtools-api/lib/esm/api/util.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/const.js +1 -0
- package/packages/@vue/devtools-api/lib/esm/env.js +11 -0
- package/packages/@vue/devtools-api/lib/esm/index.js +17 -0
- package/packages/@vue/devtools-api/package.json +38 -0
- package/packages/app-vue-style-loader/lib/addStylesClient.js +1 -1
- package/packages/h5-vue-style-loader/lib/addStylesClient.js +1 -1
- package/packages/mp-vue/dist/mp.runtime.esm.js +3 -2
- package/packages/mp-vue/package.json +1 -0
- package/packages/uni-app/LICENSE +202 -0
- package/packages/uni-app/dist/uni-app.cjs.js +165 -0
- package/packages/uni-app/dist/uni-app.d.ts +61 -0
- package/packages/uni-app/dist/uni-app.es.js +108 -0
- package/packages/uni-app/package.json +22 -0
- package/packages/uni-cloud/dist/index.js +1 -1
- package/packages/uni-stat/dist/uni-stat.cjs.js +961 -0
- package/packages/uni-stat/dist/uni-stat.es.js +959 -0
- package/packages/uni-stat/lib/uni.plugin.js +68 -0
- package/packages/uni-stat/package.json +25 -0
- package/packages/vue3/node_modules/.yarn-integrity +27 -0
- package/packages/vue3/node_modules/@intlify/core-base/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/core-base/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.cjs.js +989 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.cjs.prod.js +735 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.d.ts +576 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-browser.js +2771 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-browser.prod.js +6 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-bundler.js +965 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.global.js +2814 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.global.prod.js +6 -0
- package/packages/vue3/node_modules/@intlify/core-base/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/core-base/package.json +59 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/README.md +13 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.cjs.js +15 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.cjs.prod.js +15 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.d.ts +43 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.esm-bundler.js +11 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/package.json +49 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.cjs.js +1400 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.cjs.prod.js +1395 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.d.ts +197 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.js +1348 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.prod.js +6 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js +1329 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.global.js +1365 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.global.prod.js +6 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/package.json +56 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.cjs.js +302 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.cjs.prod.js +302 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.d.ts +21 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.esm-bundler.js +297 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/package.json +46 -0
- package/packages/vue3/node_modules/@intlify/runtime/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/runtime/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.cjs.js +116 -0
- package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.cjs.prod.js +116 -0
- package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.d.ts +95 -0
- package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.esm-bundler.js +111 -0
- package/packages/vue3/node_modules/@intlify/runtime/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/runtime/package.json +51 -0
- package/packages/vue3/node_modules/@intlify/shared/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/shared/README.md +18 -0
- package/packages/vue3/node_modules/@intlify/shared/dist/shared.cjs.js +222 -0
- package/packages/vue3/node_modules/@intlify/shared/dist/shared.cjs.prod.js +209 -0
- package/packages/vue3/node_modules/@intlify/shared/dist/shared.d.ts +145 -0
- package/packages/vue3/node_modules/@intlify/shared/dist/shared.esm-bundler.js +192 -0
- package/packages/vue3/node_modules/@intlify/shared/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/shared/package.json +46 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.cjs.js +24 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.cjs.prod.js +24 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.d.ts +81 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.esm-bundler.js +18 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/package.json +51 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/api.d.ts +90 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/api.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/app.d.ts +1 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/app.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/component.d.ts +76 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/component.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/context.d.ts +5 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/context.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/hooks.d.ts +169 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/index.d.ts +6 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/index.js +18 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/util.d.ts +4 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/util.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/const.d.ts +1 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/const.js +4 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/env.d.ts +10 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/env.js +16 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/index.d.ts +14 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/index.js +31 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/api.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/app.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/component.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/context.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/hooks.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/index.js +6 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/util.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/const.js +1 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/env.js +11 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/index.js +17 -0
- package/packages/vue3/node_modules/@vue/devtools-api/package.json +38 -0
- package/packages/vue3/node_modules/source-map/CHANGELOG.md +301 -0
- package/packages/vue3/node_modules/source-map/LICENSE +28 -0
- package/packages/vue3/node_modules/source-map/README.md +742 -0
- package/packages/vue3/node_modules/source-map/dist/source-map.debug.js +3234 -0
- package/packages/vue3/node_modules/source-map/dist/source-map.js +3233 -0
- package/packages/vue3/node_modules/source-map/dist/source-map.min.js +2 -0
- package/packages/vue3/node_modules/source-map/dist/source-map.min.js.map +1 -0
- package/packages/vue3/node_modules/source-map/lib/array-set.js +121 -0
- package/packages/vue3/node_modules/source-map/lib/base64-vlq.js +140 -0
- package/packages/vue3/node_modules/source-map/lib/base64.js +67 -0
- package/packages/vue3/node_modules/source-map/lib/binary-search.js +111 -0
- package/packages/vue3/node_modules/source-map/lib/mapping-list.js +79 -0
- package/packages/vue3/node_modules/source-map/lib/quick-sort.js +114 -0
- package/packages/vue3/node_modules/source-map/lib/source-map-consumer.js +1145 -0
- package/packages/vue3/node_modules/source-map/lib/source-map-generator.js +425 -0
- package/packages/vue3/node_modules/source-map/lib/source-node.js +413 -0
- package/packages/vue3/node_modules/source-map/lib/util.js +488 -0
- package/packages/vue3/node_modules/source-map/package.json +73 -0
- package/packages/vue3/node_modules/source-map/source-map.d.ts +98 -0
- package/packages/vue3/node_modules/source-map/source-map.js +8 -0
- package/packages/vue3/node_modules/vue-i18n/LICENSE +20 -0
- package/packages/vue3/node_modules/vue-i18n/README.md +74 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.cjs.js +1801 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.cjs.prod.js +1685 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.d.ts +3302 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-browser.js +5052 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-browser.prod.js +6 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js +2226 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.global.js +5065 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.global.prod.js +6 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-browser.js +3724 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-browser.prod.js +6 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-bundler.js +2224 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.global.js +3737 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.global.prod.js +6 -0
- package/packages/vue3/node_modules/vue-i18n/index.js +7 -0
- package/packages/vue3/node_modules/vue-i18n/package.json +69 -0
- package/packages/vue3/node_modules/vue-i18n/vetur/attributes.json +62 -0
- package/packages/vue3/node_modules/vue-i18n/vetur/tags.json +14 -0
- package/packages/vue3/package.json +15 -0
- package/packages/vue3/yarn.lock +79 -0
- package/packages/vuex/CHANGELOG.md +604 -0
- package/packages/vuex/LICENSE +21 -0
- package/packages/vuex/README.md +55 -0
- package/packages/vuex/dist/vuex.cjs.js +1474 -0
- package/packages/vuex/dist/vuex.esm-browser.js +1472 -0
- package/packages/vuex/dist/vuex.esm-browser.prod.js +1307 -0
- package/packages/vuex/dist/vuex.esm-bundler.js +1473 -0
- package/packages/vuex/dist/vuex.global.js +1499 -0
- package/packages/vuex/dist/vuex.global.prod.js +6 -0
- package/packages/vuex/dist/vuex.mjs +32 -0
- package/packages/vuex/package.json +99 -0
- package/packages/vuex/types/helpers.d.ts +86 -0
- package/packages/vuex/types/index.d.ts +167 -0
- package/packages/vuex/types/logger.d.ts +20 -0
- package/packages/vuex/types/vue.d.ts +12 -0
- package/packages/vuex3/CHANGELOG.md +356 -0
- package/packages/vuex3/LICENSE +21 -0
- package/packages/vuex3/README.md +59 -0
- package/packages/vuex3/dist/logger.js +155 -0
- package/packages/vuex3/dist/vuex.common.js +1244 -0
- package/packages/vuex3/dist/vuex.esm.browser.js +1200 -0
- package/packages/vuex3/dist/vuex.esm.browser.min.js +6 -0
- package/packages/vuex3/dist/vuex.esm.js +1243 -0
- package/packages/vuex3/dist/vuex.js +1250 -0
- package/packages/vuex3/dist/vuex.min.js +6 -0
- package/packages/vuex3/dist/vuex.mjs +26 -0
- package/packages/vuex3/package.json +96 -0
- package/packages/vuex3/types/helpers.d.ts +86 -0
- package/packages/vuex3/types/index.d.ts +164 -0
- package/packages/vuex3/types/logger.d.ts +20 -0
- package/packages/vuex3/types/vue.d.ts +18 -0
- package/packages/webpack-uni-app-loader/plugin/index.js +8 -2
- package/packages/webpack-uni-app-loader/view/main.js +12 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* vuex v3.6.2
|
|
3
|
+
* (c) 2021 Evan You
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Vuex=e()}(this,(function(){"use strict";var t=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function e(t,n){if(void 0===n&&(n=[]),null===t||"object"!=typeof t)return t;var o,r=(o=function(e){return e.original===t},n.filter(o)[0]);if(r)return r.copy;var i=Array.isArray(t)?[]:{};return n.push({original:t,copy:i}),Object.keys(t).forEach((function(o){i[o]=e(t[o],n)})),i}function n(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function o(t){return null!==t&&"object"==typeof t}var r=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"==typeof n?n():n)||{}},i={namespaced:{configurable:!0}};i.namespaced.get=function(){return!!this._rawModule.namespaced},r.prototype.addChild=function(t,e){this._children[t]=e},r.prototype.removeChild=function(t){delete this._children[t]},r.prototype.getChild=function(t){return this._children[t]},r.prototype.hasChild=function(t){return t in this._children},r.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},r.prototype.forEachChild=function(t){n(this._children,t)},r.prototype.forEachGetter=function(t){this._rawModule.getters&&n(this._rawModule.getters,t)},r.prototype.forEachAction=function(t){this._rawModule.actions&&n(this._rawModule.actions,t)},r.prototype.forEachMutation=function(t){this._rawModule.mutations&&n(this._rawModule.mutations,t)},Object.defineProperties(r.prototype,i);var c,a=function(t){this.register([],t,!1)};a.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},a.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")}),"")},a.prototype.update=function(t){!function t(e,n,o){if(n.update(o),o.modules)for(var r in o.modules){if(!n.getChild(r))return;t(e.concat(r),n.getChild(r),o.modules[r])}}([],this.root,t)},a.prototype.register=function(t,e,o){var i=this;void 0===o&&(o=!0);var c=new r(e,o);0===t.length?this.root=c:this.get(t.slice(0,-1)).addChild(t[t.length-1],c);e.modules&&n(e.modules,(function(e,n){i.register(t.concat(n),e,o)}))},a.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],o=e.getChild(n);o&&o.runtime&&e.removeChild(n)},a.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return!!e&&e.hasChild(n)};var s=function(e){var n=this;void 0===e&&(e={}),!c&&"undefined"!=typeof window&&window.Vue&&v(window.Vue);var o=e.plugins;void 0===o&&(o=[]);var r=e.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new a(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new c,this._makeLocalGettersCache=Object.create(null);var i=this,s=this.dispatch,u=this.commit;this.dispatch=function(t,e){return s.call(i,t,e)},this.commit=function(t,e,n){return u.call(i,t,e,n)},this.strict=r;var f=this._modules.root.state;p(this,f,[],this._modules.root),h(this,f),o.forEach((function(t){return t(n)})),(void 0!==e.devtools?e.devtools:c.config.devtools)&&function(e){t&&(e._devtoolHook=t,t.emit("vuex:init",e),t.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,n){t.emit("vuex:mutation",e,n)}),{prepend:!0}),e.subscribeAction((function(e,n){t.emit("vuex:action",e,n)}),{prepend:!0}))}(this)},u={state:{configurable:!0}};function f(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function l(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;p(t,n,[],t._modules.root,!0),h(t,n,e)}function h(t,e,o){var r=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var i=t._wrappedGetters,a={};n(i,(function(e,n){a[n]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})}));var s=c.config.silent;c.config.silent=!0,t._vm=new c({data:{$$state:e},computed:a}),c.config.silent=s,t.strict&&function(t){t._vm.$watch((function(){return this._data.$$state}),(function(){}),{deep:!0,sync:!0})}(t),r&&(o&&t._withCommit((function(){r._data.$$state=null})),c.nextTick((function(){return r.$destroy()})))}function p(t,e,n,o,r){var i=!n.length,a=t._modules.getNamespace(n);if(o.namespaced&&(t._modulesNamespaceMap[a],t._modulesNamespaceMap[a]=o),!i&&!r){var s=d(e,n.slice(0,-1)),u=n[n.length-1];t._withCommit((function(){c.set(s,u,o.state)}))}var f=o.context=function(t,e,n){var o=""===e,r={dispatch:o?t.dispatch:function(n,o,r){var i=m(n,o,r),c=i.payload,a=i.options,s=i.type;return a&&a.root||(s=e+s),t.dispatch(s,c)},commit:o?t.commit:function(n,o,r){var i=m(n,o,r),c=i.payload,a=i.options,s=i.type;a&&a.root||(s=e+s),t.commit(s,c,a)}};return Object.defineProperties(r,{getters:{get:o?function(){return t.getters}:function(){return function(t,e){if(!t._makeLocalGettersCache[e]){var n={},o=e.length;Object.keys(t.getters).forEach((function(r){if(r.slice(0,o)===e){var i=r.slice(o);Object.defineProperty(n,i,{get:function(){return t.getters[r]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return d(t.state,n)}}}),r}(t,a,n);o.forEachMutation((function(e,n){!function(t,e,n,o){(t._mutations[e]||(t._mutations[e]=[])).push((function(e){n.call(t,o.state,e)}))}(t,a+n,e,f)})),o.forEachAction((function(e,n){var o=e.root?n:a+n,r=e.handler||e;!function(t,e,n,o){(t._actions[e]||(t._actions[e]=[])).push((function(e){var r,i=n.call(t,{dispatch:o.dispatch,commit:o.commit,getters:o.getters,state:o.state,rootGetters:t.getters,rootState:t.state},e);return(r=i)&&"function"==typeof r.then||(i=Promise.resolve(i)),t._devtoolHook?i.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):i}))}(t,o,r,f)})),o.forEachGetter((function(e,n){!function(t,e,n,o){if(t._wrappedGetters[e])return;t._wrappedGetters[e]=function(t){return n(o.state,o.getters,t.state,t.getters)}}(t,a+n,e,f)})),o.forEachChild((function(o,i){p(t,e,n.concat(i),o,r)}))}function d(t,e){return e.reduce((function(t,e){return t[e]}),t)}function m(t,e,n){return o(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function v(t){c&&t===c||function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(c=t)}u.state.get=function(){return this._vm._data.$$state},u.state.set=function(t){},s.prototype.commit=function(t,e,n){var o=this,r=m(t,e,n),i=r.type,c=r.payload,a={type:i,payload:c},s=this._mutations[i];s&&(this._withCommit((function(){s.forEach((function(t){t(c)}))})),this._subscribers.slice().forEach((function(t){return t(a,o.state)})))},s.prototype.dispatch=function(t,e){var n=this,o=m(t,e),r=o.type,i=o.payload,c={type:r,payload:i},a=this._actions[r];if(a){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(c,n.state)}))}catch(t){}var s=a.length>1?Promise.all(a.map((function(t){return t(i)}))):a[0](i);return new Promise((function(t,e){s.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(c,n.state)}))}catch(t){}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(c,n.state,t)}))}catch(t){}e(t)}))}))}},s.prototype.subscribe=function(t,e){return f(t,this._subscribers,e)},s.prototype.subscribeAction=function(t,e){return f("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},s.prototype.watch=function(t,e,n){var o=this;return this._watcherVM.$watch((function(){return t(o.state,o.getters)}),e,n)},s.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},s.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),p(this,this.state,t,this._modules.get(t),n.preserveState),h(this,this.state)},s.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=d(e.state,t.slice(0,-1));c.delete(n,t[t.length-1])})),l(this)},s.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},s.prototype.hotUpdate=function(t){this._modules.update(t),l(this,!0)},s.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(s.prototype,u);var g=M((function(t,e){var n={};return w(e).forEach((function(e){var o=e.key,r=e.val;n[o]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var o=$(this.$store,"mapState",t);if(!o)return;e=o.context.state,n=o.context.getters}return"function"==typeof r?r.call(this,e,n):e[r]},n[o].vuex=!0})),n})),y=M((function(t,e){var n={};return w(e).forEach((function(e){var o=e.key,r=e.val;n[o]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var o=this.$store.commit;if(t){var i=$(this.$store,"mapMutations",t);if(!i)return;o=i.context.commit}return"function"==typeof r?r.apply(this,[o].concat(e)):o.apply(this.$store,[r].concat(e))}})),n})),_=M((function(t,e){var n={};return w(e).forEach((function(e){var o=e.key,r=e.val;r=t+r,n[o]=function(){if(!t||$(this.$store,"mapGetters",t))return this.$store.getters[r]},n[o].vuex=!0})),n})),b=M((function(t,e){var n={};return w(e).forEach((function(e){var o=e.key,r=e.val;n[o]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var o=this.$store.dispatch;if(t){var i=$(this.$store,"mapActions",t);if(!i)return;o=i.context.dispatch}return"function"==typeof r?r.apply(this,[o].concat(e)):o.apply(this.$store,[r].concat(e))}})),n}));function w(t){return function(t){return Array.isArray(t)||o(t)}(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function M(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function $(t,e,n){return t._modulesNamespaceMap[n]}function C(t,e,n){var o=n?t.groupCollapsed:t.group;try{o.call(t,e)}catch(n){t.log(e)}}function E(t){try{t.groupEnd()}catch(e){t.log("—— log end ——")}}function O(){var t=new Date;return" @ "+j(t.getHours(),2)+":"+j(t.getMinutes(),2)+":"+j(t.getSeconds(),2)+"."+j(t.getMilliseconds(),3)}function j(t,e){return n="0",o=e-t.toString().length,new Array(o+1).join(n)+t;var n,o}return{Store:s,install:v,version:"3.6.2",mapState:g,mapMutations:y,mapGetters:_,mapActions:b,createNamespacedHelpers:function(t){return{mapState:g.bind(null,t),mapGetters:_.bind(null,t),mapMutations:y.bind(null,t),mapActions:b.bind(null,t)}},createLogger:function(t){void 0===t&&(t={});var n=t.collapsed;void 0===n&&(n=!0);var o=t.filter;void 0===o&&(o=function(t,e,n){return!0});var r=t.transformer;void 0===r&&(r=function(t){return t});var i=t.mutationTransformer;void 0===i&&(i=function(t){return t});var c=t.actionFilter;void 0===c&&(c=function(t,e){return!0});var a=t.actionTransformer;void 0===a&&(a=function(t){return t});var s=t.logMutations;void 0===s&&(s=!0);var u=t.logActions;void 0===u&&(u=!0);var f=t.logger;return void 0===f&&(f=console),function(t){var l=e(t.state);void 0!==f&&(s&&t.subscribe((function(t,c){var a=e(c);if(o(t,l,a)){var s=O(),u=i(t),h="mutation "+t.type+s;C(f,h,n),f.log("%c prev state","color: #9E9E9E; font-weight: bold",r(l)),f.log("%c mutation","color: #03A9F4; font-weight: bold",u),f.log("%c next state","color: #4CAF50; font-weight: bold",r(a)),E(f)}l=a})),u&&t.subscribeAction((function(t,e){if(c(t,e)){var o=O(),r=a(t),i="action "+t.type+o;C(f,i,n),f.log("%c action","color: #03A9F4; font-weight: bold",r),E(f)}})))}}}}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Vuex from '../dist/vuex.common.js'
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
Store,
|
|
5
|
+
install,
|
|
6
|
+
version,
|
|
7
|
+
mapState,
|
|
8
|
+
mapMutations,
|
|
9
|
+
mapGetters,
|
|
10
|
+
mapActions,
|
|
11
|
+
createNamespacedHelpers,
|
|
12
|
+
createLogger
|
|
13
|
+
} = Vuex
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
Vuex as default,
|
|
17
|
+
Store,
|
|
18
|
+
install,
|
|
19
|
+
version,
|
|
20
|
+
mapState,
|
|
21
|
+
mapMutations,
|
|
22
|
+
mapGetters,
|
|
23
|
+
mapActions,
|
|
24
|
+
createNamespacedHelpers,
|
|
25
|
+
createLogger
|
|
26
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vuex",
|
|
3
|
+
"version": "3.6.2",
|
|
4
|
+
"description": "state management for Vue.js",
|
|
5
|
+
"main": "dist/vuex.common.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"module": "./dist/vuex.esm.js",
|
|
9
|
+
"require": "./dist/vuex.common.js",
|
|
10
|
+
"import": "./dist/vuex.mjs"
|
|
11
|
+
},
|
|
12
|
+
"./": "./"
|
|
13
|
+
},
|
|
14
|
+
"module": "dist/vuex.esm.js",
|
|
15
|
+
"unpkg": "dist/vuex.js",
|
|
16
|
+
"jsdelivr": "dist/vuex.js",
|
|
17
|
+
"typings": "types/index.d.ts",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"types/index.d.ts",
|
|
22
|
+
"types/helpers.d.ts",
|
|
23
|
+
"types/logger.d.ts",
|
|
24
|
+
"types/vue.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"dev": "node examples/server.js",
|
|
28
|
+
"build": "npm run build:main && npm run build:logger",
|
|
29
|
+
"build:main": "node scripts/build-main.js",
|
|
30
|
+
"build:logger": "node scripts/build-logger.js",
|
|
31
|
+
"lint": "eslint src test",
|
|
32
|
+
"test": "npm run lint && npm run test:types && npm run test:unit && npm run test:ssr && npm run test:e2e && npm run test:esm",
|
|
33
|
+
"test:unit": "jest --testPathIgnorePatterns test/e2e",
|
|
34
|
+
"test:e2e": "start-server-and-test dev http://localhost:8080 \"jest --testPathIgnorePatterns test/unit\"",
|
|
35
|
+
"test:ssr": "cross-env VUE_ENV=server jest --testPathIgnorePatterns test/e2e",
|
|
36
|
+
"test:types": "tsc -p types/test",
|
|
37
|
+
"test:esm": "node test/esm/esm-test.js",
|
|
38
|
+
"coverage": "jest --testPathIgnorePatterns test/e2e --coverage",
|
|
39
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
40
|
+
"release": "node scripts/release.js",
|
|
41
|
+
"docs": "vuepress dev docs",
|
|
42
|
+
"docs:build": "vuepress build docs"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/vuejs/vuex.git"
|
|
47
|
+
},
|
|
48
|
+
"author": "Evan You",
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/vuejs/vuex/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/vuejs/vuex#readme",
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"vue": "^2.0.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@babel/core": "^7.12.10",
|
|
59
|
+
"@babel/preset-env": "^7.12.11",
|
|
60
|
+
"@rollup/plugin-buble": "^0.21.3",
|
|
61
|
+
"@rollup/plugin-commonjs": "^11.1.0",
|
|
62
|
+
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
63
|
+
"@rollup/plugin-replace": "^2.3.2",
|
|
64
|
+
"@types/node": "^13.13.5",
|
|
65
|
+
"@vuepress/theme-vue": "^1.8.0",
|
|
66
|
+
"babel-jest": "^26.6.3",
|
|
67
|
+
"babel-loader": "^8.2.2",
|
|
68
|
+
"brotli": "^1.3.2",
|
|
69
|
+
"chalk": "^4.0.0",
|
|
70
|
+
"conventional-changelog-cli": "^2.1.1",
|
|
71
|
+
"cross-env": "^5.2.0",
|
|
72
|
+
"css-loader": "^2.1.0",
|
|
73
|
+
"enquirer": "^2.3.5",
|
|
74
|
+
"eslint": "^6.8.0",
|
|
75
|
+
"eslint-plugin-vue-libs": "^4.0.0",
|
|
76
|
+
"execa": "^5.0.0",
|
|
77
|
+
"express": "^4.17.1",
|
|
78
|
+
"jest": "^26.6.3",
|
|
79
|
+
"puppeteer": "^4.0.0",
|
|
80
|
+
"regenerator-runtime": "^0.13.5",
|
|
81
|
+
"rollup": "^2.38.0",
|
|
82
|
+
"rollup-plugin-terser": "^5.3.0",
|
|
83
|
+
"semver": "^7.3.2",
|
|
84
|
+
"start-server-and-test": "^1.11.7",
|
|
85
|
+
"todomvc-app-css": "^2.3.0",
|
|
86
|
+
"typescript": "^3.8.3",
|
|
87
|
+
"vue": "2.5.22",
|
|
88
|
+
"vue-loader": "15.2.1",
|
|
89
|
+
"vue-server-renderer": "2.5.22",
|
|
90
|
+
"vue-template-compiler": "2.5.22",
|
|
91
|
+
"vuepress": "^1.8.0",
|
|
92
|
+
"webpack": "^4.43.0",
|
|
93
|
+
"webpack-dev-middleware": "^3.7.2",
|
|
94
|
+
"webpack-hot-middleware": "^2.25.0"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import { Dispatch, Commit } from './index';
|
|
3
|
+
|
|
4
|
+
type Computed = () => any;
|
|
5
|
+
type InlineComputed<T extends Function> = T extends (...args: any[]) => infer R ? () => R : never
|
|
6
|
+
type MutationMethod = (...args: any[]) => void;
|
|
7
|
+
type ActionMethod = (...args: any[]) => Promise<any>;
|
|
8
|
+
type InlineMethod<T extends (fn: any, ...args: any[]) => any> = T extends (fn: any, ...args: infer Args) => infer R ? (...args: Args) => R : never
|
|
9
|
+
type CustomVue = Vue & Record<string, any>;
|
|
10
|
+
|
|
11
|
+
interface Mapper<R> {
|
|
12
|
+
<Key extends string>(map: Key[]): { [K in Key]: R };
|
|
13
|
+
<Map extends Record<string, string>>(map: Map): { [K in keyof Map]: R };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface MapperWithNamespace<R> {
|
|
17
|
+
<Key extends string>(namespace: string, map: Key[]): { [K in Key]: R };
|
|
18
|
+
<Map extends Record<string, string>>(namespace: string, map: Map): { [K in keyof Map]: R };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface MapperForState {
|
|
22
|
+
<S, Map extends Record<string, (this: CustomVue, state: S, getters: any) => any> = {}>(
|
|
23
|
+
map: Map
|
|
24
|
+
): { [K in keyof Map]: InlineComputed<Map[K]> };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface MapperForStateWithNamespace {
|
|
28
|
+
<S, Map extends Record<string, (this: CustomVue, state: S, getters: any) => any> = {}>(
|
|
29
|
+
namespace: string,
|
|
30
|
+
map: Map
|
|
31
|
+
): { [K in keyof Map]: InlineComputed<Map[K]> };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface MapperForAction {
|
|
35
|
+
<Map extends Record<string, (this: CustomVue, dispatch: Dispatch, ...args: any[]) => any>>(
|
|
36
|
+
map: Map
|
|
37
|
+
): { [K in keyof Map]: InlineMethod<Map[K]> };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface MapperForActionWithNamespace {
|
|
41
|
+
<Map extends Record<string, (this: CustomVue, dispatch: Dispatch, ...args: any[]) => any>>(
|
|
42
|
+
namespace: string,
|
|
43
|
+
map: Map
|
|
44
|
+
): { [K in keyof Map]: InlineMethod<Map[K]> };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface MapperForMutation {
|
|
48
|
+
<Map extends Record<string, (this: CustomVue, commit: Commit, ...args: any[]) => any>>(
|
|
49
|
+
map: Map
|
|
50
|
+
): { [K in keyof Map]: InlineMethod<Map[K]> };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface MapperForMutationWithNamespace {
|
|
54
|
+
<Map extends Record<string, (this: CustomVue, commit: Commit, ...args: any[]) => any>>(
|
|
55
|
+
namespace: string,
|
|
56
|
+
map: Map
|
|
57
|
+
): { [K in keyof Map]: InlineMethod<Map[K]> };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
interface NamespacedMappers {
|
|
62
|
+
mapState: Mapper<Computed> & MapperForState;
|
|
63
|
+
mapMutations: Mapper<MutationMethod> & MapperForMutation;
|
|
64
|
+
mapGetters: Mapper<Computed>;
|
|
65
|
+
mapActions: Mapper<ActionMethod> & MapperForAction;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export declare const mapState: Mapper<Computed>
|
|
69
|
+
& MapperWithNamespace<Computed>
|
|
70
|
+
& MapperForState
|
|
71
|
+
& MapperForStateWithNamespace;
|
|
72
|
+
|
|
73
|
+
export declare const mapMutations: Mapper<MutationMethod>
|
|
74
|
+
& MapperWithNamespace<MutationMethod>
|
|
75
|
+
& MapperForMutation
|
|
76
|
+
& MapperForMutationWithNamespace;
|
|
77
|
+
|
|
78
|
+
export declare const mapGetters: Mapper<Computed>
|
|
79
|
+
& MapperWithNamespace<Computed>;
|
|
80
|
+
|
|
81
|
+
export declare const mapActions: Mapper<ActionMethod>
|
|
82
|
+
& MapperWithNamespace<ActionMethod>
|
|
83
|
+
& MapperForAction
|
|
84
|
+
& MapperForActionWithNamespace;
|
|
85
|
+
|
|
86
|
+
export declare function createNamespacedHelpers(namespace: string): NamespacedMappers;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import _Vue, { WatchOptions } from "vue";
|
|
2
|
+
|
|
3
|
+
// augment typings of Vue.js
|
|
4
|
+
import "./vue";
|
|
5
|
+
|
|
6
|
+
import { mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers } from "./helpers";
|
|
7
|
+
import createLogger from "./logger";
|
|
8
|
+
|
|
9
|
+
export * from "./helpers";
|
|
10
|
+
export * from "./logger";
|
|
11
|
+
|
|
12
|
+
export declare class Store<S> {
|
|
13
|
+
constructor(options: StoreOptions<S>);
|
|
14
|
+
|
|
15
|
+
readonly state: S;
|
|
16
|
+
readonly getters: any;
|
|
17
|
+
|
|
18
|
+
replaceState(state: S): void;
|
|
19
|
+
|
|
20
|
+
dispatch: Dispatch;
|
|
21
|
+
commit: Commit;
|
|
22
|
+
|
|
23
|
+
subscribe<P extends MutationPayload>(fn: (mutation: P, state: S) => any, options?: SubscribeOptions): () => void;
|
|
24
|
+
subscribeAction<P extends ActionPayload>(fn: SubscribeActionOptions<P, S>, options?: SubscribeOptions): () => void;
|
|
25
|
+
watch<T>(getter: (state: S, getters: any) => T, cb: (value: T, oldValue: T) => void, options?: WatchOptions): () => void;
|
|
26
|
+
|
|
27
|
+
registerModule<T>(path: string, module: Module<T, S>, options?: ModuleOptions): void;
|
|
28
|
+
registerModule<T>(path: string[], module: Module<T, S>, options?: ModuleOptions): void;
|
|
29
|
+
|
|
30
|
+
unregisterModule(path: string): void;
|
|
31
|
+
unregisterModule(path: string[]): void;
|
|
32
|
+
|
|
33
|
+
hasModule(path: string): boolean;
|
|
34
|
+
hasModule(path: string[]): boolean;
|
|
35
|
+
|
|
36
|
+
hotUpdate(options: {
|
|
37
|
+
actions?: ActionTree<S, S>;
|
|
38
|
+
mutations?: MutationTree<S>;
|
|
39
|
+
getters?: GetterTree<S, S>;
|
|
40
|
+
modules?: ModuleTree<S>;
|
|
41
|
+
}): void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare function install(Vue: typeof _Vue): void;
|
|
45
|
+
|
|
46
|
+
export interface Dispatch {
|
|
47
|
+
(type: string, payload?: any, options?: DispatchOptions): Promise<any>;
|
|
48
|
+
<P extends Payload>(payloadWithType: P, options?: DispatchOptions): Promise<any>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface Commit {
|
|
52
|
+
(type: string, payload?: any, options?: CommitOptions): void;
|
|
53
|
+
<P extends Payload>(payloadWithType: P, options?: CommitOptions): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ActionContext<S, R> {
|
|
57
|
+
dispatch: Dispatch;
|
|
58
|
+
commit: Commit;
|
|
59
|
+
state: S;
|
|
60
|
+
getters: any;
|
|
61
|
+
rootState: R;
|
|
62
|
+
rootGetters: any;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface Payload {
|
|
66
|
+
type: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface MutationPayload extends Payload {
|
|
70
|
+
payload: any;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface ActionPayload extends Payload {
|
|
74
|
+
payload: any;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface SubscribeOptions {
|
|
78
|
+
prepend?: boolean
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type ActionSubscriber<P, S> = (action: P, state: S) => any;
|
|
82
|
+
export type ActionErrorSubscriber<P, S> = (action: P, state: S, error: Error) => any;
|
|
83
|
+
|
|
84
|
+
export interface ActionSubscribersObject<P, S> {
|
|
85
|
+
before?: ActionSubscriber<P, S>;
|
|
86
|
+
after?: ActionSubscriber<P, S>;
|
|
87
|
+
error?: ActionErrorSubscriber<P, S>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type SubscribeActionOptions<P, S> = ActionSubscriber<P, S> | ActionSubscribersObject<P, S>;
|
|
91
|
+
|
|
92
|
+
export interface DispatchOptions {
|
|
93
|
+
root?: boolean;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface CommitOptions {
|
|
97
|
+
silent?: boolean;
|
|
98
|
+
root?: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface StoreOptions<S> {
|
|
102
|
+
state?: S | (() => S);
|
|
103
|
+
getters?: GetterTree<S, S>;
|
|
104
|
+
actions?: ActionTree<S, S>;
|
|
105
|
+
mutations?: MutationTree<S>;
|
|
106
|
+
modules?: ModuleTree<S>;
|
|
107
|
+
plugins?: Plugin<S>[];
|
|
108
|
+
strict?: boolean;
|
|
109
|
+
devtools?: boolean;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type ActionHandler<S, R> = (this: Store<R>, injectee: ActionContext<S, R>, payload?: any) => any;
|
|
113
|
+
export interface ActionObject<S, R> {
|
|
114
|
+
root?: boolean;
|
|
115
|
+
handler: ActionHandler<S, R>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type Getter<S, R> = (state: S, getters: any, rootState: R, rootGetters: any) => any;
|
|
119
|
+
export type Action<S, R> = ActionHandler<S, R> | ActionObject<S, R>;
|
|
120
|
+
export type Mutation<S> = (state: S, payload?: any) => any;
|
|
121
|
+
export type Plugin<S> = (store: Store<S>) => any;
|
|
122
|
+
|
|
123
|
+
export interface Module<S, R> {
|
|
124
|
+
namespaced?: boolean;
|
|
125
|
+
state?: S | (() => S);
|
|
126
|
+
getters?: GetterTree<S, R>;
|
|
127
|
+
actions?: ActionTree<S, R>;
|
|
128
|
+
mutations?: MutationTree<S>;
|
|
129
|
+
modules?: ModuleTree<R>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface ModuleOptions {
|
|
133
|
+
preserveState?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface GetterTree<S, R> {
|
|
137
|
+
[key: string]: Getter<S, R>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface ActionTree<S, R> {
|
|
141
|
+
[key: string]: Action<S, R>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface MutationTree<S> {
|
|
145
|
+
[key: string]: Mutation<S>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface ModuleTree<R> {
|
|
149
|
+
[key: string]: Module<any, R>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export { createLogger }
|
|
153
|
+
|
|
154
|
+
declare const _default: {
|
|
155
|
+
Store: typeof Store;
|
|
156
|
+
install: typeof install;
|
|
157
|
+
mapState: typeof mapState,
|
|
158
|
+
mapMutations: typeof mapMutations,
|
|
159
|
+
mapGetters: typeof mapGetters,
|
|
160
|
+
mapActions: typeof mapActions,
|
|
161
|
+
createNamespacedHelpers: typeof createNamespacedHelpers,
|
|
162
|
+
createLogger: typeof createLogger
|
|
163
|
+
};
|
|
164
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Payload, Plugin } from "./index";
|
|
2
|
+
|
|
3
|
+
interface Logger extends Partial<Pick<Console, 'groupCollapsed' | 'group' | 'groupEnd'>> {
|
|
4
|
+
log(message: string, color: string, payload: any): void;
|
|
5
|
+
log(message: string): void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface LoggerOption<S> {
|
|
9
|
+
collapsed?: boolean;
|
|
10
|
+
filter?: <P extends Payload>(mutation: P, stateBefore: S, stateAfter: S) => boolean;
|
|
11
|
+
transformer?: (state: S) => any;
|
|
12
|
+
mutationTransformer?: <P extends Payload>(mutation: P) => any;
|
|
13
|
+
actionFilter?: <P extends Payload>(action: P, state: S) => boolean;
|
|
14
|
+
actionTransformer?: <P extends Payload>(action: P) => any;
|
|
15
|
+
logMutations?: boolean;
|
|
16
|
+
logActions?: boolean;
|
|
17
|
+
logger?: Logger;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function createLogger<S>(option?: LoggerOption<S>): Plugin<S>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extends interfaces in Vue.js
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import Vue, { ComponentOptions } from "vue";
|
|
6
|
+
import { Store } from "./index";
|
|
7
|
+
|
|
8
|
+
declare module "vue/types/options" {
|
|
9
|
+
interface ComponentOptions<V extends Vue> {
|
|
10
|
+
store?: Store<any>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module "vue/types/vue" {
|
|
15
|
+
interface Vue {
|
|
16
|
+
$store: Store<any>;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
const {
|
|
2
2
|
initAutoImportScanComponents
|
|
3
3
|
} = require('@dcloudio/uni-cli-shared/lib/pages')
|
|
4
|
+
const {
|
|
5
|
+
initUniModules
|
|
6
|
+
} = require('@dcloudio/uni-cli-shared/lib/uni_modules')
|
|
7
|
+
const uniI18n = require('@dcloudio/uni-cli-i18n')
|
|
4
8
|
|
|
5
9
|
let compiling = false
|
|
6
10
|
|
|
@@ -31,12 +35,14 @@ class WebpackUniAppPlugin {
|
|
|
31
35
|
if (!process.env.UNI_USING_V3) {
|
|
32
36
|
if (!compiling) {
|
|
33
37
|
compiling = true
|
|
34
|
-
console.log('
|
|
38
|
+
console.log(uniI18n.__('performingHotReload'))
|
|
35
39
|
}
|
|
36
40
|
}
|
|
37
41
|
if (fileName && typeof fileName === 'string') {
|
|
38
42
|
if (fileName.indexOf('.vue') !== -1 || fileName.indexOf('.nvue') !== -1) {
|
|
39
43
|
if (process.UNI_AUTO_SCAN_COMPONENTS) {
|
|
44
|
+
// TODO 需要处理copy webpack
|
|
45
|
+
initUniModules()
|
|
40
46
|
initAutoImportScanComponents()
|
|
41
47
|
}
|
|
42
48
|
}
|
|
@@ -54,4 +60,4 @@ class WebpackUniAppPlugin {
|
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
module.exports = WebpackUniAppPlugin
|
|
63
|
+
module.exports = WebpackUniAppPlugin
|
|
@@ -13,6 +13,12 @@ const {
|
|
|
13
13
|
getGlobalUsingComponentsCode
|
|
14
14
|
} = require('@dcloudio/uni-cli-shared/lib/pages')
|
|
15
15
|
|
|
16
|
+
const {
|
|
17
|
+
jsPreprocessOptions
|
|
18
|
+
} = require('@dcloudio/uni-cli-shared/lib/platform')
|
|
19
|
+
|
|
20
|
+
const preprocessor = require('@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/preprocess')
|
|
21
|
+
|
|
16
22
|
const traverse = require('@dcloudio/webpack-uni-mp-loader/lib/babel/global-component-traverse')
|
|
17
23
|
|
|
18
24
|
const genStylesCode = require('../../vue-loader/lib/codegen/styleInjection')
|
|
@@ -94,6 +100,12 @@ function getStylesCode (loaderContext) {
|
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
module.exports = function (source, map) {
|
|
103
|
+
// 需要执行一遍条件编译 source
|
|
104
|
+
if (source.indexOf('#ifdef') !== -1) {
|
|
105
|
+
source = preprocessor.preprocess(source, jsPreprocessOptions.context, {
|
|
106
|
+
type: jsPreprocessOptions.type
|
|
107
|
+
})
|
|
108
|
+
}
|
|
97
109
|
// 追加小程序全局自定义组件(仅v3)
|
|
98
110
|
source = getGlobalUsingComponentsCode() + source
|
|
99
111
|
const automatorCode = process.env.UNI_AUTOMATOR_WS_ENDPOINT
|