@dcloudio/uni-cli-shared 3.0.0-alpha-1000920260525733 → 3.0.0-alpha-5010120260525001
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/hbx/alias.js +2 -21
- package/dist/json/app/pages/definePage.js +1 -1
- package/dist/logs/console.js +1 -4
- package/dist/messages/en.d.ts +1 -0
- package/dist/messages/en.js +1 -0
- package/dist/messages/index.d.ts +2 -0
- package/dist/messages/zh_CN.d.ts +1 -0
- package/dist/messages/zh_CN.js +1 -0
- package/dist/vite/cloud.js +0 -2
- package/dist/vite/plugins/console.js +1 -2
- package/dist/vite/plugins/inject.js +2 -7
- package/dist/vite/plugins/sfc.js +1 -4
- package/dist/vite/plugins/stats.js +26 -0
- package/dist/vite/plugins/vitejs/plugins/asset.d.ts +0 -1
- package/dist/vite/plugins/vitejs/plugins/asset.js +1 -6
- package/dist/vite/plugins/vitejs/plugins/css.js +1 -5
- package/dist/vue/transforms/x/transformDirection.js +33 -4
- package/dist/watcher.d.ts +0 -1
- package/dist/x.d.ts +0 -1
- package/dist/x.js +1 -5
- package/lib/@vue/compiler-core/dist/compiler-core.cjs.js +23 -16
- package/lib/@vue/compiler-core/dist/compiler-core.cjs.prod.js +23 -16
- package/lib/@vue/compiler-core/dist/compiler-core.esm-bundler.js +23 -16
- package/lib/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +66 -23
- package/lib/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +115 -67
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.js +1 -1
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.prod.js +1 -1
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.esm-bundler.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.js +1 -1
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.prod.js +1 -1
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +3 -3
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +201 -43
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +199 -41
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.d.ts +50 -12
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +212 -42
- 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 +1 -1
- package/lib/dom2/app/@vue/shared/dist/shared.cjs.prod.js +1 -1
- package/lib/dom2/app/@vue/shared/dist/shared.esm-bundler.js +1 -1
- package/package.json +8 -7
package/dist/hbx/alias.js
CHANGED
|
@@ -78,27 +78,8 @@ function initModuleAlias() {
|
|
|
78
78
|
if (process.env.UNI_APP_PLATFORM ||
|
|
79
79
|
process.env.UNI_PLATFORM === 'app-harmony') {
|
|
80
80
|
if (!process.env.UNI_APP_X_VAPOR_RENDER_TARGET) {
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
process.env.UNI_APP_PLATFORM === 'harmony' ||
|
|
84
|
-
process.env.UNI_PLATFORM === 'app-harmony') {
|
|
85
|
-
if (process.env.UNI_INPUT_DIR &&
|
|
86
|
-
fs_1.default.existsSync(path_1.default.resolve(process.env.UNI_INPUT_DIR, '.native'))) {
|
|
87
|
-
process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'nativecode';
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'bytecode';
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
if (process.env.UNI_INPUT_DIR &&
|
|
95
|
-
fs_1.default.existsSync(path_1.default.resolve(process.env.UNI_INPUT_DIR, '.dynamic'))) {
|
|
96
|
-
process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'bytecode';
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'nativecode';
|
|
100
|
-
}
|
|
101
|
-
}
|
|
81
|
+
// 默认 app 平台使用 bytecode 目标
|
|
82
|
+
process.env.UNI_APP_X_VAPOR_RENDER_TARGET = 'bytecode';
|
|
102
83
|
}
|
|
103
84
|
if (process.env.UNI_APP_X_VAPOR_RENDER_TARGET?.includes('bytecode')) {
|
|
104
85
|
process.env.UNI_APP_X_DOM2_DYNAMIC = 'true';
|
|
@@ -46,7 +46,7 @@ function defineNVuePageCode(pagesJson) {
|
|
|
46
46
|
}
|
|
47
47
|
const pagePathWithExtname = (0, utils_1.normalizePagePath)(page.path, 'app');
|
|
48
48
|
if (pagePathWithExtname) {
|
|
49
|
-
importNVuePagesCode.push(`import('./${pagePathWithExtname}').then((res)=>res
|
|
49
|
+
importNVuePagesCode.push(`import('./${pagePathWithExtname}').then((res)=>{res()})`);
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
return importNVuePagesCode.join('\n');
|
package/dist/logs/console.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.appendConsoleExpr = exports.restoreConsoleExpr = exports.rewriteConsoleExpr = void 0;
|
|
7
7
|
const magic_string_1 = __importDefault(require("magic-string"));
|
|
8
8
|
const utils_1 = require("../utils");
|
|
9
|
-
const x_1 = require("../x");
|
|
10
9
|
function rewriteConsoleExpr(method, id, filename, code, sourceMap = false) {
|
|
11
10
|
filename = (0, utils_1.normalizePath)(filename);
|
|
12
11
|
const re = /(console\.(log|info|debug|warn|error))\s*\(([^)]+)\)/g;
|
|
@@ -20,9 +19,7 @@ function rewriteConsoleExpr(method, id, filename, code, sourceMap = false) {
|
|
|
20
19
|
if (s.hasChanged()) {
|
|
21
20
|
return {
|
|
22
21
|
code: s.toString(),
|
|
23
|
-
map: sourceMap
|
|
24
|
-
? s.generateMap({ hires: (0, x_1.shouldUseHighResolutionSourceMap)() })
|
|
25
|
-
: { mappings: '' },
|
|
22
|
+
map: sourceMap ? s.generateMap({ hires: true }) : { mappings: '' },
|
|
26
23
|
};
|
|
27
24
|
}
|
|
28
25
|
return { code, map: null };
|
package/dist/messages/en.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
|
|
16
16
|
readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
|
|
17
17
|
readonly 'dev.watching.restart.vapor': "DONE Restart required. Switching vapor mode requires restarting to take effect.";
|
|
18
|
+
readonly 'dev.watching.vapor.render.target': "vapor-render-target in manifest.json was changed to {manifestTarget}, but the running console is still {runtimeTarget}.";
|
|
18
19
|
readonly 'build.failed': "DONE Build failed.";
|
|
19
20
|
readonly 'compiler.build.failed': "Build failed with errors.";
|
|
20
21
|
readonly 'stat.warn.appid': "The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303";
|
package/dist/messages/en.js
CHANGED
|
@@ -17,6 +17,7 @@ exports.default = {
|
|
|
17
17
|
'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
|
|
18
18
|
'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
|
|
19
19
|
'dev.watching.restart.vapor': 'DONE Restart required. Switching vapor mode requires restarting to take effect.',
|
|
20
|
+
'dev.watching.vapor.render.target': 'vapor-render-target in manifest.json was changed to {manifestTarget}, but the running console is still {runtimeTarget}.',
|
|
20
21
|
'build.failed': 'DONE Build failed.',
|
|
21
22
|
'compiler.build.failed': 'Build failed with errors.',
|
|
22
23
|
'stat.warn.appid': 'The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303',
|
package/dist/messages/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const M: {
|
|
|
15
15
|
readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
|
|
16
16
|
readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
|
|
17
17
|
readonly 'dev.watching.restart.vapor': "DONE Restart required. 切换蒸汽模式需要重新运行才能生效。";
|
|
18
|
+
readonly 'dev.watching.vapor.render.target': "manifest.json 中更改了视图层编译目标为{manifestTarget},但注意运行控制台还是{runtimeTarget}。";
|
|
18
19
|
readonly 'build.failed': "DONE Build failed.";
|
|
19
20
|
readonly 'compiler.build.failed': "编译失败";
|
|
20
21
|
readonly 'stat.warn.appid': "当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303";
|
|
@@ -71,6 +72,7 @@ export declare const M: {
|
|
|
71
72
|
readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
|
|
72
73
|
readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
|
|
73
74
|
readonly 'dev.watching.restart.vapor': "DONE Restart required. Switching vapor mode requires restarting to take effect.";
|
|
75
|
+
readonly 'dev.watching.vapor.render.target': "vapor-render-target in manifest.json was changed to {manifestTarget}, but the running console is still {runtimeTarget}.";
|
|
74
76
|
readonly 'build.failed': "DONE Build failed.";
|
|
75
77
|
readonly 'compiler.build.failed': "Build failed with errors.";
|
|
76
78
|
readonly 'stat.warn.appid': "The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303";
|
package/dist/messages/zh_CN.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
readonly 'dev.watching.end.pages': "DONE Build complete. PAGES:{pages}";
|
|
16
16
|
readonly 'dev.watching.end.files': "DONE Build complete. FILES:{files}";
|
|
17
17
|
readonly 'dev.watching.restart.vapor': "DONE Restart required. 切换蒸汽模式需要重新运行才能生效。";
|
|
18
|
+
readonly 'dev.watching.vapor.render.target': "manifest.json 中更改了视图层编译目标为{manifestTarget},但注意运行控制台还是{runtimeTarget}。";
|
|
18
19
|
readonly 'build.failed': "DONE Build failed.";
|
|
19
20
|
readonly 'compiler.build.failed': "编译失败";
|
|
20
21
|
readonly 'stat.warn.appid': "当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303";
|
package/dist/messages/zh_CN.js
CHANGED
|
@@ -17,6 +17,7 @@ exports.default = {
|
|
|
17
17
|
'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
|
|
18
18
|
'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
|
|
19
19
|
'dev.watching.restart.vapor': 'DONE Restart required. 切换蒸汽模式需要重新运行才能生效。',
|
|
20
|
+
'dev.watching.vapor.render.target': 'manifest.json 中更改了视图层编译目标为{manifestTarget},但注意运行控制台还是{runtimeTarget}。',
|
|
20
21
|
'build.failed': 'DONE Build failed.',
|
|
21
22
|
'compiler.build.failed': '编译失败',
|
|
22
23
|
'stat.warn.appid': '当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303',
|
package/dist/vite/cloud.js
CHANGED
|
@@ -135,9 +135,7 @@ function uniEncryptUniModulesPlugin() {
|
|
|
135
135
|
type: 'asset',
|
|
136
136
|
fileName: pkg,
|
|
137
137
|
name: pkg,
|
|
138
|
-
names: [pkg],
|
|
139
138
|
originalFileName: null,
|
|
140
|
-
originalFileNames: [],
|
|
141
139
|
needsCodeReference: false,
|
|
142
140
|
source: genUniModulesPackageJson(uniModuleId, process.env.UNI_INPUT_DIR, {
|
|
143
141
|
env: (0, uni_modules_cloud_1.initCheckEnv)(),
|
|
@@ -22,8 +22,7 @@ function uniConsolePlugin(options) {
|
|
|
22
22
|
resolvedConfig = config;
|
|
23
23
|
// 理论上发行模式就不应该有这个逻辑了,只不过为了尽量不引发兼容性问题,目前严谨一些判断是否配置了 drop_console
|
|
24
24
|
if (process.env.NODE_ENV !== 'development') {
|
|
25
|
-
const compressOptions = resolvedConfig.build.terserOptions
|
|
26
|
-
?.compress;
|
|
25
|
+
const compressOptions = resolvedConfig.build.terserOptions?.compress;
|
|
27
26
|
if (compressOptions && typeof compressOptions === 'object') {
|
|
28
27
|
dropConsole = !!compressOptions.drop_console;
|
|
29
28
|
}
|
|
@@ -12,7 +12,6 @@ const shared_1 = require("@vue/shared");
|
|
|
12
12
|
const magic_string_1 = __importDefault(require("magic-string"));
|
|
13
13
|
const utils_1 = require("../utils");
|
|
14
14
|
const uts_1 = require("../../uts");
|
|
15
|
-
const x_1 = require("../../x");
|
|
16
15
|
const debugInject = (0, debug_1.default)('uni:inject');
|
|
17
16
|
// const debugInjectTry = debug('uni:inject-try')
|
|
18
17
|
function uniViteInjectPlugin(name, options) {
|
|
@@ -129,7 +128,7 @@ function uniViteInjectPlugin(name, options) {
|
|
|
129
128
|
}
|
|
130
129
|
(0, estree_walker_1.walk)(ast, {
|
|
131
130
|
enter(node, parent) {
|
|
132
|
-
if (sourceMap
|
|
131
|
+
if (sourceMap) {
|
|
133
132
|
magicString.addSourcemapLocation(node.start);
|
|
134
133
|
magicString.addSourcemapLocation(node.end);
|
|
135
134
|
}
|
|
@@ -171,11 +170,7 @@ function uniViteInjectPlugin(name, options) {
|
|
|
171
170
|
magicString.prepend(`${importBlock}\n\n`);
|
|
172
171
|
return {
|
|
173
172
|
code: magicString.toString(),
|
|
174
|
-
map: sourceMap
|
|
175
|
-
? magicString.generateMap({
|
|
176
|
-
hires: (0, x_1.shouldUseHighResolutionSourceMap)(),
|
|
177
|
-
})
|
|
178
|
-
: null,
|
|
173
|
+
map: sourceMap ? magicString.generateMap({ hires: true }) : null,
|
|
179
174
|
};
|
|
180
175
|
},
|
|
181
176
|
};
|
package/dist/vite/plugins/sfc.js
CHANGED
|
@@ -9,7 +9,6 @@ const magic_string_1 = __importDefault(require("magic-string"));
|
|
|
9
9
|
const vue_1 = require("../../vue");
|
|
10
10
|
const utils_1 = require("../utils");
|
|
11
11
|
const preprocess_1 = require("../../preprocess");
|
|
12
|
-
const x_1 = require("../../x");
|
|
13
12
|
const SRC_IMPORT_RE = /<(template|script|style)[^>]*src\s*=\s*["']([^"']+)["'][^>]*>/;
|
|
14
13
|
const SRC_IMPORT_VUE_RE = /<(template|script|style)[^>]*src\s*=\s*["'](.*\.uvue|.*\.vue)["'][^>]*>/;
|
|
15
14
|
function isSrcImport(code) {
|
|
@@ -121,9 +120,7 @@ function uniViteSfcSrcImportPlugin({ onlyVue } = { onlyVue: true }) {
|
|
|
121
120
|
}
|
|
122
121
|
return {
|
|
123
122
|
code: s.toString(),
|
|
124
|
-
map: sourceMap
|
|
125
|
-
? s.generateMap({ hires: (0, x_1.shouldUseHighResolutionSourceMap)() })
|
|
126
|
-
: null,
|
|
123
|
+
map: sourceMap ? s.generateMap({ hires: true }) : null,
|
|
127
124
|
};
|
|
128
125
|
},
|
|
129
126
|
};
|
|
@@ -9,6 +9,23 @@ const utils_1 = require("../../utils");
|
|
|
9
9
|
const json_1 = require("../../json");
|
|
10
10
|
const messages_1 = require("../../messages");
|
|
11
11
|
const emittedHashMap = new WeakMap();
|
|
12
|
+
function normalizeVaporRenderTarget(target) {
|
|
13
|
+
if (typeof target !== 'string') {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (target.includes('bytecode')) {
|
|
17
|
+
return 'bytecode';
|
|
18
|
+
}
|
|
19
|
+
if (target.includes('nativecode')) {
|
|
20
|
+
return 'nativecode';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function formatVaporRenderTarget(target) {
|
|
24
|
+
return messages_1.M[`view.render.compiler.target.${target}`];
|
|
25
|
+
}
|
|
26
|
+
function getManifestVaporRenderTarget(manifest) {
|
|
27
|
+
return normalizeVaporRenderTarget(manifest['uni-app-x']?.['vapor-render-target']);
|
|
28
|
+
}
|
|
12
29
|
function uniStatsPlugin() {
|
|
13
30
|
let resolvedConfig;
|
|
14
31
|
let isManifestChanged = false;
|
|
@@ -28,6 +45,15 @@ function uniStatsPlugin() {
|
|
|
28
45
|
try {
|
|
29
46
|
const manifest = (0, json_1.parseJson)(fs_extra_1.default.readFileSync(id, 'utf-8'), true, 'manifest.json');
|
|
30
47
|
const uniAppX = manifest['uni-app-x'] || {};
|
|
48
|
+
const vaporRenderTarget = getManifestVaporRenderTarget(manifest);
|
|
49
|
+
const runtimeVaporRenderTarget = normalizeVaporRenderTarget(process.env.UNI_APP_X_VAPOR_RENDER_TARGET);
|
|
50
|
+
if (vaporRenderTarget &&
|
|
51
|
+
runtimeVaporRenderTarget &&
|
|
52
|
+
vaporRenderTarget !== runtimeVaporRenderTarget) {
|
|
53
|
+
console.warn(messages_1.M['dev.watching.vapor.render.target']
|
|
54
|
+
.replace('{manifestTarget}', formatVaporRenderTarget(vaporRenderTarget))
|
|
55
|
+
.replace('{runtimeTarget}', formatVaporRenderTarget(runtimeVaporRenderTarget)));
|
|
56
|
+
}
|
|
31
57
|
if (uniAppX.vapor !== isVapor) {
|
|
32
58
|
isVapor = uniAppX.vapor === true;
|
|
33
59
|
console.warn(messages_1.M['dev.watching.restart.vapor']);
|
|
@@ -37,7 +37,6 @@ const shared_1 = require("@vue/shared");
|
|
|
37
37
|
const utils_1 = require("../utils");
|
|
38
38
|
const utils_2 = require("../../../../vite/utils/utils");
|
|
39
39
|
const utils_3 = require("../../../../utils");
|
|
40
|
-
const x_1 = require("../../../../x");
|
|
41
40
|
const static_1 = require("./static");
|
|
42
41
|
exports.assetUrlRE = /__VITE_ASSET__([a-z\d]{8})__(?:\$_(.*?)__)?/g;
|
|
43
42
|
const rawRE = /(\?|&)raw(?:&|$)/;
|
|
@@ -125,9 +124,7 @@ function assetPlugin(config, options) {
|
|
|
125
124
|
if (s) {
|
|
126
125
|
return {
|
|
127
126
|
code: s.toString(),
|
|
128
|
-
map: (0, utils_2.withSourcemap)(config)
|
|
129
|
-
? s.generateMap({ hires: (0, x_1.shouldUseHighResolutionSourceMap)() })
|
|
130
|
-
: null,
|
|
127
|
+
map: (0, utils_2.withSourcemap)(config) ? s.generateMap({ hires: true }) : null,
|
|
131
128
|
};
|
|
132
129
|
}
|
|
133
130
|
else {
|
|
@@ -240,9 +237,7 @@ function assetFileNamesToFileName(assetFileNames, file, contentHash, content) {
|
|
|
240
237
|
if ((0, shared_1.isFunction)(assetFileNames)) {
|
|
241
238
|
assetFileNames = assetFileNames({
|
|
242
239
|
name: file,
|
|
243
|
-
names: [file],
|
|
244
240
|
originalFileName: null,
|
|
245
|
-
originalFileNames: [],
|
|
246
241
|
source: content,
|
|
247
242
|
type: 'asset',
|
|
248
243
|
});
|
|
@@ -42,7 +42,6 @@ const shared_1 = require("@vue/shared");
|
|
|
42
42
|
const preprocess_1 = require("../../../../preprocess");
|
|
43
43
|
const uniapp_1 = require("../../../../postcss/plugins/uniapp");
|
|
44
44
|
const cleanString_1 = require("../cleanString");
|
|
45
|
-
const x_1 = require("../../../../x");
|
|
46
45
|
const constants_1 = require("../../../../constants");
|
|
47
46
|
const fontFamily_1 = require("../../../../dom2/fontFamily");
|
|
48
47
|
const utils_2 = require("../../../utils/utils");
|
|
@@ -936,9 +935,6 @@ const scss = async (source, root, options, resolvers, isNVue) => {
|
|
|
936
935
|
if (err) {
|
|
937
936
|
reject(err);
|
|
938
937
|
}
|
|
939
|
-
else if (!res) {
|
|
940
|
-
reject(new Error('Sass render result is empty.'));
|
|
941
|
-
}
|
|
942
938
|
else {
|
|
943
939
|
resolve(res);
|
|
944
940
|
}
|
|
@@ -1179,7 +1175,7 @@ async function getSource(source, filename, additionalData, enableSourcemap, sep
|
|
|
1179
1175
|
const ms = new magic_string_1.default(source);
|
|
1180
1176
|
ms.appendLeft(0, sep);
|
|
1181
1177
|
ms.appendLeft(0, additionalData);
|
|
1182
|
-
const map = ms.generateMap({ hires:
|
|
1178
|
+
const map = ms.generateMap({ hires: true });
|
|
1183
1179
|
map.file = filename;
|
|
1184
1180
|
map.sources = [filename];
|
|
1185
1181
|
return {
|
|
@@ -4,6 +4,7 @@ exports.transformDirection = void 0;
|
|
|
4
4
|
const vite_1 = require("../../../vite");
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const compiler_core_1 = require("@vue/compiler-core");
|
|
7
|
+
const shared_1 = require("@vue/shared");
|
|
7
8
|
/**
|
|
8
9
|
* 将direction属性转化为scroll-x和scroll-y
|
|
9
10
|
* 注意transformMPBuiltInTag内会讲list-view转化为scroll-view,所以此transform应该在transformMPBuiltInTag之后执行
|
|
@@ -27,7 +28,7 @@ const transformDirection = function (node, context) {
|
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
30
|
const directionProp = node.props[directionPropIndex];
|
|
30
|
-
if (
|
|
31
|
+
if ((0, vite_1.isAttributeNode)(directionProp)) {
|
|
31
32
|
const directionValue = directionProp.value?.content;
|
|
32
33
|
const scrollX = directionValue === 'horizontal' || directionValue === 'all';
|
|
33
34
|
const scrollY = !directionValue ||
|
|
@@ -39,12 +40,16 @@ const transformDirection = function (node, context) {
|
|
|
39
40
|
}
|
|
40
41
|
else if (directionProp.type === compiler_core_1.NodeTypes.DIRECTIVE) {
|
|
41
42
|
if (!directionProp.arg ||
|
|
42
|
-
directionProp.arg
|
|
43
|
+
!(0, vite_1.isSimpleExpressionNode)(directionProp.arg) ||
|
|
43
44
|
!directionProp.exp ||
|
|
44
|
-
directionProp.exp
|
|
45
|
+
!((0, vite_1.isSimpleExpressionNode)(directionProp.exp) ||
|
|
46
|
+
(0, vite_1.isCompoundExpressionNode)(directionProp.exp))) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const exp = stringifyExpression(directionProp.exp);
|
|
50
|
+
if (!exp) {
|
|
45
51
|
return;
|
|
46
52
|
}
|
|
47
|
-
const exp = directionProp.exp.content;
|
|
48
53
|
const scrollX = `(${exp}) === 'horizontal' || (${exp}) === 'all'`;
|
|
49
54
|
const scrollY = `!(${exp}) || (${exp}) === 'vertical' || (${exp}) === 'all'`;
|
|
50
55
|
node.props.splice(directionPropIndex, 1);
|
|
@@ -53,3 +58,27 @@ const transformDirection = function (node, context) {
|
|
|
53
58
|
}
|
|
54
59
|
};
|
|
55
60
|
exports.transformDirection = transformDirection;
|
|
61
|
+
function stringifyExpression(exp) {
|
|
62
|
+
if ((0, vite_1.isSimpleExpressionNode)(exp)) {
|
|
63
|
+
return exp.content;
|
|
64
|
+
}
|
|
65
|
+
if ((0, vite_1.isCompoundExpressionNode)(exp)) {
|
|
66
|
+
const children = [];
|
|
67
|
+
for (const child of exp.children) {
|
|
68
|
+
if ((0, shared_1.isString)(child)) {
|
|
69
|
+
children.push(child);
|
|
70
|
+
}
|
|
71
|
+
else if ((0, shared_1.isSymbol)(child)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
const content = stringifyExpression(child);
|
|
76
|
+
if (content === undefined) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
children.push(content);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return children.join('');
|
|
83
|
+
}
|
|
84
|
+
}
|
package/dist/watcher.d.ts
CHANGED
package/dist/x.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export declare function isUniAppX(): boolean;
|
|
|
3
3
|
export declare function isUniAppXAndroid(platform?: AppXPlatform): boolean;
|
|
4
4
|
export declare function isUniAppXIOS(platform?: AppXPlatform): boolean;
|
|
5
5
|
export declare function isUniAppXVapor(): boolean;
|
|
6
|
-
export declare function shouldUseHighResolutionSourceMap(): boolean;
|
|
7
6
|
export declare function isUniAppXAndroidVapor(platform?: AppXPlatform): boolean;
|
|
8
7
|
export declare function isUniAppXJsEngine(): boolean;
|
|
9
8
|
export declare function isUniAppXAndroidJsEngine(platform?: AppXPlatform): boolean;
|
package/dist/x.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isUniAppXAndroidNative = exports.isUniAppXAndroidJsEngine = exports.isUniAppXJsEngine = exports.isUniAppXAndroidVapor = exports.
|
|
3
|
+
exports.isUniAppXAndroidNative = exports.isUniAppXAndroidJsEngine = exports.isUniAppXJsEngine = exports.isUniAppXAndroidVapor = exports.isUniAppXVapor = exports.isUniAppXIOS = exports.isUniAppXAndroid = exports.isUniAppX = void 0;
|
|
4
4
|
function isUniAppX() {
|
|
5
5
|
return process.env.UNI_APP_X === 'true';
|
|
6
6
|
}
|
|
@@ -17,10 +17,6 @@ function isUniAppXVapor() {
|
|
|
17
17
|
return isUniAppX() && process.env.UNI_APP_X_DOM2 === 'true';
|
|
18
18
|
}
|
|
19
19
|
exports.isUniAppXVapor = isUniAppXVapor;
|
|
20
|
-
function shouldUseHighResolutionSourceMap() {
|
|
21
|
-
return !(process.env.NODE_ENV === 'development' && isUniAppXVapor());
|
|
22
|
-
}
|
|
23
|
-
exports.shouldUseHighResolutionSourceMap = shouldUseHighResolutionSourceMap;
|
|
24
20
|
function isUniAppXAndroidVapor(platform = process.env.UNI_UTS_PLATFORM) {
|
|
25
21
|
return isUniAppXAndroid(platform) && process.env.UNI_APP_X_DOM2 === 'true';
|
|
26
22
|
}
|
|
@@ -374,6 +374,12 @@ function convertToBlock(node, { helper, removeHelper, inSSR }) {
|
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
+
var __defProp = Object.defineProperty;
|
|
378
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
379
|
+
var __publicField = (obj, key, value) => {
|
|
380
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
381
|
+
return value;
|
|
382
|
+
};
|
|
377
383
|
const defaultDelimitersOpen = new Uint8Array([123, 123]);
|
|
378
384
|
const defaultDelimitersClose = new Uint8Array([125, 125]);
|
|
379
385
|
function isTagStartChar(c) {
|
|
@@ -424,31 +430,32 @@ class Tokenizer {
|
|
|
424
430
|
this.stack = stack;
|
|
425
431
|
this.cbs = cbs;
|
|
426
432
|
/** The current state the tokenizer is in. */
|
|
427
|
-
this
|
|
433
|
+
__publicField(this, "state", 1);
|
|
428
434
|
/** The read buffer. */
|
|
429
|
-
this
|
|
435
|
+
__publicField(this, "buffer", "");
|
|
430
436
|
/** The beginning of the section that is currently being read. */
|
|
431
|
-
this
|
|
437
|
+
__publicField(this, "sectionStart", 0);
|
|
432
438
|
/** The index within the buffer that we are currently looking at. */
|
|
433
|
-
this
|
|
439
|
+
__publicField(this, "index", 0);
|
|
434
440
|
/** The start of the last entity. */
|
|
435
|
-
this
|
|
441
|
+
__publicField(this, "entityStart", 0);
|
|
436
442
|
/** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
|
|
437
|
-
this
|
|
443
|
+
__publicField(this, "baseState", 1);
|
|
438
444
|
/** For special parsing behavior inside of script and style tags. */
|
|
439
|
-
this
|
|
445
|
+
__publicField(this, "inRCDATA", false);
|
|
440
446
|
/** For disabling RCDATA tags handling */
|
|
441
|
-
this
|
|
447
|
+
__publicField(this, "inXML", false);
|
|
442
448
|
/** For disabling interpolation parsing in v-pre */
|
|
443
|
-
this
|
|
449
|
+
__publicField(this, "inVPre", false);
|
|
444
450
|
/** Record newline positions for fast line / column calculation */
|
|
445
|
-
this
|
|
446
|
-
this
|
|
447
|
-
this
|
|
448
|
-
this
|
|
449
|
-
this
|
|
450
|
-
this
|
|
451
|
-
this
|
|
451
|
+
__publicField(this, "newlines", []);
|
|
452
|
+
__publicField(this, "entityDecoder");
|
|
453
|
+
__publicField(this, "mode", 0);
|
|
454
|
+
__publicField(this, "delimiterOpen", defaultDelimitersOpen);
|
|
455
|
+
__publicField(this, "delimiterClose", defaultDelimitersClose);
|
|
456
|
+
__publicField(this, "delimiterIndex", -1);
|
|
457
|
+
__publicField(this, "currentSequence");
|
|
458
|
+
__publicField(this, "sequenceIndex", 0);
|
|
452
459
|
{
|
|
453
460
|
this.entityDecoder = new decode_js.EntityDecoder(
|
|
454
461
|
decode_js.htmlDecodeTree,
|
|
@@ -374,6 +374,12 @@ function convertToBlock(node, { helper, removeHelper, inSSR }) {
|
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
+
var __defProp = Object.defineProperty;
|
|
378
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
379
|
+
var __publicField = (obj, key, value) => {
|
|
380
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
381
|
+
return value;
|
|
382
|
+
};
|
|
377
383
|
const defaultDelimitersOpen = new Uint8Array([123, 123]);
|
|
378
384
|
const defaultDelimitersClose = new Uint8Array([125, 125]);
|
|
379
385
|
function isTagStartChar(c) {
|
|
@@ -424,31 +430,32 @@ class Tokenizer {
|
|
|
424
430
|
this.stack = stack;
|
|
425
431
|
this.cbs = cbs;
|
|
426
432
|
/** The current state the tokenizer is in. */
|
|
427
|
-
this
|
|
433
|
+
__publicField(this, "state", 1);
|
|
428
434
|
/** The read buffer. */
|
|
429
|
-
this
|
|
435
|
+
__publicField(this, "buffer", "");
|
|
430
436
|
/** The beginning of the section that is currently being read. */
|
|
431
|
-
this
|
|
437
|
+
__publicField(this, "sectionStart", 0);
|
|
432
438
|
/** The index within the buffer that we are currently looking at. */
|
|
433
|
-
this
|
|
439
|
+
__publicField(this, "index", 0);
|
|
434
440
|
/** The start of the last entity. */
|
|
435
|
-
this
|
|
441
|
+
__publicField(this, "entityStart", 0);
|
|
436
442
|
/** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
|
|
437
|
-
this
|
|
443
|
+
__publicField(this, "baseState", 1);
|
|
438
444
|
/** For special parsing behavior inside of script and style tags. */
|
|
439
|
-
this
|
|
445
|
+
__publicField(this, "inRCDATA", false);
|
|
440
446
|
/** For disabling RCDATA tags handling */
|
|
441
|
-
this
|
|
447
|
+
__publicField(this, "inXML", false);
|
|
442
448
|
/** For disabling interpolation parsing in v-pre */
|
|
443
|
-
this
|
|
449
|
+
__publicField(this, "inVPre", false);
|
|
444
450
|
/** Record newline positions for fast line / column calculation */
|
|
445
|
-
this
|
|
446
|
-
this
|
|
447
|
-
this
|
|
448
|
-
this
|
|
449
|
-
this
|
|
450
|
-
this
|
|
451
|
-
this
|
|
451
|
+
__publicField(this, "newlines", []);
|
|
452
|
+
__publicField(this, "entityDecoder");
|
|
453
|
+
__publicField(this, "mode", 0);
|
|
454
|
+
__publicField(this, "delimiterOpen", defaultDelimitersOpen);
|
|
455
|
+
__publicField(this, "delimiterClose", defaultDelimitersClose);
|
|
456
|
+
__publicField(this, "delimiterIndex", -1);
|
|
457
|
+
__publicField(this, "currentSequence");
|
|
458
|
+
__publicField(this, "sequenceIndex", 0);
|
|
452
459
|
{
|
|
453
460
|
this.entityDecoder = new decode_js.EntityDecoder(
|
|
454
461
|
decode_js.htmlDecodeTree,
|
|
@@ -368,6 +368,12 @@ function convertToBlock(node, { helper, removeHelper, inSSR }) {
|
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
+
var __defProp = Object.defineProperty;
|
|
372
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
373
|
+
var __publicField = (obj, key, value) => {
|
|
374
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
375
|
+
return value;
|
|
376
|
+
};
|
|
371
377
|
const defaultDelimitersOpen = new Uint8Array([123, 123]);
|
|
372
378
|
const defaultDelimitersClose = new Uint8Array([125, 125]);
|
|
373
379
|
function isTagStartChar(c) {
|
|
@@ -418,31 +424,32 @@ class Tokenizer {
|
|
|
418
424
|
this.stack = stack;
|
|
419
425
|
this.cbs = cbs;
|
|
420
426
|
/** The current state the tokenizer is in. */
|
|
421
|
-
this
|
|
427
|
+
__publicField(this, "state", 1);
|
|
422
428
|
/** The read buffer. */
|
|
423
|
-
this
|
|
429
|
+
__publicField(this, "buffer", "");
|
|
424
430
|
/** The beginning of the section that is currently being read. */
|
|
425
|
-
this
|
|
431
|
+
__publicField(this, "sectionStart", 0);
|
|
426
432
|
/** The index within the buffer that we are currently looking at. */
|
|
427
|
-
this
|
|
433
|
+
__publicField(this, "index", 0);
|
|
428
434
|
/** The start of the last entity. */
|
|
429
|
-
this
|
|
435
|
+
__publicField(this, "entityStart", 0);
|
|
430
436
|
/** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
|
|
431
|
-
this
|
|
437
|
+
__publicField(this, "baseState", 1);
|
|
432
438
|
/** For special parsing behavior inside of script and style tags. */
|
|
433
|
-
this
|
|
439
|
+
__publicField(this, "inRCDATA", false);
|
|
434
440
|
/** For disabling RCDATA tags handling */
|
|
435
|
-
this
|
|
441
|
+
__publicField(this, "inXML", false);
|
|
436
442
|
/** For disabling interpolation parsing in v-pre */
|
|
437
|
-
this
|
|
443
|
+
__publicField(this, "inVPre", false);
|
|
438
444
|
/** Record newline positions for fast line / column calculation */
|
|
439
|
-
this
|
|
440
|
-
this
|
|
441
|
-
this
|
|
442
|
-
this
|
|
443
|
-
this
|
|
444
|
-
this
|
|
445
|
-
this
|
|
445
|
+
__publicField(this, "newlines", []);
|
|
446
|
+
__publicField(this, "entityDecoder");
|
|
447
|
+
__publicField(this, "mode", 0);
|
|
448
|
+
__publicField(this, "delimiterOpen", defaultDelimitersOpen);
|
|
449
|
+
__publicField(this, "delimiterClose", defaultDelimitersClose);
|
|
450
|
+
__publicField(this, "delimiterIndex", -1);
|
|
451
|
+
__publicField(this, "currentSequence");
|
|
452
|
+
__publicField(this, "sequenceIndex", 0);
|
|
446
453
|
}
|
|
447
454
|
get inSFCRoot() {
|
|
448
455
|
return this.mode === 2 && this.stack.length === 0;
|