Skip to content

Commit 8754225

Browse files
committed
add #gulp+stockService
1 parent b51fc03 commit 8754225

15 files changed

+1772
-188
lines changed

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# 股票机器人
22

3-
## 前端(移动端&小程序)+ 后端(node.js
3+
## 前端(移动端&小程序)+ 后端(nodejs
44

5-
**前端: Vue + Mpvue**(支持移动端与小程序)
5+
**前端: Vue + Mpvue** *(支持移动端与小程序)*
66

7-
**后端: koa**(使用Koa2开发服务端)
7+
**后端: koa** *(使用Koa2开发服务端)*
88

99
> [Vue](https://cn.vuejs.org/) 是一套用于构建用户界面的渐进式框架。`Vue` 的核心库只关注视图层,不仅易于上手,还便于与第三方库或既有项目整合。另一方面,当与现代化的工具链以及各种支持类库结合使用时,`Vue` 也完全能够为复杂的单页应用提供驱动。
1010
@@ -28,14 +28,15 @@ npm start
2828
# build H5 pages
2929
npm run startH5
3030

31-
# build for production with minification for mini program
31+
# build pages for production with minification for mini program
3232
npm run build
3333

34-
# build for production with minification for H5 pages
34+
# build pages for production with minification for H5 program
3535
npm run buildH5
3636

37-
# build for production and view the bundle analyzer report
38-
npm run build --report
37+
# build node resource for server
38+
gulp build
39+
3940
```
4041

4142
## 重要!!!
@@ -47,27 +48,33 @@ npm run build --report
4748

4849
* 使用 `Vue.js` 构建移动端应用
4950
* 使用 `mpvue` 复用代码构建小程序应用
51+
* 使用 `Koa` 构建服务端
5052
* 使用 [Vuex](https://github.com/vuejs/vuex) 数据管理方案,方便构建复杂应用
5153
* 使用 [webpack](https://github.com/webpack/webpack) 构建机制:自定义构建策略、开发阶段 hotReload
5254
* 支持使用 [npm](https://github.com/npm/npm) 外部依赖
53-
* 使用 `Koa` 构建服务端
5455

5556
## 前后端分离
5657

5758
```bash
5859
# 启动前端--小程序
5960
npm run dev
61+
6062
# 启动前端--H5
6163
npm run devH5
64+
6265
# 启动后台
6366
npm run server
6467
```
65-
*(服务端代码仅位于项目server文件夹下)*
68+
*(服务端代码仅位于项目server文件夹下,可根据自身需求进行拆分*
6669

6770
## 插件
6871

72+
- [gulp](https://www.gulpjs.com.cn/)
73+
is a toolkit for automating painful or time-consuming tasks in your development workflow, so you can stop messing around and build something.
74+
6975
- [Echarts](https://github.com/apache/incubator-echarts)
7076
一个使用 JavaScript 实现的开源可视化库,可以流畅的运行在 PC 和移动设备上,兼容当前绝大部分浏览器(IE8/9/10/11,Chrome,Firefox,Safari等),底层依赖轻量级的矢量图形库 ZRender,提供直观,交互丰富,可高度个性化定制的数据可视化图表。
77+
7178
- [Day.js](https://github.com/iamkun/dayjs)
7279
一个轻量的处理时间和日期的 JavaScript 库,和 Moment.js 的 API 设计保持完全一样. 如果您曾经用过 Moment.js, 那么您已经知道如何使用 Day.js
7380

@@ -79,6 +86,7 @@ npm run server
7986

8087
## Contribution
8188

89+
![master_head](https://avatars2.githubusercontent.com/u/31007223?s=400&u=2c4493300c0ff4a4362a737945e9cd63c015d7ae&v=4)
8290
[RuShi](https://github.com/zz570557024)
8391

8492
## License

gulpfile.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const gulp = require('gulp');
2+
const zip = require('gulp-zip');
3+
const clean = require('gulp-clean');
4+
const moment = require('dayjs');
5+
const rename = require('gulp-rename');
6+
const runSequence = require('run-sequence')
7+
var argv = require('yargs').argv;
8+
var env = argv.env || 'dev';
9+
10+
gulp.task('zip', () => {
11+
return gulp.src([
12+
'./server/**/*', './package.json'
13+
])
14+
.pipe(zip(moment().format("YYYY-MM-DD") + '-www.zip'))
15+
.pipe(gulp.dest("dist"));
16+
})
17+
18+
gulp.task('build:public', () => {
19+
return gulp.src(['./dist/**'])
20+
.pipe(gulp.dest('./server/public'));
21+
});
22+
23+
gulp.task('build:cleanMap', () => {
24+
gulp.src(['./dist/**'])
25+
.pipe(clean({
26+
force: true
27+
}))
28+
})
29+
30+
gulp.task('build:clean', () => {
31+
gulp.src(
32+
[
33+
'./.env', './server/public/**'
34+
], {
35+
read: false
36+
})
37+
.pipe(clean({
38+
force: true
39+
}));
40+
});
41+
42+
gulp.task('build', function () {
43+
runSequence(
44+
'zip'
45+
)
46+
});

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta http-equiv="X-UA-Compatible" content="ie=edge">
88
<meta name="viewport" content="initial-scale=1,user-scalable=no, width=device-width">
9-
<title>选股机器人</title>
9+
<title>股票机器人</title>
1010
<meta name="description" content="一个同时支持移动端与小程序的聊天机器人">
1111
</head>
1212

0 commit comments

Comments
 (0)