forked from cn-docs/vueuse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/vueuse/main'
# Conflicts: # CONTRIBUTING.md # pnpm-lock.yaml
- Loading branch information
Showing
29 changed files
with
10,819 additions
and
8,852 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,107 @@ | ||
# 贡献 | ||
# Contributing | ||
|
||
感谢您对该项目的兴趣! | ||
Thanks for being interested in contributing to this project! | ||
|
||
> **警告**: **⚠️ 减缓新功能的添加** | ||
> **Warning**: **⚠️ Slowing down new functions** | ||
> | ||
> 随着 VueUse 的受众不断增长,我们收到了大量的功能请求和拉取请求。因此,维护项目变得越来越具有挑战性,并且已经将我们的能力极限。因此,在不久的将来,我们可能需要减缓新功能的接受速度,并优先考虑现有功能的稳定性和质量。**请注意,此时可能不接受 VueUse 的新功能。** 如果您有任何新想法,我们建议您首先将它们合并到自己的代码库中,根据自己的需要进行迭代,并评估它们的通用性。如果您坚信您的想法对社区有益,可以提交拉取请求以及您的用例,我们将乐意进行审查和讨论。感谢您的理解。 | ||
> As the VueUse audience continues to grow, we have been inundated with an overwhelming number of feature requests and pull requests. As a result, maintaining the project has become increasingly challenging and has stretched our capacity to its limits. As such, in the near future, we may need to slow down our acceptance of new features and prioritize the stability and quality of existing functions. **Please note that new features for VueUse may not be accepted at this time.** If you have any new ideas, we suggest that you first incorporate them into your own codebase, iterate on them to suit your needs, and assess their generalizability. If you strongly believe that your ideas are beneficial to the community, you may submit a pull request along with your use cases, and we would be happy to review and discuss them. Thank you for your understanding. | ||
## 开发 | ||
## Development | ||
|
||
### 设置 | ||
### Setup | ||
|
||
将此存储库克隆到本地计算机并安装依赖项。 | ||
Clone this repo to your local machine and install the dependencies. | ||
|
||
```bash | ||
pnpm install | ||
``` | ||
|
||
我们使用 VitePress 进行快速开发和文档编写。您可以通过以下方式在本地启动它: | ||
We use VitePress for rapid development and documenting. You can start it locally by | ||
|
||
```bash | ||
pnpm dev | ||
``` | ||
|
||
## 贡献 | ||
## Contributing | ||
|
||
### 现有功能 | ||
### Existing functions | ||
|
||
请随意改进现有功能。请尽量不要引入破坏性的更改。 | ||
Feel free to enhance the existing functions. Please try not to introduce breaking changes. | ||
|
||
### 新功能 | ||
### New functions | ||
|
||
添加新功能时有一些注意事项 | ||
There are some notes for adding new functions | ||
|
||
- 在开始工作之前,最好先打开一个问题进行讨论。 | ||
- 实现应该放置在 `packages/core` 下作为一个文件夹,并在 `index.ts` 中公开。 | ||
- 在 `core` 包中,尽量不要引入第三方依赖,因为该包旨在尽可能轻量级。 | ||
- 如果您想要引入第三方依赖,请贡献到 @vueuse/integrations 或创建一个新的附加组件。 | ||
- 您可以在 `packages/core/_template/` 下找到功能模板,详情请参阅[功能文件夹](#功能文件夹)部分。 | ||
- 在为您的功能编写文档时,`<!--FOOTER_STARTS-->` 和 `<!--FOOTER_ENDS-->` 将在构建时自动更新,因此不必更新它们。 | ||
- Before you start working, it's better to open an issue to discuss first. | ||
- The implementation should be placed under `packages/core` as a folder and exposing in `index.ts` | ||
- In the `core` package, try not to introduce 3rd-party dependencies as this package is aimed to be as lightweight as possible. | ||
- If you'd like to introduce 3rd-party dependencies, please contribute to [@vueuse/integrations](https://github.com/vueuse/vueuse/tree/main/packages/integrations) or create a new add-on. | ||
- You can find the function template under `packages/core/_template/`, details explained in the [Function Folder](#function-folder) section. | ||
- When writing documentation for your function, the `<!--FOOTER_STARTS-->` and `<!--FOOTER_ENDS-->` will be automatically updated at build time, so don't feel the need to update them. | ||
|
||
> 请注意,您不需要更新包的 `index.ts`。它们是自动生成的。 | ||
> Please note you don't need to update packages' `index.ts`. They are auto-generated. | ||
### 新附加组件 | ||
### New add-ons | ||
|
||
新的附加组件非常受欢迎! | ||
New add-ons are greatly welcome! | ||
|
||
- 在 `packages/` 下创建一个新的文件夹,以您的附加组件名称命名。 | ||
- 在 `scripts/packages.ts` 中添加附加组件的详细信息。 | ||
- 在该文件夹下创建 `README.md`。 | ||
- 添加功能,就像您为核心包所做的那样。 | ||
- 提交并以 PR 形式提交。 | ||
- Create a new folder under `packages/`, name it as your add-on name. | ||
- Add add-on details in `scripts/packages.ts` | ||
- Create `README.md` under that folder. | ||
- Add functions as you would do to the core package. | ||
- Commit and submit as a PR. | ||
|
||
## 项目结构 | ||
## Project Structure | ||
|
||
### Monorepo | ||
|
||
我们使用单一存储库管理多个包 | ||
We use monorepo for multiple packages | ||
|
||
``` | ||
packages | ||
shared/ - 跨包共享的工具函数 | ||
core/ - 核心包 | ||
firebase/ - Firebase 附加组件 | ||
[...附加组件]/ - 附加组件命名 | ||
shared/ - shared utils across packages | ||
core/ - the core package | ||
firebase/ - the Firebase add-on | ||
[...addons]/ - add-ons named | ||
``` | ||
|
||
### 功能文件夹 | ||
### Function Folder | ||
|
||
一个功能文件夹通常包含以下 4 个文件: | ||
A function folder typically contains these 4 files: | ||
|
||
> 您可以在 `packages/core/_template/` 下找到模板 | ||
> You can find the template under `packages/core/_template/` | ||
```bash | ||
index.ts # 功能源代码本身 | ||
demo.vue # 文档演示 | ||
index.test.ts # vitest 单元测试 | ||
index.md # 文档 | ||
index.ts # function source code itself | ||
demo.vue # documentation demo | ||
index.test.ts # vitest unit testing | ||
index.md # documentation | ||
``` | ||
|
||
对于 `index.ts`,您应该使用名称导出函数。 | ||
for `index.ts` you should export the function with names. | ||
|
||
```ts | ||
// 正确 | ||
// DO | ||
export { useMyFunction } | ||
|
||
// 错误 | ||
// DON'T | ||
export default useMyFunction | ||
``` | ||
|
||
对于 `index.md`,第一句将显示为功能列表中的简短介绍,因此请保持简洁和清晰。 | ||
for `index.md` the first sentence will be displayed as the short intro in the function list, so try to keep it brief and clear. | ||
|
||
```markdown | ||
# useMyFunction | ||
|
||
这将是介绍。详细描述…… | ||
This will be the intro. The detail descriptions... | ||
``` | ||
|
||
阅读更多有关[指南](https://vueuse.org/guidelines)的信息。 | ||
Read more about the [guidelines](https://vueuse.org/guidelines). | ||
|
||
## 代码风格 | ||
## Code Style | ||
|
||
只要安装了开发依赖项,就不必担心代码风格问题。提交时 Git 钩子会自动为您格式化和修复它们。 | ||
Don't worry about the code style as long as you install the dev dependencies. Git hooks will format and fix them for you on committing. | ||
|
||
## 感谢 | ||
## Thanks | ||
|
||
再次感谢您对该项目的兴趣!您真棒! | ||
Thank you again for being interested in this project! You are awesome! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@vueuse/monorepo", | ||
"type": "module", | ||
"version": "10.10.1", | ||
"version": "11.0.0-beta.1", | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"description": "Collection of essential Vue Composition Utilities", | ||
|
@@ -37,7 +37,7 @@ | |
"prepare": "simple-git-hooks" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^2.21.0", | ||
"@antfu/eslint-config": "^2.21.1", | ||
"@antfu/ni": "^0.21.12", | ||
"@iconify/json": "^2.2.218", | ||
"@rollup/plugin-json": "^6.1.0", | ||
|
@@ -78,7 +78,7 @@ | |
"gray-matter": "^4.0.3", | ||
"js-yaml": "^4.1.0", | ||
"jsdom": "^24.1.0", | ||
"lint-staged": "^15.2.5", | ||
"lint-staged": "^15.2.7", | ||
"markdown-table": "^3.0.3", | ||
"md5": "^2.3.0", | ||
"msw": "^2.3.0", | ||
|
@@ -100,7 +100,7 @@ | |
"simple-git-hooks": "^2.11.1", | ||
"taze": "^0.13.8", | ||
"typescript": "^5.4.5", | ||
"unocss": "^0.60.4", | ||
"unocss": "^0.61.0", | ||
"unplugin-icons": "^0.19.0", | ||
"unplugin-vue-components": "^0.27.0", | ||
"vite": "^5.2.13", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.