@dcloudio/uni-cli-shared 3.0.0-4070520250711001 → 3.0.0-4080420251103001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/easycom.d.ts +1 -0
- package/dist/easycom.js +17 -13
- package/dist/env/define.d.ts +1 -0
- package/dist/env/define.js +3 -1
- package/dist/hbx/alias.js +43 -10
- package/dist/hbx/index.js +12 -0
- package/dist/hbx/log.js +23 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/json/app/manifest/env.d.ts +1 -1
- package/dist/json/app/manifest/env.js +4 -4
- package/dist/json/app/manifest/index.js +3 -1
- package/dist/json/app/pages/definePage.d.ts +2 -1
- package/dist/json/app/pages/definePage.js +15 -3
- package/dist/json/app/pages/index.d.ts +2 -1
- package/dist/json/app/pages/index.js +5 -3
- package/dist/json/index.d.ts +1 -1
- package/dist/json/index.js +2 -1
- package/dist/json/manifest.d.ts +1 -0
- package/dist/json/manifest.js +11 -1
- package/dist/json/mp/jsonFile.js +13 -3
- package/dist/json/mp/pages.js +1 -0
- package/dist/json/mp/types.d.ts +7 -1
- package/dist/json/theme.js +1 -4
- package/dist/json/uni-x/manifest.d.ts +1 -0
- package/dist/json/uni-x/manifest.js +5 -1
- package/dist/messages/zh_CN.js +1 -0
- package/dist/uni_modules.cloud.d.ts +10 -4
- package/dist/uni_modules.cloud.js +58 -19
- package/dist/uni_modules.d.ts +2 -0
- package/dist/uni_modules.js +81 -2
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +10 -3
- package/dist/uts.js +16 -0
- package/dist/vite/autoImport.js +2 -0
- package/dist/vite/cloud.js +51 -5
- package/dist/vite/plugins/index.d.ts +1 -0
- package/dist/vite/plugins/index.js +3 -1
- package/dist/vite/plugins/inject.js +3 -1
- package/dist/vite/plugins/stats.d.ts +2 -0
- package/dist/vite/plugins/stats.js +42 -0
- package/dist/vite/plugins/uts/uni_modules.d.ts +1 -0
- package/dist/vite/plugins/uts/uni_modules.js +90 -16
- package/dist/vite/plugins/uts/uvue.js +17 -3
- package/dist/vite/plugins/vitejs/plugins/asset.d.ts +3 -2
- package/dist/vite/plugins/vitejs/plugins/asset.js +7 -0
- package/dist/vite/plugins/vitejs/plugins/css.js +40 -5
- package/dist/vite/plugins/vitejs/plugins/static.d.ts +3 -2
- package/dist/vite/plugins/vitejs/plugins/static.js +5 -1
- package/dist/vue/transforms/templateTransformAssetUrl.d.ts +5 -1
- package/dist/vue/transforms/templateTransformAssetUrl.js +23 -14
- package/dist/vue/transforms/transformUTSComponent.js +8 -3
- package/dist/vue/utils.d.ts +5 -2
- package/dist/vue/utils.js +31 -4
- package/dist/workers.d.ts +15 -0
- package/dist/workers.js +280 -0
- package/lib/preprocessor/preprocessor-macos-arm64.node +0 -0
- package/lib/preprocessor/preprocessor-windows-x86_64.node +0 -0
- package/lib/vapor/@vitejs/plugin-vue/LICENSE +21 -0
- package/lib/vapor/@vitejs/plugin-vue/README.md +278 -0
- package/lib/vapor/@vitejs/plugin-vue/dist/index.cjs +3105 -0
- package/lib/vapor/@vitejs/plugin-vue/dist/index.d.cts +113 -0
- package/lib/vapor/@vitejs/plugin-vue/dist/index.d.mts +111 -0
- package/lib/vapor/@vitejs/plugin-vue/dist/index.d.ts +113 -0
- package/lib/vapor/@vitejs/plugin-vue/dist/index.mjs +3090 -0
- package/lib/vapor/@vitejs/plugin-vue/package.json +50 -0
- package/lib/vapor/@vue/compiler-core/LICENSE +21 -0
- package/lib/vapor/@vue/compiler-core/README.md +1 -0
- package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.js +6902 -0
- package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6779 -0
- package/lib/vapor/@vue/compiler-core/dist/compiler-core.esm-bundler.js +5870 -0
- package/lib/vapor/@vue/compiler-core/index.js +7 -0
- package/lib/vapor/@vue/compiler-core/package.json +58 -0
- package/lib/vapor/@vue/compiler-dom/LICENSE +21 -0
- package/lib/vapor/@vue/compiler-dom/README.md +1 -0
- package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.cjs.js +936 -0
- package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +856 -0
- package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +6682 -0
- package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +14 -0
- package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +693 -0
- package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.global.js +6855 -0
- package/lib/vapor/@vue/compiler-dom/dist/compiler-dom.global.prod.js +14 -0
- package/lib/vapor/@vue/compiler-dom/index.js +7 -0
- package/lib/vapor/@vue/compiler-dom/package.json +57 -0
- package/lib/vapor/@vue/compiler-sfc/LICENSE +21 -0
- package/lib/vapor/@vue/compiler-sfc/README.md +80 -0
- package/lib/vapor/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +21682 -0
- package/lib/vapor/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +66281 -0
- package/lib/vapor/@vue/compiler-sfc/package.json +68 -0
- package/lib/vapor/@vue/compiler-ssr/LICENSE +21 -0
- package/lib/vapor/@vue/compiler-ssr/README.md +1 -0
- package/lib/vapor/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1402 -0
- package/lib/vapor/@vue/compiler-ssr/package.json +34 -0
- package/lib/vapor/@vue/compiler-vapor/LICENSE +21 -0
- package/lib/vapor/@vue/compiler-vapor/README.md +1 -0
- package/lib/vapor/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +4549 -0
- package/lib/vapor/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +37029 -0
- package/lib/vapor/@vue/compiler-vapor/package.json +49 -0
- package/lib/vapor/@vue/reactivity/LICENSE +21 -0
- package/lib/vapor/@vue/reactivity/README.md +19 -0
- package/lib/vapor/@vue/reactivity/dist/reactivity.cjs.js +2033 -0
- package/lib/vapor/@vue/reactivity/dist/reactivity.cjs.prod.js +1841 -0
- package/lib/vapor/@vue/reactivity/dist/reactivity.esm-browser.js +2023 -0
- package/lib/vapor/@vue/reactivity/dist/reactivity.esm-browser.prod.js +5 -0
- package/lib/vapor/@vue/reactivity/dist/reactivity.esm-bundler.js +1992 -0
- package/lib/vapor/@vue/reactivity/dist/reactivity.global.js +2082 -0
- package/lib/vapor/@vue/reactivity/dist/reactivity.global.prod.js +5 -0
- package/lib/vapor/@vue/reactivity/index.js +7 -0
- package/lib/vapor/@vue/reactivity/package.json +55 -0
- package/lib/vapor/@vue/runtime-core/LICENSE +21 -0
- package/lib/vapor/@vue/runtime-core/README.md +28 -0
- package/lib/vapor/@vue/runtime-core/dist/runtime-core.cjs.js +8972 -0
- package/lib/vapor/@vue/runtime-core/dist/runtime-core.cjs.prod.js +7088 -0
- package/lib/vapor/@vue/runtime-core/dist/runtime-core.esm-bundler.js +8913 -0
- package/lib/vapor/@vue/runtime-core/index.js +7 -0
- package/lib/vapor/@vue/runtime-core/package.json +54 -0
- package/lib/vapor/@vue/runtime-dom/LICENSE +21 -0
- package/lib/vapor/@vue/runtime-dom/README.md +13 -0
- package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.cjs.js +1797 -0
- package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1646 -0
- package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.esm-browser.js +12929 -0
- package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.esm-browser.prod.js +6 -0
- package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +1838 -0
- package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.global.js +13086 -0
- package/lib/vapor/@vue/runtime-dom/dist/runtime-dom.global.prod.js +6 -0
- package/lib/vapor/@vue/runtime-dom/index.js +7 -0
- package/lib/vapor/@vue/runtime-dom/package.json +60 -0
- package/lib/vapor/@vue/runtime-vapor/LICENSE +21 -0
- package/lib/vapor/@vue/runtime-vapor/README.md +8 -0
- package/lib/vapor/@vue/runtime-vapor/dist/runtime-vapor.esm-bundler.js +3265 -0
- package/lib/vapor/@vue/runtime-vapor/package.json +47 -0
- package/lib/vapor/@vue/server-renderer/LICENSE +21 -0
- package/lib/vapor/@vue/server-renderer/README.md +178 -0
- package/lib/vapor/@vue/server-renderer/dist/server-renderer.cjs.js +1144 -0
- package/lib/vapor/@vue/server-renderer/dist/server-renderer.cjs.prod.js +871 -0
- package/lib/vapor/@vue/server-renderer/dist/server-renderer.esm-browser.js +8756 -0
- package/lib/vapor/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js +5 -0
- package/lib/vapor/@vue/server-renderer/dist/server-renderer.esm-bundler.js +1366 -0
- package/lib/vapor/@vue/server-renderer/index.js +7 -0
- package/lib/vapor/@vue/server-renderer/package.json +55 -0
- package/lib/vapor/@vue/shared/LICENSE +21 -0
- package/lib/vapor/@vue/shared/README.md +3 -0
- package/lib/vapor/@vue/shared/dist/shared.cjs.js +698 -0
- package/lib/vapor/@vue/shared/dist/shared.cjs.prod.js +690 -0
- package/lib/vapor/@vue/shared/dist/shared.esm-bundler.js +616 -0
- package/lib/vapor/@vue/shared/index.js +7 -0
- package/lib/vapor/@vue/shared/package.json +47 -0
- package/lib/vapor/@vue/vue/LICENSE +21 -0
- package/lib/vapor/@vue/vue/README.md +62 -0
- package/lib/vapor/@vue/vue/compiler-sfc/index.browser.js +1 -0
- package/lib/vapor/@vue/vue/compiler-sfc/index.browser.mjs +1 -0
- package/lib/vapor/@vue/vue/compiler-sfc/index.d.mts +1 -0
- package/lib/vapor/@vue/vue/compiler-sfc/index.d.ts +1 -0
- package/lib/vapor/@vue/vue/compiler-sfc/index.js +3 -0
- package/lib/vapor/@vue/vue/compiler-sfc/index.mjs +3 -0
- package/lib/vapor/@vue/vue/compiler-sfc/package.json +4 -0
- package/lib/vapor/@vue/vue/compiler-sfc/register-ts.js +3 -0
- package/lib/vapor/@vue/vue/dist/vue.cjs.js +80 -0
- package/lib/vapor/@vue/vue/dist/vue.cjs.prod.js +66 -0
- package/lib/vapor/@vue/vue/dist/vue.esm-browser.js +18840 -0
- package/lib/vapor/@vue/vue/dist/vue.esm-browser.prod.js +12 -0
- package/lib/vapor/@vue/vue/dist/vue.esm-bundler.js +72 -0
- package/lib/vapor/@vue/vue/dist/vue.global.js +18820 -0
- package/lib/vapor/@vue/vue/dist/vue.global.prod.js +12 -0
- package/lib/vapor/@vue/vue/dist/vue.runtime-with-vapor.esm-browser.js +15671 -0
- package/lib/vapor/@vue/vue/dist/vue.runtime-with-vapor.esm-browser.prod.js +9 -0
- package/lib/vapor/@vue/vue/dist/vue.runtime.esm-browser.js +12953 -0
- package/lib/vapor/@vue/vue/dist/vue.runtime.esm-browser.prod.js +6 -0
- package/lib/vapor/@vue/vue/dist/vue.runtime.esm-bundler.js +29 -0
- package/lib/vapor/@vue/vue/dist/vue.runtime.global.js +13111 -0
- package/lib/vapor/@vue/vue/dist/vue.runtime.global.prod.js +6 -0
- package/lib/vapor/@vue/vue/index.js +7 -0
- package/lib/vapor/@vue/vue/index.mjs +1 -0
- package/lib/vapor/@vue/vue/jsx-runtime/index.d.ts +25 -0
- package/lib/vapor/@vue/vue/jsx-runtime/index.js +15 -0
- package/lib/vapor/@vue/vue/jsx-runtime/index.mjs +12 -0
- package/lib/vapor/@vue/vue/jsx-runtime/package.json +5 -0
- package/lib/vapor/@vue/vue/jsx.d.ts +22 -0
- package/lib/vapor/@vue/vue/package.json +114 -0
- package/lib/vapor/@vue/vue/server-renderer/index.d.mts +1 -0
- package/lib/vapor/@vue/vue/server-renderer/index.d.ts +1 -0
- package/lib/vapor/@vue/vue/server-renderer/index.js +1 -0
- package/lib/vapor/@vue/vue/server-renderer/index.mjs +1 -0
- package/lib/vapor/@vue/vue/server-renderer/package.json +4 -0
- package/package.json +38 -38
package/dist/easycom.d.ts
CHANGED
package/dist/easycom.js
CHANGED
|
@@ -32,6 +32,7 @@ function initEasycoms(inputDir, { dirs, platform, isX, }) {
|
|
|
32
32
|
// 初始化时,从once中读取缓存,refresh时,实时读取
|
|
33
33
|
const { easycom } = pagesJson || (0, pages_1.parsePagesJson)(inputDir, platform, false);
|
|
34
34
|
const easycomOptions = {
|
|
35
|
+
platform,
|
|
35
36
|
isX,
|
|
36
37
|
dirs: easycom && easycom.autoscan === false
|
|
37
38
|
? [...dirs] // 禁止自动扫描
|
|
@@ -127,11 +128,11 @@ function initUniModulesEasycomDirs(uniModulesDir, componentsDir = 'components')
|
|
|
127
128
|
})
|
|
128
129
|
.filter(Boolean);
|
|
129
130
|
}
|
|
130
|
-
function initEasycom({ isX, dirs, rootDir, custom, extensions, }) {
|
|
131
|
+
function initEasycom({ platform, isX, dirs, rootDir, custom, extensions, }) {
|
|
131
132
|
rootDir = (0, utils_1.normalizePath)(rootDir);
|
|
132
133
|
const easycomsObj = Object.create(null);
|
|
133
134
|
if (dirs && dirs.length && rootDir) {
|
|
134
|
-
const autoEasyComObj = initAutoScanEasycoms(dirs, rootDir, extensions);
|
|
135
|
+
const autoEasyComObj = initAutoScanEasycoms(platform, dirs, rootDir, extensions);
|
|
135
136
|
if (isX) {
|
|
136
137
|
Object.keys(autoEasyComObj).forEach((tagName) => {
|
|
137
138
|
let source = autoEasyComObj[tagName];
|
|
@@ -201,7 +202,7 @@ const isDir = (path) => {
|
|
|
201
202
|
}
|
|
202
203
|
return false;
|
|
203
204
|
};
|
|
204
|
-
function initAutoScanEasycom(dir, rootDir, extensions) {
|
|
205
|
+
function initAutoScanEasycom(platform, dir, rootDir, extensions) {
|
|
205
206
|
if (!path_1.default.isAbsolute(dir)) {
|
|
206
207
|
dir = path_1.default.resolve(rootDir, dir);
|
|
207
208
|
}
|
|
@@ -209,6 +210,7 @@ function initAutoScanEasycom(dir, rootDir, extensions) {
|
|
|
209
210
|
if (!fs_1.default.existsSync(dir)) {
|
|
210
211
|
return easycoms;
|
|
211
212
|
}
|
|
213
|
+
const isMp = platform.startsWith('mp-');
|
|
212
214
|
const is_uni_modules = path_1.default.basename(path_1.default.resolve(dir, '../..')) === 'uni_modules';
|
|
213
215
|
const is_easycom_encrypt_uni_modules = // uni_modules模式不需要此逻辑
|
|
214
216
|
process.env.UNI_COMPILE_TARGET !== 'uni_modules' &&
|
|
@@ -228,24 +230,26 @@ function initAutoScanEasycom(dir, rootDir, extensions) {
|
|
|
228
230
|
for (let i = 0; i < extensions.length; i++) {
|
|
229
231
|
const ext = extensions[i];
|
|
230
232
|
if (files.includes(name + ext)) {
|
|
231
|
-
easycoms[`^${name}$`] =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
233
|
+
easycoms[`^${name}$`] =
|
|
234
|
+
// mp平台,这里不处理,由uniEntryPlugin处理
|
|
235
|
+
is_easycom_encrypt_uni_modules && !isMp
|
|
236
|
+
? (0, utils_1.normalizePath)(path_1.default.join(rootDir, `uni_modules/${uni_modules_plugin_id}?${
|
|
237
|
+
// android 走 proxy
|
|
238
|
+
process.env.UNI_APP_X === 'true' &&
|
|
239
|
+
process.env.UNI_UTS_PLATFORM === 'app-android'
|
|
240
|
+
? 'uts-proxy'
|
|
241
|
+
: 'uni_helpers'}`))
|
|
242
|
+
: `${importDir}/${name}${ext}`;
|
|
239
243
|
break;
|
|
240
244
|
}
|
|
241
245
|
}
|
|
242
246
|
});
|
|
243
247
|
return easycoms;
|
|
244
248
|
}
|
|
245
|
-
function initAutoScanEasycoms(dirs, rootDir, extensions) {
|
|
249
|
+
function initAutoScanEasycoms(platform, dirs, rootDir, extensions) {
|
|
246
250
|
const conflict = {};
|
|
247
251
|
const res = dirs.reduce((easycoms, dir) => {
|
|
248
|
-
const curEasycoms = initAutoScanEasycom(dir, rootDir, extensions);
|
|
252
|
+
const curEasycoms = initAutoScanEasycom(platform, dir, rootDir, extensions);
|
|
249
253
|
Object.keys(curEasycoms).forEach((name) => {
|
|
250
254
|
// Use the first component when name conflict
|
|
251
255
|
const componentPath = easycoms[name];
|
package/dist/env/define.d.ts
CHANGED
package/dist/env/define.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initDefine = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
4
5
|
const env_1 = require("../hbx/env");
|
|
5
6
|
const json_1 = require("../json");
|
|
6
7
|
function initDefine(stringifyBoolean = false) {
|
|
@@ -9,7 +10,7 @@ function initDefine(stringifyBoolean = false) {
|
|
|
9
10
|
const isRunByHBuilderX = (0, env_1.runByHBuilderX)();
|
|
10
11
|
const isDebug = !!manifestJson.debug;
|
|
11
12
|
const isX = process.env.UNI_APP_X === 'true';
|
|
12
|
-
const isMP = process.env.UNI_PLATFORM.startsWith('mp');
|
|
13
|
+
const isMP = process.env.UNI_PLATFORM && process.env.UNI_PLATFORM.startsWith('mp-');
|
|
13
14
|
process.env['UNI_APP_ID'] = manifestJson.appid;
|
|
14
15
|
let mpXDefine = isX && isMP
|
|
15
16
|
? {
|
|
@@ -47,6 +48,7 @@ function initDefine(stringifyBoolean = false) {
|
|
|
47
48
|
// 兼容旧版本
|
|
48
49
|
'process.env.VUE_APP_PLATFORM': JSON.stringify(process.env.UNI_PLATFORM || ''),
|
|
49
50
|
'process.env.VUE_APP_DARK_MODE': JSON.stringify(platformManifestJson.darkmode || false),
|
|
51
|
+
__UNI_PRELOAD_SHADOW_IMAGE__: JSON.stringify(process.env.UNI_PLATFORM === 'mp-weixin' ? (0, utils_1.getShadowImagePath)('grey') : ''),
|
|
50
52
|
...mpXDefine,
|
|
51
53
|
};
|
|
52
54
|
}
|
package/dist/hbx/alias.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.formatInstallHBuilderXPluginTips = exports.moduleAliasFormatter = exports.installHBuilderXPlugin = exports.initModuleAlias = void 0;
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const path_1 = __importDefault(require("path"));
|
|
9
10
|
const module_alias_1 = __importDefault(require("module-alias"));
|
|
10
11
|
const utils_1 = require("./utils");
|
|
@@ -19,16 +20,48 @@ function initModuleAlias() {
|
|
|
19
20
|
const libDir = path_1.default.resolve(__dirname, '../../lib');
|
|
20
21
|
const compilerSfcPath = path_1.default.resolve(libDir, '@vue/compiler-sfc');
|
|
21
22
|
const serverRendererPath = require.resolve('@vue/server-renderer');
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// TODO 临时开关启用vapor
|
|
24
|
+
if (!process.env.UNI_VUE_VAPOR &&
|
|
25
|
+
process.env.UNI_INPUT_DIR &&
|
|
26
|
+
// 该代码执行较早,不能使用UNI_UTS_PLATFORM
|
|
27
|
+
(process.env.UNI_PLATFORM === 'app-harmony' ||
|
|
28
|
+
(process.env.UNI_PLATFORM === 'app' &&
|
|
29
|
+
process.env.UNI_APP_PLATFORM === 'ios'))) {
|
|
30
|
+
const vaporConfig = path_1.default.resolve(process.env.UNI_INPUT_DIR, '.vapor');
|
|
31
|
+
if (fs_1.default.existsSync(vaporConfig)) {
|
|
32
|
+
process.env.UNI_VUE_VAPOR = 'true';
|
|
33
|
+
if (fs_1.default.readFileSync(vaporConfig, 'utf-8').trim() === '*') {
|
|
34
|
+
process.env.UNI_VUE_VAPOR_ALL = 'true';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (process.env.UNI_VUE_VAPOR === 'true') {
|
|
39
|
+
const vuePkgs = [
|
|
40
|
+
'@vue/compiler-core',
|
|
41
|
+
'@vue/compiler-dom',
|
|
42
|
+
'@vue/compiler-sfc',
|
|
43
|
+
'@vue/compiler-ssr',
|
|
44
|
+
'@vue/compiler-vapor',
|
|
45
|
+
'@vue/server-renderer',
|
|
46
|
+
'@vue/shared',
|
|
47
|
+
];
|
|
48
|
+
vuePkgs.forEach((pkg) => {
|
|
49
|
+
module_alias_1.default.addAlias(pkg, path_1.default.resolve(libDir, 'vapor', '@vue', pkg.split('/').pop()));
|
|
50
|
+
});
|
|
51
|
+
module_alias_1.default.addAlias('@vitejs/plugin-vue', path_1.default.resolve(libDir, 'vapor', '@vitejs', 'plugin-vue'));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
module_alias_1.default.addAliases({
|
|
55
|
+
'@vue/shared': require.resolve('@vue/shared'),
|
|
56
|
+
'@vue/shared/dist/shared.esm-bundler.js': require.resolve('@vue/shared/dist/shared.esm-bundler.js'),
|
|
57
|
+
'@vue/compiler-core': path_1.default.resolve(libDir, '@vue/compiler-core'),
|
|
58
|
+
'@vue/compiler-dom': require.resolve('@vue/compiler-dom'),
|
|
59
|
+
'@vue/compiler-sfc': compilerSfcPath,
|
|
60
|
+
'@vue/server-renderer': serverRendererPath,
|
|
61
|
+
'vue/compiler-sfc': compilerSfcPath,
|
|
62
|
+
'vue/server-renderer': serverRendererPath,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
32
65
|
if (process.env.VITEST) {
|
|
33
66
|
module_alias_1.default.addAliases({
|
|
34
67
|
vue: '@dcloudio/uni-h5-vue',
|
package/dist/hbx/index.js
CHANGED
|
@@ -21,6 +21,7 @@ exports.isEnableConsole = exports.uniHBuilderXConsolePlugin = exports.formatInst
|
|
|
21
21
|
const path_1 = __importDefault(require("path"));
|
|
22
22
|
const utils_1 = require("../utils");
|
|
23
23
|
const console_1 = require("../vite/plugins/console");
|
|
24
|
+
const workers_1 = require("../workers");
|
|
24
25
|
var log_1 = require("./log");
|
|
25
26
|
Object.defineProperty(exports, "formatAtFilename", { enumerable: true, get: function () { return log_1.formatAtFilename; } });
|
|
26
27
|
__exportStar(require("./env"), exports);
|
|
@@ -29,8 +30,19 @@ Object.defineProperty(exports, "initModuleAlias", { enumerable: true, get: funct
|
|
|
29
30
|
Object.defineProperty(exports, "installHBuilderXPlugin", { enumerable: true, get: function () { return alias_1.installHBuilderXPlugin; } });
|
|
30
31
|
Object.defineProperty(exports, "formatInstallHBuilderXPluginTips", { enumerable: true, get: function () { return alias_1.formatInstallHBuilderXPluginTips; } });
|
|
31
32
|
function uniHBuilderXConsolePlugin(method = '__f__') {
|
|
33
|
+
const exclude = [];
|
|
34
|
+
if (process.env.UNI_APP_X === 'true') {
|
|
35
|
+
const workersDirs = (0, workers_1.resolveWorkersDir)(process.env.UNI_INPUT_DIR);
|
|
36
|
+
if (workersDirs.length) {
|
|
37
|
+
// 排除workers目录
|
|
38
|
+
for (const workersDir of workersDirs) {
|
|
39
|
+
exclude.push((0, utils_1.pathToGlob)(path_1.default.join(process.env.UNI_INPUT_DIR, workersDir), '**/*'));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
32
43
|
return (0, console_1.uniConsolePlugin)({
|
|
33
44
|
method,
|
|
45
|
+
exclude,
|
|
34
46
|
filename(filename) {
|
|
35
47
|
filename = path_1.default.relative(process.env.UNI_INPUT_DIR, filename);
|
|
36
48
|
if (filename.startsWith('.') || path_1.default.isAbsolute(filename)) {
|
package/dist/hbx/log.js
CHANGED
|
@@ -125,7 +125,22 @@ exports.errorFormatter = {
|
|
|
125
125
|
return buildErrorMessage(opts.error, [], false);
|
|
126
126
|
},
|
|
127
127
|
};
|
|
128
|
+
const VITE_ROLLUP_FAILED_TO_RESOLVE_IMPORT_RE = /\[vite\]: Rollup failed to resolve import "([^"]+)" from "([^"]+)"/;
|
|
128
129
|
function buildErrorMessage(err, args = [], includeStack = true) {
|
|
130
|
+
if (err.customPrint) {
|
|
131
|
+
err.customPrint();
|
|
132
|
+
return '';
|
|
133
|
+
}
|
|
134
|
+
if (VITE_ROLLUP_FAILED_TO_RESOLVE_IMPORT_RE.test(err.message)) {
|
|
135
|
+
const [, importPath, fromPath] = err.message.match(VITE_ROLLUP_FAILED_TO_RESOLVE_IMPORT_RE) || [];
|
|
136
|
+
err.message = `Could not resolve "${importPath}" from "${fromPath}"`;
|
|
137
|
+
err.id = fromPath;
|
|
138
|
+
}
|
|
139
|
+
// 移除 from 后面的内容
|
|
140
|
+
// 主要是处理:Could not resolve "./static/logo1.png" from "../../../../../../Users/xxx/HBuilderProjects/test-x/pages/index/index.uvue?vue&type=script&lang.uts"
|
|
141
|
+
if (err.id && err.message.startsWith('Could not resolve ')) {
|
|
142
|
+
err.message = err.message.split(' from ')[0];
|
|
143
|
+
}
|
|
129
144
|
if (err.plugin) {
|
|
130
145
|
// 避免出现这样的错误:[plugin:vite:vue] [plugin vite:vue]
|
|
131
146
|
if (err.message.startsWith(`[plugin ${err.plugin}]`)) {
|
|
@@ -134,7 +149,7 @@ function buildErrorMessage(err, args = [], includeStack = true) {
|
|
|
134
149
|
// [plugin:vite:vue] pages/index/index.vue (2:12): v-on="" is not supported
|
|
135
150
|
const locStr = `(${err.loc.line}:${err.loc.column}):`;
|
|
136
151
|
if (msg.includes(locStr)) {
|
|
137
|
-
msg = msg.split(locStr)[1];
|
|
152
|
+
msg = msg.split(locStr)[1].trim();
|
|
138
153
|
}
|
|
139
154
|
}
|
|
140
155
|
args.push(`${picocolors_1.default.magenta('[plugin:' + err.plugin + ']')} ${picocolors_1.default.red(msg)}`);
|
|
@@ -148,6 +163,13 @@ function buildErrorMessage(err, args = [], includeStack = true) {
|
|
|
148
163
|
otherMsgs.push(`[plugin:${msg}`);
|
|
149
164
|
});
|
|
150
165
|
}
|
|
166
|
+
if (err.loc) {
|
|
167
|
+
// [plugin:vite:vue] pages/index/index.vue (2:12): v-on="" is not supported
|
|
168
|
+
const locStr = `(${err.loc.line}:${err.loc.column}):`;
|
|
169
|
+
if (err.message.includes(locStr)) {
|
|
170
|
+
err.message = err.message.split(locStr)[1].trim();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
151
173
|
args.push(`${picocolors_1.default.magenta('[plugin:' + err.plugin + ']')} ${picocolors_1.default.red(err.message)}`);
|
|
152
174
|
args.push(...otherMsgs);
|
|
153
175
|
if (err.loc &&
|
package/dist/index.d.ts
CHANGED
|
@@ -22,8 +22,9 @@ export * from './resolve';
|
|
|
22
22
|
export * from './scripts';
|
|
23
23
|
export * from './platform';
|
|
24
24
|
export * from './utsUtils';
|
|
25
|
+
export * from './workers';
|
|
25
26
|
export { parseUniExtApi, parseUniExtApis, parseInjects, Define, DefineOptions, Defines, getUniExtApiProviderRegisters, formatExtApiProviderName, } from './uni_modules';
|
|
26
|
-
export { parseUniModulesArtifacts, resolveEncryptUniModule, } from './uni_modules.cloud';
|
|
27
|
+
export { getUniModulesEncryptType, parseUniModulesArtifacts, resolveEncryptUniModule, } from './uni_modules.cloud';
|
|
27
28
|
import type { EncryptPackageJson } from './uni_modules.cloud';
|
|
28
29
|
export type EncryptArtifacts = EncryptPackageJson['uni_modules']['artifacts'];
|
|
29
30
|
export { M } from './messages';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.checkUpdate = exports.M = exports.resolveEncryptUniModule = exports.parseUniModulesArtifacts = exports.formatExtApiProviderName = exports.getUniExtApiProviderRegisters = exports.parseInjects = exports.parseUniExtApis = exports.parseUniExtApi = void 0;
|
|
17
|
+
exports.checkUpdate = exports.M = exports.resolveEncryptUniModule = exports.parseUniModulesArtifacts = exports.getUniModulesEncryptType = exports.formatExtApiProviderName = exports.getUniExtApiProviderRegisters = exports.parseInjects = exports.parseUniExtApis = exports.parseUniExtApi = void 0;
|
|
18
18
|
__exportStar(require("./fs"), exports);
|
|
19
19
|
__exportStar(require("./mp"), exports);
|
|
20
20
|
__exportStar(require("./url"), exports);
|
|
@@ -39,6 +39,7 @@ __exportStar(require("./resolve"), exports);
|
|
|
39
39
|
__exportStar(require("./scripts"), exports);
|
|
40
40
|
__exportStar(require("./platform"), exports);
|
|
41
41
|
__exportStar(require("./utsUtils"), exports);
|
|
42
|
+
__exportStar(require("./workers"), exports);
|
|
42
43
|
var uni_modules_1 = require("./uni_modules");
|
|
43
44
|
Object.defineProperty(exports, "parseUniExtApi", { enumerable: true, get: function () { return uni_modules_1.parseUniExtApi; } });
|
|
44
45
|
Object.defineProperty(exports, "parseUniExtApis", { enumerable: true, get: function () { return uni_modules_1.parseUniExtApis; } });
|
|
@@ -46,6 +47,7 @@ Object.defineProperty(exports, "parseInjects", { enumerable: true, get: function
|
|
|
46
47
|
Object.defineProperty(exports, "getUniExtApiProviderRegisters", { enumerable: true, get: function () { return uni_modules_1.getUniExtApiProviderRegisters; } });
|
|
47
48
|
Object.defineProperty(exports, "formatExtApiProviderName", { enumerable: true, get: function () { return uni_modules_1.formatExtApiProviderName; } });
|
|
48
49
|
var uni_modules_cloud_1 = require("./uni_modules.cloud");
|
|
50
|
+
Object.defineProperty(exports, "getUniModulesEncryptType", { enumerable: true, get: function () { return uni_modules_cloud_1.getUniModulesEncryptType; } });
|
|
49
51
|
Object.defineProperty(exports, "parseUniModulesArtifacts", { enumerable: true, get: function () { return uni_modules_cloud_1.parseUniModulesArtifacts; } });
|
|
50
52
|
Object.defineProperty(exports, "resolveEncryptUniModule", { enumerable: true, get: function () { return uni_modules_cloud_1.resolveEncryptUniModule; } });
|
|
51
53
|
var messages_1 = require("./messages");
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function getAppRenderer(manifestJson: Record<string, any>): "" | "native";
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function getAppCodeSplitting(manifestJson: Record<string, any>): boolean;
|
|
3
3
|
export declare function getAppStyleIsolation(manifestJson: Record<string, any>): 'apply-shared' | 'isolated' | 'shared';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAppStyleIsolation = exports.
|
|
3
|
+
exports.getAppStyleIsolation = exports.getAppCodeSplitting = exports.getAppRenderer = void 0;
|
|
4
4
|
function getAppRenderer(manifestJson) {
|
|
5
5
|
const platformOptions = manifestJson['app-plus'];
|
|
6
6
|
if (platformOptions && platformOptions.renderer === 'native') {
|
|
@@ -9,13 +9,13 @@ function getAppRenderer(manifestJson) {
|
|
|
9
9
|
return '';
|
|
10
10
|
}
|
|
11
11
|
exports.getAppRenderer = getAppRenderer;
|
|
12
|
-
function
|
|
13
|
-
if (manifestJson['app-plus']?.optimization?.
|
|
12
|
+
function getAppCodeSplitting(manifestJson) {
|
|
13
|
+
if (manifestJson['app-plus']?.optimization?.codeSplitting === true) {
|
|
14
14
|
return true;
|
|
15
15
|
}
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
|
-
exports.
|
|
18
|
+
exports.getAppCodeSplitting = getAppCodeSplitting;
|
|
19
19
|
function getAppStyleIsolation(manifestJson) {
|
|
20
20
|
return (manifestJson['app-plus']?.optimization?.styleIsolation ?? 'apply-shared');
|
|
21
21
|
}
|
|
@@ -31,9 +31,11 @@ const checksystemwebview_1 = require("./checksystemwebview");
|
|
|
31
31
|
const tabBar_1 = require("./tabBar");
|
|
32
32
|
const i18n_1 = require("./i18n");
|
|
33
33
|
const theme_1 = require("../../theme");
|
|
34
|
+
const manifest_1 = require("../../manifest");
|
|
34
35
|
function normalizeAppManifestJson(userManifestJson, pagesJson) {
|
|
35
36
|
const manifestJson = (0, merge_1.initRecursiveMerge)((0, defaultManifestJson_1.initDefaultManifestJson)(), userManifestJson);
|
|
36
|
-
const
|
|
37
|
+
const manifestJsonPlatform = (0, manifest_1.getPlatformManifestJson)(manifestJson);
|
|
38
|
+
const { pages, globalStyle, tabBar } = (0, theme_1.initTheme)(manifestJsonPlatform, pagesJson);
|
|
37
39
|
(0, shared_1.extend)(pagesJson, JSON.parse(JSON.stringify({ pages, globalStyle, tabBar })));
|
|
38
40
|
(0, statusbar_1.initAppStatusbar)(manifestJson, pagesJson);
|
|
39
41
|
(0, arguments_1.initArguments)(manifestJson, pagesJson);
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function staticImportPageCode(pagesJson: Record<string, any>): string;
|
|
2
|
+
export declare function definePageCode(pagesJson: Record<string, any>, platform?: UniApp.PLATFORM, dynamicImport?: boolean): string;
|
|
2
3
|
export declare function defineNVuePageCode(pagesJson: Record<string, any>): string;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defineNVuePageCode = exports.definePageCode = void 0;
|
|
3
|
+
exports.defineNVuePageCode = exports.definePageCode = exports.staticImportPageCode = void 0;
|
|
4
4
|
const utils_1 = require("../../../utils");
|
|
5
|
-
function
|
|
5
|
+
function staticImportPageCode(pagesJson) {
|
|
6
|
+
const importPagesCode = [];
|
|
7
|
+
pagesJson.pages.forEach((page) => {
|
|
8
|
+
const pagePath = page.path;
|
|
9
|
+
const pagePathWithExtname = (0, utils_1.normalizePagePath)(pagePath, 'app');
|
|
10
|
+
if (pagePathWithExtname) {
|
|
11
|
+
importPagesCode.push(`import '../assets/${(0, utils_1.removeExt)(pagePathWithExtname)}'`);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
return importPagesCode.join('\n');
|
|
15
|
+
}
|
|
16
|
+
exports.staticImportPageCode = staticImportPageCode;
|
|
17
|
+
function definePageCode(pagesJson, platform = 'app', dynamicImport = false) {
|
|
6
18
|
const importPagesCode = [];
|
|
7
19
|
const definePagesCode = [];
|
|
8
20
|
pagesJson.pages.forEach((page) => {
|
|
@@ -13,7 +25,7 @@ function definePageCode(pagesJson, platform = 'app') {
|
|
|
13
25
|
const pageIdentifier = (0, utils_1.normalizeIdentifier)(pagePath);
|
|
14
26
|
const pagePathWithExtname = (0, utils_1.normalizePagePath)(pagePath, platform);
|
|
15
27
|
if (pagePathWithExtname) {
|
|
16
|
-
if (
|
|
28
|
+
if (dynamicImport) {
|
|
17
29
|
// 拆分页面
|
|
18
30
|
importPagesCode.push(`const ${pageIdentifier} = ()=>import('./${pagePathWithExtname}')`);
|
|
19
31
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { staticImportPageCode } from './definePage';
|
|
2
|
+
export declare function normalizeAppPagesJson(pagesJson: Record<string, any>, platform?: UniApp.PLATFORM, dynamicImport?: boolean): string;
|
|
2
3
|
export declare function normalizeAppNVuePagesJson(pagesJson: Record<string, any>): string;
|
|
3
4
|
export declare function normalizeAppConfigService(pagesJson: UniApp.PagesJson, manifestJson: Record<string, any>): string;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeAppConfigService = exports.normalizeAppNVuePagesJson = exports.normalizeAppPagesJson = void 0;
|
|
3
|
+
exports.normalizeAppConfigService = exports.normalizeAppNVuePagesJson = exports.normalizeAppPagesJson = exports.staticImportPageCode = void 0;
|
|
4
4
|
const code_1 = require("./code");
|
|
5
5
|
const definePage_1 = require("./definePage");
|
|
6
6
|
const uniConfig_1 = require("./uniConfig");
|
|
7
7
|
const uniRoutes_1 = require("./uniRoutes");
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var definePage_2 = require("./definePage");
|
|
9
|
+
Object.defineProperty(exports, "staticImportPageCode", { enumerable: true, get: function () { return definePage_2.staticImportPageCode; } });
|
|
10
|
+
function normalizeAppPagesJson(pagesJson, platform = 'app', dynamicImport = false) {
|
|
11
|
+
return (0, definePage_1.definePageCode)(pagesJson, platform, dynamicImport);
|
|
10
12
|
}
|
|
11
13
|
exports.normalizeAppPagesJson = normalizeAppPagesJson;
|
|
12
14
|
function normalizeAppNVuePagesJson(pagesJson) {
|
package/dist/json/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export * from './json';
|
|
|
4
4
|
export * from './pages';
|
|
5
5
|
export * from './manifest';
|
|
6
6
|
export * from './theme';
|
|
7
|
-
export { normalizeUniAppXAppPagesJson, normalizeUniAppXAppConfig, parseUniXFlexDirection, parseUniXSplashScreen, isUniXPageFile, getUniXPagePaths, } from './uni-x';
|
|
7
|
+
export { normalizeUniAppXAppPagesJson, normalizeUniAppXAppConfig, parseUniXFlexDirection, parseUniXSplashScreen, isUniXPageFile, getUniXPagePaths, parseUniXAppAndroidPackage, } from './uni-x';
|
|
8
8
|
export { checkPagesJson } from './utils';
|
package/dist/json/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.checkPagesJson = exports.getUniXPagePaths = exports.isUniXPageFile = exports.parseUniXSplashScreen = exports.parseUniXFlexDirection = exports.normalizeUniAppXAppConfig = exports.normalizeUniAppXAppPagesJson = void 0;
|
|
17
|
+
exports.checkPagesJson = exports.parseUniXAppAndroidPackage = exports.getUniXPagePaths = exports.isUniXPageFile = exports.parseUniXSplashScreen = exports.parseUniXFlexDirection = exports.normalizeUniAppXAppConfig = exports.normalizeUniAppXAppPagesJson = void 0;
|
|
18
18
|
__exportStar(require("./mp"), exports);
|
|
19
19
|
__exportStar(require("./app"), exports);
|
|
20
20
|
__exportStar(require("./json"), exports);
|
|
@@ -28,5 +28,6 @@ Object.defineProperty(exports, "parseUniXFlexDirection", { enumerable: true, get
|
|
|
28
28
|
Object.defineProperty(exports, "parseUniXSplashScreen", { enumerable: true, get: function () { return uni_x_1.parseUniXSplashScreen; } });
|
|
29
29
|
Object.defineProperty(exports, "isUniXPageFile", { enumerable: true, get: function () { return uni_x_1.isUniXPageFile; } });
|
|
30
30
|
Object.defineProperty(exports, "getUniXPagePaths", { enumerable: true, get: function () { return uni_x_1.getUniXPagePaths; } });
|
|
31
|
+
Object.defineProperty(exports, "parseUniXAppAndroidPackage", { enumerable: true, get: function () { return uni_x_1.parseUniXAppAndroidPackage; } });
|
|
31
32
|
var utils_1 = require("./utils");
|
|
32
33
|
Object.defineProperty(exports, "checkPagesJson", { enumerable: true, get: function () { return utils_1.checkPagesJson; } });
|
package/dist/json/manifest.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const parseManifestJson: (inputDir: string) => any;
|
|
2
2
|
export declare const parseManifestJsonOnce: (inputDir: string) => any;
|
|
3
3
|
export declare const parseRpx2UnitOnce: (inputDir: string, platform?: UniApp.PLATFORM) => any;
|
|
4
|
+
export declare function getNativeTags(inputDir?: string, platform?: UniApp.PLATFORM): any;
|
|
4
5
|
interface CompilerCompatConfig {
|
|
5
6
|
MODE?: 2 | 3;
|
|
6
7
|
}
|
package/dist/json/manifest.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateThemeValue = exports.getPlatformManifestJsonOnce = exports.getPlatformManifestJson = exports.getDevServerOptions = exports.isEnableTreeShaking = exports.getRouterOptions = exports.isUniPushOffline = exports.hasPushModule = exports.isEnableSecureNetwork = exports.isEnableUniPushV2 = exports.isEnableUniPushV1 = exports.getUniStatistics = exports.normalizeNetworkTimeout = exports.parseCompatConfigOnce = exports.parseRpx2UnitOnce = exports.parseManifestJsonOnce = exports.parseManifestJson = void 0;
|
|
6
|
+
exports.validateThemeValue = exports.getPlatformManifestJsonOnce = exports.getPlatformManifestJson = exports.getDevServerOptions = exports.isEnableTreeShaking = exports.getRouterOptions = exports.isUniPushOffline = exports.hasPushModule = exports.isEnableSecureNetwork = exports.isEnableUniPushV2 = exports.isEnableUniPushV1 = exports.getUniStatistics = exports.normalizeNetworkTimeout = exports.parseCompatConfigOnce = exports.getNativeTags = exports.parseRpx2UnitOnce = exports.parseManifestJsonOnce = exports.parseManifestJson = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const shared_1 = require("@vue/shared");
|
|
@@ -32,6 +32,16 @@ exports.parseRpx2UnitOnce = (0, uni_shared_1.once)((inputDir, platform = 'h5') =
|
|
|
32
32
|
}
|
|
33
33
|
return (0, shared_1.extend)({}, rpx2unit);
|
|
34
34
|
});
|
|
35
|
+
// 获取配置的小程序原生组件
|
|
36
|
+
function getNativeTags(inputDir, platform) {
|
|
37
|
+
if (!inputDir || !platform) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const manifestJson = (0, exports.parseManifestJsonOnce)(inputDir);
|
|
41
|
+
const platformOptions = getPlatformManifestJson(manifestJson, platform);
|
|
42
|
+
return platformOptions?.nativeTags || [];
|
|
43
|
+
}
|
|
44
|
+
exports.getNativeTags = getNativeTags;
|
|
35
45
|
function parseCompatConfig(_inputDir) {
|
|
36
46
|
// 不支持 mode:2
|
|
37
47
|
return { MODE: 3 }; //parseManifestJsonOnce(inputDir).compatConfig || {}
|
package/dist/json/mp/jsonFile.js
CHANGED
|
@@ -10,6 +10,7 @@ const shared_1 = require("@vue/shared");
|
|
|
10
10
|
const utils_1 = require("../../utils");
|
|
11
11
|
const resolve_1 = require("../../resolve");
|
|
12
12
|
const utils_2 = require("../../vue/utils");
|
|
13
|
+
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
13
14
|
let appJsonCache = {};
|
|
14
15
|
const jsonFilesCache = new Map();
|
|
15
16
|
const jsonPagesCache = new Map();
|
|
@@ -93,8 +94,10 @@ function findChangedJsonFiles(supportGlobalUsingComponents = true) {
|
|
|
93
94
|
findChangedFile(name, jsonsCache.get(name));
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
if (process.env.UNI_COMPILE_TARGET !== 'uni_modules') {
|
|
98
|
+
findChangedFile('app', appJsonCache);
|
|
99
|
+
findChangedFiles(jsonPagesCache);
|
|
100
|
+
}
|
|
98
101
|
findChangedFiles(jsonComponentsCache);
|
|
99
102
|
return changedJsonFiles;
|
|
100
103
|
}
|
|
@@ -121,7 +124,14 @@ function isMiniProgramUsingComponent(name, options) {
|
|
|
121
124
|
exports.isMiniProgramUsingComponent = isMiniProgramUsingComponent;
|
|
122
125
|
function findMiniProgramUsingComponents({ filename, inputDir, componentsDir, }) {
|
|
123
126
|
const globalUsingComponents = appJsonCache && appJsonCache.usingComponents;
|
|
124
|
-
|
|
127
|
+
// 避免 uniad 相关插件 被当作 vue 组件处理
|
|
128
|
+
const enableUniAdPlugin = process.env.UNI_PLATFORM === 'mp-weixin';
|
|
129
|
+
const miniProgramComponents = enableUniAdPlugin
|
|
130
|
+
? uni_shared_1.UNI_AD_PLUGINS.reduce((acc, name) => {
|
|
131
|
+
acc[name] = 'plugin';
|
|
132
|
+
return acc;
|
|
133
|
+
}, {})
|
|
134
|
+
: {};
|
|
125
135
|
if (globalUsingComponents) {
|
|
126
136
|
(0, shared_1.extend)(miniProgramComponents, findMiniProgramUsingComponent(globalUsingComponents, componentsDir));
|
|
127
137
|
}
|
package/dist/json/mp/pages.js
CHANGED
package/dist/json/mp/types.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ interface SubPackage {
|
|
|
37
37
|
root: string;
|
|
38
38
|
pages: string[];
|
|
39
39
|
independent?: boolean;
|
|
40
|
+
plugins?: Plugins;
|
|
40
41
|
}
|
|
41
42
|
interface TabBarItem {
|
|
42
43
|
pagePath: string;
|
|
@@ -63,6 +64,8 @@ interface Plugins {
|
|
|
63
64
|
[name: string]: {
|
|
64
65
|
version: string;
|
|
65
66
|
provider: string;
|
|
67
|
+
export?: string;
|
|
68
|
+
lazy?: boolean;
|
|
66
69
|
};
|
|
67
70
|
}
|
|
68
71
|
interface PreloadRule {
|
|
@@ -101,7 +104,10 @@ export interface AppJson {
|
|
|
101
104
|
debug?: boolean;
|
|
102
105
|
functionalPages?: boolean;
|
|
103
106
|
subPackages?: SubPackage[];
|
|
104
|
-
workers?: string
|
|
107
|
+
workers?: string | {
|
|
108
|
+
path: string;
|
|
109
|
+
isSubpackage: boolean;
|
|
110
|
+
};
|
|
105
111
|
requiredBackgroundModes?: string[];
|
|
106
112
|
plugins?: Plugins;
|
|
107
113
|
preloadRule?: PreloadRule;
|
package/dist/json/theme.js
CHANGED
|
@@ -8,7 +8,6 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const json_1 = require("./json");
|
|
10
10
|
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
11
|
-
const manifest_1 = require("./manifest");
|
|
12
11
|
function hasThemeJson(themeLocation) {
|
|
13
12
|
if (!fs_1.default.existsSync(themeLocation)) {
|
|
14
13
|
return false;
|
|
@@ -84,9 +83,7 @@ exports.normalizeThemeConfigOnce = (0, uni_shared_1.once)((manifestJsonPlatform
|
|
|
84
83
|
return themeConfig;
|
|
85
84
|
});
|
|
86
85
|
function initTheme(manifestJson, pagesJson) {
|
|
87
|
-
const
|
|
88
|
-
const manifestPlatform = (0, manifest_1.getPlatformManifestJson)(manifestJson, platform) || {};
|
|
89
|
-
const themeConfig = (0, exports.normalizeThemeConfigOnce)(manifestPlatform);
|
|
86
|
+
const themeConfig = (0, exports.normalizeThemeConfigOnce)(manifestJson);
|
|
90
87
|
return (0, uni_shared_1.normalizeStyles)(pagesJson, themeConfig);
|
|
91
88
|
}
|
|
92
89
|
exports.initTheme = initTheme;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare function parseUniXFlexDirection(manifestJson: Record<string, any>): any;
|
|
2
2
|
export declare function parseUniXSplashScreen(platform: 'app-android' | 'app-ios' | 'app-harmony', manifestJson: Record<string, any>): false | object;
|
|
3
|
+
export declare function parseUniXAppAndroidPackage(appid: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseUniXSplashScreen = exports.parseUniXFlexDirection = void 0;
|
|
3
|
+
exports.parseUniXAppAndroidPackage = exports.parseUniXSplashScreen = exports.parseUniXFlexDirection = void 0;
|
|
4
4
|
const shared_1 = require("@vue/shared");
|
|
5
5
|
const flexDirs = ['row', 'row-reverse', 'column', 'column-reverse'];
|
|
6
6
|
function parseUniXFlexDirection(manifestJson) {
|
|
@@ -19,3 +19,7 @@ function parseUniXSplashScreen(platform, manifestJson) {
|
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
21
|
exports.parseUniXSplashScreen = parseUniXSplashScreen;
|
|
22
|
+
function parseUniXAppAndroidPackage(appid) {
|
|
23
|
+
return 'uni.' + appid.replace(/_/g, '');
|
|
24
|
+
}
|
|
25
|
+
exports.parseUniXAppAndroidPackage = parseUniXAppAndroidPackage;
|
package/dist/messages/zh_CN.js
CHANGED
|
@@ -44,6 +44,7 @@ exports.default = {
|
|
|
44
44
|
'prompt.run.devtools.quickapp-webview-huawei': '华为快应用开发者工具',
|
|
45
45
|
'prompt.run.devtools.quickapp-webview-union': '快应用联盟开发者工具',
|
|
46
46
|
'uvue.unsupported': 'uvue 暂不支持 {platform} 平台',
|
|
47
|
+
// 重要:HBuilderX也会用到,如果调整了文案,需要同步调整HBuilderX的文案
|
|
47
48
|
'uvue.dev.watching.end.empty': '本次代码变更,编译结果未发生变化,跳过同步手机端程序文件。',
|
|
48
49
|
'uni_modules.import': '插件[{0}]仅支持 @/uni_modules/{1} 方式引入,不支持直接导入内部文件 {2}。',
|
|
49
50
|
'pages.json.page.notfound': '页面"{pagePath}"不存在,请确保填写的页面路径不包含文件后缀,且必须与真实的文件路径大小写保持一致。',
|