Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto dev
  • Loading branch information
q378532364 committed Jun 20, 2021
2 parents 319afac + 371d7dd commit 0de9eb6
Show file tree
Hide file tree
Showing 41 changed files with 177 additions and 418 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# github actions 中文文档 https://docs.github.com/cn/actions/getting-started-with-github-actions

name: deploy to tecent server - example page
name: deploy to baidu server - example page

on:
push:
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
mkdir -p ~/.ssh/
echo "${{secrets.WFP_ID_RSA}}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan ${{secrets.TECENT_SERVER}} >> ~/.ssh/known_hosts
ssh-keyscan ${{secrets.BAIDU_SERVER}} >> ~/.ssh/known_hosts
- name: scp test files # 拷贝测试页面,到远程服务器
run: |
## 获取当前分支名称,并创建一个同名的文件夹
Expand All @@ -51,7 +51,7 @@ jobs:
## 将该文件夹,及其所有文件,上传到服务器
echo current branch name is: $currentBranchName
ssh work@${{secrets.TECENT_SERVER}} "rm -rf /home/work/wangEditor-team/example-pages/$currentBranchName"
scp -r ./$currentBranchName work@${{secrets.TECENT_SERVER}}:/home/work/wangEditor-team/example-pages/$currentBranchName
ssh work@${{secrets.BAIDU_SERVER}} "rm -rf /home/work/wangEditor-team/v4-examples/$currentBranchName"
scp -r ./$currentBranchName work@${{secrets.BAIDU_SERVER}}:/home/work/wangEditor-team/v4-examples/$currentBranchName
- name: delete ssh key # 删除 ssh key
run: rm -rf ~/.ssh/id_rsa
6 changes: 3 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
mkdir -p ~/.ssh/
echo "${{secrets.WFP_ID_RSA}}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan ${{secrets.TECENT_SERVER}} >> ~/.ssh/known_hosts
ssh-keyscan ${{secrets.BAIDU_SERVER}} >> ~/.ssh/known_hosts
- name: rebuild we-demo and scp
run: |
## 下载 demo ,安装最新的插件,并重新打包
Expand All @@ -52,5 +52,5 @@ jobs:
## 将 dist 文件夹,重命名为 publish-npm-test ,并上传到服务器
mv dist publish-npm-test
ssh work@${{secrets.TECENT_SERVER}} "rm -rf /home/work/wangEditor-team/example-pages/publish-npm-test"
scp -r ./publish-npm-test work@${{secrets.TECENT_SERVER}}:/home/work/wangEditor-team/example-pages/publish-npm-test
ssh work@${{secrets.BAIDU_SERVER}} "rm -rf /home/work/wangEditor-team/v4-examples/publish-npm-test"
scp -r ./publish-npm-test work@${{secrets.BAIDU_SERVER}}:/home/work/wangEditor-team/v4-examples/publish-npm-test
34 changes: 0 additions & 34 deletions .github/workflows/server.yml

This file was deleted.

27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## [4.7.4](https://github.com/wangeditor-team/wangEditor/compare/v4.7.3...v4.7.4) (2021-06-17)


### Bug Fixes

