diff --git a/.github/commit-convention.md b/.github/commit-convention.md index 62acda9..e98b85f 100644 --- a/.github/commit-convention.md +++ b/.github/commit-convention.md @@ -58,7 +58,7 @@ The **header** is mandatory and the **scope** of the header is optional. ### Revert -If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body, it should say: `This reverts commit .`, where the hash is the SHA of the commit being reverted. +If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body, it should say: `This reverts commit .`, where the hash is the SHA of the commit being reverted. ### Type diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..25fa621 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/examples/fire-start-vue/winfe.config.js b/examples/fire-start-vue/winfe.config.js index cbd6a7e..f23edea 100644 --- a/examples/fire-start-vue/winfe.config.js +++ b/examples/fire-start-vue/winfe.config.js @@ -2,7 +2,7 @@ const fileListPugin = require('@winning-plugin/webpack-filelist-export'); module.exports = { - chainWebpack: (config) => { + chainWebpack: config => { config .plugin('filePlugin') .after('html') @@ -10,11 +10,13 @@ module.exports = { { extract: true, jsExternals: [], - cssExternals: [`/web-public/libs/win-components/skin/index.css?t=${Date.now()}`] - } + cssExternals: [ + `/web-public/libs/win-components/skin/index.css?t=${Date.now()}`, + ], + }, ]); }, - sass: {} + sass: {}, // chainWebpack: (config) => { // console.log(config.module.rule('svg'), 'ssss'); // config.module diff --git a/examples/normal/.umirc.ts b/examples/normal/.umirc.ts index 2c94b1a..487578c 100644 --- a/examples/normal/.umirc.ts +++ b/examples/normal/.umirc.ts @@ -1,5 +1,3 @@ import { defineConfig } from 'vmi'; -export default defineConfig({ - -}); +export default defineConfig({}); diff --git a/package.json b/package.json index 3852a81..834d5f4 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "@types/node": "^14.0.23", "@umijs/core": "3.5.0-beta.4", "@umijs/plugin-analytics": "^0.2.2", - "@umijs/preset-dumi": "^1.1.6", "@umijs/test": "3.5.0-beta.4", "@umijs/test-utils": "3.5.0-beta.4", "@umijs/utils": "3.5.0-beta.4", @@ -64,7 +63,7 @@ "new-github-release-url": "^1.0.0", "npm-run-all": "^4.1.5", "open": "^8.0.2", - "prettier": "^2.3.0", + "prettier": "^2.3.2", "prettier-plugin-organize-imports": "^2.1.0", "umi-plugin-hire": "^1.0.3", "yorkie": "^2.0.0" diff --git a/packages/client/README.md b/packages/client/README.md index f49a753..ef54a18 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -1,24 +1,29 @@ # vue2 ## Project setup + ``` yarn install ``` ### Compiles and hot-reloads for development + ``` yarn serve ``` ### Compiles and minifies for production + ``` yarn build ``` ### Lints and fixes files + ``` yarn lint ``` ### Customize configuration + See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/packages/client/src/app.js b/packages/client/src/app.js index 6fd3740..fc2b475 100644 --- a/packages/client/src/app.js +++ b/packages/client/src/app.js @@ -1,48 +1,68 @@ -import Vue from 'vue' -import { decode, parsePath, withoutBase, withoutTrailingSlash, normalizeURL } from 'ufo' -import layouts from '@internal/layoutComponents' -import { getMatchedComponentsInstances, getChildrenComponentInstancesUsingFetch, promisify, globalHandleError, urlJoin, sanitizeComponent } from './utils' -import NuxtError from './components/nuxt-error.vue' -import NuxtLoading from './components/nuxt-loading.vue' -import NuxtBuildIndicator from './components/nuxt-build-indicator.vue' - +import Vue from 'vue'; +import { + decode, + parsePath, + withoutBase, + withoutTrailingSlash, + normalizeURL, +} from 'ufo'; +import layouts from '@internal/layoutComponents'; +import { + getMatchedComponentsInstances, + getChildrenComponentInstancesUsingFetch, + promisify, + globalHandleError, + urlJoin, + sanitizeComponent, +} from './utils'; +import NuxtError from './components/nuxt-error.vue'; +import NuxtLoading from './components/nuxt-loading.vue'; +import NuxtBuildIndicator from './components/nuxt-build-indicator.vue'; export default { - render (h, props) { - const loadingEl = h('NuxtLoading', { ref: 'loading' }) - - const layoutEl = h(this.layout || 'nuxt') - const templateEl = h('div', { - domProps: { - id: '__layout' + render(h, props) { + const loadingEl = h('NuxtLoading', { ref: 'loading' }); + + const layoutEl = h(this.layout || 'nuxt'); + const templateEl = h( + 'div', + { + domProps: { + id: '__layout', + }, + key: this.layoutName, }, - key: this.layoutName - }, [layoutEl]) - - const transitionEl = h('transition', { - props: { - name: 'layout', - mode: 'out-in' + [layoutEl], + ); + + const transitionEl = h( + 'transition', + { + props: { + name: 'layout', + mode: 'out-in', + }, + on: { + beforeEnter(el) { + // Ensure to trigger scroll event after calling scrollBehavior + window.$nuxt.$nextTick(() => { + window.$nuxt.$emit('triggerScroll'); + }); + }, + }, }, - on: { - beforeEnter (el) { - // Ensure to trigger scroll event after calling scrollBehavior - window.$nuxt.$nextTick(() => { - window.$nuxt.$emit('triggerScroll') - }) - } - } - }, [templateEl]) - - return h('div', { - domProps: { - id: '__nuxt' - } - }, [ - loadingEl, - h(NuxtBuildIndicator), - transitionEl - ]) + [templateEl], + ); + + return h( + 'div', + { + domProps: { + id: '__nuxt', + }, + }, + [loadingEl, h(NuxtBuildIndicator), transitionEl], + ); }, data: () => ({ @@ -51,151 +71,154 @@ export default { layout: null, layoutName: '', - nbFetching: 0 - }), + nbFetching: 0, + }), - beforeCreate () { - Vue.util.defineReactive(this, 'nuxt', this.$options.nuxt) + beforeCreate() { + Vue.util.defineReactive(this, 'nuxt', this.$options.nuxt); }, - created () { + created() { // Add this.$nuxt in child instances - this.$root.$options.$nuxt = this + this.$root.$options.$nuxt = this; if (process.client) { // add to window so we can listen when ready - window.$nuxt = this + window.$nuxt = this; - this.refreshOnlineStatus() + this.refreshOnlineStatus(); // Setup the listeners - window.addEventListener('online', this.refreshOnlineStatus) - window.addEventListener('offline', this.refreshOnlineStatus) + window.addEventListener('online', this.refreshOnlineStatus); + window.addEventListener('offline', this.refreshOnlineStatus); } // Add $nuxt.error() - this.error = this.nuxt.error + this.error = this.nuxt.error; // Add $nuxt.context - this.context = this.$options.context + this.context = this.$options.context; }, - async mounted () { - this.$loading = this.$refs.loading + async mounted() { + this.$loading = this.$refs.loading; }, watch: { - 'nuxt.err': 'errorChanged' + 'nuxt.err': 'errorChanged', }, computed: { - isOffline () { - return !this.isOnline + isOffline() { + return !this.isOnline; }, - isFetching () { - return this.nbFetching > 0 + isFetching() { + return this.nbFetching > 0; }, }, methods: { - refreshOnlineStatus () { + refreshOnlineStatus() { if (process.client) { if (typeof window.navigator.onLine === 'undefined') { // If the browser doesn't support connection status reports // assume that we are online because most apps' only react // when they now that the connection has been interrupted - this.isOnline = true + this.isOnline = true; } else { - this.isOnline = window.navigator.onLine + this.isOnline = window.navigator.onLine; } } }, - async refresh () { - const pages = getMatchedComponentsInstances(this.$route) + async refresh() { + const pages = getMatchedComponentsInstances(this.$route); if (!pages.length) { - return + return; } - this.$loading.start() + this.$loading.start(); - const promises = pages.map((page) => { - const p = [] + const promises = pages.map(page => { + const p = []; // Old fetch if (page.$options.fetch && page.$options.fetch.length) { - p.push(promisify(page.$options.fetch, this.context)) + p.push(promisify(page.$options.fetch, this.context)); } if (page.$fetch) { - p.push(page.$fetch()) + p.push(page.$fetch()); } else { // Get all component instance to call $fetch - for (const component of getChildrenComponentInstancesUsingFetch(page.$vnode.componentInstance)) { - p.push(component.$fetch()) + for (const component of getChildrenComponentInstancesUsingFetch( + page.$vnode.componentInstance, + )) { + p.push(component.$fetch()); } } if (page.$options.asyncData) { p.push( - promisify(page.$options.asyncData, this.context) - .then((newData) => { - for (const key in newData) { - Vue.set(page.$data, key, newData[key]) - } - }) - ) + promisify(page.$options.asyncData, this.context).then(newData => { + for (const key in newData) { + Vue.set(page.$data, key, newData[key]); + } + }), + ); } - return Promise.all(p) - }) + return Promise.all(p); + }); try { - await Promise.all(promises) + await Promise.all(promises); } catch (error) { - this.$loading.fail(error) - globalHandleError(error) - this.error(error) + this.$loading.fail(error); + globalHandleError(error); + this.error(error); } - this.$loading.finish() + this.$loading.finish(); }, - errorChanged () { + errorChanged() { if (this.nuxt.err) { if (this.$loading) { if (this.$loading.fail) { - this.$loading.fail(this.nuxt.err) + this.$loading.fail(this.nuxt.err); } if (this.$loading.finish) { - this.$loading.finish() + this.$loading.finish(); } } let errorLayout = (NuxtError.options || NuxtError).layout; if (typeof errorLayout === 'function') { - errorLayout = errorLayout(this.context) + errorLayout = errorLayout(this.context); } - this.setLayout(errorLayout) + this.setLayout(errorLayout); } }, - setLayout (layout) { - if(layout && typeof layout !== 'string') { - throw new Error('[nuxt] Avoid using non-string value as layout property.') + setLayout(layout) { + if (layout && typeof layout !== 'string') { + throw new Error( + '[nuxt] Avoid using non-string value as layout property.', + ); } if (!layout || !layouts['_' + layout]) { - layout = 'default' + layout = 'default'; } - this.layoutName = layout - this.layout = layouts['_' + layout] - return this.layout + this.layoutName = layout; + this.layout = layouts['_' + layout]; + return this.layout; }, - loadLayout (layout) { + loadLayout(layout) { if (!layout || !layouts['_' + layout]) { - layout = 'default' + layout = 'default'; } - return Promise.resolve(layouts['_' + layout]) + return Promise.resolve(layouts['_' + layout]); }, }, components: { - NuxtLoading - } -} + NuxtLoading, + }, +}; diff --git a/packages/client/src/client.js b/packages/client/src/client.js index baa4a88..4563428 100644 --- a/packages/client/src/client.js +++ b/packages/client/src/client.js @@ -1,13 +1,12 @@ - -import '@@/internal/app-enhancers/addEntryImportsAhead' +import '@@/internal/app-enhancers/addEntryImportsAhead'; import '@@/core/polyfill'; // import '@@/core/devScripts'; import { plugin } from '@@/core/plugin'; import '@@/core/pluginRegister'; import { ApplyPluginsType } from '@winfe/runtime'; -import Vue from 'vue' -import fetch from 'unfetch' -import middleware from './middleware.js' +import Vue from 'vue'; +import fetch from 'unfetch'; +import middleware from './middleware.js'; import { applyAsyncData, promisify, @@ -23,555 +22,606 @@ import { getQueryDiff, globalHandleError, isSamePath, - urlJoin -} from './utils.js' -import { createApp, NuxtError } from './index.js' -import fetchMixin from './mixins/fetch.client' -import NuxtLink from './components/nuxt-link.client.js' // should be included after ./index.js + urlJoin, +} from './utils.js'; +import { createApp, NuxtError } from './index.js'; +import fetchMixin from './mixins/fetch.client'; +import NuxtLink from './components/nuxt-link.client.js'; // should be included after ./index.js // Fetch mixin if (!Vue.__nuxt__fetch__mixin__) { - Vue.mixin(fetchMixin) - Vue.__nuxt__fetch__mixin__ = true + Vue.mixin(fetchMixin); + Vue.__nuxt__fetch__mixin__ = true; } // Component: -Vue.component(NuxtLink.name, NuxtLink) -Vue.component('NLink', NuxtLink) +Vue.component(NuxtLink.name, NuxtLink); +Vue.component('NLink', NuxtLink); -if (!global.fetch) { global.fetch = fetch } +if (!global.fetch) { + global.fetch = fetch; +} // Global shared references -let _lastPaths = [] -let app -let router +let _lastPaths = []; +let app; +let router; // Try to rehydrate SSR data from window -const NUXT = window.__NUXT__ || {} +const NUXT = window.__NUXT__ || {}; -const $config = NUXT.config || {} +const $config = NUXT.config || {}; if ($config._app) { - __webpack_public_path__ = urlJoin($config._app.cdnURL, $config._app.assetsPath) + __webpack_public_path__ = urlJoin( + $config._app.cdnURL, + $config._app.assetsPath, + ); } -Object.assign(Vue.config, {"silent":false,"performance":true}) +Object.assign(Vue.config, { silent: false, performance: true }); -const logs = NUXT.logs || [] - if (logs.length > 0) { - const ssrLogStyle = 'background: #2E495E;border-radius: 0.5em;color: white;font-weight: bold;padding: 2px 0.5em;' - console.group && console.group ('%cNuxt SSR', ssrLogStyle) - logs.forEach(logObj => (console[logObj.type] || console.log)(...logObj.args)) - delete NUXT.logs - console.groupEnd && console.groupEnd() +const logs = NUXT.logs || []; +if (logs.length > 0) { + const ssrLogStyle = + 'background: #2E495E;border-radius: 0.5em;color: white;font-weight: bold;padding: 2px 0.5em;'; + console.group && console.group('%cNuxt SSR', ssrLogStyle); + logs.forEach(logObj => (console[logObj.type] || console.log)(...logObj.args)); + delete NUXT.logs; + console.groupEnd && console.groupEnd(); } // Setup global Vue error handler if (!Vue.config.$nuxt) { - const defaultErrorHandler = Vue.config.errorHandler + const defaultErrorHandler = Vue.config.errorHandler; Vue.config.errorHandler = async (err, vm, info, ...rest) => { // Call other handler if exist - let handled = null + let handled = null; if (typeof defaultErrorHandler === 'function') { - handled = defaultErrorHandler(err, vm, info, ...rest) + handled = defaultErrorHandler(err, vm, info, ...rest); } if (handled === true) { - return handled + return handled; } if (vm && vm.$root) { - const nuxtApp = Object.keys(Vue.config.$nuxt) - .find(nuxtInstance => vm.$root[nuxtInstance]) + const nuxtApp = Object.keys(Vue.config.$nuxt).find( + nuxtInstance => vm.$root[nuxtInstance], + ); // Show Nuxt Error Page if (nuxtApp && vm.$root[nuxtApp].error && info !== 'render function') { - const currentApp = vm.$root[nuxtApp] + const currentApp = vm.$root[nuxtApp]; // Load error layout - let layout = (NuxtError.options || NuxtError).layout + let layout = (NuxtError.options || NuxtError).layout; if (typeof layout === 'function') { - layout = layout(currentApp.context) + layout = layout(currentApp.context); } if (layout) { - await currentApp.loadLayout(layout).catch(() => {}) + await currentApp.loadLayout(layout).catch(() => {}); } - currentApp.setLayout(layout) + currentApp.setLayout(layout); - currentApp.error(err) + currentApp.error(err); } } if (typeof defaultErrorHandler === 'function') { - return handled + return handled; } // Log to console if (process.env.NODE_ENV !== 'production') { - console.error(err) + console.error(err); } else { - console.error(err.message || err) + console.error(err.message || err); } - } - Vue.config.$nuxt = {} + }; + Vue.config.$nuxt = {}; } -Vue.config.$nuxt.$nuxt = true +Vue.config.$nuxt.$nuxt = true; -const errorHandler = Vue.config.errorHandler || console.error +const errorHandler = Vue.config.errorHandler || console.error; // Create and mount App -createApp(null, NUXT.config).then(mountApp).catch(errorHandler) +createApp(null, NUXT.config) + .then(mountApp) + .catch(errorHandler); -function componentOption (component, key, ...args) { +function componentOption(component, key, ...args) { if (!component || !component.options || !component.options[key]) { - return {} + return {}; } - const option = component.options[key] + const option = component.options[key]; if (typeof option === 'function') { - return option(...args) + return option(...args); } - return option + return option; } -function mapTransitions (toComponents, to, from) { - const componentTransitions = (component) => { - const transition = componentOption(component, 'transition', to, from) || {} - return (typeof transition === 'string' ? { name: transition } : transition) - } +function mapTransitions(toComponents, to, from) { + const componentTransitions = component => { + const transition = componentOption(component, 'transition', to, from) || {}; + return typeof transition === 'string' ? { name: transition } : transition; + }; - const fromComponents = from ? getMatchedComponents(from) : [] - const maxDepth = Math.max(toComponents.length, fromComponents.length) + const fromComponents = from ? getMatchedComponents(from) : []; + const maxDepth = Math.max(toComponents.length, fromComponents.length); - const mergedTransitions = [] - for (let i=0; i typeof toTransitions[key] !== 'undefined' && !key.toLowerCase().includes('leave')) - .forEach((key) => { transitions[key] = toTransitions[key] }) + .filter( + key => + typeof toTransitions[key] !== 'undefined' && + !key.toLowerCase().includes('leave'), + ) + .forEach(key => { + transitions[key] = toTransitions[key]; + }); - mergedTransitions.push(transitions) + mergedTransitions.push(transitions); } - return mergedTransitions + return mergedTransitions; } -async function loadAsyncComponents (to, from, next) { +async function loadAsyncComponents(to, from, next) { // Check if route changed (this._routeChanged), only if the page is not an error (for validate()) - this._routeChanged = Boolean(app.nuxt.err) || from.name !== to.name - this._paramChanged = !this._routeChanged && from.path !== to.path - this._queryChanged = !this._paramChanged && from.fullPath !== to.fullPath - this._diffQuery = (this._queryChanged ? getQueryDiff(to.query, from.query) : []) - - if ((this._routeChanged || this._paramChanged) && this.$loading.start && !this.$loading.manual) { - this.$loading.start() + this._routeChanged = Boolean(app.nuxt.err) || from.name !== to.name; + this._paramChanged = !this._routeChanged && from.path !== to.path; + this._queryChanged = !this._paramChanged && from.fullPath !== to.fullPath; + this._diffQuery = this._queryChanged + ? getQueryDiff(to.query, from.query) + : []; + + if ( + (this._routeChanged || this._paramChanged) && + this.$loading.start && + !this.$loading.manual + ) { + this.$loading.start(); } try { if (this._queryChanged) { const Components = await resolveRouteComponents( to, - (Component, instance) => ({ Component, instance }) - ) + (Component, instance) => ({ Component, instance }), + ); // Add a marker on each component that it needs to refresh or not const startLoader = Components.some(({ Component, instance }) => { - const watchQuery = Component.options.watchQuery + const watchQuery = Component.options.watchQuery; if (watchQuery === true) { - return true + return true; } if (Array.isArray(watchQuery)) { - return watchQuery.some(key => this._diffQuery[key]) + return watchQuery.some(key => this._diffQuery[key]); } if (typeof watchQuery === 'function') { - return watchQuery.apply(instance, [to.query, from.query]) + return watchQuery.apply(instance, [to.query, from.query]); } - return false - }) + return false; + }); if (startLoader && this.$loading.start && !this.$loading.manual) { - this.$loading.start() + this.$loading.start(); } } // Call next() - next() + next(); } catch (error) { - const err = error || {} - const statusCode = err.statusCode || err.status || (err.response && err.response.status) || 500 - const message = err.message || '' + const err = error || {}; + const statusCode = + err.statusCode || + err.status || + (err.response && err.response.status) || + 500; + const message = err.message || ''; // Handle chunk loading errors // This may be due to a new deployment or a network problem if (/^Loading( CSS)? chunk (\d)+ failed\./.test(message)) { - window.location.reload(true /* skip cache */) - return // prevent error page blinking for user + window.location.reload(true /* skip cache */); + return; // prevent error page blinking for user } - this.error({ statusCode, message }) - this.$nuxt.$emit('routeChanged', to, from, err) - next() + this.error({ statusCode, message }); + this.$nuxt.$emit('routeChanged', to, from, err); + next(); } } -function applySSRData (Component, ssrData) { +function applySSRData(Component, ssrData) { if (NUXT.serverRendered && ssrData) { - applyAsyncData(Component, ssrData) + applyAsyncData(Component, ssrData); } - Component._Ctor = Component - return Component + Component._Ctor = Component; + return Component; } // Get matched components -function resolveComponents (route) { +function resolveComponents(route) { return flatMapComponents(route, async (Component, _, match, key, index) => { // If component is not resolved yet, resolve it if (typeof Component === 'function' && !Component.options) { - Component = await Component() + Component = await Component(); } // Sanitize it and save it - const _Component = applySSRData(sanitizeComponent(Component), NUXT.data ? NUXT.data[index] : null) - match.components[key] = _Component - return _Component - }) + const _Component = applySSRData( + sanitizeComponent(Component), + NUXT.data ? NUXT.data[index] : null, + ); + match.components[key] = _Component; + return _Component; + }); } -function callMiddleware (Components, context, layout) { - let midd = [] - let unknownMiddleware = false +function callMiddleware(Components, context, layout) { + let midd = []; + let unknownMiddleware = false; // If layout is undefined, only call global middleware if (typeof layout !== 'undefined') { - midd = [] // Exclude global middleware if layout defined (already called before) - layout = sanitizeComponent(layout) + midd = []; // Exclude global middleware if layout defined (already called before) + layout = sanitizeComponent(layout); if (layout.options.middleware) { - midd = midd.concat(layout.options.middleware) + midd = midd.concat(layout.options.middleware); } - Components.forEach((Component) => { + Components.forEach(Component => { if (Component.options.middleware) { - midd = midd.concat(Component.options.middleware) + midd = midd.concat(Component.options.middleware); } - }) + }); } - midd = midd.map((name) => { + midd = midd.map(name => { if (typeof name === 'function') { - return name + return name; } if (typeof middleware[name] !== 'function') { - unknownMiddleware = true - this.error({ statusCode: 500, message: 'Unknown middleware ' + name }) + unknownMiddleware = true; + this.error({ statusCode: 500, message: 'Unknown middleware ' + name }); } - return middleware[name] - }) + return middleware[name]; + }); if (unknownMiddleware) { - return + return; } - return middlewareSeries(midd, context) + return middlewareSeries(midd, context); } -async function render (to, from, next) { - if (this._routeChanged === false && this._paramChanged === false && this._queryChanged === false) { - return next() +async function render(to, from, next) { + if ( + this._routeChanged === false && + this._paramChanged === false && + this._queryChanged === false + ) { + return next(); } // Handle first render on SPA mode - let spaFallback = false + let spaFallback = false; if (to === from) { - _lastPaths = [] - spaFallback = true + _lastPaths = []; + spaFallback = true; } else { - const fromMatches = [] + const fromMatches = []; _lastPaths = getMatchedComponents(from, fromMatches).map((Component, i) => { - return compile(from.matched[fromMatches[i]].path)(from.params) - }) + return compile(from.matched[fromMatches[i]].path)(from.params); + }); } // nextCalled is true when redirected - let nextCalled = false - const _next = (path) => { + let nextCalled = false; + const _next = path => { if (from.path === path.path && this.$loading.finish) { - this.$loading.finish() + this.$loading.finish(); } if (from.path !== path.path && this.$loading.pause) { - this.$loading.pause() + this.$loading.pause(); } if (nextCalled) { - return + return; } - nextCalled = true - next(path) - } + nextCalled = true; + next(path); + }; // Update context await setContext(app, { route: to, from, - next: _next.bind(this) - }) - this._dateLastError = app.nuxt.dateErr - this._hadError = Boolean(app.nuxt.err) + next: _next.bind(this), + }); + this._dateLastError = app.nuxt.dateErr; + this._hadError = Boolean(app.nuxt.err); // Get route's matched components - const matches = [] - const Components = getMatchedComponents(to, matches) + const matches = []; + const Components = getMatchedComponents(to, matches); // If no Components matched, generate 404 if (!Components.length) { // Default layout - await callMiddleware.call(this, Components, app.context) + await callMiddleware.call(this, Components, app.context); if (nextCalled) { - return + return; } // Load layout for error page - const errorLayout = (NuxtError.options || NuxtError).layout + const errorLayout = (NuxtError.options || NuxtError).layout; const layout = await this.loadLayout( typeof errorLayout === 'function' ? errorLayout.call(NuxtError, app.context) - : errorLayout - ) + : errorLayout, + ); - await callMiddleware.call(this, Components, app.context, layout) + await callMiddleware.call(this, Components, app.context, layout); if (nextCalled) { - return + return; } // Show error page - app.context.error({ statusCode: 404, message: 'This page could not be found' }) - return next() + app.context.error({ + statusCode: 404, + message: 'This page could not be found', + }); + return next(); } // Update ._data and other properties if hot reloaded - Components.forEach((Component) => { + Components.forEach(Component => { if (Component._Ctor && Component._Ctor.options) { - Component.options.asyncData = Component._Ctor.options.asyncData - Component.options.fetch = Component._Ctor.options.fetch + Component.options.asyncData = Component._Ctor.options.asyncData; + Component.options.fetch = Component._Ctor.options.fetch; } - }) + }); // Apply transitions - this.setTransitions(mapTransitions(Components, to, from)) + this.setTransitions(mapTransitions(Components, to, from)); try { // Call middleware - await callMiddleware.call(this, Components, app.context) + await callMiddleware.call(this, Components, app.context); if (nextCalled) { - return + return; } if (app.context._errored) { - return next() + return next(); } // Set layout - let layout = Components[0].options.layout + let layout = Components[0].options.layout; if (typeof layout === 'function') { - layout = layout(app.context) + layout = layout(app.context); } - layout = await this.loadLayout(layout) + layout = await this.loadLayout(layout); // Call middleware for layout - await callMiddleware.call(this, Components, app.context, layout) + await callMiddleware.call(this, Components, app.context, layout); if (nextCalled) { - return + return; } if (app.context._errored) { - return next() + return next(); } // Call .validate() - let isValid = true + let isValid = true; try { for (const Component of Components) { if (typeof Component.options.validate !== 'function') { - continue + continue; } - isValid = await Component.options.validate(app.context) + isValid = await Component.options.validate(app.context); if (!isValid) { - break + break; } } } catch (validationError) { // ...If .validate() threw an error this.error({ statusCode: validationError.statusCode || '500', - message: validationError.message - }) - return next() + message: validationError.message, + }); + return next(); } // ...If .validate() returned false if (!isValid) { - this.error({ statusCode: 404, message: 'This page could not be found' }) - return next() + this.error({ statusCode: 404, message: 'This page could not be found' }); + return next(); } - - let instances + let instances; // Call asyncData & fetch hooks on components matched by the route. - await Promise.all(Components.map(async (Component, i) => { - // Check if only children route changed - Component._path = compile(to.matched[matches[i]].path)(to.params) - Component._dataRefresh = false - const childPathChanged = Component._path !== _lastPaths[i] - // Refresh component (call asyncData & fetch) when: - // Route path changed part includes current component - // Or route param changed part includes current component and watchParam is not `false` - // Or route query is changed and watchQuery returns `true` - if (this._routeChanged && childPathChanged) { - Component._dataRefresh = true - } else if (this._paramChanged && childPathChanged) { - const watchParam = Component.options.watchParam - Component._dataRefresh = watchParam !== false - } else if (this._queryChanged) { - const watchQuery = Component.options.watchQuery - if (watchQuery === true) { - Component._dataRefresh = true - } else if (Array.isArray(watchQuery)) { - Component._dataRefresh = watchQuery.some(key => this._diffQuery[key]) - } else if (typeof watchQuery === 'function') { - if (!instances) { - instances = getMatchedComponentsInstances(to) + await Promise.all( + Components.map(async (Component, i) => { + // Check if only children route changed + Component._path = compile(to.matched[matches[i]].path)(to.params); + Component._dataRefresh = false; + const childPathChanged = Component._path !== _lastPaths[i]; + // Refresh component (call asyncData & fetch) when: + // Route path changed part includes current component + // Or route param changed part includes current component and watchParam is not `false` + // Or route query is changed and watchQuery returns `true` + if (this._routeChanged && childPathChanged) { + Component._dataRefresh = true; + } else if (this._paramChanged && childPathChanged) { + const watchParam = Component.options.watchParam; + Component._dataRefresh = watchParam !== false; + } else if (this._queryChanged) { + const watchQuery = Component.options.watchQuery; + if (watchQuery === true) { + Component._dataRefresh = true; + } else if (Array.isArray(watchQuery)) { + Component._dataRefresh = watchQuery.some( + key => this._diffQuery[key], + ); + } else if (typeof watchQuery === 'function') { + if (!instances) { + instances = getMatchedComponentsInstances(to); + } + Component._dataRefresh = watchQuery.apply(instances[i], [ + to.query, + from.query, + ]); } - Component._dataRefresh = watchQuery.apply(instances[i], [to.query, from.query]) } - } - if (!this._hadError && this._isMounted && !Component._dataRefresh) { - return - } + if (!this._hadError && this._isMounted && !Component._dataRefresh) { + return; + } - const promises = [] + const promises = []; - const hasAsyncData = ( - Component.options.asyncData && - typeof Component.options.asyncData === 'function' - ) + const hasAsyncData = + Component.options.asyncData && + typeof Component.options.asyncData === 'function'; - const hasFetch = Boolean(Component.options.fetch) && Component.options.fetch.length + const hasFetch = + Boolean(Component.options.fetch) && Component.options.fetch.length; - const loadingIncrease = (hasAsyncData && hasFetch) ? 30 : 45 + const loadingIncrease = hasAsyncData && hasFetch ? 30 : 45; - // Call asyncData(context) - if (hasAsyncData) { - const promise = promisify(Component.options.asyncData, app.context) + // Call asyncData(context) + if (hasAsyncData) { + const promise = promisify(Component.options.asyncData, app.context); - promise.then((asyncDataResult) => { - applyAsyncData(Component, asyncDataResult) + promise.then(asyncDataResult => { + applyAsyncData(Component, asyncDataResult); - if (this.$loading.increase) { - this.$loading.increase(loadingIncrease) - } - }) - promises.push(promise) - } + if (this.$loading.increase) { + this.$loading.increase(loadingIncrease); + } + }); + promises.push(promise); + } - // Check disabled page loading - this.$loading.manual = Component.options.loading === false + // Check disabled page loading + this.$loading.manual = Component.options.loading === false; - // Call fetch(context) - if (hasFetch) { - let p = Component.options.fetch(app.context) - if (!p || (!(p instanceof Promise) && (typeof p.then !== 'function'))) { - p = Promise.resolve(p) - } - p.then((fetchResult) => { - if (this.$loading.increase) { - this.$loading.increase(loadingIncrease) + // Call fetch(context) + if (hasFetch) { + let p = Component.options.fetch(app.context); + if (!p || (!(p instanceof Promise) && typeof p.then !== 'function')) { + p = Promise.resolve(p); } - }) - promises.push(p) - } + p.then(fetchResult => { + if (this.$loading.increase) { + this.$loading.increase(loadingIncrease); + } + }); + promises.push(p); + } - return Promise.all(promises) - })) + return Promise.all(promises); + }), + ); // If not redirected if (!nextCalled) { if (this.$loading.finish && !this.$loading.manual) { - this.$loading.finish() + this.$loading.finish(); } - next() + next(); } } catch (err) { - const error = err || {} + const error = err || {}; if (error.message === 'ERR_REDIRECT') { - return this.$nuxt.$emit('routeChanged', to, from, error) + return this.$nuxt.$emit('routeChanged', to, from, error); } - _lastPaths = [] + _lastPaths = []; - globalHandleError(error) + globalHandleError(error); // Load error layout - let layout = (NuxtError.options || NuxtError).layout + let layout = (NuxtError.options || NuxtError).layout; if (typeof layout === 'function') { - layout = layout(app.context) + layout = layout(app.context); } - await this.loadLayout(layout) + await this.loadLayout(layout); - this.error(error) - this.$nuxt.$emit('routeChanged', to, from, error) - next() + this.error(error); + this.$nuxt.$emit('routeChanged', to, from, error); + next(); } } // Fix components format in matched, it's due to code-splitting of vue-router -function normalizeComponents (to, ___) { +function normalizeComponents(to, ___) { flatMapComponents(to, (Component, _, match, key) => { if (typeof Component === 'object' && !Component.options) { // Updated via vue-router resolveAsyncComponents() - Component = Vue.extend(Component) - Component._Ctor = Component - match.components[key] = Component + Component = Vue.extend(Component); + Component._Ctor = Component; + match.components[key] = Component; } - return Component - }) + return Component; + }); } -function setLayoutForNextPage (to) { +function setLayoutForNextPage(to) { // Set layout - let hasError = Boolean(this.$options.nuxt.err) + let hasError = Boolean(this.$options.nuxt.err); if (this._hadError && this._dateLastError === this.$options.nuxt.dateErr) { - hasError = false + hasError = false; } let layout = hasError ? (NuxtError.options || NuxtError).layout - : to.matched[0].components.default.options.layout + : to.matched[0].components.default.options.layout; if (typeof layout === 'function') { - layout = layout(app.context) + layout = layout(app.context); } - this.setLayout(layout) + this.setLayout(layout); } -function checkForErrors (app) { +function checkForErrors(app) { // Hide error component if no error if (app._hadError && app._dateLastError === app.$options.nuxt.dateErr) { - app.error() + app.error(); } } // When navigating on a different route but the same component is used, Vue.js // Will not update the instance data, so we have to update $data ourselves -function fixPrepatch (to, ___) { - if (this._routeChanged === false && this._paramChanged === false && this._queryChanged === false) { - return +function fixPrepatch(to, ___) { + if ( + this._routeChanged === false && + this._paramChanged === false && + this._queryChanged === false + ) { + return; } - const instances = getMatchedComponentsInstances(to) - const Components = getMatchedComponents(to) + const instances = getMatchedComponentsInstances(to); + const Components = getMatchedComponents(to); - let triggerScroll = false + let triggerScroll = false; Vue.nextTick(() => { instances.forEach((instance, i) => { if (!instance || instance._isDestroyed) { - return + return; } if ( @@ -580,246 +630,268 @@ function fixPrepatch (to, ___) { instance.$vnode.data.keepAlive !== true && typeof instance.constructor.options.data === 'function' ) { - const newData = instance.constructor.options.data.call(instance) + const newData = instance.constructor.options.data.call(instance); for (const key in newData) { - Vue.set(instance.$data, key, newData[key]) + Vue.set(instance.$data, key, newData[key]); } - triggerScroll = true + triggerScroll = true; } - }) + }); if (triggerScroll) { // Ensure to trigger scroll event after calling scrollBehavior window.$nuxt.$nextTick(() => { - window.$nuxt.$emit('triggerScroll') - }) + window.$nuxt.$emit('triggerScroll'); + }); } - checkForErrors(this) + checkForErrors(this); // Hot reloading - setTimeout(() => hotReloadAPI(this), 100) - }) + setTimeout(() => hotReloadAPI(this), 100); + }); } -function nuxtReady (_app) { - window.onNuxtReadyCbs && window.onNuxtReadyCbs.forEach((cb) => { - if (typeof cb === 'function') { - cb(_app) - } - }) +function nuxtReady(_app) { + window.onNuxtReadyCbs && + window.onNuxtReadyCbs.forEach(cb => { + if (typeof cb === 'function') { + cb(_app); + } + }); // Special JSDOM if (typeof window._onNuxtLoaded === 'function') { - window._onNuxtLoaded(_app) + window._onNuxtLoaded(_app); } // Add router hooks router.afterEach((to, from) => { // Wait for fixPrepatch + $data updates - Vue.nextTick(() => _app.$nuxt.$emit('routeChanged', to, from)) - }) + Vue.nextTick(() => _app.$nuxt.$emit('routeChanged', to, from)); + }); } -const noopData = () => { return {} } -const noopFetch = () => {} +const noopData = () => { + return {}; +}; +const noopFetch = () => {}; // Special hot reload with asyncData(context) -function getNuxtChildComponents ($parent, $components = []) { - $parent.$children.forEach(($child) => { - if ($child.$vnode && $child.$vnode.data.nuxtChild && !$components.find(c =>(c.$options.__file === $child.$options.__file))) { - $components.push($child) +function getNuxtChildComponents($parent, $components = []) { + $parent.$children.forEach($child => { + if ( + $child.$vnode && + $child.$vnode.data.nuxtChild && + !$components.find(c => c.$options.__file === $child.$options.__file) + ) { + $components.push($child); } if ($child.$children && $child.$children.length) { - getNuxtChildComponents($child, $components) + getNuxtChildComponents($child, $components); } - }) + }); - return $components + return $components; } function hotReloadAPI(_app) { - if (!module.hot) return + if (!module.hot) return; - let $components = getNuxtChildComponents(_app.$nuxt, []) + let $components = getNuxtChildComponents(_app.$nuxt, []); - $components.forEach(addHotReload.bind(_app)) + $components.forEach(addHotReload.bind(_app)); } -function addHotReload ($component, depth) { - if ($component.$vnode.data._hasHotReload) return - $component.$vnode.data._hasHotReload = true +function addHotReload($component, depth) { + if ($component.$vnode.data._hasHotReload) return; + $component.$vnode.data._hasHotReload = true; - var _forceUpdate = $component.$forceUpdate.bind($component.$parent) + var _forceUpdate = $component.$forceUpdate.bind($component.$parent); $component.$vnode.context.$forceUpdate = async () => { - let Components = getMatchedComponents(router.currentRoute) - let Component = Components[depth] + let Components = getMatchedComponents(router.currentRoute); + let Component = Components[depth]; if (!Component) { - return _forceUpdate() + return _forceUpdate(); } if (typeof Component === 'object' && !Component.options) { // Updated via vue-router resolveAsyncComponents() - Component = Vue.extend(Component) - Component._Ctor = Component - } - this.error() - let promises = [] - const next = function (path) { - this.$loading.finish && this.$loading.finish() - router.push(path) - } + Component = Vue.extend(Component); + Component._Ctor = Component; + } + this.error(); + let promises = []; + const next = function(path) { + this.$loading.finish && this.$loading.finish(); + router.push(path); + }; await setContext(app, { route: router.currentRoute, isHMR: true, - next: next.bind(this) - }) - const context = app.context + next: next.bind(this), + }); + const context = app.context; if (this.$loading.start && !this.$loading.manual) { - this.$loading.start() + this.$loading.start(); } - callMiddleware.call(this, Components, context) - .then(() => { - // If layout changed - if (depth !== 0) { - return - } + callMiddleware + .call(this, Components, context) + .then(() => { + // If layout changed + if (depth !== 0) { + return; + } - let layout = Component.options.layout || 'default' - if (typeof layout === 'function') { - layout = layout(context) - } - if (this.layoutName === layout) { - return - } - let promise = this.loadLayout(layout) - promise.then(() => { - this.setLayout(layout) - Vue.nextTick(() => hotReloadAPI(this)) + let layout = Component.options.layout || 'default'; + if (typeof layout === 'function') { + layout = layout(context); + } + if (this.layoutName === layout) { + return; + } + let promise = this.loadLayout(layout); + promise.then(() => { + this.setLayout(layout); + Vue.nextTick(() => hotReloadAPI(this)); + }); + return promise; }) - return promise - }) - - .then(() => { - return callMiddleware.call(this, Components, context, this.layout) - }) - - .then(() => { - // Call asyncData(context) - let pAsyncData = promisify(Component.options.asyncData || noopData, context) - pAsyncData.then((asyncDataResult) => { - applyAsyncData(Component, asyncDataResult) - this.$loading.increase && this.$loading.increase(30) + + .then(() => { + return callMiddleware.call(this, Components, context, this.layout); }) - promises.push(pAsyncData) - - // Call fetch() - Component.options.fetch = Component.options.fetch || noopFetch - let pFetch = Component.options.fetch.length && Component.options.fetch(context) - if (!pFetch || (!(pFetch instanceof Promise) && (typeof pFetch.then !== 'function'))) { pFetch = Promise.resolve(pFetch) } - pFetch.then(() => this.$loading.increase && this.$loading.increase(30)) - promises.push(pFetch) - - return Promise.all(promises) - }) - .then(() => { - this.$loading.finish && this.$loading.finish() - _forceUpdate() - setTimeout(() => hotReloadAPI(this), 100) - }) - } + + .then(() => { + // Call asyncData(context) + let pAsyncData = promisify( + Component.options.asyncData || noopData, + context, + ); + pAsyncData.then(asyncDataResult => { + applyAsyncData(Component, asyncDataResult); + this.$loading.increase && this.$loading.increase(30); + }); + promises.push(pAsyncData); + + // Call fetch() + Component.options.fetch = Component.options.fetch || noopFetch; + let pFetch = + Component.options.fetch.length && Component.options.fetch(context); + if ( + !pFetch || + (!(pFetch instanceof Promise) && typeof pFetch.then !== 'function') + ) { + pFetch = Promise.resolve(pFetch); + } + pFetch.then(() => this.$loading.increase && this.$loading.increase(30)); + promises.push(pFetch); + + return Promise.all(promises); + }) + .then(() => { + this.$loading.finish && this.$loading.finish(); + _forceUpdate(); + setTimeout(() => hotReloadAPI(this), 100); + }); + }; } -async function mountApp (__app) { +async function mountApp(__app) { // Set global variables - app = __app.app - router = __app.router + app = __app.app; + router = __app.router; // Create Vue instance - const _app = new Vue(app) + const _app = new Vue(app); // Mounts Vue app to DOM element const mount = () => { - _app.$mount('#root') + _app.$mount('#root'); // Add afterEach router hooks - router.afterEach(normalizeComponents) + router.afterEach(normalizeComponents); - router.afterEach(setLayoutForNextPage.bind(_app)) + router.afterEach(setLayoutForNextPage.bind(_app)); - router.afterEach(fixPrepatch.bind(_app)) + router.afterEach(fixPrepatch.bind(_app)); // Listen for first Vue update Vue.nextTick(() => { // Call window.{{globals.readyCallback}} callbacks - nuxtReady(_app) + nuxtReady(_app); // Enable hot reloading - hotReloadAPI(_app) - }) - } + hotReloadAPI(_app); + }); + }; // Resolve route components - const Components = await Promise.all(resolveComponents(app.context.route)) + const Components = await Promise.all(resolveComponents(app.context.route)); // Enable transitions - _app.setTransitions = _app.$options.nuxt.setTransitions.bind(_app) + _app.setTransitions = _app.$options.nuxt.setTransitions.bind(_app); if (Components.length) { - _app.setTransitions(mapTransitions(Components, router.currentRoute)) - _lastPaths = router.currentRoute.matched.map(route => compile(route.path)(router.currentRoute.params)) + _app.setTransitions(mapTransitions(Components, router.currentRoute)); + _lastPaths = router.currentRoute.matched.map(route => + compile(route.path)(router.currentRoute.params), + ); } // Initialize error handler - _app.$loading = {} // To avoid error while _app.$nuxt does not exist + _app.$loading = {}; // To avoid error while _app.$nuxt does not exist if (NUXT.error) { - _app.error(NUXT.error) + _app.error(NUXT.error); } // Add beforeEach router hooks - router.beforeEach(loadAsyncComponents.bind(_app)) - router.beforeEach(render.bind(_app)) + router.beforeEach(loadAsyncComponents.bind(_app)); + router.beforeEach(render.bind(_app)); // Fix in static: remove trailing slash to force hydration // Full static, if server-rendered: hydrate, to allow custom redirect to generated page // Fix in static: remove trailing slash to force hydration - if (NUXT.serverRendered && isSamePath(NUXT.routePath, _app.context.route.path)) { - return mount() + if ( + NUXT.serverRendered && + isSamePath(NUXT.routePath, _app.context.route.path) + ) { + return mount(); } // First render on client-side const clientFirstMount = () => { - normalizeComponents(router.currentRoute, router.currentRoute) - setLayoutForNextPage.call(_app, router.currentRoute) - checkForErrors(_app) + normalizeComponents(router.currentRoute, router.currentRoute); + setLayoutForNextPage.call(_app, router.currentRoute); + checkForErrors(_app); // Don't call fixPrepatch.call(_app, router.currentRoute, router.currentRoute) since it's first render - mount() - } + mount(); + }; // fix: force next tick to avoid having same timestamp when an error happen on spa fallback - await new Promise(resolve => setTimeout(resolve, 0)) - render.call(_app, router.currentRoute, router.currentRoute, (path) => { + await new Promise(resolve => setTimeout(resolve, 0)); + render.call(_app, router.currentRoute, router.currentRoute, path => { // If not redirected if (!path) { - clientFirstMount() - return + clientFirstMount(); + return; } // Add a one-time afterEach hook to // mount the app wait for redirect and route gets resolved const unregisterHook = router.afterEach((to, from) => { - unregisterHook() - clientFirstMount() - }) + unregisterHook(); + clientFirstMount(); + }); // Push the path and let route to be resolved - router.push(path, undefined, (err) => { + router.push(path, undefined, err => { if (err) { - errorHandler(err) + errorHandler(err); } - }) - }) + }); + }); } -import '@@/internal/app-enhancers/addEntryCode' +import '@@/internal/app-enhancers/addEntryCode'; diff --git a/packages/client/src/components/index.js b/packages/client/src/components/index.js index 7140e2b..b8634c2 100644 --- a/packages/client/src/components/index.js +++ b/packages/client/src/components/index.js @@ -1,5 +1,7 @@ -import { wrapFunctional } from './utils' +import { wrapFunctional } from './utils'; -export { default as Logo } from '../../components/Logo.vue' +export { default as Logo } from '../../components/Logo.vue'; -export const LazyLogo = import('../../components/Logo.vue' /* webpackChunkName: "components/logo" */).then(c => wrapFunctional(c.default || c)) +export const LazyLogo = import( + '../../components/Logo.vue' /* webpackChunkName: "components/logo" */ +).then(c => wrapFunctional(c.default || c)); diff --git a/packages/client/src/components/nuxt-child.js b/packages/client/src/components/nuxt-child.js index af27a4d..cd68675 100644 --- a/packages/client/src/components/nuxt-child.js +++ b/packages/client/src/components/nuxt-child.js @@ -1,91 +1,96 @@ - export default { name: 'NuxtChild', functional: true, props: { nuxtChildKey: { type: String, - default: '' + default: '', }, keepAlive: Boolean, keepAliveProps: { type: Object, - default: undefined - } + default: undefined, + }, }, - render (_, { parent, data, props }) { - const h = parent.$createElement + render(_, { parent, data, props }) { + const h = parent.$createElement; - data.nuxtChild = true - const _parent = parent - const transitions = parent.$nuxt.nuxt.transitions - const defaultTransition = parent.$nuxt.nuxt.defaultTransition + data.nuxtChild = true; + const _parent = parent; + const transitions = parent.$nuxt.nuxt.transitions; + const defaultTransition = parent.$nuxt.nuxt.defaultTransition; - let depth = 0 + let depth = 0; while (parent) { if (parent.$vnode && parent.$vnode.data.nuxtChild) { - depth++ + depth++; } - parent = parent.$parent + parent = parent.$parent; } - data.nuxtChildDepth = depth - const transition = transitions[depth] || defaultTransition - const transitionProps = {} - transitionsKeys.forEach((key) => { + data.nuxtChildDepth = depth; + const transition = transitions[depth] || defaultTransition; + const transitionProps = {}; + transitionsKeys.forEach(key => { if (typeof transition[key] !== 'undefined') { - transitionProps[key] = transition[key] + transitionProps[key] = transition[key]; } - }) + }); - const listeners = {} - listenersKeys.forEach((key) => { + const listeners = {}; + listenersKeys.forEach(key => { if (typeof transition[key] === 'function') { - listeners[key] = transition[key].bind(_parent) + listeners[key] = transition[key].bind(_parent); } - }) + }); if (process.client) { // Add triggerScroll event on beforeEnter (fix #1376) - const beforeEnter = listeners.beforeEnter - listeners.beforeEnter = (el) => { + const beforeEnter = listeners.beforeEnter; + listeners.beforeEnter = el => { // Ensure to trigger scroll event after calling scrollBehavior window.$nuxt.$nextTick(() => { - window.$nuxt.$emit('triggerScroll') - }) + window.$nuxt.$emit('triggerScroll'); + }); if (beforeEnter) { - return beforeEnter.call(_parent, el) + return beforeEnter.call(_parent, el); } - } + }; } // make sure that leave is called asynchronous (fix #5703) if (transition.css === false) { - const leave = listeners.leave + const leave = listeners.leave; // only add leave listener when user didnt provide one // or when it misses the done argument if (!leave || leave.length < 2) { listeners.leave = (el, done) => { if (leave) { - leave.call(_parent, el) + leave.call(_parent, el); } - _parent.$nextTick(done) - } + _parent.$nextTick(done); + }; } } - let routerView = h('routerView', data) + let routerView = h('routerView', data); if (props.keepAlive) { - routerView = h('keep-alive', { props: props.keepAliveProps }, [routerView]) + routerView = h('keep-alive', { props: props.keepAliveProps }, [ + routerView, + ]); } - return h('transition', { - props: transitionProps, - on: listeners - }, [routerView]) - } -} + return h( + 'transition', + { + props: transitionProps, + on: listeners, + }, + [routerView], + ); + }, +}; const transitionsKeys = [ 'name', @@ -103,8 +108,8 @@ const transitionsKeys = [ 'appearActiveClass', 'enterToClass', 'leaveToClass', - 'appearToClass' -] + 'appearToClass', +]; const listenersKeys = [ 'beforeEnter', @@ -118,5 +123,5 @@ const listenersKeys = [ 'beforeAppear', 'appear', 'afterAppear', - 'appearCancelled' -] + 'appearCancelled', +]; diff --git a/packages/client/src/components/nuxt-link.client.js b/packages/client/src/components/nuxt-link.client.js index 1477cfd..fba5f41 100644 --- a/packages/client/src/components/nuxt-link.client.js +++ b/packages/client/src/components/nuxt-link.client.js @@ -1,28 +1,33 @@ -import Vue from 'vue' +import Vue from 'vue'; -const requestIdleCallback = window.requestIdleCallback || - function (cb) { - const start = Date.now() - return setTimeout(function () { +const requestIdleCallback = + window.requestIdleCallback || + function(cb) { + const start = Date.now(); + return setTimeout(function() { cb({ didTimeout: false, - timeRemaining: () => Math.max(0, 50 - (Date.now() - start)) - }) - }, 1) - } + timeRemaining: () => Math.max(0, 50 - (Date.now() - start)), + }); + }, 1); + }; -const cancelIdleCallback = window.cancelIdleCallback || function (id) { - clearTimeout(id) -} +const cancelIdleCallback = + window.cancelIdleCallback || + function(id) { + clearTimeout(id); + }; -const observer = window.IntersectionObserver && new window.IntersectionObserver((entries) => { - entries.forEach(({ intersectionRatio, target: link }) => { - if (intersectionRatio <= 0 || !link.__prefetch) { - return - } - link.__prefetch() - }) -}) +const observer = + window.IntersectionObserver && + new window.IntersectionObserver(entries => { + entries.forEach(({ intersectionRatio, target: link }) => { + if (intersectionRatio <= 0 || !link.__prefetch) { + return; + } + link.__prefetch(); + }); + }); export default { name: 'NuxtLink', @@ -30,69 +35,76 @@ export default { props: { prefetch: { type: Boolean, - default: true + default: true, }, noPrefetch: { type: Boolean, - default: false - } + default: false, + }, }, - mounted () { + mounted() { if (this.prefetch && !this.noPrefetch) { - this.handleId = requestIdleCallback(this.observe, { timeout: 2e3 }) + this.handleId = requestIdleCallback(this.observe, { timeout: 2e3 }); } }, - beforeDestroy () { - cancelIdleCallback(this.handleId) + beforeDestroy() { + cancelIdleCallback(this.handleId); if (this.__observed) { - observer.unobserve(this.$el) - delete this.$el.__prefetch + observer.unobserve(this.$el); + delete this.$el.__prefetch; } }, methods: { - observe () { + observe() { // If no IntersectionObserver, avoid prefetching if (!observer) { - return + return; } // Add to observer if (this.shouldPrefetch()) { - this.$el.__prefetch = this.prefetchLink.bind(this) - observer.observe(this.$el) - this.__observed = true + this.$el.__prefetch = this.prefetchLink.bind(this); + observer.observe(this.$el); + this.__observed = true; } }, - shouldPrefetch () { - return this.getPrefetchComponents().length > 0 + shouldPrefetch() { + return this.getPrefetchComponents().length > 0; }, - canPrefetch () { - const conn = navigator.connection - const hasBadConnection = this.$nuxt.isOffline || (conn && ((conn.effectiveType || '').includes('2g') || conn.saveData)) + canPrefetch() { + const conn = navigator.connection; + const hasBadConnection = + this.$nuxt.isOffline || + (conn && ((conn.effectiveType || '').includes('2g') || conn.saveData)); - return !hasBadConnection + return !hasBadConnection; }, - getPrefetchComponents () { - const ref = this.$router.resolve(this.to, this.$route, this.append) - const Components = ref.resolved.matched.map(r => r.components.default) + getPrefetchComponents() { + const ref = this.$router.resolve(this.to, this.$route, this.append); + const Components = ref.resolved.matched.map(r => r.components.default); - return Components.filter(Component => typeof Component === 'function' && !Component.options && !Component.__prefetched) + return Components.filter( + Component => + typeof Component === 'function' && + !Component.options && + !Component.__prefetched, + ); }, - prefetchLink () { + prefetchLink() { if (!this.canPrefetch()) { - return + return; } // Stop observing this link (in case of internet connection changes) - observer.unobserve(this.$el) - const Components = this.getPrefetchComponents() + observer.unobserve(this.$el); + const Components = this.getPrefetchComponents(); for (const Component of Components) { - const componentOrPromise = Component() + const componentOrPromise = Component(); if (componentOrPromise instanceof Promise) { - componentOrPromise.catch(() => {}) + componentOrPromise.catch(() => {}); } - Component.__prefetched = true + Component.__prefetched = true; } - } - } -} + }, + }, +}; diff --git a/packages/client/src/components/nuxt-link.server.js b/packages/client/src/components/nuxt-link.server.js index f123090..87a5c50 100644 --- a/packages/client/src/components/nuxt-link.server.js +++ b/packages/client/src/components/nuxt-link.server.js @@ -1,4 +1,4 @@ -import Vue from 'vue' +import Vue from 'vue'; export default { name: 'NuxtLink', @@ -6,11 +6,11 @@ export default { props: { prefetch: { type: Boolean, - default: true + default: true, }, noPrefetch: { type: Boolean, - default: false - } - } -} + default: false, + }, + }, +}; diff --git a/packages/client/src/components/nuxt.js b/packages/client/src/components/nuxt.js index dc79c20..54caf80 100644 --- a/packages/client/src/components/nuxt.js +++ b/packages/client/src/components/nuxt.js @@ -1,101 +1,112 @@ -import Vue from 'vue' -import { compile } from '../utils' +import Vue from 'vue'; +import { compile } from '../utils'; -import NuxtError from './nuxt-error.vue' +import NuxtError from './nuxt-error.vue'; -import NuxtChild from './nuxt-child' +import NuxtChild from './nuxt-child'; export default { name: 'Nuxt', components: { NuxtChild, - NuxtError + NuxtError, }, props: { nuxtChildKey: { type: String, - default: undefined + default: undefined, }, keepAlive: Boolean, keepAliveProps: { type: Object, - default: undefined + default: undefined, }, name: { type: String, - default: 'default' - } + default: 'default', + }, }, - errorCaptured (error) { + errorCaptured(error) { // if we receive and error while showing the NuxtError component // capture the error and force an immediate update so we re-render // without the NuxtError component if (this.displayingNuxtError) { - this.errorFromNuxtError = error - this.$forceUpdate() + this.errorFromNuxtError = error; + this.$forceUpdate(); } }, computed: { - routerViewKey () { + routerViewKey() { // If nuxtChildKey prop is given or current route has children - if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) { - return this.nuxtChildKey || compile(this.$route.matched[0].path)(this.$route.params) + if ( + typeof this.nuxtChildKey !== 'undefined' || + this.$route.matched.length > 1 + ) { + return ( + this.nuxtChildKey || + compile(this.$route.matched[0].path)(this.$route.params) + ); } - const [matchedRoute] = this.$route.matched + const [matchedRoute] = this.$route.matched; if (!matchedRoute) { - return this.$route.path + return this.$route.path; } - const Component = matchedRoute.components.default + const Component = matchedRoute.components.default; if (Component && Component.options) { - const { options } = Component + const { options } = Component; if (options.key) { - return (typeof options.key === 'function' ? options.key(this.$route) : options.key) + return typeof options.key === 'function' + ? options.key(this.$route) + : options.key; } } - const strict = /\/$/.test(matchedRoute.path) - return strict ? this.$route.path : this.$route.path.replace(/\/$/, '') - } + const strict = /\/$/.test(matchedRoute.path); + return strict ? this.$route.path : this.$route.path.replace(/\/$/, ''); + }, }, - beforeCreate () { - Vue.util.defineReactive(this, 'nuxt', this.$root.$options.nuxt) + beforeCreate() { + Vue.util.defineReactive(this, 'nuxt', this.$root.$options.nuxt); }, - render (h) { + render(h) { // if there is no error if (!this.nuxt.err) { // Directly return nuxt child return h('NuxtChild', { key: this.routerViewKey, - props: this.$props - }) + props: this.$props, + }); } // if an error occurred within NuxtError show a simple // error message instead to prevent looping if (this.errorFromNuxtError) { - this.$nextTick(() => (this.errorFromNuxtError = false)) + this.$nextTick(() => (this.errorFromNuxtError = false)); return h('div', {}, [ h('h2', 'An error occurred while showing the error page'), - h('p', 'Unfortunately an error occurred and while showing the error page another error occurred'), + h( + 'p', + 'Unfortunately an error occurred and while showing the error page another error occurred', + ), h('p', `Error details: ${this.errorFromNuxtError.toString()}`), - h('nuxt-link', { props: { to: '/' } }, 'Go back to home') - ]) + h('nuxt-link', { props: { to: '/' } }, 'Go back to home'), + ]); } // track if we are showing the NuxtError component - this.displayingNuxtError = true - this.$nextTick(() => (this.displayingNuxtError = false)) + this.displayingNuxtError = true; + this.$nextTick(() => (this.displayingNuxtError = false)); return h(NuxtError, { props: { - error: this.nuxt.err - } - }) - } -} + error: this.nuxt.err, + }, + }); + }, +}; diff --git a/packages/client/src/components/plugin.js b/packages/client/src/components/plugin.js index c2042d7..d5c81fe 100644 --- a/packages/client/src/components/plugin.js +++ b/packages/client/src/components/plugin.js @@ -1,11 +1,14 @@ -import Vue from 'vue' -import { wrapFunctional } from './utils' +import Vue from 'vue'; +import { wrapFunctional } from './utils'; const components = { - Logo: () => import('../../components/Logo.vue' /* webpackChunkName: "components/logo" */).then(c => wrapFunctional(c.default || c)) -} + Logo: () => + import( + '../../components/Logo.vue' /* webpackChunkName: "components/logo" */ + ).then(c => wrapFunctional(c.default || c)), +}; for (const name in components) { - Vue.component(name, components[name]) - Vue.component('Lazy' + name, components[name]) + Vue.component(name, components[name]); + Vue.component('Lazy' + name, components[name]); } diff --git a/packages/client/src/components/utils.js b/packages/client/src/components/utils.js index b79efd5..76bcfda 100644 --- a/packages/client/src/components/utils.js +++ b/packages/client/src/components/utils.js @@ -1,30 +1,36 @@ // nuxt/nuxt.js#8607 export function wrapFunctional(options) { if (!options || !options.functional) { - return options + return options; } - const propKeys = Array.isArray(options.props) ? options.props : Object.keys(options.props || {}) + const propKeys = Array.isArray(options.props) + ? options.props + : Object.keys(options.props || {}); return { render(h) { - const attrs = {} - const props = {} + const attrs = {}; + const props = {}; for (const key in this.$attrs) { if (propKeys.includes(key)) { - props[key] = this.$attrs[key] + props[key] = this.$attrs[key]; } else { - attrs[key] = this.$attrs[key] + attrs[key] = this.$attrs[key]; } } - return h(options, { - on: this.$listeners, - attrs, - props, - scopedSlots: this.$scopedSlots, - }, this.$slots.default) - } - } + return h( + options, + { + on: this.$listeners, + attrs, + props, + scopedSlots: this.$scopedSlots, + }, + this.$slots.default, + ); + }, + }; } diff --git a/packages/client/src/index.js b/packages/client/src/index.js index 448bc0d..49461e7 100644 --- a/packages/client/src/index.js +++ b/packages/client/src/index.js @@ -1,123 +1,165 @@ -import Vue from 'vue' - -import Meta from 'vue-meta' -import ClientOnly from 'vue-client-only' -import NoSsr from 'vue-no-ssr' -import { createRouter } from './router.js' -import NuxtChild from './components/nuxt-child.js' -import NuxtError from './components/nuxt-error.vue' -import Nuxt from './components/nuxt.js' -import App from './App.js' -import { setContext, getLocation, getRouteData, normalizeError } from './utils' +import Vue from 'vue'; +import { plugin } from '@@/core/plugin'; +import { ApplyPluginsType } from '@@/core/umiExports'; +import Meta from 'vue-meta'; +import ClientOnly from 'vue-client-only'; +import NoSsr from 'vue-no-ssr'; +import { createRouter } from './router.js'; +import NuxtChild from './components/nuxt-child.js'; +import NuxtError from './components/nuxt-error.vue'; +import Nuxt from './components/nuxt.js'; +import App from './App.js'; +import { setContext, getLocation, getRouteData, normalizeError } from './utils'; + +plugin.applyPlugins({ + key: 'enhanceApp', + type: ApplyPluginsType.event, + args: { Vue }, +}); + +plugin.applyPlugins({ + key: 'default', + type: ApplyPluginsType.event, + args: { Vue }, +}); /* Plugins */ // import nuxt_plugin_plugin_360b9564 from 'nuxt_plugin_plugin_360b9564' // Source: ./components/plugin.js (mode: 'all') -const nuxt_plugin_plugin_360b9564 = function(){} +const nuxt_plugin_plugin_360b9564 = function() {}; // Component: -Vue.component(ClientOnly.name, ClientOnly) +Vue.component(ClientOnly.name, ClientOnly); // TODO: Remove in Nuxt 3: Vue.component(NoSsr.name, { ...NoSsr, - render (h, ctx) { + render(h, ctx) { if (process.client && !NoSsr._warned) { - NoSsr._warned = true + NoSsr._warned = true; - console.warn(' has been deprecated and will be removed in Nuxt 3, please use instead') + console.warn( + ' has been deprecated and will be removed in Nuxt 3, please use instead', + ); } - return NoSsr.render(h, ctx) - } -}) + return NoSsr.render(h, ctx); + }, +}); // Component: -Vue.component(NuxtChild.name, NuxtChild) -Vue.component('NChild', NuxtChild) - -// Component NuxtLink is imported in server.js or client.js +Vue.component(NuxtChild.name, NuxtChild); +Vue.component('NChild', NuxtChild); // Component: -Vue.component(Nuxt.name, Nuxt) +Vue.component(Nuxt.name, Nuxt); Object.defineProperty(Vue.prototype, '$nuxt', { get() { - const globalNuxt = this.$root.$options.$nuxt + const globalNuxt = this.$root.$options.$nuxt; if (process.client && !globalNuxt && typeof window !== 'undefined') { - return window.$nuxt + return window.$nuxt; } - return globalNuxt + return globalNuxt; }, - configurable: true -}) + configurable: true, +}); -Vue.use(Meta, {"keyName":"head","attribute":"data-n-head","ssrAttribute":"data-n-head-ssr","tagIDKeyName":"hid"}) +Vue.use(Meta, { + keyName: 'head', + attribute: 'data-n-head', + ssrAttribute: 'data-n-head-ssr', + tagIDKeyName: 'hid', +}); -const defaultTransition = {"name":"page","mode":"out-in","appear":true,"appearClass":"appear","appearActiveClass":"appear-active","appearToClass":"appear-to"} +const defaultTransition = { + name: 'page', + mode: 'out-in', + appear: true, + appearClass: 'appear', + appearActiveClass: 'appear-active', + appearToClass: 'appear-to', +}; async function createApp(ssrContext, config = {}) { - const router = await createRouter(ssrContext, config) + const router = await createRouter(ssrContext, config); // Create Root instance // here we inject the router and store to all child components, // making them available everywhere as `this.$router` and `this.$store`. const app = { - head: {"title":"nuxt-test","htmlAttrs":{"lang":"en"},"meta":[{"charset":"utf-8"},{"name":"viewport","content":"width=device-width, initial-scale=1"},{"hid":"description","name":"description","content":""}],"link":[{"rel":"icon","type":"image\u002Fx-icon","href":"\u002Ffavicon.ico"}],"style":[],"script":[]}, + head: { + title: 'nuxt-test', + htmlAttrs: { lang: 'en' }, + meta: [ + { charset: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + { hid: 'description', name: 'description', content: '' }, + ], + link: [ + { rel: 'icon', type: 'image\u002Fx-icon', href: '\u002Ffavicon.ico' }, + ], + style: [], + script: [], + }, router, nuxt: { defaultTransition, transitions: [defaultTransition], - setTransitions (transitions) { + setTransitions(transitions) { if (!Array.isArray(transitions)) { - transitions = [transitions] + transitions = [transitions]; } - transitions = transitions.map((transition) => { + transitions = transitions.map(transition => { if (!transition) { - transition = defaultTransition + transition = defaultTransition; } else if (typeof transition === 'string') { - transition = Object.assign({}, defaultTransition, { name: transition }) + transition = Object.assign({}, defaultTransition, { + name: transition, + }); } else { - transition = Object.assign({}, defaultTransition, transition) + transition = Object.assign({}, defaultTransition, transition); } - return transition - }) - this.$options.nuxt.transitions = transitions - return transitions + return transition; + }); + this.$options.nuxt.transitions = transitions; + return transitions; }, err: null, dateErr: null, - error (err) { - err = err || null - app.context._errored = Boolean(err) - err = err ? normalizeError(err) : null - let nuxt = app.nuxt // to work with @vue/composition-api, see https://github.com/nuxt/nuxt.js/issues/6517#issuecomment-573280207 + error(err) { + err = err || null; + app.context._errored = Boolean(err); + err = err ? normalizeError(err) : null; + let nuxt = app.nuxt; // to work with @vue/composition-api, see https://github.com/nuxt/nuxt.js/issues/6517#issuecomment-573280207 if (this) { - nuxt = this.nuxt || this.$options.nuxt + nuxt = this.nuxt || this.$options.nuxt; } - nuxt.dateErr = Date.now() - nuxt.err = err + nuxt.dateErr = Date.now(); + nuxt.err = err; // Used in src/server.js if (ssrContext) { - ssrContext.nuxt.error = err + ssrContext.nuxt.error = err; } - return err - } + return err; + }, }, - ...App - } + ...App, + }; - const next = ssrContext ? ssrContext.next : location => app.router.push(location) + const next = ssrContext + ? ssrContext.next + : location => app.router.push(location); // Resolve route - let route + let route; if (ssrContext) { - route = router.resolve(ssrContext.url).route + route = router.resolve(ssrContext.url).route; } else { - const path = getLocation(router.options.base, router.options.mode) - route = router.resolve(path).route + const path = getLocation(router.options.base, router.options.mode); + route = router.resolve(path).route; } // Set context to app.context @@ -129,96 +171,97 @@ async function createApp(ssrContext, config = {}) { req: ssrContext ? ssrContext.req : undefined, res: ssrContext ? ssrContext.res : undefined, beforeRenderFns: ssrContext ? ssrContext.beforeRenderFns : undefined, - ssrContext - }) + ssrContext, + }); function inject(key, value) { if (!key) { - throw new Error('inject(key, value) has no key provided') + throw new Error('inject(key, value) has no key provided'); } if (value === undefined) { - throw new Error(`inject('${key}', value) has no value provided`) + throw new Error(`inject('${key}', value) has no value provided`); } - key = '$' + key + key = '$' + key; // Add into app - app[key] = value + app[key] = value; // Add into context if (!app.context[key]) { - app.context[key] = value + app.context[key] = value; } // Check if plugin not already installed - const installKey = '__nuxt_' + key + '_installed__' + const installKey = '__nuxt_' + key + '_installed__'; if (Vue[installKey]) { - return + return; } - Vue[installKey] = true + Vue[installKey] = true; // Call Vue.use() to install the plugin into vm Vue.use(() => { if (!Object.prototype.hasOwnProperty.call(Vue.prototype, key)) { Object.defineProperty(Vue.prototype, key, { - get () { - return this.$root.$options[key] - } - }) + get() { + return this.$root.$options[key]; + }, + }); } - }) + }); } // Inject runtime config as $config - inject('config', config) + inject('config', config); // Add enablePreview(previewData = {}) in context for plugins if (process.static && process.client) { - app.context.enablePreview = function (previewData = {}) { - app.previewData = Object.assign({}, previewData) - inject('preview', previewData) - } + app.context.enablePreview = function(previewData = {}) { + app.previewData = Object.assign({}, previewData); + inject('preview', previewData); + }; } // Plugin execution if (typeof nuxt_plugin_plugin_360b9564 === 'function') { - await nuxt_plugin_plugin_360b9564(app.context, inject) + await nuxt_plugin_plugin_360b9564(app.context, inject); } // Lock enablePreview in context if (process.static && process.client) { - app.context.enablePreview = function () { - console.warn('You cannot call enablePreview() outside a plugin.') - } + app.context.enablePreview = function() { + console.warn('You cannot call enablePreview() outside a plugin.'); + }; } // Wait for async component to be resolved first await new Promise((resolve, reject) => { - const { route } = router.resolve(app.context.route.fullPath) + const { route } = router.resolve(app.context.route.fullPath); // Ignore 404s rather than blindly replacing URL if (!route.matched.length && process.client) { - return resolve() + return resolve(); } - router.replace(route, resolve, (err) => { + router.replace(route, resolve, err => { // https://github.com/vuejs/vue-router/blob/v3.4.3/src/util/errors.js - if (!err._isRouter) return reject(err) - if (err.type !== 2 /* NavigationFailureType.redirected */) return resolve() + if (!err._isRouter) return reject(err); + if (err.type !== 2 /* NavigationFailureType.redirected */) + return resolve(); // navigated to a different route in router guard const unregister = router.afterEach(async (to, from) => { if (process.server && ssrContext && ssrContext.url) { - ssrContext.url = to.fullPath + ssrContext.url = to.fullPath; } - app.context.route = await getRouteData(to) - app.context.params = to.params || {} - app.context.query = to.query || {} - unregister() - resolve() - }) - }) - }) + app.context.route = await getRouteData(to); + app.context.params = to.params || {}; + app.context.query = to.query || {}; + unregister(); + resolve(); + }); + }); + }); return { app, - router - } + router, + }; } -export { createApp, NuxtError } +export { createApp, NuxtError }; diff --git a/packages/client/src/jsonp.js b/packages/client/src/jsonp.js index 702adf2..ca79218 100644 --- a/packages/client/src/jsonp.js +++ b/packages/client/src/jsonp.js @@ -1,82 +1,93 @@ -const chunks = {} // chunkId => exports -const chunksInstalling = {} // chunkId => Promise -const failedChunks = {} +const chunks = {}; // chunkId => exports +const chunksInstalling = {}; // chunkId => Promise +const failedChunks = {}; function importChunk(chunkId, src) { // Already installed if (chunks[chunkId]) { - return Promise.resolve(chunks[chunkId]) + return Promise.resolve(chunks[chunkId]); } // Failed loading if (failedChunks[chunkId]) { - return Promise.reject(failedChunks[chunkId]) + return Promise.reject(failedChunks[chunkId]); } // Installing if (chunksInstalling[chunkId]) { - return chunksInstalling[chunkId] + return chunksInstalling[chunkId]; } // Set a promise in chunk cache - let resolve, reject - const promise = chunksInstalling[chunkId] = new Promise((_resolve, _reject) => { - resolve = _resolve - reject = _reject - }) + let resolve, reject; + const promise = (chunksInstalling[chunkId] = new Promise( + (_resolve, _reject) => { + resolve = _resolve; + reject = _reject; + }, + )); // Clear chunk data from cache - delete chunks[chunkId] + delete chunks[chunkId]; // Start chunk loading - const script = document.createElement('script') - script.charset = 'utf-8' - script.timeout = 120 - script.src = src - let timeout + const script = document.createElement('script'); + script.charset = 'utf-8'; + script.timeout = 120; + script.src = src; + let timeout; // Create error before stack unwound to get useful stacktrace later - const error = new Error() + const error = new Error(); // Complete handlers - const onScriptComplete = script.onerror = script.onload = (event) => { + const onScriptComplete = (script.onerror = script.onload = event => { // Cleanups - clearTimeout(timeout) - delete chunksInstalling[chunkId] + clearTimeout(timeout); + delete chunksInstalling[chunkId]; // Avoid mem leaks in IE - script.onerror = script.onload = null + script.onerror = script.onload = null; // Verify chunk is loaded if (chunks[chunkId]) { - return resolve(chunks[chunkId]) + return resolve(chunks[chunkId]); } // Something bad happened - const errorType = event && (event.type === 'load' ? 'missing' : event.type) - const realSrc = event && event.target && event.target.src - error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')' - error.name = 'ChunkLoadError' - error.type = errorType - error.request = realSrc - failedChunks[chunkId] = error - reject(error) - } + const errorType = event && (event.type === 'load' ? 'missing' : event.type); + const realSrc = event && event.target && event.target.src; + error.message = + 'Loading chunk ' + + chunkId + + ' failed.\n(' + + errorType + + ': ' + + realSrc + + ')'; + error.name = 'ChunkLoadError'; + error.type = errorType; + error.request = realSrc; + failedChunks[chunkId] = error; + reject(error); + }); // Timeout timeout = setTimeout(() => { - onScriptComplete({ type: 'timeout', target: script }) - }, 120000) + onScriptComplete({ type: 'timeout', target: script }); + }, 120000); // Append script - document.head.appendChild(script) + document.head.appendChild(script); // Return promise - return promise + return promise; } export function installJsonp() { - window.__NUXT_JSONP__ = function (chunkId, exports) { chunks[chunkId] = exports } - window.__NUXT_JSONP_CACHE__ = chunks - window.__NUXT_IMPORT__ = importChunk + window.__NUXT_JSONP__ = function(chunkId, exports) { + chunks[chunkId] = exports; + }; + window.__NUXT_JSONP_CACHE__ = chunks; + window.__NUXT_IMPORT__ = importChunk; } diff --git a/packages/client/src/middleware.js b/packages/client/src/middleware.js index 343ef95..e0d0641 100644 --- a/packages/client/src/middleware.js +++ b/packages/client/src/middleware.js @@ -1,3 +1,3 @@ -const middleware = {} +const middleware = {}; -export default middleware +export default middleware; diff --git a/packages/client/src/mixins/fetch.client.js b/packages/client/src/mixins/fetch.client.js index 017e559..099d7ce 100644 --- a/packages/client/src/mixins/fetch.client.js +++ b/packages/client/src/mixins/fetch.client.js @@ -1,90 +1,103 @@ -import Vue from 'vue' -import { hasFetch, normalizeError, addLifecycleHook, createGetCounter } from '../utils' - -const isSsrHydration = (vm) => vm.$vnode && vm.$vnode.elm && vm.$vnode.elm.dataset && vm.$vnode.elm.dataset.fetchKey -const nuxtState = window.__NUXT__ +import Vue from 'vue'; +import { + hasFetch, + normalizeError, + addLifecycleHook, + createGetCounter, +} from '../utils'; + +const isSsrHydration = vm => + vm.$vnode && + vm.$vnode.elm && + vm.$vnode.elm.dataset && + vm.$vnode.elm.dataset.fetchKey; +const nuxtState = window.__NUXT__; export default { - beforeCreate () { + beforeCreate() { if (!hasFetch(this)) { - return + return; } - this._fetchDelay = typeof this.$options.fetchDelay === 'number' ? this.$options.fetchDelay : 200 + this._fetchDelay = + typeof this.$options.fetchDelay === 'number' + ? this.$options.fetchDelay + : 200; Vue.util.defineReactive(this, '$fetchState', { pending: false, error: null, - timestamp: Date.now() - }) + timestamp: Date.now(), + }); - this.$fetch = $fetch.bind(this) - addLifecycleHook(this, 'created', created) - addLifecycleHook(this, 'beforeMount', beforeMount) - } -} + this.$fetch = $fetch.bind(this); + addLifecycleHook(this, 'created', created); + addLifecycleHook(this, 'beforeMount', beforeMount); + }, +}; function beforeMount() { if (!this._hydrated) { - return this.$fetch() + return this.$fetch(); } } function created() { if (!isSsrHydration(this)) { - return + return; } // Hydrate component - this._hydrated = true - this._fetchKey = this.$vnode.elm.dataset.fetchKey - const data = nuxtState.fetch[this._fetchKey] + this._hydrated = true; + this._fetchKey = this.$vnode.elm.dataset.fetchKey; + const data = nuxtState.fetch[this._fetchKey]; // If fetch error if (data && data._error) { - this.$fetchState.error = data._error - return + this.$fetchState.error = data._error; + return; } // Merge data for (const key in data) { - Vue.set(this.$data, key, data[key]) + Vue.set(this.$data, key, data[key]); } } function $fetch() { if (!this._fetchPromise) { - this._fetchPromise = $_fetch.call(this) - .then(() => { delete this._fetchPromise }) + this._fetchPromise = $_fetch.call(this).then(() => { + delete this._fetchPromise; + }); } - return this._fetchPromise + return this._fetchPromise; } async function $_fetch() { - this.$nuxt.nbFetching++ - this.$fetchState.pending = true - this.$fetchState.error = null - this._hydrated = false - let error = null - const startTime = Date.now() + this.$nuxt.nbFetching++; + this.$fetchState.pending = true; + this.$fetchState.error = null; + this._hydrated = false; + let error = null; + const startTime = Date.now(); try { - await this.$options.fetch.call(this) + await this.$options.fetch.call(this); } catch (err) { if (process.dev) { - console.error('Error in fetch():', err) + console.error('Error in fetch():', err); } - error = normalizeError(err) + error = normalizeError(err); } - const delayLeft = this._fetchDelay - (Date.now() - startTime) + const delayLeft = this._fetchDelay - (Date.now() - startTime); if (delayLeft > 0) { - await new Promise(resolve => setTimeout(resolve, delayLeft)) + await new Promise(resolve => setTimeout(resolve, delayLeft)); } - this.$fetchState.error = error - this.$fetchState.pending = false - this.$fetchState.timestamp = Date.now() + this.$fetchState.error = error; + this.$fetchState.pending = false; + this.$fetchState.timestamp = Date.now(); - this.$nextTick(() => this.$nuxt.nbFetching--) + this.$nextTick(() => this.$nuxt.nbFetching--); } diff --git a/packages/client/src/mixins/fetch.server.js b/packages/client/src/mixins/fetch.server.js index 24a0068..7509c7d 100644 --- a/packages/client/src/mixins/fetch.server.js +++ b/packages/client/src/mixins/fetch.server.js @@ -1,69 +1,86 @@ -import Vue from 'vue' -import { hasFetch, normalizeError, addLifecycleHook, purifyData, createGetCounter } from '../utils' +import Vue from 'vue'; +import { + hasFetch, + normalizeError, + addLifecycleHook, + purifyData, + createGetCounter, +} from '../utils'; async function serverPrefetch() { if (!this._fetchOnServer) { - return + return; } // Call and await on $fetch try { - await this.$options.fetch.call(this) + await this.$options.fetch.call(this); } catch (err) { if (process.dev) { - console.error('Error in fetch():', err) + console.error('Error in fetch():', err); } - this.$fetchState.error = normalizeError(err) + this.$fetchState.error = normalizeError(err); } - this.$fetchState.pending = false + this.$fetchState.pending = false; // Define an ssrKey for hydration - this._fetchKey = this._fetchKey || this.$ssrContext.fetchCounters['']++ + this._fetchKey = this._fetchKey || this.$ssrContext.fetchCounters['']++; // Add data-fetch-key on parent element of Component - const attrs = this.$vnode.data.attrs = this.$vnode.data.attrs || {} - attrs['data-fetch-key'] = this._fetchKey + const attrs = (this.$vnode.data.attrs = this.$vnode.data.attrs || {}); + attrs['data-fetch-key'] = this._fetchKey; // Add to ssrContext for window.__NUXT__.fetch if (this.$ssrContext.nuxt.fetch[this._fetchKey] !== undefined) { - console.warn(`Duplicate fetch key detected (${this._fetchKey}). This may lead to unexpected results.`) + console.warn( + `Duplicate fetch key detected (${this._fetchKey}). This may lead to unexpected results.`, + ); } - this.$ssrContext.nuxt.fetch[this._fetchKey] = - this.$fetchState.error ? { _error: this.$fetchState.error } : purifyData(this._data) + this.$ssrContext.nuxt.fetch[this._fetchKey] = this.$fetchState.error + ? { _error: this.$fetchState.error } + : purifyData(this._data); } export default { created() { if (!hasFetch(this)) { - return + return; } if (typeof this.$options.fetchOnServer === 'function') { - this._fetchOnServer = this.$options.fetchOnServer.call(this) !== false + this._fetchOnServer = this.$options.fetchOnServer.call(this) !== false; } else { - this._fetchOnServer = this.$options.fetchOnServer !== false + this._fetchOnServer = this.$options.fetchOnServer !== false; } - const defaultKey = this.$options._scopeId || this.$options.name || '' - const getCounter = createGetCounter(this.$ssrContext.fetchCounters, defaultKey) + const defaultKey = this.$options._scopeId || this.$options.name || ''; + const getCounter = createGetCounter( + this.$ssrContext.fetchCounters, + defaultKey, + ); if (typeof this.$options.fetchKey === 'function') { - this._fetchKey = this.$options.fetchKey.call(this, getCounter) + this._fetchKey = this.$options.fetchKey.call(this, getCounter); } else { - const key = 'string' === typeof this.$options.fetchKey ? this.$options.fetchKey : defaultKey - this._fetchKey = key ? key + ':' + getCounter(key) : String(getCounter(key)) + const key = + 'string' === typeof this.$options.fetchKey + ? this.$options.fetchKey + : defaultKey; + this._fetchKey = key + ? key + ':' + getCounter(key) + : String(getCounter(key)); } // Added for remove vue undefined warning while ssr - this.$fetch = () => {} // issue #8043 + this.$fetch = () => {}; // issue #8043 Vue.util.defineReactive(this, '$fetchState', { pending: true, error: null, - timestamp: Date.now() - }) + timestamp: Date.now(), + }); - addLifecycleHook(this, 'serverPrefetch', serverPrefetch) - } -} + addLifecycleHook(this, 'serverPrefetch', serverPrefetch); + }, +}; diff --git a/packages/client/src/router.scrollBehavior.js b/packages/client/src/router.scrollBehavior.js index 4d42dcc..fe5097f 100644 --- a/packages/client/src/router.scrollBehavior.js +++ b/packages/client/src/router.scrollBehavior.js @@ -1,45 +1,45 @@ -import { getMatchedComponents, setScrollRestoration } from './utils' +import { getMatchedComponents, setScrollRestoration } from './utils'; if (process.client) { if ('scrollRestoration' in window.history) { - setScrollRestoration('manual') + setScrollRestoration('manual'); // reset scrollRestoration to auto when leaving page, allowing page reload // and back-navigation from other pages to use the browser to restore the // scrolling position. window.addEventListener('beforeunload', () => { - setScrollRestoration('auto') - }) + setScrollRestoration('auto'); + }); // Setting scrollRestoration to manual again when returning to this page. window.addEventListener('load', () => { - setScrollRestoration('manual') - }) + setScrollRestoration('manual'); + }); } } function shouldScrollToTop(route) { - const Pages = getMatchedComponents(route) - if (Pages.length === 1) { - const { options = {} } = Pages[0] - return options.scrollToTop !== false - } - return Pages.some(({ options }) => options && options.scrollToTop) + const Pages = getMatchedComponents(route); + if (Pages.length === 1) { + const { options = {} } = Pages[0]; + return options.scrollToTop !== false; + } + return Pages.some(({ options }) => options && options.scrollToTop); } -export default function (to, from, savedPosition) { +export default function(to, from, savedPosition) { // If the returned position is falsy or an empty object, will retain current scroll position - let position = false - const isRouteChanged = to !== from + let position = false; + const isRouteChanged = to !== from; // savedPosition is only available for popstate navigations (back button) if (savedPosition) { - position = savedPosition + position = savedPosition; } else if (isRouteChanged && shouldScrollToTop(to)) { - position = { x: 0, y: 0 } + position = { x: 0, y: 0 }; } - const nuxt = window.$nuxt + const nuxt = window.$nuxt; if ( // Initial load (vuejs/vue-router#3199) @@ -47,30 +47,35 @@ export default function (to, from, savedPosition) { // Route hash changes (to.path === from.path && to.hash !== from.hash) ) { - nuxt.$nextTick(() => nuxt.$emit('triggerScroll')) + nuxt.$nextTick(() => nuxt.$emit('triggerScroll')); } - return new Promise((resolve) => { + return new Promise(resolve => { // wait for the out transition to complete (if necessary) nuxt.$once('triggerScroll', () => { // coords will be used if no selector is provided, // or if the selector didn't match any element. if (to.hash) { - let hash = to.hash + let hash = to.hash; // CSS.escape() is not supported with IE and Edge. - if (typeof window.CSS !== 'undefined' && typeof window.CSS.escape !== 'undefined') { - hash = '#' + window.CSS.escape(hash.substr(1)) + if ( + typeof window.CSS !== 'undefined' && + typeof window.CSS.escape !== 'undefined' + ) { + hash = '#' + window.CSS.escape(hash.substr(1)); } try { if (document.querySelector(hash)) { // scroll to anchor by returning the selector - position = { selector: hash } + position = { selector: hash }; } } catch (e) { - console.warn('Failed to save scroll position. Please add CSS.escape() polyfill (https://github.com/mathiasbynens/CSS.escape).') + console.warn( + 'Failed to save scroll position. Please add CSS.escape() polyfill (https://github.com/mathiasbynens/CSS.escape).', + ); } } - resolve(position) - }) - }) + resolve(position); + }); + }); } diff --git a/packages/client/src/server.js b/packages/client/src/server.js index bf67fb2..675ab42 100644 --- a/packages/client/src/server.js +++ b/packages/client/src/server.js @@ -1,288 +1,335 @@ -import Vue from 'vue' -import { joinURL, normalizeURL, withQuery } from 'ufo' -import fetch from 'node-fetch' -import middleware from './middleware.js' +import Vue from 'vue'; +import { joinURL, normalizeURL, withQuery } from 'ufo'; +import fetch from 'node-fetch'; +import middleware from './middleware.js'; import { applyAsyncData, middlewareSeries, sanitizeComponent, getMatchedComponents, - promisify -} from './utils.js' -import fetchMixin from './mixins/fetch.server' -import { createApp, NuxtError } from './index.js' -import NuxtLink from './components/nuxt-link.server.js' // should be included after ./index.js + promisify, +} from './utils.js'; +import fetchMixin from './mixins/fetch.server'; +import { createApp, NuxtError } from './index.js'; +import NuxtLink from './components/nuxt-link.server.js'; // should be included after ./index.js // Update serverPrefetch strategy -Vue.config.optionMergeStrategies.serverPrefetch = Vue.config.optionMergeStrategies.created +Vue.config.optionMergeStrategies.serverPrefetch = + Vue.config.optionMergeStrategies.created; // Fetch mixin if (!Vue.__nuxt__fetch__mixin__) { - Vue.mixin(fetchMixin) - Vue.__nuxt__fetch__mixin__ = true + Vue.mixin(fetchMixin); + Vue.__nuxt__fetch__mixin__ = true; } if (!Vue.__original_use__) { - Vue.__original_use__ = Vue.use - Vue.__install_times__ = 0 - Vue.use = function (plugin, ...args) { - plugin.__nuxt_external_installed__ = Vue._installedPlugins.includes(plugin) - return Vue.__original_use__(plugin, ...args) - } + Vue.__original_use__ = Vue.use; + Vue.__install_times__ = 0; + Vue.use = function(plugin, ...args) { + plugin.__nuxt_external_installed__ = Vue._installedPlugins.includes(plugin); + return Vue.__original_use__(plugin, ...args); + }; } if (Vue.__install_times__ === 2) { - Vue.__install_times__ = 0 + Vue.__install_times__ = 0; Vue._installedPlugins = Vue._installedPlugins.filter(plugin => { - return plugin.__nuxt_external_installed__ === true - }) + return plugin.__nuxt_external_installed__ === true; + }); } -Vue.__install_times__++ +Vue.__install_times__++; // Component: -Vue.component(NuxtLink.name, NuxtLink) -Vue.component('NLink', NuxtLink) +Vue.component(NuxtLink.name, NuxtLink); +Vue.component('NLink', NuxtLink); -if (!global.fetch) { global.fetch = fetch } +if (!global.fetch) { + global.fetch = fetch; +} -const noopApp = () => new Vue({ render: h => h('div', { domProps: { id: '__nuxt' } }) }) +const noopApp = () => + new Vue({ render: h => h('div', { domProps: { id: '__nuxt' } }) }); -const createNext = ssrContext => (opts) => { +const createNext = ssrContext => opts => { // If static target, render on client-side - ssrContext.redirected = opts + ssrContext.redirected = opts; if (ssrContext.target === 'static' || !ssrContext.res) { - ssrContext.nuxt.serverRendered = false - return + ssrContext.nuxt.serverRendered = false; + return; } - let fullPath = withQuery(opts.path, opts.query) - const $config = ssrContext.runtimeConfig || {} - const routerBase = ($config._app && $config._app.basePath) || '/' - if (!fullPath.startsWith('http') && (routerBase !== '/' && !fullPath.startsWith(routerBase))) { - fullPath = joinURL(routerBase, fullPath) + let fullPath = withQuery(opts.path, opts.query); + const $config = ssrContext.runtimeConfig || {}; + const routerBase = ($config._app && $config._app.basePath) || '/'; + if ( + !fullPath.startsWith('http') && + routerBase !== '/' && !fullPath.startsWith(routerBase) + ) { + fullPath = joinURL(routerBase, fullPath); } // Avoid loop redirect if (decodeURI(fullPath) === decodeURI(ssrContext.url)) { - ssrContext.redirected = false - return + ssrContext.redirected = false; + return; } ssrContext.res.writeHead(opts.status, { - Location: normalizeURL(fullPath) - }) - ssrContext.res.end() -} + Location: normalizeURL(fullPath), + }); + ssrContext.res.end(); +}; // This exported function will be called by `bundleRenderer`. // This is where we perform data-prefetching to determine the // state of our application before actually rendering it. // Since data fetching is async, this function is expected to // return a Promise that resolves to the app instance. -export default async (ssrContext) => { +export default async ssrContext => { // Create ssrContext.next for simulate next() of beforeEach() when wanted to redirect - ssrContext.redirected = false - ssrContext.next = createNext(ssrContext) + ssrContext.redirected = false; + ssrContext.next = createNext(ssrContext); // Used for beforeNuxtRender({ Components, nuxtState }) - ssrContext.beforeRenderFns = [] + ssrContext.beforeRenderFns = []; // Nuxt object (window.{{globals.context}}, defaults to window.__NUXT__) - ssrContext.nuxt = { layout: 'default', data: [], fetch: {}, error: null, serverRendered: true, routePath: '' } + ssrContext.nuxt = { + layout: 'default', + data: [], + fetch: {}, + error: null, + serverRendered: true, + routePath: '', + }; - ssrContext.fetchCounters = {} + ssrContext.fetchCounters = {}; // Remove query from url is static target // Public runtime config - ssrContext.nuxt.config = ssrContext.runtimeConfig.public + ssrContext.nuxt.config = ssrContext.runtimeConfig.public; if (ssrContext.nuxt.config._app) { - __webpack_public_path__ = joinURL(ssrContext.nuxt.config._app.cdnURL, ssrContext.nuxt.config._app.assetsPath) + __webpack_public_path__ = joinURL( + ssrContext.nuxt.config._app.cdnURL, + ssrContext.nuxt.config._app.assetsPath, + ); } // Create the app definition and the instance (created for each request) - const { app, router } = await createApp(ssrContext, ssrContext.runtimeConfig.private) - const _app = new Vue(app) + const { app, router } = await createApp( + ssrContext, + ssrContext.runtimeConfig.private, + ); + const _app = new Vue(app); // Add ssr route path to nuxt context so we can account for page navigation between ssr and csr - ssrContext.nuxt.routePath = app.context.route.path + ssrContext.nuxt.routePath = app.context.route.path; // Add meta infos (used in renderer.js) - ssrContext.meta = _app.$meta() + ssrContext.meta = _app.$meta(); // Keep asyncData for each matched component in ssrContext (used in app/utils.js via this.$ssrContext) - ssrContext.asyncData = {} + ssrContext.asyncData = {}; const beforeRender = async () => { // Call beforeNuxtRender() methods - await Promise.all(ssrContext.beforeRenderFns.map(fn => promisify(fn, { Components, nuxtState: ssrContext.nuxt }))) - } + await Promise.all( + ssrContext.beforeRenderFns.map(fn => + promisify(fn, { Components, nuxtState: ssrContext.nuxt }), + ), + ); + }; const renderErrorPage = async () => { // Don't server-render the page in static target if (ssrContext.target === 'static') { - ssrContext.nuxt.serverRendered = false + ssrContext.nuxt.serverRendered = false; } // Load layout for error page - const layout = (NuxtError.options || NuxtError).layout - const errLayout = typeof layout === 'function' ? layout.call(NuxtError, app.context) : layout - ssrContext.nuxt.layout = errLayout || 'default' - await _app.loadLayout(errLayout) - _app.setLayout(errLayout) - - await beforeRender() - return _app - } + const layout = (NuxtError.options || NuxtError).layout; + const errLayout = + typeof layout === 'function' + ? layout.call(NuxtError, app.context) + : layout; + ssrContext.nuxt.layout = errLayout || 'default'; + await _app.loadLayout(errLayout); + _app.setLayout(errLayout); + + await beforeRender(); + return _app; + }; const render404Page = () => { - app.context.error({ statusCode: 404, path: ssrContext.url, message: 'This page could not be found' }) - return renderErrorPage() - } + app.context.error({ + statusCode: 404, + path: ssrContext.url, + message: 'This page could not be found', + }); + return renderErrorPage(); + }; - const s = Date.now() + const s = Date.now(); // Components are already resolved by setContext -> getRouteData (app/utils.js) - const Components = getMatchedComponents(app.context.route) + const Components = getMatchedComponents(app.context.route); /* - ** Call global middleware (nuxt.config.js) - */ - let midd = [] - midd = midd.map((name) => { + ** Call global middleware (nuxt.config.js) + */ + let midd = []; + midd = midd.map(name => { if (typeof name === 'function') { - return name + return name; } if (typeof middleware[name] !== 'function') { - app.context.error({ statusCode: 500, message: 'Unknown middleware ' + name }) + app.context.error({ + statusCode: 500, + message: 'Unknown middleware ' + name, + }); } - return middleware[name] - }) - await middlewareSeries(midd, app.context) + return middleware[name]; + }); + await middlewareSeries(midd, app.context); // ...If there is a redirect or an error, stop the process if (ssrContext.redirected) { - return noopApp() + return noopApp(); } if (ssrContext.nuxt.error) { - return renderErrorPage() + return renderErrorPage(); } /* - ** Set layout - */ - let layout = Components.length ? Components[0].options.layout : NuxtError.layout + ** Set layout + */ + let layout = Components.length + ? Components[0].options.layout + : NuxtError.layout; if (typeof layout === 'function') { - layout = layout(app.context) + layout = layout(app.context); } - await _app.loadLayout(layout) + await _app.loadLayout(layout); if (ssrContext.nuxt.error) { - return renderErrorPage() + return renderErrorPage(); } - layout = _app.setLayout(layout) - ssrContext.nuxt.layout = _app.layoutName + layout = _app.setLayout(layout); + ssrContext.nuxt.layout = _app.layoutName; /* - ** Call middleware (layout + pages) - */ - midd = [] + ** Call middleware (layout + pages) + */ + midd = []; - layout = sanitizeComponent(layout) + layout = sanitizeComponent(layout); if (layout.options.middleware) { - midd = midd.concat(layout.options.middleware) + midd = midd.concat(layout.options.middleware); } - Components.forEach((Component) => { + Components.forEach(Component => { if (Component.options.middleware) { - midd = midd.concat(Component.options.middleware) + midd = midd.concat(Component.options.middleware); } - }) - midd = midd.map((name) => { + }); + midd = midd.map(name => { if (typeof name === 'function') { - return name + return name; } if (typeof middleware[name] !== 'function') { - app.context.error({ statusCode: 500, message: 'Unknown middleware ' + name }) + app.context.error({ + statusCode: 500, + message: 'Unknown middleware ' + name, + }); } - return middleware[name] - }) - await middlewareSeries(midd, app.context) + return middleware[name]; + }); + await middlewareSeries(midd, app.context); // ...If there is a redirect or an error, stop the process if (ssrContext.redirected) { - return noopApp() + return noopApp(); } if (ssrContext.nuxt.error) { - return renderErrorPage() + return renderErrorPage(); } /* - ** Call .validate() - */ - let isValid = true + ** Call .validate() + */ + let isValid = true; try { for (const Component of Components) { if (typeof Component.options.validate !== 'function') { - continue + continue; } - isValid = await Component.options.validate(app.context) + isValid = await Component.options.validate(app.context); if (!isValid) { - break + break; } } } catch (validationError) { // ...If .validate() threw an error app.context.error({ statusCode: validationError.statusCode || '500', - message: validationError.message - }) - return renderErrorPage() + message: validationError.message, + }); + return renderErrorPage(); } // ...If .validate() returned false if (!isValid) { // Render a 404 error page - return render404Page() + return render404Page(); } // If no Components found, returns 404 if (!Components.length) { - return render404Page() + return render404Page(); } // Call asyncData & fetch hooks on components matched by the route. - const asyncDatas = await Promise.all(Components.map((Component) => { - const promises = [] - - // Call asyncData(context) - if (Component.options.asyncData && typeof Component.options.asyncData === 'function') { - const promise = promisify(Component.options.asyncData, app.context) - promise.then((asyncDataResult) => { - ssrContext.asyncData[Component.cid] = asyncDataResult - applyAsyncData(Component) - return asyncDataResult - }) - promises.push(promise) - } else { - promises.push(null) - } + const asyncDatas = await Promise.all( + Components.map(Component => { + const promises = []; + + // Call asyncData(context) + if ( + Component.options.asyncData && + typeof Component.options.asyncData === 'function' + ) { + const promise = promisify(Component.options.asyncData, app.context); + promise.then(asyncDataResult => { + ssrContext.asyncData[Component.cid] = asyncDataResult; + applyAsyncData(Component); + return asyncDataResult; + }); + promises.push(promise); + } else { + promises.push(null); + } - // Call fetch(context) - if (Component.options.fetch && Component.options.fetch.length) { - promises.push(Component.options.fetch(app.context)) - } else { - promises.push(null) - } + // Call fetch(context) + if (Component.options.fetch && Component.options.fetch.length) { + promises.push(Component.options.fetch(app.context)); + } else { + promises.push(null); + } - return Promise.all(promises) - })) + return Promise.all(promises); + }), + ); - if (process.env.DEBUG && asyncDatas.length) console.debug('Data fetching ' + ssrContext.url + ': ' + (Date.now() - s) + 'ms') + if (process.env.DEBUG && asyncDatas.length) + console.debug( + 'Data fetching ' + ssrContext.url + ': ' + (Date.now() - s) + 'ms', + ); // datas are the first row of each - ssrContext.nuxt.data = asyncDatas.map(r => r[0] || {}) + ssrContext.nuxt.data = asyncDatas.map(r => r[0] || {}); // ...If there is a redirect or an error, stop the process if (ssrContext.redirected) { - return noopApp() + return noopApp(); } if (ssrContext.nuxt.error) { - return renderErrorPage() + return renderErrorPage(); } // Call beforeNuxtRender methods & add store state - await beforeRender() + await beforeRender(); - return _app -} + return _app; +}; diff --git a/packages/client/src/utils.js b/packages/client/src/utils.js index 405dc87..11dd8aa 100644 --- a/packages/client/src/utils.js +++ b/packages/client/src/utils.js @@ -1,150 +1,178 @@ -import Vue from 'vue' -import { isSamePath as _isSamePath, joinURL, normalizeURL, withQuery, withoutTrailingSlash } from 'ufo' +import Vue from 'vue'; +import { + isSamePath as _isSamePath, + joinURL, + normalizeURL, + withQuery, + withoutTrailingSlash, +} from 'ufo'; // window.{{globals.loadedCallback}} hook // Useful for jsdom testing or plugins (https://github.com/tmpvar/jsdom#dealing-with-asynchronous-script-loading) if (process.client) { - window.onNuxtReadyCbs = [] - window.onNuxtReady = (cb) => { - window.onNuxtReadyCbs.push(cb) - } + window.onNuxtReadyCbs = []; + window.onNuxtReady = cb => { + window.onNuxtReadyCbs.push(cb); + }; } -export function createGetCounter (counterObject, defaultKey = '') { - return function getCounter (id = defaultKey) { +export function createGetCounter(counterObject, defaultKey = '') { + return function getCounter(id = defaultKey) { if (counterObject[id] === undefined) { - counterObject[id] = 0 + counterObject[id] = 0; } - return counterObject[id]++ - } + return counterObject[id]++; + }; } -export function empty () {} +export function empty() {} -export function globalHandleError (error) { +export function globalHandleError(error) { if (Vue.config.errorHandler) { - Vue.config.errorHandler(error) + Vue.config.errorHandler(error); } } -export function interopDefault (promise) { - return promise.then(m => m.default || m) +export function interopDefault(promise) { + return promise.then(m => m.default || m); } export function hasFetch(vm) { - return vm.$options && typeof vm.$options.fetch === 'function' && !vm.$options.fetch.length + return ( + vm.$options && + typeof vm.$options.fetch === 'function' && + !vm.$options.fetch.length + ); } export function purifyData(data) { if (process.env.NODE_ENV === 'production') { - return data + return data; } - return Object.entries(data).filter( - ([key, value]) => { - const valid = !(value instanceof Function) && !(value instanceof Promise) + return Object.entries(data) + .filter(([key, value]) => { + const valid = !(value instanceof Function) && !(value instanceof Promise); if (!valid) { - console.warn(`${key} is not able to be stringified. This will break in a production environment.`) + console.warn( + `${key} is not able to be stringified. This will break in a production environment.`, + ); } - return valid - } - ).reduce((obj, [key, value]) => { - obj[key] = value - return obj - }, {}) + return valid; + }) + .reduce((obj, [key, value]) => { + obj[key] = value; + return obj; + }, {}); } export function getChildrenComponentInstancesUsingFetch(vm, instances = []) { - const children = vm.$children || [] + const children = vm.$children || []; for (const child of children) { if (child.$fetch) { - instances.push(child) + instances.push(child); continue; // Don't get the children since it will reload the template } if (child.$children) { - getChildrenComponentInstancesUsingFetch(child, instances) + getChildrenComponentInstancesUsingFetch(child, instances); } } - return instances + return instances; } -export function applyAsyncData (Component, asyncData) { +export function applyAsyncData(Component, asyncData) { if ( // For SSR, we once all this function without second param to just apply asyncData // Prevent doing this for each SSR request - !asyncData && Component.options.__hasNuxtData + !asyncData && + Component.options.__hasNuxtData ) { - return + return; } - const ComponentData = Component.options._originDataFn || Component.options.data || function () { return {} } - Component.options._originDataFn = ComponentData + const ComponentData = + Component.options._originDataFn || + Component.options.data || + function() { + return {}; + }; + Component.options._originDataFn = ComponentData; - Component.options.data = function () { - const data = ComponentData.call(this, this) + Component.options.data = function() { + const data = ComponentData.call(this, this); if (this.$ssrContext) { - asyncData = this.$ssrContext.asyncData[Component.cid] + asyncData = this.$ssrContext.asyncData[Component.cid]; } - return { ...data, ...asyncData } - } + return { ...data, ...asyncData }; + }; - Component.options.__hasNuxtData = true + Component.options.__hasNuxtData = true; if (Component._Ctor && Component._Ctor.options) { - Component._Ctor.options.data = Component.options.data + Component._Ctor.options.data = Component.options.data; } } -export function sanitizeComponent (Component) { +export function sanitizeComponent(Component) { // If Component already sanitized if (Component.options && Component._Ctor === Component) { - return Component + return Component; } if (!Component.options) { - Component = Vue.extend(Component) // fix issue #6 - Component._Ctor = Component + Component = Vue.extend(Component); // fix issue #6 + Component._Ctor = Component; } else { - Component._Ctor = Component - Component.extendOptions = Component.options + Component._Ctor = Component; + Component.extendOptions = Component.options; } // If no component name defined, set file path as name, (also fixes #5703) if (!Component.options.name && Component.options.__file) { - Component.options.name = Component.options.__file + Component.options.name = Component.options.__file; } - return Component + return Component; } -export function getMatchedComponents (route, matches = false, prop = 'components') { - return Array.prototype.concat.apply([], route.matched.map((m, index) => { - return Object.keys(m[prop]).map((key) => { - matches && matches.push(index) - return m[prop][key] - }) - })) +export function getMatchedComponents( + route, + matches = false, + prop = 'components', +) { + return Array.prototype.concat.apply( + [], + route.matched.map((m, index) => { + return Object.keys(m[prop]).map(key => { + matches && matches.push(index); + return m[prop][key]; + }); + }), + ); } -export function getMatchedComponentsInstances (route, matches = false) { - return getMatchedComponents(route, matches, 'instances') +export function getMatchedComponentsInstances(route, matches = false) { + return getMatchedComponents(route, matches, 'instances'); } -export function flatMapComponents (route, fn) { - return Array.prototype.concat.apply([], route.matched.map((m, index) => { - return Object.keys(m.components).reduce((promises, key) => { - if (m.components[key]) { - promises.push(fn(m.components[key], m.instances[key], m, key, index)) - } else { - delete m.components[key] - } - return promises - }, []) - })) +export function flatMapComponents(route, fn) { + return Array.prototype.concat.apply( + [], + route.matched.map((m, index) => { + return Object.keys(m.components).reduce((promises, key) => { + if (m.components[key]) { + promises.push(fn(m.components[key], m.instances[key], m, key, index)); + } else { + delete m.components[key]; + } + return promises; + }, []); + }), + ); } -export function resolveRouteComponents (route, fn) { +export function resolveRouteComponents(route, fn) { return Promise.all( flatMapComponents(route, async (Component, instance, match, key) => { // If component is a function, resolve it if (typeof Component === 'function' && !Component.options) { try { - Component = await Component() + Component = await Component(); } catch (error) { // Handle webpack chunk loading errors // This may be due to a new deployment or a network problem @@ -154,41 +182,48 @@ export function resolveRouteComponents (route, fn) { typeof window !== 'undefined' && window.sessionStorage ) { - const timeNow = Date.now() - const previousReloadTime = parseInt(window.sessionStorage.getItem('nuxt-reload')) + const timeNow = Date.now(); + const previousReloadTime = parseInt( + window.sessionStorage.getItem('nuxt-reload'), + ); // check for previous reload time not to reload infinitely if (!previousReloadTime || previousReloadTime + 60000 < timeNow) { - window.sessionStorage.setItem('nuxt-reload', timeNow) - window.location.reload(true /* skip cache */) + window.sessionStorage.setItem('nuxt-reload', timeNow); + window.location.reload(true /* skip cache */); } } - throw error + throw error; } } - match.components[key] = Component = sanitizeComponent(Component) - return typeof fn === 'function' ? fn(Component, instance, match, key) : Component - }) - ) + match.components[key] = Component = sanitizeComponent(Component); + return typeof fn === 'function' + ? fn(Component, instance, match, key) + : Component; + }), + ); } -export async function getRouteData (route) { +export async function getRouteData(route) { if (!route) { - return + return; } // Make sure the components are resolved (code-splitting) - await resolveRouteComponents(route) + await resolveRouteComponents(route); // Send back a copy of route with meta based on Component definition return { ...route, meta: getMatchedComponents(route).map((Component, index) => { - return { ...Component.options.meta, ...(route.matched[index] || {}).meta } - }) - } + return { + ...Component.options.meta, + ...(route.matched[index] || {}).meta, + }; + }), + }; } -export async function setContext (app, context) { +export async function setContext(app, context) { // If context not defined, create it if (!app.context) { app.context = { @@ -200,142 +235,151 @@ export async function setContext (app, context) { payload: context.payload, error: context.error, base: app.router.options.base, - env: {} - } + env: {}, + }; // Only set once if (context.req) { - app.context.req = context.req + app.context.req = context.req; } if (context.res) { - app.context.res = context.res + app.context.res = context.res; } if (context.ssrContext) { - app.context.ssrContext = context.ssrContext + app.context.ssrContext = context.ssrContext; } app.context.redirect = (status, path, query) => { if (!status) { - return + return; } - app.context._redirected = true + app.context._redirected = true; // if only 1 or 2 arguments: redirect('/') or redirect('/', { foo: 'bar' }) - let pathType = typeof path - if (typeof status !== 'number' && (pathType === 'undefined' || pathType === 'object')) { - query = path || {} - path = status - pathType = typeof path - status = 302 + let pathType = typeof path; + if ( + typeof status !== 'number' && + (pathType === 'undefined' || pathType === 'object') + ) { + query = path || {}; + path = status; + pathType = typeof path; + status = 302; } if (pathType === 'object') { - path = app.router.resolve(path).route.fullPath + path = app.router.resolve(path).route.fullPath; } // "/absolute/route", "./relative/route" or "../relative/route" if (/(^[.]{1,2}\/)|(^\/(?!\/))/.test(path)) { app.context.next({ path, query, - status - }) + status, + }); } else { - path = withQuery(path, query) + path = withQuery(path, query); if (process.server) { app.context.next({ path, - status - }) + status, + }); } if (process.client) { // https://developer.mozilla.org/en-US/docs/Web/API/Location/replace - window.location.replace(path) + window.location.replace(path); // Throw a redirect error - throw new Error('ERR_REDIRECT') + throw new Error('ERR_REDIRECT'); } } - } + }; if (process.server) { - app.context.beforeNuxtRender = fn => context.beforeRenderFns.push(fn) + app.context.beforeNuxtRender = fn => context.beforeRenderFns.push(fn); } if (process.client) { - app.context.nuxtState = window.__NUXT__ + app.context.nuxtState = window.__NUXT__; } } // Dynamic keys const [currentRouteData, fromRouteData] = await Promise.all([ getRouteData(context.route), - getRouteData(context.from) - ]) + getRouteData(context.from), + ]); if (context.route) { - app.context.route = currentRouteData + app.context.route = currentRouteData; } if (context.from) { - app.context.from = fromRouteData + app.context.from = fromRouteData; } - app.context.next = context.next - app.context._redirected = false - app.context._errored = false - app.context.isHMR = Boolean(context.isHMR) - app.context.params = app.context.route.params || {} - app.context.query = app.context.route.query || {} + app.context.next = context.next; + app.context._redirected = false; + app.context._errored = false; + app.context.isHMR = Boolean(context.isHMR); + app.context.params = app.context.route.params || {}; + app.context.query = app.context.route.query || {}; } -export function middlewareSeries (promises, appContext) { +export function middlewareSeries(promises, appContext) { if (!promises.length || appContext._redirected || appContext._errored) { - return Promise.resolve() + return Promise.resolve(); } - return promisify(promises[0], appContext) - .then(() => { - return middlewareSeries(promises.slice(1), appContext) - }) + return promisify(promises[0], appContext).then(() => { + return middlewareSeries(promises.slice(1), appContext); + }); } -export function promisify (fn, context) { - let promise +export function promisify(fn, context) { + let promise; if (fn.length === 2) { - console.warn('Callback-based asyncData, fetch or middleware calls are deprecated. ' + - 'Please switch to promises or async/await syntax') + console.warn( + 'Callback-based asyncData, fetch or middleware calls are deprecated. ' + + 'Please switch to promises or async/await syntax', + ); // fn(context, callback) - promise = new Promise((resolve) => { - fn(context, function (err, data) { + promise = new Promise(resolve => { + fn(context, function(err, data) { if (err) { - context.error(err) + context.error(err); } - data = data || {} - resolve(data) - }) - }) + data = data || {}; + resolve(data); + }); + }); } else { - promise = fn(context) + promise = fn(context); } - if (promise && promise instanceof Promise && typeof promise.then === 'function') { - return promise + if ( + promise && + promise instanceof Promise && + typeof promise.then === 'function' + ) { + return promise; } - return Promise.resolve(promise) + return Promise.resolve(promise); } // Imported from vue-router -export function getLocation (base, mode) { +export function getLocation(base, mode) { if (mode === 'hash') { - return window.location.hash.replace(/^#\//, '') + return window.location.hash.replace(/^#\//, ''); } - base = decodeURI(base).slice(0, -1) // consideration is base is normalized with trailing slash - let path = decodeURI(window.location.pathname) + base = decodeURI(base).slice(0, -1); // consideration is base is normalized with trailing slash + let path = decodeURI(window.location.pathname); if (base && path.startsWith(base)) { - path = path.slice(base.length) + path = path.slice(base.length); } - const fullPath = (path || '/') + window.location.search + window.location.hash + const fullPath = + (path || '/') + window.location.search + window.location.hash; - return normalizeURL(fullPath) + return normalizeURL(fullPath); } // Imported from path-to-regexp @@ -347,37 +391,41 @@ export function getLocation (base, mode) { * @param {Object=} options * @return {!function(Object=, Object=)} */ -export function compile (str, options) { - return tokensToFunction(parse(str, options), options) +export function compile(str, options) { + return tokensToFunction(parse(str, options), options); } -export function getQueryDiff (toQuery, fromQuery) { - const diff = {} - const queries = { ...toQuery, ...fromQuery } +export function getQueryDiff(toQuery, fromQuery) { + const diff = {}; + const queries = { ...toQuery, ...fromQuery }; for (const k in queries) { if (String(toQuery[k]) !== String(fromQuery[k])) { - diff[k] = true + diff[k] = true; } } - return diff + return diff; } -export function normalizeError (err) { - let message +export function normalizeError(err) { + let message; if (!(err.message || typeof err === 'string')) { try { - message = JSON.stringify(err, null, 2) + message = JSON.stringify(err, null, 2); } catch (e) { - message = `[${err.constructor.name}]` + message = `[${err.constructor.name}]`; } } else { - message = err.message || err + message = err.message || err; } return { ...err, message, - statusCode: (err.statusCode || err.status || (err.response && err.response.status) || 500) - } + statusCode: + err.statusCode || + err.status || + (err.response && err.response.status) || + 500, + }; } /** @@ -385,18 +433,21 @@ export function normalizeError (err) { * * @type {RegExp} */ -const PATH_REGEXP = new RegExp([ - // Match escaped characters that would otherwise appear in future matches. - // This allows the user to escape special characters that won't transform. - '(\\\\.)', - // Match Express-style parameters and un-named parameters with a prefix - // and optional suffixes. Matches appear as: - // - // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] - // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] - // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] - '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' -].join('|'), 'g') +const PATH_REGEXP = new RegExp( + [ + // Match escaped characters that would otherwise appear in future matches. + // This allows the user to escape special characters that won't transform. + '(\\\\.)', + // Match Express-style parameters and un-named parameters with a prefix + // and optional suffixes. Matches appear as: + // + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] + // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] + '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))', + ].join('|'), + 'g', +); /** * Parse a string for the raw tokens. @@ -405,46 +456,46 @@ const PATH_REGEXP = new RegExp([ * @param {Object=} options * @return {!Array} */ -function parse (str, options) { - const tokens = [] - let key = 0 - let index = 0 - let path = '' - const defaultDelimiter = (options && options.delimiter) || '/' - let res +function parse(str, options) { + const tokens = []; + let key = 0; + let index = 0; + let path = ''; + const defaultDelimiter = (options && options.delimiter) || '/'; + let res; while ((res = PATH_REGEXP.exec(str)) != null) { - const m = res[0] - const escaped = res[1] - const offset = res.index - path += str.slice(index, offset) - index = offset + m.length + const m = res[0]; + const escaped = res[1]; + const offset = res.index; + path += str.slice(index, offset); + index = offset + m.length; // Ignore already escaped sequences. if (escaped) { - path += escaped[1] - continue + path += escaped[1]; + continue; } - const next = str[index] - const prefix = res[2] - const name = res[3] - const capture = res[4] - const group = res[5] - const modifier = res[6] - const asterisk = res[7] + const next = str[index]; + const prefix = res[2]; + const name = res[3]; + const capture = res[4]; + const group = res[5]; + const modifier = res[6]; + const asterisk = res[7]; // Push the current path onto the tokens. if (path) { - tokens.push(path) - path = '' + tokens.push(path); + path = ''; } - const partial = prefix != null && next != null && next !== prefix - const repeat = modifier === '+' || modifier === '*' - const optional = modifier === '?' || modifier === '*' - const delimiter = res[2] || defaultDelimiter - const pattern = capture || group + const partial = prefix != null && next != null && next !== prefix; + const repeat = modifier === '+' || modifier === '*'; + const optional = modifier === '?' || modifier === '*'; + const delimiter = res[2] || defaultDelimiter; + const pattern = capture || group; tokens.push({ name: name || key++, @@ -454,21 +505,25 @@ function parse (str, options) { repeat, partial, asterisk: Boolean(asterisk), - pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') - }) + pattern: pattern + ? escapeGroup(pattern) + : asterisk + ? '.*' + : '[^' + escapeString(delimiter) + ']+?', + }); } // Match any characters still remaining. if (index < str.length) { - path += str.substr(index) + path += str.substr(index); } // If the path exists, push it onto the end. if (path) { - tokens.push(path) + tokens.push(path); } - return tokens + return tokens; } /** @@ -477,11 +532,17 @@ function parse (str, options) { * @param {string} * @return {string} */ -function encodeURIComponentPretty (str, slashAllowed) { - const re = slashAllowed ? /[?#]/g : /[/?#]/g - return encodeURI(str).replace(re, (c) => { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) +function encodeURIComponentPretty(str, slashAllowed) { + const re = slashAllowed ? /[?#]/g : /[/?#]/g; + return encodeURI(str).replace(re, c => { + return ( + '%' + + c + .charCodeAt(0) + .toString(16) + .toUpperCase() + ); + }); } /** @@ -490,8 +551,8 @@ function encodeURIComponentPretty (str, slashAllowed) { * @param {string} * @return {string} */ -function encodeAsterisk (str) { - return encodeURIComponentPretty(str, true) +function encodeAsterisk(str) { + return encodeURIComponentPretty(str, true); } /** @@ -500,8 +561,8 @@ function encodeAsterisk (str) { * @param {string} str * @return {string} */ -function escapeString (str) { - return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, '\\$1') +function escapeString(str) { + return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, '\\$1'); } /** @@ -510,92 +571,121 @@ function escapeString (str) { * @param {string} group * @return {string} */ -function escapeGroup (group) { - return group.replace(/([=!:$/()])/g, '\\$1') +function escapeGroup(group) { + return group.replace(/([=!:$/()])/g, '\\$1'); } /** * Expose a method for transforming tokens into the path function. */ -function tokensToFunction (tokens, options) { +function tokensToFunction(tokens, options) { // Compile all the tokens into regexps. - const matches = new Array(tokens.length) + const matches = new Array(tokens.length); // Compile all the patterns before compilation. for (let i = 0; i < tokens.length; i++) { if (typeof tokens[i] === 'object') { - matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options)) + matches[i] = new RegExp( + '^(?:' + tokens[i].pattern + ')$', + flags(options), + ); } } - return function (obj, opts) { - let path = '' - const data = obj || {} - const options = opts || {} - const encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent + return function(obj, opts) { + let path = ''; + const data = obj || {}; + const options = opts || {}; + const encode = options.pretty + ? encodeURIComponentPretty + : encodeURIComponent; for (let i = 0; i < tokens.length; i++) { - const token = tokens[i] + const token = tokens[i]; if (typeof token === 'string') { - path += token + path += token; - continue + continue; } - const value = data[token.name || 'pathMatch'] - let segment + const value = data[token.name || 'pathMatch']; + let segment; if (value == null) { if (token.optional) { // Prepend partial segment prefixes. if (token.partial) { - path += token.prefix + path += token.prefix; } - continue + continue; } else { - throw new TypeError('Expected "' + token.name + '" to be defined') + throw new TypeError('Expected "' + token.name + '" to be defined'); } } if (Array.isArray(value)) { if (!token.repeat) { - throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') + throw new TypeError( + 'Expected "' + + token.name + + '" to not repeat, but received `' + + JSON.stringify(value) + + '`', + ); } if (value.length === 0) { if (token.optional) { - continue + continue; } else { - throw new TypeError('Expected "' + token.name + '" to not be empty') + throw new TypeError( + 'Expected "' + token.name + '" to not be empty', + ); } } for (let j = 0; j < value.length; j++) { - segment = encode(value[j]) + segment = encode(value[j]); if (!matches[i].test(segment)) { - throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') + throw new TypeError( + 'Expected all "' + + token.name + + '" to match "' + + token.pattern + + '", but received `' + + JSON.stringify(segment) + + '`', + ); } - path += (j === 0 ? token.prefix : token.delimiter) + segment + path += (j === 0 ? token.prefix : token.delimiter) + segment; } - continue + continue; } - segment = token.asterisk ? encodeAsterisk(value) : encode(value) + segment = token.asterisk ? encodeAsterisk(value) : encode(value); if (!matches[i].test(segment)) { - throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') + throw new TypeError( + 'Expected "' + + token.name + + '" to match "' + + token.pattern + + '", but received "' + + segment + + '"', + ); } - path += token.prefix + segment + path += token.prefix + segment; } - return path - } + return path; + }; } /** @@ -604,27 +694,27 @@ function tokensToFunction (tokens, options) { * @param {Object} options * @return {string} */ -function flags (options) { - return options && options.sensitive ? '' : 'i' +function flags(options) { + return options && options.sensitive ? '' : 'i'; } export function addLifecycleHook(vm, hook, fn) { if (!vm.$options[hook]) { - vm.$options[hook] = [] + vm.$options[hook] = []; } if (!vm.$options[hook].includes(fn)) { - vm.$options[hook].push(fn) + vm.$options[hook].push(fn); } } -export const urlJoin = joinURL +export const urlJoin = joinURL; -export const stripTrailingSlash = withoutTrailingSlash +export const stripTrailingSlash = withoutTrailingSlash; -export const isSamePath = _isSamePath +export const isSamePath = _isSamePath; -export function setScrollRestoration (newVal) { +export function setScrollRestoration(newVal) { try { window.history.scrollRestoration = newVal; - } catch(e) {} + } catch (e) {} } diff --git a/packages/preset-built-in/src/plugins/generateFiles/core/plugin.ts b/packages/preset-built-in/src/plugins/generateFiles/core/plugin.ts index 51c755a..5224a85 100644 --- a/packages/preset-built-in/src/plugins/generateFiles/core/plugin.ts +++ b/packages/preset-built-in/src/plugins/generateFiles/core/plugin.ts @@ -15,11 +15,11 @@ export default function (api: IApi) { key: 'addRuntimePluginKey', type: api.ApplyPluginsType.add, initialValue: [ - 'modifyClientRenderOpts', 'patchRoutes', - 'rootContainer', 'render', 'onRouteChange', + 'default', + 'enhanceApp', ], }); const plugins = await api.applyPlugins({ @@ -65,4 +65,11 @@ export default function (api: IApi) { source: `./plugin`, }; }); + + api.addUmiExports(() => { + return { + specifiers: ['ApplyPluginsType'], + source: `${runtimePath}`, + }; + }); } diff --git a/packages/preset-built-vmi/src/index.ts b/packages/preset-built-vmi/src/index.ts index d79d56e..6a3bc21 100644 --- a/packages/preset-built-vmi/src/index.ts +++ b/packages/preset-built-vmi/src/index.ts @@ -1,21 +1,27 @@ export { IDumiOpts } from './context'; -export default function() { - return { - plugins: [ - require.resolve('./plugins/features/init'), +//@ts-ignore +export default function (api) { + const plugins = [ + require.resolve('./plugins/features/init'), - // generate nuxt file - require.resolve( - './plugins/generateFiles/internals/app-enhancers/entryImportsAhead', - ), - require.resolve('./plugins/generateFiles/internals/layout/layout'), + // generate nuxt file + require.resolve( + './plugins/generateFiles/internals/app-enhancers/entryImportsAhead', + ), + require.resolve('./plugins/generateFiles/internals/layout/layout'), - require.resolve('./plugins/features/entry'), - require.resolve('./plugins/features/routes'), - require.resolve('./plugins/features/webpack'), - require.resolve('./plugins/features/outputPath'), - require.resolve('./plugins/features/alias'), - ], - }; + require.resolve('./plugins/features/entry'), + require.resolve('./plugins/features/routes'), + + require.resolve('./plugins/features/webpack'), + require.resolve('./plugins/features/outputPath'), + require.resolve('./plugins/features/alias'), + ]; + + if (api.env === 'development') { + plugins.push(require.resolve('./plugins/features/componentRoutes')); + } + + return { plugins }; } diff --git a/packages/preset-built-vmi/src/plugins/features/alias.ts b/packages/preset-built-vmi/src/plugins/features/alias.ts index 42db257..0b65a4e 100644 --- a/packages/preset-built-vmi/src/plugins/features/alias.ts +++ b/packages/preset-built-vmi/src/plugins/features/alias.ts @@ -1,6 +1,5 @@ import { IApi } from '@umijs/types'; -import { resolve, winPath } from '@umijs/utils'; -import { dirname, resolve as $resolve } from 'path'; +import { resolve as $resolve } from 'path'; export default (api: IApi) => { const { paths, pkg, cwd } = api; diff --git a/packages/preset-built-vmi/src/plugins/features/componentRoutes.ts b/packages/preset-built-vmi/src/plugins/features/componentRoutes.ts new file mode 100644 index 0000000..800c414 --- /dev/null +++ b/packages/preset-built-vmi/src/plugins/features/componentRoutes.ts @@ -0,0 +1,38 @@ +//@ts-ignore +import { createRoutes } from '@nuxt/utils'; +import type { IApi, IRoute } from '@umijs/types'; +import fs, { constants } from 'fs'; +import path from 'path'; + +/** + * plugin for generate component routes + */ +export default (api: IApi) => { + // generate vmi component routes + api.onPatchRoutesBefore(async ({ routes, parentRoute }) => { + // only deal with the top level routes + if (!parentRoute) { + // get root index.js/index.vue + let rootIndex; + try { + fs.accessSync(path.resolve(api.cwd, 'index.js'), constants.R_OK); + rootIndex = path.resolve(api.cwd, 'index.js'); + fs.accessSync(path.resolve(api.cwd, 'index.vue'), constants.R_OK); + rootIndex = path.resolve(api.cwd, 'index.vue'); + } catch (error) {} + + if (!rootIndex) return; + + const route: IRoute[] = createRoutes({ + files: ['/' + path.basename(rootIndex)], + srcDir: api.paths.absSrcPath, + pagesDir: api.paths.absSrcPath, + routeNameSplitter: '-', + supportedExtensions: ['vue', 'js', 'jsx'], + undefined, + }); + // unshit docs routes in integrate mode + routes.unshift(...route); + } + }); +}; diff --git a/packages/preset-built-vmi/src/plugins/features/entry.ts b/packages/preset-built-vmi/src/plugins/features/entry.ts index 2d992cb..2ce72df 100644 --- a/packages/preset-built-vmi/src/plugins/features/entry.ts +++ b/packages/preset-built-vmi/src/plugins/features/entry.ts @@ -1,8 +1,5 @@ import { IApi } from '@umijs/types'; - export default (api: IApi) => { - const { paths, pkg, cwd } = api; - api.describe({ key: 'entry', config: { @@ -14,7 +11,7 @@ export default (api: IApi) => { }); api.chainWebpack(async (memo) => { - memo.entryPoints.delete('umi'); + memo.entryPoints.clear(); memo.entry('vmi').add(require.resolve('@winfe/client/src/client')); return memo; }); diff --git a/packages/preset-built-vmi/src/plugins/features/routes.ts b/packages/preset-built-vmi/src/plugins/features/routes.ts index 034d7e0..700626c 100644 --- a/packages/preset-built-vmi/src/plugins/features/routes.ts +++ b/packages/preset-built-vmi/src/plugins/features/routes.ts @@ -1,6 +1,6 @@ -import type { IApi, IRoute } from '@umijs/types'; +import type { IApi } from '@umijs/types'; import ctx from '../../context'; -import getRouteConfig, { DUMI_ROOT_FLAG } from '../../routes/getRouteConfig'; +import getRouteConfig from '../../routes/getRouteConfig'; /** * plugin for generate routes @@ -25,48 +25,4 @@ export default (api: IApi) => { } } }); - - api.register({ - key: 'vmi.getRootRoute', - async fn(oRoutes: IRoute[] = []) { - const findRoot = (routes: IRoute[]) => { - for (let i = 0; i < routes.length; i += 1) { - if (routes[i][DUMI_ROOT_FLAG]) { - return routes[i]; - } - - const childRoot = findRoot(routes[i].routes || []); - - if (childRoot) { - return childRoot; - } - } - - return null; - }; - - return findRoot(oRoutes); - }, - }); - - // add empty component for root layout - // TODO: move this logic into getRouteConfig and make sure tests passed - api.onPatchRoute(({ route }) => { - if (route[DUMI_ROOT_FLAG]) { - route.component = '(props) => props.children'; - } - }); - - // remove useless /index.html from exportStatic feature - api.onPatchRoutes(({ routes, parentRoute }) => { - if (api.config.exportStatic && parentRoute?.[DUMI_ROOT_FLAG]) { - const rootHtmlIndex = routes.findIndex( - (route) => route.path === '/index.html', - ); - - if (rootHtmlIndex > -1) { - routes.splice(rootHtmlIndex, 1); - } - } - }); }; diff --git a/packages/preset-built-vmi/src/plugins/features/webpack.ts b/packages/preset-built-vmi/src/plugins/features/webpack.ts index 9909483..139b612 100644 --- a/packages/preset-built-vmi/src/plugins/features/webpack.ts +++ b/packages/preset-built-vmi/src/plugins/features/webpack.ts @@ -14,7 +14,7 @@ export default (api: IApi) => { }, }); - api.chainWebpack(async memo => { + api.chainWebpack(async (memo) => { memo.resolve.extensions.merge(['.vue']); // vue-loader @@ -30,10 +30,8 @@ export default (api: IApi) => { ...(process.env.APP_ROOT ? [process.cwd()] : []), ]) .end() - .exclude.add(/node_modules/) - // don't compile mfsu temp files - // TODO: do not hard code - .end() + // .exclude.add(/node_modules/) + // .end() .use('vue-loader') .loader(require.resolve('vue-loader')) .options({ diff --git a/packages/preset-built-vmi/src/plugins/generateFiles/store.ts b/packages/preset-built-vmi/src/plugins/generateFiles/store.ts index ef40397..48896cc 100644 --- a/packages/preset-built-vmi/src/plugins/generateFiles/store.ts +++ b/packages/preset-built-vmi/src/plugins/generateFiles/store.ts @@ -1,7 +1,7 @@ +import { Route } from '@umijs/core'; +import { IApi } from '@umijs/types'; import { readFileSync } from 'fs'; import { join } from 'path'; -import { IApi } from '@umijs/types'; -import { Route } from '@umijs/core'; import { runtimePath } from './constants'; export default function (api: IApi) { diff --git a/packages/preset-built-vmi/src/routes/getRouteConfig.ts b/packages/preset-built-vmi/src/routes/getRouteConfig.ts index 2206b77..ca73ba9 100644 --- a/packages/preset-built-vmi/src/routes/getRouteConfig.ts +++ b/packages/preset-built-vmi/src/routes/getRouteConfig.ts @@ -7,24 +7,13 @@ import slash from 'slash2'; import type { IDumiOpts } from '../index'; import getRouteConfigFromDir from './getRouteConfigFromDir'; -const debug = createDebug('dumi:routes:get'); - -export const DUMI_ROOT_FLAG = '__dumiRoot'; +const debug = createDebug('vmi:routes:get'); export default async (api: IApi, opts: IDumiOpts): Promise => { const { paths } = api; const config: IRoute[] = []; const childRoutes: IRoute[] = []; - const userRoutes = - opts.isIntegrate || api.args?.vmi !== undefined - ? ( - await api.applyPlugins({ - key: 'vmi.getRootRoute', - type: api.ApplyPluginsType.modify, - initialValue: api.userConfig.routes, - }) - )?.routes - : api.userConfig.routes; + const userRoutes = api.userConfig.routes; if (userRoutes) { // only apply user's routes if there has routes config diff --git a/packages/runtime/src/dynamic/loadable.js b/packages/runtime/src/dynamic/loadable.js index 46e9dda..e103706 100644 --- a/packages/runtime/src/dynamic/loadable.js +++ b/packages/runtime/src/dynamic/loadable.js @@ -47,12 +47,12 @@ function load(loader) { }; state.promise = promise - .then((loaded) => { + .then(loaded => { state.loading = false; state.loaded = loaded; return loaded; }) - .catch((err) => { + .catch(err => { state.loading = false; state.error = err; throw err; @@ -71,7 +71,7 @@ function loadMap(obj) { let promises = []; try { - Object.keys(obj).forEach((key) => { + Object.keys(obj).forEach(key => { let result = load(obj[key]); if (!result.loading) { @@ -84,10 +84,10 @@ function loadMap(obj) { promises.push(result.promise); result.promise - .then((res) => { + .then(res => { state.loaded[key] = res; }) - .catch((err) => { + .catch(err => { state.error = err; }); }); @@ -96,11 +96,11 @@ function loadMap(obj) { } state.promise = Promise.all(promises) - .then((res) => { + .then(res => { state.loading = false; return res; }) - .catch((err) => { + .catch(err => { state.loading = false; throw err; }); @@ -157,7 +157,7 @@ function createLoadableComponent(loadFn, options) { typeof opts.webpack === 'function' ) { const moduleIds = opts.webpack(); - READY_INITIALIZERS.push((ids) => { + READY_INITIALIZERS.push(ids => { for (const moduleId of moduleIds) { if (ids.indexOf(moduleId) !== -1) { return init(); @@ -177,7 +177,7 @@ function createLoadableComponent(loadFn, options) { })); if (context && Array.isArray(opts.modules)) { - opts.modules.forEach((moduleName) => { + opts.modules.forEach(moduleName => { context(moduleName); }); } @@ -261,7 +261,7 @@ class LoadableSubscription { this._clearTimeouts(); }) // eslint-disable-next-line handle-callback-err - .catch((err) => { + .catch(err => { this._update(); this._clearTimeouts(); }); @@ -273,7 +273,7 @@ class LoadableSubscription { ...this._state, ...partial, }; - this._callbacks.forEach((callback) => callback()); + this._callbacks.forEach(callback => callback()); } _clearTimeouts() { @@ -334,7 +334,7 @@ Loadable.preloadAll = () => { }; Loadable.preloadReady = (ids = []) => { - return new Promise((resolve) => { + return new Promise(resolve => { const res = () => { initialized = true; return resolve(); diff --git a/packages/vmi/src/ServiceWithBuiltIn.ts b/packages/vmi/src/ServiceWithBuiltIn.ts index 27b795b..6a24ea8 100644 --- a/packages/vmi/src/ServiceWithBuiltIn.ts +++ b/packages/vmi/src/ServiceWithBuiltIn.ts @@ -3,7 +3,6 @@ import { dirname } from 'path'; class Service extends CoreService { constructor(opts: IServiceOpts) { - // process.env.UMI_UI = 'none'; process.env.IS_VMI = 'true'; process.env.UMI_VERSION = require('../package').version; process.env.UMI_DIR = dirname(require.resolve('../package')); @@ -15,10 +14,7 @@ class Service extends CoreService { require.resolve('@winfe/preset-built-vmi'), ...(opts.presets || []), ], - plugins: [ - require.resolve('./plugins/umiAlias'), - ...(opts.plugins || []), - ], + plugins: [require.resolve('./plugins/umiAlias'), ...(opts.plugins || [])], }); } } diff --git a/scripts/benchmarks.js b/scripts/benchmarks.js index 442a6c3..032bbd3 100644 --- a/scripts/benchmarks.js +++ b/scripts/benchmarks.js @@ -11,19 +11,19 @@ const bootstrap = async () => { absolute: true, cwd: path.join(__dirname, '..'), }); - const projects = benchmarks.map((benchmark) => path.dirname(benchmark)); + const projects = benchmarks.map(benchmark => path.dirname(benchmark)); await buildExamples(projects); const suite = new Benchmark.Suite(); - benchmarks.forEach((benchmark) => { + benchmarks.forEach(benchmark => { const benchmarkFunc = require(benchmark); benchmarkFunc(suite); }); suite - .on('cycle', function (event) { + .on('cycle', function(event) { console.log(String(event.target)); }) - .on('complete', function () { + .on('complete', function() { console.log(''); for (let index = 0; index < this.length; index++) { const benchmark = this[index]; diff --git a/scripts/bootstrap-examples.js b/scripts/bootstrap-examples.js index 08ab903..b06e224 100644 --- a/scripts/bootstrap-examples.js +++ b/scripts/bootstrap-examples.js @@ -9,8 +9,7 @@ const getPackages = require('./utils/getPackages'); const pkgs = getPackages('../../examples'); - pkgs.forEach(async (shortName) => { - + pkgs.forEach(async shortName => { const pkgJSONPath = join( __dirname, '..', @@ -25,8 +24,8 @@ const getPackages = require('./utils/getPackages'); version: '0.0.1', description: shortName, scripts: { - start: "umi dev", - build: "umi build" + start: 'umi dev', + build: 'umi build', }, repository: { type: 'git', @@ -36,7 +35,7 @@ const getPackages = require('./utils/getPackages'); authors: ['chencheng (https://github.com/sorrycc)'], license: 'MIT', dependencies: { - umi: "latest" + umi: 'latest', }, bugs: 'http://github.com/umijs/umi/issues', homepage: `https://github.com/umijs/umi/tree/master/examples/${shortName}#readme`, @@ -54,7 +53,7 @@ const getPackages = require('./utils/getPackages'); 'sideEffects', 'main', 'module', - ].forEach((key) => { + ].forEach(key => { if (pkg[key]) json[key] = pkg[key]; }); } @@ -69,7 +68,10 @@ const getPackages = require('./utils/getPackages'); 'README.md', ); if (args.force || !existsSync(readmePath)) { - writeFileSync(readmePath, `# ${shortName}\n\nTODO\n\n## How to use\n\nExecute [\`@umijs/create-umi-app\`](https://github.com/umijs/umi/tree/master/packages/create-umi-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:\n\n\`\`\`bash\nnpx @umijs/create-umi-app --example ${shortName} ${shortName}-app\n# or\nyarn create @umijs/umi-app --example ${shortName} ${shortName}-app\n\`\`\`\n`); + writeFileSync( + readmePath, + `# ${shortName}\n\nTODO\n\n## How to use\n\nExecute [\`@umijs/create-umi-app\`](https://github.com/umijs/umi/tree/master/packages/create-umi-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:\n\n\`\`\`bash\nnpx @umijs/create-umi-app --example ${shortName} ${shortName}-app\n# or\nyarn create @umijs/umi-app --example ${shortName} ${shortName}-app\n\`\`\`\n`, + ); } else { return; } @@ -84,7 +86,9 @@ const getPackages = require('./utils/getPackages'); ); if (!existsSync(indexPath)) { await mkdirp(join(indexPath, '..')); - writeFileSync(indexPath, `import React from 'react'; + writeFileSync( + indexPath, + `import React from 'react'; import type { FC } from 'react'; const IndexPage: FC = () => { @@ -93,7 +97,8 @@ const IndexPage: FC = () => { export default IndexPage; -`); +`, + ); } }); })(); diff --git a/scripts/bootstrap.js b/scripts/bootstrap.js index 256c3a2..d9e395d 100644 --- a/scripts/bootstrap.js +++ b/scripts/bootstrap.js @@ -9,7 +9,7 @@ const getPackages = require('./utils/getPackages'); const pkgs = getPackages(); - pkgs.forEach((shortName) => { + pkgs.forEach(shortName => { const name = shortName === 'umi' ? shortName : `@umijs/${shortName}`; const pkgJSONPath = join( @@ -54,7 +54,7 @@ const getPackages = require('./utils/getPackages'); 'sideEffects', 'main', 'module', - ].forEach((key) => { + ].forEach(key => { if (pkg[key]) json[key] = pkg[key]; }); } diff --git a/scripts/buildExamples.js b/scripts/buildExamples.js index 4c5ef35..4137e6b 100644 --- a/scripts/buildExamples.js +++ b/scripts/buildExamples.js @@ -6,7 +6,7 @@ const { glob, signale } = require('@umijs/utils'); const UMI_SCRIPT = path.join(__dirname, '../packages/umi/bin/umi.js'); function build({ cwd }) { - return new Promise((resolve) => { + return new Promise(resolve => { signale.pending(cwd); const child = fork(UMI_SCRIPT, ['build'], { env: { @@ -17,7 +17,7 @@ function build({ cwd }) { cwd, stdio: 'ignore', }); - child.on('exit', (code) => { + child.on('exit', code => { if (code === 0) { signale.complete(`success build ${cwd}`); resolve(); @@ -43,7 +43,7 @@ async function buildExamples(customProjectPaths) { Array.isArray(customProjectPaths) && customProjectPaths.length > 0 ? customProjectPaths : examples; - await Promise.all(projects.map((project) => build({ cwd: project }))); + await Promise.all(projects.map(project => build({ cwd: project }))); } module.exports = buildExamples; diff --git a/scripts/docs.js b/scripts/docs.js index 4fb7a0e..b26fcc5 100644 --- a/scripts/docs.js +++ b/scripts/docs.js @@ -46,7 +46,7 @@ function syncDocs() { cwd: join(__dirname, '../docs'), }); const pulledFiles = lodash.pullAll(files, DOC_SYNC_BLACKLIST); - pulledFiles.forEach((path) => { + pulledFiles.forEach(path => { syncDoc({ path }); }); } diff --git a/scripts/example.js b/scripts/example.js index 0371027..c8a339a 100644 --- a/scripts/example.js +++ b/scripts/example.js @@ -14,5 +14,4 @@ if (args._[1]) { process.env.APP_ROOT = args._[1]; } - require('../packages/vmi/lib/cli'); diff --git a/scripts/release.js b/scripts/release.js index 4592d45..a8503b7 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -66,7 +66,7 @@ async function release() { const updatedStdout = execa.sync(lernaCli, ['changed']).stdout; updated = updatedStdout .split('\n') - .map((pkg) => { + .map(pkg => { if (pkg === 'vmi') return pkg; else return pkg.split('/')[1]; }) @@ -104,7 +104,7 @@ async function release() { // Sync version to root package.json logStep('sync version to root package.json'); const rootPkg = require('../package'); - Object.keys(rootPkg.devDependencies).forEach((name) => { + Object.keys(rootPkg.devDependencies).forEach(name => { if (name.startsWith('@umijs/') && !name.startsWith('@umijs/p')) { rootPkg.devDependencies[name] = currVersion; } @@ -136,7 +136,7 @@ async function release() { logStep(`publish packages: ${chalk.blue(pkgs.join(', '))}`); const currVersion = require('../lerna').version; const isNext = isNextVersion(currVersion); - const releasePkgs = pkgs.sort((a) => { + const releasePkgs = pkgs.sort(a => { return a === 'umi' ? 1 : -1; }); for (const [index, pkg] of releasePkgs.entries()) { @@ -155,7 +155,7 @@ async function release() { name: 'otp', type: 'input', message: 'This operation requires a one-time password:', - validate: (msg) => !!msg, + validate: msg => !!msg, }); cliArgs = cliArgs.concat(['--otp', otp]); } @@ -183,7 +183,7 @@ async function release() { logStep('done'); } -release().catch((err) => { +release().catch(err => { console.error(err); process.exit(1); }); diff --git a/scripts/release2.js b/scripts/release2.js index 152f87d..f5838bf 100644 --- a/scripts/release2.js +++ b/scripts/release2.js @@ -9,7 +9,10 @@ const info = chalk.bold.green; info(`start...`); -const { name: packageName } = require(path.resolve(process.cwd(), './package.json')); +const { name: packageName } = require(path.resolve( + process.cwd(), + './package.json', +)); const { command } = require(path.resolve(process.cwd(), './lerna.json')); @@ -23,11 +26,19 @@ const argvs = [ process.env.PUB_CI_ACCESS_TOKEN, '--registry', 'http://registry.npmjs.org/', - '--yes' + '--yes', ]; //符合semver语义的版本 -const semantic = ['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', 'prerelease']; +const semantic = [ + 'major', + 'minor', + 'patch', + 'premajor', + 'preminor', + 'prepatch', + 'prerelease', +]; // 自定义preid /** @@ -45,7 +56,10 @@ const semantic = ['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', */ if (command.publish && command.publish.version) { - if (typeof command.publish.version === 'string' && semantic.includes(command.publish.version)) { + if ( + typeof command.publish.version === 'string' && + semantic.includes(command.publish.version) + ) { argvs.push(...['--bump', command.publish.version]); } else if (command.publish.version instanceof Array) { argvs.push(...command.publish.version); @@ -53,17 +67,21 @@ if (command.publish && command.publish.version) { } try { - const ps = spawn(path.resolve(process.cwd(), 'node_modules/.bin/lerna'), argvs, { - stdio: 'inherit', - encoding: 'utf-8', - cwd: process.cwd(), - env: { - FORCE_COLOR: true, - npm_config_color: 'always', - npm_config_progress: true, - ...process.env - } - }); + const ps = spawn( + path.resolve(process.cwd(), 'node_modules/.bin/lerna'), + argvs, + { + stdio: 'inherit', + encoding: 'utf-8', + cwd: process.cwd(), + env: { + FORCE_COLOR: true, + npm_config_color: 'always', + npm_config_progress: true, + ...process.env, + }, + }, + ); ps.on('error', () => { throw new Error(`Failed to install ${packageName}\n${ps.stderr}`); diff --git a/scripts/syncTNPM.js b/scripts/syncTNPM.js index 6b96bfd..33e2179 100644 --- a/scripts/syncTNPM.js +++ b/scripts/syncTNPM.js @@ -4,12 +4,11 @@ const getPackages = require('./utils/getPackages'); process.setMaxListeners(Infinity); -module.exports = function (publishPkgs) { +module.exports = function(publishPkgs) { const pkgs = (publishPkgs || getPackages()).map( - (name) => - require(join(__dirname, '../packages', name, 'package.json')).name, + name => require(join(__dirname, '../packages', name, 'package.json')).name, ); - const commands = pkgs.map((pkg) => { + const commands = pkgs.map(pkg => { const subprocess = execa('tnpm', ['sync', pkg]); subprocess.stdout.pipe(process.stdout); return subprocess; diff --git a/scripts/utils/changelog.js b/scripts/utils/changelog.js index 2481e19..cdb4ff4 100644 --- a/scripts/utils/changelog.js +++ b/scripts/utils/changelog.js @@ -10,7 +10,7 @@ exports.getChangelog = async () => { throw new Error(`get changelog failed, no new commits was found.`); } - const commits = log.split('\n').map((commit) => { + const commits = log.split('\n').map(commit => { const splitIndex = commit.lastIndexOf(' '); return { message: commit.slice(0, splitIndex), @@ -18,8 +18,8 @@ exports.getChangelog = async () => { }; }); - return (nextTag) => + return nextTag => commits - .map((commit) => `- ${htmlEscape(commit.message)} ${commit.id}`) + .map(commit => `- ${htmlEscape(commit.message)} ${commit.id}`) .join('\n') + `\n\n${repoUrl}/compare/${latest}...${nextTag}`; }; diff --git a/scripts/utils/exec.js b/scripts/utils/exec.js index 9b7acfc..9ce4ff5 100644 --- a/scripts/utils/exec.js +++ b/scripts/utils/exec.js @@ -7,11 +7,11 @@ module.exports = function exec(command, args, opts) { args, Object.assign({ stdio: 'inherit', env: process.env }, opts), ); - child.once('error', (err) => { + child.once('error', err => { console.log(err); reject(err); }); - child.once('close', (code) => { + child.once('close', code => { if (code === 1) { process.exit(1); } else { diff --git a/scripts/utils/getPackages.js b/scripts/utils/getPackages.js index 61c0b92..6f19f70 100644 --- a/scripts/utils/getPackages.js +++ b/scripts/utils/getPackages.js @@ -3,6 +3,6 @@ const { join } = require('path'); module.exports = function getPackages(path = '../../packages') { return readdirSync(join(__dirname, path)).filter( - (pkg) => pkg.charAt(0) !== '.', + pkg => pkg.charAt(0) !== '.', ); }; diff --git a/scripts/utils/git.js b/scripts/utils/git.js index d7ba89d..f7d80df 100644 --- a/scripts/utils/git.js +++ b/scripts/utils/git.js @@ -27,7 +27,7 @@ exports.latestTagOrFirstCommit = async () => { return latest; }; -exports.commitLogFromRevision = async (revision) => { +exports.commitLogFromRevision = async revision => { const { stdout } = await execa('git', [ 'log', '--format=%s %h', diff --git a/scripts/utils/isNextVersion.js b/scripts/utils/isNextVersion.js index 723580e..306d145 100644 --- a/scripts/utils/isNextVersion.js +++ b/scripts/utils/isNextVersion.js @@ -1,4 +1,4 @@ -module.exports = function (version) { +module.exports = function(version) { return ( version.includes('-rc.') || version.includes('-beta.') || diff --git a/scripts/utils/parseDoc.js b/scripts/utils/parseDoc.js index 05aa4ec..ad88e30 100644 --- a/scripts/utils/parseDoc.js +++ b/scripts/utils/parseDoc.js @@ -1,4 +1,4 @@ -module.exports = function (docStr) { +module.exports = function(docStr) { docStr = docStr.trim(); const hasYamlConfig = docStr.startsWith('---'); const docArr = docStr.split('\n'); diff --git a/scripts/verifyCommit.js b/scripts/verifyCommit.js index f57e178..9c7527d 100644 --- a/scripts/verifyCommit.js +++ b/scripts/verifyCommit.js @@ -2,7 +2,9 @@ const { chalk } = require('@umijs/utils'); const msgPath = process.env.GIT_PARAMS; -const msg = require('fs').readFileSync(msgPath, 'utf-8').trim(); +const msg = require('fs') + .readFileSync(msgPath, 'utf-8') + .trim(); const commitRE = /^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release|dep)(\(.+\))?: .{1,50}/; diff --git a/yarn.lock b/yarn.lock index 6c42048..8dcf859 100644 --- a/yarn.lock +++ b/yarn.lock @@ -78,7 +78,7 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.2", "@babel/core@^7.7.5": +"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.7.5": version "7.14.8" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.8.tgz#20cdf7c84b5d86d83fac8710a8bc605a7ba3f010" integrity sha512-/AtaeEhT6ErpDhInbXmjHcUQXH0L0TEgscfcxk1qbOvLuKCa5aZT0SOOtDKFY96/CLROwbLSKyFor6idgNaU4Q== @@ -99,7 +99,7 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.12.1", "@babel/generator@^7.12.10", "@babel/generator@^7.14.0", "@babel/generator@^7.14.8", "@babel/generator@^7.14.9", "@babel/generator@^7.4.0", "@babel/generator@^7.7.2": +"@babel/generator@^7.12.1", "@babel/generator@^7.12.10", "@babel/generator@^7.14.0", "@babel/generator@^7.14.8", "@babel/generator@^7.14.9", "@babel/generator@^7.4.0": version "7.14.9" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.9.tgz#23b19c597d38b4f7dc2e3fe42a69c88d9ecfaa16" integrity sha512-4yoHbhDYzFa0GLfCzLp5GxH7vPPMAHdZjyE7M/OajM9037zhx0rf+iNsJwp4PT0MSFpwjG7BsHEbPkBQpZ6cYA== @@ -790,7 +790,7 @@ "@babel/helper-simple-access" "^7.12.1" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.12.1", "@babel/plugin-transform-modules-commonjs@^7.14.5", "@babel/plugin-transform-modules-commonjs@^7.7.2": +"@babel/plugin-transform-modules-commonjs@^7.12.1", "@babel/plugin-transform-modules-commonjs@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.5.tgz#7aaee0ea98283de94da98b28f8c35701429dad97" integrity sha512-en8GfBtgnydoao2PS+87mKyw62k02k7kJ9ltbKe0fXTHrQmG6QZZflYuGI1VVG7sVpx4E1n7KBpNlPb8m78J+A== @@ -1214,7 +1214,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.1", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.11.1", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.8.4": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.8.4": version "7.14.8" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.8.tgz#7119a56f421018852694290b9f9148097391b446" integrity sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg== @@ -1230,7 +1230,7 @@ "@babel/parser" "^7.14.5" "@babel/types" "^7.14.5" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.5", "@babel/traverse@^7.14.8", "@babel/traverse@^7.4.3", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.5", "@babel/traverse@^7.14.8", "@babel/traverse@^7.4.3": version "7.14.9" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.9.tgz#016126b331210bf06fff29d52971eef8383e556f" integrity sha512-bldh6dtB49L8q9bUyB7bC20UKgU+EFDwKJylwl234Kv+ySZeMD31Xeht6URyueQ6LrRRpF2tmkfcZooZR9/e8g== @@ -1245,7 +1245,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.6", "@babel/types@^7.14.0", "@babel/types@^7.14.5", "@babel/types@^7.14.8", "@babel/types@^7.14.9", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.7.2": +"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.6", "@babel/types@^7.14.0", "@babel/types@^7.14.5", "@babel/types@^7.14.8", "@babel/types@^7.14.9", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0", "@babel/types@^7.4.4": version "7.14.9" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.9.tgz#f2b19c3f2f77c5708d67fe8f6046e9cea2b5036d" integrity sha512-u0bLTnv3DFHeaQLYzb7oRJ1JHr1sv/SYDM7JSqHFFLwXG1wTZRughxFI5NCP8qBEo1rVVsn7Yg2Lvw49nne/Ow== @@ -2337,19 +2337,6 @@ npmlog "^4.1.2" write-file-atomic "^2.3.0" -"@mapbox/hast-util-to-jsx@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@mapbox/hast-util-to-jsx/-/hast-util-to-jsx-1.0.0.tgz#90ce46b0d2dde42d5ea4d4a1e0b26b9ce2215013" - integrity sha512-HJRp3qkr0uGIBFASzA8rVATLo6y/UoOMoD8eXsG8HVofk5Dokc9PV+dh266zYLZniYgtpJbc2+AKf1fNpsVqAA== - dependencies: - kebab-case "^1.0.0" - postcss "^7.0.31" - postcss-js "^2.0.3" - property-information "^5.5.0" - react-attr-converter "^0.3.1" - stringify-entities "^3.0.1" - stringify-object "^3.3.0" - "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -2849,13 +2836,6 @@ resolved "https://registry.yarnpkg.com/@types/hapi__joi/-/hapi__joi-16.0.6.tgz#aa8f7dff93fdd3db6506ca2433a8302d8819fad1" integrity sha512-rpU8FNMGxhYIF6bUlxZYO4drNjqUWCGrf4UINABAJzdcrPs4bP+Bz5VXzp8rOPZsNynnaDXbiU/MyjOGlfeczg== -"@types/hast@^2.0.0": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.2.tgz#236201acca9e2695e42f713d7dd4f151dc2982e4" - integrity sha512-Op5W7jYgZI7AWKY5wQ0/QNMzQM7dGQPyW1rXKNiymVCy5iTfdPuGu4HhYNOM2sIv8gUfIuIdcYlXmAepwaowow== - dependencies: - "@types/unist" "*" - "@types/history@*": version "4.7.9" resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.9.tgz#1cfb6d60ef3822c589f18e70f8b12f9a28ce8724" @@ -2906,18 +2886,6 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818" integrity sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg== -"@types/mathjax@^0.0.36": - version "0.0.36" - resolved "https://registry.yarnpkg.com/@types/mathjax/-/mathjax-0.0.36.tgz#18cf766f88ac0cd4e7ee8282b1286049bb6aa682" - integrity sha512-TqDJc2GWuTqd/m+G/FbNkN+/TF2OCCHvcawmhIrUaZkdVquMdNZmNiNUkupNg9qctorXXkVLVSogZv1DhmgLmg== - -"@types/mdast@^3.0.0": - version "3.0.7" - resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.7.tgz#cba63d0cc11eb1605cea5c0ad76e02684394166b" - integrity sha512-YwR7OK8aPmaBvMMUi+pZXBNoW2unbVbfok4YRqGMJBe1dpDlzpRkJrYEYmvjxgs5JhuQmKfDexrN98u941Zasg== - dependencies: - "@types/unist" "*" - "@types/merge-stream@1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@types/merge-stream/-/merge-stream-1.1.2.tgz#a880ff66b1fbbb5eef4958d015c5947a9334dbb1" @@ -2959,7 +2927,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.9.tgz#04eb3da65d08ea377f5e682bf0d22dc1f5e7f19e" integrity sha512-HXhRf581nCItzn8yevv4LYt+bJ5cBbDBAJExbDPMeU/2n5/j0ZemGpayahFBP4xL7RseaCLASLD9i9AYyDe7Nw== -"@types/node@^14.0.23", "@types/node@^14.14.28": +"@types/node@^14.0.23": version "14.17.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.6.tgz#cc61c8361c89e70c468cda464d1fa3dd7e5ebd62" integrity sha512-iBxsxU7eswQDGhlr3AiamBxOssaYxbM+NKXVil8jg9yFXvrfEFbDumLD/2dMTB+zYyg7w+Xjt8yuxfdbUHAtcQ== @@ -2974,11 +2942,6 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== -"@types/parse5@^5.0.0": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" - integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw== - "@types/prettier@^1.16.1": version "1.19.1" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.19.1.tgz#33509849f8e679e4add158959fdb086440e9553f" @@ -3075,13 +3038,6 @@ dependencies: "@types/node" "*" -"@types/sax@^1.2.1": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@types/sax/-/sax-1.2.3.tgz#b630ac1403ebd7812e0bf9a10de9bf5077afb348" - integrity sha512-+QSw6Tqvs/KQpZX8DvIl3hZSjNFLW/OqE5nlyHXtTwODaJvioN2rOWpBNEWZp2HZUFhOh+VohmJku/WxEXU2XA== - dependencies: - "@types/node" "*" - "@types/scheduler@*": version "0.16.2" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" @@ -3110,11 +3066,6 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== -"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" - integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== - "@types/yargs-parser@*": version "20.2.1" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" @@ -3141,13 +3092,6 @@ dependencies: "@umijs/utils" "3.5.0-beta.4" -"@umijs/ast@3.5.14": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/ast/-/ast-3.5.14.tgz#1056b9885677a34958132a58f52397a7ec6081bb" - integrity sha512-RwhSlq9deV92CK0lJeb57y9ABJ+FLME8LWHiLwq47+lrnC0+yAQxa6/h3lHPpeH8kzT5MMQ2uDPsNWGrxOSGQg== - dependencies: - "@umijs/utils" "3.5.14" - "@umijs/ast@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/ast/-/ast-3.5.2.tgz#64d44eb139949ccb1b218bd052400f42b5535716" @@ -3160,13 +3104,6 @@ resolved "https://registry.yarnpkg.com/@umijs/babel-plugin-auto-css-modules/-/babel-plugin-auto-css-modules-3.5.0-beta.4.tgz#319525790531938e95d77f572d1bca16c0626c02" integrity sha512-HY3MoHdkqQ6EZs3AtH3aa4FO1CcDWcP7HcEAJW+5GE0KIuB5fXFjdyucX8Ig5+Q1Hr/1ipncONp4SeQg2xnpLQ== -"@umijs/babel-plugin-auto-css-modules@3.5.14": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/babel-plugin-auto-css-modules/-/babel-plugin-auto-css-modules-3.5.14.tgz#ec5edabbc7f5d87f9aa0a310df011e929f6fc04a" - integrity sha512-rORG8TtWg25GFu/11otFAkhPoXJ1GTOe5yiJdEX4+mFRvQ0n5hp7pmABIaGLkKhr1Z4snD7j2i3h7q5GocyjYw== - dependencies: - "@umijs/utils" "3.5.14" - "@umijs/babel-plugin-auto-css-modules@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/babel-plugin-auto-css-modules/-/babel-plugin-auto-css-modules-3.5.2.tgz#b50b95451546700df5aec58db1cc1107613bcb37" @@ -3179,13 +3116,6 @@ dependencies: "@umijs/utils" "3.5.0-beta.4" -"@umijs/babel-plugin-import-to-await-require@3.5.14": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/babel-plugin-import-to-await-require/-/babel-plugin-import-to-await-require-3.5.14.tgz#991c478f13cd26a3f114e30ae8087729d1b77106" - integrity sha512-UwxFvw0odNiiFgL03/MldKwtCvf7FsrpONAK9P5E1KKqwv/LBKzYirz/Sq1hcwo3Jq4G+Zu1hf1+v1395A2/QQ== - dependencies: - "@umijs/utils" "3.5.14" - "@umijs/babel-plugin-import-to-await-require@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/babel-plugin-import-to-await-require/-/babel-plugin-import-to-await-require-3.5.2.tgz#412831d05715d7710c766f5026b5f77a1b20822f" @@ -3201,14 +3131,6 @@ "@umijs/utils" "3.5.0-beta.4" core-js "3.6.5" -"@umijs/babel-plugin-lock-core-js-3@3.5.14": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/babel-plugin-lock-core-js-3/-/babel-plugin-lock-core-js-3-3.5.14.tgz#d7608c02e7f743cf632f3acdedf1dbf67ab5a9d1" - integrity sha512-gruEARniHvQ66zAqvX41QswFOttMRS6BNob1X5ciRMPKRYZVYtPftFqMR1l2ACL0JJJpnxFRK2qMkarpoKirvA== - dependencies: - "@umijs/utils" "3.5.14" - core-js "3.6.5" - "@umijs/babel-plugin-lock-core-js-3@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/babel-plugin-lock-core-js-3/-/babel-plugin-lock-core-js-3-3.5.2.tgz#ea2ab39b4c55735879a3435f7fb031a33884af16" @@ -3224,13 +3146,6 @@ dependencies: "@umijs/utils" "3.5.0-beta.4" -"@umijs/babel-plugin-no-anonymous-default-export@3.5.14": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/babel-plugin-no-anonymous-default-export/-/babel-plugin-no-anonymous-default-export-3.5.14.tgz#4596caed3e001b2870f07d5e52b3220bf08c65e8" - integrity sha512-pTd1OR/MPi6GHl01My92U5i0mam+tSnWRX1144LSo67+clAmlxflu/MzJG/7kdTlWKxo3ZNliBG2Frv4S2P1og== - dependencies: - "@umijs/utils" "3.5.14" - "@umijs/babel-plugin-no-anonymous-default-export@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/babel-plugin-no-anonymous-default-export/-/babel-plugin-no-anonymous-default-export-3.5.2.tgz#dad3b0e657a180ee9607173001c25400cab7adb0" @@ -3250,18 +3165,6 @@ "@umijs/babel-plugin-no-anonymous-default-export" "3.5.0-beta.4" "@umijs/deps" "3.5.0-beta.4" -"@umijs/babel-preset-umi@3.5.14", "@umijs/babel-preset-umi@3.x": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/babel-preset-umi/-/babel-preset-umi-3.5.14.tgz#07cc495ad3bbe8295d4bfffb42f0ac4820868e72" - integrity sha512-HjYJbW+KNqeTWUvlJZrEnMdbgXyfzONDfuSsyp2RCrrFcGjlgm9JicvqvJaAtRZDHAdj8Xjby5ynqWyHGrGxIA== - dependencies: - "@babel/runtime" "7.12.5" - "@umijs/babel-plugin-auto-css-modules" "3.5.14" - "@umijs/babel-plugin-import-to-await-require" "3.5.14" - "@umijs/babel-plugin-lock-core-js-3" "3.5.14" - "@umijs/babel-plugin-no-anonymous-default-export" "3.5.14" - "@umijs/deps" "3.5.14" - "@umijs/babel-preset-umi@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/babel-preset-umi/-/babel-preset-umi-3.5.2.tgz#b8bd61e4ad753e7b3886db31ff9dd8adb9c7fdfa" @@ -3313,16 +3216,6 @@ "@umijs/deps" "3.5.0-beta.4" "@umijs/utils" "3.5.0-beta.4" -"@umijs/core@3.5.14": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/core/-/core-3.5.14.tgz#0629237a3ac6b833d410bfcbbf25c97de7c934cb" - integrity sha512-h0ndE7fmg7K9vX026y7RdZNDwL5m3rbuuOrjHKc4IqHx9gSyLW16owd9xK1cRK11iXY9yeUwJl0HbG9Zn4OLtA== - dependencies: - "@umijs/ast" "3.5.14" - "@umijs/babel-preset-umi" "3.5.14" - "@umijs/deps" "3.5.14" - "@umijs/utils" "3.5.14" - "@umijs/core@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/core/-/core-3.5.2.tgz#1d6602b0fe4de9c32dfa0ddddfb8ef33e932aa22" @@ -3344,18 +3237,6 @@ jest-worker "24.9.0" prettier "2.2.1" -"@umijs/deps@3.5.14": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/deps/-/deps-3.5.14.tgz#1371571958f94b0291d7b3a728833fda57393fb9" - integrity sha512-EmN4kOBLNo+6G9aCarXKOX48b/VF36gTFMqe6iDEPBaycDm8kxtzcjwS1cJQoVJw2pLL6ec6t6dPugJtCom0YQ== - dependencies: - "@bloomberg/record-tuple-polyfill" "0.0.3" - chokidar "3.5.1" - clipboardy "2.3.0" - esbuild "0.12.15" - jest-worker "24.9.0" - prettier "2.2.1" - "@umijs/deps@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/deps/-/deps-3.5.2.tgz#76c7f4d29865a76cd4751b420a3b70782e29a109" @@ -3372,54 +3253,6 @@ resolved "https://registry.yarnpkg.com/@umijs/plugin-analytics/-/plugin-analytics-0.2.2.tgz#575fd231d4327ea13413217aa1b5fc6bdd89465e" integrity sha512-dVDzUfgIdEwdCC6a5IsMYpIPI+bEZjBEqIhAvw9dic6Vk77w9RxQxyRfW11dDmdXLAwWphp22NntQNt1ejZPtg== -"@umijs/preset-dumi@^1.1.6": - version "1.1.24" - resolved "https://registry.yarnpkg.com/@umijs/preset-dumi/-/preset-dumi-1.1.24.tgz#386df38f69ab0ec7d479a88423b6558bde6c91d6" - integrity sha512-0V1T99VqM3Lmz6ZA5xXIeVaB31BrceGijpH2SFGk+rz0+r3aS7Rk34MpOwu0JX7eJDY+LaBDO09OLfthSf0mJA== - dependencies: - "@babel/core" "^7.7.2" - "@babel/generator" "^7.7.2" - "@babel/plugin-transform-modules-commonjs" "^7.7.2" - "@babel/traverse" "^7.7.2" - "@babel/types" "^7.7.2" - "@mapbox/hast-util-to-jsx" "^1.0.0" - "@umijs/babel-preset-umi" "3.x" - "@umijs/plugin-analytics" "^0.2.2" - "@umijs/runtime" "^3.2.14" - "@umijs/types" "3.x" - "@umijs/utils" "^3.2.28" - copy-text-to-clipboard "^2.2.0" - deepmerge "^4.2.2" - dumi-assets-types "1.0.0" - dumi-theme-default "1.1.7" - enhanced-resolve "^4.1.1" - github-slugger "^1.3.0" - hast-util-has-property "^1.0.4" - hast-util-is-element "^1.1.0" - hast-util-raw "^6.0.0" - hast-util-to-html "^7.1.1" - hast-util-to-string "^1.0.2" - hosted-git-info "^3.0.2" - js-yaml "^3.13.1" - lz-string "^1.4.4" - react-docgen-typescript-dumi-tmp "^1.22.1-0" - rehype-autolink-headings "^4.0.0" - rehype-mathjax "^3.1.0" - rehype-remove-comments "^4.0.2" - rehype-stringify "^8.0.0" - remark-frontmatter "^3.0.0" - remark-gfm "^1.0.0" - remark-math "^4.0.0" - remark-parse "^9.0.0" - remark-rehype "^8.0.0" - remark-stringify "^9.0.0" - sitemap "^6.3.3" - slash2 "^2.0.0" - terser "^5.5.1" - unified "^8.4.1" - unist-util-visit "^2.0.1" - unist-util-visit-parents "^3.0.1" - "@umijs/renderer-mpa@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/renderer-mpa/-/renderer-mpa-3.5.2.tgz#2e369dfe6d6c1e1403e98be2c5a9d20abd7d6f34" @@ -3441,26 +3274,6 @@ react-router-dom "5.2.0" use-subscription "1.5.1" -"@umijs/runtime@^3.2.14": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/runtime/-/runtime-3.5.14.tgz#0ce79f689f4b3ff6768156b481343b44250188e1" - integrity sha512-H2Sy3Ram8FwqI0eun7CuNyyo/QYDDqx0ohKYusqdtuNjkotdr2PLGD15qbsI382gk6PfmsXWbZMsgzutpetrZA== - dependencies: - "@types/react-router" "5.1.12" - "@types/react-router-dom" "5.1.7" - history-with-query "4.10.4" - react-router "5.2.0" - react-router-dom "5.2.0" - use-subscription "1.5.1" - -"@umijs/server@3.5.14": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/server/-/server-3.5.14.tgz#09424cc3dbf419815130e814a732beb2efedddce" - integrity sha512-b/uP51JLSJ77qEQoIXoe9eu/KHYG8dpyU+7mwwBjMjuN2cjcQWZv3XJ5k6QS3PhFUgbdDhqK1sYjPRcNUpH4DQ== - dependencies: - "@umijs/deps" "3.5.14" - "@umijs/utils" "3.5.14" - "@umijs/server@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/server/-/server-3.5.2.tgz#4bdfefbb845d5d3f3d3dae95db8a5ee1e574a28d" @@ -3504,18 +3317,6 @@ "@umijs/utils" "3.5.2" webpack-chain "6.5.1" -"@umijs/types@3.x": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/types/-/types-3.5.14.tgz#630bee3630c3a91977d7934cf32b5d04eee7196e" - integrity sha512-9dB5VqFoDylFWPDK/fo5nBub/iDppotuAUn0ZNJ21ELBpdswTUqmjGFFcz0MSAElg/nhI2HyVVRbdh3MEj5CfQ== - dependencies: - "@umijs/babel-preset-umi" "3.5.14" - "@umijs/core" "3.5.14" - "@umijs/deps" "3.5.14" - "@umijs/server" "3.5.14" - "@umijs/utils" "3.5.14" - webpack-chain "6.5.1" - "@umijs/utils@3.5.0-beta.4": version "3.5.0-beta.4" resolved "https://registry.yarnpkg.com/@umijs/utils/-/utils-3.5.0-beta.4.tgz#165fbd829e56a04323996973c23327e0f96e2e99" @@ -3523,13 +3324,6 @@ dependencies: "@umijs/deps" "3.5.0-beta.4" -"@umijs/utils@3.5.14", "@umijs/utils@^3.2.28": - version "3.5.14" - resolved "https://registry.yarnpkg.com/@umijs/utils/-/utils-3.5.14.tgz#ff18c5499c4e26597924c7c322c27daeae69b1d5" - integrity sha512-zPzAGqjhlvAdO5hSgqSfBmoiEMpsqFzG/F4eW/T1BDRtfpEFqFjAkxuuxYXWlOAwykRnb6ata8n4QboPYyCdig== - dependencies: - "@umijs/deps" "3.5.14" - "@umijs/utils@3.5.2": version "3.5.2" resolved "https://registry.npmjs.org/@umijs/utils/-/utils-3.5.2.tgz#5752474df6b7e78d31d9290b5630f803b6e19a6a" @@ -4056,11 +3850,6 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" -arg@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.0.tgz#a20e2bb5710e82950a516b3f933fee5ed478be90" - integrity sha512-4P8Zm2H+BRS+c/xX1LrHw0qKpEhdlZjLCgWy+d78T9vqa2Z2SiD2wMrYuWIAFy5IZUD7nnNXroRttz+0RzlrzQ== - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -4389,11 +4178,6 @@ babel-preset-jest@^26.6.2: babel-plugin-jest-hoist "^26.6.2" babel-preset-current-node-syntax "^1.0.0" -bail@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" - integrity sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ== - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -4806,11 +4590,6 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase-css@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" - integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== - camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -4889,11 +4668,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -ccount@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" - integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== - center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" @@ -4935,26 +4709,6 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -character-entities-html4@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.4.tgz#0e64b0a3753ddbf1fdc044c5fd01d0199a02e125" - integrity sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g== - -character-entities-legacy@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" - integrity sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA== - -character-entities@^1.0.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b" - integrity sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw== - -character-reference-invalid@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" - integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== - chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -5057,11 +4811,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -classnames@2.x, classnames@^2.2.1, classnames@^2.2.6: - version "2.3.1" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" - integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== - clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" @@ -5301,17 +5050,7 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -comma-separated-tokens@^1.0.0: - version "1.0.8" - resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" - integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== - -commander@>=7.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.1.0.tgz#db36e3e66edf24ff591d639862c6ab2c52664362" - integrity sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA== - -commander@^2.18.0, commander@^2.19.0, commander@^2.20.0: +commander@^2.18.0, commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -5554,11 +5293,6 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -copy-text-to-clipboard@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/copy-text-to-clipboard/-/copy-text-to-clipboard-2.2.0.tgz#329dd6daf8c42034c763ace567418401764579ae" - integrity sha512-WRvoIdnTs1rgPMkgA2pUOa/M4Enh2uzCwdKsOMYNAJiz/4ZvEJgmbF4OmninPmlFdAWisfeh0tH+Cpf7ni3RqQ== - core-js-compat@^3.14.0, core-js-compat@^3.16.0, core-js-compat@^3.6.2: version "3.16.0" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.16.0.tgz#fced4a0a534e7e02f7e084bff66c701f8281805f" @@ -6005,7 +5739,7 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== @@ -6223,11 +5957,6 @@ dom-accessibility-api@^0.5.6: resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.6.tgz#3f5d43b52c7a3bd68b5fb63fa47b4e4c1fdf65a9" integrity sha512-DplGLZd8L1lN64jlT27N9TVSESFR5STaEJvX+thCby7fuCHonfPpAlodYc3vuUYbDuDec5w8AMP7oCM5TWFsqw== -dom-align@^1.7.0: - version "1.12.2" - resolved "https://registry.yarnpkg.com/dom-align/-/dom-align-1.12.2.tgz#0f8164ebd0c9c21b0c790310493cd855892acd4b" - integrity sha512-pHuazgqrsTFrGU2WLDdXxCFabkdQDx72ddkraZNih1KsMcN5qsRSTR9O4VJRlwTPCPb5COYg3LOfiMHHcPInHg== - dom-serializer@0: version "0.2.2" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" @@ -6287,20 +6016,6 @@ dot-prop@^5.1.0, dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" -dumi-assets-types@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/dumi-assets-types/-/dumi-assets-types-1.0.0.tgz#d5368cb11045b203bf1ef1080e553b2287a2ec81" - integrity sha512-7nhSeWM15vybbUAMPLZsdls2jKoHB2UU4P1RM6kLPucuS8eC/HSmufquFqTTYtX4oIDLHGtil/dVtMreNGwhdA== - -dumi-theme-default@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/dumi-theme-default/-/dumi-theme-default-1.1.7.tgz#5cce82406ea78d622a2e12284807320ccb49042e" - integrity sha512-A0+vgOhlUB8tb9hVxea9xawjxLf1c6Z2PE0UKYBrDH2rvwh7Q0aV8dQTip7h/hRlIpYBK1gbpJLBFhYPn1lOQA== - dependencies: - prism-react-renderer "^1.1.1" - prismjs "^1.21.0" - rc-tabs "^11.7.1" - duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" @@ -6362,11 +6077,6 @@ emittery@^0.7.1: resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.7.2.tgz#25595908e13af0f5674ab419396e2fb394cdfa82" integrity sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ== -"emoji-regex@>=6.0.0 <=6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" - integrity sha1-xs0OwbBkLio8Z6ETfvxeeW2k+I4= - emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -6406,7 +6116,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.1, enhanced-resolve@^4.5.0: +enhanced-resolve@^4.0.0, enhanced-resolve@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz#2f3cfd84dbe3b487f18f2db2ef1e064a571ca5ec" integrity sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg== @@ -6551,11 +6261,6 @@ es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -esbuild@0.12.15: - version "0.12.15" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.15.tgz#9d99cf39aeb2188265c5983e983e236829f08af0" - integrity sha512-72V4JNd2+48eOVCXx49xoSWHgC3/cCy96e7mbXKY+WOWghN00cCmlGnwVLRhRHorvv0dgCyuMYBZlM2xDM5OQw== - esbuild@^0.12.5: version "0.12.17" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.17.tgz#5816f905c2905de0ebbc658860df7b5b48afbcd3" @@ -6586,11 +6291,6 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - escodegen@^1.11.0: version "1.14.3" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" @@ -6623,11 +6323,6 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -esm@^3.2.25: - version "3.2.25" - resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.25.tgz#342c18c29d56157688ba5ce31f8431fbb795cc10" - integrity sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA== - esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -6860,7 +6555,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.0, extend@^3.0.1, extend@~3.0.2: +extend@^3.0.0, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -7007,13 +6702,6 @@ father-build@1.19.2: vinyl-fs "3.0.3" yargs-parser "13.1.2" -fault@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13" - integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA== - dependencies: - format "^0.2.0" - fb-watchman@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" @@ -7208,11 +6896,6 @@ format-util@^1.0.3: resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271" integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== -format@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" - integrity sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs= - forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -7493,13 +7176,6 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -github-slugger@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.3.0.tgz#9bd0a95c5efdfc46005e82a906ef8e2a059124c9" - integrity sha512-gwJScWVNhFYSRDvURk/8yhcFBee6aFjye2a7Lhb2bUyRulpIoek9p0I9Kt7PT67d/nUlZbFu8L9RLiA0woQN8Q== - dependencies: - emoji-regex ">=6.0.0 <=6.1.1" - glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -7822,133 +7498,6 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -hast-to-hyperscript@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz#9b67fd188e4c81e8ad66f803855334173920218d" - integrity sha512-zQgLKqF+O2F72S1aa4y2ivxzSlko3MAvxkwG8ehGmNiqd98BIN3JM1rAJPmplEyLmGLO2QZYJtIneOSZ2YbJuA== - dependencies: - "@types/unist" "^2.0.3" - comma-separated-tokens "^1.0.0" - property-information "^5.3.0" - space-separated-tokens "^1.0.0" - style-to-object "^0.3.0" - unist-util-is "^4.0.0" - web-namespaces "^1.0.0" - -hast-util-from-dom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-from-dom/-/hast-util-from-dom-3.0.0.tgz#e0ea87fafaf3ec64650fc9404ab1538238f32cb5" - integrity sha512-4vQuGiD5Y/wlD7fZiY4mZML/6oh0GOnH38UNyeDFcSTE4AHF0zjKHZfbd+ekVwPvsZXRl8choc99INHUwSPJlg== - dependencies: - hastscript "^6.0.0" - web-namespaces "^1.0.0" - -hast-util-from-parse5@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz#554e34abdeea25ac76f5bd950a1f0180e0b3bc2a" - integrity sha512-jeJUWiN5pSxW12Rh01smtVkZgZr33wBokLzKLwinYOUfSzm1Nl/c3GUGebDyOKjdsRgMvoVbV0VpAcpjF4NrJA== - dependencies: - "@types/parse5" "^5.0.0" - hastscript "^6.0.0" - property-information "^5.0.0" - vfile "^4.0.0" - vfile-location "^3.2.0" - web-namespaces "^1.0.0" - -hast-util-has-property@^1.0.0, hast-util-has-property@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/hast-util-has-property/-/hast-util-has-property-1.0.4.tgz#9f137565fad6082524b382c1e7d7d33ca5059f36" - integrity sha512-ghHup2voGfgFoHMGnaLHOjbYFACKrRh9KFttdCzMCbFoBMJXiNi2+XTrPP8+q6cDJM/RSqlCfVWrjp1H201rZg== - -hast-util-is-conditional-comment@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/hast-util-is-conditional-comment/-/hast-util-is-conditional-comment-1.0.4.tgz#cc0694c9b5d27cc3e0f1d0e1185a631140aa6e81" - integrity sha512-rtULxWWknVeSuU/vsJ9tHo+M3ExyaOrZcWvLxqY2nUfCHbDcq60EJzSJC5zNm6ZlbxbJ8l7Ej8C1Kzsi5PJS1A== - -hast-util-is-element@^1.0.0, hast-util-is-element@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz#3b3ed5159a2707c6137b48637fbfe068e175a425" - integrity sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ== - -hast-util-parse-selector@^2.0.0: - version "2.2.5" - resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a" - integrity sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ== - -hast-util-raw@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-6.1.0.tgz#e16a3c2642f65cc7c480c165400a40d604ab75d0" - integrity sha512-5FoZLDHBpka20OlZZ4I/+RBw5piVQ8iI1doEvffQhx5CbCyTtP8UCq8Tw6NmTAMtXgsQxmhW7Ly8OdFre5/YMQ== - dependencies: - "@types/hast" "^2.0.0" - hast-util-from-parse5 "^6.0.0" - hast-util-to-parse5 "^6.0.0" - html-void-elements "^1.0.0" - parse5 "^6.0.0" - unist-util-position "^3.0.0" - unist-util-visit "^2.0.0" - vfile "^4.0.0" - web-namespaces "^1.0.0" - xtend "^4.0.0" - zwitch "^1.0.0" - -hast-util-to-html@^7.1.1: - version "7.1.3" - resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-7.1.3.tgz#9f339ca9bea71246e565fc79ff7dbfe98bb50f5e" - integrity sha512-yk2+1p3EJTEE9ZEUkgHsUSVhIpCsL/bvT8E5GzmWc+N1Po5gBw+0F8bo7dpxXR0nu0bQVxVZGX2lBGF21CmeDw== - dependencies: - ccount "^1.0.0" - comma-separated-tokens "^1.0.0" - hast-util-is-element "^1.0.0" - hast-util-whitespace "^1.0.0" - html-void-elements "^1.0.0" - property-information "^5.0.0" - space-separated-tokens "^1.0.0" - stringify-entities "^3.0.1" - unist-util-is "^4.0.0" - xtend "^4.0.0" - -hast-util-to-parse5@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz#1ec44650b631d72952066cea9b1445df699f8479" - integrity sha512-Lu5m6Lgm/fWuz8eWnrKezHtVY83JeRGaNQ2kn9aJgqaxvVkFCZQBEhgodZUDUvoodgyROHDb3r5IxAEdl6suJQ== - dependencies: - hast-to-hyperscript "^9.0.0" - property-information "^5.0.0" - web-namespaces "^1.0.0" - xtend "^4.0.0" - zwitch "^1.0.0" - -hast-util-to-string@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/hast-util-to-string/-/hast-util-to-string-1.0.4.tgz#9b24c114866bdb9478927d7e9c36a485ac728378" - integrity sha512-eK0MxRX47AV2eZ+Lyr18DCpQgodvaS3fAQO2+b9Two9F5HEoRPhiUMNzoXArMJfZi2yieFzUBMRl3HNJ3Jus3w== - -hast-util-to-text@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/hast-util-to-text/-/hast-util-to-text-2.0.1.tgz#04f2e065642a0edb08341976084aa217624a0f8b" - integrity sha512-8nsgCARfs6VkwH2jJU9b8LNTuR4700na+0h3PqCaEk4MAnMDeu5P0tP8mjk9LLNGxIeQRLbiDbZVw6rku+pYsQ== - dependencies: - hast-util-is-element "^1.0.0" - repeat-string "^1.0.0" - unist-util-find-after "^3.0.0" - -hast-util-whitespace@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz#e4fe77c4a9ae1cb2e6c25e02df0043d0164f6e41" - integrity sha512-I5GTdSfhYfAPNztx2xJRQpG8cuDSNt599/7YUn7Gx/WxNMsG+a835k97TDkFgk123cwjfwINaZknkKkphx/f2A== - -hastscript@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" - integrity sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w== - dependencies: - "@types/hast" "^2.0.0" - comma-separated-tokens "^1.0.0" - hast-util-parse-selector "^2.0.0" - property-information "^5.0.0" - space-separated-tokens "^1.0.0" - he@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -8023,13 +7572,6 @@ hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== -hosted-git-info@^3.0.2: - version "3.0.8" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-3.0.8.tgz#6e35d4cc87af2c5f816e4cb9ce350ba87a3f370d" - integrity sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw== - dependencies: - lru-cache "^6.0.0" - hosted-git-info@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.0.2.tgz#5e425507eede4fea846b7262f0838456c4209961" @@ -8066,11 +7608,6 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -html-void-elements@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" - integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w== - http-cache-semantics@^3.8.1: version "3.8.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" @@ -8364,11 +7901,6 @@ init-package-json@^1.10.3: validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" -inline-style-parser@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" - integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== - inquirer@^6.2.0: version "6.5.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" @@ -8460,19 +7992,6 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-alphabetical@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" - integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== - -is-alphanumerical@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz#7eb9a2431f855f6b1ef1a78e326df515696c4dbf" - integrity sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A== - dependencies: - is-alphabetical "^1.0.0" - is-decimal "^1.0.0" - is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -8514,11 +8033,6 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" - integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== - is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" @@ -8576,11 +8090,6 @@ is-date-object@^1.0.1: resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== -is-decimal@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5" - integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw== - is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -8672,11 +8181,6 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-hexadecimal@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" - integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== - is-installed-globally@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" @@ -8763,11 +8267,6 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= -is-plain-obj@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -9538,7 +9037,7 @@ jsdom@^14.1.0: ws "^6.1.2" xml-name-validator "^3.0.0" -jsdom@^16.0.0, jsdom@^16.4.0: +jsdom@^16.4.0: version "16.6.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.6.0.tgz#f79b3786682065492a3da6a60a4695da983805ac" integrity sha512-Ty1vmF4NHJkolaEmdjtxTfSfkdb8Ywarwf63f+F8/mDD1uLSSWDxDuMiZxiPhwunLrn9LOSVItWj4bLYsLN3Dg== @@ -9696,18 +9195,6 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -katex@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/katex/-/katex-0.12.0.tgz#2fb1c665dbd2b043edcf8a1f5c555f46beaa0cb9" - integrity sha512-y+8btoc/CK70XqcHqjxiGWBOeIL8upbS0peTPXTvgrh21n1RiWWcIpSWM+4uXq+IAgNh9YYQWdc7LVDPDAEEAg== - dependencies: - commander "^2.19.0" - -kebab-case@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.1.tgz#bf734fc95400a3701869215d99a902bd3fe72f60" - integrity sha512-txPHx6nVLhv8PHGXIlAk0nYoh894SpAqGPXNvbg2hh8spvHXIah3+vT87DLoa59nKgC6scD3u3xAuRIgiMqbfQ== - keyv@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" @@ -10092,11 +9579,6 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -longest-streak@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" - integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== - longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -10246,23 +9728,6 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -markdown-table@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b" - integrity sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A== - dependencies: - repeat-string "^1.0.0" - -mathjax-full@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/mathjax-full/-/mathjax-full-3.2.0.tgz#e53269842a943d4df10502937518991268996c5c" - integrity sha512-D2EBNvUG+mJyhn+M1C858k0f2Fc4KxXvbEX2WCMXroV10212JwfYqaBJ336ECBSz5X9L5LRoamxb7AJtg3KaJA== - dependencies: - esm "^3.2.25" - mhchemparser "^4.1.0" - mj-context-menu "^0.6.1" - speech-rule-engine "^3.3.3" - md5.js@^1.3.4: version "1.3.5" resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -10272,122 +9737,6 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -mdast-util-definitions@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz#c5c1a84db799173b4dcf7643cda999e440c24db2" - integrity sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ== - dependencies: - unist-util-visit "^2.0.0" - -mdast-util-find-and-replace@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-1.1.1.tgz#b7db1e873f96f66588c321f1363069abf607d1b5" - integrity sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA== - dependencies: - escape-string-regexp "^4.0.0" - unist-util-is "^4.0.0" - unist-util-visit-parents "^3.0.0" - -mdast-util-from-markdown@^0.8.0: - version "0.8.5" - resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz#d1ef2ca42bc377ecb0463a987910dae89bd9a28c" - integrity sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ== - dependencies: - "@types/mdast" "^3.0.0" - mdast-util-to-string "^2.0.0" - micromark "~2.11.0" - parse-entities "^2.0.0" - unist-util-stringify-position "^2.0.0" - -mdast-util-frontmatter@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/mdast-util-frontmatter/-/mdast-util-frontmatter-0.2.0.tgz#8bd5cd55e236c03e204a036f7372ebe9e6748240" - integrity sha512-FHKL4w4S5fdt1KjJCwB0178WJ0evnyyQr5kXTM3wrOVpytD0hrkvd+AOOjU9Td8onOejCkmZ+HQRT3CZ3coHHQ== - dependencies: - micromark-extension-frontmatter "^0.2.0" - -mdast-util-gfm-autolink-literal@^0.1.0: - version "0.1.3" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.3.tgz#9c4ff399c5ddd2ece40bd3b13e5447d84e385fb7" - integrity sha512-GjmLjWrXg1wqMIO9+ZsRik/s7PLwTaeCHVB7vRxUwLntZc8mzmTsLVr6HW1yLokcnhfURsn5zmSVdi3/xWWu1A== - dependencies: - ccount "^1.0.0" - mdast-util-find-and-replace "^1.1.0" - micromark "^2.11.3" - -mdast-util-gfm-strikethrough@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz#45eea337b7fff0755a291844fbea79996c322890" - integrity sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA== - dependencies: - mdast-util-to-markdown "^0.6.0" - -mdast-util-gfm-table@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz#af05aeadc8e5ee004eeddfb324b2ad8c029b6ecf" - integrity sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ== - dependencies: - markdown-table "^2.0.0" - mdast-util-to-markdown "~0.6.0" - -mdast-util-gfm-task-list-item@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz#70c885e6b9f543ddd7e6b41f9703ee55b084af10" - integrity sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A== - dependencies: - mdast-util-to-markdown "~0.6.0" - -mdast-util-gfm@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-0.1.2.tgz#8ecddafe57d266540f6881f5c57ff19725bd351c" - integrity sha512-NNkhDx/qYcuOWB7xHUGWZYVXvjPFFd6afg6/e2g+SV4r9q5XUcCbV4Wfa3DLYIiD+xAEZc6K4MGaE/m0KDcPwQ== - dependencies: - mdast-util-gfm-autolink-literal "^0.1.0" - mdast-util-gfm-strikethrough "^0.2.0" - mdast-util-gfm-table "^0.1.0" - mdast-util-gfm-task-list-item "^0.1.0" - mdast-util-to-markdown "^0.6.1" - -mdast-util-math@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/mdast-util-math/-/mdast-util-math-0.1.2.tgz#629a0793bd8822432917e5ddda5279492390cc2b" - integrity sha512-fogAitds+wH+QRas78Yr1TwmQGN4cW/G2WRw5ePuNoJbBSPJCxIOCE8MTzHgWHVSpgkRaPQTgfzXRE1CrwWSlg== - dependencies: - longest-streak "^2.0.0" - mdast-util-to-markdown "^0.6.0" - repeat-string "^1.0.0" - -mdast-util-to-hast@^10.2.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz#61875526a017d8857b71abc9333942700b2d3604" - integrity sha512-JoPBfJ3gBnHZ18icCwHR50orC9kNH81tiR1gs01D8Q5YpV6adHNO9nKNuFBCJQ941/32PT1a63UF/DitmS3amQ== - dependencies: - "@types/mdast" "^3.0.0" - "@types/unist" "^2.0.0" - mdast-util-definitions "^4.0.0" - mdurl "^1.0.0" - unist-builder "^2.0.0" - unist-util-generated "^1.0.0" - unist-util-position "^3.0.0" - unist-util-visit "^2.0.0" - -mdast-util-to-markdown@^0.6.0, mdast-util-to-markdown@^0.6.1, mdast-util-to-markdown@~0.6.0: - version "0.6.5" - resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz#b33f67ca820d69e6cc527a93d4039249b504bebe" - integrity sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ== - dependencies: - "@types/unist" "^2.0.0" - longest-streak "^2.0.0" - mdast-util-to-string "^2.0.0" - parse-entities "^2.0.0" - repeat-string "^1.0.0" - zwitch "^1.0.0" - -mdast-util-to-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b" - integrity sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w== - mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -10398,11 +9747,6 @@ mdn-data@2.0.4: resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== -mdurl@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= - media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -10532,79 +9876,6 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= -mhchemparser@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/mhchemparser/-/mhchemparser-4.1.1.tgz#a2142fdab37a02ec8d1b48a445059287790becd5" - integrity sha512-R75CUN6O6e1t8bgailrF1qPq+HhVeFTM3XQ0uzI+mXTybmphy3b6h4NbLOYhemViQ3lUs+6CKRkC3Ws1TlYREA== - -micromark-extension-frontmatter@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/micromark-extension-frontmatter/-/micromark-extension-frontmatter-0.2.2.tgz#61b8e92e9213e1d3c13f5a59e7862f5ca98dfa53" - integrity sha512-q6nPLFCMTLtfsctAuS0Xh4vaolxSFUWUWR6PZSrXXiRy+SANGllpcqdXFv2z07l0Xz/6Hl40hK0ffNCJPH2n1A== - dependencies: - fault "^1.0.0" - -micromark-extension-gfm-autolink-literal@~0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.7.tgz#53866c1f0c7ef940ae7ca1f72c6faef8fed9f204" - integrity sha512-ePiDGH0/lhcngCe8FtH4ARFoxKTUelMp4L7Gg2pujYD5CSMb9PbblnyL+AAMud/SNMyusbS2XDSiPIRcQoNFAw== - dependencies: - micromark "~2.11.3" - -micromark-extension-gfm-strikethrough@~0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.5.tgz#96cb83356ff87bf31670eefb7ad7bba73e6514d1" - integrity sha512-PpOKlgokpQRwUesRwWEp+fHjGGkZEejj83k9gU5iXCbDG+XBA92BqnRKYJdfqfkrRcZRgGuPuXb7DaK/DmxOhw== - dependencies: - micromark "~2.11.0" - -micromark-extension-gfm-table@~0.4.0: - version "0.4.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.3.tgz#4d49f1ce0ca84996c853880b9446698947f1802b" - integrity sha512-hVGvESPq0fk6ALWtomcwmgLvH8ZSVpcPjzi0AjPclB9FsVRgMtGZkUcpE0zgjOCFAznKepF4z3hX8z6e3HODdA== - dependencies: - micromark "~2.11.0" - -micromark-extension-gfm-tagfilter@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-0.3.0.tgz#d9f26a65adee984c9ccdd7e182220493562841ad" - integrity sha512-9GU0xBatryXifL//FJH+tAZ6i240xQuFrSL7mYi8f4oZSbc+NvXjkrHemeYP0+L4ZUT+Ptz3b95zhUZnMtoi/Q== - -micromark-extension-gfm-task-list-item@~0.3.0: - version "0.3.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz#d90c755f2533ed55a718129cee11257f136283b8" - integrity sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ== - dependencies: - micromark "~2.11.0" - -micromark-extension-gfm@^0.3.0: - version "0.3.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-0.3.3.tgz#36d1a4c089ca8bdfd978c9bd2bf1a0cb24e2acfe" - integrity sha512-oVN4zv5/tAIA+l3GbMi7lWeYpJ14oQyJ3uEim20ktYFAcfX1x3LNlFGGlmrZHt7u9YlKExmyJdDGaTt6cMSR/A== - dependencies: - micromark "~2.11.0" - micromark-extension-gfm-autolink-literal "~0.5.0" - micromark-extension-gfm-strikethrough "~0.6.5" - micromark-extension-gfm-table "~0.4.0" - micromark-extension-gfm-tagfilter "~0.3.0" - micromark-extension-gfm-task-list-item "~0.3.0" - -micromark-extension-math@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/micromark-extension-math/-/micromark-extension-math-0.1.2.tgz#5d7bb2b86018da4a758c05f3991664430ee4d711" - integrity sha512-ZJXsT2eVPM8VTmcw0CPSDeyonOn9SziGK3Z+nkf9Vb6xMPeU+4JMEnO6vzDL10562Favw8Vste74f54rxJ/i6Q== - dependencies: - katex "^0.12.0" - micromark "~2.11.0" - -micromark@^2.11.3, micromark@~2.11.0, micromark@~2.11.3: - version "2.11.4" - resolved "https://registry.yarnpkg.com/micromark/-/micromark-2.11.4.tgz#d13436138eea826383e822449c9a5c50ee44665a" - integrity sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA== - dependencies: - debug "^4.0.0" - parse-entities "^2.0.0" - micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -10793,11 +10064,6 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mj-context-menu@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/mj-context-menu/-/mj-context-menu-0.6.1.tgz#a043c5282bf7e1cf3821de07b13525ca6f85aa69" - integrity sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA== - mkdirp-promise@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" @@ -11633,18 +10899,6 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" -parse-entities@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" - integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== - dependencies: - character-entities "^1.0.0" - character-entities-legacy "^1.0.0" - character-reference-invalid "^1.0.0" - is-alphanumerical "^1.0.0" - is-decimal "^1.0.0" - is-hexadecimal "^1.0.0" - parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -11705,7 +10959,7 @@ parse5@5.1.0: resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== -parse5@6.0.1, parse5@^6.0.0: +parse5@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== @@ -12138,14 +11392,6 @@ postcss-initial@^3.0.0: dependencies: postcss "^7.0.2" -postcss-js@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-2.0.3.tgz#a96f0f23ff3d08cec7dc5b11bf11c5f8077cdab9" - integrity sha512-zS59pAk3deu6dVHyrGqmC3oDXBdNdajk4k1RyxeVXCrcEDBUBHoIhE4QTsmhxgzXxsaqFDAkUZfmMa5f/N/79w== - dependencies: - camelcase-css "^2.0.1" - postcss "^7.0.18" - postcss-lab-function@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/postcss-lab-function/-/postcss-lab-function-2.0.1.tgz#bb51a6856cd12289ab4ae20db1e3821ef13d7d2e" @@ -12601,7 +11847,7 @@ postcss@^6.0.1: source-map "^0.6.1" supports-color "^5.4.0" -postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.17, postcss@^7.0.18, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.31, postcss@^7.0.32, postcss@^7.0.36, postcss@^7.0.5, postcss@^7.0.6: +postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.36, postcss@^7.0.5, postcss@^7.0.6: version "7.0.36" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.36.tgz#056f8cffa939662a8f5905950c07d5285644dfcb" integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw== @@ -12640,7 +11886,7 @@ prettier@^1.18.2, prettier@^1.19.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== -prettier@^2.3.0: +prettier@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ== @@ -12655,16 +11901,6 @@ pretty-format@^26.0.0, pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" -prism-react-renderer@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.2.1.tgz#392460acf63540960e5e3caa699d851264e99b89" - integrity sha512-w23ch4f75V1Tnz8DajsYKvY5lF7H1+WvzvLUcF0paFxkTHSp42RS0H5CttdN2Q8RR3DRGZ9v5xD/h3n8C8kGmg== - -prismjs@^1.21.0: - version "1.24.1" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.24.1.tgz#c4d7895c4d6500289482fa8936d9cdd192684036" - integrity sha512-mNPsedLuk90RVJioIky8ANZEwYm5w9LcvCXrxHlwf4fNVSn8jEipMybMkWUyyF0JhnC+C4VcOVSBuHRKs1L5Ow== - process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -12740,13 +11976,6 @@ proper-lockfile@^4.1.2: retry "^0.12.0" signal-exit "^3.0.2" -property-information@^5.0.0, property-information@^5.3.0, property-information@^5.5.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" - integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== - dependencies: - xtend "^4.0.0" - proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -12929,100 +12158,6 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" -rc-align@^4.0.0: - version "4.0.9" - resolved "https://registry.yarnpkg.com/rc-align/-/rc-align-4.0.9.tgz#46d8801c4a139ff6a65ad1674e8efceac98f85f2" - integrity sha512-myAM2R4qoB6LqBul0leaqY8gFaiECDJ3MtQDmzDo9xM9NRT/04TvWOYd2YHU9zvGzqk9QXF6S9/MifzSKDZeMw== - dependencies: - "@babel/runtime" "^7.10.1" - classnames "2.x" - dom-align "^1.7.0" - rc-util "^5.3.0" - resize-observer-polyfill "^1.5.1" - -rc-dropdown@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/rc-dropdown/-/rc-dropdown-3.2.0.tgz#da6c2ada403842baee3a9e909a0b1a91ba3e1090" - integrity sha512-j1HSw+/QqlhxyTEF6BArVZnTmezw2LnSmRk6I9W7BCqNCKaRwleRmMMs1PHbuaG8dKHVqP6e21RQ7vPBLVnnNw== - dependencies: - "@babel/runtime" "^7.10.1" - classnames "^2.2.6" - rc-trigger "^5.0.4" - -rc-menu@^9.0.0: - version "9.0.12" - resolved "https://registry.yarnpkg.com/rc-menu/-/rc-menu-9.0.12.tgz#492c4bb07a596e2ce07587c669b27ee28c3810c5" - integrity sha512-8uy47DL36iDEwVZdUO/fjhhW5+4j0tYlrCsOzw6iy8MJqKL7/HC2pj7sL/S9ayp2+hk9fYQYB9Tu+UN+N2OOOQ== - dependencies: - "@babel/runtime" "^7.10.1" - classnames "2.x" - rc-motion "^2.4.3" - rc-overflow "^1.2.0" - rc-trigger "^5.1.2" - rc-util "^5.12.0" - shallowequal "^1.1.0" - -rc-motion@^2.0.0, rc-motion@^2.4.3: - version "2.4.4" - resolved "https://registry.yarnpkg.com/rc-motion/-/rc-motion-2.4.4.tgz#e995d5fa24fc93065c24f714857cf2677d655bb0" - integrity sha512-ms7n1+/TZQBS0Ydd2Q5P4+wJTSOrhIrwNxLXCZpR7Fa3/oac7Yi803HDALc2hLAKaCTQtw9LmQeB58zcwOsqlQ== - dependencies: - "@babel/runtime" "^7.11.1" - classnames "^2.2.1" - rc-util "^5.2.1" - -rc-overflow@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/rc-overflow/-/rc-overflow-1.2.2.tgz#95b0222016c0cdbdc0db85f569c262e7706a5f22" - integrity sha512-X5kj9LDU1ue5wHkqvCprJWLKC+ZLs3p4He/oxjZ1Q4NKaqKBaYf5OdSzRSgh3WH8kSdrfU8LjvlbWnHgJOEkNQ== - dependencies: - "@babel/runtime" "^7.11.1" - classnames "^2.2.1" - rc-resize-observer "^1.0.0" - rc-util "^5.5.1" - -rc-resize-observer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/rc-resize-observer/-/rc-resize-observer-1.0.0.tgz#97fb89856f62fec32ab6e40933935cf58e2e102d" - integrity sha512-RgKGukg1mlzyGdvzF7o/LGFC8AeoMH9aGzXTUdp6m+OApvmRdUuOscq/Y2O45cJA+rXt1ApWlpFoOIioXL3AGg== - dependencies: - "@babel/runtime" "^7.10.1" - classnames "^2.2.1" - rc-util "^5.0.0" - resize-observer-polyfill "^1.5.1" - -rc-tabs@^11.7.1: - version "11.10.1" - resolved "https://registry.yarnpkg.com/rc-tabs/-/rc-tabs-11.10.1.tgz#7b112f78bac998480c777ae160adc425e3fdb7cb" - integrity sha512-ey1i2uMyfnRNYbViLcUYGH+Y7hueJbdCVSLaXnXki9hxBcGqxJMPy9t5xR0n/3QFQspj7Tf6+2VTXVtmO7Yaug== - dependencies: - "@babel/runtime" "^7.11.2" - classnames "2.x" - rc-dropdown "^3.2.0" - rc-menu "^9.0.0" - rc-resize-observer "^1.0.0" - rc-util "^5.5.0" - -rc-trigger@^5.0.4, rc-trigger@^5.1.2: - version "5.2.9" - resolved "https://registry.yarnpkg.com/rc-trigger/-/rc-trigger-5.2.9.tgz#795a787d2b038347dcde27b89a4a5cec8fc40f3e" - integrity sha512-0Bxsh2Xe+etejMn73am+jZBcOpsueAZiEKLiGoDfA0fvm/JHLNOiiww3zJ0qgyPOTmbYxhsxFcGOZu+VcbaZhQ== - dependencies: - "@babel/runtime" "^7.11.2" - classnames "^2.2.6" - rc-align "^4.0.0" - rc-motion "^2.0.0" - rc-util "^5.5.0" - -rc-util@^5.0.0, rc-util@^5.12.0, rc-util@^5.2.1, rc-util@^5.3.0, rc-util@^5.5.0, rc-util@^5.5.1: - version "5.13.2" - resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-5.13.2.tgz#a8a0bb77743351841ba8bed6393e03b8d2f685c8" - integrity sha512-eYc71XXGlp96RMzg01Mhq/T3BL6OOVTDSS0urFEuvpi+e7slhJRhaHGCKy2hqJm18m9ff7VoRoptplKu60dYog== - dependencies: - "@babel/runtime" "^7.12.5" - react-is "^16.12.0" - shallowequal "^1.1.0" - rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -13033,17 +12168,7 @@ rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-attr-converter@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/react-attr-converter/-/react-attr-converter-0.3.1.tgz#4a2abf6d907b7ddae4d862dfec80e489ce41ad6e" - integrity sha512-dSxo2Mn6Zx4HajeCeQNLefwEO4kNtV/0E682R1+ZTyFRPqxDa5zYb5qM/ocqw9Bxr/kFQO0IUiqdV7wdHw+Cdg== - -react-docgen-typescript-dumi-tmp@^1.22.1-0: - version "1.22.1-0" - resolved "https://registry.yarnpkg.com/react-docgen-typescript-dumi-tmp/-/react-docgen-typescript-dumi-tmp-1.22.1-0.tgz#6f452de05c5c114a6e1dd60b34930afaa7ae39a0" - integrity sha512-wjuAm1yj+ZZucovow2VF0MXkH2SGZ+squZxfNdnam3oyUbHy/xZaU1ZabCn7rY+13ZFx0/NLda+ZuBgF3g8vBA== - -react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1: +react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -13347,88 +12472,6 @@ regjsparser@^0.6.4: dependencies: jsesc "~0.5.0" -rehype-autolink-headings@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/rehype-autolink-headings/-/rehype-autolink-headings-4.0.0.tgz#9d5d78c9fb9c787b40efdc95e99cbeb573133e47" - integrity sha512-2lglJ+4S3A4RCz+zlKVWj1wHvwO4bjunAoEOgMfjphT59EVXwdMiJzrL/A2fuAX/33k/LhkGW6BEK1Cl1I5WQw== - dependencies: - extend "^3.0.1" - hast-util-has-property "^1.0.0" - hast-util-is-element "^1.0.0" - unist-util-visit "^2.0.0" - -rehype-mathjax@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/rehype-mathjax/-/rehype-mathjax-3.1.0.tgz#d0282243bf68f3f18dd63a062e0f8c45662ecc26" - integrity sha512-Pmz92Y56lBFmDjFc9nIdrKu1xzKSBYevcwKiKiG7b5JJg74q1E62nRSbPEm37vXaXn7Bn25iRsWcP39bJKkMxg== - dependencies: - "@types/mathjax" "^0.0.36" - hast-util-from-dom "^3.0.0" - hast-util-to-text "^2.0.0" - jsdom "^16.0.0" - mathjax-full "^3.0.0" - unist-util-visit "^2.0.0" - -rehype-remove-comments@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/rehype-remove-comments/-/rehype-remove-comments-4.0.2.tgz#08487a5d85cb7b6a2571d7226176420c6c519a27" - integrity sha512-E2FNohTuIs7QzUnEQs3SdYdCScsTgUN7yPeDNWi+gsvx+pbLzIAyp27TWz3Gm64jpdLi7/6HxyRHxdd1NVQ37A== - dependencies: - hast-util-is-conditional-comment "^1.0.0" - unist-util-filter "^2.0.0" - -rehype-stringify@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/rehype-stringify/-/rehype-stringify-8.0.0.tgz#9b6afb599bcf3165f10f93fc8548f9a03d2ec2ba" - integrity sha512-VkIs18G0pj2xklyllrPSvdShAV36Ff3yE5PUO9u36f6+2qJFnn22Z5gKwBOwgXviux4UC7K+/j13AnZfPICi/g== - dependencies: - hast-util-to-html "^7.1.1" - -remark-frontmatter@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/remark-frontmatter/-/remark-frontmatter-3.0.0.tgz#ca5d996361765c859bd944505f377d6b186a6ec6" - integrity sha512-mSuDd3svCHs+2PyO29h7iijIZx4plX0fheacJcAoYAASfgzgVIcXGYSq9GFyYocFLftQs8IOmmkgtOovs6d4oA== - dependencies: - mdast-util-frontmatter "^0.2.0" - micromark-extension-frontmatter "^0.2.0" - -remark-gfm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-1.0.0.tgz#9213643001be3f277da6256464d56fd28c3b3c0d" - integrity sha512-KfexHJCiqvrdBZVbQ6RopMZGwaXz6wFJEfByIuEwGf0arvITHjiKKZ1dpXujjH9KZdm1//XJQwgfnJ3lmXaDPA== - dependencies: - mdast-util-gfm "^0.1.0" - micromark-extension-gfm "^0.3.0" - -remark-math@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/remark-math/-/remark-math-4.0.0.tgz#494ddd50766555ad2332e3afca7796a76452256f" - integrity sha512-lH7SoQenXtQrvL0bm+mjZbvOk//YWNuyR+MxV18Qyv8rgFmMEGNuB0TSCQDkoDaiJ40FCnG8lxErc/zhcedYbw== - dependencies: - mdast-util-math "^0.1.0" - micromark-extension-math "^0.1.0" - -remark-parse@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-9.0.0.tgz#4d20a299665880e4f4af5d90b7c7b8a935853640" - integrity sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw== - dependencies: - mdast-util-from-markdown "^0.8.0" - -remark-rehype@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-8.1.0.tgz#610509a043484c1e697437fa5eb3fd992617c945" - integrity sha512-EbCu9kHgAxKmW1yEYjx3QafMyGY3q8noUbNUI5xyKbaFP89wbhDrKxyIQNukNYthzjNHZu6J7hwFg7hRm1svYA== - dependencies: - mdast-util-to-hast "^10.2.0" - -remark-stringify@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-9.0.1.tgz#576d06e910548b0a7191a71f27b33f1218862894" - integrity sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg== - dependencies: - mdast-util-to-markdown "^0.6.0" - remove-bom-buffer@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" @@ -13456,7 +12499,7 @@ repeat-element@^1.1.2: resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== -repeat-string@^1.0.0, repeat-string@^1.5.2, repeat-string@^1.6.1: +repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= @@ -13525,11 +12568,6 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -resize-observer-polyfill@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" - integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg== - resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" @@ -13822,7 +12860,7 @@ sass-loader@^7.0.1: pify "^4.0.1" semver "^6.3.0" -sax@>=0.6.0, sax@^1.2.4, sax@~1.2.4: +sax@>=0.6.0, sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== @@ -13989,11 +13027,6 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" -shallowequal@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" - integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== - shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -14063,16 +13096,6 @@ sisteransi@^1.0.5: resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== -sitemap@^6.3.3: - version "6.4.0" - resolved "https://registry.yarnpkg.com/sitemap/-/sitemap-6.4.0.tgz#b4bc4edf36de742405a7572bc3e467ba484b852e" - integrity sha512-DoPKNc2/apQZTUnfiOONWctwq7s6dZVspxAZe2VPMNtoqNq7HgXRvlRnbIpKjf+8+piQdWncwcy+YhhTGY5USQ== - dependencies: - "@types/node" "^14.14.28" - "@types/sax" "^1.2.1" - arg "^5.0.0" - sax "^1.2.4" - slash2@2.0.0, slash2@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/slash2/-/slash2-2.0.0.tgz#f4e0a11708b8545b912695981cf7096f52c63487" @@ -14232,11 +13255,6 @@ sourcemap-codec@^1.4.4: resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== -space-separated-tokens@^1.0.0: - version "1.1.5" - resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" - integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== - spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -14263,15 +13281,6 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz#8a595135def9592bda69709474f1cbeea7c2467f" integrity sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ== -speech-rule-engine@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/speech-rule-engine/-/speech-rule-engine-3.3.3.tgz#781ed03cbcf3279f94d1d80241025ea954c6d571" - integrity sha512-0exWw+0XauLjat+f/aFeo5T8SiDsO1JtwpY3qgJE4cWt+yL/Stl0WP4VNDWdh7lzGkubUD9lWP4J1ASnORXfyQ== - dependencies: - commander ">=7.0.0" - wicked-good-xpath "^1.3.0" - xmldom-sre "^0.1.31" - split-on-first@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" @@ -14534,15 +13543,6 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringify-entities@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-3.1.0.tgz#b8d3feac256d9ffcc9fa1fefdcf3ca70576ee903" - integrity sha512-3FP+jGMmMV/ffZs86MoghGqAoqXAdxLrJP4GUdrDN1aIScYih5tuIO3eF4To5AJZ79KDZ8Fpdy7QJnK8SsL1Vg== - dependencies: - character-entities-html4 "^1.0.0" - character-entities-legacy "^1.0.0" - xtend "^4.0.0" - stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" @@ -14652,13 +13652,6 @@ style-inject@^0.3.0: resolved "https://registry.yarnpkg.com/style-inject/-/style-inject-0.3.0.tgz#d21c477affec91811cc82355832a700d22bf8dd3" integrity sha512-IezA2qp+vcdlhJaVm5SOdPPTUu0FCEqfNSli2vRuSIBbu5Nq5UvygTk/VzeCqfLz2Atj3dVII5QBKGZRZ0edzw== -style-to-object@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" - integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== - dependencies: - inline-style-parser "0.1.1" - stylehacks@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" @@ -14845,7 +13838,7 @@ terser@^4.1.2: source-map "~0.6.1" source-map-support "~0.5.12" -terser@^5.0.0, terser@^5.5.1: +terser@^5.0.0: version "5.7.1" resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.1.tgz#2dc7a61009b66bb638305cb2a824763b116bf784" integrity sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg== @@ -15105,11 +14098,6 @@ trim-off-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= -trough@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" - integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== - "true-case-path@^1.0.2": version "1.0.3" resolved "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz#f813b5a8c86b40da59606722b144e3225799f47d" @@ -15344,17 +14332,6 @@ unicode-property-aliases-ecmascript@^1.0.4: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== -unified@^8.4.1: - version "8.4.2" - resolved "https://registry.yarnpkg.com/unified/-/unified-8.4.2.tgz#13ad58b4a437faa2751a4a4c6a16f680c500fff1" - integrity sha512-JCrmN13jI4+h9UAyKEoGcDZV+i1E7BLFuG7OsaDvTXI5P0qhHX+vZO/kOhz9jn8HGENDKbwSeB0nVOg4gVStGA== - dependencies: - bail "^1.0.0" - extend "^3.0.0" - is-plain-obj "^2.0.0" - trough "^1.0.0" - vfile "^4.0.0" - union-value@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" @@ -15404,64 +14381,6 @@ unique-string@^1.0.0: dependencies: crypto-random-string "^1.0.0" -unist-builder@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" - integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== - -unist-util-filter@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-util-filter/-/unist-util-filter-2.0.3.tgz#558cf866016f0e7ade1e30ef190abf253111dd39" - integrity sha512-8k6Jl/KLFqIRTHydJlHh6+uFgqYHq66pV75pZgr1JwfyFSjbWb12yfb0yitW/0TbHXjr9U4G9BQpOvMANB+ExA== - dependencies: - unist-util-is "^4.0.0" - -unist-util-find-after@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/unist-util-find-after/-/unist-util-find-after-3.0.0.tgz#5c65fcebf64d4f8f496db46fa8fd0fbf354b43e6" - integrity sha512-ojlBqfsBftYXExNu3+hHLfJQ/X1jYY/9vdm4yZWjIbf0VuWF6CRufci1ZyoD/wV2TYMKxXUoNuoqwy+CkgzAiQ== - dependencies: - unist-util-is "^4.0.0" - -unist-util-generated@^1.0.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" - integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg== - -unist-util-is@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" - integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== - -unist-util-position@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" - integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== - -unist-util-stringify-position@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" - integrity sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g== - dependencies: - "@types/unist" "^2.0.2" - -unist-util-visit-parents@^3.0.0, unist-util-visit-parents@^3.0.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" - integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== - dependencies: - "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" - -unist-util-visit@^2.0.0, unist-util-visit@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" - integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== - dependencies: - "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" - unist-util-visit-parents "^3.0.0" - universal-user-agent@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-4.0.1.tgz#fd8d6cb773a679a709e967ef8288a31fcc03e557" @@ -15684,29 +14603,6 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vfile-location@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c" - integrity sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA== - -vfile-message@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a" - integrity sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ== - dependencies: - "@types/unist" "^2.0.0" - unist-util-stringify-position "^2.0.0" - -vfile@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-4.2.1.tgz#03f1dce28fc625c625bc6514350fbdb00fa9e624" - integrity sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA== - dependencies: - "@types/unist" "^2.0.0" - is-buffer "^2.0.0" - unist-util-stringify-position "^2.0.0" - vfile-message "^2.0.0" - vinyl-fs@3.0.3, vinyl-fs@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" @@ -15891,11 +14787,6 @@ wcwidth@^1.0.0: dependencies: defaults "^1.0.3" -web-namespaces@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" - integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== - webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -16026,11 +14917,6 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" -wicked-good-xpath@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/wicked-good-xpath/-/wicked-good-xpath-1.3.0.tgz#81b0e95e8650e49c94b22298fff8686b5553cf6c" - integrity sha1-gbDpXoZQ5JyUsiKY//hoa1VTz2w= - wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" @@ -16216,11 +15102,6 @@ xmlchars@^2.1.1, xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xmldom-sre@^0.1.31: - version "0.1.31" - resolved "https://registry.yarnpkg.com/xmldom-sre/-/xmldom-sre-0.1.31.tgz#10860d5bab2c603144597d04bf2c4980e98067f4" - integrity sha512-f9s+fUkX04BxQf+7mMWAp5zk61pciie+fFLC9hX9UVvCeJQfNHRHXpeo5MPcR0EUf57PYLdt+ZO4f3Ipk2oZUw== - xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" @@ -16354,8 +15235,3 @@ zlib@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/zlib/-/zlib-1.0.5.tgz#6e7c972fc371c645a6afb03ab14769def114fcc0" integrity sha1-bnyXL8NxxkWmr7A6sUdp3vEU/MA= - -zwitch@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" - integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==