From af280c26d93be9e29f51e41ba5030e1f928c9601 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Wed, 16 Dec 2020 17:16:50 +0800 Subject: [PATCH] feat(cli): easycom --- .eslintrc.js | 5 +- api-extractor.json | 49 +++ package.json | 2 +- .../uni-cli-shared/__tests__/easycom.spec.ts | 68 ++++ .../example/components/test/test.vue | 0 .../example/components/test1/test1.nvue | 0 .../plugin/components/test/test.vue | 0 .../plugin/components/test2/test2.nvue | 0 packages/uni-cli-shared/package.json | 5 +- packages/uni-cli-shared/src/easycom.ts | 102 ++++++ packages/uni-cli-shared/src/index.ts | 2 + packages/uni-cli-shared/src/pagesJson.ts | 85 ----- .../src/transforms/addImport.ts | 25 ++ .../transforms/transformBuiltInComponent.ts | 17 + .../src/transforms/transformEasycom.ts | 18 ++ packages/uni-cli-shared/tsconfig.json | 22 +- .../uni-components/dist/uni-components.esm.js | 54 ++-- .../uni-components/lib/uni-components.css | 77 +++++ .../uni-components/lib/uni-components.esm.js | 197 ++++++++++++ packages/uni-components/src/index.ts | 1 - packages/uni-components/vite.config.ts | 32 ++ .../uni-core/src/view/plugin/longPress.ts | 3 +- packages/uni-h5/dist/uni-h5.esm.js | 9 +- packages/uni-mp-core/__tests__/hooks.spec.ts | 2 +- packages/uni-shared/api-extractor.json | 8 + packages/uni-shared/build.json | 5 +- packages/uni-shared/dist/uni-shared.cjs.js | 133 ++++++++ packages/uni-shared/dist/uni-shared.d.ts | 25 ++ .../{uni.shared.esm.js => uni-shared.esm.js} | 47 +-- packages/uni-shared/package.json | 5 +- packages/uni-shared/src/debounce.ts | 2 +- packages/uni-shared/src/tags.ts | 48 +-- packages/uni-shared/tsconfig.json | 18 ++ packages/vite-plugin-uni/package.json | 3 +- packages/vite-plugin-uni/src/config/index.ts | 1 + .../src/config/vueCompilerOptions.ts | 10 + packages/vite-plugin-uni/tsconfig.json | 20 +- rollup.config.js | 37 ++- scripts/apiExtractor.js | 37 +++ scripts/build.js | 23 +- tsconfig.node.json | 14 + yarn.lock | 296 +++++++++--------- 42 files changed, 1141 insertions(+), 366 deletions(-) create mode 100644 api-extractor.json create mode 100644 packages/uni-cli-shared/__tests__/easycom.spec.ts create mode 100644 packages/uni-cli-shared/__tests__/example/components/test/test.vue create mode 100644 packages/uni-cli-shared/__tests__/example/components/test1/test1.nvue create mode 100644 packages/uni-cli-shared/__tests__/example/uni_modules/plugin/components/test/test.vue create mode 100644 packages/uni-cli-shared/__tests__/example/uni_modules/plugin/components/test2/test2.nvue create mode 100644 packages/uni-cli-shared/src/easycom.ts delete mode 100644 packages/uni-cli-shared/src/pagesJson.ts create mode 100644 packages/uni-cli-shared/src/transforms/addImport.ts create mode 100644 packages/uni-cli-shared/src/transforms/transformBuiltInComponent.ts create mode 100644 packages/uni-cli-shared/src/transforms/transformEasycom.ts create mode 100644 packages/uni-components/lib/uni-components.css create mode 100644 packages/uni-components/lib/uni-components.esm.js create mode 100644 packages/uni-shared/api-extractor.json create mode 100644 packages/uni-shared/dist/uni-shared.cjs.js create mode 100644 packages/uni-shared/dist/uni-shared.d.ts rename packages/uni-shared/dist/{uni.shared.esm.js => uni-shared.esm.js} (83%) create mode 100644 packages/uni-shared/tsconfig.json create mode 100644 packages/vite-plugin-uni/src/config/vueCompilerOptions.ts create mode 100644 scripts/apiExtractor.js create mode 100644 tsconfig.node.json diff --git a/.eslintrc.js b/.eslintrc.js index 1ed99671d..16188ffbd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -43,7 +43,10 @@ module.exports = { }, // Packages targeting Node { - files: ['packages/{vue-cli-plugin-uni,vue-cli-plugin-hbuilderx}/**'], + files: [ + 'packages/{vue-cli-plugin-uni,vue-cli-plugin-hbuilderx}/**', + 'packages/*/vite.config.ts' + ], rules: { 'no-restricted-globals': ['error', ...DOMGlobals], 'no-restricted-syntax': 'off' diff --git a/api-extractor.json b/api-extractor.json new file mode 100644 index 000000000..ab9a6d370 --- /dev/null +++ b/api-extractor.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + "apiReport": { + "enabled": true, + "reportFolder": "/temp/" + }, + + "docModel": { + "enabled": true + }, + + "dtsRollup": { + "enabled": true + }, + + "tsdocMetadata": { + "enabled": false + }, + + "messages": { + "compilerMessageReporting": { + "default": { + "logLevel": "warning" + } + }, + + "extractorMessageReporting": { + "default": { + "logLevel": "warning", + "addToApiReportFile": true + }, + + "ae-missing-release-tag": { + "logLevel": "none" + } + }, + + "tsdocMessageReporting": { + "default": { + "logLevel": "warning" + }, + + "tsdoc-undefined-tag": { + "logLevel": "none" + } + } + } +} diff --git a/package.json b/package.json index cff1f4597..98b5cdd0a 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "dev": "node scripts/dev.js", "build": "node scripts/build.js", - "lint": "eslint --ext .ts packages/*/src/**", + "lint": "eslint packages/**/*.ts", "format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"", "ls-lint": "ls-lint", "test": "jest", diff --git a/packages/uni-cli-shared/__tests__/easycom.spec.ts b/packages/uni-cli-shared/__tests__/easycom.spec.ts new file mode 100644 index 000000000..a7c970585 --- /dev/null +++ b/packages/uni-cli-shared/__tests__/easycom.spec.ts @@ -0,0 +1,68 @@ +import path from 'path' + +import { initEasycoms, matchEasycom } from '../src/easycom' + +const rootDir = path.resolve(__dirname, 'example') +const dirs = [ + path.resolve(__dirname, 'example/components'), + path.resolve(__dirname, 'example/uni_modules/plugin/components') +] + +describe('easycom', () => { + test('initEasycoms with dirs', () => { + expect(initEasycoms({ dirs, rootDir })).toEqual([ + { + pattern: new RegExp('^test$'), + replacement: '@/components/test/test' + }, + { + pattern: new RegExp('^test1$'), + replacement: '@/components/test1/test1' + }, + { + pattern: new RegExp('^test2$'), + replacement: '@/uni_modules/plugin/components/test2/test2' + } + ]) + expect(matchEasycom('test')).toBe('@/components/test/test') + expect(matchEasycom('test1')).toBe('@/components/test1/test1') + expect(matchEasycom('test2')).toBe( + '@/uni_modules/plugin/components/test2/test2' + ) + }) + test('initEasycoms with custom', () => { + expect( + initEasycoms({ custom: { '^uni-(.*)': '@/components/uni-$1.vue' } }) + ).toEqual([ + { + pattern: new RegExp('^uni-(.*)'), + replacement: '@/components/uni-$1.vue' + } + ]) + expect(matchEasycom('test')).toBe(false) + expect(matchEasycom('uni-test1')).toBe('@/components/uni-test1.vue') + }) + test('initEasycoms with dirs and custom', () => { + expect( + initEasycoms({ + dirs, + rootDir, + custom: { '^test$': '@/components/uni-test.vue' } + }) + ).toEqual([ + { + pattern: new RegExp('^test$'), + replacement: '@/components/uni-test.vue' + }, + { + pattern: new RegExp('^test1$'), + replacement: '@/components/test1/test1' + }, + { + pattern: new RegExp('^test2$'), + replacement: '@/uni_modules/plugin/components/test2/test2' + } + ]) + expect(matchEasycom('test')).toBe('@/components/uni-test.vue') + }) +}) diff --git a/packages/uni-cli-shared/__tests__/example/components/test/test.vue b/packages/uni-cli-shared/__tests__/example/components/test/test.vue new file mode 100644 index 000000000..e69de29bb diff --git a/packages/uni-cli-shared/__tests__/example/components/test1/test1.nvue b/packages/uni-cli-shared/__tests__/example/components/test1/test1.nvue new file mode 100644 index 000000000..e69de29bb diff --git a/packages/uni-cli-shared/__tests__/example/uni_modules/plugin/components/test/test.vue b/packages/uni-cli-shared/__tests__/example/uni_modules/plugin/components/test/test.vue new file mode 100644 index 000000000..e69de29bb diff --git a/packages/uni-cli-shared/__tests__/example/uni_modules/plugin/components/test2/test2.nvue b/packages/uni-cli-shared/__tests__/example/uni_modules/plugin/components/test2/test2.nvue new file mode 100644 index 000000000..e69de29bb diff --git a/packages/uni-cli-shared/package.json b/packages/uni-cli-shared/package.json index e58187cd3..25e827be0 100644 --- a/packages/uni-cli-shared/package.json +++ b/packages/uni-cli-shared/package.json @@ -6,7 +6,8 @@ "types": "dist/index.d.ts", "files": [ "dist/**/*.js", - "dist/**/*.d.ts" + "dist/**/*.d.ts", + "lib" ], "buildOptions": { "bundler": "tsc" @@ -21,6 +22,8 @@ "url": "https://github.com/dcloudio/uni-app/issues" }, "dependencies": { + "@dcloudio/uni-shared": "^3.0.0", + "@vue/compiler-core": "^3.0.4", "strip-json-comments": "^3.1.1", "xregexp": "3.1.0" } diff --git a/packages/uni-cli-shared/src/easycom.ts b/packages/uni-cli-shared/src/easycom.ts new file mode 100644 index 000000000..eec985ef9 --- /dev/null +++ b/packages/uni-cli-shared/src/easycom.ts @@ -0,0 +1,102 @@ +import fs from 'fs' +import path from 'path' + +interface EasycomOption { + dirs?: string[] + rootDir?: string + custom?: EasycomCustom +} +interface EasycomMatcher { + pattern: RegExp + replacement: string +} +interface EasycomCustom { + [key: string]: string +} + +const easycoms: EasycomMatcher[] = [] + +const easycomsCache = new Map() +const easycomsInvalidCache = new Set() + +function clearEasycoms() { + easycoms.length = 0 + easycomsCache.clear() + easycomsInvalidCache.clear() +} + +export function initEasycoms({ dirs, rootDir, custom }: EasycomOption) { + clearEasycoms() + const easycomsObj = Object.create(null) + if (dirs && rootDir) { + Object.assign(easycomsObj, initAutoScanEasycoms(dirs, rootDir)) + } + if (custom) { + Object.assign(easycomsObj, custom) + } + Object.keys(easycomsObj).forEach(name => { + easycoms.push({ + pattern: new RegExp(name), + replacement: easycomsObj[name] + }) + }) + return easycoms +} + +export function matchEasycom(tag: string) { + let source = easycomsCache.get(tag) + if (source) { + return source + } + if (easycomsInvalidCache.has(tag)) { + return false + } + const matcher = easycoms.find(matcher => matcher.pattern.test(tag)) + if (!matcher) { + easycomsInvalidCache.add(tag) + return false + } + source = tag.replace(matcher.pattern, matcher.replacement) + easycomsCache.set(tag, source) + return source +} + +const isDir = (path: string) => fs.lstatSync(path).isDirectory() + +function initAutoScanEasycom( + dir: string, + rootDir: string +): Record { + const easycoms = Object.create(null) + if (!fs.existsSync(dir)) { + return easycoms + } + fs.readdirSync(dir).forEach(name => { + const folder = path.resolve(dir, name) + if (!isDir(folder)) { + return + } + const importDir = path.relative(rootDir, folder) + const files = fs.readdirSync(folder) + if (files.find(file => path.parse(file).name === name)) { + easycoms[`^${name}$`] = `@/${importDir}/${name}` + } + }) + return easycoms +} + +function initAutoScanEasycoms(dirs: string[], rootDir: string) { + return dirs.reduce>( + (easycoms: Record, dir: string) => { + const curEasycoms = initAutoScanEasycom(dir, rootDir) + Object.keys(curEasycoms).forEach(name => { + // Use the first component when name conflict + if (!easycoms[name]) { + easycoms[name] = curEasycoms[name] + } + }) + return easycoms + }, + Object.create(null) + ) +} diff --git a/packages/uni-cli-shared/src/index.ts b/packages/uni-cli-shared/src/index.ts index d04157047..e8a530005 100644 --- a/packages/uni-cli-shared/src/index.ts +++ b/packages/uni-cli-shared/src/index.ts @@ -1 +1,3 @@ export * from './json' +export * from './transforms/transformBuiltInComponent' +export * from './transforms/transformEasycom' diff --git a/packages/uni-cli-shared/src/pagesJson.ts b/packages/uni-cli-shared/src/pagesJson.ts deleted file mode 100644 index e9f75ea28..000000000 --- a/packages/uni-cli-shared/src/pagesJson.ts +++ /dev/null @@ -1,85 +0,0 @@ -type Data = Record - -interface Customizer { - (a: unknown, b: unknown, k: string): unknown -} - -const isArray = Array.isArray - -function isPlainObject(a: unknown): a is Data { - if (a === null) { - return false - } - return typeof a === 'object' -} - -function mergeWith(objects: Data[], customizer: Customizer) { - const [first, ...rest] = objects - let ret = first - rest.forEach(a => { - ret = mergeTo(ret, a, customizer) - }) - return ret -} - -function mergeTo(a: Data, b: Data, customizer: Customizer) { - const ret: Data = {} - Object.keys(a) - .concat(Object.keys(b)) - .forEach(k => { - const v = customizer(a[k], b[k], k) - ret[k] = typeof v === 'undefined' ? a[k] : v - }) - return ret -} - -function mergeWithRule(a: Data[], b: Data[], k: string, matchField: string) { - if (!isArray(a)) { - return a - } - const bMatchItems: Data[] = [] - const ret = a.map(aItem => { - if (!matchField) { - return aItem - } - // 暂不考虑重复 - const bMatchItem = b.find(bItem => aItem[matchField] === bItem[matchField]) - if (bMatchItem) { - bMatchItems.push(bMatchItem) - return mergeWith([aItem, bMatchItem], createCustomizer(k)) - } - return aItem - }) - return ret.concat(b.filter(bItem => !bMatchItems.includes(bItem))) -} - -function customizeArray(a: any[], b: any[], k: string) { - if (k === 'pages' || k === 'subPackages.pages') { - return mergeWithRule(a, b, k, 'path') - } else if (k === 'subPackages') { - return mergeWithRule(a, b, k, 'root') - } - return b -} - -function customizeObject(a: Data, b: Data, k: string) { - return mergeWith([a, b], createCustomizer(k)) -} - -function createCustomizer(key?: string): Customizer { - return function customizer(a: unknown, b: unknown, k: string) { - const newKey = key ? `${key}.${k}` : k - - if (isArray(a) && isArray(b)) { - return customizeArray(a, b, newKey) - } - if (isPlainObject(a) && isPlainObject(b)) { - return customizeObject(a, b, newKey) - } - return b - } -} - -export default function merge(pagesJsons: any[]) { - return mergeWith(pagesJsons, createCustomizer()) -} diff --git a/packages/uni-cli-shared/src/transforms/addImport.ts b/packages/uni-cli-shared/src/transforms/addImport.ts new file mode 100644 index 000000000..aa264dbfc --- /dev/null +++ b/packages/uni-cli-shared/src/transforms/addImport.ts @@ -0,0 +1,25 @@ +import { + ElementNode, + ConstantTypes, + TransformContext, + createSimpleExpression +} from '@vue/compiler-core' + +export function addImport( + path: string, + node: ElementNode, + context: TransformContext +) { + // remove resolveComponent + context.components.delete(node.tag) + // add import + const importsArray = Array.from(context.imports) + const existing = importsArray.find(i => i.path === path) + if (existing) { + return + } + context.imports.add({ + path, + exp: createSimpleExpression(name, false, node.loc, ConstantTypes.CAN_HOIST) + }) +} diff --git a/packages/uni-cli-shared/src/transforms/transformBuiltInComponent.ts b/packages/uni-cli-shared/src/transforms/transformBuiltInComponent.ts new file mode 100644 index 000000000..84d26f808 --- /dev/null +++ b/packages/uni-cli-shared/src/transforms/transformBuiltInComponent.ts @@ -0,0 +1,17 @@ +import { NodeTypes, NodeTransform } from '@vue/compiler-core' + +import { isBuiltInComponent } from '@dcloudio/uni-shared' + +import { addImport } from './addImport' + +const COMPONENTS_PATH = '@dcloudio/uni-h5/lib/' + +export const transformBuiltInComponent: NodeTransform = (node, context) => { + if (node.type !== NodeTypes.ELEMENT) { + return + } + const tag = node.tag + if (isBuiltInComponent(tag)) { + addImport(COMPONENTS_PATH + tag + '/index.js', node, context) + } +} diff --git a/packages/uni-cli-shared/src/transforms/transformEasycom.ts b/packages/uni-cli-shared/src/transforms/transformEasycom.ts new file mode 100644 index 000000000..e24cda127 --- /dev/null +++ b/packages/uni-cli-shared/src/transforms/transformEasycom.ts @@ -0,0 +1,18 @@ +import { NodeTypes, NodeTransform } from '@vue/compiler-core' + +import { matchEasycom } from '../easycom' + +import { addImport } from './addImport' + +export const transformEasycom: NodeTransform = (node, context) => { + if (node.type !== NodeTypes.ELEMENT) { + return + } + if (node.tag === 'match-media' && process.env.UNI_PLATFORM !== 'mp-weixin') { + node.tag = 'uni-match-media' + } + const path = matchEasycom(node.tag) + if (path) { + addImport(path, node, context) + } +} diff --git a/packages/uni-cli-shared/tsconfig.json b/packages/uni-cli-shared/tsconfig.json index b77ca0bf7..ac63115cc 100644 --- a/packages/uni-cli-shared/tsconfig.json +++ b/packages/uni-cli-shared/tsconfig.json @@ -1,17 +1,7 @@ { - "compilerOptions": { - "rootDir": "src", - "baseUrl": "./", - "target": "esnext", - "moduleResolution": "node", - "strict": true, - "declaration": true, - "noUnusedLocals": true, - "esModuleInterop": true, - "outDir": "./dist", - "module": "commonjs", - "lib": ["ESNext", "DOM"], - "sourceMap": false - } - } - \ No newline at end of file + "extends": "../../tsconfig.node.json", + "compilerOptions": { + "outDir": "dist" + }, + "include": ["src"] +} diff --git a/packages/uni-components/dist/uni-components.esm.js b/packages/uni-components/dist/uni-components.esm.js index 2c6d82e1f..b756f4221 100644 --- a/packages/uni-components/dist/uni-components.esm.js +++ b/packages/uni-components/dist/uni-components.esm.js @@ -538,7 +538,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { }, [ createVNode("div", { class: [{play: !$data.playing, pause: $data.playing}, "uni-audio-button"], - onClick: _cache[1] || (_cache[1] = (...args) => $options.trigger(...args)) + onClick: _cache[1] || (_cache[1] = (...args) => $options.trigger && $options.trigger(...args)) }, null, 2) ], 4), createVNode("div", _hoisted_2, [ @@ -1302,7 +1302,7 @@ var script$2 = { const _hoisted_1$2 = {class: "uni-checkbox-wrapper"}; function render$2(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createBlock("uni-checkbox", mergeProps({disabled: $props.disabled}, _ctx.$attrs, { - onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick(...args)) + onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick && $options._onClick(...args)) }), [ createVNode("div", _hoisted_1$2, [ createVNode("div", { @@ -2561,12 +2561,12 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) { autofocus: $props.focus, class: "uni-input-input", autocomplete: "off", - onFocus: _cache[2] || (_cache[2] = (...args) => $options._onFocus(...args)), - onBlur: _cache[3] || (_cache[3] = (...args) => $options._onBlur(...args)), - onInput: _cache[4] || (_cache[4] = withModifiers((...args) => $options._onInput(...args), ["stop"])), - onCompositionstart: _cache[5] || (_cache[5] = (...args) => $options._onComposition(...args)), - onCompositionend: _cache[6] || (_cache[6] = (...args) => $options._onComposition(...args)), - onKeyup: _cache[7] || (_cache[7] = withModifiers((...args) => $options._onKeyup(...args), ["stop"])) + onFocus: _cache[2] || (_cache[2] = (...args) => $options._onFocus && $options._onFocus(...args)), + onBlur: _cache[3] || (_cache[3] = (...args) => $options._onBlur && $options._onBlur(...args)), + onInput: _cache[4] || (_cache[4] = withModifiers((...args) => $options._onInput && $options._onInput(...args), ["stop"])), + onCompositionstart: _cache[5] || (_cache[5] = (...args) => $options._onComposition && $options._onComposition(...args)), + onCompositionend: _cache[6] || (_cache[6] = (...args) => $options._onComposition && $options._onComposition(...args)), + onKeyup: _cache[7] || (_cache[7] = withModifiers((...args) => $options._onKeyup && $options._onKeyup(...args), ["stop"])) }, null, 40, ["disabled", "type", "maxlength", "step", "autofocus"]), [ [vModelDynamic, _ctx.valueSync] ]) @@ -2609,7 +2609,7 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createBlock("uni-label", mergeProps({ class: {"uni-label-pointer": $options.pointer} }, _ctx.$attrs, { - onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick(...args)) + onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick && $options._onClick(...args)) }), [ renderSlot(_ctx.$slots, "default") ], 16); @@ -3752,15 +3752,15 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) { return $props.hoverClass && $props.hoverClass !== "none" ? (openBlock(), createBlock("uni-navigator", mergeProps({ key: 0, class: [_ctx.hovering ? $props.hoverClass : ""], - onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx._hoverTouchStart(...args)), - onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx._hoverTouchEnd(...args)), - onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx._hoverTouchCancel(...args)), - onClick: _cache[4] || (_cache[4] = (...args) => $options._onClick(...args)) + onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx._hoverTouchStart && _ctx._hoverTouchStart(...args)), + onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx._hoverTouchEnd && _ctx._hoverTouchEnd(...args)), + onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx._hoverTouchCancel && _ctx._hoverTouchCancel(...args)), + onClick: _cache[4] || (_cache[4] = (...args) => $options._onClick && $options._onClick(...args)) }, _ctx.$attrs), [ renderSlot(_ctx.$slots, "default") ], 16)) : (openBlock(), createBlock("uni-navigator", mergeProps({ key: 1, - onClick: _cache[5] || (_cache[5] = (...args) => $options._onClick(...args)) + onClick: _cache[5] || (_cache[5] = (...args) => $options._onClick && $options._onClick(...args)) }, _ctx.$attrs), [ renderSlot(_ctx.$slots, "default") ], 16)); @@ -3971,7 +3971,7 @@ var script$d = { const _hoisted_1$5 = {class: "uni-radio-wrapper"}; function render$d(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createBlock("uni-radio", mergeProps({disabled: $props.disabled}, _ctx.$attrs, { - onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick(...args)) + onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick && $options._onClick(...args)) }), [ createVNode("div", _hoisted_1$5, [ createVNode("div", { @@ -5721,7 +5721,7 @@ const _hoisted_1$8 = {class: "uni-slider-wrapper"}; const _hoisted_2$3 = {class: "uni-slider-tap-area"}; function render$h(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createBlock("uni-slider", mergeProps({ref: "uni-slider"}, _ctx.$attrs, { - onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick(...args)) + onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick && $options._onClick(...args)) }), [ createVNode("div", _hoisted_1$8, [ createVNode("div", _hoisted_2$3, [ @@ -5860,7 +5860,7 @@ var script$k = { const _hoisted_1$9 = {class: "uni-switch-wrapper"}; function render$j(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createBlock("uni-switch", mergeProps({disabled: $props.disabled}, _ctx.$attrs, { - onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick(...args)) + onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick && $options._onClick(...args)) }), [ createVNode("div", _hoisted_1$9, [ withDirectives(createVNode("div", { @@ -6143,12 +6143,12 @@ function render$k(_ctx, _cache, $props, $setup, $data, $options) { autofocus: $props.autoFocus || $props.focus, class: [{"uni-textarea-textarea-fix-margin": $data.fixMargin}, "uni-textarea-textarea"], style: {"overflow-y": $props.autoHeight ? "hidden" : "auto"}, - onCompositionstart: _cache[2] || (_cache[2] = (...args) => $options._compositionstart(...args)), - onCompositionend: _cache[3] || (_cache[3] = (...args) => $options._compositionend(...args)), - onInput: _cache[4] || (_cache[4] = withModifiers((...args) => $options._input(...args), ["stop"])), - onFocus: _cache[5] || (_cache[5] = (...args) => $options._focus(...args)), - onBlur: _cache[6] || (_cache[6] = (...args) => $options._blur(...args)), - onTouchstartPassive: _cache[7] || (_cache[7] = (...args) => $options._touchstart(...args)) + onCompositionstart: _cache[2] || (_cache[2] = (...args) => $options._compositionstart && $options._compositionstart(...args)), + onCompositionend: _cache[3] || (_cache[3] = (...args) => $options._compositionend && $options._compositionend(...args)), + onInput: _cache[4] || (_cache[4] = withModifiers((...args) => $options._input && $options._input(...args), ["stop"])), + onFocus: _cache[5] || (_cache[5] = (...args) => $options._focus && $options._focus(...args)), + onBlur: _cache[6] || (_cache[6] = (...args) => $options._blur && $options._blur(...args)), + onTouchstartPassive: _cache[7] || (_cache[7] = (...args) => $options._touchstart && $options._touchstart(...args)) }, null, 46, ["disabled", "maxlength", "autofocus"]), [ [vModelText, _ctx.valueSync] ]) @@ -6167,9 +6167,9 @@ function render$l(_ctx, _cache, $props, $setup, $data, $options) { return _ctx.hoverClass && _ctx.hoverClass !== "none" ? (openBlock(), createBlock("uni-view", mergeProps({ key: 0, class: [_ctx.hovering ? _ctx.hoverClass : ""], - onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx._hoverTouchStart(...args)), - onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx._hoverTouchEnd(...args)), - onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx._hoverTouchCancel(...args)) + onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx._hoverTouchStart && _ctx._hoverTouchStart(...args)), + onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx._hoverTouchEnd && _ctx._hoverTouchEnd(...args)), + onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx._hoverTouchCancel && _ctx._hoverTouchCancel(...args)) }, _ctx.$attrs), [ renderSlot(_ctx.$slots, "default") ], 16)) : (openBlock(), createBlock("uni-view", mergeProps({key: 1}, _ctx.$attrs), [ @@ -6177,4 +6177,4 @@ function render$l(_ctx, _cache, $props, $setup, $data, $options) { ], 16)); } script$m.render = render$l; -export {script as Audio, script$1 as Canvas, script$2 as Checkbox, script$3 as CheckboxGroup, script$4 as Editor, script$5 as Form, script$6 as Icon, script$7 as Image, script$8 as Input, script$9 as Label, script$a as MovableView, script$b as Navigator, script$c as Progress, script$d as Radio, script$e as RadioGroup, script$f as ResizeSensor, script$g as RichText, script$h as ScrollView, script$i as Slider, script$j as SwiperItem, script$k as Switch, script$l as Textarea, script$m as View, passiveOptions, supportsPassive$1 as supportsPassive}; +export {script as Audio, script$1 as Canvas, script$2 as Checkbox, script$3 as CheckboxGroup, script$4 as Editor, script$5 as Form, script$6 as Icon, script$7 as Image, script$8 as Input, script$9 as Label, script$a as MovableView, script$b as Navigator, script$c as Progress, script$d as Radio, script$e as RadioGroup, script$f as ResizeSensor, script$g as RichText, script$h as ScrollView, script$i as Slider, script$j as SwiperItem, script$k as Switch, script$l as Textarea, script$m as View}; diff --git a/packages/uni-components/lib/uni-components.css b/packages/uni-components/lib/uni-components.css new file mode 100644 index 000000000..72dcb2ce8 --- /dev/null +++ b/packages/uni-components/lib/uni-components.css @@ -0,0 +1,77 @@ + +uni-audio{ + display:none; +} +uni-audio[controls]{ + display:inline-block; +} +uni-audio[hidden]{ + display:none; +} +.uni-audio-default{ + max-width:100%; + min-width:302px; + height:65px; + background:#fcfcfc; + border:1px solid #e0e0e0; + border-radius:2.5px; + display:inline-block; + overflow:hidden; +} +.uni-audio-left{ + width:65px; + height:65px; + float:left; + background-color:#e6e6e6; + background-size:100% 100%; + background-position:50% 50%; +} +.uni-audio-button{ + width:24px; + height:24px; + margin:20.5px; + background-size:cover; +} +.uni-audio-button.play{ + background-image:url(data:image/png;base64,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); +} +.uni-audio-button.pause{ + background-image:url(data:image/png;base64,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); +} +.uni-audio-right{ + box-sizing:border-box; + height:65px; + margin-left:65px; + padding:11px 16.5px 13.5px 15px; + overflow:hidden; +} +.uni-audio-time{ + margin-top:3.5px; + height:16.5px; + font-size:12px; + color:#888888; + float:right; +} +.uni-audio-info{ + margin-right:70px; + overflow:hidden; +} +.uni-audio-name{ + height:22.5px; + line-height:22.5px; + margin-bottom:3.5px; + font-size:14px; + color:#353535; + overflow:hidden; + white-space:nowrap; + text-overflow:ellipsis; +} +.uni-audio-author{ + height:14.5px; + line-height:14.5px; + font-size:12px; + color:#888888; + overflow:hidden; + white-space:nowrap; + text-overflow:ellipsis; +} diff --git a/packages/uni-components/lib/uni-components.esm.js b/packages/uni-components/lib/uni-components.esm.js new file mode 100644 index 000000000..3b7eae9ba --- /dev/null +++ b/packages/uni-components/lib/uni-components.esm.js @@ -0,0 +1,197 @@ +import {isFunction} from "@vue/shared"; +import {openBlock, createBlock, mergeProps, createVNode, toDisplayString} from "vue"; +var subscriber = { + mounted() { + this._toggleListeners("subscribe", this.id); + this.$watch("id", (newId, oldId) => { + this._toggleListeners("unsubscribe", oldId, true); + this._toggleListeners("subscribe", newId, true); + }); + }, + beforeDestroy() { + this._toggleListeners("unsubscribe", this.id); + if (this._contextId) { + this._toggleListeners("unsubscribe", this._contextId); + } + }, + methods: { + _toggleListeners(type, id, watch) { + if (watch && !id) { + return; + } + if (!isFunction(this._handleSubscribe)) { + return; + } + UniViewJSBridge[type](this.$page.id + "-" + this.$options.name.replace(/VUni([A-Z])/, "$1").toLowerCase() + "-" + id, this._handleSubscribe); + }, + _getContextInfo() { + const id = `context-${this._uid}`; + if (!this._contextId) { + this._toggleListeners("subscribe", id); + this._contextId = id; + } + return { + name: this.$options.name.replace(/VUni([A-Z])/, "$1").toLowerCase(), + id, + page: this.$page.id + }; + } + } +}; +var script = { + name: "Audio", + mixins: [subscriber], + props: { + id: { + type: String, + default: "" + }, + src: { + type: String, + default: "" + }, + loop: { + type: [Boolean, String], + default: false + }, + controls: { + type: [Boolean, String], + default: false + }, + poster: { + type: String, + default: "" + }, + name: { + type: String, + default: "" + }, + author: { + type: String, + default: "" + } + }, + data() { + return { + playing: false, + currentTime: this.getTime(0) + }; + }, + watch: { + src(val) { + if (this.$refs.audio) { + this.$refs.audio.src = this.$getRealPath(val); + } + } + }, + mounted() { + const audio = this.$refs.audio; + audio.addEventListener("error", ($event) => { + this.playing = false; + this.$trigger("error", $event, {}); + }); + audio.addEventListener("play", ($event) => { + this.playing = true; + this.$trigger("play", $event, {}); + }); + audio.addEventListener("pause", ($event) => { + this.playing = false; + this.$trigger("pause", $event, {}); + }); + audio.addEventListener("ended", ($event) => { + this.playing = false; + this.$trigger("ended", $event, {}); + }); + audio.addEventListener("timeupdate", ($event) => { + var currentTime = audio.currentTime; + this.currentTime = this.getTime(currentTime); + var duration = audio.duration; + this.$trigger("timeupdate", $event, { + currentTime, + duration + }); + }); + audio.src = this.$getRealPath(this.src); + }, + methods: { + _handleSubscribe({ + type, + data = {} + }) { + var audio = this.$refs.audio; + switch (type) { + case "setSrc": + audio.src = this.$getRealPath(data.src); + this.$emit("update:src", data.src); + break; + case "play": + audio.play(); + break; + case "pause": + audio.pause(); + break; + case "seek": + audio.currentTime = data.position; + break; + } + }, + trigger() { + if (this.playing) { + this.$refs.audio.pause(); + } else { + this.$refs.audio.play(); + } + }, + getTime(time) { + var h = Math.floor(time / 3600); + var m = Math.floor(time % 3600 / 60); + var s = Math.floor(time % 3600 % 60); + h = (h < 10 ? "0" : "") + h; + m = (m < 10 ? "0" : "") + m; + s = (s < 10 ? "0" : "") + s; + var str = m + ":" + s; + if (h !== "00") { + str = h + ":" + str; + } + return str; + } + } +}; +const _hoisted_1 = {class: "uni-audio-default"}; +const _hoisted_2 = {class: "uni-audio-right"}; +const _hoisted_3 = {class: "uni-audio-time"}; +const _hoisted_4 = {class: "uni-audio-info"}; +const _hoisted_5 = {class: "uni-audio-name"}; +const _hoisted_6 = {class: "uni-audio-author"}; +function render(_ctx, _cache, $props, $setup, $data, $options) { + return openBlock(), createBlock("uni-audio", mergeProps({ + id: $props.id, + controls: !!$props.controls + }, _ctx.$attrs), [ + createVNode("audio", { + ref: "audio", + loop: $props.loop, + style: {display: "none"} + }, null, 8, ["loop"]), + createVNode("div", _hoisted_1, [ + createVNode("div", { + style: "background-image: url(" + _ctx.$getRealPath($props.poster) + ");", + class: "uni-audio-left" + }, [ + createVNode("div", { + class: [{play: !$data.playing, pause: $data.playing}, "uni-audio-button"], + onClick: _cache[1] || (_cache[1] = (...args) => $options.trigger && $options.trigger(...args)) + }, null, 2) + ], 4), + createVNode("div", _hoisted_2, [ + createVNode("div", _hoisted_3, toDisplayString($data.currentTime), 1), + createVNode("div", _hoisted_4, [ + createVNode("div", _hoisted_5, toDisplayString($props.name), 1), + createVNode("div", _hoisted_6, toDisplayString($props.author), 1) + ]) + ]) + ]) + ], 16, ["id", "controls"]); +} +script.render = render; +export default script; diff --git a/packages/uni-components/src/index.ts b/packages/uni-components/src/index.ts index efc63e757..cb64ac1b5 100644 --- a/packages/uni-components/src/index.ts +++ b/packages/uni-components/src/index.ts @@ -1,2 +1 @@ export * from './components' -export { supportsPassive, passiveOptions } from './helpers' diff --git a/packages/uni-components/vite.config.ts b/packages/uni-components/vite.config.ts index 8baf72d44..c6cec7b67 100644 --- a/packages/uni-components/vite.config.ts +++ b/packages/uni-components/vite.config.ts @@ -1,3 +1,6 @@ +import fs from 'fs' +import path from 'path' + import { isCustomElement } from '../uni-shared' export default { @@ -25,4 +28,33 @@ export default { return 'assets/[name]-[hash][extname]' } } + // configureBuild: buildComponents +} + +const components = fs + .readdirSync(path.resolve(__dirname, 'src/components')) + .filter(item => !/(^|\/)\.[^/.]/g.test(item)) + +function buildComponents(_config, builds) { + return once(() => { + const mainBuild = builds[0] + components.forEach(name => { + builds.push({ + // eslint-disabled no-restricted-syntax + ...mainBuild, + input: `src/components/${name}/index.vue`, + output: { + dir: `dist/${name}`, + file: `${name}.js` + }, + plugins: [...mainBuild.plugins] + }) + }) + console.log('builds.length', builds.length) + }) +} + +function once(fn) { + let called = false + return () => (!called && fn(), (called = true)) } diff --git a/packages/uni-core/src/view/plugin/longPress.ts b/packages/uni-core/src/view/plugin/longPress.ts index 60ebb9c1f..ce3decfb6 100644 --- a/packages/uni-core/src/view/plugin/longPress.ts +++ b/packages/uni-core/src/view/plugin/longPress.ts @@ -1,7 +1,8 @@ -import { passiveOptions } from '@dcloudio/uni-components' const LONGPRESS_TIMEOUT = 350 const LONGPRESS_THRESHOLD = 10 +const passiveOptions = { passive: true } // TODO caniuse? + let longPressTimer = 0 function clearLongPressTimer() { diff --git a/packages/uni-h5/dist/uni-h5.esm.js b/packages/uni-h5/dist/uni-h5.esm.js index 0a92e86dc..ffa557213 100644 --- a/packages/uni-h5/dist/uni-h5.esm.js +++ b/packages/uni-h5/dist/uni-h5.esm.js @@ -1,9 +1,9 @@ import {isFunction, extend, isPlainObject, isPromise, isArray, hasOwn} from "@vue/shared"; import {injectHook, openBlock, createBlock, createVNode, Fragment, renderList, toDisplayString, createCommentVNode, createTextVNode, Transition, withCtx, withModifiers, withDirectives, vShow, resolveComponent, KeepAlive, resolveDynamicComponent, mergeProps, renderSlot} from "vue"; -import {passiveOptions, Input} from "@dcloudio/uni-components"; -export * from "@dcloudio/uni-components"; import {TABBAR_HEIGHT, COMPONENT_NAME_PREFIX, isCustomElement, NAVBAR_HEIGHT} from "@dcloudio/uni-shared"; import {createWebHistory, createWebHashHistory, createRouter} from "vue-router"; +import {Input} from "@dcloudio/uni-components"; +export * from "@dcloudio/uni-components"; function applyOptions(options, instance2, publicThis) { Object.keys(options).forEach((name) => { if (name.indexOf("on") === 0) { @@ -90,6 +90,7 @@ function initBridge(namespace) { const ViewJSBridge = initBridge("view"); const LONGPRESS_TIMEOUT = 350; const LONGPRESS_THRESHOLD = 10; +const passiveOptions = {passive: true}; let longPressTimer = 0; function clearLongPressTimer() { if (longPressTimer) { @@ -2243,7 +2244,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) { createVNode("div", _hoisted_1$4, [ withDirectives(createVNode("div", { class: "uni-page-head-btn", - onClick: _cache[1] || (_cache[1] = (...args) => $options._back(...args)) + onClick: _cache[1] || (_cache[1] = (...args) => $options._back && $options._back(...args)) }, [ createVNode("i", { style: {color: _ctx.color, fontSize: "27px"}, @@ -2808,7 +2809,7 @@ var script$9 = { function render$9(_ctx, _cache, $props, $setup, $data, $options) { return openBlock(), createBlock("div", { class: "uni-async-error", - onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick(...args)) + onClick: _cache[1] || (_cache[1] = (...args) => $options._onClick && $options._onClick(...args)) }, " \u8FDE\u63A5\u670D\u52A1\u5668\u8D85\u65F6\uFF0C\u70B9\u51FB\u5C4F\u5E55\u91CD\u8BD5 "); } script$9.render = render$9; diff --git a/packages/uni-mp-core/__tests__/hooks.spec.ts b/packages/uni-mp-core/__tests__/hooks.spec.ts index 51d82360f..eb8fcb913 100644 --- a/packages/uni-mp-core/__tests__/hooks.spec.ts +++ b/packages/uni-mp-core/__tests__/hooks.spec.ts @@ -1,5 +1,5 @@ import { defineComponent } from 'vue' -import { initHooks, initUnknownHooks } from '../src/componentHooks' +import { initHooks, initUnknownHooks } from '../src/runtime/componentHooks' const vueBasicOptions = defineComponent({ onLoad() {}, diff --git a/packages/uni-shared/api-extractor.json b/packages/uni-shared/api-extractor.json new file mode 100644 index 000000000..c18cb2ed3 --- /dev/null +++ b/packages/uni-shared/api-extractor.json @@ -0,0 +1,8 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "./dist/packages//src/index.d.ts", + "dtsRollup": { + "publicTrimmedFilePath": "./dist/.d.ts" + } + } + \ No newline at end of file diff --git a/packages/uni-shared/build.json b/packages/uni-shared/build.json index d5da73fec..9c60fa1ae 100644 --- a/packages/uni-shared/build.json +++ b/packages/uni-shared/build.json @@ -1,5 +1,8 @@ { "input": { - "src/index.ts": "dist/uni.shared.esm.js" + "src/index.ts": ["dist/uni-shared.esm.js", "dist/uni-shared.cjs.js"] + }, + "compilerOptions": { + "declaration": true } } diff --git a/packages/uni-shared/dist/uni-shared.cjs.js b/packages/uni-shared/dist/uni-shared.cjs.js new file mode 100644 index 000000000..8e9580549 --- /dev/null +++ b/packages/uni-shared/dist/uni-shared.cjs.js @@ -0,0 +1,133 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var shared = require('@vue/shared'); + +const NAVBAR_HEIGHT = 44; +const TABBAR_HEIGHT = 50; +const COMPONENT_NAME_PREFIX = 'VUni'; + +function debounce(fn, delay) { + let timeout; + const newFn = function () { + clearTimeout(timeout); + const timerFn = () => fn.apply(this, arguments); + timeout = setTimeout(timerFn, delay); + }; + newFn.cancel = function () { + clearTimeout(timeout); + }; + return newFn; +} + +function plusReady(callback) { + if (typeof callback !== 'function') { + return; + } + if (window.plus) { + return callback(); + } + document.addEventListener('plusready', callback); +} + +const encode = encodeURIComponent; +function stringifyQuery(obj, encodeStr = encode) { + const res = obj + ? Object.keys(obj) + .map(key => { + let val = obj[key]; + if (typeof val === undefined || val === null) { + val = ''; + } + else if (shared.isPlainObject(val)) { + val = JSON.stringify(val); + } + return encodeStr(key) + '=' + encodeStr(val); + }) + .filter(x => x.length > 0) + .join('&') + : null; + return res ? `?${res}` : ''; +} + +const BUILT_IN_TAGS = [ + 'uni-ad', + 'uni-audio', + 'uni-button', + 'uni-camera', + 'uni-canvas', + 'uni-checkbox', + 'uni-checkbox-group', + 'uni-cover-image', + 'uni-cover-view', + 'uni-editor', + 'uni-form', + 'uni-functional-page-navigator', + 'uni-icon', + 'uni-image', + 'uni-input', + 'uni-label', + 'uni-live-player', + 'uni-live-pusher', + 'uni-map', + 'uni-movable-area', + 'uni-movable-view', + 'uni-navigator', + 'uni-official-account', + 'uni-open-data', + 'uni-picker', + 'uni-picker-view', + 'uni-picker-view-column', + 'uni-progress', + 'uni-radio', + 'uni-radio-group', + 'uni-rich-text', + 'uni-scroll-view', + 'uni-slider', + 'uni-swiper', + 'uni-swiper-item', + 'uni-switch', + 'uni-text', + 'uni-textarea', + 'uni-video', + 'uni-view', + 'uni-web-view' +]; +const TAGS = [ + 'uni-app', + 'uni-layout', + 'uni-content', + 'uni-main', + 'uni-top-window', + 'uni-left-window', + 'uni-right-window', + 'uni-tabbar', + 'uni-page', + 'uni-page-head', + 'uni-page-wrapper', + 'uni-page-body', + 'uni-page-refresh', + 'uni-actionsheet', + 'uni-modal', + 'uni-toast', + 'uni-resize-sensor', + 'uni-shadow-root' +]; +function isBuiltInComponent(tag) { + return BUILT_IN_TAGS.indexOf('uni-' + tag) !== -1; +} +function isCustomElement(tag) { + return TAGS.indexOf(tag) !== -1 || BUILT_IN_TAGS.indexOf(tag) !== -1; +} + +exports.BUILT_IN_TAGS = BUILT_IN_TAGS; +exports.COMPONENT_NAME_PREFIX = COMPONENT_NAME_PREFIX; +exports.NAVBAR_HEIGHT = NAVBAR_HEIGHT; +exports.TABBAR_HEIGHT = TABBAR_HEIGHT; +exports.TAGS = TAGS; +exports.debounce = debounce; +exports.isBuiltInComponent = isBuiltInComponent; +exports.isCustomElement = isCustomElement; +exports.plusReady = plusReady; +exports.stringifyQuery = stringifyQuery; diff --git a/packages/uni-shared/dist/uni-shared.d.ts b/packages/uni-shared/dist/uni-shared.d.ts new file mode 100644 index 000000000..31a2eaf85 --- /dev/null +++ b/packages/uni-shared/dist/uni-shared.d.ts @@ -0,0 +1,25 @@ + +export declare const BUILT_IN_TAGS: string[]; + +export declare const COMPONENT_NAME_PREFIX = "VUni"; + +export declare function debounce(fn: Function, delay: number): { + (this: any): void; + cancel(): void; +}; + +export declare function isBuiltInComponent(tag: string): boolean; + +export declare function isCustomElement(tag: string): boolean; + +export declare const NAVBAR_HEIGHT = 44; + +export declare function plusReady(callback: () => void): void; + +export declare function stringifyQuery(obj?: Record, encodeStr?: typeof encodeURIComponent): string; + +export declare const TABBAR_HEIGHT = 50; + +export declare const TAGS: string[]; + +export { } diff --git a/packages/uni-shared/dist/uni.shared.esm.js b/packages/uni-shared/dist/uni-shared.esm.js similarity index 83% rename from packages/uni-shared/dist/uni.shared.esm.js rename to packages/uni-shared/dist/uni-shared.esm.js index 4bca690a1..78bd3ab53 100644 --- a/packages/uni-shared/dist/uni.shared.esm.js +++ b/packages/uni-shared/dist/uni-shared.esm.js @@ -47,25 +47,7 @@ function stringifyQuery(obj, encodeStr = encode) { return res ? `?${res}` : ''; } -const TAGS = [ - 'uni-app', - 'uni-layout', - 'uni-content', - 'uni-main', - 'uni-top-window', - 'uni-left-window', - 'uni-right-window', - 'uni-tabbar', - 'uni-page', - 'uni-page-head', - 'uni-page-wrapper', - 'uni-page-body', - 'uni-page-refresh', - 'uni-actionsheet', - 'uni-modal', - 'uni-toast', - 'uni-resize-sensor', - 'uni-shadow-root', +const BUILT_IN_TAGS = [ 'uni-ad', 'uni-audio', 'uni-button', @@ -108,8 +90,31 @@ const TAGS = [ 'uni-view', 'uni-web-view' ]; +const TAGS = [ + 'uni-app', + 'uni-layout', + 'uni-content', + 'uni-main', + 'uni-top-window', + 'uni-left-window', + 'uni-right-window', + 'uni-tabbar', + 'uni-page', + 'uni-page-head', + 'uni-page-wrapper', + 'uni-page-body', + 'uni-page-refresh', + 'uni-actionsheet', + 'uni-modal', + 'uni-toast', + 'uni-resize-sensor', + 'uni-shadow-root' +]; +function isBuiltInComponent(tag) { + return BUILT_IN_TAGS.indexOf('uni-' + tag) !== -1; +} function isCustomElement(tag) { - return TAGS.indexOf(tag) !== -1; + return TAGS.indexOf(tag) !== -1 || BUILT_IN_TAGS.indexOf(tag) !== -1; } -export { COMPONENT_NAME_PREFIX, NAVBAR_HEIGHT, TABBAR_HEIGHT, TAGS, debounce, isCustomElement, plusReady, stringifyQuery }; +export { BUILT_IN_TAGS, COMPONENT_NAME_PREFIX, NAVBAR_HEIGHT, TABBAR_HEIGHT, TAGS, debounce, isBuiltInComponent, isCustomElement, plusReady, stringifyQuery }; diff --git a/packages/uni-shared/package.json b/packages/uni-shared/package.json index 9e33bc083..c55014152 100644 --- a/packages/uni-shared/package.json +++ b/packages/uni-shared/package.json @@ -2,8 +2,9 @@ "name": "@dcloudio/uni-shared", "version": "3.0.0", "description": "@dcloudio/uni-shared", - "main": "dist/uni.shared.esm.js", - "module": "dist/uni.shared.esm.js", + "main": "dist/uni-shared.cjs.js", + "module": "dist/uni-shared.esm.js", + "types": "dist/uni-shared.d.ts", "files": [ "dist" ], diff --git a/packages/uni-shared/src/debounce.ts b/packages/uni-shared/src/debounce.ts index bce0b1239..7ffdcfb5b 100644 --- a/packages/uni-shared/src/debounce.ts +++ b/packages/uni-shared/src/debounce.ts @@ -1,5 +1,5 @@ export function debounce(fn: Function, delay: number) { - let timeout: number + let timeout: any const newFn = function(this: any) { clearTimeout(timeout) const timerFn = () => fn.apply(this, arguments) diff --git a/packages/uni-shared/src/tags.ts b/packages/uni-shared/src/tags.ts index 8d68b5e74..354ff6b3c 100644 --- a/packages/uni-shared/src/tags.ts +++ b/packages/uni-shared/src/tags.ts @@ -1,23 +1,4 @@ -export const TAGS = [ - 'uni-app', - 'uni-layout', - 'uni-content', - 'uni-main', - 'uni-top-window', - 'uni-left-window', - 'uni-right-window', - 'uni-tabbar', - 'uni-page', - 'uni-page-head', - 'uni-page-wrapper', - 'uni-page-body', - 'uni-page-refresh', - 'uni-actionsheet', - 'uni-modal', - 'uni-toast', - 'uni-resize-sensor', - 'uni-shadow-root', - +export const BUILT_IN_TAGS = [ 'uni-ad', 'uni-audio', 'uni-button', @@ -61,6 +42,31 @@ export const TAGS = [ 'uni-web-view' ] +export const TAGS = [ + 'uni-app', + 'uni-layout', + 'uni-content', + 'uni-main', + 'uni-top-window', + 'uni-left-window', + 'uni-right-window', + 'uni-tabbar', + 'uni-page', + 'uni-page-head', + 'uni-page-wrapper', + 'uni-page-body', + 'uni-page-refresh', + 'uni-actionsheet', + 'uni-modal', + 'uni-toast', + 'uni-resize-sensor', + 'uni-shadow-root' +] + +export function isBuiltInComponent(tag: string) { + return BUILT_IN_TAGS.indexOf('uni-' + tag) !== -1 +} + export function isCustomElement(tag: string) { - return TAGS.indexOf(tag) !== -1 + return TAGS.indexOf(tag) !== -1 || BUILT_IN_TAGS.indexOf(tag) !== -1 } diff --git a/packages/uni-shared/tsconfig.json b/packages/uni-shared/tsconfig.json new file mode 100644 index 000000000..843865ac8 --- /dev/null +++ b/packages/uni-shared/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "outDir": "dist", + "sourceMap": false, + "target": "esnext", + "module": "esnext", + "moduleResolution": "node", + "allowJs": false, + "strict": true, + "noUnusedLocals": true, + "experimentalDecorators": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "removeComments": false, + "lib": ["ESNext", "DOM"] + }, + "include": ["src"] +} diff --git a/packages/vite-plugin-uni/package.json b/packages/vite-plugin-uni/package.json index 3015f4433..f61f993d3 100644 --- a/packages/vite-plugin-uni/package.json +++ b/packages/vite-plugin-uni/package.json @@ -21,7 +21,8 @@ }, "license": "Apache-2.0", "dependencies": { - "@rollup/pluginutils": "^4.0.0", + "@dcloudio/uni-cli-shared": "^3.0.0", + "@rollup/pluginutils": "^4.1.0", "estree-walker": "^2.0.1", "magic-string": "^0.25.7", "slash": "^3.0.0" diff --git a/packages/vite-plugin-uni/src/config/index.ts b/packages/vite-plugin-uni/src/config/index.ts index 94c9006c6..8ff5a40ff 100644 --- a/packages/vite-plugin-uni/src/config/index.ts +++ b/packages/vite-plugin-uni/src/config/index.ts @@ -3,3 +3,4 @@ export * from './resolvers' export * from './optimizeDeps' export * from './configureServer' export * from './rollupInputOptions' +export * from './vueCompilerOptions' diff --git a/packages/vite-plugin-uni/src/config/vueCompilerOptions.ts b/packages/vite-plugin-uni/src/config/vueCompilerOptions.ts new file mode 100644 index 000000000..fe63044d3 --- /dev/null +++ b/packages/vite-plugin-uni/src/config/vueCompilerOptions.ts @@ -0,0 +1,10 @@ +import { CompilerOptions } from '@vue/compiler-sfc' + +import { + transformEasycom, + transformBuiltInComponent +} from '@dcloudio/uni-cli-shared' + +export const vueCompilerOptions: CompilerOptions = { + nodeTransforms: [transformEasycom, transformBuiltInComponent] +} diff --git a/packages/vite-plugin-uni/tsconfig.json b/packages/vite-plugin-uni/tsconfig.json index d18378882..ac63115cc 100644 --- a/packages/vite-plugin-uni/tsconfig.json +++ b/packages/vite-plugin-uni/tsconfig.json @@ -1,19 +1,7 @@ { + "extends": "../../tsconfig.node.json", "compilerOptions": { - "rootDir": "src", - "baseUrl": "./", - "target": "esnext", - "moduleResolution": "node", - "strict": true, - "declaration": true, - "noUnusedLocals": true, - "esModuleInterop": true, - "outDir": "./dist", - "module": "commonjs", - "lib": ["ESNext", "DOM"], - "sourceMap": false, - "paths": { - "@dcloudio/uni-cli-shared": ["../uni-cli-shared"] - } - } + "outDir": "dist" + }, + "include": ["src"] } diff --git a/rollup.config.js b/rollup.config.js index 1cc836a01..e0f5eb41c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -15,23 +15,38 @@ const packageDir = path.resolve(packagesDir, process.env.TARGET) const resolve = p => path.resolve(packageDir, p) const pkg = require(resolve(`package.json`)) +// ensure TS checks only once for each build +let hasTSChecked = false + const configs = [] const buildOptions = require(resolve(`build.json`)) Object.keys(buildOptions.input).forEach(name => { - configs.push( - createConfig(name, { - file: resolve(buildOptions.input[name]), - format: `es` + const files = buildOptions.input[name] + if (Array.isArray(files)) { + files.forEach(file => { + configs.push( + createConfig(name, { + file: resolve(file), + format: file.includes('.cjs.') ? 'cjs' : 'es' + }) + ) }) - ) + } else { + configs.push( + createConfig(name, { + file: resolve(buildOptions.input[name]), + format: (buildOptions.output && buildOptions.output.format) || `es` + }) + ) + } }) export default configs function createConfig(entryFile, output, plugins = []) { - const shouldEmitDeclarations = process.env.TYPES != null + const shouldEmitDeclarations = process.env.TYPES != null && !hasTSChecked const tsPlugin = ts({ - check: process.env.NODE_ENV === 'production', + check: process.env.NODE_ENV === 'production' && !hasTSChecked, tsconfig: path.resolve(__dirname, 'tsconfig.json'), cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'), tsconfigOverride: { @@ -44,10 +59,16 @@ function createConfig(entryFile, output, plugins = []) { } }) + // we only need to check TS and generate declarations once for each build. + // it also seems to run into weird issues when checking multiple times + // during a single build. + hasTSChecked = true + const external = [ '@vue/shared', ...Object.keys(pkg.dependencies || {}), - ...Object.keys(pkg.peerDependencies || {}) + ...Object.keys(pkg.peerDependencies || {}), + ...(buildOptions.external || []) ] return { diff --git a/scripts/apiExtractor.js b/scripts/apiExtractor.js new file mode 100644 index 000000000..3e8edace3 --- /dev/null +++ b/scripts/apiExtractor.js @@ -0,0 +1,37 @@ +const fs = require('fs-extra') +const path = require('path') +const chalk = require('chalk') + +exports.extract = async function extract(target) { + const pkgDir = path.resolve(`packages/${target}`) + + console.log() + console.log( + chalk.bold(chalk.yellow(`Rolling up type definitions for ${target}...`)) + ) + + // build types + const { Extractor, ExtractorConfig } = require('@microsoft/api-extractor') + + const extractorConfigPath = path.resolve(pkgDir, `api-extractor.json`) + const extractorConfig = ExtractorConfig.loadFileAndPrepare( + extractorConfigPath + ) + const extractorResult = Extractor.invoke(extractorConfig, { + localBuild: true, + showVerboseMessages: true + }) + if (extractorResult.succeeded) { + console.log( + chalk.bold(chalk.green(`API Extractor completed successfully.`)) + ) + } else { + console.error( + `API Extractor completed with ${extractorResult.errorCount} errors` + + ` and ${extractorResult.warningCount} warnings` + ) + process.exitCode = 1 + } + + await fs.remove(`${pkgDir}/dist/packages`) +} diff --git a/scripts/build.js b/scripts/build.js index 123a5d70d..5b9bc632e 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -4,6 +4,9 @@ const chalk = require('chalk') const execa = require('execa') const { gzipSync } = require('zlib') const { compress } = require('brotli') + +const { extract } = require('./apiExtractor') + const { targets: allTargets, fuzzyMatchTarget } = require('./utils') const args = require('minimist')(process.argv.slice(2)) @@ -11,6 +14,7 @@ const targets = args._ const formats = args.formats || args.f const devOnly = args.devOnly || args.d const isRelease = args.release +const buildTypes = args.t || args.types || isRelease const buildAllMatching = args.all || args.a run() @@ -42,7 +46,7 @@ async function build(target) { } const bundler = pkg.buildOptions && pkg.buildOptions.bundler - + const types = buildTypes && pkg.types // if building a specific format, do not remove dist. if (!formats && bundler !== 'vite') { await fs.remove(`${pkgDir}/dist`) @@ -59,9 +63,13 @@ async function build(target) { } ) } else if (bundler === 'tsc') { - return await execa('tsc', ['--listEmittedFiles', '-p', pkgDir], { - stdio: 'inherit' - }) + return await execa( + 'tsc', + ['--listEmittedFiles', types ? `--declaration` : '', '-p', pkgDir], + { + stdio: 'inherit' + } + ) } await execa( @@ -69,10 +77,15 @@ async function build(target) { [ '-c', '--environment', - [`NODE_ENV:${env}`, `TARGET:${target}`].filter(Boolean).join(',') + [`NODE_ENV:${env}`, types ? `TYPES:true` : ``, `TARGET:${target}`] + .filter(Boolean) + .join(',') ], { stdio: 'inherit' } ) + if (types) { + await extract(target) + } } function checkAllSizes(targets) { diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 000000000..eb2d5e80e --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "esnext", + "moduleResolution": "node", + "strict": true, + "declaration": false, + "noUnusedLocals": true, + "esModuleInterop": true, + "outDir": "dist", + "module": "commonjs", + "lib": ["ESNext", "DOM"], + "sourceMap": false + } +} diff --git a/yarn.lock b/yarn.lock index 8d1c48164..c924b3408 100644 --- a/yarn.lock +++ b/yarn.lock @@ -280,14 +280,14 @@ minimist "^1.2.0" "@dcloudio/types@^2.0.0": - version "2.0.18" - resolved "https://registry.npmjs.org/@dcloudio/types/-/types-2.0.18.tgz#c62ffb2fce441081e4abee8d9e794bd38d308aeb" - integrity sha512-BQhuy8jI7ibxj7WtqY3GhT8Qd6WE0zKUZsjOFbEYLLw5RxBuLuKnJrPjn/ZLTVjIdQ+2uCT16PKprI/cOuWSUg== + version "2.0.19" + resolved "https://registry.npmjs.org/@dcloudio/types/-/types-2.0.19.tgz#f400332a3a40768b93540c352928db08c02c463d" + integrity sha512-qGY0STIqz7DRHgUp0v1wW61mQAvvjaTkyFsoJqTw0fbl6p72W4BmvaOewRve7JLToEHtgCZ0pOo7MUMVsumIJw== -"@eslint/eslintrc@^0.2.1": - version "0.2.1" - resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.1.tgz#f72069c330461a06684d119384435e12a5d76e3c" - integrity sha512-XRUeBZ5zBWLYgSANMpThFddrZZkEbGHgUdt5UJjZfnlN9BGCiUBrf+nvbRupSjMvqzwnQN0qwCmOxITt1cfywA== +"@eslint/eslintrc@^0.2.2": + version "0.2.2" + resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76" + integrity sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ== dependencies: ajv "^6.12.4" debug "^4.1.1" @@ -632,7 +632,7 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@rollup/pluginutils@^4.0.0", "@rollup/pluginutils@^4.1.0": +"@rollup/pluginutils@^4.1.0": version "4.1.0" resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.0.tgz#0dcc61c780e39257554feb7f77207dceca13c838" integrity sha512-TrBhfJkFxA+ER+ew2U2/fHbebhLT/l/2pRk0hfj9KusXUuRXd2v0R58AfaZK9VXDQ4TogOSEmICVrQAA3zFnHQ== @@ -727,9 +727,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.4", "@types/babel__traverse@^7.0.6": - version "7.0.16" - resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.16.tgz#0bbbf70c7bc4193210dd27e252c51260a37cd6a7" - integrity sha512-S63Dt4CZOkuTmpLGGWtT/mQdVORJOpx6SZWGVaP56dda/0Nx5nEe82K7/LAm8zYr6SfMq+1N2OreIOrHAx656w== + version "7.11.0" + resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.11.0.tgz#b9a1efa635201ba9bc850323a8793ee2d36c04a0" + integrity sha512-kSjgDMZONiIfSH1Nxcr5JIRMwUetDki63FSQfpTCz8ogF3Ulqm8+mr5f78dUYs6vMiB6gBusQqfQmBvHZj/lwg== dependencies: "@babel/types" "^7.3.0" @@ -742,9 +742,9 @@ "@types/node" "*" "@types/connect@*": - version "3.4.33" - resolved "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz#31610c901eca573b8713c3330abc6e6b9f588546" - integrity sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A== + version "3.4.34" + resolved "https://registry.npmjs.org/@types/connect/-/connect-3.4.34.tgz#170a40223a6d666006d93ca128af2beb1d9b1901" + integrity sha512-ePPA/JuI+X0vb+gSWlPKOY0NdNAie/rPUqX2GUPpbZwiKTkSPhjXWuee47E4MtE54QVzGCQMQkAL6JhV2E1+cQ== dependencies: "@types/node" "*" @@ -779,9 +779,9 @@ integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== "@types/express-serve-static-core@*": - version "4.17.14" - resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.14.tgz#cabf91debeeb3cb04b798e2cff908864e89b6106" - integrity sha512-uFTLwu94TfUFMToXNgRZikwPuZdOtDgs3syBtAIr/OXorL1kJqUJT9qCLnRZ5KBOWfZQikQ2xKgR2tnDj1OgDA== + version "4.17.15" + resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.15.tgz#7c3d37829a991da9a507c1efd44d97532e8909e3" + integrity sha512-pb71P0BrBAx7cQE+/7QnA1HTQUkdBKMlkPY7lHUMn0YvPJkL2UA+KW3BdWQ309IT+i9En/qm45ZxpjIcpgEhNQ== dependencies: "@types/node" "*" "@types/qs" "*" @@ -841,9 +841,9 @@ "@types/istanbul-lib-report" "*" "@types/jest@26.x", "@types/jest@^26.0.0": - version "26.0.15" - resolved "https://registry.npmjs.org/@types/jest/-/jest-26.0.15.tgz#12e02c0372ad0548e07b9f4e19132b834cb1effe" - integrity sha512-s2VMReFXRg9XXxV+CW9e5Nz8fH2K1aEhwgjUqPPbQd7g95T0laAcvLv032EhFHIa5GHsZ8W7iJEQVaJq6k3Gog== + version "26.0.18" + resolved "https://registry.npmjs.org/@types/jest/-/jest-26.0.18.tgz#3c5f9228e9ac15bd42f903f1acf2ad6ea5ed73d9" + integrity sha512-scDPs+mELZgsFetTgBSsIxKGrlitn9t/d2ecP+S1QSIGD+31fkMBEftLfOAX5k3tU06/0PjreJIQ+gWEbbHqpw== dependencies: jest-diff "^26.0.0" pretty-format "^26.0.0" @@ -895,9 +895,9 @@ integrity sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q== "@types/node@*": - version "14.14.10" - resolved "https://registry.npmjs.org/@types/node/-/node-14.14.10.tgz#5958a82e41863cfc71f2307b3748e3491ba03785" - integrity sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ== + version "14.14.11" + resolved "https://registry.npmjs.org/@types/node/-/node-14.14.11.tgz#fc25a4248a5e8d0837019b1d170146d07334abe0" + integrity sha512-BJ97wAUuU3NUiUCp44xzUFquQEvnk1wu7q4CMEUYKJWjdkr0YWYDsm4RFtAvxYsNjLsKcrFt6RvK8r+mnzMbEQ== "@types/node@10.17.13": version "10.17.13" @@ -967,9 +967,9 @@ integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw== "@types/yargs@^15.0.0": - version "15.0.10" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.10.tgz#0fe3c8173a0d5c3e780b389050140c3f5ea6ea74" - integrity sha512-z8PNtlhrj7eJNLmrAivM7rjBESG6JwC5xP3RVk12i/8HVP7Xnx/sEmERnRImyEuUaJfO942X0qMOYsoupaJbZQ== + version "15.0.11" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.11.tgz#361d7579ecdac1527687bcebf9946621c12ab78c" + integrity sha512-jfcNBxHFYJ4nPIacsi3woz1+kvUO6s1CyeEhtnDHBjHUMNj5UlW2GynmnSgiJJEdNg9yW5C8lfoNRZrHGv5EqA== dependencies: "@types/yargs-parser" "*" @@ -1021,36 +1021,36 @@ dependencies: eslint-visitor-keys "^1.1.0" -"@vue/compiler-core@3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.3.tgz#dbb4d5eb91f294038f0bed170a1c25f59f7dc74f" - integrity sha512-iWlRT8RYLmz7zkg84pTOriNUzjH7XACWN++ImFkskWXWeev29IKi7p76T9jKDaMZoPiGcUZ0k9wayuASWVxOwg== +"@vue/compiler-core@3.0.4": + version "3.0.4" + resolved "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.4.tgz#0122aca6eada4cb28b39ed930af917444755e330" + integrity sha512-snpMICsbWTZqBFnPB03qr4DtiSxVYfDF3DvbDSkN9Z9NTM8Chl8E/lYhKBSsvauq91DAWAh8PU3lr9vrLyQsug== dependencies: "@babel/parser" "^7.12.0" "@babel/types" "^7.12.0" - "@vue/shared" "3.0.3" + "@vue/shared" "3.0.4" estree-walker "^2.0.1" source-map "^0.6.1" -"@vue/compiler-dom@3.0.3", "@vue/compiler-dom@^3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.3.tgz#582ba30bc82da8409868bc1153ff0e0e2be617e5" - integrity sha512-6GdUbDPjsc0MDZGAgpi4lox+d+aW9/brscwBOLOFfy9wcI9b6yLPmBbjdIsJq3pYdJWbdvACdJ77avBBdHEP8A== +"@vue/compiler-dom@3.0.4", "@vue/compiler-dom@^3.0.3": + version "3.0.4" + resolved "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.4.tgz#834fd4b15c5698cf9f4505c2bfbccca058a843eb" + integrity sha512-FOxbHBIkkGjYQeTz1DlXQjS1Ms8EPXQWsdTdTPeohoS0KzCz6RiOjiAG+jLtMi6Nr5GX2h0TlCvcnI8mcsicFQ== dependencies: - "@vue/compiler-core" "3.0.3" - "@vue/shared" "3.0.3" + "@vue/compiler-core" "3.0.4" + "@vue/shared" "3.0.4" "@vue/compiler-sfc@^3.0.0-rc.9", "@vue/compiler-sfc@^3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.0.3.tgz#7fad9d40e139dd717713c0db701e1eb776f8349f" - integrity sha512-YocHSirye85kRVC4lU0+SE6uhrwGJzbhwkrqG4g6kmsAUopZ0qUjbICMlej5bYx2+AUz9yBIM7hpK8nIKFVFjg== + version "3.0.4" + resolved "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.0.4.tgz#2119fe1e68d2c268aafa20461c82c139a9adf8e0" + integrity sha512-brDn6HTuK6R3oBCjtMPPsIpyJEZFinlnxjtBXww/goFJOJBAU9CrsdegwyZItNnixCFUIg4CLv4Nj1Eg/eKlfg== dependencies: "@babel/parser" "^7.12.0" "@babel/types" "^7.12.0" - "@vue/compiler-core" "3.0.3" - "@vue/compiler-dom" "3.0.3" - "@vue/compiler-ssr" "3.0.3" - "@vue/shared" "3.0.3" + "@vue/compiler-core" "3.0.4" + "@vue/compiler-dom" "3.0.4" + "@vue/compiler-ssr" "3.0.4" + "@vue/shared" "3.0.4" consolidate "^0.16.0" estree-walker "^2.0.1" hash-sum "^2.0.0" @@ -1062,36 +1062,36 @@ postcss-selector-parser "^6.0.4" source-map "^0.6.1" -"@vue/compiler-ssr@3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.0.3.tgz#7d9e5c1b8c71d69865ac6c48d2e6eb2eecb68501" - integrity sha512-IjJMoHCiDk939Ix7Q5wrex59TVJr6JFQ95gf36f4G4UrVau0GGY/3HudnWT/6eyWJ7267+odqQs1uCZgDfL/Ww== +"@vue/compiler-ssr@3.0.4": + version "3.0.4" + resolved "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.0.4.tgz#ccbd1f55734d51d1402fad825ac102002a7a07c7" + integrity sha512-4aYWQEL4+LS4+D44K9Z7xMOWMEjBsz4Li9nMcj2rxRQ35ewK6uFPodvs6ORP60iBDSkwUFZoldFlNemQlu1BFw== dependencies: - "@vue/compiler-dom" "3.0.3" - "@vue/shared" "3.0.3" + "@vue/compiler-dom" "3.0.4" + "@vue/shared" "3.0.4" -"@vue/reactivity@3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.3.tgz#681ee01ceff9219bc4da6bbb7d9c97d452e44d1d" - integrity sha512-t39Qmc42MX7wJtf8L6tHlu17eP9Rc5w4aRnxpLHNWoaRxddv/7FBhWqusJ2Bwkk8ixFHOQeejcLMt5G469WYJw== +"@vue/reactivity@3.0.4": + version "3.0.4" + resolved "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.4.tgz#b6599dd8271a745960a03f05744ccf7991ba5d8d" + integrity sha512-AFTABrLhUYZY2on3ea9FxeXal7w3f6qIp9gT+/oG93H7dFTL5LvVnxygCopv7tvkIl/GSGQb/yK1D1gmXx1Pww== dependencies: - "@vue/shared" "3.0.3" + "@vue/shared" "3.0.4" -"@vue/runtime-core@3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.3.tgz#edab3c9ad122cf8afd034b174cd20c073fbf950a" - integrity sha512-Fd1JVnYI6at0W/2ERwJuTSq4S22gNt8bKEbICcvCAac7hJUZ1rylThlrhsvrgA+DVkWU01r0niNZQ4UddlNw7g== +"@vue/runtime-core@3.0.4": + version "3.0.4" + resolved "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.4.tgz#a5b9a001560b1fd8c01a43f68b764c555de7836c" + integrity sha512-qH9e4kqU7b3u1JewvLmGmoAGY+mnuBqz7aEKb2mhpEgwa1yFv496BRuUfMXXMCix3+TndUVMJ8jt41FSdNppwg== dependencies: - "@vue/reactivity" "3.0.3" - "@vue/shared" "3.0.3" + "@vue/reactivity" "3.0.4" + "@vue/shared" "3.0.4" -"@vue/runtime-dom@3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.3.tgz#5e3e5e5418b9defcac988d2be0cf65596fa2cc03" - integrity sha512-ytTvSlRaEYvLQUkkpruIBizWIwuIeHER0Ch/evO6kUaPLjZjX3NerVxA40cqJx8rRjb9keQso21U2Jcpk8GsTg== +"@vue/runtime-dom@3.0.4": + version "3.0.4" + resolved "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.4.tgz#6f81aec545f24511d2c28a315aa3391420b69c68" + integrity sha512-BGIoiTSESzWUhN0Ofi2X/q+HN8f6IUFmUEyyBGKbmx7DTAJNZhFfjqsepfXQrM5IGeTfJLB1ZEVyroDQJNXq3g== dependencies: - "@vue/runtime-core" "3.0.3" - "@vue/shared" "3.0.3" + "@vue/runtime-core" "3.0.4" + "@vue/shared" "3.0.4" csstype "^2.6.8" "@vue/shared@3.0.0-rc.5": @@ -1099,10 +1099,10 @@ resolved "https://registry.npmjs.org/@vue/shared/-/shared-3.0.0-rc.5.tgz#cea2378e3e37363ddc1f5dd158edc9c9b5b3fff0" integrity sha512-ZhcgGzBpp+pUzisZgQpM4ctIGgLpYjBj7/rZfbhEPxFHF/BuTV2jmhXvAl8aF9xDAejIcw85xCy92gDSwKtPag== -"@vue/shared@3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@vue/shared/-/shared-3.0.3.tgz#ef12ebff93a446df281e8a0fd765b5aea8e7745b" - integrity sha512-yGgkF7u4W0Dmwri9XdeY50kOowN4UIX7aBQ///jbxx37itpzVjK7QzvD3ltQtPfWaJDGBfssGL0wpAgwX9OJpQ== +"@vue/shared@3.0.4": + version "3.0.4" + resolved "https://registry.npmjs.org/@vue/shared/-/shared-3.0.4.tgz#6dc50f593bdfdeaa6183d1dbc15e2d45e7c6b8b3" + integrity sha512-Swfbz31AaMX48CpFl+YmIrqOH9MgJMTrltG9e26A4ZxYx9LjGuMV+41WnxFzS3Bc9nbrc6sDPM37G6nIT8NJSg== abab@^2.0.3: version "2.0.5" @@ -1132,7 +1132,7 @@ acorn-globals@^6.0.0: acorn "^7.1.1" acorn-walk "^7.1.1" -acorn-jsx@^5.2.0: +acorn-jsx@^5.3.1: version "5.3.1" resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== @@ -2333,9 +2333,9 @@ es-module-lexer@^0.3.25: integrity sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA== esbuild@^0.8.12: - version "0.8.17" - resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.17.tgz#1c16c6d5988dcfdcf27a7e1612b7fd05e1477c54" - integrity sha512-ReHap+Iyn5BQF0B8F3xrLwu+j57ri5uDUw2ej9XTPAuFDebYiWwRzBY4jhF610bklveXLbCGim/8/2wQKQlu1w== + version "0.8.21" + resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.8.21.tgz#c431f8af457795c2fecb1b2873cb8eaef4e5b53c" + integrity sha512-vRRx5MZmiekw2R7jK5BppvBUFCJA0Zkl0wYxrDmyUvMPBcQC/xJvxJUM4R+Hgjgb3gp5P1W655AsuoqDeQQDVw== escape-html@^1.0.3: version "1.0.3" @@ -2390,12 +2390,12 @@ eslint-visitor-keys@^2.0.0: integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== eslint@^7.2.0: - version "7.14.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-7.14.0.tgz#2d2cac1d28174c510a97b377f122a5507958e344" - integrity sha512-5YubdnPXrlrYAFCKybPuHIAH++PINe1pmKNc5wQRB9HSbqIK1ywAnntE3Wwua4giKu0bjligf1gLF6qxMGOYRA== + version "7.15.0" + resolved "https://registry.npmjs.org/eslint/-/eslint-7.15.0.tgz#eb155fb8ed0865fcf5d903f76be2e5b6cd7e0bc7" + integrity sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA== dependencies: "@babel/code-frame" "^7.0.0" - "@eslint/eslintrc" "^0.2.1" + "@eslint/eslintrc" "^0.2.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -2405,10 +2405,10 @@ eslint@^7.2.0: eslint-scope "^5.1.1" eslint-utils "^2.1.0" eslint-visitor-keys "^2.0.0" - espree "^7.3.0" + espree "^7.3.1" esquery "^1.2.0" esutils "^2.0.2" - file-entry-cache "^5.0.1" + file-entry-cache "^6.0.0" functional-red-black-tree "^1.0.1" glob-parent "^5.0.0" globals "^12.1.0" @@ -2432,13 +2432,13 @@ eslint@^7.2.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^7.3.0: - version "7.3.0" - resolved "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz#dc30437cf67947cf576121ebd780f15eeac72348" - integrity sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw== +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== dependencies: acorn "^7.4.0" - acorn-jsx "^5.2.0" + acorn-jsx "^5.3.1" eslint-visitor-keys "^1.3.0" esprima@^4.0.0, esprima@^4.0.1: @@ -2486,9 +2486,9 @@ estree-walker@^1.0.1: integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== estree-walker@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz#f8e030fb21cefa183b44b7ad516b747434e7a3e0" - integrity sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg== + version "2.0.2" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== esutils@^2.0.2: version "2.0.3" @@ -2698,12 +2698,12 @@ figures@^3.2.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== +file-entry-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a" + integrity sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA== dependencies: - flat-cache "^2.0.1" + flat-cache "^3.0.4" fill-range@^4.0.0: version "4.0.0" @@ -2739,19 +2739,18 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" + flatted "^3.1.0" + rimraf "^3.0.2" -flatted@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== +flatted@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz#a5d06b4a8b01e3a63771daa5cb7a1903e2e57067" + integrity sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA== follow-redirects@^1.0.0: version "1.13.0" @@ -3392,9 +3391,9 @@ is-generator-fn@^2.0.0: integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-generator-function@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz#d2132e529bb0000a7f80794d4bdf5cd5e5813522" - integrity sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw== + version "1.0.8" + resolved "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.8.tgz#dfb5c2b120e02b0a8d9d2c6806cd5621aa922f7b" + integrity sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ== is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.1" @@ -3960,9 +3959,9 @@ js-tokens@^4.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: - version "3.14.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" - integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== + version "3.14.1" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -4313,9 +4312,9 @@ lines-and-columns@^1.1.6: integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= lint-staged@^10.2.10: - version "10.5.2" - resolved "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.2.tgz#acfaa0093af3262aee3130b2e22438941530bdd1" - integrity sha512-e8AYR1TDlzwB8VVd38Xu2lXDZf6BcshVqKVuBQThDJRaJLobqKnpbm4dkwJ2puypQNbLr9KF/9mfA649mAGvjA== + version "10.5.3" + resolved "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.3.tgz#c682838b3eadd4c864d1022da05daa0912fb1da5" + integrity sha512-TanwFfuqUBLufxCc3RUtFEkFraSPNR3WzWcGF39R3f2J7S9+iF9W0KTVLfSy09lYGmZS5NDCxjNvhGMSJyFCWg== dependencies: chalk "^4.1.0" cli-truncate "^2.1.0" @@ -4620,7 +4619,7 @@ mkdirp@1.x: resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@^0.5.1, mkdirp@^0.5.4: +mkdirp@^0.5.4: version "0.5.5" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -4632,11 +4631,16 @@ ms@2.0.0: resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@2.1.2, ms@^2.1.1: +ms@2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + mute-stream@0.0.8: version "0.0.8" resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" @@ -5516,13 +5520,6 @@ reusify@^1.0.4: resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - rimraf@^2.6.1: version "2.7.1" resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -5530,7 +5527,7 @@ rimraf@^2.6.1: dependencies: glob "^7.1.3" -rimraf@^3.0.0: +rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -5630,9 +5627,9 @@ rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.8.2: estree-walker "^0.6.1" rollup@^2.16.1, rollup@^2.32.1: - version "2.34.0" - resolved "https://registry.npmjs.org/rollup/-/rollup-2.34.0.tgz#ecc7f1d4ce2cb88bb51bec2f56b984f3c35b8271" - integrity sha512-dW5iLvttZzdVehjEuNJ1bWvuMEJjOWGmnuFS82WeKHTGXDkRHQeq/ExdifkSyJv9dLcR86ysKRmrIDyR6O0X8g== + version "2.34.2" + resolved "https://registry.npmjs.org/rollup/-/rollup-2.34.2.tgz#fa73e05c64df587e9ed4dc80d7d4e7d4a43f8908" + integrity sha512-mvtQLqu3cNeoctS+kZ09iOPxrc1P1/Bt1z15enuQ5feyKOdM3MJAVFjjsygurDpSWn530xB4AlA83TWIzRstXA== optionalDependencies: fsevents "~2.1.2" @@ -5720,9 +5717,11 @@ semver-compare@^1.0.0: integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@~7.3.0: - version "7.3.2" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" - integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + version "7.3.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" + integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== + dependencies: + lru-cache "^6.0.0" semver@^6.0.0, semver@^6.3.0: version "6.3.0" @@ -6473,9 +6472,9 @@ uuid@^3.3.2: integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== uuid@^8.3.0: - version "8.3.1" - resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31" - integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg== + version "8.3.2" + resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== v8-compile-cache@^2.0.3: version "2.2.0" @@ -6585,18 +6584,18 @@ vlq@^0.2.2: integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== vue-router@^4.0.0-beta.6: - version "4.0.0-rc.6" - resolved "https://registry.npmjs.org/vue-router/-/vue-router-4.0.0-rc.6.tgz#8fa9e2d612c28ccf9b2bfa9421052932808ce24b" - integrity sha512-hVHC8A4/0yku1Z6+oUtX9odeHv78XwDI7putt1hd7os27P7mLabkjArN7f3TI3e/cz17MxAUz5Yp+m8ZE3sPsw== + version "4.0.1" + resolved "https://registry.npmjs.org/vue-router/-/vue-router-4.0.1.tgz#309240e50524b1e7d4e82e27f0a0fa25fe3d1d71" + integrity sha512-2C2nRxA2nCusgJyUpvcbd9Bnc9kACp/VLUCK4drXtgeRXHjQliZJcgjjP268vkGvvEKun9jjp8Ic1PpzUgbYKg== vue@^3.0.0-rc.5, vue@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/vue/-/vue-3.0.3.tgz#ad94a475e6ebbf3904673b6a0ae46e47b957bd72" - integrity sha512-BZG5meD5vLWdvfnRL5WqfDy+cnXO1X/SweModGUna78bdFPZW6+ZO1tU9p0acrskX3DKFcfSp2s4SZnMjABx6w== + version "3.0.4" + resolved "https://registry.npmjs.org/vue/-/vue-3.0.4.tgz#872c65c143f5717bd5387c61613d9f55f4cc0f43" + integrity sha512-2o+AiQF8sAupyhbyl3oxVCl3WCwC/n5NI7VMM+gVQ231qvSB8eI7sCBloloqDJK6yA367EEtmRSeSCf4sxCC+A== dependencies: - "@vue/compiler-dom" "3.0.3" - "@vue/runtime-dom" "3.0.3" - "@vue/shared" "3.0.3" + "@vue/compiler-dom" "3.0.4" + "@vue/runtime-dom" "3.0.4" + "@vue/shared" "3.0.4" w3c-hr-time@^1.0.2: version "1.0.2" @@ -6705,13 +6704,6 @@ write-file-atomic@^3.0.0: signal-exit "^3.0.2" typedarray-to-buffer "^3.1.5" -write@1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - ws@^6.1.0: version "6.2.1" resolved "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" @@ -6720,9 +6712,9 @@ ws@^6.1.0: async-limiter "~1.0.0" ws@^7.2.3, ws@^7.3.1: - version "7.4.0" - resolved "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz#a5dd76a24197940d4a8bb9e0e152bb4503764da7" - integrity sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ== + version "7.4.1" + resolved "https://registry.npmjs.org/ws/-/ws-7.4.1.tgz#a333be02696bd0e54cea0434e21dcc8a9ac294bb" + integrity sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ== xml-name-validator@^3.0.0: version "3.0.0" -- GitLab