Skip to content

Commit

Permalink
feat: develop the vue options adapter and helper function (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Sep 21, 2023
1 parent 28f8335 commit da30b19
Show file tree
Hide file tree
Showing 38 changed files with 10,084 additions and 6,675 deletions.
4 changes: 2 additions & 2 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
service_name: travis-pro
repo_token: Sbfm02BRH1LOIrI5n2qzElUYNdXd1vrge
service_name: github-action
repo_token: SqPAbL75NNAtRb0TMLUmt14qRDbbV6vsT
8 changes: 5 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
env: {
browser: true,
es2021: true
es2021: true,
node: true
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
overrides: [],
Expand All @@ -19,7 +20,8 @@ module.exports = {
'@typescript-eslint/no-unused-vars': ['error', { destructuredArrayIgnorePattern: '^_' }],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'no-empty': 'off',
'@typescript-eslint/triple-slash-reference': 'off'
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-this-alias': 'off'
}
};
19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/BUG_REPORT_en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: 🐛Report a bug in English
description: Use English to report a bug when using alova with vue-options
labels: ['bug:need-confirm']
body:
- type: markdown
attributes:
value: |
👋🏻👋🏻👋🏻Hi, thank you very much for supporting alova, that is really IMPORTANT!
**we hope to make alova a common project for everyone, and encourage every developer to become a contributor to the alova community with an open and inclusive attitude. If you want, you can try to participate by submitting a PR Contributing, it will let developers all over the world to use your code, please [see CONTRIBUTING](https://github.com/alovajs/alova/blob/main/CONTRIBUTING.md) for more details!**
⚠️⚠️⚠️Please read the following before submitting a bug report:
- Before submitting bugs, you can find solutions through [official documents](https://alova.js.org);
- Join [Discord](https://discord.gg/S47QGJgkVb) or [QQ Channel](https://pd.qq.com/s/1cdjx0nnw) for online communication.
- Make sure you searched for [historical issues](https://github.com/alovajs/alova/issues) and found no similar issues.
- If you have a question or doubt, you can move to the [Discussions](https://github.com/alovajs/alova/discussions) to post, which will help the author to better manage the alova community.
- type: textarea
id: description
attributes:
label: Please describe the bug in detail
description: Please describe in as much detail as possible under what circumstances, what problems you encountered, and what solutions you have tried, including key code snippets if possible.
validations:
required: true

- type: input
id: reproduce
attributes:
label: Reproduce link
description: This helps solvers to solve problem faster. You can choose one of the [official examples](https://alova.js.org/category/examples/) as a template to reproduce the problem, or you can do it yourself Links to [codesandbox](https://codesandbox.io), [stackBlitz](https://stackblitz.com) or GitHub repositories. Please do not fill in a invalid link.

- type: textarea
id: reproduce-steps
attributes:
label: steps to reproduce
description: Please provide the simplest operation steps so that we can quickly reproduce the problem.
placeholder: |
for example:
1. Click the button
2. Request not sent
validations:
required: true

- type: textarea
id: expect
attributes:
label: expected performance
description: Please use clear and concise language to describe what effect you want to achieve

- type: input
id: version
attributes:
label: alova version
description: Please fill in the version number in node_modules/alova/package.json
placeholder: e.g. 2.9.0
validations:
required: true

- type: input
id: version
attributes:
label: \@alova/vue-options version
description: Please fill in the version number in node_modules/@alova/vue-options/package.json
placeholder: e.g. 1.0.0
validations:
required: true

- type: input
id: browsers
attributes:
label: device/browser/browser version
description: On which devices/browsers and which browser versions can this issue be reproduced?

- type: textarea
id: remark
attributes:
label: additional content
description: If there are additional content or notes, please fill them in here.
78 changes: 78 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/BUG_REPORT_zh-CN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: 🐛用中文反馈bug
description: 使用中文反馈一个关于vue options+alova时遇到的bug
labels: ['bug:need-confirm']
body:
- type: markdown
attributes:
value: |
👋🏻👋🏻👋🏻Hi你好,非常感谢你对alova的支持,它真的很重要!
**我们期望将alova打造成大家共同的项目,以开放包容的态度鼓励每位开发者成为alova社区的贡献者,如果你愿意,可尝试通过提交PR参与贡献,让你的代码为全世界的开发者提供价值,具体贡献请[参阅贡献指南](https://github.com/alovajs/alova/blob/main/CONTRIBUTING.zh-CN.md)!**
⚠️⚠️⚠️在提交 bug 报告前,请阅读以下内容:
- 提交bug前可先通过 [官方文档](https://alova.js.org) 寻找解决办法;
- 加入[Discord](https://discord.gg/S47QGJgkVb)或[QQ频道](https://pd.qq.com/s/1cdjx0nnw)在线交流。
- 确认你搜索过 [历史 issue](https://github.com/alovajs/alova/issues),并且没有发现同样的问题。
- 如果是一个问题或疑惑,可移步到 [Discussions](https://github.com/alovajs/alova/discussions) 发帖,这有助于作者更好地打理alova社区。
- type: textarea
id: description
attributes:
label: 请详细描述bug
description: 请尽量详细地描述你在什么情况下,遇到了什么问题,以及你尝试过什么解决方法,可提供关键代码片段。
validations:
required: true

- type: input
id: reproduce
attributes:
label: 复现链接
description: 这有助于解决者更快地解决问题,你可以在 [官方示例集](https://alova.js.org/category/examples/) 中选择一个作为模板复现问题,也可以自行在 [codesandbox](https://codesandbox.io)、[stackBlitz](https://stackblitz.com) 或 GitHub 仓库链接。请不要填写无效的链接。

- type: textarea
id: reproduce-steps
attributes:
label: 复现步骤
description: 请提供一个最简单的操作步骤,方便我们快速复现问题。
placeholder: |
比如:
1. 点击按钮
2. 请求未发出
validations:
required: true

- type: textarea
id: expect
attributes:
label: 期望的表现
description: 请使用清晰简洁地语言描述一下期望达成什么效果

- type: input
id: version
attributes:
label: alova 版本
description: 请填写 node_modules/alova/package.json 里的版本号
placeholder: 比如 2.9.0
validations:
required: true

- type: input
id: version
attributes:
label: \@alova/vue-options 版本
description: 请填写 node_modules/@alova/vue-options/package.json 里的版本号
placeholder: 比如 1.0.0
validations:
required: true

- type: input
id: browsers
attributes:
label: 设备/浏览器/浏览器版本
description: 在哪些设备/浏览器以及哪个浏览器版本上能重现这个问题?

- type: textarea
id: remark
attributes:
label: 额外的说明
description: 如果还有额外的说明或备注,请在此填写。
40 changes: 40 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/FEATURE_REQUEST_en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 🚀 new feature proposal
description: Your new feature or optimization proposal for @alova/vue-options
labels: ['feature-request']
body:
- type: markdown
attributes:
value: |
👋🏻👋🏻👋🏻Hi, thank you so much for supporting alova, it's really IMPORTANT!
**We expect to build alova into a common project for everyone, and encourage every developer to become a contributor to the alova community with an open and inclusive attitude. If you want, you can try to contribute by submitting a PR, it will let developers all over the world to use your code, please [see CONTRIBUTING](https://github.com/alovajs/alova/blob/main/CONTRIBUTING.md) for more details!**
⚠️⚠️⚠️Please read the following before submitting a new feature proposal:
- Confirm that it cannot be implemented through the existing APIs, you can search in the [official document](https://alova.js.org) first, generally speaking, we only add new features when considering problems that cannot be easily solved by the existing APIs, not just an alternative way of doing what can already be done
- Confirm that it is in line with alova's goal, please [see the goal of alova](https://github.com/alovajs/alova/blob/main/CONTRIBUTING.md#goal-of-alova)
- Make sure no duplicates are found in [Historical issues](https://github.com/alovajs/alova/issues) or [Discussion](https://github.com/alovajs/alova/discussions).
- type: textarea
id: description
attributes:
label: What problem does the new feature need to solve?
description: Before committing, please make sure to read [alova's development direction](../../CONTRIBUTING.md#goal-of-alova).
validations:
required: true

- type: textarea
id: api
attributes:
label: How should the new features you expect looks like?
description: You can provide a code design snippet of a new feature to express how the new feature you expect looks like in the new version.

- type: dropdown
id: importance
attributes:
label: How important is it to you?
options:
- better to have
- can make it easier to develop
- I'd give up without it
validations:
required: true
40 changes: 40 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/FEATURE_REQUEST_zh-CN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 🚀新特性提案
description: 你对@alova/vue-options的新特性或优化提案
labels: ['feature-request']
body:
- type: markdown
attributes:
value: |
👋🏻👋🏻👋🏻Hi你好,非常感谢你对alova的支持,它真的很重要!
**我们期望将alova打造成大家共同的项目,以开放包容的态度鼓励每位开发者成为alova社区的贡献者,如果你愿意,可尝试通过提交PR参与贡献,让你的代码为全世界的开发者提供价值,具体贡献请[参阅贡献指南](https://github.com/alovajs/alova/blob/main/CONTRIBUTING.zh-CN.md)!**
⚠️⚠️⚠️在提交新特性提案前,请阅读以下内容:
- 确认目前无法通过 API 实现,可先在[官方文档](https://alova.js.org)中搜索,一般来说,我们只考虑现有 API 无法轻松解决的问题的情况下添加新特性,而不仅仅是做已经可以完成的事情的替代方法
- 确认符合alova的发展方向,请[参阅alova的发展方向](https://github.com/alovajs/alova/blob/main/CONTRIBUTING.zh-CN.md#alova-%E7%9A%84%E5%8F%91%E5%B1%95%E6%96%B9%E5%90%91)
- 确认在 [历史 issue](https://github.com/alovajs/alova/issues)或[Discussion](https://github.com/alovajs/alova/discussions)没有发现重复内容。
- type: textarea
id: description
attributes:
label: 需要新特性解决什么问题?
description: 确定提交前,请确保已阅读[alova的发展方向](../../CONTRIBUTING.zh-CN.md#alova的发展方向)。
validations:
required: true

- type: textarea
id: api
attributes:
label: 你期望的新特性应该如何呈现?
description: 可提供一段新特性的代码设计片段,以表达你期望的新特性如何呈现在新版本中。

- type: dropdown
id: importance
attributes:
label: 它对你有多重要?
options:
- 有就更好了
- 可以让我更便于开发
- 没有它我就要弃坑了
validations:
required: true
5 changes: 5 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions & Discussions
url: https://github.com/alovajs/alova/discussions
about: Use GitHub discussions for your questions and discussions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
- name: Lint check
run: npm run lint

# 这条命令包含了测试
# 这条命令包含了测试,同时测试vue2和vue3
- name: Unit tests
run: npm run test
run: npm run test && npm run test:vue3

release:
runs-on: ubuntu-latest
Expand All @@ -56,10 +56,10 @@ jobs:
- name: Install deps
run: npm ci

- name: Test SSR
run: npm run test:node
- name: Test vue3
run: npm run test:vue3

# 这条命令包含了测试和上传覆盖率
# 这条命令测试vue2,并且上传覆盖率
- name: Coverage
run: npm run coveralls

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vue optional statesHook+wrapper function
# vue options statesHook+wrapper function

This library provides an alova's statesHook and several wrapper functions to be compatible with the use of alova's optional writing method in vue. With it, you can use all the functions of alova in vue2.
This library provides an alova's statesHook and several wrapper functions to be compatible with the use of alova's options writing method in vue. With it, you can use all the functions of alova in vue2.

[![npm](https://img.shields.io/npm/v/@alova/mock)](https://www.npmjs.com/package/@alova/mock)
[![build](https://github.com/alovajs/mock/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/alovajs/mock/actions/workflows/main.yml)
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vue optional statesHook+包装函数
# vue options statesHook+包装函数

本库提供一个 alova 的 statesHook 和几个包装函数,用于兼容 alova 在 vue 的 optional 写法的使用,有了它,你可以在 vue2 中使用 alova 的所有功能。
本库提供一个 alova 的 statesHook 和几个包装函数,用于兼容 alova 在 vue 的 options 写法的使用,有了它,你可以在 vue2 中使用 alova 的所有功能。

[![npm](https://img.shields.io/npm/v/@alova/mock)](https://www.npmjs.com/package/@alova/mock)
[![build](https://github.com/alovajs/mock/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/alovajs/mock/actions/workflows/main.yml)
Expand Down
4 changes: 2 additions & 2 deletions config/rollup.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ exports.banner = `/**

const compilePath = (exports.compilePath = {
external: ['alova'],
packageName: 'AlovaMock',
packageName: 'AlovaVueOptions',
input: 'src/index.ts',
output: suffix => `dist/alova-mock.${suffix}.js`
output: suffix => `dist/alova-vue-options.${suffix}.js`
});
exports.external = compilePath.external;
Loading

0 comments on commit da30b19

Please sign in to comment.