feat: auto import css plugin
🤔 这个变动的性质是?
- [ ] 新特性提交
- [ ] 日常 bug 修复
- [ ] 站点、文档改进
- [ ] 演示代码改进
- [ ] 组件样式/交互改进
- [ ] TypeScript 定义更新
- [ ] 包体积优化
- [ ] 性能优化
- [ ] 功能增强
- [ ] 国际化改进
- [ ] 重构
- [ ] 代码风格优化
- [ ] 测试用例
- [ ] 分支合并
- [ ] 其他改动(是关于什么的改动?)
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
⚠️ 请自检并全部勾选全部选项。⚠️
- [ ] 文档已补充或无须补充
- [ ] 代码演示已提供或无须提供
- [ ] TypeScript 定义已补充或无须补充
- [ ] fork仓库代码是否为最新避免文件冲突
- [ ] Files changed 没有 package.json lock 等无关文件
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 83.98%. Comparing base (
301a9e0) to head (aefd0a7). Report is 2 commits behind head on V3.0.
Additional details and impacted files
@@ Coverage Diff @@
## V3.0 #2613 +/- ##
=======================================
Coverage 83.98% 83.98%
=======================================
Files 221 221
Lines 17867 17867
Branches 2676 2676
=======================================
Hits 15005 15005
Misses 2857 2857
Partials 5 5
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Walkthrough
此次更改涉及多个文件的新增和配置更新,主要集中在 packages/nutui-auto-import 目录下。新增了 .gitignore、LICENSE、README.md、babel.config.json、package.json、多个 TypeScript 配置文件以及测试文件。这些文件的引入和修改为该包提供了必要的配置、文档和测试支持,确保其在不同环境下的兼容性与功能性。
Changes
| 文件路径 | 更改摘要 |
|---|---|
packages/nutui-auto-import/.gitattributes |
添加了新行以指定所有文件应视为文本,并使用 LF 作为行结束符。 |
packages/nutui-auto-import/.gitignore |
新增 .gitignore 文件,指定忽略的文件和目录模式。 |
packages/nutui-auto-import/LICENSE |
添加了 MIT 许可证,声明软件的使用、复制、修改和分发权限。 |
packages/nutui-auto-import/README.md |
新增部分,详细说明包的按需导入组件样式文件的功能及示例。 |
packages/nutui-auto-import/babel.config.json |
新增 Babel 配置文件,指定使用 @babel/preset-react 预设。 |
packages/nutui-auto-import/package.json |
新增 package.json 文件,包含包的元数据和配置。 |
packages/nutui-auto-import/src/api.ts |
添加导出语句,表明该文件应视为模块。 |
packages/nutui-auto-import/src/core/options.ts |
新增 Options 接口和相关函数,定义选项和解析逻辑。 |
packages/nutui-auto-import/src/index.ts |
引入插件以支持自动导入功能,并定义相关方法。 |
packages/nutui-auto-import/src/esbuild.ts |
新增文件,导出 NutUIAutoImport 的 esbuild 属性。 |
packages/nutui-auto-import/src/rolldown.ts |
新增文件,导出 NutUIAutoImport 的 rolldown 属性。 |
packages/nutui-auto-import/src/rollup.ts |
新增文件,导出 NutUIAutoImport 的 rollup 属性。 |
packages/nutui-auto-import/src/rspack.ts |
新增文件,导出 NutUIAutoImport 的 rspack 属性。 |
packages/nutui-auto-import/src/vite.ts |
新增文件,导出 NutUIAutoImport 的 vite 属性。 |
packages/nutui-auto-import/src/webpack.ts |
新增文件,导出 NutUIAutoImport 的 webpack 属性。 |
packages/nutui-auto-import/tests/fixtures/basic.jsx |
新增一个 React 组件,导出名为 A 的功能组件。 |
packages/nutui-auto-import/tests/rollup.test.ts |
新增 Rollup 测试套件,封装对 *.jsx 文件的测试。 |
packages/nutui-auto-import/tsconfig.json |
新增 TypeScript 配置文件,指定编译选项。 |
packages/nutui-auto-import/tsup.config.ts |
新增 tsup 的配置文件,指定入口点和输出格式。 |
packages/nutui-auto-import/vitest.config.ts |
新增 Vitest 配置文件,设置测试环境。 |
.gitignore |
添加 .vite 目录的忽略条目。 |
pnpm-workspace.yaml |
在 packages 列表中新增 packages/nutui-auto-import。 |
Poem
🐰 在兔子洞里欢跳跃,
新文件如花儿绽放,
许可证和配置齐上阵,
测试与文档共辉煌。
让我们一起庆祝这变化,
NutUI 未来更辉煌! 🌟
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?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
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)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.