@dcloudio/uni-cli-shared 3.0.0-4080720251210001 → 3.0.0-5000320260312001
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/constants.d.ts +3 -0
- package/dist/constants.js +6 -1
- package/dist/deps.js +6 -1
- package/dist/dom2/index.d.ts +1 -0
- package/dist/dom2/index.js +17 -0
- package/dist/dom2/sharedData.d.ts +2 -0
- package/dist/dom2/sharedData.js +19 -0
- package/dist/easycom.js +34 -5
- package/dist/env/define.d.ts +3 -0
- package/dist/env/define.js +12 -0
- package/dist/hbx/alias.js +15 -17
- package/dist/hbx/index.d.ts +1 -1
- package/dist/hbx/index.js +4 -2
- package/dist/hbx/log.d.ts +5 -0
- package/dist/hbx/log.js +44 -1
- package/dist/i18n.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/json/app/manifest/index.d.ts +1 -0
- package/dist/json/app/manifest/index.js +3 -1
- package/dist/json/mp/pages.js +0 -5
- package/dist/json/pages.d.ts +2 -2
- package/dist/json/pages.js +4 -1
- package/dist/json/uni-x/index.d.ts +1 -1
- package/dist/json/utils.js +31 -22
- package/dist/logs/console.js +1 -1
- package/dist/logs/index.d.ts +11 -0
- package/dist/logs/index.js +34 -1
- package/dist/messages/en.d.ts +6 -3
- package/dist/messages/en.js +6 -3
- package/dist/messages/index.d.ts +11 -5
- package/dist/messages/zh_CN.d.ts +5 -2
- package/dist/messages/zh_CN.js +5 -2
- package/dist/mp/assets.d.ts +1 -0
- package/dist/mp/assets.js +27 -1
- package/dist/mp/externalClasses.d.ts +38 -2
- package/dist/mp/externalClasses.js +90 -4
- package/dist/mp/index.d.ts +4 -3
- package/dist/mp/index.js +11 -1
- package/dist/mp/plugin.d.ts +1 -0
- package/dist/mp/plugin.js +14 -1
- package/dist/mp/style.d.ts +1 -0
- package/dist/mp/style.js +8 -1
- package/dist/mp/usingComponents.d.ts +1 -0
- package/dist/mp/usingComponents.js +17 -1
- package/dist/postcss/index.d.ts +2 -0
- package/dist/postcss/index.js +3 -1
- package/dist/postcss/plugins/stylePluginExternal.d.ts +17 -0
- package/dist/postcss/plugins/stylePluginExternal.js +127 -0
- package/dist/postcss/plugins/stylePluginScoped.js +30 -0
- package/dist/preprocess/context.js +2 -0
- package/dist/preprocess/index.d.ts +9 -6
- package/dist/preprocess/index.js +33 -8
- package/dist/resolve.js +5 -1
- package/dist/uni_modules.js +20 -4
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +9 -6
- package/dist/utsUtils.d.ts +1 -0
- package/dist/utsUtils.js +2 -1
- package/dist/vite/autoImport.js +91 -6
- package/dist/vite/plugins/console.js +1 -1
- package/dist/vite/plugins/cssScoped.js +2 -1
- package/dist/vite/plugins/easycom.js +7 -0
- package/dist/vite/plugins/json.js +69 -2
- package/dist/vite/plugins/pre.js +4 -2
- package/dist/vite/plugins/sfc.js +1 -1
- package/dist/vite/plugins/stats.js +32 -0
- package/dist/vite/plugins/uts/ext-api.js +1 -1
- package/dist/vite/plugins/uts/uni_modules.js +12 -0
- package/dist/vite/plugins/uts/uvue.js +7 -2
- package/dist/vite/plugins/vitejs/plugins/asset.d.ts +1 -0
- package/dist/vite/plugins/vitejs/plugins/asset.js +19 -1
- package/dist/vite/plugins/vitejs/plugins/css.d.ts +2 -1
- package/dist/vite/plugins/vitejs/plugins/css.js +27 -10
- package/dist/vite/utils/ast.d.ts +2 -1
- package/dist/vite/utils/ast.js +5 -1
- package/dist/vue/parse.d.ts +2 -0
- package/dist/vue/parse.js +3 -1
- package/dist/vue/transforms/index.d.ts +1 -0
- package/dist/vue/transforms/index.js +1 -0
- package/dist/vue/transforms/transformLineBreak.d.ts +2 -0
- package/dist/vue/transforms/transformLineBreak.js +15 -0
- package/dist/vue/transforms/transformTag.d.ts +1 -1
- package/dist/vue/transforms/transformTag.js +5 -0
- package/dist/vue/transforms/x/transformMPBuiltInTag.js +2 -2
- package/dist/vue/utils.js +8 -1
- package/lib/@vue/compiler-core/dist/compiler-core.cjs.js +42 -23
- package/lib/@vue/compiler-core/dist/compiler-core.cjs.prod.js +42 -23
- package/lib/@vue/compiler-core/dist/compiler-core.esm-bundler.js +39 -19
- package/lib/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +4635 -1024
- package/lib/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +8762 -7849
- package/lib/dom2/app/@vitejs/plugin-vue/LICENSE +21 -0
- package/lib/dom2/app/@vitejs/plugin-vue/README.md +278 -0
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.cjs +3353 -0
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.d.cts +113 -0
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.d.mts +111 -0
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.d.ts +113 -0
- package/lib/dom2/app/@vitejs/plugin-vue/dist/index.mjs +3338 -0
- package/lib/dom2/app/@vitejs/plugin-vue/package.json +50 -0
- package/lib/dom2/app/@vue/compiler-core/LICENSE +21 -0
- package/lib/dom2/app/@vue/compiler-core/README.md +1 -0
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.js +5492 -0
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.prod.js +5436 -0
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.d.ts +1187 -0
- package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.esm-bundler.js +4335 -0
- package/lib/dom2/app/@vue/compiler-core/index.js +7 -0
- package/lib/dom2/app/@vue/compiler-core/package.json +58 -0
- package/lib/dom2/app/@vue/compiler-dom/LICENSE +21 -0
- package/lib/dom2/app/@vue/compiler-dom/README.md +1 -0
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.js +762 -0
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +736 -0
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.d.ts +73 -0
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +5051 -0
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +11 -0
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +557 -0
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.js +5234 -0
- package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.prod.js +11 -0
- package/lib/dom2/app/@vue/compiler-dom/index.js +7 -0
- package/lib/dom2/app/@vue/compiler-dom/package.json +57 -0
- package/lib/dom2/app/@vue/compiler-sfc/LICENSE +21 -0
- package/lib/dom2/app/@vue/compiler-sfc/README.md +80 -0
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +15528 -0
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.d.ts +11595 -0
- package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +41525 -0
- package/lib/dom2/app/@vue/compiler-sfc/package.json +68 -0
- package/lib/dom2/app/@vue/compiler-vapor/LICENSE +21 -0
- package/lib/dom2/app/@vue/compiler-vapor/README.md +1 -0
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +3584 -0
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.d.ts +22858 -0
- package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +22438 -0
- package/lib/dom2/app/@vue/compiler-vapor/package.json +51 -0
- package/lib/dom2/app/@vue/compiler-vapor-dom2/dist/compiler-vapor-dom2.cjs.js +1 -0
- package/lib/dom2/app/@vue/compiler-vapor-dom2/package.json +56 -0
- package/lib/dom2/app/@vue/shared/LICENSE +21 -0
- package/lib/dom2/app/@vue/shared/README.md +3 -0
- package/lib/dom2/app/@vue/shared/dist/shared.cjs.js +773 -0
- package/lib/dom2/app/@vue/shared/dist/shared.cjs.prod.js +773 -0
- package/lib/dom2/app/@vue/shared/dist/shared.d.ts +412 -0
- package/lib/dom2/app/@vue/shared/dist/shared.esm-bundler.js +688 -0
- package/lib/dom2/app/@vue/shared/index.js +7 -0
- package/lib/dom2/app/@vue/shared/package.json +47 -0
- package/lib/preprocess/lib/preprocess.js +9 -3
- package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.js +1 -1
- package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.prod.js +1 -1
- package/package.json +8 -6
package/dist/vue/parse.js
CHANGED
|
@@ -3,10 +3,11 @@ 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.parseWxsCode = exports.parseWxsNodes = exports.parseBlockCode = exports.parseVueCode = void 0;
|
|
6
|
+
exports.onVueTemplateCompileLog = exports.parseWxsCode = exports.parseWxsNodes = exports.parseBlockCode = exports.parseVueCode = void 0;
|
|
7
7
|
const compiler_core_1 = require("@vue/compiler-core");
|
|
8
8
|
const magic_string_1 = __importDefault(require("magic-string"));
|
|
9
9
|
const ast_1 = require("../vite/utils/ast");
|
|
10
|
+
const logs_1 = require("../logs");
|
|
10
11
|
const BLOCK_RE = /<\/block>/;
|
|
11
12
|
const WXS_LANG_RE = /lang=["|'](renderjs|wxs|sjs)["|']/;
|
|
12
13
|
const WXS_ATTRS = ['wxs', 'renderjs', 'sjs'];
|
|
@@ -110,3 +111,4 @@ function parseWxsNode(code, nodes) {
|
|
|
110
111
|
});
|
|
111
112
|
return magicString.toString();
|
|
112
113
|
}
|
|
114
|
+
exports.onVueTemplateCompileLog = logs_1.onCompileLog;
|
|
@@ -20,6 +20,7 @@ const transformTag_1 = require("./transformTag");
|
|
|
20
20
|
const transformEvent_1 = require("./transformEvent");
|
|
21
21
|
const transformComponent_1 = require("./transformComponent");
|
|
22
22
|
const constants_1 = require("../../mp/constants");
|
|
23
|
+
__exportStar(require("./transformLineBreak"), exports);
|
|
23
24
|
__exportStar(require("./transformRef"), exports);
|
|
24
25
|
__exportStar(require("./transformPageHead"), exports);
|
|
25
26
|
__exportStar(require("./transformComponent"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformLineBreak = void 0;
|
|
4
|
+
const transformLineBreak = (node, context) => {
|
|
5
|
+
if (node.type === 2) {
|
|
6
|
+
const parent = context.parent;
|
|
7
|
+
if (parent && parent.type === 1 && parent.tag === 'text') {
|
|
8
|
+
// 解析文本节点转义,暂时仅处理换行
|
|
9
|
+
node.content = node.content.replace(/[\\]+n/g, function (match) {
|
|
10
|
+
return JSON.parse(`"${match}"`);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.transformLineBreak = transformLineBreak;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type NodeTransform } from '@vue/compiler-core';
|
|
2
2
|
export declare function createTransformTag(opts: Record<string, string>): NodeTransform;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createTransformTag = void 0;
|
|
4
|
+
const compiler_core_1 = require("@vue/compiler-core");
|
|
4
5
|
const ast_1 = require("../../vite/utils/ast");
|
|
5
6
|
function createTransformTag(opts) {
|
|
6
7
|
return function transformTag(node, context) {
|
|
@@ -12,6 +13,10 @@ function createTransformTag(opts) {
|
|
|
12
13
|
if (!newTag) {
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
16
|
+
// TODO: 临时 dom2 硬编码处理 tagType,待后续优化
|
|
17
|
+
if (process.env.UNI_APP_X_DOM2 === 'true' && oldTag === 'cover-view') {
|
|
18
|
+
node.tagType = compiler_core_1.ElementTypes.ELEMENT;
|
|
19
|
+
}
|
|
15
20
|
node.tag = newTag;
|
|
16
21
|
};
|
|
17
22
|
}
|
|
@@ -69,13 +69,13 @@ function createMPBuiltInTagTransform(options) {
|
|
|
69
69
|
if (options.propRename && node.tag in options.propRename) {
|
|
70
70
|
const propMap = options.propRename[node.tag];
|
|
71
71
|
node.props.forEach((prop) => {
|
|
72
|
-
if (
|
|
72
|
+
if ((0, vite_1.isAttributeNode)(prop)) {
|
|
73
73
|
const propName = (0, shared_1.camelize)(prop.name);
|
|
74
74
|
if (propName in propMap && propMap[propName]) {
|
|
75
75
|
(0, utils_1.renameProp)(propMap[propName], prop);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
else if (
|
|
78
|
+
else if ((0, vite_1.isDirectiveNode)(prop)) {
|
|
79
79
|
if (!prop.rawName || !prop.arg || !(0, compiler_core_1.isStaticExp)(prop.arg)) {
|
|
80
80
|
return;
|
|
81
81
|
}
|
package/dist/vue/utils.js
CHANGED
|
@@ -178,7 +178,14 @@ function advancePositionWithMutation(pos, source, numberOfCharacters = source.le
|
|
|
178
178
|
exports.advancePositionWithMutation = advancePositionWithMutation;
|
|
179
179
|
function createResolveStaticAsset(inputDir) {
|
|
180
180
|
return function resolveStaticAsset(relativePath, context, options) {
|
|
181
|
-
|
|
181
|
+
let filename = context.filename;
|
|
182
|
+
if (!filename && context.options?.filename) {
|
|
183
|
+
filename = context.options.filename;
|
|
184
|
+
}
|
|
185
|
+
if (!filename) {
|
|
186
|
+
return relativePath;
|
|
187
|
+
}
|
|
188
|
+
const newRelativePath = (0, utils_1.normalizePath)(path_1.default.relative(inputDir, path_1.default.resolve(path_1.default.dirname(filename), relativePath)));
|
|
182
189
|
if (options.base) {
|
|
183
190
|
// explicit base - directly rewrite relative urls into absolute url
|
|
184
191
|
// to avoid generating extra imports
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
10
|
var shared = require('@vue/shared');
|
|
11
|
-
var decode_js = require('entities/
|
|
11
|
+
var decode_js = require('entities/decode');
|
|
12
12
|
var parser = require('@babel/parser');
|
|
13
13
|
var estreeWalker = require('estree-walker');
|
|
14
14
|
var sourceMapJs = require('source-map-js');
|
|
@@ -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,
|
|
@@ -1715,7 +1722,7 @@ function isReferenced(node, parent, grandparent) {
|
|
|
1715
1722
|
if (parent.key === node) {
|
|
1716
1723
|
return !!parent.computed;
|
|
1717
1724
|
}
|
|
1718
|
-
return
|
|
1725
|
+
return true;
|
|
1719
1726
|
case "ClassProperty":
|
|
1720
1727
|
if (parent.key === node) {
|
|
1721
1728
|
return !!parent.computed;
|
|
@@ -1746,9 +1753,6 @@ function isReferenced(node, parent, grandparent) {
|
|
|
1746
1753
|
case "ExportDefaultSpecifier":
|
|
1747
1754
|
return false;
|
|
1748
1755
|
case "ExportSpecifier":
|
|
1749
|
-
if (grandparent == null ? void 0 : grandparent.source) {
|
|
1750
|
-
return false;
|
|
1751
|
-
}
|
|
1752
1756
|
return parent.local === node;
|
|
1753
1757
|
case "ImportDefaultSpecifier":
|
|
1754
1758
|
case "ImportNamespaceSpecifier":
|
|
@@ -2530,6 +2534,7 @@ function onText(content, start, end) {
|
|
|
2530
2534
|
}
|
|
2531
2535
|
}
|
|
2532
2536
|
function onCloseTag(el, end, isImplied = false) {
|
|
2537
|
+
var _a;
|
|
2533
2538
|
if (isImplied) {
|
|
2534
2539
|
setLocEnd(el.loc, backTrack(end, 60));
|
|
2535
2540
|
} else {
|
|
@@ -2554,6 +2559,13 @@ function onCloseTag(el, end, isImplied = false) {
|
|
|
2554
2559
|
el.tagType = 3;
|
|
2555
2560
|
} else if (isComponent(el)) {
|
|
2556
2561
|
el.tagType = 1;
|
|
2562
|
+
const importSources = (_a = currentOptions.bindingMetadata) == null ? void 0 : _a.__importSources;
|
|
2563
|
+
if (importSources) {
|
|
2564
|
+
const source = importSources[tag] || importSources[shared.capitalize(shared.camelize(tag))] || importSources[shared.camelize(tag)] || importSources[shared.capitalize(tag)];
|
|
2565
|
+
if (source) {
|
|
2566
|
+
el.importSource = source;
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2557
2569
|
}
|
|
2558
2570
|
}
|
|
2559
2571
|
if (!tokenizer.inRCDATA) {
|
|
@@ -3120,6 +3132,8 @@ function createTransformContext(root, {
|
|
|
3120
3132
|
transformHoist = null,
|
|
3121
3133
|
isBuiltInComponent = shared.NOOP,
|
|
3122
3134
|
isCustomElement = shared.NOOP,
|
|
3135
|
+
// fixed by xxxxxx
|
|
3136
|
+
isEasyComponent = shared.NOOP,
|
|
3123
3137
|
expressionPlugins = [],
|
|
3124
3138
|
scopeId = null,
|
|
3125
3139
|
slotted = true,
|
|
@@ -3147,6 +3161,8 @@ function createTransformContext(root, {
|
|
|
3147
3161
|
transformHoist,
|
|
3148
3162
|
isBuiltInComponent,
|
|
3149
3163
|
isCustomElement,
|
|
3164
|
+
// fixed by xxxxxx
|
|
3165
|
+
isEasyComponent,
|
|
3150
3166
|
expressionPlugins,
|
|
3151
3167
|
scopeId,
|
|
3152
3168
|
slotted,
|
|
@@ -5312,7 +5328,9 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
5312
5328
|
context.helper(builtIn);
|
|
5313
5329
|
return builtIn;
|
|
5314
5330
|
}
|
|
5315
|
-
|
|
5331
|
+
const isEasyComponent = context.isEasyComponent;
|
|
5332
|
+
const isEasyCom = isEasyComponent && isEasyComponent(tag);
|
|
5333
|
+
if (!isEasyCom) {
|
|
5316
5334
|
const fromSetup = resolveSetupReference(tag, context);
|
|
5317
5335
|
if (fromSetup) {
|
|
5318
5336
|
return fromSetup;
|
|
@@ -5325,7 +5343,8 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
5325
5343
|
}
|
|
5326
5344
|
}
|
|
5327
5345
|
}
|
|
5328
|
-
if (
|
|
5346
|
+
if (// fixed by xxxxxx
|
|
5347
|
+
!isEasyCom && context.selfName && shared.capitalize(shared.camelize(tag)) === context.selfName) {
|
|
5329
5348
|
context.helper(RESOLVE_COMPONENT);
|
|
5330
5349
|
context.components.add(tag + `__self`);
|
|
5331
5350
|
return toValidAssetId(tag, `component`);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
10
|
var shared = require('@vue/shared');
|
|
11
|
-
var decode_js = require('entities/
|
|
11
|
+
var decode_js = require('entities/decode');
|
|
12
12
|
var parser = require('@babel/parser');
|
|
13
13
|
var estreeWalker = require('estree-walker');
|
|
14
14
|
var sourceMapJs = require('source-map-js');
|
|
@@ -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,
|
|
@@ -1711,7 +1718,7 @@ function isReferenced(node, parent, grandparent) {
|
|
|
1711
1718
|
if (parent.key === node) {
|
|
1712
1719
|
return !!parent.computed;
|
|
1713
1720
|
}
|
|
1714
|
-
return
|
|
1721
|
+
return true;
|
|
1715
1722
|
case "ClassProperty":
|
|
1716
1723
|
if (parent.key === node) {
|
|
1717
1724
|
return !!parent.computed;
|
|
@@ -1742,9 +1749,6 @@ function isReferenced(node, parent, grandparent) {
|
|
|
1742
1749
|
case "ExportDefaultSpecifier":
|
|
1743
1750
|
return false;
|
|
1744
1751
|
case "ExportSpecifier":
|
|
1745
|
-
if (grandparent == null ? void 0 : grandparent.source) {
|
|
1746
|
-
return false;
|
|
1747
|
-
}
|
|
1748
1752
|
return parent.local === node;
|
|
1749
1753
|
case "ImportDefaultSpecifier":
|
|
1750
1754
|
case "ImportNamespaceSpecifier":
|
|
@@ -2526,6 +2530,7 @@ function onText(content, start, end) {
|
|
|
2526
2530
|
}
|
|
2527
2531
|
}
|
|
2528
2532
|
function onCloseTag(el, end, isImplied = false) {
|
|
2533
|
+
var _a;
|
|
2529
2534
|
if (isImplied) {
|
|
2530
2535
|
setLocEnd(el.loc, backTrack(end, 60));
|
|
2531
2536
|
} else {
|
|
@@ -2550,6 +2555,13 @@ function onCloseTag(el, end, isImplied = false) {
|
|
|
2550
2555
|
el.tagType = 3;
|
|
2551
2556
|
} else if (isComponent(el)) {
|
|
2552
2557
|
el.tagType = 1;
|
|
2558
|
+
const importSources = (_a = currentOptions.bindingMetadata) == null ? void 0 : _a.__importSources;
|
|
2559
|
+
if (importSources) {
|
|
2560
|
+
const source = importSources[tag] || importSources[shared.capitalize(shared.camelize(tag))] || importSources[shared.camelize(tag)] || importSources[shared.capitalize(tag)];
|
|
2561
|
+
if (source) {
|
|
2562
|
+
el.importSource = source;
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2553
2565
|
}
|
|
2554
2566
|
}
|
|
2555
2567
|
if (!tokenizer.inRCDATA) {
|
|
@@ -3079,6 +3091,8 @@ function createTransformContext(root, {
|
|
|
3079
3091
|
transformHoist = null,
|
|
3080
3092
|
isBuiltInComponent = shared.NOOP,
|
|
3081
3093
|
isCustomElement = shared.NOOP,
|
|
3094
|
+
// fixed by xxxxxx
|
|
3095
|
+
isEasyComponent = shared.NOOP,
|
|
3082
3096
|
expressionPlugins = [],
|
|
3083
3097
|
scopeId = null,
|
|
3084
3098
|
slotted = true,
|
|
@@ -3106,6 +3120,8 @@ function createTransformContext(root, {
|
|
|
3106
3120
|
transformHoist,
|
|
3107
3121
|
isBuiltInComponent,
|
|
3108
3122
|
isCustomElement,
|
|
3123
|
+
// fixed by xxxxxx
|
|
3124
|
+
isEasyComponent,
|
|
3109
3125
|
expressionPlugins,
|
|
3110
3126
|
scopeId,
|
|
3111
3127
|
slotted,
|
|
@@ -5217,7 +5233,9 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
5217
5233
|
context.helper(builtIn);
|
|
5218
5234
|
return builtIn;
|
|
5219
5235
|
}
|
|
5220
|
-
|
|
5236
|
+
const isEasyComponent = context.isEasyComponent;
|
|
5237
|
+
const isEasyCom = isEasyComponent && isEasyComponent(tag);
|
|
5238
|
+
if (!isEasyCom) {
|
|
5221
5239
|
const fromSetup = resolveSetupReference(tag, context);
|
|
5222
5240
|
if (fromSetup) {
|
|
5223
5241
|
return fromSetup;
|
|
@@ -5230,7 +5248,8 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
5230
5248
|
}
|
|
5231
5249
|
}
|
|
5232
5250
|
}
|
|
5233
|
-
if (
|
|
5251
|
+
if (// fixed by xxxxxx
|
|
5252
|
+
!isEasyCom && context.selfName && shared.capitalize(shared.camelize(tag)) === context.selfName) {
|
|
5234
5253
|
context.helper(RESOLVE_COMPONENT);
|
|
5235
5254
|
context.components.add(tag + `__self`);
|
|
5236
5255
|
return toValidAssetId(tag, `component`);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
import { isString, NOOP, isObject,
|
|
6
|
+
import { isString, NOOP, isObject, extend, NO, capitalize, camelize, isSymbol, isArray, EMPTY_OBJ, PatchFlagNames, slotFlagsText, isOn, isBuiltInDirective, isReservedProp, toHandlerKey } from '@vue/shared';
|
|
7
7
|
export { generateCodeFrame } from '@vue/shared';
|
|
8
8
|
import { parseExpression } from '@babel/parser';
|
|
9
9
|
|
|
@@ -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;
|
|
@@ -2296,6 +2303,7 @@ function onText(content, start, end) {
|
|
|
2296
2303
|
}
|
|
2297
2304
|
}
|
|
2298
2305
|
function onCloseTag(el, end, isImplied = false) {
|
|
2306
|
+
var _a;
|
|
2299
2307
|
if (isImplied) {
|
|
2300
2308
|
setLocEnd(el.loc, backTrack(end, 60));
|
|
2301
2309
|
} else {
|
|
@@ -2320,6 +2328,13 @@ function onCloseTag(el, end, isImplied = false) {
|
|
|
2320
2328
|
el.tagType = 3;
|
|
2321
2329
|
} else if (isComponent(el)) {
|
|
2322
2330
|
el.tagType = 1;
|
|
2331
|
+
const importSources = (_a = currentOptions.bindingMetadata) == null ? void 0 : _a.__importSources;
|
|
2332
|
+
if (importSources) {
|
|
2333
|
+
const source = importSources[tag] || importSources[capitalize(camelize(tag))] || importSources[camelize(tag)] || importSources[capitalize(tag)];
|
|
2334
|
+
if (source) {
|
|
2335
|
+
el.importSource = source;
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2323
2338
|
}
|
|
2324
2339
|
}
|
|
2325
2340
|
if (!tokenizer.inRCDATA) {
|
|
@@ -2865,6 +2880,8 @@ function createTransformContext(root, {
|
|
|
2865
2880
|
transformHoist = null,
|
|
2866
2881
|
isBuiltInComponent = NOOP,
|
|
2867
2882
|
isCustomElement = NOOP,
|
|
2883
|
+
// fixed by xxxxxx
|
|
2884
|
+
isEasyComponent = NOOP,
|
|
2868
2885
|
expressionPlugins = [],
|
|
2869
2886
|
scopeId = null,
|
|
2870
2887
|
slotted = true,
|
|
@@ -2892,6 +2909,8 @@ function createTransformContext(root, {
|
|
|
2892
2909
|
transformHoist,
|
|
2893
2910
|
isBuiltInComponent,
|
|
2894
2911
|
isCustomElement,
|
|
2912
|
+
// fixed by xxxxxx
|
|
2913
|
+
isEasyComponent,
|
|
2895
2914
|
expressionPlugins,
|
|
2896
2915
|
scopeId,
|
|
2897
2916
|
slotted,
|
|
@@ -4628,6 +4647,8 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
4628
4647
|
context.helper(builtIn);
|
|
4629
4648
|
return builtIn;
|
|
4630
4649
|
}
|
|
4650
|
+
const isEasyComponent = context.isEasyComponent;
|
|
4651
|
+
isEasyComponent && isEasyComponent(tag);
|
|
4631
4652
|
context.helper(RESOLVE_COMPONENT);
|
|
4632
4653
|
context.components.add(tag);
|
|
4633
4654
|
return toValidAssetId(tag, `component`);
|
|
@@ -5387,8 +5408,7 @@ const transformModel = (dir, node, context) => {
|
|
|
5387
5408
|
context.onError(createCompilerError(44, exp.loc));
|
|
5388
5409
|
return createTransformProps();
|
|
5389
5410
|
}
|
|
5390
|
-
|
|
5391
|
-
if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) {
|
|
5411
|
+
if (!expString.trim() || !isMemberExpression(expString) && true) {
|
|
5392
5412
|
context.onError(
|
|
5393
5413
|
createCompilerError(42, exp.loc)
|
|
5394
5414
|
);
|