@dcloudio/uni-cli-shared 3.0.0-alpha-5020620260914001 → 3.0.0-alpha-5030120260930001
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/dom2/script.js +8 -1
- package/dist/dom2/sharedData.d.ts +1 -0
- package/dist/dom2/sharedData.js +5 -0
- package/dist/hbx/alias.d.ts +3 -0
- package/dist/hbx/alias.js +170 -42
- package/dist/hbx/env.js +1 -1
- package/dist/hbx/index.d.ts +2 -1
- package/dist/hbx/index.js +6 -1
- package/dist/hbx/pluginPaths.d.ts +1 -0
- package/dist/hbx/pluginPaths.js +31 -0
- package/dist/hbx/utils.js +7 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/json/manifest.d.ts +3 -0
- package/dist/json/manifest.js +13 -1
- package/dist/json/mp/jsonFile.d.ts +8 -1
- package/dist/json/mp/jsonFile.js +171 -13
- package/dist/json/uni-x/index.d.ts +1 -0
- package/dist/json/uni-x/index.js +4 -0
- package/dist/json/uni-x/uniConfig.d.ts +1 -0
- package/dist/json/uni-x/uniConfig.js +5 -0
- package/dist/messages/en.d.ts +4 -0
- package/dist/messages/en.js +7 -0
- package/dist/messages/index.d.ts +8 -0
- package/dist/messages/zh_CN.d.ts +4 -0
- package/dist/messages/zh_CN.js +7 -0
- package/dist/mp/index.d.ts +1 -0
- package/dist/mp/index.js +1 -0
- package/dist/mp/uasm.d.ts +37 -0
- package/dist/mp/uasm.js +228 -0
- package/dist/mp/usingComponents.d.ts +3 -3
- package/dist/mp/usingComponents.js +29 -9
- package/dist/postcss/plugins/alipayPageBackground.d.ts +3 -0
- package/dist/postcss/plugins/alipayPageBackground.js +125 -0
- package/dist/postcss/plugins/constants.d.ts +1 -0
- package/dist/postcss/plugins/constants.js +14 -0
- package/dist/postcss/plugins/stylePluginExternal.js +3 -1
- package/dist/postcss/plugins/uniapp.js +17 -20
- package/dist/preprocess/context.js +6 -0
- package/dist/resolve.js +5 -0
- package/dist/uasm.d.ts +7 -0
- package/dist/uasm.js +74 -12
- package/dist/uni_modules.cloud.js +2 -1
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +25 -5
- package/dist/uts/extApi.js +2 -1
- package/dist/uts/scriptMacros.d.ts +13 -0
- package/dist/uts/scriptMacros.js +52 -0
- package/dist/uts.js +9 -2
- package/dist/vite/autoImport.js +8 -2
- package/dist/vite/cloud.js +12 -1
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/plugins/index.d.ts +1 -0
- package/dist/vite/plugins/index.js +1 -0
- package/dist/vite/plugins/stats.js +9 -0
- package/dist/vite/plugins/uts/standardScript.d.ts +17 -0
- package/dist/vite/plugins/uts/standardScript.js +150 -0
- package/dist/vite/plugins/uts/uni_modules.js +16 -5
- package/dist/vite/plugins/uts/uvue.d.ts +5 -1
- package/dist/vite/plugins/uts/uvue.js +36 -33
- package/dist/vite/plugins/vitejs/plugins/css.d.ts +2 -1
- package/dist/vite/plugins/vitejs/plugins/css.js +2 -1
- package/dist/vue/transforms/index.d.ts +1 -0
- package/dist/vue/transforms/index.js +1 -0
- package/dist/vue/transforms/transformTeleport.js +18 -1
- package/dist/vue/transforms/x/transformVHtml.d.ts +6 -0
- package/dist/vue/transforms/x/transformVHtml.js +62 -0
- package/dist/workers.d.ts +34 -1
- package/dist/workers.js +131 -23
- package/dist/x.d.ts +4 -0
- package/dist/x.js +19 -1
- package/lib/@vue/compiler-core/dist/compiler-core.cjs.js +16 -23
- package/lib/@vue/compiler-core/dist/compiler-core.cjs.prod.js +16 -23
- package/lib/@vue/compiler-core/dist/compiler-core.esm-bundler.js +16 -23
- package/lib/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +23 -66
- package/lib/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +67 -115
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.cjs +22 -3
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.d.cts +4 -1
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.d.mts +4 -1
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.d.ts +4 -1
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.mjs +22 -3
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.js +249 -237
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.prod.js +235 -230
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.d.ts +252 -285
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.esm-bundler.js +159 -162
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.js +50 -50
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +49 -49
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.d.ts +10 -11
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +212 -216
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +6 -6
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +49 -49
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.js +212 -216
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.prod.js +6 -6
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +732 -406
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.d.ts +138 -137
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +1854 -1400
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +595 -419
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.d.ts +476 -421
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +972 -733
- package/lib/dom2/app/@vue/compiler-vapor-dom2/dist/compiler-vapor-dom2.cjs.js +1 -1
- package/lib/dom2/app/@vue/shared/dist/shared.cjs.js +100 -42
- package/lib/dom2/app/@vue/shared/dist/shared.cjs.prod.js +100 -42
- package/lib/dom2/app/@vue/shared/dist/shared.d.ts +260 -242
- package/lib/dom2/app/@vue/shared/dist/shared.esm-bundler.js +97 -43
- package/lib/dom2/web/@vitejs/plugin-vue/dist/index.cjs +1826 -0
- package/lib/dom2/web/@vitejs/plugin-vue/dist/index.d.cts +127 -0
- package/lib/dom2/web/@vitejs/plugin-vue/dist/index.d.mts +127 -0
- package/lib/dom2/web/@vitejs/plugin-vue/dist/index.mjs +1795 -0
- package/lib/dom2/web/@vitejs/plugin-vue/package.json +67 -0
- package/lib/dom2/web/@vue/compiler-core/dist/compiler-core.cjs.js +5547 -0
- package/lib/dom2/web/@vue/compiler-core/dist/compiler-core.cjs.prod.js +5484 -0
- package/lib/dom2/web/@vue/compiler-core/dist/compiler-core.d.ts +1144 -0
- package/lib/dom2/web/@vue/compiler-core/dist/compiler-core.esm-bundler.js +4354 -0
- package/lib/dom2/web/@vue/compiler-core/index.js +7 -0
- package/lib/dom2/web/@vue/compiler-core/package.json +58 -0
- package/lib/dom2/web/@vue/compiler-dom/dist/compiler-dom.cjs.js +760 -0
- package/lib/dom2/web/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +735 -0
- package/lib/dom2/web/@vue/compiler-dom/dist/compiler-dom.d.ts +72 -0
- package/lib/dom2/web/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +5051 -0
- package/lib/dom2/web/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +11 -0
- package/lib/dom2/web/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +548 -0
- package/lib/dom2/web/@vue/compiler-dom/dist/compiler-dom.global.js +5232 -0
- package/lib/dom2/web/@vue/compiler-dom/dist/compiler-dom.global.prod.js +11 -0
- package/lib/dom2/web/@vue/compiler-dom/index.js +7 -0
- package/lib/dom2/web/@vue/compiler-dom/package.json +57 -0
- package/lib/dom2/web/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +16243 -0
- package/lib/dom2/web/@vue/compiler-sfc/dist/compiler-sfc.d.ts +11680 -0
- package/lib/dom2/web/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +43922 -0
- package/lib/dom2/web/@vue/compiler-sfc/package.json +68 -0
- package/lib/dom2/web/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +880 -0
- package/lib/dom2/web/@vue/compiler-ssr/dist/compiler-ssr.d.ts +9 -0
- package/lib/dom2/web/@vue/compiler-ssr/package.json +34 -0
- package/lib/dom2/web/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +5066 -0
- package/lib/dom2/web/@vue/compiler-vapor/dist/compiler-vapor.d.ts +28814 -0
- package/lib/dom2/web/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +24098 -0
- package/lib/dom2/web/@vue/compiler-vapor/package.json +51 -0
- package/lib/dom2/web/@vue/compiler-vapor-web/dist/compiler-vapor-web.cjs.js +327 -0
- package/lib/dom2/web/@vue/compiler-vapor-web/dist/compiler-vapor-web.d.ts +14 -0
- package/lib/dom2/web/@vue/compiler-vapor-web/package.json +38 -0
- package/lib/dom2/web/@vue/server-renderer/dist/server-renderer.cjs.js +715 -0
- package/lib/dom2/web/@vue/server-renderer/dist/server-renderer.cjs.prod.js +702 -0
- package/lib/dom2/web/@vue/server-renderer/dist/server-renderer.d.ts +76 -0
- package/lib/dom2/web/@vue/server-renderer/dist/server-renderer.esm-browser.js +7265 -0
- package/lib/dom2/web/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js +7 -0
- package/lib/dom2/web/@vue/server-renderer/dist/server-renderer.esm-bundler.js +597 -0
- package/lib/dom2/web/@vue/server-renderer/index.js +7 -0
- package/lib/dom2/web/@vue/server-renderer/package.json +53 -0
- package/lib/dom2/web/@vue/shared/dist/shared.cjs.js +918 -0
- package/lib/dom2/web/@vue/shared/dist/shared.cjs.prod.js +918 -0
- package/lib/dom2/web/@vue/shared/dist/shared.d.ts +526 -0
- package/lib/dom2/web/@vue/shared/dist/shared.esm-bundler.js +821 -0
- package/lib/dom2/web/@vue/shared/index.js +7 -0
- package/lib/dom2/web/@vue/shared/package.json +47 -0
- package/lib/dom2/web/vue-router/dist/devtools-CLRpXhL7.js +1060 -0
- package/lib/dom2/web/vue-router/dist/useApi-CUgTH_jn.js +444 -0
- package/lib/dom2/web/vue-router/dist/vue-router.js +1671 -0
- package/package.json +8 -6
package/dist/dom2/script.js
CHANGED
|
@@ -4,16 +4,23 @@ exports.uniVaporScriptPlugin = void 0;
|
|
|
4
4
|
const uts_1 = require("../uts");
|
|
5
5
|
const extApi_1 = require("../uts/extApi");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
|
+
const scriptMacros_1 = require("../uts/scriptMacros");
|
|
7
8
|
const sharedData_1 = require("./sharedData");
|
|
8
9
|
function uniVaporScriptPlugin(options = {}) {
|
|
9
10
|
const { uasm, ...sharedData } = options;
|
|
10
11
|
const { D2SP } = (0, utils_1.requireUniHelpers)();
|
|
11
12
|
const nodeEnv = process.env.UNI_NODE_ENV || process.env.NODE_ENV;
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* 鸿蒙平台push、一键登录必须获取摇树结果,因此在非开发模式下或鸿蒙平台必须执行摇树逻辑
|
|
15
|
+
*/
|
|
16
|
+
const extApi = (0, utils_1.isNormalCompileTarget)() &&
|
|
17
|
+
(nodeEnv !== 'development' ||
|
|
18
|
+
process.env.UNI_UTS_PLATFORM === 'app-harmony')
|
|
13
19
|
? (0, extApi_1.initUts2jsExtApiOptions)()
|
|
14
20
|
: undefined;
|
|
15
21
|
return D2SP({
|
|
16
22
|
typescript: (0, uts_1.resolveUTSCompiler)().getTypeScript(),
|
|
23
|
+
createUniAppXScriptMacrosTransformer: scriptMacros_1.createUniAppXScriptMacrosTransformer,
|
|
17
24
|
extApi,
|
|
18
25
|
uasm,
|
|
19
26
|
sharedData: {
|
|
@@ -3,4 +3,5 @@ export declare function uniSharedDataPlugin(): Plugin;
|
|
|
3
3
|
export declare function initSourceFileCallback(): ((sourceFile: import('typescript').SourceFile) => void) | undefined;
|
|
4
4
|
export declare function initUts2jsSharedDataOptions(): {
|
|
5
5
|
resolveFieldMeta: any;
|
|
6
|
+
createSharedDataTransformer: any;
|
|
6
7
|
} | undefined;
|
package/dist/dom2/sharedData.js
CHANGED
|
@@ -45,9 +45,14 @@ function initSourceFileCallback() {
|
|
|
45
45
|
exports.initSourceFileCallback = initSourceFileCallback;
|
|
46
46
|
function initUts2jsSharedDataOptions() {
|
|
47
47
|
if (process.env.UNI_APP_X_DOM2 === 'true') {
|
|
48
|
+
const uniHelpers = (0, utils_1.requireUniHelpers)();
|
|
49
|
+
if (typeof uniHelpers.CSDT !== 'function') {
|
|
50
|
+
throw new Error('DOM2 requires the SharedData transformer (CSDT)');
|
|
51
|
+
}
|
|
48
52
|
return {
|
|
49
53
|
resolveFieldMeta: require('@dcloudio/compiler-vapor-dom2')
|
|
50
54
|
.resolveSharedDataFieldMeta,
|
|
55
|
+
createSharedDataTransformer: uniHelpers.CSDT,
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
58
|
}
|
package/dist/hbx/alias.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { Formatter } from '../logs/format';
|
|
2
|
+
export declare function resolveWebVaporPackage(packageName: string): string;
|
|
3
|
+
export declare function initWebVaporAliases(): void;
|
|
4
|
+
export declare function normalizeUniAppXVaporEnv(): void;
|
|
2
5
|
export declare function initModuleAlias(): void;
|
|
3
6
|
export declare function installHBuilderXPlugin(plugin: string): void;
|
|
4
7
|
export declare const moduleAliasFormatter: Formatter;
|
package/dist/hbx/alias.js
CHANGED
|
@@ -3,22 +3,166 @@ 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.formatInstallHBuilderXPluginTips = exports.moduleAliasFormatter = exports.installHBuilderXPlugin = exports.initModuleAlias = void 0;
|
|
6
|
+
exports.formatInstallHBuilderXPluginTips = exports.moduleAliasFormatter = exports.installHBuilderXPlugin = exports.initModuleAlias = exports.normalizeUniAppXVaporEnv = exports.initWebVaporAliases = exports.resolveWebVaporPackage = void 0;
|
|
7
7
|
// 注意:该文件尽可能少依赖其他文件,否则可能会导致还没有alias的时候,就加载了目标模块
|
|
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");
|
|
12
|
+
const pluginPaths_1 = require("./pluginPaths");
|
|
11
13
|
const hbxPlugins = {
|
|
12
|
-
typescript: 'compile-typescript
|
|
13
|
-
less: 'compile-less
|
|
14
|
-
sass: 'compile-dart-sass
|
|
15
|
-
stylus: 'compile-stylus
|
|
16
|
-
pug: 'compile-pug-cli
|
|
14
|
+
typescript: ['compile-typescript', 'node_modules/typescript'],
|
|
15
|
+
less: ['compile-less', 'node_modules/less'],
|
|
16
|
+
sass: ['compile-dart-sass', 'node_modules/sass'],
|
|
17
|
+
stylus: ['compile-stylus', 'node_modules/stylus'],
|
|
18
|
+
pug: ['compile-pug-cli', 'node_modules/pug'],
|
|
17
19
|
};
|
|
20
|
+
const commonVuePackages = [
|
|
21
|
+
'@vue/compiler-core',
|
|
22
|
+
'@vue/compiler-dom',
|
|
23
|
+
'@vue/compiler-sfc',
|
|
24
|
+
'@vue/shared',
|
|
25
|
+
];
|
|
26
|
+
const vaporVuePackages = [...commonVuePackages, '@vue/compiler-vapor'];
|
|
27
|
+
const webVaporVuePackages = [
|
|
28
|
+
...commonVuePackages,
|
|
29
|
+
'@vue/compiler-ssr',
|
|
30
|
+
'@vue/compiler-vapor',
|
|
31
|
+
'@vue/server-renderer',
|
|
32
|
+
];
|
|
33
|
+
function addVaporVuePackageAliases(vueDir, packages) {
|
|
34
|
+
const aliases = {};
|
|
35
|
+
packages.forEach((pkg) => {
|
|
36
|
+
aliases[pkg] = path_1.default.resolve(vueDir, pkg.slice(pkg.lastIndexOf('/') + 1));
|
|
37
|
+
});
|
|
38
|
+
module_alias_1.default.addAliases(aliases);
|
|
39
|
+
}
|
|
40
|
+
function resolveWebVaporPackage(packageName) {
|
|
41
|
+
return path_1.default.resolve(__dirname, '../../lib/dom2/web', packageName);
|
|
42
|
+
}
|
|
43
|
+
exports.resolveWebVaporPackage = resolveWebVaporPackage;
|
|
44
|
+
function resolveWebVaporPluginVue() {
|
|
45
|
+
return resolveWebVaporPackage('@vitejs/plugin-vue/dist/index.cjs');
|
|
46
|
+
}
|
|
47
|
+
function initWebVaporAliases() {
|
|
48
|
+
const webDir = resolveWebVaporPackage('');
|
|
49
|
+
const webVueDir = path_1.default.join(webDir, '@vue');
|
|
50
|
+
addVaporVuePackageAliases(webVueDir, webVaporVuePackages);
|
|
51
|
+
module_alias_1.default.addAliases({
|
|
52
|
+
'@vitejs/plugin-vue': resolveWebVaporPluginVue(),
|
|
53
|
+
'@dcloudio/compiler-vapor-web': path_1.default.join(webVueDir, 'compiler-vapor-web'),
|
|
54
|
+
'vue/compiler-sfc': path_1.default.join(webVueDir, 'compiler-sfc'),
|
|
55
|
+
'vue/server-renderer': path_1.default.join(webVueDir, 'server-renderer'),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
exports.initWebVaporAliases = initWebVaporAliases;
|
|
59
|
+
function addAppVaporAliases(libDir) {
|
|
60
|
+
const appVueDir = path_1.default.resolve(libDir, 'dom2', 'app', '@vue');
|
|
61
|
+
addVaporVuePackageAliases(appVueDir, vaporVuePackages);
|
|
62
|
+
module_alias_1.default.addAliases({
|
|
63
|
+
'@vitejs/plugin-vue': path_1.default.resolve(libDir, 'dom2', 'app', '@vitejs', 'plugin-vue'),
|
|
64
|
+
'@dcloudio/compiler-vapor-dom2': path_1.default.join(appVueDir, 'compiler-vapor-dom2'),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function addNonVaporVuePackageAliases(libDir, compilerSfcPath, serverRendererPath) {
|
|
68
|
+
module_alias_1.default.addAliases({
|
|
69
|
+
'@vue/shared': require.resolve('@vue/shared'),
|
|
70
|
+
'@vue/shared/dist/shared.esm-bundler.js': require.resolve('@vue/shared/dist/shared.esm-bundler.js'),
|
|
71
|
+
'@vue/compiler-core': path_1.default.resolve(libDir, '@vue/compiler-core'),
|
|
72
|
+
'@vue/compiler-dom': require.resolve('@vue/compiler-dom'),
|
|
73
|
+
'@vue/compiler-sfc': compilerSfcPath,
|
|
74
|
+
'@vue/server-renderer': serverRendererPath,
|
|
75
|
+
'vue/compiler-sfc': compilerSfcPath,
|
|
76
|
+
'vue/server-renderer': serverRendererPath,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
18
79
|
function isWebOrMpPlatform(platform) {
|
|
19
80
|
return platform === 'h5' || platform === 'web' || platform?.startsWith('mp-');
|
|
20
81
|
}
|
|
82
|
+
function isWebPlatform(platform) {
|
|
83
|
+
return platform === 'h5' || platform === 'web';
|
|
84
|
+
}
|
|
85
|
+
function hasWebVaporConfig() {
|
|
86
|
+
// 框架自身生成 dist-x-vapor 时没有用户项目目录,通过内部构建标记绕过配置文件检查。
|
|
87
|
+
if (process.env.UNI_APP_X_VAPOR_BUILD === 'true') {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
// HBuilderX/CLI 会在加载框架前传入项目根目录。
|
|
91
|
+
const inputDir = process.env.UNI_INPUT_DIR;
|
|
92
|
+
return !!inputDir && fs_1.default.existsSync(path_1.default.resolve(inputDir, '.vapor'));
|
|
93
|
+
}
|
|
94
|
+
function resolveUniCliPlatform() {
|
|
95
|
+
const entry = process.argv[1];
|
|
96
|
+
if (!entry || !['uni', 'uni.js'].includes(path_1.default.basename(entry))) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const args = process.argv.slice(2);
|
|
100
|
+
for (let index = 0; index < args.length; index++) {
|
|
101
|
+
const arg = args[index];
|
|
102
|
+
if (arg === '--') {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (arg === '-p' || arg === '--platform') {
|
|
106
|
+
const platform = args[index + 1];
|
|
107
|
+
if (platform && !platform.startsWith('-')) {
|
|
108
|
+
return platform;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else if (arg.startsWith('-p=') || arg.startsWith('--platform=')) {
|
|
112
|
+
const platform = arg.slice(arg.indexOf('=') + 1);
|
|
113
|
+
if (platform) {
|
|
114
|
+
return platform;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return 'h5';
|
|
119
|
+
}
|
|
120
|
+
function normalizeUniAppXVaporEnv() {
|
|
121
|
+
// App 使用 UNI_APP_X_VAPOR 作为对外开关;Web 仅在项目根目录存在 .vapor 时启用。
|
|
122
|
+
const utsPlatform = process.env.UNI_UTS_PLATFORM;
|
|
123
|
+
const uniPlatform = process.env.UNI_PLATFORM;
|
|
124
|
+
const cliPlatform = resolveUniCliPlatform();
|
|
125
|
+
const platform = cliPlatform || utsPlatform || uniPlatform;
|
|
126
|
+
const webVaporConfigured = isWebPlatform(platform) && hasWebVaporConfig();
|
|
127
|
+
// Web 以项目根目录的 .vapor 作为显式开关。HBuilderX dev 不会预先注入
|
|
128
|
+
// UNI_APP_X,因此这里需要同步补齐 uni-app x 环境标记。
|
|
129
|
+
const isWebVapor = webVaporConfigured;
|
|
130
|
+
if (isWebVapor) {
|
|
131
|
+
process.env.UNI_APP_X = 'true';
|
|
132
|
+
}
|
|
133
|
+
if (process.env.UNI_APP_X_VAPOR === 'true' || isWebVapor) {
|
|
134
|
+
process.env.UNI_APP_X_DOM2 = 'true';
|
|
135
|
+
}
|
|
136
|
+
else if (process.env.UNI_APP_X_VAPOR === 'false') {
|
|
137
|
+
delete process.env.UNI_APP_X_DOM2;
|
|
138
|
+
}
|
|
139
|
+
// alias 初始化早于 CLI 环境初始化,优先读取 CLI 参数,否则使用预置的平台环境变量。
|
|
140
|
+
// 小程序仍关闭 Vapor,Web 平台使用独立的 Web Vapor 产物。
|
|
141
|
+
const shouldDisableVapor = cliPlatform
|
|
142
|
+
? isWebOrMpPlatform(cliPlatform) && !isWebVapor
|
|
143
|
+
: (isWebOrMpPlatform(utsPlatform) || isWebOrMpPlatform(uniPlatform)) &&
|
|
144
|
+
!isWebVapor;
|
|
145
|
+
if (shouldDisableVapor) {
|
|
146
|
+
delete process.env.UNI_APP_X_DOM2;
|
|
147
|
+
}
|
|
148
|
+
// 将平台归一化后的实际状态同步回对外开关。
|
|
149
|
+
if (isWebVapor) {
|
|
150
|
+
process.env.UNI_APP_X_VAPOR = 'true';
|
|
151
|
+
process.env.UNI_APP_X_DOM2 = 'true';
|
|
152
|
+
}
|
|
153
|
+
if (process.env.UNI_APP_X_DOM2 === 'true') {
|
|
154
|
+
process.env.UNI_APP_X_VAPOR = 'true';
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
delete process.env.UNI_APP_X_DOM2;
|
|
158
|
+
delete process.env.UNI_APP_X_VAPOR;
|
|
159
|
+
delete process.env.UNI_APP_X_DOM2_DYNAMIC;
|
|
160
|
+
delete process.env.UNI_APP_X_VAPOR_RENDER_TARGET;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.normalizeUniAppXVaporEnv = normalizeUniAppXVaporEnv;
|
|
21
164
|
function initModuleAlias() {
|
|
165
|
+
normalizeUniAppXVaporEnv();
|
|
22
166
|
const libDir = path_1.default.resolve(__dirname, '../../lib');
|
|
23
167
|
const compilerSfcPath = path_1.default.resolve(libDir, '@vue/compiler-sfc');
|
|
24
168
|
const serverRendererPath = require.resolve('@vue/server-renderer');
|
|
@@ -34,15 +178,14 @@ function initModuleAlias() {
|
|
|
34
178
|
process.env.UNI_APP_X_DOM2_CPP_DIR =
|
|
35
179
|
process.env.UNI_APP_HARMONY_DOM2_CPP_DIR;
|
|
36
180
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
delete process.env.UNI_APP_X_DOM2_DYNAMIC;
|
|
181
|
+
const platform = resolveUniCliPlatform() ||
|
|
182
|
+
process.env.UNI_UTS_PLATFORM ||
|
|
183
|
+
process.env.UNI_PLATFORM;
|
|
184
|
+
const webVapor = process.env.UNI_APP_X_VAPOR === 'true' && isWebPlatform(platform);
|
|
185
|
+
if (webVapor) {
|
|
186
|
+
initWebVaporAliases();
|
|
44
187
|
}
|
|
45
|
-
if (process.env.UNI_APP_X_DOM2 === 'true') {
|
|
188
|
+
else if (process.env.UNI_APP_X_DOM2 === 'true') {
|
|
46
189
|
if (process.env.UNI_OUTPUT_DIR &&
|
|
47
190
|
(process.env.UNI_PLATFORM === 'app' ||
|
|
48
191
|
process.env.UNI_PLATFORM === 'app-plus' ||
|
|
@@ -88,31 +231,11 @@ function initModuleAlias() {
|
|
|
88
231
|
}
|
|
89
232
|
}
|
|
90
233
|
}
|
|
91
|
-
if (process.env.UNI_APP_X_DOM2 === 'true') {
|
|
92
|
-
|
|
93
|
-
'@vue/compiler-core',
|
|
94
|
-
'@vue/compiler-dom',
|
|
95
|
-
'@vue/compiler-sfc',
|
|
96
|
-
'@vue/compiler-vapor',
|
|
97
|
-
'@vue/shared',
|
|
98
|
-
];
|
|
99
|
-
vuePkgs.forEach((pkg) => {
|
|
100
|
-
module_alias_1.default.addAlias(pkg, path_1.default.resolve(libDir, 'dom2', 'app', '@vue', pkg.split('/').pop()));
|
|
101
|
-
});
|
|
102
|
-
module_alias_1.default.addAlias('@vitejs/plugin-vue', path_1.default.resolve(libDir, 'dom2', 'app', '@vitejs', 'plugin-vue'));
|
|
103
|
-
module_alias_1.default.addAlias('@dcloudio/compiler-vapor-dom2', path_1.default.resolve(libDir, 'dom2', 'app', '@vue', 'compiler-vapor-dom2'));
|
|
234
|
+
if (process.env.UNI_APP_X_DOM2 === 'true' && !webVapor) {
|
|
235
|
+
addAppVaporAliases(libDir);
|
|
104
236
|
}
|
|
105
|
-
else {
|
|
106
|
-
|
|
107
|
-
'@vue/shared': require.resolve('@vue/shared'),
|
|
108
|
-
'@vue/shared/dist/shared.esm-bundler.js': require.resolve('@vue/shared/dist/shared.esm-bundler.js'),
|
|
109
|
-
'@vue/compiler-core': path_1.default.resolve(libDir, '@vue/compiler-core'),
|
|
110
|
-
'@vue/compiler-dom': require.resolve('@vue/compiler-dom'),
|
|
111
|
-
'@vue/compiler-sfc': compilerSfcPath,
|
|
112
|
-
'@vue/server-renderer': serverRendererPath,
|
|
113
|
-
'vue/compiler-sfc': compilerSfcPath,
|
|
114
|
-
'vue/server-renderer': serverRendererPath,
|
|
115
|
-
});
|
|
237
|
+
else if (!webVapor) {
|
|
238
|
+
addNonVaporVuePackageAliases(libDir, compilerSfcPath, serverRendererPath);
|
|
116
239
|
}
|
|
117
240
|
if (process.env.VITEST) {
|
|
118
241
|
module_alias_1.default.addAliases({
|
|
@@ -123,11 +246,15 @@ function initModuleAlias() {
|
|
|
123
246
|
if ((0, utils_1.isInHBuilderX)()) {
|
|
124
247
|
// 又是为了复用 HBuilderX 的插件逻辑,硬编码映射
|
|
125
248
|
Object.keys(hbxPlugins).forEach((lang) => {
|
|
126
|
-
const
|
|
249
|
+
const [pluginName, subpath] = hbxPlugins[lang];
|
|
250
|
+
const realPath = (0, pluginPaths_1.resolveHBuilderXPluginPath)(pluginName, subpath);
|
|
127
251
|
module_alias_1.default.addAlias(lang,
|
|
128
252
|
// @ts-expect-error
|
|
129
253
|
() => {
|
|
130
254
|
try {
|
|
255
|
+
if (!realPath) {
|
|
256
|
+
throw new Error(`HBuilder plugin "${pluginName}" is not found`);
|
|
257
|
+
}
|
|
131
258
|
require.resolve(realPath);
|
|
132
259
|
}
|
|
133
260
|
catch (e) {
|
|
@@ -139,8 +266,7 @@ function initModuleAlias() {
|
|
|
139
266
|
});
|
|
140
267
|
});
|
|
141
268
|
// web 平台用了 vite 内置 css 插件,该插件会加载预编译器如scss、less等,需要转向到 HBuilderX 的对应编译器插件
|
|
142
|
-
if (process.env.UNI_PLATFORM
|
|
143
|
-
process.env.UNI_PLATFORM === 'web') {
|
|
269
|
+
if (isWebPlatform(process.env.UNI_PLATFORM)) {
|
|
144
270
|
// https://github.com/vitejs/vite/blob/main/packages/vite/src/node/packages.ts#L92
|
|
145
271
|
// 拦截预编译器
|
|
146
272
|
const join = path_1.default.join;
|
|
@@ -154,7 +280,9 @@ function initModuleAlias() {
|
|
|
154
280
|
if (nodeModules === 'node_modules' &&
|
|
155
281
|
packageJson === 'package.json' &&
|
|
156
282
|
hbxPlugins[pkgName]) {
|
|
157
|
-
|
|
283
|
+
const [pluginName, subpath] = hbxPlugins[pkgName];
|
|
284
|
+
return ((0, pluginPaths_1.resolveHBuilderXPluginPath)(pluginName, subpath, packageJson) ||
|
|
285
|
+
join(...paths));
|
|
158
286
|
}
|
|
159
287
|
}
|
|
160
288
|
return join(...paths);
|
package/dist/hbx/env.js
CHANGED
|
@@ -15,7 +15,7 @@ const utils_2 = require("./utils");
|
|
|
15
15
|
var utils_3 = require("./utils");
|
|
16
16
|
Object.defineProperty(exports, "isInHBuilderX", { enumerable: true, get: function () { return utils_3.isInHBuilderX; } });
|
|
17
17
|
exports.runByHBuilderX = (0, uni_shared_1.once)(() => {
|
|
18
|
-
return (!!process.env.UNI_HBUILDERX_PLUGINS &&
|
|
18
|
+
return ((!!process.env.HX_PLUGIN_PATHS || !!process.env.UNI_HBUILDERX_PLUGINS) &&
|
|
19
19
|
(!!process.env.RUN_BY_HBUILDERX || !!process.env.HX_Version));
|
|
20
20
|
});
|
|
21
21
|
/**
|
package/dist/hbx/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { formatAtFilename, createErrorWithBlockFlag } from './log';
|
|
2
2
|
export * from './env';
|
|
3
|
-
export {
|
|
3
|
+
export { resolveHBuilderXPluginPath } from './pluginPaths';
|
|
4
|
+
export { initWebVaporAliases, resolveWebVaporPackage, initModuleAlias, normalizeUniAppXVaporEnv, installHBuilderXPlugin, formatInstallHBuilderXPluginTips, } from './alias';
|
|
4
5
|
export declare function uniHBuilderXConsolePlugin(method?: string): import("vite").Plugin<any>;
|
|
5
6
|
export declare function isEnableConsole(): boolean;
|
package/dist/hbx/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.isEnableConsole = exports.uniHBuilderXConsolePlugin = exports.formatInstallHBuilderXPluginTips = exports.installHBuilderXPlugin = exports.initModuleAlias = exports.createErrorWithBlockFlag = exports.formatAtFilename = void 0;
|
|
20
|
+
exports.isEnableConsole = exports.uniHBuilderXConsolePlugin = exports.formatInstallHBuilderXPluginTips = exports.installHBuilderXPlugin = exports.normalizeUniAppXVaporEnv = exports.initModuleAlias = exports.resolveWebVaporPackage = exports.initWebVaporAliases = exports.resolveHBuilderXPluginPath = exports.createErrorWithBlockFlag = exports.formatAtFilename = void 0;
|
|
21
21
|
const path_1 = __importDefault(require("path"));
|
|
22
22
|
const utils_1 = require("../utils");
|
|
23
23
|
const console_1 = require("../vite/plugins/console");
|
|
@@ -26,8 +26,13 @@ var log_1 = require("./log");
|
|
|
26
26
|
Object.defineProperty(exports, "formatAtFilename", { enumerable: true, get: function () { return log_1.formatAtFilename; } });
|
|
27
27
|
Object.defineProperty(exports, "createErrorWithBlockFlag", { enumerable: true, get: function () { return log_1.createErrorWithBlockFlag; } });
|
|
28
28
|
__exportStar(require("./env"), exports);
|
|
29
|
+
var pluginPaths_1 = require("./pluginPaths");
|
|
30
|
+
Object.defineProperty(exports, "resolveHBuilderXPluginPath", { enumerable: true, get: function () { return pluginPaths_1.resolveHBuilderXPluginPath; } });
|
|
29
31
|
var alias_1 = require("./alias");
|
|
32
|
+
Object.defineProperty(exports, "initWebVaporAliases", { enumerable: true, get: function () { return alias_1.initWebVaporAliases; } });
|
|
33
|
+
Object.defineProperty(exports, "resolveWebVaporPackage", { enumerable: true, get: function () { return alias_1.resolveWebVaporPackage; } });
|
|
30
34
|
Object.defineProperty(exports, "initModuleAlias", { enumerable: true, get: function () { return alias_1.initModuleAlias; } });
|
|
35
|
+
Object.defineProperty(exports, "normalizeUniAppXVaporEnv", { enumerable: true, get: function () { return alias_1.normalizeUniAppXVaporEnv; } });
|
|
31
36
|
Object.defineProperty(exports, "installHBuilderXPlugin", { enumerable: true, get: function () { return alias_1.installHBuilderXPlugin; } });
|
|
32
37
|
Object.defineProperty(exports, "formatInstallHBuilderXPluginTips", { enumerable: true, get: function () { return alias_1.formatInstallHBuilderXPluginTips; } });
|
|
33
38
|
function uniHBuilderXConsolePlugin(method = '__f__') {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveHBuilderXPluginPath(pluginName: string, ...subpaths: string[]): string | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.resolveHBuilderXPluginPath = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
9
|
+
const getHBuilderXPluginPaths = (0, uni_shared_1.once)(() => {
|
|
10
|
+
const raw = process.env.HX_PLUGIN_PATHS;
|
|
11
|
+
if (!raw) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const pluginPaths = JSON.parse(raw);
|
|
15
|
+
if (!pluginPaths ||
|
|
16
|
+
typeof pluginPaths !== 'object' ||
|
|
17
|
+
Array.isArray(pluginPaths)) {
|
|
18
|
+
throw new Error('Invalid HX_PLUGIN_PATHS');
|
|
19
|
+
}
|
|
20
|
+
return pluginPaths;
|
|
21
|
+
});
|
|
22
|
+
function resolveHBuilderXPluginPath(pluginName, ...subpaths) {
|
|
23
|
+
const pluginPaths = getHBuilderXPluginPaths();
|
|
24
|
+
const pluginPath = pluginPaths
|
|
25
|
+
? pluginPaths[pluginName]
|
|
26
|
+
: process.env.UNI_HBUILDERX_PLUGINS
|
|
27
|
+
? path_1.default.resolve(process.env.UNI_HBUILDERX_PLUGINS, pluginName)
|
|
28
|
+
: undefined;
|
|
29
|
+
return pluginPath ? path_1.default.resolve(pluginPath, ...subpaths) : undefined;
|
|
30
|
+
}
|
|
31
|
+
exports.resolveHBuilderXPluginPath = resolveHBuilderXPluginPath;
|
package/dist/hbx/utils.js
CHANGED
|
@@ -9,7 +9,10 @@ const uni_shared_1 = require("@dcloudio/uni-shared");
|
|
|
9
9
|
exports.isInHBuilderX = (0, uni_shared_1.once)(() => {
|
|
10
10
|
// 自动化测试传入了 HX_APP_ROOT(其实就是UNI_HBUILDERX_PLUGINS)
|
|
11
11
|
if (process.env.HX_APP_ROOT) {
|
|
12
|
-
process.env.UNI_HBUILDERX_PLUGINS = process.env.HX_APP_ROOT
|
|
12
|
+
process.env.UNI_HBUILDERX_PLUGINS = path_1.default.resolve(process.env.HX_APP_ROOT, 'plugins');
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
if (process.env.HX_PLUGIN_PATHS && process.env.UNI_HBUILDERX_PLUGINS) {
|
|
13
16
|
return true;
|
|
14
17
|
}
|
|
15
18
|
try {
|
|
@@ -22,5 +25,8 @@ exports.isInHBuilderX = (0, uni_shared_1.once)(() => {
|
|
|
22
25
|
catch (e) {
|
|
23
26
|
// console.error(e)
|
|
24
27
|
}
|
|
28
|
+
if (process.env.HX_PLUGIN_PATHS) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
25
31
|
return false;
|
|
26
32
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./ssr"), exports);
|
|
|
24
24
|
__exportStar(require("./vue"), exports);
|
|
25
25
|
__exportStar(require("./uts"), exports);
|
|
26
26
|
__exportStar(require("./uts/extApi"), exports);
|
|
27
|
+
__exportStar(require("./uts/scriptMacros"), exports);
|
|
27
28
|
__exportStar(require("./x"), exports);
|
|
28
29
|
__exportStar(require("./logs"), exports);
|
|
29
30
|
__exportStar(require("./dom2"), exports);
|
package/dist/json/manifest.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare const parseManifestJson: (inputDir: string) => any;
|
|
2
2
|
export declare const parseManifestJsonOnce: (inputDir: string) => any;
|
|
3
|
+
export type UniAppXVaporScriptLang = 'js' | 'ts' | 'uts';
|
|
4
|
+
export declare function resolveUniAppXVaporScriptLang(manifestJson: Record<string, any>): UniAppXVaporScriptLang;
|
|
5
|
+
export declare function getUniAppXVaporScriptLang(inputDir?: string): UniAppXVaporScriptLang;
|
|
3
6
|
export declare const parseRpx2UnitOnce: (inputDir: string, platform?: UniApp.PLATFORM) => any;
|
|
4
7
|
export declare function getNativeTags(inputDir?: string, platform?: UniApp.PLATFORM): any;
|
|
5
8
|
interface CompilerCompatConfig {
|
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.getNativeTags = 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.getUniAppXVaporScriptLang = exports.resolveUniAppXVaporScriptLang = 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");
|
|
@@ -21,6 +21,18 @@ const parseManifestJson = (inputDir) => {
|
|
|
21
21
|
};
|
|
22
22
|
exports.parseManifestJson = parseManifestJson;
|
|
23
23
|
exports.parseManifestJsonOnce = (0, uni_shared_1.once)(exports.parseManifestJson);
|
|
24
|
+
function resolveUniAppXVaporScriptLang(manifestJson) {
|
|
25
|
+
const lang = manifestJson['uni-app-x']?.['vapor-default-script-lang'];
|
|
26
|
+
return lang === 'js' || lang === 'ts' || lang === 'uts' ? lang : 'ts';
|
|
27
|
+
}
|
|
28
|
+
exports.resolveUniAppXVaporScriptLang = resolveUniAppXVaporScriptLang;
|
|
29
|
+
function getUniAppXVaporScriptLang(inputDir) {
|
|
30
|
+
if (!inputDir) {
|
|
31
|
+
return 'ts';
|
|
32
|
+
}
|
|
33
|
+
return resolveUniAppXVaporScriptLang((0, exports.parseManifestJsonOnce)(inputDir));
|
|
34
|
+
}
|
|
35
|
+
exports.getUniAppXVaporScriptLang = getUniAppXVaporScriptLang;
|
|
24
36
|
exports.parseRpx2UnitOnce = (0, uni_shared_1.once)((inputDir, platform = 'h5') => {
|
|
25
37
|
const rpx2unit = platform === 'h5' || platform === 'app' || platform === 'app-harmony'
|
|
26
38
|
? uni_shared_1.defaultRpx2Unit
|
|
@@ -5,9 +5,16 @@ export declare function hasJsonFile(filename: string): boolean;
|
|
|
5
5
|
export declare function getComponentJsonFilenames(): string[];
|
|
6
6
|
export declare function findJsonFile(filename: string): Record<string, any> | ComponentJson | PageWindowOptions | undefined;
|
|
7
7
|
export declare function findUsingComponents(filename: string): UsingComponents | undefined;
|
|
8
|
+
export declare function findMiniProgramSubPackageRoot(filename: string): string | undefined;
|
|
9
|
+
export declare function addMiniProgramComponentPackageRoot(filename: string, packageRoot?: string): void;
|
|
10
|
+
export declare function findMiniProgramComponentPackageRoot(filename: string): string | undefined;
|
|
11
|
+
export declare function findMiniProgramComponentPackageRoots(filename: string): (string | undefined)[] | undefined;
|
|
12
|
+
export declare function resolveMiniProgramComponentPackageRoot(filename: string, packageRoot?: string): string | undefined;
|
|
8
13
|
export declare function normalizeJsonFilename(filename: string): string;
|
|
9
14
|
export declare function findChangedJsonFiles(supportGlobalUsingComponents?: boolean | ((filename: string) => boolean)): Map<string, string>;
|
|
10
|
-
export declare function addMiniProgramAppJson(appJson: Record<string, any
|
|
15
|
+
export declare function addMiniProgramAppJson(appJson: Record<string, any>, options?: {
|
|
16
|
+
subPackages?: boolean;
|
|
17
|
+
}): void;
|
|
11
18
|
export declare function addMiniProgramPageJson(filename: string, json: PageWindowOptions): void;
|
|
12
19
|
export declare function addMiniProgramComponentJson(filename: string, json: ComponentJson): void;
|
|
13
20
|
export declare function addMiniProgramUsingComponents(filename: string, json: UsingComponents): void;
|