@wevu/compiler 7.5.0 → 7.7.0
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,2 +1,2 @@
|
|
|
1
|
-
import { n as StaticPageMeta, r as StaticRouteValue, t as StaticPageDeclaration } from "../public-
|
|
1
|
+
import { n as StaticPageMeta, r as StaticRouteValue, t as StaticPageDeclaration } from "../public-BL8gwg7L.mjs";
|
|
2
2
|
export { StaticPageDeclaration, StaticPageMeta, StaticRouteValue };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/pageDeclaration/public.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* 路由元信息支持的有限静态 JSON 值。
|
|
4
3
|
*/
|
|
@@ -14,5 +13,4 @@ interface StaticPageDeclaration {
|
|
|
14
13
|
}
|
|
15
14
|
/** 完整可静态提取的页面元信息;动态成员不产生部分结果。 */
|
|
16
15
|
type StaticPageMeta = Record<string, StaticRouteValue>;
|
|
17
|
-
//#endregion
|
|
18
16
|
export { StaticPageMeta as n, StaticRouteValue as r, StaticPageDeclaration as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as t from"@weapp-vite/ast/babelTypes";import vueJsxPlugin from"@vue/babel-plugin-jsx";import{transformSync}from"@weapp-vite/ast/babelCore";const DEFAULT_VUE_JSX_TRANSFORM_OPTIONS={enableObjectSlots:true,mergeProps:true,optimize:true,resolveType:false,transformOn:true};function readDirectiveExpression(attribute){if(!attribute.value)return t.booleanLiteral(true);if(!t.isJSXExpressionContainer(attribute.value)||t.isJSXEmptyExpression(attribute.value.expression))return;return t.isExpression(attribute.value.expression)?attribute.value.expression:void 0}function createWevuJsxDirectiveCompatibilityPlugin(){return{name:`wevu-jsx-directive-compatibility`,visitor:{JSXElement(path){const attributes=path.node.openingElement.attributes;let ifExpression;let textExpression;path.node.openingElement.attributes=attributes.filter(attribute=>{if(!t.isJSXAttribute(attribute))return true;const name=t.isJSXIdentifier(attribute.name)?attribute.name.name:t.isJSXNamespacedName(attribute.name)?attribute.name.namespace.name:void 0;if(name===`v-if`){ifExpression=readDirectiveExpression(attribute);return false}if(name===`v-text`){textExpression=readDirectiveExpression(attribute);return false}if(name?.startsWith(`v-`)&&![`v-html`,`v-model`,`v-models`,`v-show`,`v-slots`].includes(name))return false;return true});if(textExpression)path.node.children=[t.jsxExpressionContainer(textExpression)];if(ifExpression)path.replaceWith(t.conditionalExpression(ifExpression,path.node,t.nullLiteral()))}}}}function transformVueJsxScript(source,filename,sourceMaps=true,options){const result=transformSync(source,{filename,sourceType:`module`,sourceMaps,plugins:[createWevuJsxDirectiveCompatibilityPlugin,[vueJsxPlugin,{...DEFAULT_VUE_JSX_TRANSFORM_OPTIONS,...options}]],parserOpts:{plugins:[`typescript`,`jsx`]},generatorOpts:{retainLines:!sourceMaps}});return{code:result?.code??source,map:result?.map?{...result.map,file:result.map.file??void 0}:null}}export{transformVueJsxScript};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wevu/compiler",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.7.0",
|
|
5
5
|
"description": "wevu 编译器基础包,面向小程序模板的编译与转换",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,26 +57,27 @@
|
|
|
57
57
|
"dist"
|
|
58
58
|
],
|
|
59
59
|
"engines": {
|
|
60
|
-
"node": "^22.
|
|
60
|
+
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
+
"@babel/core": "^8.0.9",
|
|
63
64
|
"@jridgewell/remapping": "^2.3.5",
|
|
64
65
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
65
66
|
"@vue/babel-plugin-jsx": "3.0.0",
|
|
66
|
-
"@vue/compiler-core": "^3.5.
|
|
67
|
-
"@vue/compiler-dom": "^3.5.
|
|
68
|
-
"@weapp-core/constants": "0.
|
|
69
|
-
"@weapp-core/shared": "3.
|
|
70
|
-
"@weapp-vite/ast": "7.
|
|
67
|
+
"@vue/compiler-core": "^3.5.44",
|
|
68
|
+
"@vue/compiler-dom": "^3.5.44",
|
|
69
|
+
"@weapp-core/constants": "0.5.0",
|
|
70
|
+
"@weapp-core/shared": "3.4.0",
|
|
71
|
+
"@weapp-vite/ast": "7.7.0",
|
|
71
72
|
"comment-json": "^5.0.0",
|
|
72
73
|
"lru-cache": "^11.5.3",
|
|
73
74
|
"magic-string": "^1.4.3",
|
|
74
75
|
"merge": "^2.1.1",
|
|
75
76
|
"pathe": "^2.0.3",
|
|
76
|
-
"postcss": "^8.5.
|
|
77
|
-
"postcss-selector-parser": "^7.1.
|
|
78
|
-
"rolldown-require": "2.0
|
|
79
|
-
"vue": "^3.5.
|
|
77
|
+
"postcss": "^8.5.31",
|
|
78
|
+
"postcss-selector-parser": "^7.1.7",
|
|
79
|
+
"rolldown-require": "2.1.0",
|
|
80
|
+
"vue": "^3.5.44"
|
|
80
81
|
},
|
|
81
82
|
"tsd": {
|
|
82
83
|
"compilerOptions": {
|