@vureact/compiler-core 1.6.0 → 1.6.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vureact/compiler-core v1.6.
|
|
2
|
+
* @vureact/compiler-core v1.6.2
|
|
3
3
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -39,7 +39,7 @@ var RUNTIME_PACKAGES = {
|
|
|
39
39
|
},
|
|
40
40
|
runtime: {
|
|
41
41
|
name: PACKAGE_NAME.runtime,
|
|
42
|
-
version: "^1.0
|
|
42
|
+
version: "^1.1.0"
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
var STYLE_MODULE_NAME = "$style";
|
|
@@ -324,6 +324,11 @@ var ADAPTER_RULES = {
|
|
|
324
324
|
target: "nextTick",
|
|
325
325
|
package: PACKAGE_NAME.runtime,
|
|
326
326
|
type: "rename"
|
|
327
|
+
},
|
|
328
|
+
defineAsyncComponent: {
|
|
329
|
+
target: "defineAsyncComponent",
|
|
330
|
+
package: PACKAGE_NAME.runtime,
|
|
331
|
+
type: "rename"
|
|
327
332
|
}
|
|
328
333
|
},
|
|
329
334
|
// =================== [VuReact Router] ===================
|
|
@@ -1053,7 +1058,7 @@ function buildStandardProp(nodeIR) {
|
|
|
1053
1058
|
babelExp: { ast: keyAST },
|
|
1054
1059
|
value: {
|
|
1055
1060
|
content,
|
|
1056
|
-
isStringLiteral:
|
|
1061
|
+
isStringLiteral: isStringLiteral13,
|
|
1057
1062
|
babelExp: { ast: valueAST }
|
|
1058
1063
|
}
|
|
1059
1064
|
} = nodeIR;
|
|
@@ -1062,7 +1067,7 @@ function buildStandardProp(nodeIR) {
|
|
|
1062
1067
|
}
|
|
1063
1068
|
let value;
|
|
1064
1069
|
if (content !== "true") {
|
|
1065
|
-
value =
|
|
1070
|
+
value = isStringLiteral13 ? t9.stringLiteral(content) : buildJsxExpressionNode(valueAST);
|
|
1066
1071
|
}
|
|
1067
1072
|
return t9.jsxAttribute(keyAST, value);
|
|
1068
1073
|
}
|
|
@@ -2991,98 +2996,22 @@ function resolveDefineAsyncComponent(ctx) {
|
|
|
2991
2996
|
return;
|
|
2992
2997
|
}
|
|
2993
2998
|
const [arg] = node.arguments;
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
function checkIsUnsupported(ctx, arg) {
|
|
3001
|
-
if (t25.isFunction(arg)) {
|
|
3002
|
-
checkIsDynamicImport(ctx, arg);
|
|
3003
|
-
} else if (t25.isObjectExpression(arg)) {
|
|
3004
|
-
const { value } = arg.properties.find(
|
|
3005
|
-
(p) => t25.isObjectProperty(p) && t25.isIdentifier(p.key) && p.key.name === "loader"
|
|
3006
|
-
);
|
|
3007
|
-
checkIsDynamicImport(ctx, value);
|
|
3008
|
-
if (arg.properties.length > 1) {
|
|
3009
|
-
warnMultipleOptionsUsed(ctx, arg);
|
|
3010
|
-
}
|
|
3011
|
-
}
|
|
3012
|
-
}
|
|
3013
|
-
function checkIsDynamicImport(ctx, node) {
|
|
3014
|
-
const { scriptData, filename } = ctx;
|
|
3015
|
-
const warnIsNotImport = (target) => {
|
|
3016
|
-
if (!target || !t25.isImport(target)) {
|
|
3017
|
-
logger.error(
|
|
3018
|
-
`Only ES module dynamic imports are supported. You must use and return import('...').`,
|
|
3019
|
-
{
|
|
3020
|
-
source: scriptData.source,
|
|
3021
|
-
file: filename,
|
|
3022
|
-
loc: target?.loc || {}
|
|
2999
|
+
if (!t25.isObjectExpression(arg)) {
|
|
3000
|
+
return;
|
|
3001
|
+
}
|
|
3002
|
+
for (const prop of arg.properties) {
|
|
3003
|
+
if (!t25.isObjectProperty(prop) || !t25.isIdentifier(prop.key) || prop.key.name !== "hydrate") {
|
|
3004
|
+
continue;
|
|
3023
3005
|
}
|
|
3024
|
-
|
|
3006
|
+
logger.warn('Unsupported option "hydrate"', {
|
|
3007
|
+
file: ctx.filename,
|
|
3008
|
+
source: ctx.scriptData.source,
|
|
3009
|
+
loc: prop.key.loc
|
|
3010
|
+
});
|
|
3011
|
+
break;
|
|
3012
|
+
}
|
|
3025
3013
|
}
|
|
3026
3014
|
};
|
|
3027
|
-
if (t25.isFunction(node)) {
|
|
3028
|
-
checkIsDynamicImport(ctx, node.body);
|
|
3029
|
-
return;
|
|
3030
|
-
}
|
|
3031
|
-
if (t25.isBlockStatement(node)) {
|
|
3032
|
-
const [returnSmt] = node.body;
|
|
3033
|
-
if (t25.isReturnStatement(returnSmt)) {
|
|
3034
|
-
warnIsNotImport(returnSmt.argument);
|
|
3035
|
-
}
|
|
3036
|
-
return;
|
|
3037
|
-
}
|
|
3038
|
-
if (t25.isCallExpression(node)) {
|
|
3039
|
-
warnIsNotImport(node.callee);
|
|
3040
|
-
if (t25.isStringLiteral(node.arguments[0])) {
|
|
3041
|
-
replaceVueSuffix(node.arguments[0]);
|
|
3042
|
-
}
|
|
3043
|
-
return;
|
|
3044
|
-
}
|
|
3045
|
-
warnIsNotImport(node);
|
|
3046
|
-
}
|
|
3047
|
-
function warnMultipleOptionsUsed(ctx, node) {
|
|
3048
|
-
const { scriptData, filename } = ctx;
|
|
3049
|
-
logger.warn(
|
|
3050
|
-
"Only the loader option is supported. Other options may be implemented manually based on your needs.",
|
|
3051
|
-
{
|
|
3052
|
-
source: scriptData.source,
|
|
3053
|
-
file: filename,
|
|
3054
|
-
loc: node.loc
|
|
3055
|
-
}
|
|
3056
|
-
);
|
|
3057
|
-
}
|
|
3058
|
-
function pushToGlobalScope(path9, ctx) {
|
|
3059
|
-
const { node } = path9;
|
|
3060
|
-
const callee = node.callee;
|
|
3061
|
-
callee.name = REACT_API_MAP.lazy;
|
|
3062
|
-
callee.loc.identifierName = REACT_API_MAP.lazy;
|
|
3063
|
-
if (node.typeParameters) {
|
|
3064
|
-
node.typeParameters = void 0;
|
|
3065
|
-
}
|
|
3066
|
-
let declarationPath = path9.parentPath;
|
|
3067
|
-
while (declarationPath) {
|
|
3068
|
-
if (declarationPath.isVariableDeclaration()) {
|
|
3069
|
-
break;
|
|
3070
|
-
}
|
|
3071
|
-
declarationPath = declarationPath.parentPath;
|
|
3072
|
-
}
|
|
3073
|
-
let fullNode;
|
|
3074
|
-
if (declarationPath?.isVariableDeclaration()) {
|
|
3075
|
-
fullNode = declarationPath.node;
|
|
3076
|
-
declarationPath.remove();
|
|
3077
|
-
} else if (path9.parentPath.isVariableDeclarator()) {
|
|
3078
|
-
fullNode = path9.parent;
|
|
3079
|
-
path9.parentPath.remove();
|
|
3080
|
-
} else {
|
|
3081
|
-
fullNode = path9.node;
|
|
3082
|
-
path9.remove();
|
|
3083
|
-
}
|
|
3084
|
-
const scriptIR = getScriptIR(ctx);
|
|
3085
|
-
scriptIR.statement.global.push(fullNode);
|
|
3086
3015
|
}
|
|
3087
3016
|
|
|
3088
3017
|
// src/core/transform/sfc/script/syntax-processor/preprocess/resolve-define-expose.ts
|
|
@@ -4903,6 +4832,10 @@ function resolveRenameAdapter(ctx) {
|
|
|
4903
4832
|
};
|
|
4904
4833
|
}
|
|
4905
4834
|
function isVueApiReference2(path9, apiName) {
|
|
4835
|
+
const whitelist = [VUE_API_MAP.defineAsyncComponent];
|
|
4836
|
+
if (whitelist.includes(apiName)) {
|
|
4837
|
+
return true;
|
|
4838
|
+
}
|
|
4906
4839
|
if (path9.isIdentifier()) {
|
|
4907
4840
|
if (path9.parentPath.isCallExpression() && path9.parentPath.node.callee === path9.node) {
|
|
4908
4841
|
return false;
|
|
@@ -5070,7 +5003,7 @@ import * as t45 from "@babel/types";
|
|
|
5070
5003
|
var strCodeTypes = {
|
|
5071
5004
|
isIdentifier: isIdentifier24,
|
|
5072
5005
|
isSimpleExpression,
|
|
5073
|
-
isStringLiteral:
|
|
5006
|
+
isStringLiteral: isStringLiteral12
|
|
5074
5007
|
};
|
|
5075
5008
|
function isSimpleExpression(code, excludeVar = false) {
|
|
5076
5009
|
let node;
|
|
@@ -5107,7 +5040,7 @@ function isIdentifier24(code) {
|
|
|
5107
5040
|
return false;
|
|
5108
5041
|
}
|
|
5109
5042
|
}
|
|
5110
|
-
function
|
|
5043
|
+
function isStringLiteral12(code) {
|
|
5111
5044
|
try {
|
|
5112
5045
|
const node = parseExpression3(code);
|
|
5113
5046
|
return t45.isStringLiteral(node);
|
|
@@ -5254,21 +5187,21 @@ function resolvePropAsBabelExp(ir, ctx) {
|
|
|
5254
5187
|
target.content = valueName;
|
|
5255
5188
|
target.ast = t46.jsxIdentifier(valueName);
|
|
5256
5189
|
};
|
|
5257
|
-
const setValueExpression = (target, content,
|
|
5190
|
+
const setValueExpression = (target, content, isStringLiteral13) => {
|
|
5258
5191
|
target.content = content;
|
|
5259
|
-
target.ast = resolveStringExpr(content, ctx,
|
|
5192
|
+
target.ast = resolveStringExpr(content, ctx, isStringLiteral13);
|
|
5260
5193
|
};
|
|
5261
5194
|
const createRuntimeCall = (fnName, args) => {
|
|
5262
5195
|
const fnArgs = args.filter(Boolean).join(",");
|
|
5263
5196
|
return `${fnName}(${fnArgs})`;
|
|
5264
5197
|
};
|
|
5265
|
-
const applyRuntimeExpression = (expression, setName = false, nameIdentifier,
|
|
5198
|
+
const applyRuntimeExpression = (expression, setName = false, nameIdentifier, isStringLiteral13) => {
|
|
5266
5199
|
if (setName && nameIdentifier) {
|
|
5267
5200
|
setNameIdentifier(nameExp, nameIdentifier);
|
|
5268
5201
|
}
|
|
5269
5202
|
const dir = ADAPTER_RULES.runtime.dir;
|
|
5270
5203
|
recordImport(ctx, dir.package, dir.target);
|
|
5271
|
-
setValueExpression(value.babelExp, expression,
|
|
5204
|
+
setValueExpression(value.babelExp, expression, isStringLiteral13);
|
|
5272
5205
|
};
|
|
5273
5206
|
if (ir.isKeyLessVBind) {
|
|
5274
5207
|
const dirKeyless = ADAPTER_RULES.runtime.dirKeyless;
|
|
@@ -5617,31 +5550,47 @@ function collectComponentRef(tag, ctx) {
|
|
|
5617
5550
|
// src/core/transform/sfc/template/syntax-processor/process/props/resolve-template-key.ts
|
|
5618
5551
|
import {
|
|
5619
5552
|
ConstantTypes,
|
|
5620
|
-
|
|
5553
|
+
ElementTypes as VueElementTypes,
|
|
5554
|
+
NodeTypes as VueNodeTypes
|
|
5621
5555
|
} from "@vue/compiler-core";
|
|
5622
|
-
function resolveTemplateNodeKey(
|
|
5623
|
-
const
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
(
|
|
5556
|
+
function resolveTemplateNodeKey(templNode, keyContent, ctx) {
|
|
5557
|
+
const { filename, source } = ctx;
|
|
5558
|
+
const { children, loc } = templNode;
|
|
5559
|
+
if (children.length > 1) {
|
|
5560
|
+
logger.warn(
|
|
5561
|
+
"Expected <template> with `:key` to have a single parent element; otherwise, the key cannot be transferred to the first child.",
|
|
5562
|
+
{
|
|
5563
|
+
file: filename,
|
|
5564
|
+
source,
|
|
5565
|
+
loc
|
|
5566
|
+
}
|
|
5567
|
+
);
|
|
5568
|
+
return;
|
|
5569
|
+
}
|
|
5570
|
+
const [firstChild] = children;
|
|
5571
|
+
if (firstChild?.type !== VueNodeTypes.ELEMENT || firstChild.tagType === VueElementTypes.TEMPLATE || firstChild.tagType === VueElementTypes.SLOT) {
|
|
5572
|
+
return;
|
|
5573
|
+
}
|
|
5574
|
+
const hasKeyProp = firstChild.props.some(
|
|
5575
|
+
(p) => p.type === VueNodeTypes.DIRECTIVE && p.name === "key"
|
|
5627
5576
|
);
|
|
5628
5577
|
if (hasKeyProp) return;
|
|
5629
|
-
|
|
5578
|
+
firstChild.props.push(createSimpleVueBind("key", keyContent));
|
|
5630
5579
|
}
|
|
5631
5580
|
function createSimpleVueBind(name, value) {
|
|
5632
5581
|
return {
|
|
5633
|
-
type:
|
|
5582
|
+
type: VueNodeTypes.DIRECTIVE,
|
|
5634
5583
|
name: "bind",
|
|
5635
5584
|
rawName: `:${name}`,
|
|
5636
5585
|
exp: {
|
|
5637
|
-
type:
|
|
5586
|
+
type: VueNodeTypes.SIMPLE_EXPRESSION,
|
|
5638
5587
|
content: value,
|
|
5639
5588
|
isStatic: false,
|
|
5640
5589
|
constType: ConstantTypes.NOT_CONSTANT,
|
|
5641
5590
|
loc: {}
|
|
5642
5591
|
},
|
|
5643
5592
|
arg: {
|
|
5644
|
-
type:
|
|
5593
|
+
type: VueNodeTypes.SIMPLE_EXPRESSION,
|
|
5645
5594
|
content: name,
|
|
5646
5595
|
isStatic: true,
|
|
5647
5596
|
constType: ConstantTypes.CAN_STRINGIFY,
|
|
@@ -5668,7 +5617,7 @@ function resolveDynamicAttributeProp(directive, ir, ctx, vueNode, nodeIR) {
|
|
|
5668
5617
|
return;
|
|
5669
5618
|
}
|
|
5670
5619
|
if (vueNode.tag === "template" && name === "key") {
|
|
5671
|
-
resolveTemplateNodeKey(vueNode, content);
|
|
5620
|
+
resolveTemplateNodeKey(vueNode, content, ctx);
|
|
5672
5621
|
return;
|
|
5673
5622
|
}
|
|
5674
5623
|
const propIR = createPropsIR(directive.rawName, name, content);
|
|
@@ -5686,12 +5635,12 @@ function resolvePropertyIR(propsIR, ir, ctx, nodeIR, isDynamic = false) {
|
|
|
5686
5635
|
content = propsIR.value.content = parseStyleString(content);
|
|
5687
5636
|
}
|
|
5688
5637
|
if (isDynamic) {
|
|
5689
|
-
const
|
|
5690
|
-
if (
|
|
5638
|
+
const isStringLiteral13 = strCodeTypes.isStringLiteral(content);
|
|
5639
|
+
if (isStringLiteral13) {
|
|
5691
5640
|
content = normalizeString(content);
|
|
5692
5641
|
propsIR.value.content = content;
|
|
5693
5642
|
}
|
|
5694
|
-
propsIR.value.isStringLiteral =
|
|
5643
|
+
propsIR.value.isStringLiteral = isStringLiteral13;
|
|
5695
5644
|
}
|
|
5696
5645
|
const existing = findSameProp(nodeIR.props, propsIR);
|
|
5697
5646
|
if (existing) {
|
|
@@ -5776,14 +5725,14 @@ function resolveDirectiveProp(directive, ir, ctx, vueNode, nodeIR, siblingNodesI
|
|
|
5776
5725
|
}
|
|
5777
5726
|
|
|
5778
5727
|
// src/core/transform/sfc/template/syntax-processor/process/props/resolve-props.ts
|
|
5779
|
-
import { NodeTypes as
|
|
5728
|
+
import { NodeTypes as NodeTypes6 } from "@vue/compiler-core";
|
|
5780
5729
|
function resolveProps(vueNode, ir, ctx, nodeIR, siblingNodesIR) {
|
|
5781
5730
|
for (const prop of vueNode.props) {
|
|
5782
|
-
if (prop.type ===
|
|
5731
|
+
if (prop.type === NodeTypes6.ATTRIBUTE) {
|
|
5783
5732
|
resolveAttributeProp(prop, ir, ctx, nodeIR);
|
|
5784
5733
|
continue;
|
|
5785
5734
|
}
|
|
5786
|
-
if (prop.type ===
|
|
5735
|
+
if (prop.type === NodeTypes6.DIRECTIVE) {
|
|
5787
5736
|
const stop = resolveDirectiveProp(
|
|
5788
5737
|
prop,
|
|
5789
5738
|
ir,
|
|
@@ -5918,7 +5867,7 @@ function resolveVMemo(directive, _ir, ctx, nodeIR) {
|
|
|
5918
5867
|
// src/core/transform/sfc/template/syntax-processor/process/props/resolve-v-model.ts
|
|
5919
5868
|
import {
|
|
5920
5869
|
ElementTypes,
|
|
5921
|
-
NodeTypes as
|
|
5870
|
+
NodeTypes as NodeTypes7
|
|
5922
5871
|
} from "@vue/compiler-core";
|
|
5923
5872
|
function resolveVModel(directive, ir, ctx, vueNode, nodeIR) {
|
|
5924
5873
|
const arg = directive.arg;
|
|
@@ -5970,7 +5919,7 @@ function resolveModelPropName(inputType, isComponent = false) {
|
|
|
5970
5919
|
}
|
|
5971
5920
|
function getRadioValue(vueNode) {
|
|
5972
5921
|
const valueAttr = vueNode.props.find(
|
|
5973
|
-
(prop) => prop.type ===
|
|
5922
|
+
(prop) => prop.type === NodeTypes7.ATTRIBUTE && prop.name === "value"
|
|
5974
5923
|
);
|
|
5975
5924
|
if (!valueAttr?.value?.content) return '""';
|
|
5976
5925
|
const content = valueAttr.value.content;
|
|
@@ -5980,7 +5929,7 @@ function resolveHtmlInput(node, isComponent) {
|
|
|
5980
5929
|
if (isComponent) return;
|
|
5981
5930
|
if (node.tag !== "input") return node.tag;
|
|
5982
5931
|
const typeProp = node.props.find(
|
|
5983
|
-
(prop) => prop.type ===
|
|
5932
|
+
(prop) => prop.type === NodeTypes7.ATTRIBUTE && prop.name === "type"
|
|
5984
5933
|
);
|
|
5985
5934
|
return typeProp?.value?.content?.toLowerCase();
|
|
5986
5935
|
}
|
|
@@ -6170,20 +6119,20 @@ function resolveInterpolationNode(node, _ir, ctx, childrenIR) {
|
|
|
6170
6119
|
}
|
|
6171
6120
|
|
|
6172
6121
|
// src/core/transform/sfc/template/syntax-processor/process/resolve-slot-outlet-node.ts
|
|
6173
|
-
import { NodeTypes as
|
|
6122
|
+
import { NodeTypes as NodeTypes9 } from "@vue/compiler-core";
|
|
6174
6123
|
|
|
6175
6124
|
// src/core/transform/sfc/template/syntax-processor/process/resolve-template-children.ts
|
|
6176
6125
|
import {
|
|
6177
6126
|
isSlotOutlet as isSlotOutlet2,
|
|
6178
|
-
NodeTypes as
|
|
6127
|
+
NodeTypes as VueNodeTypes2
|
|
6179
6128
|
} from "@vue/compiler-core";
|
|
6180
6129
|
|
|
6181
6130
|
// src/core/transform/sfc/template/syntax-processor/process/resolve-template-v-slot-node.ts
|
|
6182
|
-
import { NodeTypes as
|
|
6131
|
+
import { NodeTypes as NodeTypes8 } from "@vue/compiler-core";
|
|
6183
6132
|
function resolveTemplateVSlotNode(node, ir, ctx, nodeIR) {
|
|
6184
6133
|
let slotIR = {};
|
|
6185
6134
|
for (const prop of node.props) {
|
|
6186
|
-
if (prop.type ===
|
|
6135
|
+
if (prop.type === NodeTypes8.DIRECTIVE) {
|
|
6187
6136
|
slotIR = resolveVSlotProp(prop, ir, ctx);
|
|
6188
6137
|
}
|
|
6189
6138
|
}
|
|
@@ -6213,7 +6162,7 @@ function resolveTemplateChildren(node, nodeIR, ctx) {
|
|
|
6213
6162
|
}
|
|
6214
6163
|
function resolveChildNodes(node, nodeIR, ctx, parentIR, childrenIR) {
|
|
6215
6164
|
for (const child of node.children) {
|
|
6216
|
-
if (child.type ===
|
|
6165
|
+
if (child.type === VueNodeTypes2.ELEMENT) {
|
|
6217
6166
|
if (isSlotOutlet2(child)) {
|
|
6218
6167
|
resolveSlotOutletNode(child, nodeIR, ctx, parentIR, childrenIR);
|
|
6219
6168
|
continue;
|
|
@@ -6232,15 +6181,15 @@ function resolveChildNodes(node, nodeIR, ctx, parentIR, childrenIR) {
|
|
|
6232
6181
|
}
|
|
6233
6182
|
continue;
|
|
6234
6183
|
}
|
|
6235
|
-
if (child.type ===
|
|
6184
|
+
if (child.type === VueNodeTypes2.INTERPOLATION) {
|
|
6236
6185
|
resolveInterpolationNode(child, nodeIR, ctx, childrenIR);
|
|
6237
6186
|
continue;
|
|
6238
6187
|
}
|
|
6239
|
-
if (child.type ===
|
|
6188
|
+
if (child.type === VueNodeTypes2.TEXT) {
|
|
6240
6189
|
resolveTextNode(child, nodeIR, ctx, childrenIR);
|
|
6241
6190
|
continue;
|
|
6242
6191
|
}
|
|
6243
|
-
if (child.type ===
|
|
6192
|
+
if (child.type === VueNodeTypes2.COMMENT) {
|
|
6244
6193
|
resolveCommentNode(child, nodeIR, ctx, childrenIR);
|
|
6245
6194
|
}
|
|
6246
6195
|
}
|
|
@@ -6283,7 +6232,7 @@ function resolveSlotProps(node, ctx) {
|
|
|
6283
6232
|
});
|
|
6284
6233
|
};
|
|
6285
6234
|
for (const prop of node.props) {
|
|
6286
|
-
if (prop.type ===
|
|
6235
|
+
if (prop.type === NodeTypes9.ATTRIBUTE) {
|
|
6287
6236
|
const attr = prop.name;
|
|
6288
6237
|
const value = prop.value?.content.trim();
|
|
6289
6238
|
if (attr === "name" && value) {
|
|
@@ -6293,7 +6242,7 @@ function resolveSlotProps(node, ctx) {
|
|
|
6293
6242
|
}
|
|
6294
6243
|
continue;
|
|
6295
6244
|
}
|
|
6296
|
-
if (prop.type ===
|
|
6245
|
+
if (prop.type === NodeTypes9.DIRECTIVE) {
|
|
6297
6246
|
const arg = prop.arg;
|
|
6298
6247
|
const exp = prop.exp;
|
|
6299
6248
|
warnUnsupportedVueDollarVar(ctx, prop);
|
|
@@ -6325,7 +6274,7 @@ function resolveSlotNode(parentIR, node, nodeIR, slotContext, ctx) {
|
|
|
6325
6274
|
}
|
|
6326
6275
|
if (fallback.length === 1) {
|
|
6327
6276
|
const child = fallback[0];
|
|
6328
|
-
if (child.type ===
|
|
6277
|
+
if (child.type === NodeTypes9.TEXT) {
|
|
6329
6278
|
fallbackResolved = true;
|
|
6330
6279
|
expression += ` ?? ${JSON.stringify(child.content.trim())}`;
|
|
6331
6280
|
}
|
|
@@ -6387,7 +6336,7 @@ function transform(ast, ctx, options) {
|
|
|
6387
6336
|
}
|
|
6388
6337
|
|
|
6389
6338
|
// package.json
|
|
6390
|
-
var version = "1.6.
|
|
6339
|
+
var version = "1.6.2";
|
|
6391
6340
|
var bin = {
|
|
6392
6341
|
vureact: "./bin/vureact.js"
|
|
6393
6342
|
};
|
package/lib/cli.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @vureact/compiler-core v1.6.
|
|
3
|
+
* @vureact/compiler-core v1.6.2
|
|
4
4
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
getDirname,
|
|
14
14
|
normalizePath,
|
|
15
15
|
version
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SRBJ5B5X.esm.js";
|
|
17
17
|
|
|
18
18
|
// src/cli/index.ts
|
|
19
19
|
import { cac } from "cac";
|
package/lib/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
3
|
-
* @vureact/compiler-core v1.6.
|
|
3
|
+
* @vureact/compiler-core v1.6.2
|
|
4
4
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkFLZ5AUPGjs = require('./chunk-FLZ5AUPG.js');
|
|
17
17
|
|
|
18
18
|
// src/cli/index.ts
|
|
19
19
|
var _cac = require('cac');
|
|
@@ -76,7 +76,7 @@ var _ora = require('ora'); var _ora2 = _interopRequireDefault(_ora);
|
|
|
76
76
|
|
|
77
77
|
function setupWatcher(compiler, config) {
|
|
78
78
|
const spinner = _ora2.default.call(void 0, );
|
|
79
|
-
const cmpHelper = new (0,
|
|
79
|
+
const cmpHelper = new (0, _chunkFLZ5AUPGjs.Helper)(config);
|
|
80
80
|
const watcher = _chokidar2.default.watch(cmpHelper.getInputPath(), {
|
|
81
81
|
ignored: cmpHelper.getExcludes(),
|
|
82
82
|
persistent: true,
|
|
@@ -111,7 +111,7 @@ function setupWatcher(compiler, config) {
|
|
|
111
111
|
const fn = processors[ext];
|
|
112
112
|
const unit = await fn(filePath);
|
|
113
113
|
cmpHelper.printCoreLogs();
|
|
114
|
-
cmpHelper.printCompileInfo(filePath,
|
|
114
|
+
cmpHelper.printCompileInfo(filePath, _chunkFLZ5AUPGjs.calcElapsedTime.call(void 0, startTime));
|
|
115
115
|
if (unit) {
|
|
116
116
|
await _optionalChain([config, 'access', _5 => _5.onChange, 'optionalCall', _6 => _6(event, unit)]);
|
|
117
117
|
}
|
|
@@ -120,7 +120,7 @@ function setupWatcher(compiler, config) {
|
|
|
120
120
|
await compiler.processAsset(filePath);
|
|
121
121
|
cmpHelper.print(
|
|
122
122
|
_kleur2.default.blue("Copied Asset"),
|
|
123
|
-
_kleur2.default.dim(
|
|
123
|
+
_kleur2.default.dim(_chunkFLZ5AUPGjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
spinner.stop();
|
|
@@ -133,7 +133,7 @@ function setupWatcher(compiler, config) {
|
|
|
133
133
|
await compiler.removeOutputPath(filePath, type2);
|
|
134
134
|
cmpHelper.print(
|
|
135
135
|
_kleur2.default.yellow("Removed"),
|
|
136
|
-
_kleur2.default.dim(
|
|
136
|
+
_kleur2.default.dim(_chunkFLZ5AUPGjs.normalizePath.call(void 0, cmpHelper.relativePath(filePath)))
|
|
137
137
|
);
|
|
138
138
|
};
|
|
139
139
|
if (type === "unlink") {
|
|
@@ -166,7 +166,7 @@ async function resolveAction(root, options) {
|
|
|
166
166
|
const projectRoot = root ? _path2.default.resolve(process.cwd(), root) : process.cwd();
|
|
167
167
|
const userConfig = await loadUserConfig(projectRoot);
|
|
168
168
|
const finalConfig = mergeConfig(projectRoot, options, userConfig);
|
|
169
|
-
const compiler = new (0,
|
|
169
|
+
const compiler = new (0, _chunkFLZ5AUPGjs.VuReact)(finalConfig);
|
|
170
170
|
await compiler.execute();
|
|
171
171
|
if (finalConfig.watch) {
|
|
172
172
|
setupWatcher(compiler, finalConfig);
|
|
@@ -189,7 +189,7 @@ function resolveOptions(command) {
|
|
|
189
189
|
|
|
190
190
|
|
|
191
191
|
var _updatenotifier = require('update-notifier'); var _updatenotifier2 = _interopRequireDefault(_updatenotifier);
|
|
192
|
-
var __dirname =
|
|
192
|
+
var __dirname = _chunkFLZ5AUPGjs.getDirname.call(void 0, import.meta.url);
|
|
193
193
|
function checkForUpdates() {
|
|
194
194
|
try {
|
|
195
195
|
const possiblePaths = [
|
|
@@ -229,7 +229,7 @@ function checkForUpdates() {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
// src/cli/index.ts
|
|
232
|
-
var [programName] = Object.keys(
|
|
232
|
+
var [programName] = Object.keys(_chunkFLZ5AUPGjs.bin);
|
|
233
233
|
var cli = _cac.cac.call(void 0, programName);
|
|
234
234
|
checkForUpdates();
|
|
235
235
|
var buildCommand = cli.command("build [root]", "Compile Vue3 to React (one-time)");
|
|
@@ -240,4 +240,4 @@ var watchCommand = cli.command("watch [root]", "Compile Vue3 to React and watch
|
|
|
240
240
|
resolveOptions(watchCommand).action((root, options) => {
|
|
241
241
|
resolveAction(root, { ...options, watch: true });
|
|
242
242
|
});
|
|
243
|
-
cli.help().version(
|
|
243
|
+
cli.help().version(_chunkFLZ5AUPGjs.version).parse();
|
package/lib/compiler-core.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vureact/compiler-core v1.6.
|
|
2
|
+
* @vureact/compiler-core v1.6.2
|
|
3
3
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parseOnlyScript,
|
|
19
19
|
parseSFC,
|
|
20
20
|
transform
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SRBJ5B5X.esm.js";
|
|
22
22
|
export {
|
|
23
23
|
BaseCompiler,
|
|
24
24
|
CacheKey,
|
package/lib/compiler-core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* @vureact/compiler-core v1.6.
|
|
2
|
+
* @vureact/compiler-core v1.6.2
|
|
3
3
|
* (c) 2025-present Ruihong Zhong (Ryan John)
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkFLZ5AUPGjs = require('./chunk-FLZ5AUPG.js');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -33,4 +33,4 @@ var _chunkZZVHHUP3js = require('./chunk-ZZVHHUP3.js');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
exports.BaseCompiler =
|
|
36
|
+
exports.BaseCompiler = _chunkFLZ5AUPGjs.BaseCompiler; exports.CacheKey = _chunkFLZ5AUPGjs.CacheKey; exports.FileCompiler = _chunkFLZ5AUPGjs.FileCompiler; exports.Helper = _chunkFLZ5AUPGjs.Helper; exports.VuReact = _chunkFLZ5AUPGjs.VuReact; exports.defineConfig = _chunkFLZ5AUPGjs.defineConfig; exports.generate = _chunkFLZ5AUPGjs.generate; exports.generateComponent = _chunkFLZ5AUPGjs.generateComponent; exports.generateOnlyScript = _chunkFLZ5AUPGjs.generateOnlyScript; exports.parse = _chunkFLZ5AUPGjs.parse; exports.parseOnlyScript = _chunkFLZ5AUPGjs.parseOnlyScript; exports.parseSFC = _chunkFLZ5AUPGjs.parseSFC; exports.transform = _chunkFLZ5AUPGjs.transform;
|