@wevu/compiler 6.17.0 → 6.17.1
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/index.mjs +26 -26
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -242,7 +242,7 @@ function resolveWevuInternalImportModuleId(apiName) {
|
|
|
242
242
|
}
|
|
243
243
|
//#endregion
|
|
244
244
|
//#region src/utils/vueTemplateTags.ts
|
|
245
|
-
const RESERVED_VUE_COMPONENT_TAGS = new Set([
|
|
245
|
+
const RESERVED_VUE_COMPONENT_TAGS = /* @__PURE__ */ new Set([
|
|
246
246
|
"template",
|
|
247
247
|
"slot",
|
|
248
248
|
"component",
|
|
@@ -618,7 +618,7 @@ const __weapp_defineThemeJson = (config) => (__weapp_json_macro_values.push(conf
|
|
|
618
618
|
}
|
|
619
619
|
//#endregion
|
|
620
620
|
//#region src/plugins/vue/transform/jsonMacros/parse.ts
|
|
621
|
-
const JSON_MACROS = new Set([
|
|
621
|
+
const JSON_MACROS = /* @__PURE__ */ new Set([
|
|
622
622
|
"defineAppJson",
|
|
623
623
|
"definePageJson",
|
|
624
624
|
"defineComponentJson",
|
|
@@ -1298,7 +1298,7 @@ function collectWevuPageFeatureFlagsFromCode(code, options) {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
//#endregion
|
|
1300
1300
|
//#region src/plugins/wevu/pageFeatures/optionsObjects.ts
|
|
1301
|
-
const WEVU_FACTORY_NAMES = new Set([WE_VU_RUNTIME_APIS.defineComponent, WE_VU_RUNTIME_APIS.createWevuComponent]);
|
|
1301
|
+
const WEVU_FACTORY_NAMES = /* @__PURE__ */ new Set([WE_VU_RUNTIME_APIS.defineComponent, WE_VU_RUNTIME_APIS.createWevuComponent]);
|
|
1302
1302
|
const REGEXP_META_CHARS_RE = /[.*+?^${}()|[\]\\]/g;
|
|
1303
1303
|
function escapeRegExp(value) {
|
|
1304
1304
|
return value.replace(REGEXP_META_CHARS_RE, "\\$&");
|
|
@@ -1786,7 +1786,7 @@ async function collectWevuFeaturesFromSetupReachableImports(pageModule, setupFn,
|
|
|
1786
1786
|
async function collectWevuFeaturesFromCodeReachableImports(code, options) {
|
|
1787
1787
|
const { optionsObjects, module } = collectTargetOptionsObjectsFromCode(code, options.id, { astEngine: options.astEngine });
|
|
1788
1788
|
if (!optionsObjects.length) return /* @__PURE__ */ new Set();
|
|
1789
|
-
const moduleCache = new Map([[options.id, module]]);
|
|
1789
|
+
const moduleCache = /* @__PURE__ */ new Map([[options.id, module]]);
|
|
1790
1790
|
const enabled = /* @__PURE__ */ new Set();
|
|
1791
1791
|
for (const optionsObject of optionsObjects) {
|
|
1792
1792
|
const setupFn = getSetupFunctionFromOptionsObject(optionsObject);
|
|
@@ -2162,7 +2162,7 @@ function ensureRuntimeImport(program, importedName, localName = importedName) {
|
|
|
2162
2162
|
}
|
|
2163
2163
|
//#endregion
|
|
2164
2164
|
//#region src/plugins/vue/transform/transformScript/imports.ts
|
|
2165
|
-
const INTERNAL_RUNTIME_VALUE_EXPORTS = new Set([
|
|
2165
|
+
const INTERNAL_RUNTIME_VALUE_EXPORTS = /* @__PURE__ */ new Set([
|
|
2166
2166
|
"addMutationRecorder",
|
|
2167
2167
|
"batch",
|
|
2168
2168
|
"computed",
|
|
@@ -2332,7 +2332,7 @@ function splitWevuNamedImportsToInternalRuntime(path, program, state) {
|
|
|
2332
2332
|
function createImportVisitors(program, state) {
|
|
2333
2333
|
return { ImportDeclaration(path) {
|
|
2334
2334
|
if (path.node.source.value === "vue") {
|
|
2335
|
-
const movedVueRuntimeAPIs = new Set([
|
|
2335
|
+
const movedVueRuntimeAPIs = /* @__PURE__ */ new Set([
|
|
2336
2336
|
"useAttrs",
|
|
2337
2337
|
"useSlots",
|
|
2338
2338
|
"useModel",
|
|
@@ -3465,7 +3465,7 @@ function hasStaticPropertyInComponentExpression(componentExpr, keyName, program)
|
|
|
3465
3465
|
if (t.isObjectExpression(expr) && hasStaticPropertyWithSpreads(expr, keyName, program)) return true;
|
|
3466
3466
|
if (t.isIdentifier(expr)) {
|
|
3467
3467
|
const resolved = resolveObjectExpressionFromProgram(program, expr.name);
|
|
3468
|
-
if (resolved && hasStaticPropertyWithSpreads(resolved, keyName, program, new Set([expr.name]))) return true;
|
|
3468
|
+
if (resolved && hasStaticPropertyWithSpreads(resolved, keyName, program, /* @__PURE__ */ new Set([expr.name]))) return true;
|
|
3469
3469
|
}
|
|
3470
3470
|
}
|
|
3471
3471
|
return false;
|
|
@@ -3541,7 +3541,7 @@ function transformScript(source, options) {
|
|
|
3541
3541
|
const warn = resolveWarnHandler(options?.warn);
|
|
3542
3542
|
const state = {
|
|
3543
3543
|
transformed: false,
|
|
3544
|
-
defineComponentAliases: new Set([WE_VU_RUNTIME_APIS.defineComponent, "_defineComponent"]),
|
|
3544
|
+
defineComponentAliases: /* @__PURE__ */ new Set([WE_VU_RUNTIME_APIS.defineComponent, "_defineComponent"]),
|
|
3545
3545
|
defineComponentDecls: /* @__PURE__ */ new Map(),
|
|
3546
3546
|
defaultExportPath: null
|
|
3547
3547
|
};
|
|
@@ -3799,7 +3799,7 @@ function stripRenderOptionFromScript(source, filename, warn) {
|
|
|
3799
3799
|
} catch {
|
|
3800
3800
|
return source;
|
|
3801
3801
|
}
|
|
3802
|
-
const defineComponentAliases = new Set(["defineComponent", "_defineComponent"]);
|
|
3802
|
+
const defineComponentAliases = /* @__PURE__ */ new Set(["defineComponent", "_defineComponent"]);
|
|
3803
3803
|
const defineComponentDecls = /* @__PURE__ */ new Map();
|
|
3804
3804
|
let removedRender = false;
|
|
3805
3805
|
let removedJsonMacroImport = false;
|
|
@@ -4880,7 +4880,7 @@ function normalizeFsResolvedId(id, options) {
|
|
|
4880
4880
|
}
|
|
4881
4881
|
//#endregion
|
|
4882
4882
|
//#region src/plugins/utils/vueSfcBlockSrc.ts
|
|
4883
|
-
const SCRIPT_LANG_EXT = new Map([
|
|
4883
|
+
const SCRIPT_LANG_EXT = /* @__PURE__ */ new Map([
|
|
4884
4884
|
[".ts", "ts"],
|
|
4885
4885
|
[".tsx", "tsx"],
|
|
4886
4886
|
[".js", "js"],
|
|
@@ -4888,7 +4888,7 @@ const SCRIPT_LANG_EXT = new Map([
|
|
|
4888
4888
|
[".mjs", "js"],
|
|
4889
4889
|
[".cjs", "js"]
|
|
4890
4890
|
]);
|
|
4891
|
-
const STYLE_LANG_EXT = new Map([
|
|
4891
|
+
const STYLE_LANG_EXT = /* @__PURE__ */ new Map([
|
|
4892
4892
|
[".css", "css"],
|
|
4893
4893
|
[".scss", "scss"],
|
|
4894
4894
|
[".sass", "sass"],
|
|
@@ -4896,7 +4896,7 @@ const STYLE_LANG_EXT = new Map([
|
|
|
4896
4896
|
[".styl", "styl"],
|
|
4897
4897
|
[".stylus", "styl"]
|
|
4898
4898
|
]);
|
|
4899
|
-
const TEMPLATE_LANG_EXT = new Map([
|
|
4899
|
+
const TEMPLATE_LANG_EXT = /* @__PURE__ */ new Map([
|
|
4900
4900
|
[".html", "html"],
|
|
4901
4901
|
[".htm", "html"],
|
|
4902
4902
|
[".pug", "pug"],
|
|
@@ -5815,7 +5815,7 @@ function findSlotDirective(node) {
|
|
|
5815
5815
|
}
|
|
5816
5816
|
//#endregion
|
|
5817
5817
|
//#region src/plugins/vue/compiler/template/expression/scopedSlot.ts
|
|
5818
|
-
const SCOPED_SLOT_GLOBALS = new Set([
|
|
5818
|
+
const SCOPED_SLOT_GLOBALS = /* @__PURE__ */ new Set([
|
|
5819
5819
|
"Math",
|
|
5820
5820
|
"Number",
|
|
5821
5821
|
"Date",
|
|
@@ -6037,7 +6037,7 @@ function normalizeStyleBindingExpression(exp, context) {
|
|
|
6037
6037
|
}
|
|
6038
6038
|
//#endregion
|
|
6039
6039
|
//#region src/plugins/vue/compiler/template/expression/inline.ts
|
|
6040
|
-
const INLINE_GLOBALS = new Set([
|
|
6040
|
+
const INLINE_GLOBALS = /* @__PURE__ */ new Set([
|
|
6041
6041
|
"Math",
|
|
6042
6042
|
"Number",
|
|
6043
6043
|
"Date",
|
|
@@ -6084,7 +6084,7 @@ const INLINE_GLOBALS = new Set([
|
|
|
6084
6084
|
]);
|
|
6085
6085
|
const IDENTIFIER_RE$2 = /^[A-Z_$][\w$]*$/i;
|
|
6086
6086
|
const SIMPLE_PATH_RE = /^[A-Z_$][\w$]*(?:\.[A-Z_$][\w$]*)*$/i;
|
|
6087
|
-
const SCRIPT_SETUP_REF_BINDINGS = new Set(["setup-ref", "setup-maybe-ref"]);
|
|
6087
|
+
const SCRIPT_SETUP_REF_BINDINGS = /* @__PURE__ */ new Set(["setup-ref", "setup-maybe-ref"]);
|
|
6088
6088
|
function createMemberAccess$1(target, prop) {
|
|
6089
6089
|
if (IDENTIFIER_RE$2.test(prop)) return t.memberExpression(t.identifier(target), t.identifier(prop));
|
|
6090
6090
|
return t.memberExpression(t.identifier(target), t.stringLiteral(prop), true);
|
|
@@ -6265,7 +6265,7 @@ function registerInlineExpression(exp, context) {
|
|
|
6265
6265
|
}
|
|
6266
6266
|
//#endregion
|
|
6267
6267
|
//#region src/plugins/vue/compiler/template/expression/js.ts
|
|
6268
|
-
const JS_RUNTIME_GLOBALS = new Set([
|
|
6268
|
+
const JS_RUNTIME_GLOBALS = /* @__PURE__ */ new Set([
|
|
6269
6269
|
"Math",
|
|
6270
6270
|
"Number",
|
|
6271
6271
|
"Date",
|
|
@@ -6717,7 +6717,7 @@ const SIMPLE_IDENTIFIER_RE$1 = /^[A-Z_$][\w$]*$/i;
|
|
|
6717
6717
|
const SIMPLE_MEMBER_PATH_RE = /^[A-Z_$][\w$]*(?:\.[A-Z_$][\w$]*)*$/i;
|
|
6718
6718
|
const isSimpleIdentifier = (value) => SIMPLE_IDENTIFIER_RE$1.test(value);
|
|
6719
6719
|
const isSimpleMemberPath = (value) => SIMPLE_MEMBER_PATH_RE.test(value);
|
|
6720
|
-
const COMPONENT_NON_PROP_BINDINGS = new Set([
|
|
6720
|
+
const COMPONENT_NON_PROP_BINDINGS = /* @__PURE__ */ new Set([
|
|
6721
6721
|
"class",
|
|
6722
6722
|
"style",
|
|
6723
6723
|
"id",
|
|
@@ -6823,7 +6823,7 @@ function transformBindDirective(node, context, forInfo, options) {
|
|
|
6823
6823
|
//#region src/plugins/vue/compiler/template/directives/custom.ts
|
|
6824
6824
|
const IDENTIFIER_RE$1 = /^[a-z_$][\w$]*$/i;
|
|
6825
6825
|
function transformCustomDirective(name, exp, arg, context) {
|
|
6826
|
-
if (new Set([
|
|
6826
|
+
if ((/* @__PURE__ */ new Set([
|
|
6827
6827
|
"bind",
|
|
6828
6828
|
"on",
|
|
6829
6829
|
"model",
|
|
@@ -6837,7 +6837,7 @@ function transformCustomDirective(name, exp, arg, context) {
|
|
|
6837
6837
|
"slot",
|
|
6838
6838
|
"cloak",
|
|
6839
6839
|
"once"
|
|
6840
|
-
]).has(name)) return null;
|
|
6840
|
+
])).has(name)) return null;
|
|
6841
6841
|
const dataAttrName = `data-v-${name}`;
|
|
6842
6842
|
if (exp && exp.type === NodeTypes.SIMPLE_EXPRESSION) {
|
|
6843
6843
|
const expValue = normalizeWxmlExpressionWithContext(exp.content, context);
|
|
@@ -6860,7 +6860,7 @@ function getElementType(element) {
|
|
|
6860
6860
|
const QUOTE_RE$1 = /"/g;
|
|
6861
6861
|
const CAMELIZE_RE = /-([a-z0-9])/gi;
|
|
6862
6862
|
const IDENTIFIER_RE = /^[A-Z_$][\w$]*$/i;
|
|
6863
|
-
const NATIVE_MODEL_TAGS = new Set([
|
|
6863
|
+
const NATIVE_MODEL_TAGS = /* @__PURE__ */ new Set([
|
|
6864
6864
|
"input",
|
|
6865
6865
|
"textarea",
|
|
6866
6866
|
"select",
|
|
@@ -8295,7 +8295,7 @@ function transformNode(node, context) {
|
|
|
8295
8295
|
}
|
|
8296
8296
|
//#endregion
|
|
8297
8297
|
//#region src/plugins/vue/compiler/template.ts
|
|
8298
|
-
const HTML_VOID_TAGS = new Set([
|
|
8298
|
+
const HTML_VOID_TAGS = /* @__PURE__ */ new Set([
|
|
8299
8299
|
"area",
|
|
8300
8300
|
"base",
|
|
8301
8301
|
"br",
|
|
@@ -8855,7 +8855,7 @@ function isIdentifierLikeKey(key) {
|
|
|
8855
8855
|
function getObjectTag(value) {
|
|
8856
8856
|
return OBJECT_TO_STRING.call(value);
|
|
8857
8857
|
}
|
|
8858
|
-
const SERIALIZABLE_NATIVE_FUNCTIONS = new Map([
|
|
8858
|
+
const SERIALIZABLE_NATIVE_FUNCTIONS = /* @__PURE__ */ new Map([
|
|
8859
8859
|
[String, "String"],
|
|
8860
8860
|
[Number, "Number"],
|
|
8861
8861
|
[Boolean, "Boolean"],
|
|
@@ -9266,7 +9266,7 @@ async function parseVueFile(source, filename, options) {
|
|
|
9266
9266
|
const resolvedNext = await resolveSfcBlockSrc(nextDescriptor, filename, options.sfcSrc);
|
|
9267
9267
|
descriptorForCompile = resolvedNext.descriptor;
|
|
9268
9268
|
if (resolvedNext.deps.length) {
|
|
9269
|
-
sfcSrcDeps = [
|
|
9269
|
+
sfcSrcDeps = [.../* @__PURE__ */ new Set([...sfcSrcDeps ?? [], ...resolvedNext.deps])];
|
|
9270
9270
|
meta.sfcSrcDeps = sfcSrcDeps;
|
|
9271
9271
|
}
|
|
9272
9272
|
} else descriptorForCompile = nextDescriptor;
|
|
@@ -9303,7 +9303,7 @@ async function parseVueFile(source, filename, options) {
|
|
|
9303
9303
|
const resolvedNext = await resolveSfcBlockSrc(nextDescriptor, filename, options.sfcSrc);
|
|
9304
9304
|
descriptorForCompile = resolvedNext.descriptor;
|
|
9305
9305
|
if (resolvedNext.deps.length) {
|
|
9306
|
-
sfcSrcDeps = [
|
|
9306
|
+
sfcSrcDeps = [.../* @__PURE__ */ new Set([...sfcSrcDeps ?? [], ...resolvedNext.deps])];
|
|
9307
9307
|
meta.sfcSrcDeps = sfcSrcDeps;
|
|
9308
9308
|
}
|
|
9309
9309
|
} else descriptorForCompile = nextDescriptor;
|
|
@@ -9337,7 +9337,7 @@ function composeSourceMaps(transformedMap, originalMap) {
|
|
|
9337
9337
|
}
|
|
9338
9338
|
//#endregion
|
|
9339
9339
|
//#region src/plugins/vue/transform/compileVueFile/reservedProps.ts
|
|
9340
|
-
const RESERVED_SCRIPT_SETUP_PROPS = new Set([
|
|
9340
|
+
const RESERVED_SCRIPT_SETUP_PROPS = /* @__PURE__ */ new Set([
|
|
9341
9341
|
"id",
|
|
9342
9342
|
"class",
|
|
9343
9343
|
"slot"
|
|
@@ -9475,7 +9475,7 @@ function resolveScriptSetupPropsDerivedKeys(bindings) {
|
|
|
9475
9475
|
}
|
|
9476
9476
|
function collectScriptSetupReturnInfo(scriptCode) {
|
|
9477
9477
|
const keys = /* @__PURE__ */ new Set();
|
|
9478
|
-
const propsObjectAliases = new Set(["__props"]);
|
|
9478
|
+
const propsObjectAliases = /* @__PURE__ */ new Set(["__props"]);
|
|
9479
9479
|
const propsRefsAliases = /* @__PURE__ */ new Set();
|
|
9480
9480
|
const destructuredPropsKeys = /* @__PURE__ */ new Set();
|
|
9481
9481
|
const addObjectPatternKeys = (pattern) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wevu/compiler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.17.
|
|
4
|
+
"version": "6.17.1",
|
|
5
5
|
"description": "wevu 编译器基础包,面向小程序模板的编译与转换",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"vue": "^3.5.38",
|
|
53
53
|
"@weapp-core/constants": "0.1.12",
|
|
54
54
|
"@weapp-core/shared": "3.0.4",
|
|
55
|
-
"@weapp-vite/ast": "6.17.
|
|
55
|
+
"@weapp-vite/ast": "6.17.1",
|
|
56
56
|
"rolldown-require": "2.0.19"
|
|
57
57
|
},
|
|
58
58
|
"publishConfig": {
|