@dcloudio/uni-cli-shared 3.0.0-alpha-1000920260522733 → 3.0.0-alpha-5010120260522001
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/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/stats.js +26 -0
- package/dist/vite/plugins/vitejs/plugins/asset.d.ts +0 -1
- package/dist/vite/plugins/vitejs/plugins/asset.js +0 -2
- package/dist/vite/plugins/vitejs/plugins/css.js +0 -3
- package/dist/vue/transforms/x/transformDirection.js +33 -4
- package/dist/watcher.d.ts +0 -1
- 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/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
|
}
|
|
@@ -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']);
|
|
@@ -237,9 +237,7 @@ function assetFileNamesToFileName(assetFileNames, file, contentHash, content) {
|
|
|
237
237
|
if ((0, shared_1.isFunction)(assetFileNames)) {
|
|
238
238
|
assetFileNames = assetFileNames({
|
|
239
239
|
name: file,
|
|
240
|
-
names: [file],
|
|
241
240
|
originalFileName: null,
|
|
242
|
-
originalFileNames: [],
|
|
243
241
|
source: content,
|
|
244
242
|
type: 'asset',
|
|
245
243
|
});
|
|
@@ -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
|
@@ -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;
|
|
@@ -19032,33 +19032,70 @@ function getObjectOrArrayExpressionKeys(value) {
|
|
|
19032
19032
|
return [];
|
|
19033
19033
|
}
|
|
19034
19034
|
|
|
19035
|
+
var __defProp$1 = Object.defineProperty;
|
|
19036
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19037
|
+
var __publicField$1 = (obj, key, value) => {
|
|
19038
|
+
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19039
|
+
return value;
|
|
19040
|
+
};
|
|
19035
19041
|
var _a, _b;
|
|
19036
19042
|
class ScriptCompileContext {
|
|
19037
19043
|
constructor(descriptor, options) {
|
|
19038
19044
|
this.descriptor = descriptor;
|
|
19039
19045
|
this.options = options;
|
|
19040
|
-
this
|
|
19041
|
-
this
|
|
19042
|
-
|
|
19043
|
-
this
|
|
19044
|
-
this
|
|
19045
|
-
this
|
|
19046
|
-
this
|
|
19046
|
+
__publicField$1(this, "isJS");
|
|
19047
|
+
__publicField$1(this, "isTS");
|
|
19048
|
+
// fixed by xxxxxx
|
|
19049
|
+
__publicField$1(this, "isUTS");
|
|
19050
|
+
__publicField$1(this, "isCE", false);
|
|
19051
|
+
__publicField$1(this, "scriptAst");
|
|
19052
|
+
__publicField$1(this, "scriptSetupAst");
|
|
19053
|
+
__publicField$1(this, "source", this.descriptor.source);
|
|
19054
|
+
__publicField$1(this, "filename", this.descriptor.filename);
|
|
19055
|
+
__publicField$1(this, "s", new MagicString(this.source));
|
|
19056
|
+
__publicField$1(this, "startOffset", (_a = this.descriptor.scriptSetup) == null ? void 0 : _a.loc.start.offset);
|
|
19057
|
+
__publicField$1(this, "endOffset", (_b = this.descriptor.scriptSetup) == null ? void 0 : _b.loc.end.offset);
|
|
19058
|
+
// import / type analysis
|
|
19059
|
+
__publicField$1(this, "scope");
|
|
19060
|
+
__publicField$1(this, "globalScopes");
|
|
19061
|
+
__publicField$1(this, "userImports", /* @__PURE__ */ Object.create(null));
|
|
19047
19062
|
// macros presence check
|
|
19048
|
-
this
|
|
19049
|
-
this
|
|
19050
|
-
this
|
|
19051
|
-
this
|
|
19052
|
-
this
|
|
19053
|
-
this
|
|
19054
|
-
this
|
|
19055
|
-
this
|
|
19056
|
-
|
|
19063
|
+
__publicField$1(this, "hasDefinePropsCall", false);
|
|
19064
|
+
__publicField$1(this, "hasDefineEmitCall", false);
|
|
19065
|
+
__publicField$1(this, "hasDefineExposeCall", false);
|
|
19066
|
+
__publicField$1(this, "hasDefaultExportName", false);
|
|
19067
|
+
__publicField$1(this, "hasDefaultExportRender", false);
|
|
19068
|
+
__publicField$1(this, "hasDefineOptionsCall", false);
|
|
19069
|
+
__publicField$1(this, "hasDefineSlotsCall", false);
|
|
19070
|
+
__publicField$1(this, "hasDefineModelCall", false);
|
|
19071
|
+
// defineProps
|
|
19072
|
+
__publicField$1(this, "propsCall");
|
|
19073
|
+
__publicField$1(this, "propsDecl");
|
|
19074
|
+
__publicField$1(this, "propsRuntimeDecl");
|
|
19075
|
+
__publicField$1(this, "propsTypeDecl");
|
|
19076
|
+
__publicField$1(this, "propsDestructureDecl");
|
|
19077
|
+
__publicField$1(this, "propsDestructuredBindings", /* @__PURE__ */ Object.create(null));
|
|
19078
|
+
__publicField$1(this, "propsDestructureRestId");
|
|
19079
|
+
__publicField$1(this, "propsRuntimeDefaults");
|
|
19080
|
+
// defineEmits
|
|
19081
|
+
__publicField$1(this, "emitsRuntimeDecl");
|
|
19082
|
+
__publicField$1(this, "emitsTypeDecl");
|
|
19083
|
+
__publicField$1(this, "emitDecl");
|
|
19057
19084
|
// defineModel
|
|
19058
|
-
this
|
|
19085
|
+
__publicField$1(this, "modelDecls", /* @__PURE__ */ Object.create(null));
|
|
19086
|
+
// defineOptions
|
|
19087
|
+
__publicField$1(this, "optionsRuntimeDecl");
|
|
19059
19088
|
// codegen
|
|
19060
|
-
this
|
|
19061
|
-
this
|
|
19089
|
+
__publicField$1(this, "bindingMetadata", {});
|
|
19090
|
+
__publicField$1(this, "helperImports", /* @__PURE__ */ new Set());
|
|
19091
|
+
/**
|
|
19092
|
+
* to be exposed on compiled script block for HMR cache busting
|
|
19093
|
+
*/
|
|
19094
|
+
__publicField$1(this, "deps");
|
|
19095
|
+
/**
|
|
19096
|
+
* cache for resolved fs
|
|
19097
|
+
*/
|
|
19098
|
+
__publicField$1(this, "fs");
|
|
19062
19099
|
const { script, scriptSetup } = descriptor;
|
|
19063
19100
|
const scriptLang = script && script.lang;
|
|
19064
19101
|
const scriptSetupLang = scriptSetup && scriptSetup.lang;
|
|
@@ -21340,6 +21377,12 @@ minimatch.Minimatch = Minimatch;
|
|
|
21340
21377
|
minimatch.escape = escape;
|
|
21341
21378
|
minimatch.unescape = unescape;
|
|
21342
21379
|
|
|
21380
|
+
var __defProp = Object.defineProperty;
|
|
21381
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
21382
|
+
var __publicField = (obj, key, value) => {
|
|
21383
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21384
|
+
return value;
|
|
21385
|
+
};
|
|
21343
21386
|
class TypeScope {
|
|
21344
21387
|
constructor(filename, source, offset = 0, imports = /* @__PURE__ */ Object.create(null), types = /* @__PURE__ */ Object.create(null), declares = /* @__PURE__ */ Object.create(null)) {
|
|
21345
21388
|
this.filename = filename;
|
|
@@ -21348,10 +21391,10 @@ class TypeScope {
|
|
|
21348
21391
|
this.imports = imports;
|
|
21349
21392
|
this.types = types;
|
|
21350
21393
|
this.declares = declares;
|
|
21351
|
-
this
|
|
21352
|
-
this
|
|
21353
|
-
this
|
|
21354
|
-
this
|
|
21394
|
+
__publicField(this, "isGenericScope", false);
|
|
21395
|
+
__publicField(this, "resolvedImportSources", /* @__PURE__ */ Object.create(null));
|
|
21396
|
+
__publicField(this, "exportedTypes", /* @__PURE__ */ Object.create(null));
|
|
21397
|
+
__publicField(this, "exportedDeclares", /* @__PURE__ */ Object.create(null));
|
|
21355
21398
|
}
|
|
21356
21399
|
}
|
|
21357
21400
|
function resolveTypeElements(ctx, node, scope, typeParameters) {
|