-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ✨ 添加 web-type.json 支持 webstorm 代码提示 #871
Conversation
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
15300206 | Triggered | Generic Password | ea53814 | pnpm-lock.yaml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
总览工作流程为 npm 发布工作流程添加了一个新步骤,具体是在 变更
对链接问题的评估
可能相关的 PR
诗歌
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for wot-design-uni ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
docs/component/datetime-picker-view.md (1)
Line range hint
52-52
: 修正 year 类型的描述文本year 类型的描述文本有误,应该只显示年份,而不是年月。
- `year` 类型只展示年月。 + `year` 类型只展示年。🧰 Tools
🪛 Markdownlint (0.37.0)
1-1: null
Multiple spaces after hash on atx style heading(MD019, no-multiple-space-atx)
🧹 Nitpick comments (22)
docs/component/layout.md (1)
3-3
: 简洁明了的组件介绍!这个简短的介绍很好地概括了 Layout 组件的主要用途,有助于开发者快速理解组件的功能。
不过建议考虑补充一下具体的使用场景,比如:
-用于快速进行布局。 +用于快速进行页面布局,支持24栅格系统,可以轻松创建响应式的页面结构。docs/component/sort-button.md (1)
Line range hint
7-17
: 建议增加代码示例的注释说明为了提高代码示例的可读性和理解性,建议在示例代码中添加更详细的注释,说明每个状态值的具体含义和使用场景。
建议按如下方式优化代码示例:
```html +<!-- value: 1 表示升序,0 表示未选中,-1 表示降序 --> <wd-sort-button title="价格" v-model="value" @change="handleChange" />
const value = ref<number>(0) +// 排序状态改变时的回调函数 function handleChange({ value }) { + // value 为当前选中的排序状态 console.log(value) }<details> <summary>🧰 Tools</summary> <details> <summary>🪛 Markdownlint (0.37.0)</summary> 1-1: null Multiple spaces after hash on atx style heading (MD019, no-multiple-space-atx) </details> </details> </blockquote></details> <details> <summary>docs/component/rate.md (1)</summary><blockquote> `3-3`: **建议修正语法用词** 描述清晰地说明了组件的用途,这很好!不过有一处语法需要调整: - 当"快速"修饰动词"评价"时,应该使用"地"而不是"的" 建议按如下方式修改: ```diff -用于快速的评价操作,或对评价进行展示。 +用于快速地评价操作,或对评价进行展示。
🧰 Tools
🪛 LanguageTool
[uncategorized] ~3-~3: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:快速"地"评价
Context: # Rate 评分 用于快速的评价操作,或对评价进行展示。 ## 基本用法 设置v-model
分数,设...(wb4)
scripts/qrcode.ts (3)
50-84
:generateMiniProgramCode
函数的重试逻辑可进一步优化。
目前在失败后仅重复网络请求,若错误是用户或配置导致,反复重试意义不大。建议根据返回的错误类型或状态码,分别做处理(如身份认证失败可直接退出;网络波动可继续重试)。
86-90
: 可能考虑并行生成二维码。
目前的写法是 for-of 循环同步调用,可进一步通过 Promise.all 并行生成,提高效率(若并行不会触发接口限流)。- for (const page of pages) { - await generateMiniProgramCode(accessToken, page.path) - } + await Promise.all( + pages.map((page) => generateMiniProgramCode(accessToken, page.path)) + )
104-104
: 脚本入口点命名轻微拼写问题。
genrateQRCodeImage
建议更正为generateQRCodeImage
以更易读。-genrateQRCodeImage() +generateQRCodeImage()scripts/compiler.ts (1)
24-24
: 递归函数调用无明显问题,但要注意异常处理。
若复制时出现读写异常,可能会被直接忽略,可考虑增加错误处理或重试机制。scripts/release.ts (1)
80-82
: 变量命名tarfetPackageJson
存在拼写问题,可考虑修正。
拼写正确能降低维护成本,避免歧义。- const tarfetPackageJson = require('../src/uni_modules/wot-design-uni/package.json') + const targetPackageJson = require('../src/uni_modules/wot-design-uni/package.json')scripts/build-web-types.ts (2)
58-66
:findModule
函数基于正则匹配搜索类型所在模块,能适用于常见场景。
若后续复杂度提升,需考虑在 build 过程中建立更完善的类型映射表。
68-71
:toKebabCase
函数简单实用,能在属性名转换中避免断词错误。
请确保在国际化字符场景下也有合理的处理策略。scripts/buildThemeVars.ts (2)
Line range hint
4-16
: 函数类型定义清晰,建议进一步完善错误处理
为函数extractSCSSVariables
添加了显式类型,增加可读性和可维护性。若未检测到/* component var */
时,仅打印错误信息可能导致后续步骤失败却无明显提示,考虑抛出异常或在脚本层面做更完备的处理。
Line range hint
34-69
: 字符串拼接逻辑可正常工作,但建议考虑模板化
generateTSFileContent
通过多次字符串累加生成输出,在变量数量增加时可能影响可读性与维护性。可考虑使用模板引擎或收集片段后一次性join
,使代码更简洁易维护。docs/component/count-to.md (1)
3-3
: 建议补充组件描述当前描述过于简单,建议补充以下内容:
- 组件的主要使用场景
- 支持的特性(如数字动画、格式化等)
- 常见应用示例
建议修改为:
-数字滚动组件。 +数字滚动组件,用于数据展示,支持数字动画过渡、自定义起始值、结束值、持续时间、格式化等特性,常用于数据统计展示、金额变化等场景。docs/component/search.md (1)
3-3
: 建议优化组件描述当前描述偏重于技术实现,建议从用户使用角度描述组件功能。
建议修改为:
-搜索框组件,支持输入框聚焦、失焦、输入、搜索、取消、清空事件。 +搜索框组件,用于用户输入搜索内容并执行搜索操作,支持搜索建议、取消搜索、清空输入等交互功能,广泛应用于站内搜索、列表筛选等场景。docs/component/radio.md (1)
3-3
: 建议丰富组件描述当前描述准确但可以提供更多使用场景信息。
建议修改为:
-单选框,用于在一组备选项中进行单选。 +单选框,用于在一组互斥的备选项中选择单个选项,支持多种形态(普通、按钮、点状)和布局方式,常用于设置项选择、表单选项等场景。package.json (1)
104-104
: 依赖更新:新增开发工具支持新增了以下关键依赖:
- components-helper:用于生成 web-types
- esno:用于执行 TypeScript 脚本
- fast-glob:用于文件模式匹配
- inquirer 升级到最新版本
建议在 README 中更新开发环境要求说明。
Also applies to: 109-110, 113-113
docs/component/tabbar.md (2)
163-166
: 属性表格格式需要优化表格前后缺少空行,影响文档的可读性。建议在表格前后添加空行。
## Attributes + | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | |-----------------------|--------------------------------------------|-----------------------------|--------------------------------------|-------------------|------------| | model-value / v-model | 选中标签的索引值或者名称 | number / string | - | 0 | 0.1.27 | +🧰 Tools
🪛 Markdownlint (0.37.0)
164-164: null
Tables should be surrounded by blank lines(MD058, blanks-around-tables)
205-205
: TabbarItem Slots 表格格式需要优化表格前后缺少空行,影响文档的可读性。建议在表格前后添加空行。
## TabbarItem Slots + | name | 说明 | 参数 | 最低版本 | | ------ | -------------------- | ----------------------- | -------- | | icon | 自定义图标 | `active: boolean` | 0.1.27 | +docs/component/message-box.md (1)
272-277
: 属性表格格式需要优化表格前后缺少空行,且与上方内容间距过大。建议调整格式。
## Attributes - - | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | | ------------- | -------- | ------- | ------ | ------ | -------- | | selector | 指定唯一标识 | string | - | - | - | - + | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | | ------------- | -------- | ------- | ------ | ------ | -------- | | selector | 指定唯一标识 | string | - | - | - | +docs/component/datetime-picker-view.md (3)
3-3
: 建议增强组件描述当前描述过于简单,建议补充以下内容:
- 组件的主要用途和应用场景
- 与普通 Picker 组件的区别
- 支持的日期时间格式类型概览
建议修改为:
- 为 Picker 组件的封装,在其内部构建好日期时间选项。 + 为 Picker 组件的封装,提供日期和时间选择功能。支持年、年月、年月日、时分等多种格式,内部自动构建日期时间选项,简化了开发者的使用成本。适用于需要用户选择日期或时间的表单场景。
Line range hint
108-108
: 建议完善 filter 部分的文档说明filter 功能的说明可以更加详细,建议补充:
- 具体的使用场景
- 各种类型的示例值范围
- 更多的实际应用示例
建议在示例代码前添加以下说明:
+ filter 函数用于自定义过滤选项,常见的应用场景包括: + - 限制分钟选项为每5分钟或10分钟 + - 过滤掉不可选择的年份或月份 + - 自定义工作时间范围 + + 各类型的值范围参考: + - year: 根据 minDate/maxDate 计算的年份列表 + - month: 1-12 + - date: 1-31(根据实际月份自动调整) + - hour: 0-23 + - minute: 0-59🧰 Tools
🪛 Markdownlint (0.37.0)
1-1: null
Multiple spaces after hash on atx style heading(MD019, no-multiple-space-atx)
Line range hint
126-141
: 建议优化属性表格的说明属性表格的部分说明需要优化:
建议进行以下改进:
- 补充 v-model 的说明:
- v-model | 选中项,当 type 为 time 时,类型为字符串,否则为 `timestamp` | `string` / `timestamp` | - | - | + v-model | 选中项,当 type 为 time 时,类型为 HH:mm 格式的字符串,否则为 13 位的时间戳。例如:time 类型:"12:30",其他类型:1642432323000 | `string` / `timestamp` | - | - |
- 补充 formatter 的说明:
- formatter | 自定义弹出层选项文案的格式化函数,返回一个字符串 | function | - | - | - | + formatter | 自定义弹出层选项文案的格式化函数,接收 type(year/month/date/hour/minute) 和 value 参数,返回显示的字符串。启用后会覆盖默认的 display-format 行为 | function | - | - | - |🧰 Tools
🪛 Markdownlint (0.37.0)
1-1: null
Multiple spaces after hash on atx style heading(MD019, no-multiple-space-atx)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (61)
.github/workflows/npm-publish.yml
(1 hunks).gitignore
(1 hunks)build/qrcode.js
(0 hunks)docs/component/action-sheet.md
(1 hunks)docs/component/backtop.md
(1 hunks)docs/component/button.md
(1 hunks)docs/component/card.md
(1 hunks)docs/component/cell.md
(1 hunks)docs/component/checkbox.md
(1 hunks)docs/component/collapse.md
(1 hunks)docs/component/config-provider.md
(0 hunks)docs/component/count-to.md
(1 hunks)docs/component/datetime-picker-view.md
(1 hunks)docs/component/datetime-picker.md
(1 hunks)docs/component/divider.md
(1 hunks)docs/component/drop-menu.md
(1 hunks)docs/component/fab.md
(1 hunks)docs/component/floating-panel.md
(0 hunks)docs/component/grid.md
(1 hunks)docs/component/icon.md
(1 hunks)docs/component/img-cropper.md
(1 hunks)docs/component/img.md
(1 hunks)docs/component/input-number.md
(1 hunks)docs/component/input.md
(1 hunks)docs/component/layout.md
(1 hunks)docs/component/loading.md
(1 hunks)docs/component/loadmore.md
(1 hunks)docs/component/message-box.md
(3 hunks)docs/component/navbar.md
(3 hunks)docs/component/notice-bar.md
(1 hunks)docs/component/notify.md
(2 hunks)docs/component/pagination.md
(1 hunks)docs/component/picker-view.md
(1 hunks)docs/component/popup.md
(1 hunks)docs/component/radio.md
(1 hunks)docs/component/rate.md
(1 hunks)docs/component/search.md
(1 hunks)docs/component/segmented.md
(1 hunks)docs/component/select-picker.md
(1 hunks)docs/component/sort-button.md
(1 hunks)docs/component/steps.md
(1 hunks)docs/component/sticky.md
(1 hunks)docs/component/swipe-action.md
(1 hunks)docs/component/switch.md
(1 hunks)docs/component/tabbar.md
(4 hunks)docs/component/tabs.md
(1 hunks)docs/component/tag.md
(1 hunks)docs/component/text.md
(1 hunks)docs/component/toast.md
(1 hunks)docs/component/tooltip.md
(1 hunks)docs/component/transition.md
(1 hunks)package.json
(2 hunks)scripts/build-web-types.ts
(1 hunks)scripts/buildThemeVars.ts
(3 hunks)scripts/changelog.ts
(1 hunks)scripts/compiler.ts
(3 hunks)scripts/component-helper.ts
(1 hunks)scripts/demoCopy.ts
(1 hunks)scripts/qrcode.ts
(1 hunks)scripts/release.ts
(3 hunks)src/uni_modules/wot-design-uni/package.json
(1 hunks)
💤 Files with no reviewable changes (3)
- docs/component/floating-panel.md
- docs/component/config-provider.md
- build/qrcode.js
✅ Files skipped from review due to trivial changes (19)
- docs/component/icon.md
- docs/component/img.md
- docs/component/sticky.md
- docs/component/pagination.md
- docs/component/notice-bar.md
- docs/component/loading.md
- docs/component/popup.md
- docs/component/drop-menu.md
- docs/component/text.md
- docs/component/backtop.md
- docs/component/img-cropper.md
- .gitignore
- docs/component/action-sheet.md
- docs/component/picker-view.md
- docs/component/datetime-picker.md
- docs/component/cell.md
- docs/component/grid.md
- docs/component/tooltip.md
- docs/component/navbar.md
🧰 Additional context used
🪛 Markdownlint (0.37.0)
docs/component/tabbar.md
164-164: null
Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🪛 LanguageTool
docs/component/rate.md
[uncategorized] ~3-~3: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:快速"地"评价
Context: # Rate 评分 用于快速的评价操作,或对评价进行展示。 ## 基本用法 设置v-model
分数,设...
(wb4)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (61)
docs/component/sort-button.md (2)
3-3
: 组件描述清晰准确!新增的描述简洁地说明了组件的功能和支持的状态,有助于开发者快速理解组件的用途。
Line range hint
52-52
: 建议明确说明 v-model 的默认值在属性表格中,v-model 的默认值描述为"0或-1",这样的描述可能会让开发者感到困惑。建议明确说明在什么情况下默认值是 0,什么情况下是 -1。
🧰 Tools
🪛 Markdownlint (0.37.0)
1-1: null
Multiple spaces after hash on atx style heading(MD019, no-multiple-space-atx)
docs/component/tag.md (1)
3-3
: 描述清晰准确,符合组件功能!描述简洁明了,准确地概括了标签组件的主要用途,有助于开发者理解组件的适用场景。
scripts/qrcode.ts (6)
1-4
: 导入模块的实现看起来很干净。
这些基础库已被正确地使用,且写法符合 ES Module 规范。
9-19
: 网络请求与错误处理机制整体可行。
在getAccessToken
函数中已包含try/catch
并打印错误。若需要进一步提高鲁棒性,可添加重试逻辑或超时处理。
24-33
: 读取并解析pages.json
的处理方式合理。
使用JSON5.parse
使得对注释或更灵活的 JSON 格式兼容性更好。错误处理也做得较为全面。
34-41
:camelToKebabCase
函数实现简单明了。
多次使用正则表达式替换,能有效完成大小写转换与连接符插入,逻辑清晰。
43-48
: 删除目录前的检查方式正确。
使用fs.rmSync
时已传递{ recursive: true, force: true }
,确保即使目录不存在也不会抛出异常;满足脚本需求。
92-102
: 整体流程的封装结构清晰。
genrateQRCodeImage
函数先删除旧目录、获取令牌、再批量生成二维码,容错逻辑完整。若后续需要更灵活的逻辑,可将获取令牌与二维码生成解耦。scripts/component-helper.ts (4)
1-31
: 配置对象书写规范且字段命名清晰。
包含了标签、属性、web-types 输出文件的命名及正则表达式等,用于驱动后续的元数据解析逻辑,没有明显问题。
33-94
:normalize
函数逻辑符合预期。
- 通过正则提取文件名,赋值到
_data
上;- 按标题字符匹配区分属性、事件、插槽、指令等类型;
- 循环解析表格,并调用
setData
进行数据填充;
函数在大多数情况下能正确处理分段标题。若有更复杂的 Markdown 结构,需要额外测试或兜底处理。
96-139
:setData
函数能有效地将解析结果归类到对应的子标题下。
若存在同名子标题,可循环更新已有数据;若无则新建子项,实现了较好的可扩展性。
141-161
:generateWebTypes
函数成功串联并输出多个类型文件。
- 同步使用
fast-glob
搜集文件路径;- 读取、解析并进行归一化处理;
- 再通过
vetur
和webTypes
分别生成所需数据文件;- 最终落盘写入对应的 JSON 文件。
整体模块流程顺畅,将生成逻辑集中在一起,易于维护。scripts/changelog.ts (1)
1-2
: ES Module 方式导入替换 CommonJS 方式,符合现代 Node.js 规范。
无需额外 require 语法,且与本仓库其他脚本风格保持一致。scripts/demoCopy.ts (3)
1-9
: 文件头部信息可读性良好,保持注释一致性即可。
这些注释包含作者及修改时间等信息,有助于后续维护追踪。
10-11
: 采用 ES Module 语法替换require
,与 TypeScript 迁移保持一致。
转用import fs
和import path
能与项目整体风格统一。
16-16
: 为函数添加类型注解能提高可读性与安全性。
(sourceDir: string, targetDir: string)
的写法让 IDE 更好地提供提示,对后续维护利大于弊。scripts/compiler.ts (3)
1-2
: ES Module 语法迁移成功,保持与其他脚本一致。
替换require
为import
提高了代码一致性,将来升级也更方便。
7-7
: 新增 TypeScript 类型注解能帮助避免不必要的运行时错误。
通过srcPath: string, tarPath: string, filter: string[] = []
明确参数类型,有利于团队协作。
37-37
: 为copyFile
方法增加类型注解能保持代码风格一致。
该方法与copyComponents
的注解思路相同,保持整体统一性很好。scripts/release.ts (3)
1-3
: 引入模块改为 ES Module 格式,符合项目整体升级方向。
import
形式能让 Tree Shaking 等优化更直观。
10-10
:handleLowestVersion
添加类型注解,类型安全性提升。
在大型脚本中明确定义dir: string, version: string
能减少意外的类型错误。
84-84
: 通过脚本执行pnpm build:theme-vars
提高了发布流程的自动化程度。
在发版时构建主题变量可保证包的完整性和一致性。scripts/build-web-types.ts (10)
1-9
: 文件开头导入与版本信息读取逻辑清晰易懂。
此处直接从package.json
获取name
和version
,有助于保持配置同步。
9-12
:typeMap
提供的模块映射应与组件中常用类型保持同步。
最好定期检查该映射是否需要新增或更新,以避免遗漏一些扩展类型。
14-21
:removeHtmlTagsAndNonEnglish
函数对组件名等进行清洗,避免不必要字符干扰。
实现简明,可在后续需要时结合更多正则或替换规则。
24-26
: 使用函数式写法命名组件,增加前缀wd-
有助于区分命名空间。
这样在注册组件时能避免与其他库冲突,符合多组件库并存的最佳实践。
29-34
: 生成文档地址时,需确认fileName
与路由路径的一致性。
若文档路由规则改变,需要同步更新此处逻辑。
37-44
:reWebTypesSource
函数将组件名转换为符号,易于 TypeScript IDE 关联。
基于驼峰处理能较好兼容大部分场景,如需支持多单词拆分可再拓展。
47-55
: 为类型提供source: { symbol, module }
输出,说明其依赖关系更清晰。
在 IDE 提示中能让开发者快速了解类型所在的模块,增强可维护性。
74-88
:reAttribute
函数对v-model:
动态处理非常灵活。
此逻辑可应对多种情况,但需注意兼容性,如遇到更复杂的场景可能要强化校验。
91-95
: 根据操作系统差异替换路径分隔符,减少在 Windows 环境下出错的风险。
这是常见痛点处理方案之一,能有效避免路径拼接问题。
97-119
: 调用generateWebTypes
时集中配置了相关映射与正则,可直接定制处理规则。
配置项足够灵活,可覆盖大部分组件文档生成场景。scripts/buildThemeVars.ts (2)
1-2
: 使用 ES 模块导入,符合当前 Node.js 生态趋势
这些修改成功将require
替换为import
,可提高整体可维护性,并与 ES 模块规范保持一致。
17-17
: 对variables
进行类型声明有助于减少潜在错误
显式声明variables
为Record<string, string>
,进一步强化了类型安全。.github/workflows/npm-publish.yml (1)
25-27
: 新增构建步骤完善了发布流程
该步骤为 WebStorm 提供更好的提示支持,整体流程更清晰,推荐在后续脚本中加入必要的错误处理与日志。docs/component/switch.md (1)
3-3
: 简介内容有效提升了文档可读性
新增说明“用来打开或关闭选项”,可让使用者快速了解开关组件的用途。docs/component/divider.md (1)
3-4
: 补充版本提示与用途说明,避免用户误用
强调了分割线的主要用途,并以危险提示块注明新增属性的版本要求,可减少用户误操作。docs/component/card.md (1)
3-3
: 描述准确且清晰!组件描述简洁明了,准确表达了卡片组件的主要用途。
src/uni_modules/wot-design-uni/package.json (1)
43-47
: 配置更新有助于提升开发体验!添加了 Vetur 和 web-types 配置,这将为 WebStorm 和其他 IDE 提供更好的代码提示支持。
docs/component/steps.md (2)
3-3
: 描述清晰准确!组件描述准确表达了步骤条的主要用途。
5-7
: 破坏性更新提醒清晰明确!很好地提醒了用户关于插槽使用方式的重要变更。建议在组件代码中也添加相应的废弃警告。
✅ Verification successful
不需要添加废弃警告
由于旧的插槽(
title-slot
、icon-slot
和description-slot
)已经被完全移除,且新的插槽命名已经在文档中清晰说明,因此无需在组件代码中添加废弃警告。文档中的破坏性更新提醒已经足够清晰地传达了这一变更。🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # 检查是否已在组件代码中添加废弃警告 rg -l "deprecated|废弃" --type ts --type vueLength of output: 72
Script:
#!/bin/bash # First find the Steps component files fd -e vue -e tsx -e ts "step" --type f # Then search for deprecation warnings in Chinese and English rg "deprecated|废弃|不推荐使用" $(fd -e vue -e tsx -e ts "step" --type f)Length of output: 357
Script:
#!/bin/bash # Check the content of the component files for slot definitions echo "=== wd-step.vue ===" cat src/uni_modules/wot-design-uni/components/wd-step/wd-step.vue echo -e "\n=== wd-steps.vue ===" cat src/uni_modules/wot-design-uni/components/wd-steps/wd-steps.vueLength of output: 5092
docs/component/loadmore.md (1)
3-3
: 描述简洁有效!组件描述准确说明了加载更多组件的使用场景和位置。
docs/component/input-number.md (1)
3-3
: 描述全面且详细!组件描述清晰地说明了计数器的组成部分和用途。
docs/component/transition.md (1)
3-3
: 描述清晰准确!组件描述简洁地说明了过渡动画组件的主要用途。
docs/component/toast.md (1)
3-3
: 描述全面完整!组件描述涵盖了轻提示组件的所有主要功能,包括消息通知、加载提示和操作结果提示,并强调了函数式调用支持。
docs/component/segmented.md (1)
3-3
: 文档改进:添加了组件功能说明新增的描述清晰地说明了分段器组件的主要功能和用途。
package.json (2)
45-45
: 构建脚本优化:使用 pnpm 和 esno将构建文档的脚本更新为使用 pnpm 和 esno,提高了构建过程的一致性和可靠性。
54-54
: 新增功能:添加多个构建相关脚本新增了以下实用的构建脚本:
- web-types 生成
- 二维码生成
- 更新日志生成
- 主题变量构建
Also applies to: 59-61
docs/component/fab.md (1)
8-9
: 文档完善:添加了重要使用说明新增了关于点击事件处理的重要说明,包括:
- 使用 useQueue hook 实现自动关闭功能
- 防止事件冒泡的处理方法
docs/component/swipe-action.md (2)
3-3
: 文档改进:添加了组件用途说明清晰地说明了滑动操作组件的常见使用场景。
Line range hint
5-8
: 文档完善:添加了用户体验建议新增了重要的用户体验建议:
- 建议使用更直观的交互方式(如 ActionSheet)
- 建议添加操作提示以提高功能可发现性
docs/component/input.md (2)
3-3
: 文档改进:添加了组件说明新增了简洁明了的输入框组件功能说明。
5-7
: 文档完善:添加了重要迁移提示新增了关于 textarea 功能迁移的重要提示,有助于用户顺利升级和使用新的 Textarea 组件。
docs/component/notify.md (1)
3-4
: 组件描述清晰简洁新增的组件描述准确地说明了组件的用途和位置。
docs/component/checkbox.md (1)
3-4
: 组件描述清晰简洁新增的组件描述准确地说明了复选框的用途。
docs/component/message-box.md (1)
3-3
: 组件描述清晰简洁新增的组件描述准确地说明了弹框组件的用途和支持的调用方式。
docs/component/collapse.md (1)
3-4
: 组件描述清晰简洁新增的组件描述准确地说明了折叠面板的用途和交互方式。
docs/component/tabs.md (1)
3-3
: 描述清晰准确!组件描述简洁明了,准确表达了标签页组件的主要用途。
docs/component/button.md (1)
3-3
: 描述恰当且实用!按钮组件的描述准确概括了其主要用途,并列举了常见使用场景。
docs/component/select-picker.md (1)
3-3
: 描述简洁有效!选择器组件的描述准确传达了其支持单选和多选的核心功能。
const appID = process.argv[process.argv.indexOf('--APP_ID') + 1] | ||
const appSecret = process.argv[process.argv.indexOf('--APP_SECRET') + 1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
需校验命令行参数的有效性。
如果运行脚本时未传入 --APP_ID
或 --APP_SECRET
参数,process.argv.indexOf()
可能返回 -1,会导致取值索引越界。建议在访问前先判断是否存在对应的参数以及参数值,避免脚本意外报错。
+if (process.argv.indexOf('--APP_ID') === -1 || process.argv.indexOf('--APP_SECRET') === -1) {
+ console.error('请提供 --APP_ID 和 --APP_SECRET 参数')
+ process.exit(1)
+}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const appID = process.argv[process.argv.indexOf('--APP_ID') + 1] | |
const appSecret = process.argv[process.argv.indexOf('--APP_SECRET') + 1] | |
if (process.argv.indexOf('--APP_ID') === -1 || process.argv.indexOf('--APP_SECRET') === -1) { | |
console.error('请提供 --APP_ID 和 --APP_SECRET 参数') | |
process.exit(1) | |
} | |
const appID = process.argv[process.argv.indexOf('--APP_ID') + 1] | |
const appSecret = process.argv[process.argv.indexOf('--APP_SECRET') + 1] |
✅ Closes: #819
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
#819
💡 需求背景和解决方案
目前webstorm无法通过volar完成代码提示,故引入
components-helper
通过markdown
文档生成web-types.json来实现此功能。顺便将js脚本迁移到
typescript
,并引入esno
执行ts脚本☑️ 请求合并前的自查清单
Summary by CodeRabbit
以下是发布说明:
新功能
构建脚本
esno
替代node
文档
依赖
components-helper
和esno
依赖inquirer
版本其他改进
.gitignore