@dcloudio/vue-cli-plugin-uni 2.0.0 → 2.0.1-33420211227001
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 +38 -7
- package/lib/copy-webpack-options.js +60 -20
- package/lib/env.js +102 -52
- package/lib/error-reporting.js +9 -3
- package/lib/h5/index.js +3 -0
- package/lib/mp/index.js +32 -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 +15 -12
- package/packages/mp-vue/package.json +1 -0
- package/packages/sass-loader/CHANGELOG.md +436 -0
- package/packages/sass-loader/LICENSE +20 -0
- package/packages/sass-loader/README.md +606 -0
- package/packages/sass-loader/dist/SassError.js +33 -0
- package/packages/sass-loader/dist/cjs.js +5 -0
- package/packages/sass-loader/dist/getDefaultSassImplementation.js +28 -0
- package/packages/sass-loader/dist/getRenderFunctionFromSassImplementation.js +39 -0
- package/packages/sass-loader/dist/getSassImplementation.js +56 -0
- package/packages/sass-loader/dist/getSassOptions.js +116 -0
- package/packages/sass-loader/dist/importsToResolve.js +88 -0
- package/packages/sass-loader/dist/index.js +117 -0
- package/packages/sass-loader/dist/options.json +41 -0
- package/packages/sass-loader/dist/proxyCustomImporters.js +31 -0
- package/packages/sass-loader/dist/webpackImporter.js +93 -0
- package/packages/sass-loader/node_modules/schema-utils/CHANGELOG.md +279 -0
- package/packages/sass-loader/node_modules/schema-utils/LICENSE +20 -0
- package/packages/sass-loader/node_modules/schema-utils/README.md +276 -0
- package/packages/sass-loader/node_modules/schema-utils/declarations/ValidationError.d.ts +88 -0
- package/packages/sass-loader/node_modules/schema-utils/declarations/index.d.ts +2 -0
- package/packages/sass-loader/node_modules/schema-utils/declarations/keywords/absolutePath.d.ts +12 -0
- package/packages/sass-loader/node_modules/schema-utils/declarations/util/Range.d.ts +82 -0
- package/packages/sass-loader/node_modules/schema-utils/declarations/util/hints.d.ts +6 -0
- package/packages/sass-loader/node_modules/schema-utils/declarations/validate.d.ts +44 -0
- package/packages/sass-loader/node_modules/schema-utils/dist/ValidationError.js +1261 -0
- package/packages/sass-loader/node_modules/schema-utils/dist/index.js +5 -0
- package/packages/sass-loader/node_modules/schema-utils/dist/keywords/absolutePath.js +93 -0
- package/packages/sass-loader/node_modules/schema-utils/dist/util/Range.js +163 -0
- package/packages/sass-loader/node_modules/schema-utils/dist/util/hints.js +105 -0
- package/packages/sass-loader/node_modules/schema-utils/dist/validate.js +160 -0
- package/packages/sass-loader/node_modules/schema-utils/package.json +109 -0
- package/packages/sass-loader/node_modules/semver/CHANGELOG.md +70 -0
- package/packages/sass-loader/node_modules/semver/LICENSE +15 -0
- package/packages/sass-loader/node_modules/semver/README.md +443 -0
- package/packages/sass-loader/node_modules/semver/bin/semver.js +174 -0
- package/packages/sass-loader/node_modules/semver/package.json +60 -0
- package/packages/sass-loader/node_modules/semver/range.bnf +16 -0
- package/packages/sass-loader/node_modules/semver/semver.js +1596 -0
- package/packages/sass-loader/package.json +144 -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
- package/util/format-errors.js +17 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
/** @typedef {import("ajv").Ajv} Ajv */
|
|
9
|
+
|
|
10
|
+
/** @typedef {import("ajv").ValidateFunction} ValidateFunction */
|
|
11
|
+
|
|
12
|
+
/** @typedef {import("../validate").SchemaUtilErrorObject} SchemaUtilErrorObject */
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} message
|
|
16
|
+
* @param {object} schema
|
|
17
|
+
* @param {string} data
|
|
18
|
+
* @returns {SchemaUtilErrorObject}
|
|
19
|
+
*/
|
|
20
|
+
function errorMessage(message, schema, data) {
|
|
21
|
+
return {
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
// eslint-disable-next-line no-undefined
|
|
24
|
+
dataPath: undefined,
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
// eslint-disable-next-line no-undefined
|
|
27
|
+
schemaPath: undefined,
|
|
28
|
+
keyword: 'absolutePath',
|
|
29
|
+
params: {
|
|
30
|
+
absolutePath: data
|
|
31
|
+
},
|
|
32
|
+
message,
|
|
33
|
+
parentSchema: schema
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @param {boolean} shouldBeAbsolute
|
|
38
|
+
* @param {object} schema
|
|
39
|
+
* @param {string} data
|
|
40
|
+
* @returns {SchemaUtilErrorObject}
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
function getErrorFor(shouldBeAbsolute, schema, data) {
|
|
45
|
+
const message = shouldBeAbsolute ? `The provided value ${JSON.stringify(data)} is not an absolute path!` : `A relative path is expected. However, the provided value ${JSON.stringify(data)} is an absolute path!`;
|
|
46
|
+
return errorMessage(message, schema, data);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @param {Ajv} ajv
|
|
51
|
+
* @returns {Ajv}
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
function addAbsolutePathKeyword(ajv) {
|
|
56
|
+
ajv.addKeyword('absolutePath', {
|
|
57
|
+
errors: true,
|
|
58
|
+
type: 'string',
|
|
59
|
+
|
|
60
|
+
compile(schema, parentSchema) {
|
|
61
|
+
/** @type {ValidateFunction} */
|
|
62
|
+
const callback = data => {
|
|
63
|
+
let passes = true;
|
|
64
|
+
const isExclamationMarkPresent = data.includes('!');
|
|
65
|
+
|
|
66
|
+
if (isExclamationMarkPresent) {
|
|
67
|
+
callback.errors = [errorMessage(`The provided value ${JSON.stringify(data)} contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.`, parentSchema, data)];
|
|
68
|
+
passes = false;
|
|
69
|
+
} // ?:[A-Za-z]:\\ - Windows absolute path
|
|
70
|
+
// \\\\ - Windows network absolute path
|
|
71
|
+
// \/ - Unix-like OS absolute path
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
const isCorrectAbsolutePath = schema === /^(?:[A-Za-z]:(\\|\/)|\\\\|\/)/.test(data);
|
|
75
|
+
|
|
76
|
+
if (!isCorrectAbsolutePath) {
|
|
77
|
+
callback.errors = [getErrorFor(schema, parentSchema, data)];
|
|
78
|
+
passes = false;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return passes;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
callback.errors = [];
|
|
85
|
+
return callback;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
});
|
|
89
|
+
return ajv;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
var _default = addAbsolutePathKeyword;
|
|
93
|
+
exports.default = _default;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {[number, boolean]} RangeValue
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @callback RangeValueCallback
|
|
9
|
+
* @param {RangeValue} rangeValue
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/
|
|
12
|
+
class Range {
|
|
13
|
+
/**
|
|
14
|
+
* @param {"left" | "right"} side
|
|
15
|
+
* @param {boolean} exclusive
|
|
16
|
+
* @returns {">" | ">=" | "<" | "<="}
|
|
17
|
+
*/
|
|
18
|
+
static getOperator(side, exclusive) {
|
|
19
|
+
if (side === 'left') {
|
|
20
|
+
return exclusive ? '>' : '>=';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return exclusive ? '<' : '<=';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @param {number} value
|
|
27
|
+
* @param {boolean} logic is not logic applied
|
|
28
|
+
* @param {boolean} exclusive is range exclusive
|
|
29
|
+
* @returns {string}
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
static formatRight(value, logic, exclusive) {
|
|
34
|
+
if (logic === false) {
|
|
35
|
+
return Range.formatLeft(value, !logic, !exclusive);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return `should be ${Range.getOperator('right', exclusive)} ${value}`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @param {number} value
|
|
42
|
+
* @param {boolean} logic is not logic applied
|
|
43
|
+
* @param {boolean} exclusive is range exclusive
|
|
44
|
+
* @returns {string}
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
static formatLeft(value, logic, exclusive) {
|
|
49
|
+
if (logic === false) {
|
|
50
|
+
return Range.formatRight(value, !logic, !exclusive);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return `should be ${Range.getOperator('left', exclusive)} ${value}`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @param {number} start left side value
|
|
57
|
+
* @param {number} end right side value
|
|
58
|
+
* @param {boolean} startExclusive is range exclusive from left side
|
|
59
|
+
* @param {boolean} endExclusive is range exclusive from right side
|
|
60
|
+
* @param {boolean} logic is not logic applied
|
|
61
|
+
* @returns {string}
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
static formatRange(start, end, startExclusive, endExclusive, logic) {
|
|
66
|
+
let result = 'should be';
|
|
67
|
+
result += ` ${Range.getOperator(logic ? 'left' : 'right', logic ? startExclusive : !startExclusive)} ${start} `;
|
|
68
|
+
result += logic ? 'and' : 'or';
|
|
69
|
+
result += ` ${Range.getOperator(logic ? 'right' : 'left', logic ? endExclusive : !endExclusive)} ${end}`;
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @param {Array<RangeValue>} values
|
|
74
|
+
* @param {boolean} logic is not logic applied
|
|
75
|
+
* @return {RangeValue} computed value and it's exclusive flag
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
static getRangeValue(values, logic) {
|
|
80
|
+
let minMax = logic ? Infinity : -Infinity;
|
|
81
|
+
let j = -1;
|
|
82
|
+
const predicate = logic ?
|
|
83
|
+
/** @type {RangeValueCallback} */
|
|
84
|
+
([value]) => value <= minMax :
|
|
85
|
+
/** @type {RangeValueCallback} */
|
|
86
|
+
([value]) => value >= minMax;
|
|
87
|
+
|
|
88
|
+
for (let i = 0; i < values.length; i++) {
|
|
89
|
+
if (predicate(values[i])) {
|
|
90
|
+
[minMax] = values[i];
|
|
91
|
+
j = i;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (j > -1) {
|
|
96
|
+
return values[j];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return [Infinity, true];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
constructor() {
|
|
103
|
+
/** @type {Array<RangeValue>} */
|
|
104
|
+
this._left = [];
|
|
105
|
+
/** @type {Array<RangeValue>} */
|
|
106
|
+
|
|
107
|
+
this._right = [];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @param {number} value
|
|
111
|
+
* @param {boolean=} exclusive
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
left(value, exclusive = false) {
|
|
116
|
+
this._left.push([value, exclusive]);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @param {number} value
|
|
120
|
+
* @param {boolean=} exclusive
|
|
121
|
+
*/
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
right(value, exclusive = false) {
|
|
125
|
+
this._right.push([value, exclusive]);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @param {boolean} logic is not logic applied
|
|
129
|
+
* @return {string} "smart" range string representation
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
format(logic = true) {
|
|
134
|
+
const [start, leftExclusive] = Range.getRangeValue(this._left, logic);
|
|
135
|
+
const [end, rightExclusive] = Range.getRangeValue(this._right, !logic);
|
|
136
|
+
|
|
137
|
+
if (!Number.isFinite(start) && !Number.isFinite(end)) {
|
|
138
|
+
return '';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const realStart = leftExclusive ? start + 1 : start;
|
|
142
|
+
const realEnd = rightExclusive ? end - 1 : end; // e.g. 5 < x < 7, 5 < x <= 6, 6 <= x <= 6
|
|
143
|
+
|
|
144
|
+
if (realStart === realEnd) {
|
|
145
|
+
return `should be ${logic ? '' : '!'}= ${realStart}`;
|
|
146
|
+
} // e.g. 4 < x < ∞
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
if (Number.isFinite(start) && !Number.isFinite(end)) {
|
|
150
|
+
return Range.formatLeft(start, logic, leftExclusive);
|
|
151
|
+
} // e.g. ∞ < x < 4
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
if (!Number.isFinite(start) && Number.isFinite(end)) {
|
|
155
|
+
return Range.formatRight(end, logic, rightExclusive);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return Range.formatRange(start, end, leftExclusive, rightExclusive, logic);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
module.exports = Range;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const Range = require('./Range');
|
|
4
|
+
/** @typedef {import("../validate").Schema} Schema */
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {Schema} schema
|
|
8
|
+
* @param {boolean} logic
|
|
9
|
+
* @return {string[]}
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
module.exports.stringHints = function stringHints(schema, logic) {
|
|
14
|
+
const hints = [];
|
|
15
|
+
let type = 'string';
|
|
16
|
+
const currentSchema = { ...schema
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
if (!logic) {
|
|
20
|
+
const tmpLength = currentSchema.minLength;
|
|
21
|
+
const tmpFormat = currentSchema.formatMinimum;
|
|
22
|
+
const tmpExclusive = currentSchema.formatExclusiveMaximum;
|
|
23
|
+
currentSchema.minLength = currentSchema.maxLength;
|
|
24
|
+
currentSchema.maxLength = tmpLength;
|
|
25
|
+
currentSchema.formatMinimum = currentSchema.formatMaximum;
|
|
26
|
+
currentSchema.formatMaximum = tmpFormat;
|
|
27
|
+
currentSchema.formatExclusiveMaximum = !currentSchema.formatExclusiveMinimum;
|
|
28
|
+
currentSchema.formatExclusiveMinimum = !tmpExclusive;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (typeof currentSchema.minLength === 'number') {
|
|
32
|
+
if (currentSchema.minLength === 1) {
|
|
33
|
+
type = 'non-empty string';
|
|
34
|
+
} else {
|
|
35
|
+
const length = Math.max(currentSchema.minLength - 1, 0);
|
|
36
|
+
hints.push(`should be longer than ${length} character${length > 1 ? 's' : ''}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (typeof currentSchema.maxLength === 'number') {
|
|
41
|
+
if (currentSchema.maxLength === 0) {
|
|
42
|
+
type = 'empty string';
|
|
43
|
+
} else {
|
|
44
|
+
const length = currentSchema.maxLength + 1;
|
|
45
|
+
hints.push(`should be shorter than ${length} character${length > 1 ? 's' : ''}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (currentSchema.pattern) {
|
|
50
|
+
hints.push(`should${logic ? '' : ' not'} match pattern ${JSON.stringify(currentSchema.pattern)}`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (currentSchema.format) {
|
|
54
|
+
hints.push(`should${logic ? '' : ' not'} match format ${JSON.stringify(currentSchema.format)}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (currentSchema.formatMinimum) {
|
|
58
|
+
hints.push(`should be ${currentSchema.formatExclusiveMinimum ? '>' : '>='} ${JSON.stringify(currentSchema.formatMinimum)}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (currentSchema.formatMaximum) {
|
|
62
|
+
hints.push(`should be ${currentSchema.formatExclusiveMaximum ? '<' : '<='} ${JSON.stringify(currentSchema.formatMaximum)}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return [type].concat(hints);
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @param {Schema} schema
|
|
69
|
+
* @param {boolean} logic
|
|
70
|
+
* @return {string[]}
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
module.exports.numberHints = function numberHints(schema, logic) {
|
|
75
|
+
const hints = [schema.type === 'integer' ? 'integer' : 'number'];
|
|
76
|
+
const range = new Range();
|
|
77
|
+
|
|
78
|
+
if (typeof schema.minimum === 'number') {
|
|
79
|
+
range.left(schema.minimum);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (typeof schema.exclusiveMinimum === 'number') {
|
|
83
|
+
range.left(schema.exclusiveMinimum, true);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (typeof schema.maximum === 'number') {
|
|
87
|
+
range.right(schema.maximum);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (typeof schema.exclusiveMaximum === 'number') {
|
|
91
|
+
range.right(schema.exclusiveMaximum, true);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const rangeFormat = range.format(logic);
|
|
95
|
+
|
|
96
|
+
if (rangeFormat) {
|
|
97
|
+
hints.push(rangeFormat);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (typeof schema.multipleOf === 'number') {
|
|
101
|
+
hints.push(`should${logic ? '' : ' not'} be multiple of ${schema.multipleOf}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return hints;
|
|
105
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _ajv = _interopRequireDefault(require("ajv"));
|
|
9
|
+
|
|
10
|
+
var _ajvKeywords = _interopRequireDefault(require("ajv-keywords"));
|
|
11
|
+
|
|
12
|
+
var _absolutePath = _interopRequireDefault(require("./keywords/absolutePath"));
|
|
13
|
+
|
|
14
|
+
var _ValidationError = _interopRequireDefault(require("./ValidationError"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
/** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */
|
|
19
|
+
|
|
20
|
+
/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */
|
|
21
|
+
|
|
22
|
+
/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */
|
|
23
|
+
|
|
24
|
+
/** @typedef {import("ajv").ErrorObject} ErrorObject */
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {Object} Extend
|
|
28
|
+
* @property {number=} formatMinimum
|
|
29
|
+
* @property {number=} formatMaximum
|
|
30
|
+
* @property {boolean=} formatExclusiveMinimum
|
|
31
|
+
* @property {boolean=} formatExclusiveMaximum
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend} Schema */
|
|
35
|
+
|
|
36
|
+
/** @typedef {ErrorObject & { children?: Array<ErrorObject>}} SchemaUtilErrorObject */
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @callback PostFormatter
|
|
40
|
+
* @param {string} formattedError
|
|
41
|
+
* @param {SchemaUtilErrorObject} error
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @typedef {Object} ValidationErrorConfiguration
|
|
47
|
+
* @property {string=} name
|
|
48
|
+
* @property {string=} baseDataPath
|
|
49
|
+
* @property {PostFormatter=} postFormatter
|
|
50
|
+
*/
|
|
51
|
+
const ajv = new _ajv.default({
|
|
52
|
+
allErrors: true,
|
|
53
|
+
verbose: true,
|
|
54
|
+
$data: true
|
|
55
|
+
});
|
|
56
|
+
(0, _ajvKeywords.default)(ajv, ['instanceof', 'formatMinimum', 'formatMaximum', 'patternRequired']); // Custom keywords
|
|
57
|
+
|
|
58
|
+
(0, _absolutePath.default)(ajv);
|
|
59
|
+
/**
|
|
60
|
+
* @param {Schema} schema
|
|
61
|
+
* @param {Array<object> | object} options
|
|
62
|
+
* @param {ValidationErrorConfiguration=} configuration
|
|
63
|
+
* @returns {void}
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
function validate(schema, options, configuration) {
|
|
67
|
+
let errors = [];
|
|
68
|
+
|
|
69
|
+
if (Array.isArray(options)) {
|
|
70
|
+
errors = Array.from(options, nestedOptions => validateObject(schema, nestedOptions));
|
|
71
|
+
errors.forEach((list, idx) => {
|
|
72
|
+
const applyPrefix =
|
|
73
|
+
/**
|
|
74
|
+
* @param {SchemaUtilErrorObject} error
|
|
75
|
+
*/
|
|
76
|
+
error => {
|
|
77
|
+
// eslint-disable-next-line no-param-reassign
|
|
78
|
+
error.dataPath = `[${idx}]${error.dataPath}`;
|
|
79
|
+
|
|
80
|
+
if (error.children) {
|
|
81
|
+
error.children.forEach(applyPrefix);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
list.forEach(applyPrefix);
|
|
86
|
+
});
|
|
87
|
+
errors = errors.reduce((arr, items) => {
|
|
88
|
+
arr.push(...items);
|
|
89
|
+
return arr;
|
|
90
|
+
}, []);
|
|
91
|
+
} else {
|
|
92
|
+
errors = validateObject(schema, options);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (errors.length > 0) {
|
|
96
|
+
throw new _ValidationError.default(errors, schema, configuration);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @param {Schema} schema
|
|
101
|
+
* @param {Array<object> | object} options
|
|
102
|
+
* @returns {Array<SchemaUtilErrorObject>}
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
function validateObject(schema, options) {
|
|
107
|
+
const compiledSchema = ajv.compile(schema);
|
|
108
|
+
const valid = compiledSchema(options);
|
|
109
|
+
if (valid) return [];
|
|
110
|
+
return compiledSchema.errors ? filterErrors(compiledSchema.errors) : [];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @param {Array<ErrorObject>} errors
|
|
114
|
+
* @returns {Array<SchemaUtilErrorObject>}
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
function filterErrors(errors) {
|
|
119
|
+
/** @type {Array<SchemaUtilErrorObject>} */
|
|
120
|
+
let newErrors = [];
|
|
121
|
+
|
|
122
|
+
for (const error of
|
|
123
|
+
/** @type {Array<SchemaUtilErrorObject>} */
|
|
124
|
+
errors) {
|
|
125
|
+
const {
|
|
126
|
+
dataPath
|
|
127
|
+
} = error;
|
|
128
|
+
/** @type {Array<SchemaUtilErrorObject>} */
|
|
129
|
+
|
|
130
|
+
let children = [];
|
|
131
|
+
newErrors = newErrors.filter(oldError => {
|
|
132
|
+
if (oldError.dataPath.includes(dataPath)) {
|
|
133
|
+
if (oldError.children) {
|
|
134
|
+
children = children.concat(oldError.children.slice(0));
|
|
135
|
+
} // eslint-disable-next-line no-undefined, no-param-reassign
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
oldError.children = undefined;
|
|
139
|
+
children.push(oldError);
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return true;
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
if (children.length) {
|
|
147
|
+
error.children = children;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
newErrors.push(error);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return newErrors;
|
|
154
|
+
} // TODO change after resolve https://github.com/microsoft/TypeScript/issues/34994
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
validate.ValidationError = _ValidationError.default;
|
|
158
|
+
validate.ValidateError = _ValidationError.default;
|
|
159
|
+
var _default = validate;
|
|
160
|
+
exports.default = _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_from": "schema-utils@^2.6.1",
|
|
3
|
+
"_id": "schema-utils@2.7.0",
|
|
4
|
+
"_inBundle": false,
|
|
5
|
+
"_integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==",
|
|
6
|
+
"_location": "/sass-loader/schema-utils",
|
|
7
|
+
"_phantomChildren": {},
|
|
8
|
+
"_requested": {
|
|
9
|
+
"type": "range",
|
|
10
|
+
"registry": true,
|
|
11
|
+
"raw": "schema-utils@^2.6.1",
|
|
12
|
+
"name": "schema-utils",
|
|
13
|
+
"escapedName": "schema-utils",
|
|
14
|
+
"rawSpec": "^2.6.1",
|
|
15
|
+
"saveSpec": null,
|
|
16
|
+
"fetchSpec": "^2.6.1"
|
|
17
|
+
},
|
|
18
|
+
"_requiredBy": [
|
|
19
|
+
"/sass-loader"
|
|
20
|
+
],
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz",
|
|
22
|
+
"_shasum": "17151f76d8eae67fbbf77960c33c676ad9f4efc7",
|
|
23
|
+
"_spec": "schema-utils@^2.6.1",
|
|
24
|
+
"_where": "/Users/fxy/Documents/DCloud/HbuilderX-plugins/alpha/uniapp-cli/node_modules/sass-loader",
|
|
25
|
+
"author": {
|
|
26
|
+
"name": "webpack Contrib",
|
|
27
|
+
"url": "https://github.com/webpack-contrib"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/webpack/schema-utils/issues"
|
|
31
|
+
},
|
|
32
|
+
"bundleDependencies": false,
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@types/json-schema": "^7.0.4",
|
|
35
|
+
"ajv": "^6.12.2",
|
|
36
|
+
"ajv-keywords": "^3.4.1"
|
|
37
|
+
},
|
|
38
|
+
"deprecated": false,
|
|
39
|
+
"description": "webpack Validation Utils",
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@babel/cli": "^7.10.1",
|
|
42
|
+
"@babel/core": "^7.10.1",
|
|
43
|
+
"@babel/preset-env": "^7.10.1",
|
|
44
|
+
"@commitlint/cli": "^8.3.5",
|
|
45
|
+
"@commitlint/config-conventional": "^8.3.4",
|
|
46
|
+
"@webpack-contrib/defaults": "^6.3.0",
|
|
47
|
+
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
|
48
|
+
"babel-jest": "^25.5.1",
|
|
49
|
+
"cross-env": "^6.0.3",
|
|
50
|
+
"del": "^5.1.0",
|
|
51
|
+
"del-cli": "^3.0.1",
|
|
52
|
+
"eslint": "^6.8.0",
|
|
53
|
+
"eslint-config-prettier": "^6.11.0",
|
|
54
|
+
"eslint-plugin-import": "^2.20.2",
|
|
55
|
+
"husky": "^4.2.5",
|
|
56
|
+
"jest": "^25.5.4",
|
|
57
|
+
"lint-staged": "^10.2.7",
|
|
58
|
+
"npm-run-all": "^4.1.5",
|
|
59
|
+
"prettier": "^1.19.1",
|
|
60
|
+
"standard-version": "^8.0.0",
|
|
61
|
+
"typescript": "^3.9.3"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">= 8.9.0"
|
|
65
|
+
},
|
|
66
|
+
"files": [
|
|
67
|
+
"dist",
|
|
68
|
+
"declarations"
|
|
69
|
+
],
|
|
70
|
+
"funding": {
|
|
71
|
+
"type": "opencollective",
|
|
72
|
+
"url": "https://opencollective.com/webpack"
|
|
73
|
+
},
|
|
74
|
+
"homepage": "https://github.com/webpack/schema-utils",
|
|
75
|
+
"keywords": [
|
|
76
|
+
"webpack"
|
|
77
|
+
],
|
|
78
|
+
"license": "MIT",
|
|
79
|
+
"main": "dist/index.js",
|
|
80
|
+
"name": "schema-utils",
|
|
81
|
+
"repository": {
|
|
82
|
+
"type": "git",
|
|
83
|
+
"url": "git+https://github.com/webpack/schema-utils.git"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"build": "npm-run-all -p \"build:**\"",
|
|
87
|
+
"build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files",
|
|
88
|
+
"build:types": "tsc --declaration --emitDeclarationOnly --outDir declarations && prettier \"declarations/**/*.ts\" --write",
|
|
89
|
+
"clean": "del-cli dist declarations",
|
|
90
|
+
"commitlint": "commitlint --from=master",
|
|
91
|
+
"defaults": "webpack-defaults",
|
|
92
|
+
"lint": "npm-run-all -l -p \"lint:**\"",
|
|
93
|
+
"lint:js": "eslint --cache .",
|
|
94
|
+
"lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different",
|
|
95
|
+
"lint:types": "tsc --pretty --noEmit",
|
|
96
|
+
"prebuild": "npm run clean",
|
|
97
|
+
"prepare": "npm run build",
|
|
98
|
+
"pretest": "npm run lint",
|
|
99
|
+
"release": "standard-version",
|
|
100
|
+
"security": "npm audit",
|
|
101
|
+
"start": "npm run build -- -w",
|
|
102
|
+
"test": "npm run test:coverage",
|
|
103
|
+
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
|
|
104
|
+
"test:only": "cross-env NODE_ENV=test jest",
|
|
105
|
+
"test:watch": "npm run test:only -- --watch"
|
|
106
|
+
},
|
|
107
|
+
"types": "declarations/index.d.ts",
|
|
108
|
+
"version": "2.7.0"
|
|
109
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# changes log
|
|
2
|
+
|
|
3
|
+
## 6.2.0
|
|
4
|
+
|
|
5
|
+
* Coerce numbers to strings when passed to semver.coerce()
|
|
6
|
+
* Add `rtl` option to coerce from right to left
|
|
7
|
+
|
|
8
|
+
## 6.1.3
|
|
9
|
+
|
|
10
|
+
* Handle X-ranges properly in includePrerelease mode
|
|
11
|
+
|
|
12
|
+
## 6.1.2
|
|
13
|
+
|
|
14
|
+
* Do not throw when testing invalid version strings
|
|
15
|
+
|
|
16
|
+
## 6.1.1
|
|
17
|
+
|
|
18
|
+
* Add options support for semver.coerce()
|
|
19
|
+
* Handle undefined version passed to Range.test
|
|
20
|
+
|
|
21
|
+
## 6.1.0
|
|
22
|
+
|
|
23
|
+
* Add semver.compareBuild function
|
|
24
|
+
* Support `*` in semver.intersects
|
|
25
|
+
|
|
26
|
+
## 6.0
|
|
27
|
+
|
|
28
|
+
* Fix `intersects` logic.
|
|
29
|
+
|
|
30
|
+
This is technically a bug fix, but since it is also a change to behavior
|
|
31
|
+
that may require users updating their code, it is marked as a major
|
|
32
|
+
version increment.
|
|
33
|
+
|
|
34
|
+
## 5.7
|
|
35
|
+
|
|
36
|
+
* Add `minVersion` method
|
|
37
|
+
|
|
38
|
+
## 5.6
|
|
39
|
+
|
|
40
|
+
* Move boolean `loose` param to an options object, with
|
|
41
|
+
backwards-compatibility protection.
|
|
42
|
+
* Add ability to opt out of special prerelease version handling with
|
|
43
|
+
the `includePrerelease` option flag.
|
|
44
|
+
|
|
45
|
+
## 5.5
|
|
46
|
+
|
|
47
|
+
* Add version coercion capabilities
|
|
48
|
+
|
|
49
|
+
## 5.4
|
|
50
|
+
|
|
51
|
+
* Add intersection checking
|
|
52
|
+
|
|
53
|
+
## 5.3
|
|
54
|
+
|
|
55
|
+
* Add `minSatisfying` method
|
|
56
|
+
|
|
57
|
+
## 5.2
|
|
58
|
+
|
|
59
|
+
* Add `prerelease(v)` that returns prerelease components
|
|
60
|
+
|
|
61
|
+
## 5.1
|
|
62
|
+
|
|
63
|
+
* Add Backus-Naur for ranges
|
|
64
|
+
* Remove excessively cute inspection methods
|
|
65
|
+
|
|
66
|
+
## 5.0
|
|
67
|
+
|
|
68
|
+
* Remove AMD/Browserified build artifacts
|
|
69
|
+
* Fix ltr and gtr when using the `*` range
|
|
70
|
+
* Fix for range `*` with a prerelease identifier
|