Commit b891c63b by Jaxon

feat: 添加 WXML 格式化支持及相关配置

refactor: 重构 ESLint 配置以支持 WXML 文件检查

style: 格式化现有 WXML 文件代码

chore: 添加 prettier-plugin-wxml 及相关依赖

docs: 更新文档和注释说明

test: 添加 WXML 相关测试用例

build: 更新构建配置以支持 WXML 处理
1 parent 633192f7
Showing 43 changed files with 772 additions and 395 deletions
*.log
node_modules/
dist/
build/
miniprogram_npm
uni_modules
# 只格式化 wxml
!*.wxml
export { default } from "@venus/prettier-config";
{
"mcpServers": {
"figma": {
"httpUrl": "https://mcp.figma.com/mcp"
}
},
"$version": 2
}
\ No newline at end of file \ No newline at end of file
...@@ -64,6 +64,9 @@ ...@@ -64,6 +64,9 @@
"[vue]": { "[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint" "editor.defaultFormatter": "dbaeumer.vscode-eslint"
}, },
"[wxml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// extensions // extensions
"extensions.ignoreRecommendations": true, "extensions.ignoreRecommendations": true,
...@@ -188,6 +191,8 @@ ...@@ -188,6 +191,8 @@
"wxml" "wxml"
], ],
"eslint.format.enable": true,
"tailwindCSS.experimental.classRegex": [["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]], "tailwindCSS.experimental.classRegex": [["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]],
"github.copilot.enable": { "github.copilot.enable": {
...@@ -240,5 +245,5 @@ ...@@ -240,5 +245,5 @@
"nolebase", "nolebase",
"rollup", "rollup",
"vitest" "vitest"
] ],
} }
<view class="_root {{selectable?'_select':''}}" style="{{containerStyle}}"><slot wx:if="{{!nodes[0]}}"/><node id="_root" childs="{{nodes}}" opts="{{[lazyLoad,loadingImg,errorImg,showImgMenu,selectable]}}" catchadd="_add"/></view>
\ No newline at end of file \ No newline at end of file
<view class="_root {{selectable?'_select':''}}" style="{{containerStyle}}"><slot wx:if="{{!nodes[0]}}"/><node id="_root" childs="{{nodes}}" opts="{{[lazyLoad,loadingImg,errorImg,showImgMenu,selectable]}}" catchadd="_add"/></view>
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// <wxs src="../../utils/tools.wxs" module="tools" /> // <wxs src="../../utils/tools.wxs" module="tools" />
// tools.tofix2(12.33333) // tools.tofix2(12.33333)
module.exports = { module.exports = {
msg: 'wxs-tools',
tofix2: function(num) {
return num.toFixed(2)
}
};
\ No newline at end of file \ No newline at end of file
msg: "wxs-tools",
tofix2: function (num) {
return num.toFixed(2);
},
};
<view class="bg"></view> <view class="bg"></view>
<view class="container-box"> <view class="container-box">
<view class="h"> <view class="h">
<text>请选择</text> <text>请选择</text>
<image src="/images/icon/close.svg" bindtap="close"></image> <image src="/images/icon/close.svg" bindtap="close"></image>
</view> </view>
<view class="tabs"> <view class="tabs">
<view wx:if="{{index <= tabIndex}}" wx:for="{{tabs}}" wx:key="*this" class="tab {{tabIndex === index?'active':''}}" data-index="{{index}}" bindtap="tabClick">{{ item }}</view> <view wx:if="{{index <= tabIndex}}"
</view> wx:for="{{tabs}}"
<view class="data"> wx:key="*this"
<scroll-view scroll-y scroll-with-animation> class="tab {{tabIndex === index?'active':''}}"
<view class="inner-box"> data-index="{{index}}"
<view class="{{item.active?'active':''}}" wx:for="{{redionData}}" wx:key="id" data-index="{{index}}" bindtap="_click">{{ item.name }}</view> bindtap="tabClick">
</view> {{ item }}
</scroll-view> </view>
</view> </view>
<view class="data">
<scroll-view scroll-y scroll-with-animation>
<view class="inner-box">
<view class="{{item.active?'active':''}}"
wx:for="{{redionData}}"
wx:key="id"
data-index="{{index}}"
bindtap="_click">
{{ item.name }}
</view>
</view>
</scroll-view>
</view>
</view> </view>
...@@ -4,4 +4,4 @@ module.exports = { ...@@ -4,4 +4,4 @@ module.exports = {
shareProfile: "百款精品商品,总有一款适合您", // 首页转发的时候话术 shareProfile: "百款精品商品,总有一款适合您", // 首页转发的时候话术
kanjiaRequirePlayAd: false, // 是否必须要观看视频广告后才可以砍价 kanjiaRequirePlayAd: false, // 是否必须要观看视频广告后才可以砍价
goodsDetailSkuShowType: 0, // 0 为点击立即购买按钮后出现规格尺寸、数量的选择; 1为直接在商品详情页面显示规格尺寸、数量的选择,而不弹框 goodsDetailSkuShowType: 0, // 0 为点击立即购买按钮后出现规格尺寸、数量的选择; 1为直接在商品详情页面显示规格尺寸、数量的选择,而不弹框
};
\ No newline at end of file \ No newline at end of file
};
<view class="container"> <view class="container">
<!-- <button wx:if="{{!addressData}}" type="primary" class="save-btn" bindtap="readFromWx"> <form bind:submit="bindSave" report-submit>
读取微信地址 <view class="form-box">
</button> --> <view class="row-wrap">
<form bindsubmit="bindSave" report-submit="true"> <view class="label">联系人</view>
<view class="form-box"> <view class="label-right">
<view class="row-wrap"> <input
<view class="label">联系人</view> name="linkMan"
<view class="label-right"> class="input"
<input name="linkMan" class="input" type="text" placeholder="姓名" value="{{addressData.linkMan}}{{wxaddress.userName}}" /> type="text"
</view> placeholder="姓名"
</view> value="{{addressData.linkMan}}{{wxaddress.userName}}"
<view class="row-wrap"> />
<view class="label">手机号码</view> </view>
<view class="label-right"> </view>
<input name="mobile" class="input" maxlength="11" type="number" placeholder="11位手机号码" value="{{addressData.mobile}}{{wxaddress.telNumber}}" /> <view />
</view> <view class="row-wrap">
</view> <view class="label">手机号码</view>
<view class="row-wrap"> <view class="label-right">
<view class="label">选择地区</view> <input name="mobile"
<view class="showRegionSelect" bindtap="showRegionSelect">{{showRegionStr}}</view> class="input"
</view> maxlength="11"
<view class="addr-details"> type="number"
<view class="label">详细地址</view> placeholder="11位手机号码"
<view class="label-right"> value="{{addressData.mobile}}{{wxaddress.telNumber}}"
<textarea name="address" auto-height placeholder="街道门牌信息" value="{{addressData.address}}{{wxaddress.detailInfo}}" /> />
</view> </view>
</view> </view>
</view> <view class="row-wrap">
<button type="warn" class="save-btn" formType="submit">保存</button> <view class="label">选择地区</view>
<button type="default" class="save-btn" bindtap="deleteAddress" data-id="{{addressData.id}}" wx:if="{{addressData}}"> <view class="showRegionSelect" bind:tap="showRegionSelect"
删除该地址 >{{showRegionStr}}</view
</button> >
</form> </view>
<view class="addr-details">
<view class="label">详细地址</view>
<view class="label-right">
<textarea
name="address"
auto-height
placeholder="街道门牌信息"
value="{{addressData.address}}{{wxaddress.detailInfo}}"
/>
</view>
</view>
</view>
<button type="warn" class="save-btn" formType="submit">保存</button>
<button type="default" class="save-btn"
bind:tap="deleteAddress"
data-id="{{addressData.id}}"
wx:if="{{addressData}}">
删除该地址
</button>
</form>
</view> </view>
<float-menu /> <float-menu />
<region-picker wx:if="{{ showRegionSelect }}" bind:closeAddress="closeAddress" bind:selectAddress="selectAddress" />
\ No newline at end of file \ No newline at end of file
<region-picker
wx:if="{{ showRegionSelect }}"
bind:closeAddress="closeAddress"
bind:selectAddress="selectAddress"
/>
...@@ -14,68 +14,78 @@ ...@@ -14,68 +14,78 @@
</view> --> </view> -->
<!-- 购物车内容 --> <!-- 购物车内容 -->
<view class="cart_content"> <view class="cart_content">
<!-- <view class="cart_title">购物车</view> --> <!-- <view class="cart_title">购物车</view> -->
<view class="cart_main"> <view class="cart_main">
<!-- 当cart数组 长度不为0 显示 商品信息 --> <!-- 当cart数组 长度不为0 显示 商品信息 -->
<block wx:if="{{cart.length!==0}}"> <block wx:if="{{cart.length!==0}}">
<view class="cart_item" wx:for="{{cart}}" wx:key="basicInfo.id"> <view class="cart_item" wx:for="{{cart}}" wx:key="basicInfo.id">
<!-- 复选框 --> <!-- 复选框 -->
<view class="cart_chk_wrap"> <view class="cart_chk_wrap">
<checkbox-group data-id="{{item.basicInfo.id}}" bindchange="handleItemChange"> <checkbox-group data-id="{{item.basicInfo.id}}" bindchange="handleItemChange">
<checkbox checked="{{item.checked}}"></checkbox> <checkbox checked="{{item.checked}}"></checkbox>
</checkbox-group> </checkbox-group>
</view> </view>
<!-- 商品图片 --> <!-- 商品图片 -->
<navigator class="cart_img_wrap"> <navigator class="cart_img_wrap">
<image mode="widthFix" src="{{item.basicInfo.pic}}"></image> <image mode="widthFix" src="{{item.basicInfo.pic}}"></image>
</navigator> </navigator>
<!-- 商品信息 --> <!-- 商品信息 -->
<view class="cart_info_wrap"> <view class="cart_info_wrap">
<view class="goods_name">{{item.basicInfo.name}}</view> <view class="goods_name">{{item.basicInfo.name}}</view>
<view class="goods_price_wrap"> <view class="goods_price_wrap">
<view class="goods_price">¥{{item.basicInfo.minPrice}}</view> <view class="goods_price">¥{{item.basicInfo.minPrice}}</view>
<view class="cart_num_tool"> <view class="cart_num_tool">
<view bindtap="handleItemNumEdit" data-id="{{item.basicInfo.id}}" data-operation="{{-1}}" class="num_edit"> <view
- bindtap="handleItemNumEdit"
</view> data-id="{{item.basicInfo.id}}"
<view class="goods_num">{{item.num}}</view> data-operation="{{-1}}"
<view bindtap="handleItemNumEdit" data-id="{{item.basicInfo.id}}" data-operation="{{1}}" class="num_edit"> class="num_edit"
+ >
</view> -
</view> </view>
</view> <view class="goods_num">{{item.num}}</view>
</view> <view
</view> bindtap="handleItemNumEdit"
</block> data-id="{{item.basicInfo.id}}"
<block wx:else> data-operation="{{1}}"
<!-- <image mode="widthFix" src="http://hbimg.b0.upaiyun.com/e1b1467beea0a9c7d6a56b32bac6d7e5dcd914f7c3e6-YTwUd6_fw658"></image> --> class="num_edit"
<view class="no-goods"> >
<view class="title-box">购物车空空如也~</view> +
<navigator class="to-index-btn" open-type="switchTab" url="/pages/category/index">去逛逛</navigator> </view>
<view style="position:absolute;bottom:10rpx;width:750rpx;"> </view>
<!-- <ad unit-id="adunit-588264b3e2362e1e"></ad> --> </view>
</view> </view>
</view> </view>
</block> </block>
</view> <block wx:else>
<!-- <image mode="widthFix" src="http://hbimg.b0.upaiyun.com/e1b1467beea0a9c7d6a56b32bac6d7e5dcd914f7c3e6-YTwUd6_fw658"></image> -->
<view class="no-goods">
<view class="title-box">购物车空空如也~</view>
<navigator class="to-index-btn" open-type="switchTab" url="/pages/category/index">去逛逛</navigator>
<view style="position:absolute;bottom:10rpx;width:750rpx;">
<!-- <ad unit-id="adunit-588264b3e2362e1e"></ad> -->
</view>
</view>
</block>
</view>
</view> </view>
<!-- 底部工具栏 --> <!-- 底部工具栏 -->
<view class="footer_tool"> <view class="footer_tool">
<!-- 全选 --> <!-- 全选 -->
<view class="all_chk_wrap"> <view class="all_chk_wrap">
<checkbox-group bindchange="handleItemAllCheck"> <checkbox-group bindchange="handleItemAllCheck">
<checkbox checked="{{allChecked}}">全选</checkbox> <checkbox checked="{{allChecked}}">全选</checkbox>
</checkbox-group> </checkbox-group>
</view> </view>
<!-- 总价格 --> <!-- 总价格 -->
<view class="total_price_wrap"> <view class="total_price_wrap">
<view class="total_price"> <view class="total_price">
合计: 合计:
<text class="total_price_text">¥{{totalPrice}}</text> <text class="total_price_text">¥{{totalPrice}}</text>
</view> </view>
<view>包含运费</view> <view>包含运费</view>
</view> </view>
<!-- 结算 --> <!-- 结算 -->
<view class="order_pay_wrap" bindtap="handlePay">结算({{totalNum}})</view> <view class="order_pay_wrap" bindtap="handlePay">结算({{totalNum}})</view>
</view> </view>
<template is="apifmLogin" data="{{wxlogin: wxlogin}}" /> <template is="apifmLogin" data="{{wxlogin: wxlogin}}" />
// pages/collect/index.js // pages/collect/index.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
......
<!-- pages/collect/index.wxml --> <!-- pages/collect/index.wxml -->
<Tabs tabs="{{tabs}}" bindtabsItemChange="handleTabsItemChange">
<view class="collect_main">
<view class="collect_title">
<text class="collect_tips active">全部</text>
<text class="collect_tips">正在热卖</text>
<text class="collect_tips">即将上线</text>
</view>
<view class="collect_content">
<navigator class="goods_item" wx:for="{{collect}}" wx:key="goods_id" url="/pages/goods_detail/index?id={{item.basicInfo.id}}">
<!-- 左侧 图片容器 -->
<view class="goods_img_wrap">
<image mode="widthFix" src="{{item.basicInfo.pic?item.basicInfo.pic:'https://ww1.sinaimg.cn/large/007rAy9hgy1g24by9t530j30i20i2glm.jpg'}}"></image>
</view>
<!-- 右侧 商品容器 -->
<view class="goods_info_wrap">
<view class="goods_name">{{item.basicInfo.name}}</view>
<view class="goods_price">¥{{item.basicInfo.minPrice}}</view>
</view>
</navigator>
</view>
</view>
</Tabs>
\ No newline at end of file \ No newline at end of file
<Tabs tabs="{{tabs}}" bind:tabsItemChange="handleTabsItemChange">
<view class="collect_main">
<view class="collect_title">
<text class="collect_tips active">
全部
</text>
<text class="collect_tips">
正在热卖
</text>
<text class="collect_tips">
即将上线
</text>
</view>
<view class="collect_content">
<navigator class="goods_item"
wx:for="{{collect}}"
wx:key="goods_id"
url="/pages/goods_detail/index?id={{item.basicInfo.id}}">
<!-- 左侧 图片容器 -->
<view class="goods_img_wrap">
<image mode="widthFix"
src="{{item.basicInfo.pic?item.basicInfo.pic:'https://ww1.sinaimg.cn/large/007rAy9hgy1g24by9t530j30i20i2glm.jpg'}}" />
</view>
<!-- 右侧 商品容器 -->
<view class="goods_info_wrap">
<view class="goods_name">
{{item.basicInfo.name}}
</view>
<view class="goods_price">
¥{{item.basicInfo.minPrice}}
</view>
</view>
</navigator>
</view>
</view>
</Tabs>
<!-- pages/feedback/index.wxml -->
<Tabs tabs="{{tabs}}" bindtabsItemChange="handleTabsItemChange"> <Tabs tabs="{{tabs}}" bindtabsItemChange="handleTabsItemChange">
<view class="fb_main">
<view class="fb_title">问题的种类</view>
<view class="fb_tips">
<text>功能建议</text>
<text>购买遇到问题</text>
<text>性能问题</text>
<text>其他</text>
</view>
<view class="fb_content">
<textarea value="{{textVal}}" bindinput="handleTextInput" placeholder="请描述一下您的问题"></textarea>
<view class="fb_tool">
<button bindtap="handleChooseImg">+</button>
<view class="up_img_item" wx:for="{{chooseImgs}}" wx:key="*this" bindtap="handleRemoveImg" data-index="{{index}}">
<UpImg src="{{item}}"></UpImg>
</view>
</view>
</view>
<view class="form_btn_wrap">
<button bindtap="handleFormSubmit" type="warn">
<icon type="success_no_circle" size="20" color="white"></icon>
提交
</button>
</view>
</view>
</Tabs>
\ No newline at end of file \ No newline at end of file
<view class="fb_main">
<view class="fb_title">问题的种类</view>
<view class="fb_tips">
<text>功能建议</text>
<text>购买遇到问题</text>
<text>性能问题</text>
<text>其他</text>
</view>
<view class="fb_content">
<textarea value="{{textVal}}" bindinput="handleTextInput" placeholder="请描述一下您的问题"></textarea>
<view class="fb_tool">
<button bindtap="handleChooseImg">
+
</button>
<view
class="up_img_item"
wx:for="{{chooseImgs}}"
wx:key="*this"
bindtap="handleRemoveImg"
data-index="{{index}}"
>
<UpImg src="{{item}}"></UpImg>
</view>
</view>
</view>
<view class="form_btn_wrap">
<button bindtap="handleFormSubmit" type="warn">
<icon type="success_no_circle" size="20" color="white"></icon>
提交
</button>
</view>
</view>
</Tabs>
<!-- pages/goods_detail/index.wxml --> <!-- pages/goods_detail/index.wxml -->
<import src="../../wxParse/wxParse.wxml" /> <import src="../../wxParse/wxParse.wxml" />
<view class="detail_swiper"> <view class="detail_swiper">
<swiper indicator-dots="{{true}}" autoplay="{{true}}" circular="{{true}}"> <swiper indicator-dots="{{true}}"
<swiper-item wx:for="{{goodsObj.pics}}" wx:key="id" bindtap="handlePrevewImage" data-url="{{item.pic}}"> autoplay="{{true}}"
<image src="{{item.pic}}" mode="widthFix"></image> circular="{{true}}">
</swiper-item> <swiper-item wx:for="{{goodsObj.pics}}"
</swiper> wx:key="id"
bindtap="handlePrevewImage"
data-url="{{item.pic}}">
<image src="{{item.pic}}" mode="widthFix">
</image>
</swiper-item>
</swiper>
</view>
<view class="goods_price">
¥{{goodsObj.goods_price}}
</view> </view>
<view class="goods_price">¥{{goodsObj.goods_price}}</view>
<view class="goods_name_row"> <view class="goods_name_row">
<view class="goods_name">{{goodsObj.goods_name}}</view> <view class="goods_name">
<view class="goods_collect" bindtap="handleCollect"> {{goodsObj.goods_name}}
<text class="iconfont {{isCollect?'icon-shoucang1':'icon-shoucang'}}"></text> </view>
<view class="collect_text">收藏</view> <view class="goods_collect" bindtap="handleCollect">
</view> <text class="iconfont {{isCollect?'icon-shoucang1':'icon-shoucang'}}">
</text>
<view class="collect_text">
收藏
</view>
</view>
</view> </view>
<view class="goods_info"> <view class="goods_info">
<view class="goods_info_title">图文详情</view> <view class="goods_info_title">
<view class="goods_info_content"> 图文详情
<!-- 富文本 --> </view>
<!-- {{goodsObj.goods_introduce}} --> <view class="goods_info_content">
<!-- <rich-text is="wxParse" nodes="{{goodsObj.goods_introduce}}"></rich-text> --> <!-- 富文本 -->
<template is="wxParse" data="{{wxParseData:article.nodes}}" /> <!-- {{goodsObj.goods_introduce}} -->
</view> <!-- <rich-text is="wxParse" nodes="{{goodsObj.goods_introduce}}"></rich-text> -->
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view>
</view> </view>
<view class="btm_tool"> <view class="btm_tool">
<view class="tool_item">
<view class="iconfont icon-kefu1"></view>
<view>客服</view>
<button open-type="contact"></button>
</view>
<view class="tool_item">
<view class="iconfont icon-fenxiang"></view>
<view>分享</view>
<button open-type="share"></button>
</view>
<navigator open-type="switchTab" url="/pages/cart/index" class="tool_item">
<view class="iconfont .icon-shopcart"></view>
<view>购物车</view>
</navigator>
<view class="tool_item btn_cart " bindtap="handleCartAdd">加入购物车</view>
<view class="tool_item btn_buy" bindtap="handleBuyNow">立即购买</view>
</view>
\ No newline at end of file \ No newline at end of file
<view class="tool_item">
<view class="iconfont icon-kefu1">
</view>
<view>客服</view>
<button open-type="contact">
</button>
</view>
<view class="tool_item">
<view class="iconfont icon-fenxiang">
</view>
<view>分享</view>
<button open-type="share">
</button>
</view>
<navigator open-type="switchTab"
url="/pages/cart/index"
class="tool_item">
<view class="iconfont .icon-shopcart">
</view>
<view>购物车</view>
</navigator>
<view class="tool_item btn_cart " bindtap="handleCartAdd">
加入购物车
</view>
<view class="tool_item btn_buy" bindtap="handleBuyNow">
立即购买
</view>
</view>
<SearchInput></SearchInput> <SearchInput></SearchInput>
<Tabs tabs="{{tabs}}" bindtabsItemChange="handleTabsItemChange"> <Tabs tabs="{{tabs}}" bindtabsItemChange="handleTabsItemChange">
<block wx:if="{{tabs[0].isActive}}">
<view class="first_tab">
<navigator wx:for="{{goodsList}}" wx:key="id" class="goods_item" url="/pages/goods_detail/index?id={{item.id}}">
<!-- 左侧 图片容器 -->
<view class="goods_img_wrap">
<image mode="widthFix" src="{{item.pic?item.pic:'https://ww1.sinaimg.cn/large/007rAy9hgy1g24by9t530j30i20i2glm.jpg'}}"></image>
</view>
<!-- 右侧 商品容器 -->
<view class="goods_info_wrap">
<view class="goods_name">{{item.name}}</view>
<view class="goods_price">¥{{item.minPrice}}</view>
</view>
</navigator>
</view>
</block>
</Tabs>
\ No newline at end of file \ No newline at end of file
<block wx:if="{{tabs[0].isActive}}">
<view class="first_tab">
<navigator wx:for="{{goodsList}}"
wx:key="id"
class="goods_item"
url="/pages/goods_detail/index?id={{item.id}}">
<!-- 左侧 图片容器 -->
<view class="goods_img_wrap">
<image mode="widthFix"
src="{{item.pic?item.pic:'https://ww1.sinaimg.cn/large/007rAy9hgy1g24by9t530j30i20i2glm.jpg'}}">
</image>
</view>
<!-- 右侧 商品容器 -->
<view class="goods_info_wrap">
<view class="goods_name">
{{item.name}}
</view>
<view class="goods_price">
¥{{item.minPrice}}
</view>
</view>
</navigator>
</view>
</block>
</Tabs>
This diff could not be displayed because it is too large.
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
} }
} }
}, },
"app-harmony": {
"distribute": {}
},
"mp-harmony": {
"distribute": {}
},
"quickapp": {}, "quickapp": {},
"mp-weixin": { "mp-weixin": {
"appid": "wxa2abb91f64032a2b", "appid": "wxa2abb91f64032a2b",
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
} }
] ]
}, },
"__esModule": true,
"pages": [ "pages": [
{ {
"path": "pages/index/index", "path": "pages/index/index",
......
...@@ -21,6 +21,14 @@ const routes: RouteRecordRaw[] = [ ...@@ -21,6 +21,14 @@ const routes: RouteRecordRaw[] = [
path: "/demos/ant-design", path: "/demos/ant-design",
component: () => import("#/views/demos/antd/index.vue"), component: () => import("#/views/demos/antd/index.vue"),
}, },
{
meta: {
title: "mcp演示",
},
name: "mcpDemo",
path: "/demos/mcp-demo",
component: () => import("#/views/demos/mcpDemo/index.vue"),
},
], ],
}, },
]; ];
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"language": "en,en-US", "language": "en,en-US",
"allowCompoundWords": true, "allowCompoundWords": true,
"words": [ "words": [
"wxml",
"acmr", "acmr",
"antd", "antd",
"antdv", "antdv",
...@@ -57,6 +58,11 @@ ...@@ -57,6 +58,11 @@
"yxxx" "yxxx"
], ],
"ignorePaths": [ "ignorePaths": [
"**/uni_modules/**",
"**/miniprogram_npm/**",
"**/node_modules/**",
"**/node_modules/**", "**/node_modules/**",
"**/dist/**", "**/dist/**",
"**/*-dist/**", "**/*-dist/**",
......
import { defineConfig } from "@vben/eslint-config"; import { defineConfig } from "@vben/eslint-config";
export default defineConfig(); export default defineConfig();
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
} }
}, },
"dependencies": { "dependencies": {
"eslint": "catalog:", "@wxml/parser": "^0.4.0",
"eslint": "catalog:",
"eslint-config-turbo": "catalog:", "eslint-config-turbo": "catalog:",
"eslint-plugin-command": "catalog:", "eslint-plugin-command": "catalog:",
"eslint-plugin-eslint-comments": "catalog:", "eslint-plugin-eslint-comments": "catalog:",
......
...@@ -58,6 +58,7 @@ export async function ignores(): Promise<Linter.Config[]> { ...@@ -58,6 +58,7 @@ export async function ignores(): Promise<Linter.Config[]> {
"**/*.sh", "**/*.sh",
"**/*.ttf", "**/*.ttf",
"**/*.woff", "**/*.woff",
"**/*.wxml",
], ],
}, },
]; ];
......
...@@ -15,7 +15,7 @@ export * from "./turbo"; ...@@ -15,7 +15,7 @@ export * from "./turbo";
export * from "./typescript"; export * from "./typescript";
export * from "./unicorn"; export * from "./unicorn";
export * from "./vue"; export * from "./vue";
export * from "./wxml";
/* /*
eslint-config/src/configs/index.ts eslint-config/src/configs/index.ts
......
...@@ -39,6 +39,7 @@ export async function javascript(): Promise<Linter.Config[]> { ...@@ -39,6 +39,7 @@ export async function javascript(): Promise<Linter.Config[]> {
linterOptions: { linterOptions: {
reportUnusedDisableDirectives: true, reportUnusedDisableDirectives: true,
}, },
ignores: [ "**/*.wxml" ],
plugins: { plugins: {
"unused-imports": pluginUnusedImports, "unused-imports": pluginUnusedImports,
}, },
......
...@@ -17,6 +17,7 @@ export async function prettier(): Promise<Linter.Config[]> { ...@@ -17,6 +17,7 @@ export async function prettier(): Promise<Linter.Config[]> {
] as const); ] as const);
return [ return [
{ {
files:[ "**/*.wxml", "**/*.wxs" ],
plugins: { plugins: {
prettier: pluginPrettier, prettier: pluginPrettier,
}, },
......
...@@ -20,10 +20,10 @@ export async function unicorn(): Promise<Linter.Config[]> { ...@@ -20,10 +20,10 @@ export async function unicorn(): Promise<Linter.Config[]> {
plugins: { plugins: {
unicorn: pluginUnicorn, unicorn: pluginUnicorn,
}, },
ignores: [ "**/*.wxml" ],
rules: { rules: {
...pluginUnicorn.configs.recommended.rules, ...pluginUnicorn.configs.recommended.rules,
"unicorn/no-abusive-eslint-disable":"off", "unicorn/no-abusive-eslint-disable":"off",
"unicorn/no-this-assignment":"warn", "unicorn/no-this-assignment":"warn",
"unicorn/no-empty-file":"off", "unicorn/no-empty-file":"off",
"unicorn/prefer-ternary":"off", "unicorn/prefer-ternary":"off",
......
...@@ -27,7 +27,9 @@ import { ...@@ -27,7 +27,9 @@ import {
typescript, typescript,
unicorn, unicorn,
vue, vue,
wxmlConfig,
} from "./configs"; } from "./configs";
import { prettier } from "./configs/prettier";
import { customConfig } from "./custom-config"; import { customConfig } from "./custom-config";
type FlatConfig = Linter.Config; type FlatConfig = Linter.Config;
...@@ -39,7 +41,7 @@ async function defineConfig(config: FlatConfig[] = []) { ...@@ -39,7 +41,7 @@ async function defineConfig(config: FlatConfig[] = []) {
vue(), vue(),
javascript(), javascript(),
ignores(), ignores(),
// prettier(), prettier(),
typescript(), typescript(),
jsonc(), jsonc(),
disableds(), disableds(),
...@@ -53,6 +55,7 @@ async function defineConfig(config: FlatConfig[] = []) { ...@@ -53,6 +55,7 @@ async function defineConfig(config: FlatConfig[] = []) {
regexp(), regexp(),
command(), command(),
turbo(), turbo(),
wxmlConfig(),
...customConfig, ...customConfig,
...config, ...config,
]; ];
......
declare module "@wxml/parser" {
export default any;
}
declare module "eslint-plugin-wxml" {
export default any;
}
export default {
printWidth: 120,
tabWidth: 4,
useTabs: true,
semi: true,
singleQuote: false,
htmlWhitespaceSensitivity: "ignore",
bracketSameLine: true,
plugins: [
"prettier-plugin-tailwindcss",
"@venus/prettier-plugin-wxml",
],
overrides: [
{
files: [ "*.json5" ],
options: {
quoteProps: "preserve",
singleQuote: false,
},
},
{
files: [ "*.wxml" ],
options: {
parser: "wxml",
},
},
],
};
{
"name": "@venus/prettier-config",
"version": "5.0.0",
"private": true,
"homepage": "https://github.com/venusjs/vue-venus-admin",
"bugs": "https://github.com/venusjs/vue-venus-admin/issues",
"repository": {
"type": "git",
"url": "git+https://github.com/venusjs/vue-venus-admin.git",
"directory": "internal/lint-configs/prettier-config"
},
"license": "MIT",
"type": "module",
"files": [
"dist"
],
"main": "./index.mjs",
"module": "./index.mjs",
"exports": {
".": {
"default": "./index.mjs"
}
},
"dependencies": {
"@venus/prettier-plugin-wxml": "workspace:*",
"prettier": "catalog:",
"prettier-plugin-tailwindcss": "catalog:"
}
}
{
"name": "@venus/prettier-plugin-wxml",
"version": "1.0.0",
"type": "module",
"main": "index.js",
"exports": {
".": "./index.js"
},
"peerDependencies": {
"prettier": "^2.8.0 || ^3.0.0"
},
"dependencies": {
"@babel/generator": "^7.28.5",
"prettier-plugin-mp": "^2.5.0"
},
"devDependencies": {
"@babel/parser": "^7.28.5"
}
}
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
'@babel/generator':
specifier: ^7.28.5
version: 7.28.5
prettier-plugin-mp:
specifier: ^2.5.0
version: 2.5.0(prettier@3.7.4)
devDependencies:
'@babel/parser':
specifier: ^7.28.5
version: 7.28.5
packages:
'@babel/generator@7.28.5':
resolution: {integrity: sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==}
engines: {node: '>=6.9.0'}
'@babel/helper-string-parser@7.27.1':
resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==}
engines: {node: '>=6.9.0'}
'@babel/helper-validator-identifier@7.28.5':
resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
engines: {node: '>=6.9.0'}
'@babel/parser@7.28.5':
resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==}
engines: {node: '>=6.0.0'}
hasBin: true
'@babel/types@7.28.5':
resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==}
engines: {node: '>=6.9.0'}
'@jridgewell/gen-mapping@0.3.13':
resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
'@jridgewell/resolve-uri@3.1.2':
resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
engines: {node: '>=6.0.0'}
'@jridgewell/sourcemap-codec@1.5.5':
resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}
'@jridgewell/trace-mapping@0.3.31':
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
'@wxml/parser@0.4.0':
resolution: {integrity: sha512-pS0OPyKzCOhCPGlcfO9IDLZbqH4485bPdGDqaa+hYnI+cY/OW+GN4J88XpfdzM8wXJcJShFZy5F6MTUr2rysXg==}
jsesc@3.1.0:
resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==}
engines: {node: '>=6'}
hasBin: true
prettier-plugin-mp@2.5.0:
resolution: {integrity: sha512-xOACEwH19w211V8kkQEcrZnVQsP+g7/wepcJ2VM0ajLJdhQgcW4qJpD827vl28BYUuhkQ6dnyAAkeybJ3lzvzQ==}
peerDependencies:
prettier: ^3.0.0
prettier@3.7.4:
resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==}
engines: {node: '>=14'}
hasBin: true
snapshots:
'@babel/generator@7.28.5':
dependencies:
'@babel/parser': 7.28.5
'@babel/types': 7.28.5
'@jridgewell/gen-mapping': 0.3.13
'@jridgewell/trace-mapping': 0.3.31
jsesc: 3.1.0
'@babel/helper-string-parser@7.27.1': {}
'@babel/helper-validator-identifier@7.28.5': {}
'@babel/parser@7.28.5':
dependencies:
'@babel/types': 7.28.5
'@babel/types@7.28.5':
dependencies:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.28.5
'@jridgewell/gen-mapping@0.3.13':
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
'@jridgewell/trace-mapping': 0.3.31
'@jridgewell/resolve-uri@3.1.2': {}
'@jridgewell/sourcemap-codec@1.5.5': {}
'@jridgewell/trace-mapping@0.3.31':
dependencies:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.5
'@wxml/parser@0.4.0': {}
jsesc@3.1.0: {}
prettier-plugin-mp@2.5.0(prettier@3.7.4):
dependencies:
'@wxml/parser': 0.4.0
prettier: 3.7.4
prettier@3.7.4: {}
...@@ -6,7 +6,7 @@ export { getStagedFiles, add as gitAdd } from "./git"; ...@@ -6,7 +6,7 @@ export { getStagedFiles, add as gitAdd } from "./git";
export { generatorContentHash } from "./hash"; export { generatorContentHash } from "./hash";
export * from "./monorepo"; export * from "./monorepo";
export { toPosixPath } from "./path"; export { toPosixPath } from "./path";
// export { prettierFormat } from "./prettier"; export { prettierFormat } from "./prettier";
export * from "./spinner"; export * from "./spinner";
export type { Package } from "@manypkg/get-packages"; export type { Package } from "@manypkg/get-packages";
export { default as colors } from "chalk"; export { default as colors } from "chalk";
......
...@@ -69,6 +69,9 @@ ...@@ -69,6 +69,9 @@
"@vben/turbo-run": "workspace:*", "@vben/turbo-run": "workspace:*",
"@vben/vite-config": "workspace:*", "@vben/vite-config": "workspace:*",
"@vben/vsh": "workspace:*", "@vben/vsh": "workspace:*",
"@venus/prettier-config": "workspace:*",
"@venus/prettier-plugin-wxml": "workspace:*",
"@vitejs/plugin-vue": "catalog:", "@vitejs/plugin-vue": "catalog:",
"@vitejs/plugin-vue-jsx": "catalog:", "@vitejs/plugin-vue-jsx": "catalog:",
"@vue/test-utils": "catalog:", "@vue/test-utils": "catalog:",
...@@ -79,6 +82,9 @@ ...@@ -79,6 +82,9 @@
"is-ci": "catalog:", "is-ci": "catalog:",
"lefthook": "catalog:", "lefthook": "catalog:",
"playwright": "catalog:", "playwright": "catalog:",
"prettier": "catalog:",
"prettier-plugin-mp": "catalog:",
"prettier-plugin-tailwindcss": "catalog:",
"rimraf": "catalog:", "rimraf": "catalog:",
"tailwindcss": "catalog:", "tailwindcss": "catalog:",
"turbo": "catalog:", "turbo": "catalog:",
......
This diff could not be displayed because it is too large.
packages: packages:
- internal/lint-configs/prettier-config/plugin/*
- internal/* - internal/*
- internal/lint-configs/* - internal/lint-configs/*
- packages/* - packages/*
...@@ -144,6 +145,7 @@ catalog: ...@@ -144,6 +145,7 @@ catalog:
postcss-preset-env: ^10.2.4 postcss-preset-env: ^10.2.4
postcss-scss: ^4.0.9 postcss-scss: ^4.0.9
prettier: ^3.6.2 prettier: ^3.6.2
prettier-plugin-mp: ^2.5.0
prettier-plugin-tailwindcss: ^0.7.1 prettier-plugin-tailwindcss: ^0.7.1
publint: ^0.3.12 publint: ^0.3.12
qrcode: ^1.5.4 qrcode: ^1.5.4
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
getPackages, getPackages,
gitAdd, gitAdd,
outputJSON, outputJSON,
// prettierFormat, prettierFormat,
toPosixPath, toPosixPath,
} from "@vben/node-utils"; } from "@vben/node-utils";
...@@ -40,7 +40,7 @@ async function createCodeWorkspace({ ...@@ -40,7 +40,7 @@ async function createCodeWorkspace({
const outputPath = join(monorepoRoot, CODE_WORKSPACE_FILE); const outputPath = join(monorepoRoot, CODE_WORKSPACE_FILE);
await outputJSON(outputPath, { folders }, spaces); await outputJSON(outputPath, { folders }, spaces);
// await prettierFormat(outputPath); await prettierFormat(outputPath);
if (autoCommit) { if (autoCommit) {
await gitAdd(CODE_WORKSPACE_FILE, monorepoRoot); await gitAdd(CODE_WORKSPACE_FILE, monorepoRoot);
} }
......
{ {
"folders": [
{
"name": "@vben/backend-mock",
"path": "apps/backend-mock"
},
{
"name": "wechat-app-mall",
"path": "apps/miniprogram/wechat-app-mall-master"
},
{
"name": "wx-mall",
"path": "apps/miniprogram/wx-mall-master"
},
{
"name": "unibest",
"path": "apps/uniapp/unidemo"
},
{
"name": "@vben/playground",
"path": "apps/web/playground"
},
{
"name": "@vben/web-antd",
"path": "apps/web/web-antd"
},
{
"name": "@vben/docs",
"path": "docs"
},
{
"name": "@vben/commitlint-config",
"path": "internal/lint-configs/commitlint-config"
},
{
"name": "@vben/eslint-config",
"path": "internal/lint-configs/eslint-config"
},
{
"name": "@vben/stylelint-config",
"path": "internal/lint-configs/stylelint-config"
},
{
"name": "@vben/node-utils",
"path": "internal/node-utils"
},
{
"name": "@vben/tailwind-config",
"path": "internal/tailwind-config"
},
{
"name": "@vben/tsconfig",
"path": "internal/tsconfig"
},
{
"name": "@vben/vite-config",
"path": "internal/vite-config"
},
{
"name": "@vben-core/design",
"path": "packages/@core/base/design"
},
{
"name": "@vben-core/icons",
"path": "packages/@core/base/icons"
},
{
"name": "@vben-core/shared",
"path": "packages/@core/base/shared"
},
{
"name": "@vben-core/typings",
"path": "packages/@core/base/typings"
},
{
"name": "@vben-core/composables",
"path": "packages/@core/composables"
},
{
"name": "@vben-core/preferences",
"path": "packages/@core/preferences"
},
{
"name": "@vben-core/form-ui",
"path": "packages/@core/ui-kit/form-ui"
},
{
"name": "@vben-core/layout-ui",
"path": "packages/@core/ui-kit/layout-ui"
},
{
"name": "@vben-core/menu-ui",
"path": "packages/@core/ui-kit/menu-ui"
},
{
"name": "@vben-core/popup-ui",
"path": "packages/@core/ui-kit/popup-ui"
},
{
"name": "@vben-core/shadcn-ui",
"path": "packages/@core/ui-kit/shadcn-ui"
},
{
"name": "@vben-core/tabs-ui",
"path": "packages/@core/ui-kit/tabs-ui"
},
{
"name": "@vben/constants",
"path": "packages/constants"
},
{
"name": "@vben/access",
"path": "packages/effects/access"
},
{
"name": "@vben/common-ui",
"path": "packages/effects/common-ui"
},
{
"name": "@vben/hooks",
"path": "packages/effects/hooks"
},
{
"name": "@vben/layouts",
"path": "packages/effects/layouts"
},
{
"name": "@vben/plugins",
"path": "packages/effects/plugins"
},
{
"name": "@vben/request",
"path": "packages/effects/request"
},
{
"name": "@vben/icons",
"path": "packages/icons"
},
{
"name": "@vben/locales",
"path": "packages/locales"
},
{
"name": "@vben/preferences",
"path": "packages/preferences"
},
{
"name": "@vben/stores",
"path": "packages/stores"
},
{
"name": "@vben/styles",
"path": "packages/styles"
},
{
"name": "@vben/types",
"path": "packages/types"
},
{
"name": "@vben/utils",
"path": "packages/utils"
},
{
"name": "@vben/turbo-run",
"path": "scripts/turbo-run"
},
{
"name": "@vben/vsh",
"path": "scripts/vsh"
}
]
}
\ No newline at end of file \ No newline at end of file
"folders": [
{
"name": "@vben/backend-mock",
"path": "apps/backend-mock",
},
{
"name": "wechat-app-mall",
"path": "apps/miniprogram/wechat-app-mall-master",
},
{
"name": "wx-mall",
"path": "apps/miniprogram/wx-mall-master",
},
{
"name": "unibest",
"path": "apps/uniapp/unidemo",
},
{
"name": "@vben/playground",
"path": "apps/web/playground",
},
{
"name": "@vben/web-antd",
"path": "apps/web/web-antd",
},
{
"name": "@vben/docs",
"path": "docs",
},
{
"name": "@vben/commitlint-config",
"path": "internal/lint-configs/commitlint-config",
},
{
"name": "@vben/eslint-config",
"path": "internal/lint-configs/eslint-config",
},
{
"name": "@venus/prettier-config",
"path": "internal/lint-configs/prettier-config",
},
{
"name": "@venus/prettier-plugin-wxml",
"path": "internal/lint-configs/prettier-config/plugin/prettier-plugin-wxml",
},
{
"name": "@vben/stylelint-config",
"path": "internal/lint-configs/stylelint-config",
},
{
"name": "@vben/node-utils",
"path": "internal/node-utils",
},
{
"name": "@vben/tailwind-config",
"path": "internal/tailwind-config",
},
{
"name": "@vben/tsconfig",
"path": "internal/tsconfig",
},
{
"name": "@vben/vite-config",
"path": "internal/vite-config",
},
{
"name": "@vben-core/design",
"path": "packages/@core/base/design",
},
{
"name": "@vben-core/icons",
"path": "packages/@core/base/icons",
},
{
"name": "@vben-core/shared",
"path": "packages/@core/base/shared",
},
{
"name": "@vben-core/typings",
"path": "packages/@core/base/typings",
},
{
"name": "@vben-core/composables",
"path": "packages/@core/composables",
},
{
"name": "@vben-core/preferences",
"path": "packages/@core/preferences",
},
{
"name": "@vben-core/form-ui",
"path": "packages/@core/ui-kit/form-ui",
},
{
"name": "@vben-core/layout-ui",
"path": "packages/@core/ui-kit/layout-ui",
},
{
"name": "@vben-core/menu-ui",
"path": "packages/@core/ui-kit/menu-ui",
},
{
"name": "@vben-core/popup-ui",
"path": "packages/@core/ui-kit/popup-ui",
},
{
"name": "@vben-core/shadcn-ui",
"path": "packages/@core/ui-kit/shadcn-ui",
},
{
"name": "@vben-core/tabs-ui",
"path": "packages/@core/ui-kit/tabs-ui",
},
{
"name": "@vben/constants",
"path": "packages/constants",
},
{
"name": "@vben/access",
"path": "packages/effects/access",
},
{
"name": "@vben/common-ui",
"path": "packages/effects/common-ui",
},
{
"name": "@vben/hooks",
"path": "packages/effects/hooks",
},
{
"name": "@vben/layouts",
"path": "packages/effects/layouts",
},
{
"name": "@vben/plugins",
"path": "packages/effects/plugins",
},
{
"name": "@vben/request",
"path": "packages/effects/request",
},
{
"name": "@vben/icons",
"path": "packages/icons",
},
{
"name": "@vben/locales",
"path": "packages/locales",
},
{
"name": "@vben/preferences",
"path": "packages/preferences",
},
{
"name": "@vben/stores",
"path": "packages/stores",
},
{
"name": "@vben/styles",
"path": "packages/styles",
},
{
"name": "@vben/types",
"path": "packages/types",
},
{
"name": "@vben/utils",
"path": "packages/utils",
},
{
"name": "@vben/turbo-run",
"path": "scripts/turbo-run",
},
{
"name": "@vben/vsh",
"path": "scripts/vsh",
},
],
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!