Skip to content

Commit

Permalink
refactor: separate codes from extension
Browse files Browse the repository at this point in the history
  • Loading branch information
JOU-amjs committed Nov 30, 2022
1 parent d3b8830 commit a06349a
Show file tree
Hide file tree
Showing 60 changed files with 2,939 additions and 6,019 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/main-mock.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
name: build

# 触发条件:在 push或合并请求 到 master 或 realease开头的分支后
# 触发条件:在 push或合并请求 到 main
on:
push:
branches:
- main
paths:
- packages/hooks/**

pull_request:
branches:
- main
paths:
- packages/hooks/**

# 任务
jobs:
Expand All @@ -28,16 +24,16 @@ jobs:
with:
node-version: 16.14.x
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
cache: 'npm'

# 执行测试和打包操作
- run: yarn install --immutable
- run: npm ci

# 测试
- run: yarn workspace @alova/hooks run test
- run: npm run test:coverage

# 打包发布
- run: yarn workspace @alova/hooks run build
- run: cd ./packages/hooks && npm publish
- run: npm run build --if-present
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ALOVA_PUBLISH_TOKEN }}
File renamed without changes.
27 changes: 8 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
# alova extensions
# @alova/scene

[alova](https://github.com/alovajs/alova) is a request scenario management library. Its mission is to make the application manage CS data interaction more intelligently, and propose better request management solutions for different request scenarios , so it also provides some request schemes in specific scenarios, which can allow developers to implement functions with higher performance and better experience more elegantly.
scenario hooks with alova.js

## alova example
[Here are some examples that will demonstrate the power of alova](https://alova.js.org/category/%E7%A4%BA%E4%BE%8B)
## UsePagination

## Packages
This repository contains the following packages

| Project | Description |
| ---- | ---- |
| [@alova/mock](https://github.com/alovajs/extensions/tree/main/packages/mock) | a mock request adapter of alova.js |
| [@alova/hooks](https://github.com/alovajs/extensions/tree/main/packages/hooks) | extended hooks with alova.js |

## What's next?

As mentioned above, alova's mission is to propose better request management solutions for different request scenarios. Solutions for specific scenarios will be implemented in **@alova/hooks**. If you have a desired request scenario, welcome Discuss via [issue](https://github.com/alovajs/extensions/issues), and you are welcome to contribute your ingenuity via [pull requests](https://github.com/alovajs/extensions/pulls) Come and make alova better together.

## LICENSE

[MIT](https://en.wikipedia.org/wiki/MIT_License)
| Framework | available | tested |
| --------- | --------- | ------ |
| vue |||
| react |||
| svelte |||
24 changes: 24 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# alova 场景化方案

[alova](https://github.com/alovajs/alova) 是一个请求场景管理库,它的使命,就是让应用更聪明地管理 CS 数据交互,针对不同的请求场景提出更好的请求管理方案,因此也提供了一些特定场景下的请求方案,可以让开发者更优雅地实现更高性能和体验更好的功能。

## alova 示例

[这里有些示例将会展示 alova 的强大力量](https://alova.js.org/category/%E7%A4%BA%E4%BE%8B)

## Packages

本仓库包含以下 packages

| Project | Description |
| ------------------------------------------------------------------------------ | ---------------------------------- |
| [@alova/mock](https://github.com/alovajs/extensions/tree/main/packages/mock) | a mock request adapter of alova.js |
| [@alova/hooks](https://github.com/alovajs/extensions/tree/main/packages/hooks) | extended hooks with alova.js |

## 下一步做什么?

就像上面所说,alova 的使命是针对不同的请求场景提出更好的请求管理方案,特定场景的方案将会在 **@alova/hooks** 中实现,如果你有期待的请求场景,欢迎通过 [issue](https://github.com/alovajs/extensions/issues) 来讨论,也欢迎贡献你的聪明才智,通过 [pull requests](https://github.com/alovajs/extensions/pulls) 来一起让 alova 变得更好。

## LICENSE

[MIT](https://en.wikipedia.org/wiki/MIT_License)
22 changes: 0 additions & 22 deletions README_zh-CN.md

This file was deleted.

File renamed without changes.
29 changes: 0 additions & 29 deletions config/extensions.js

This file was deleted.

21 changes: 21 additions & 0 deletions config/libs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
// @alova/scene
vuehooks: {
external: ['alova', 'vue'],
packageName: 'AlovaSceneVue',
input: 'src/index-vue.js',
output: suffix => `dist/alova-scene-vue.${suffix}.js`
},
reacthooks: {
external: ['alova', 'react'],
packageName: 'AlovaSceneHook',
input: 'src/index-react.js',
output: suffix => `dist/alova-scene-react.${suffix}.js`
},
sveltehooks: {
external: ['alova', 'svelte', 'svelte/store'],
packageName: 'AlovaSceneHook',
input: 'src/index-svelte.js',
output: suffix => `dist/alova-scene-svelte.${suffix}.js`
}
};
4 changes: 2 additions & 2 deletions config/rollup.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* @Date: 2020-04-09 11:06:01
* @LastEditors: JOU(wx: huzhen555)
* @LastEditTime: 2022-11-06 15:56:36
* @LastEditTime: 2022-11-30 20:46:39
*/
var typescript = require('rollup-plugin-typescript2');
var { readFileSync } = require('fs');
var compilePaths = require('./extensions');
var compilePaths = require('./libs');

const getCompiler = (
opt = {
Expand Down
Loading

0 comments on commit a06349a

Please sign in to comment.