提交 84816c22 编写于 作者: fxy060608's avatar fxy060608

chore: update deps

上级 2e990d30
此差异已折叠。
......@@ -24,12 +24,8 @@
"@dcloudio/uni-i18n": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@rollup/pluginutils": "^4.1.1",
"clean-css": "^5.1.3",
"debug": "^4.3.2",
"fs-extra": "^10.0.0",
"postcss-import": "^14.0.2",
"postcss-load-config": "^3.1.0",
"postcss-modules": "^4.1.3"
"fs-extra": "^10.0.0"
},
"devDependencies": {
"@types/debug": "^4.1.7",
......
......@@ -28,6 +28,7 @@
"@dcloudio/uni-components": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-stat": "3.0.0-alpha-3021320211109003"
"@dcloudio/uni-stat": "3.0.0-alpha-3021320211109003",
"@vue/shared": "3.2.21"
}
}
......@@ -23,6 +23,7 @@
"@babel/preset-env": "^7.15.5",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@vue/shared": "3.2.21",
"acorn": "^5.2.1",
"babel-loader": "^8.2.2",
"consolidate": "^0.15.1",
......
......@@ -25,6 +25,8 @@
"@rollup/pluginutils": "^4.1.1",
"@vue/compiler-core": "3.2.21",
"@vue/compiler-dom": "3.2.21",
"@vue/shared": "3.2.21",
"chalk": "^4.1.1",
"chokidar": "^3.5.2",
"compare-versions": "^3.6.0",
"debug": "^4.3.2",
......
......@@ -25,7 +25,9 @@
"@vue/compiler-dom": "3.2.21",
"@vue/compiler-sfc": "3.2.21",
"@vue/server-renderer": "3.2.21",
"@vue/shared": "3.2.21",
"debug": "^4.3.2",
"fs-extra": "^10.0.0",
"mime": "^3.0.0",
"module-alias": "^2.2.2"
},
......
import fs from 'fs'
import path from 'path'
import { normalizePath, Plugin, ResolvedConfig } from 'vite'
import { isInHBuilderX, resolveMainPathOnce } from '@dcloudio/uni-cli-shared'
import type { Plugin, ResolvedConfig } from 'vite'
import {
isInHBuilderX,
normalizePath,
resolveMainPathOnce,
} from '@dcloudio/uni-cli-shared'
import { createDefine, isSsr } from '../utils'
import { esbuildPrePlugin } from './esbuild/esbuildPrePlugin'
import { external } from './configureServer/ssr'
......
......@@ -2,7 +2,7 @@ import {
getRouterOptions,
parseManifestJsonOnce,
} from '@dcloudio/uni-cli-shared'
import { Plugin } from 'vite'
import type { Plugin } from 'vite'
import { uniTimestampMiddleware } from './middlewares/timestamp'
import { initSSR } from './ssr'
import { initStatic } from './static'
......
import { parse as parseUrl } from 'url'
import { IncomingMessage, ServerResponse } from 'http'
import { ViteDevServer } from 'vite'
import type { ViteDevServer } from 'vite'
import { NextHandler } from './static'
import path from 'path'
import { EXTNAME_VUE_RE } from '@dcloudio/uni-cli-shared'
......
import { ViteDevServer } from 'vite'
import type { ViteDevServer } from 'vite'
export const external = [
'@dcloudio/uni-app',
......
import fs from 'fs'
import path from 'path'
import debug from 'debug'
import { ViteDevServer } from 'vite'
import type { ViteDevServer } from 'vite'
import { createFilter } from '@rollup/pluginutils'
import {
isImportRequest,
......
import path from 'path'
import debug from 'debug'
import { ModuleGraph, Plugin } from 'vite'
import type { ModuleGraph, Plugin } from 'vite'
import { extend } from '@vue/shared'
import {
initEasycomsOnce,
......
import { ResolvedConfig } from 'vite'
import type { ResolvedConfig } from 'vite'
import { UniVitePlugin } from '@dcloudio/uni-cli-shared'
import { createHandleHotUpdate } from './handleHotUpdate'
import { createTransformIndexHtml } from './transformIndexHtml'
......
import { Plugin } from 'vite'
import type { Plugin } from 'vite'
import { parseManifestJsonOnce } from '@dcloudio/uni-cli-shared'
......
import fs from 'fs'
import { OutputAsset, OutputChunk } from 'rollup'
import { Plugin, ResolvedConfig } from 'vite'
import type { Plugin, ResolvedConfig } from 'vite'
import { buildInCssSet, resolveBuiltIn } from '@dcloudio/uni-cli-shared'
......
import path from 'path'
import { Plugin } from 'vite'
import type { Plugin } from 'vite'
import { createFilter, FilterPattern } from '@rollup/pluginutils'
import { camelize, capitalize } from '@vue/shared'
......
import path from 'path'
import { Plugin, ResolvedConfig } from 'vite'
import type { Plugin, ResolvedConfig } from 'vite'
import { extend } from '@vue/shared'
......
import { Plugin } from 'vite'
import type { Plugin } from 'vite'
import {
defineUniManifestJsonPlugin,
......
import path from 'path'
import { Plugin, ResolvedConfig } from 'vite'
import type { Plugin, ResolvedConfig } from 'vite'
import {
API_DEPS_CSS,
FEATURE_DEFINES,
......
import debug from 'debug'
import { Plugin } from 'vite'
import type { Plugin } from 'vite'
import { rewriteDefault } from '@vue/compiler-sfc'
import { missingModuleName, parseRenderjs } from '@dcloudio/uni-cli-shared'
......
import path from 'path'
import debug from 'debug'
import { Plugin } from 'vite'
import type { Plugin } from 'vite'
import { resolveBuiltIn, parseCompatConfigOnce } from '@dcloudio/uni-cli-shared'
import { ownerModuleName } from '../utils'
......
import path from 'path'
import debug from 'debug'
import { Plugin } from 'vite'
import type { Plugin } from 'vite'
import {
EXTNAME_JS_RE,
normalizePath,
......
import path from 'path'
import { Plugin, ResolvedConfig } from 'vite'
import type { Plugin, ResolvedConfig } from 'vite'
import { OutputChunk } from 'rollup'
......
import { ConfigEnv, UserConfig } from 'vite'
import type { ConfigEnv, UserConfig } from 'vite'
import {
parsePagesJsonOnce,
parseManifestJsonOnce,
......
......@@ -12,7 +12,7 @@ import {
getBuiltInPaths,
transformMatchMedia,
} from '@dcloudio/uni-cli-shared'
import { ConfigEnv, ResolvedConfig, UserConfig } from 'vite'
import type { ConfigEnv, ResolvedConfig, UserConfig } from 'vite'
import resolve from 'resolve'
import { resolveComponentType } from '@vue/compiler-dom'
import { transformPageHead } from '../plugin/transforms/transformPageHead'
......
......@@ -34,9 +34,11 @@
"@dcloudio/uni-i18n": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@vue/server-renderer": "3.2.21",
"@vue/shared": "3.2.21",
"localstorage-polyfill": "^1.0.1",
"pako": "^2.0.3",
"safe-area-insets": "^1.4.1",
"vue-router": "^4.0.12",
"xmlhttprequest": "^1.8.0"
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
......
......@@ -25,6 +25,7 @@
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@vue/compiler-core": "3.2.21"
"@vue/compiler-core": "3.2.21",
"@vue/shared": "3.2.21"
}
}
import { isPlainObject, isArray, hasOwn, isFunction, extend, camelize } from '@vue/shared';
import { injectHook, ref } from 'vue';
// lifecycle
// App and Page
const ON_SHOW$1 = 'onShow';
//Page
const ON_LOAD$1 = 'onLoad';
const ON_READY$1 = 'onReady';
class EventChannel$1 {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
......@@ -800,13 +870,13 @@ function parse$2(appOptions) {
if (!this.$vm) {
this.onLaunch(args);
}
this.$vm.$callHook(ON_SHOW, args);
this.$vm.$callHook(ON_SHOW$1, args);
};
}
var parseAppOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
parse: parse$2
__proto__: null,
parse: parse$2
});
/**
......@@ -881,7 +951,7 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
// https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
if (this.$vm) {
this.$vm.$callHook('mounted');
this.$vm.$callHook(ON_READY);
this.$vm.$callHook(ON_READY$1);
}
},
detached() {
......@@ -947,8 +1017,8 @@ function parse$1(componentOptions) {
const pageInstance = this.pageinstance;
pageInstance.$vm = this.$vm;
if (hasOwn(pageInstance, '_$args')) {
this.$vm.$callHook(ON_LOAD, pageInstance._$args);
this.$vm.$callHook(ON_SHOW);
this.$vm.$callHook(ON_LOAD$1, pageInstance._$args);
this.$vm.$callHook(ON_SHOW$1);
delete pageInstance._$args;
}
}
......@@ -972,13 +1042,13 @@ function parse$1(componentOptions) {
}
var parseComponentOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
parse: parse$1,
handleLink: handleLink,
initLifetimes: initLifetimes
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
parse: parse$1,
handleLink: handleLink,
initLifetimes: initLifetimes
});
function parse(pageOptions) {
......@@ -987,15 +1057,15 @@ function parse(pageOptions) {
// 纠正百度小程序生命周期methods:onShow在methods:onLoad之前触发的问题
methods.onShow = function onShow() {
if (this.$vm && this._$loaded) {
this.$vm.$callHook(ON_SHOW);
this.$vm.$callHook(ON_SHOW$1);
}
};
methods.onLoad = function onLoad(args) {
// 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad
if (this.$vm) {
this._$loaded = true;
this.$vm.$callHook(ON_LOAD, args);
this.$vm.$callHook(ON_SHOW);
this.$vm.$callHook(ON_LOAD$1, args);
this.$vm.$callHook(ON_SHOW$1);
}
else {
this.pageinstance._$args = args;
......@@ -1004,20 +1074,20 @@ function parse(pageOptions) {
}
var parsePageOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
parse: parse,
handleLink: handleLink,
initLifetimes: initLifetimes,
mocks: mocks,
isPage: isPage,
initRelation: initRelation
__proto__: null,
parse: parse,
handleLink: handleLink,
initLifetimes: initLifetimes,
mocks: mocks,
isPage: isPage,
initRelation: initRelation
});
const createApp = initCreateApp(parseAppOptions);
const createPage = initCreatePage(parsePageOptions);
const createComponent = initCreateComponent(parseComponentOptions);
const createSubpackageApp = initCreateSubpackageApp(parseAppOptions);
swan.EventChannel = EventChannel;
swan.EventChannel = EventChannel$1;
swan.createApp = global.createApp = createApp;
swan.createPage = createPage;
swan.createComponent = createComponent;
......
......@@ -33,6 +33,7 @@
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003"
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003"
}
}
......@@ -26,7 +26,10 @@
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@vue/compiler-core": "3.2.21",
"@vue/compiler-dom": "3.2.21",
"@vue/compiler-sfc": "3.2.21",
"@vue/shared": "3.2.21",
"estree-walker": "^2.0.2"
},
"devDependencies": {
"@vue/compiler-sfc": "3.2.21"
}
}
import { isPlainObject, isArray, hasOwn, isFunction, extend, camelize } from '@vue/shared';
import { injectHook, ref } from 'vue';
const ON_READY$1 = 'onReady';
class EventChannel$1 {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
......@@ -813,7 +878,7 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
// https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
if (this.$vm) {
this.$vm.$callHook('mounted');
this.$vm.$callHook(ON_READY);
this.$vm.$callHook(ON_READY$1);
}
},
detached() {
......@@ -845,12 +910,12 @@ function handleLink(event) {
}
var baseParseOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
initLifetimes: initLifetimes
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
initLifetimes: initLifetimes
});
function parse$1(pageOptions) {
......@@ -924,7 +989,7 @@ const createApp = initCreateApp();
const createPage = initCreatePage(parsePageOptions);
const createComponent = initCreateComponent(parseComponentOptions);
const createSubpackageApp = initCreateSubpackageApp();
ks.EventChannel = EventChannel;
ks.EventChannel = EventChannel$1;
ks.createApp = global.createApp = createApp;
ks.createPage = createPage;
ks.createComponent = createComponent;
......
......@@ -29,6 +29,7 @@
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003"
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003"
}
}
import { isPlainObject, isArray, hasOwn, isFunction, extend, camelize, isObject } from '@vue/shared';
import { injectHook, ref, onBeforeMount } from 'vue';
const ON_READY$1 = 'onReady';
class EventChannel$1 {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
......@@ -939,21 +1004,21 @@ function handleLink({ detail: { vuePid, nodeId, webviewId }, }) {
}
vm.$callCreatedHook();
vm.$callHook('mounted');
vm.$callHook(ON_READY);
vm.$callHook(ON_READY$1);
}
function parse(componentOptions, { handleLink }) {
componentOptions.methods.__l = handleLink;
}
var parseComponentOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
instances: instances,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes$1
__proto__: null,
mocks: mocks,
isPage: isPage,
instances: instances,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes$1
});
function initLifetimes(lifetimesOptions) {
......@@ -965,7 +1030,7 @@ function initLifetimes(lifetimesOptions) {
}
this.$vm.$callCreatedHook();
this.$vm.$callHook('mounted');
this.$vm.$callHook(ON_READY);
this.$vm.$callHook(ON_READY$1);
}
else {
this.is && console.warn(this.is + ' is not ready');
......@@ -986,20 +1051,20 @@ function initLifetimes(lifetimesOptions) {
}
var parsePageOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes
});
const createApp = initCreateApp();
const createPage = initCreatePage(parsePageOptions);
const createComponent = initCreateComponent(parseComponentOptions);
const createSubpackageApp = initCreateSubpackageApp();
tt.EventChannel = EventChannel;
tt.EventChannel = EventChannel$1;
tt.createApp = global.createApp = createApp;
tt.createPage = createPage;
tt.createComponent = createComponent;
......
......@@ -29,6 +29,7 @@
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@vue/compiler-core": "3.2.21"
}
}
import { isPlainObject, isArray, hasOwn, isFunction, extend, camelize } from '@vue/shared';
import { injectHook, ref } from 'vue';
const ON_READY$1 = 'onReady';
class EventChannel$1 {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
......@@ -775,7 +840,7 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
// https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
if (this.$vm) {
this.$vm.$callHook('mounted');
this.$vm.$callHook(ON_READY);
this.$vm.$callHook(ON_READY$1);
}
},
detached() {
......@@ -807,12 +872,12 @@ function handleLink(event) {
}
var parseOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
initLifetimes: initLifetimes
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
initLifetimes: initLifetimes
});
const createApp = initCreateApp();
......@@ -824,7 +889,7 @@ wx.createPage = createPage;
wx.createComponent = createComponent;
wx.createSubpackageApp = createSubpackageApp;
qq.EventChannel = EventChannel;
qq.EventChannel = EventChannel$1;
qq.createApp = global.createApp = createApp;
qq.createPage = createPage;
qq.createComponent = createComponent;
......
......@@ -29,6 +29,7 @@
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"fs-extra": "^10.0.0"
}
}
import { isPlainObject, isArray, hasOwn, isFunction, extend, camelize, isObject } from '@vue/shared';
import { injectHook, ref } from 'vue';
const ON_READY$1 = 'onReady';
class EventChannel$1 {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
......@@ -955,21 +1020,21 @@ function handleLink({ detail: { vuePid, nodeId, webviewId }, }) {
}
vm.$callCreatedHook();
vm.$callHook('mounted');
vm.$callHook(ON_READY);
vm.$callHook(ON_READY$1);
}
function parse(componentOptions, { handleLink }) {
componentOptions.methods.__l = handleLink;
}
var parseComponentOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
instances: instances,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes$1
__proto__: null,
mocks: mocks,
isPage: isPage,
instances: instances,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes$1
});
function initLifetimes(lifetimesOptions) {
......@@ -981,7 +1046,7 @@ function initLifetimes(lifetimesOptions) {
}
this.$vm.$callCreatedHook();
this.$vm.$callHook('mounted');
this.$vm.$callHook(ON_READY);
this.$vm.$callHook(ON_READY$1);
}
else {
this.is && console.warn(this.is + ' is not ready');
......@@ -1002,20 +1067,20 @@ function initLifetimes(lifetimesOptions) {
}
var parsePageOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes
});
const createApp = initCreateApp();
const createPage = initCreatePage(parsePageOptions);
const createComponent = initCreateComponent(parseComponentOptions);
const createSubpackageApp = initCreateSubpackageApp();
tt.EventChannel = EventChannel;
tt.EventChannel = EventChannel$1;
tt.createApp = global.createApp = createApp;
tt.createPage = createPage;
tt.createComponent = createComponent;
......
......@@ -26,6 +26,7 @@
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@vue/compiler-core": "3.2.21"
}
}
......@@ -22,6 +22,7 @@
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@vue/shared": "3.2.21",
"base64url": "^3.0.1",
"debug": "^4.3.2",
"magic-string": "^0.25.7"
......
......@@ -15,7 +15,7 @@ const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
//Page
const ON_LOAD = 'onLoad';
const ON_READY = 'onReady';
const ON_READY$1 = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
......@@ -194,7 +194,7 @@ function initHook$1(mpOptions, hook, excludes) {
};
}
}
const EXCLUDE_HOOKS = [ON_READY];
const EXCLUDE_HOOKS = [ON_READY$1];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
hooks.forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
......@@ -647,6 +647,8 @@ function initCreatePage(parseOptions) {
};
}
const ON_READY = 'onReady';
const MPPage = Page;
const MPComponent = Component;
const customizeRE = /:/g;
......
......@@ -31,6 +31,7 @@
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003"
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003"
}
}
import { isPlainObject, isArray, hasOwn, isFunction, extend, camelize, isObject } from '@vue/shared';
import { injectHook, ref } from 'vue';
const ON_READY$1 = 'onReady';
class EventChannel$1 {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
......@@ -875,7 +940,7 @@ function initLifetimes(lifetimesOptions) {
}
this.$vm.$callCreatedHook();
this.$vm.$callHook('mounted');
this.$vm.$callHook(ON_READY);
this.$vm.$callHook(ON_READY$1);
}
else {
this.is && console.warn(this.is + ' is not ready');
......@@ -940,7 +1005,7 @@ function handleLink({ detail: { nodeId, webviewId }, }) {
delete vm._$childVues;
}
vm.$callHook('mounted');
vm.$callHook(ON_READY);
vm.$callHook(ON_READY$1);
};
// 当 parentVm 已经 mounted 时,直接触发,否则延迟
if (!parentVm || parentVm.$.isMounted) {
......@@ -956,30 +1021,30 @@ function handleLink({ detail: { nodeId, webviewId }, }) {
}
var parseComponentOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
initRelation: initRelation,
handleLink: handleLink,
mocks: mocks,
isPage: isPage,
parse: parse,
initLifetimes: initLifetimes$1
__proto__: null,
initRelation: initRelation,
handleLink: handleLink,
mocks: mocks,
isPage: isPage,
parse: parse,
initLifetimes: initLifetimes$1
});
var parsePageOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes
});
const createApp = initCreateApp();
const createPage = initCreatePage(parsePageOptions);
const createComponent = initCreateComponent(parseComponentOptions);
const createSubpackageApp = initCreateSubpackageApp();
qa.EventChannel = EventChannel;
qa.EventChannel = EventChannel$1;
qa.createApp = global.createApp = createApp;
qa.createPage = createPage;
qa.createComponent = createComponent;
......
......@@ -27,6 +27,8 @@
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003"
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@vue/shared": "3.2.21"
}
}
......@@ -21,5 +21,8 @@
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"devDependencies": {
"@vue/runtime-core": "3.2.21"
},
"dependencies": {
"@vue/shared": "3.2.21"
}
}
'use strict'
'use strict';
var debug = require('debug')
var uniCliShared = require('@dcloudio/uni-cli-shared')
var debug = require('debug');
var uniCliShared = require('@dcloudio/uni-cli-shared');
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var debug__default = /*#__PURE__*/ _interopDefaultLegacy(debug)
var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug);
var index = [
uniCliShared.defineUniMainJsPlugin((opts) => {
let isEnable = false
return {
name: 'vite:uni-stat',
enforce: 'pre',
config(config, env) {
if (isSsr(env.command, config)) {
return
}
const inputDir = process.env.UNI_INPUT_DIR
const platform = process.env.UNI_PLATFORM
isEnable =
uniCliShared.getUniStatistics(inputDir, platform).enable === true
if (process.env.NODE_ENV === 'production') {
const manifestJson = uniCliShared.parseManifestJsonOnce(inputDir)
if (!manifestJson.appid) {
console.log()
console.warn(uniCliShared.M['stat.warn.appid'])
console.log()
isEnable = false
}
}
const titlesJson = Object.create(null)
if (isEnable) {
uniCliShared
.parsePagesJsonOnce(inputDir, platform)
.pages.forEach((page) => {
const titleText = page.style.navigationBar.titleText || ''
if (titleText) {
titlesJson[page.path] = titleText
}
})
}
debug__default['default']('vite:uni:stat')('isEnable', isEnable)
process.env.UNI_STAT_TITLE_JSON = JSON.stringify(titlesJson)
return {
define: {
'process.env.UNI_STAT_TITLE_JSON': process.env.UNI_STAT_TITLE_JSON,
},
}
},
transform(code, id) {
if (isEnable && opts.filter(id)) {
return {
code: code + `;import '@dcloudio/uni-stat';`,
map: null,
}
}
},
}
}),
]
function isSsr(command, config) {
if (command === 'serve') {
return !!(config.server && config.server.middlewareMode)
}
if (command === 'build') {
return !!(config.build && config.build.ssr)
}
return false
var index = [
uniCliShared.defineUniMainJsPlugin((opts) => {
let isEnable = false;
return {
name: 'vite:uni-stat',
enforce: 'pre',
config(config, env) {
if (isSsr(env.command, config)) {
return;
}
const inputDir = process.env.UNI_INPUT_DIR;
const platform = process.env.UNI_PLATFORM;
isEnable = uniCliShared.getUniStatistics(inputDir, platform).enable === true;
if (process.env.NODE_ENV === 'production') {
const manifestJson = uniCliShared.parseManifestJsonOnce(inputDir);
if (!manifestJson.appid) {
console.log();
console.warn(uniCliShared.M['stat.warn.appid']);
console.log();
isEnable = false;
}
}
const titlesJson = Object.create(null);
if (isEnable) {
uniCliShared.parsePagesJsonOnce(inputDir, platform).pages.forEach((page) => {
const titleText = page.style.navigationBar.titleText || '';
if (titleText) {
titlesJson[page.path] = titleText;
}
});
}
debug__default["default"]('vite:uni:stat')('isEnable', isEnable);
process.env.UNI_STAT_TITLE_JSON = JSON.stringify(titlesJson);
return {
define: {
'process.env.UNI_STAT_TITLE_JSON': process.env.UNI_STAT_TITLE_JSON,
},
};
},
transform(code, id) {
if (isEnable && opts.filter(id)) {
return {
code: code + `;import '@dcloudio/uni-stat';`,
map: null,
};
}
},
};
}),
];
function isSsr(command, config) {
if (command === 'serve') {
return !!(config.server && config.server.middlewareMode);
}
if (command === 'build') {
return !!(config.build && config.build.ssr);
}
return false;
}
module.exports = index
module.exports = index;
......@@ -22,6 +22,9 @@
},
"license": "Apache-2.0",
"dependencies": {
"@babel/core": "^7.15.5",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-typescript": "^7.15.4",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@rollup/pluginutils": "^4.1.1",
......@@ -30,12 +33,14 @@
"@vue/compiler-core": "3.2.21",
"@vue/compiler-dom": "3.2.21",
"@vue/compiler-sfc": "3.2.21",
"@vue/shared": "3.2.21",
"cac": "^6.7.3",
"chalk": "^4.1.1",
"debug": "^4.3.2",
"estree-walker": "^2.0.2",
"express": "^4.17.1",
"fs-extra": "^10.0.0",
"hash-sum": "^2.0.0",
"jsonc-parser": "^3.0.0"
},
"devDependencies": {
......@@ -45,6 +50,9 @@
"@vue/babel-plugin-jsx": "^1.1.1",
"chokidar": "^3.5.2"
},
"peerDependencies": {
"vite": "^2.6.14"
},
"uni-app": {
"compilerVersion": "3.2.10"
},
......
import { extend } from '@vue/shared'
import { RollupWatcher } from 'rollup'
import { BuildOptions, ServerOptions } from 'vite'
import type { BuildOptions, ServerOptions } from 'vite'
import { M } from '@dcloudio/uni-cli-shared'
import { CliOptions } from '.'
import { build, buildSSR } from './build'
......
import { cac } from 'cac'
import { LogLevel } from 'vite'
import type { LogLevel } from 'vite'
import { PLATFORMS } from './utils'
import { runBuild, runDev } from './action'
......
import path from 'path'
import debug from 'debug'
import { Plugin, ResolvedConfig, ViteDevServer } from 'vite'
import type { Plugin, ResolvedConfig, ViteDevServer } from 'vite'
import type { Options as VueOptions } from '@vitejs/plugin-vue'
import type { Options as ViteLegacyOptions } from '@vitejs/plugin-legacy'
import type { VueJSXPluginOptions } from '@vue/babel-plugin-jsx'
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册