* 修复行内code回车后导致样式及插入问题 ([cebf20a](https://github.com/wangeditor-team/wangEditor/commit/cebf20a79df1f979376f27eee128ae3c95a4a4eb))
* 修复a标签包裹img的 取消链接 问题 ([23eb557](https://github.com/wangeditor-team/wangEditor/commit/23eb557a5dabcdc6201753695a8590dec539fe9e))

## [4.7.3](https://github.com/wangeditor-team/wangEditor/compare/v4.7.2...v4.7.3) (2021-06-10)


### Bug Fixes

* 特殊情况下无法通过backspace删除图片 ([0648a93](https://github.com/wangeditor-team/wangEditor/commit/0648a9340a7c156dbc16b83e955f684854cb8c76))
* 优化粘贴时过滤meta的行为 ([313665c](https://github.com/wangeditor-team/wangEditor/commit/313665c5a656314477f8973e0cdff9c4ba125aeb))

## [4.7.2](https://github.com/wangeditor-team/wangEditor/compare/v4.7.1...v4.7.2) (2021-06-03)


### Bug Fixes

* 禁修复多行插入链接造成页面卡死,止多行插入链链接 ([110b37a](https://github.com/wangeditor-team/wangEditor/commit/110b37a8bb3b6bd5d87e1d831c8dab6f52e2b6df))
* 设置字体大小和颜色时,光标跳到行首 ([8fc7e04](https://github.com/wangeditor-team/wangEditor/commit/8fc7e04272ab222416e2cbfbaa57eb2565a8f87a))
* 修复给标题加超链接的问题 ([0d7a05e](https://github.com/wangeditor-team/wangEditor/commit/0d7a05e8c922bc48dc655bee90b8192a816057f9))
* 修复删除全部内容后EMPTY_P前有个空格 ([1811f8c](https://github.com/wangeditor-team/wangEditor/commit/1811f8c417f8466df5d458a6c215fad1e4b2b7c3))
* ts 构建错误 ([4603677](https://github.com/wangeditor-team/wangEditor/commit/46036774c73f909dae99c950b0ffcc67f7414b9f))

## [4.7.1](https://github.com/wangeditor-team/wangEditor/compare/v4.7.0...v4.7.1) (2021-05-20)


Expand Down
3 changes: 1 addition & 2 deletions docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ npm run start

- `master` 主干分支,当前正在运行的代码。**不可**直接往 `master` 提交代码。
- `dev` 开发分支,当前正在开发、但尚未发布的代码。**不可**直接往 `dev` 提交代码,但可以合并其他分支。
- `server` 开发分支,用于部署 server 端功能,**不可**直接往 `server` 提交代码,但可以合并其他分支。
- `feature-xxx` 开发新功能
- `fix-xxx` bug 修复
- `hotfix-xxx` 高优紧急 bug 修复,修复完需紧急上线
Expand Down Expand Up @@ -106,7 +105,7 @@ npm run start

当提交完自己的分支之后,github actions 会自动触发部署到腾讯云测试机。
查看 [actions 列表](https://github.com/wangeditor-team/wangEditor/actions),待所有任务运行完成之后。
打开浏览器访问 `http://106.55.153.217:8881/<你的分支名>/examples/index.html` ,这就是你本次分支代码的远程测试环境。
打开浏览器访问 `http://106.12.198.214:8881/<你的分支名>/examples/index.html` ,这就是你本次分支代码的远程测试环境。

要保证这一步成功,再进行下一步。

Expand Down
2 changes: 1 addition & 1 deletion docs/pub.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

## 回归测试

发布完成之后,访问 http://106.55.153.217:8881/publish-npm-test/ 即可得到最新版本的 demo 。
发布完成之后,访问 http://106.12.198.214:8881/publish-npm-test/ 即可得到最新版本的 demo 。

## 修改任务状态

Expand Down
2 changes: 1 addition & 1 deletion examples/i18next.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script>
const E = window.wangEditor
const editor = new E('#div1')
editor.config.uploadImgServer = '/api/upload-img'
editor.config.uploadImgServer = 'http://106.12.198.214:3000/api/upload-img'
editor.config.lang = 'en'
editor.i18next = window.i18next
// editor.config.languages['en'] = {
Expand Down
2 changes: 1 addition & 1 deletion examples/jq-create-dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>jq create dom</h1>
editor = new E(editorToolbar, editorArea);
editor.config.placeholder = '这里是我加的placeholder';
editor.config.zIndex = 10;
editor.config.uploadVideoServer = '/api/upload-video';
editor.config.uploadVideoServer = 'http://106.12.198.214:3000/api/upload-video';
editor.config.uploadImgServer = '/upload/document/images';
editor.config.uploadImgParams = {
identify: 'online_image'
Expand Down
5 changes: 4 additions & 1 deletion examples/link.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<p>
wangEditor demo
</p>
<button onclick="insertLinkImg()">插入带有超链接的图片</button>
<div id="div1">
<p><br/></p>
<p><br/></p>
Expand Down Expand Up @@ -41,7 +42,9 @@
<script>
const E = window.wangEditor
const editor = new E('#div1')

function insertLinkImg () {
editor.cmd.do( 'insertHTML', '<a href="https://www.baidu.com/"><img src="https://user-images.githubusercontent.com/37204782/119621908-3ebe3c00-be39-11eb-924d-82308460d461.png" style="max-width:100%;"/></a>' )
        }
editor.create()
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/txt-html-function.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// 改为使用var声明,才能在window对象上获取到编辑器实例,方便e2e测试
var E = window.wangEditor
var editor = new E('#div1')
editor.config.uploadImgServer = '/api/upload-img'
editor.config.uploadImgServer = 'http://106.12.198.214:3000/api/upload-img'

editor.config.onchange = function (newHtml) {
console.log('onchange', newHtml)
Expand Down
2 changes: 1 addition & 1 deletion examples/upload-image-alt.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const E = window.wangEditor
const editor = new E('#div1')

editor.config.uploadImgServer = '/api/upload-img'
editor.config.uploadImgServer = 'http://106.12.198.214:3000/api/upload-img'
editor.config.showLinkImgAlt = true
editor.config.showLinkImgHref = true
// editor.config.showLinkImg = false
Expand Down
14 changes: 7 additions & 7 deletions examples/upload-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// 忽略粘贴内容中的图片
editor.config.pasteIgnoreImg = true

// editor.config.uploadImgServer = '/api/upload-img'
editor.config.uploadImgServer = 'http://106.12.198.214:3000/api/upload-img'
// editor.config.showLinkImgAlt = true
// editor.config.showLinkImgHref = true
// editor.config.showLinkImg = false
Expand Down Expand Up @@ -73,12 +73,12 @@
// insertImgFn(result.data[0].url) // 只插入一个图片,多了忽略
// }
// }
editor.config.customUploadImg = function (resultFiles, insertImgFn) {
console.log('customUploadImg', resultFiles)
Array.from(resultFiles).forEach(file => {
insertImgFn(URL.createObjectURL(file))
})
}
// editor.config.customUploadImg = function (resultFiles, insertImgFn) {
// console.log('customUploadImg', resultFiles)
// Array.from(resultFiles).forEach(file => {
// insertImgFn(URL.createObjectURL(file))
// })
// }

editor.create()
</script>
Expand Down
2 changes: 1 addition & 1 deletion examples/upload-img-accept-empty.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const E = window.wangEditor
const editor = new E('#div1')
editor.config.uploadImgAccept = []
editor.config.uploadImgServer = '/api/upload-img'
editor.config.uploadImgServer = 'http://106.12.198.214:3000/api/upload-img'
// editor.config.showLinkImgAlt = true
// editor.config.showLinkImgHref = true
editor.config.showLinkImg = false
Expand Down
2 changes: 1 addition & 1 deletion examples/upload-video.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
var editor = new E('#div1')

// 上传地址
editor.config.uploadVideoServer = '/api/upload-video';
editor.config.uploadVideoServer = 'http://106.12.198.214:3000/api/upload-video';

// 自定义插入视频
// editor.config.customInsertVideo = (url) => {
Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wangeditor",
"version": "4.7.1",
"version": "4.7.4",
"description": "wangEditor - 轻量级 web 富文本编辑器,配置方便,使用简单,开源免费",
"homepage": "http://www.wangeditor.com/",
"keywords": [
Expand All @@ -14,7 +14,6 @@
"scripts": {
"dev": "cross-env NODE_ENV=development webpack --watch --config build/webpack.dev.js",
"example": "cross-env PORT=8881 nodemon server/www.js",
"server": "cross-env NODE_ENV=prd_dev pm2 start server/pm2.conf.json",
"build": "cross-env NODE_ENV=production webpack --config build/webpack.prod.js",
"build:dev": "cross-env NODE_ENV=development webpack --config build/webpack.dev.js",
"build:un-min": "cross-env NODE_ENV=production webpack --config build/webpack.un-min.prod.js",
Expand Down Expand Up @@ -81,11 +80,8 @@
"jest": "^26.0.1",
"jquery": "^3.5.1",
"koa": "^2.13.0",
"koa-bodyparser": "^4.3.0",
"koa-json": "^2.0.2",
"koa-logger": "^3.2.1",
"koa-onerror": "^4.1.0",
"koa-router": "^9.0.1",
"koa-static": "^5.0.0",
"less": "^3.11.1",
"less-loader": "^6.0.0",
Expand Down
22 changes: 1 addition & 21 deletions server/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
# 服务端

提供文件上传接口,用于测试。

## 开发环境

`npm start` 时会启动 server ,并且依赖于 koa2-static 来启动 examples 页面的静态服务。

## 测试环境

### 发布到测试机

代码 push 到 `server` 分支,即可自动发布到测试机。

具体可参考 `.github/workflows/server.yml`

### 测试机配置

nginx 需要配置,做反向代理,参考测试机 `/etc/nginx/nginx.conf`
- 代理接口 `/api/`
- 代理图片 url `/server/upload-files/`

定时删除文件,配置 crontab 定时执行 `server/rm.sh`
`npm start` 时会启动 server ,依赖于 koa2-static 来启动 examples 页面的静态服务。
97 changes: 0 additions & 97 deletions server/controller/save-file.js

This file was deleted.

Loading

0 comments on commit 0de9eb6

Please sign in to comment.