Skip to content

Commit 9909b91

Browse files
author
levy
committed
Merge branch 'dev'
2 parents fd4d623 + e96beea commit 9909b91

File tree

12 files changed

+1581
-338
lines changed

12 files changed

+1581
-338
lines changed

.github/badge.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
types:
22
feat: 'enhancement'
3-
fix: 'bug'
3+
fix:
4+
hack: 'hack'
5+
default: 'bug'
6+
hack: 'hack'
47
docs: 'documentation'
58
refactor: 'refactor'
9+
style: 'style'
610
test: 'test'
711
perf: 'performance'
812
chore:

.grenrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ module.exports = {
2525
'♻️ Tests:': ['test'],
2626
'🚀 Performance:': ['performance'],
2727
'⚓ Dependency upgrades:': ['dependencies'],
28-
'🏡 Chore:': ['chore']
28+
'🏡 Chore:': ['chore'],
29+
'💄 Style:': ['style'],
30+
'🎩 Hack': ['hack']
2931
}
3032
}

.stylelintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "stylelint-config-standard",
3+
"rules": {
4+
"no-empty-source": null
5+
}
6+
}

README-zh.md

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
# log-viewer
22

3-
[![Build Status](https://travis-ci.com/FEMessage/log-viewer.svg?branch=master)](https://travis-ci.com/FEMessage/log-viewer)
4-
[![NPM Download](https://img.shields.io/npm/dm/@femessage/log-viewer.svg)](https://www.npmjs.com/package/@femessage/log-viewer)
5-
[![NPM Version](https://img.shields.io/npm/v/@femessage/log-viewer.svg)](https://www.npmjs.com/package/@femessage/log-viewer)
6-
[![NPM License](https://img.shields.io/npm/l/@femessage/log-viewer.svg)](https://github.com/FEMessage/log-viewer/blob/master/LICENSE)
3+
[![Build Status](https://badgen.net/travis/FEMessage/log-viewer/master)](https://travis-ci.com/FEMessage/log-viewer)
4+
[![NPM Download](https://badgen.net/npm/dm/@femessage/log-viewer)](https://www.npmjs.com/package/@femessage/log-viewer)
5+
[![NPM Version](https://badgen.net/npm/v/@femessage/log-viewer)](https://www.npmjs.com/package/@femessage/log-viewer)
6+
[![NPM License](https://badgen.net/npm/license/@femessage/log-viewer)](https://github.com/FEMessage/log-viewer/blob/master/LICENSE)
77
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/FEMessage/log-viewer/pulls)
88
[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)
99

1010
日志查看组件,将终端日志内容展示在页面中
1111

12-
![1.gif](https://cdn.nlark.com/yuque/0/2019/gif/298847/1563414930214-34da6e0b-bdbe-4c59-b531-772afa146417.gif#align=left&display=inline&height=837&name=1.gif&originHeight=837&originWidth=1118&size=78547&status=done&width=1118)
12+
![new-log](https://user-images.githubusercontent.com/53422750/65296811-4cb5b700-db98-11e9-9b55-1a5c8633ae8f.gif)
1313

1414
[English](./README-en.md)
1515

1616
## Table of Contents
1717

18-
* [Features](#Features)
19-
* [Install](#Install)
20-
* [Usage](#Usage)
21-
* [Performance](#performance)
22-
* [Contributors](#Contributors)
23-
* [MIT](#MIT)
18+
- [Features](#features)
19+
- [Install](#install)
20+
- [Usage](#usage)
21+
- [Reference](#reference)
22+
- [Performance](#performance)
23+
- [内存占用](#内存占用)
24+
- [item-mode](#item-mode)
25+
- [vfor-mode](#vfor-mode)
26+
- [render 耗时](#render-耗时)
27+
- [item-mode](#item-mode-1)
28+
- [vfor-mode](#vfor-mode-1)
29+
- [Contributing](#contributing)
30+
- [Contributors](#contributors)
31+
- [License](#license)
2432

2533
## Features
2634

27-
* 对日志流中特殊字符进行了处理
28-
* 高性能,处理大量数据不卡顿
29-
* 可自定义 loading 样式
30-
* 可自动滚动到底部
35+
- 对日志流中特殊字符进行了处理
36+
- 高性能,处理大量数据不卡顿
37+
- 可自定义 loading 样式
38+
- 可自动滚动到底部
3139

3240
[⬆ Back to Top](#table-of-contents)
3341

@@ -42,20 +50,17 @@ yarn add @femessage/log-viewer
4250
## Usage
4351

4452
```html
45-
<log-viewer
46-
:log="log"
47-
:loading="isLoading"
48-
/>
53+
<log-viewer :log="log" :loading="isLoading" />
4954
```
5055

5156
[⬆ Back to Top](#table-of-contents)
5257

5358
## Reference
5459

55-
* [thanks to react-lazylog](https://github.com/mozilla-frontend-infra/react-lazylog)
56-
* [travis-ci logs](https://travis-ci.org/)
57-
* [http://jafrog.com/2013/11/23/colors-in-terminal.html](http://jafrog.com/2013/11/23/colors-in-terminal.html)
58-
* [https://en.wikipedia.org/wiki/ANSI_escape_code](https://en.wikipedia.org/wiki/ANSI_escape_code)
60+
- [thanks to react-lazylog](https://github.com/mozilla-frontend-infra/react-lazylog)
61+
- [travis-ci logs](https://travis-ci.org/)
62+
- [http://jafrog.com/2013/11/23/colors-in-terminal.html](http://jafrog.com/2013/11/23/colors-in-terminal.html)
63+
- [https://en.wikipedia.org/wiki/ANSI_escape_code](https://en.wikipedia.org/wiki/ANSI_escape_code)
5964

6065
[⬆ Back to Top](#table-of-contents)
6166

@@ -101,6 +106,19 @@ patch 时间: 23.81ms<br />
101106

102107
[⬆ Back to Top](#table-of-contents)
103108

109+
## Contributing
110+
111+
For those who are interested in contributing to this project, such as:
112+
113+
- report a bug
114+
- request new feature
115+
- fix a bug
116+
- implement a new feature
117+
118+
Please refer to our [contributing guide](https://github.com/FEMessage/.github/blob/master/CONTRIBUTING.md).
119+
120+
[⬆ Back to Top](#table-of-contents)
121+
104122
## Contributors
105123

106124
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

README.md

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
# log-viewer
22

3-
[![Build Status](https://travis-ci.com/FEMessage/log-viewer.svg?branch=master)](https://travis-ci.com/FEMessage/log-viewer)
4-
[![NPM Download](https://img.shields.io/npm/dm/@femessage/log-viewer.svg)](https://www.npmjs.com/package/@femessage/log-viewer)
5-
[![NPM Version](https://img.shields.io/npm/v/@femessage/log-viewer.svg)](https://www.npmjs.com/package/@femessage/log-viewer)
6-
[![NPM License](https://img.shields.io/npm/l/@femessage/log-viewer.svg)](https://github.com/FEMessage/log-viewer/blob/master/LICENSE)
3+
[![Build Status](https://badgen.net/travis/FEMessage/log-viewer/master)](https://travis-ci.com/FEMessage/log-viewer)
4+
[![NPM Download](https://badgen.net/npm/dm/@femessage/log-viewer)](https://www.npmjs.com/package/@femessage/log-viewer)
5+
[![NPM Version](https://badgen.net/npm/v/@femessage/log-viewer)](https://www.npmjs.com/package/@femessage/log-viewer)
6+
[![NPM License](https://badgen.net/npm/license/@femessage/log-viewer)](https://github.com/FEMessage/log-viewer/blob/master/LICENSE)
77
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/FEMessage/log-viewer/pulls)
88
[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)
99

1010
log-viewer is a vue component which can display terminal log in browser with high performance.
1111

12-
![1.gif](https://cdn.nlark.com/yuque/0/2019/gif/298847/1563414930214-34da6e0b-bdbe-4c59-b531-772afa146417.gif#align=left&display=inline&height=837&name=1.gif&originHeight=837&originWidth=1118&size=78547&status=done&width=1118)
12+
![new-log](https://user-images.githubusercontent.com/53422750/65296811-4cb5b700-db98-11e9-9b55-1a5c8633ae8f.gif)
1313

1414
[中文文档](./README-zh.md)
1515

1616
## Table of Contents
1717

18-
* [Features](#Features)
19-
* [Install](#Install)
20-
* [Usage](#Usage)
21-
* [Performance](#performance)
22-
* [Contributors](#Contributors)
23-
* [MIT](#MIT)
18+
- [Features](#features)
19+
- [Install](#install)
20+
- [Usage](#usage)
21+
- [Reference](#reference)
22+
- [Performance](#performance)
23+
- [Memory Usage](#memory-usage)
24+
- [item-mode](#item-mode)
25+
- [vfor-mode](#vfor-mode)
26+
- [Render timeline](#render-timeline)
27+
- [item-mode](#item-mode-1)
28+
- [vfor-mode](#vfor-mode-1)
29+
- [Contributing](#contributing)
30+
- [Contributors](#contributors)
31+
- [License](#license)
2432

2533
## Features
2634

27-
* Process some special characters in the log stream
28-
* High performance, and process large amounts of data without jamming
29-
* Customize loading status
30-
* Auto scroll to the bottom
35+
- Process some special characters in the log stream
36+
- High performance, and process large amounts of data without jamming
37+
- Customize loading status
38+
- Auto scroll to the bottom
3139

3240
[⬆ Back to Top](#table-of-contents)
3341

@@ -42,20 +50,17 @@ yarn add @femessage/log-viewer
4250
## Usage
4351

4452
```html
45-
<log-viewer
46-
:log="log"
47-
:loading="isLoading"
48-
/>
53+
<log-viewer :log="log" :loading="isLoading" />
4954
```
5055

5156
[⬆ Back to Top](#table-of-contents)
5257

5358
## Reference
5459

55-
* [thanks to react-lazylog](https://github.com/mozilla-frontend-infra/react-lazylog)
56-
* [travis-ci logs](https://travis-ci.org/)
57-
* [http://jafrog.com/2013/11/23/colors-in-terminal.html](http://jafrog.com/2013/11/23/colors-in-terminal.html)
58-
* [https://en.wikipedia.org/wiki/ANSI_escape_code](https://en.wikipedia.org/wiki/ANSI_escape_code)
60+
- [thanks to react-lazylog](https://github.com/mozilla-frontend-infra/react-lazylog)
61+
- [travis-ci logs](https://travis-ci.org/)
62+
- [http://jafrog.com/2013/11/23/colors-in-terminal.html](http://jafrog.com/2013/11/23/colors-in-terminal.html)
63+
- [https://en.wikipedia.org/wiki/ANSI_escape_code](https://en.wikipedia.org/wiki/ANSI_escape_code)
5964

6065
[⬆ Back to Top](#table-of-contents)
6166

@@ -104,6 +109,19 @@ Total time: 956.86ms<br />
104109

105110
[⬆ Back to Top](#table-of-contents)
106111

112+
## Contributing
113+
114+
For those who are interested in contributing to this project, such as:
115+
116+
- report a bug
117+
- request new feature
118+
- fix a bug
119+
- implement a new feature
120+
121+
Please refer to our [contributing guide](https://github.com/FEMessage/.github/blob/master/CONTRIBUTING.md).
122+
123+
[⬆ Back to Top](#table-of-contents)
124+
107125
## Contributors
108126

109127
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

package.json

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@femessage/log-viewer",
33
"version": "1.0.1",
4-
"description": "",
4+
"description": "💻 View terminal logs in browser",
55
"author": "https://github.com/FEMessage",
66
"license": "MIT",
77
"repository": {
@@ -15,8 +15,7 @@
1515
],
1616
"files": [
1717
"src",
18-
"dist",
19-
"yarn.lock"
18+
"dist"
2019
],
2120
"main": "dist/log-viewer.umd.js",
2221
"module": "dist/log-viewer.esm.js",
@@ -26,7 +25,7 @@
2625
},
2726
"scripts": {
2827
"dev": "vue-styleguidist server",
29-
"test": "jest",
28+
"test": "jest --verbose",
3029
"doc": "vue-styleguidist build",
3130
"build": "npm run build:unpkg & npm run build:es & npm run build:umd & npm run doc",
3231
"build:umd": "rollup --config build/rollup.config.js --format umd --file dist/log-viewer.umd.js",
@@ -47,29 +46,32 @@
4746
"file-loader": "^3.0.1",
4847
"github-release-notes": "^0.17.0",
4948
"glob": "^7.1.3",
50-
"husky": "^0.14.3",
49+
"husky": "1.3.1",
5150
"jest": "^24.8.0",
51+
"less": "^3.9.0",
52+
"less-loader": "^5.0.0",
53+
"lint-staged": "^8.1.0",
5254
"minimist": "^1.2.0",
53-
"prettier": "1.12.1",
55+
"prettier": "1.18.2",
5456
"pretty-quick": "^1.4.1",
5557
"rollup": "^1.9.0",
5658
"rollup-plugin-babel": "^4.3.2",
5759
"rollup-plugin-commonjs": "^9.3.4",
5860
"rollup-plugin-terser": "^4.0.4",
5961
"rollup-plugin-vue": "^4.7.2",
6062
"standard-version": "^6.0.1",
61-
"stylus": "^0.54.5",
62-
"stylus-loader": "^3.0.2",
63-
"vue": "^2.5.16",
64-
"vue-loader": "^15.7.0",
65-
"vue-styleguidist": "3.11.4",
63+
"stylelint": "^9.10.0",
64+
"stylelint-config-standard": "^18.2.0",
65+
"vue": "^2.6.10",
66+
"vue-loader": "^15.7.1",
67+
"vue-styleguidist": "^3.16.3",
6668
"vue-template-compiler": "^2.5.16",
6769
"webpack": "^4.29.6"
6870
},
6971
"publishConfig": {
7072
"access": "public"
7173
},
72-
"vue-sfc-cli": "1.10.3",
74+
"vue-sfc-cli": "1.10.7",
7375
"engines": {
7476
"node": ">= 4.0.0",
7577
"npm": ">= 3.0.0"
@@ -78,5 +80,22 @@
7880
"moduleNameMapper": {
7981
"^@/(.*)$": "<rootDir>/src/$1"
8082
}
83+
},
84+
"husky": {
85+
"hooks": {
86+
"pre-commit": "lint-staged",
87+
"post-commit": "git update-index --again"
88+
}
89+
},
90+
"lint-staged": {
91+
"*.(js|md|json)": [
92+
"prettier --write",
93+
"git add"
94+
],
95+
"*.vue": [
96+
"prettier --write",
97+
"stylelint --fix",
98+
"git add"
99+
]
81100
}
82101
}

src/components/line-number.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="line-number" :class="className">{{number}}</div>
2+
<div class="line-number" :class="className">{{ number }}</div>
33
</template>
44
<script>
55
export default {

src/components/line-wrapper.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,33 @@ export default {
5858
}
5959
}
6060
</script>
61-
<style lang="stylus">
61+
<style lang="less">
6262
.line-wrapper {
6363
color: #f1f1f1;
6464
line-height: 20px;
6565
height: 20px;
6666
white-space: nowrap;
6767
// word-break: break-all;
6868
box-sizing: border-box;
69-
padding-left: 16px
69+
padding-left: 16px;
7070
7171
&:hover {
7272
background-color: #444;
7373
}
74-
.line-number{
75-
display:inline-block;
74+
75+
.line-number {
76+
display: inline-block;
7677
min-width: 40px;
7778
text-align: right;
7879
color: #666;
7980
padding-right: 8px;
80-
-webkit-user-select:none;
81-
-moz-user-select:none;
82-
-ms-user-select:none;
83-
user-select:none;
81+
-webkit-user-select: none;
82+
-moz-user-select: none;
83+
-ms-user-select: none;
84+
user-select: none;
8485
}
85-
.line-content{
86+
87+
.line-content {
8688
display: inline-block;
8789
}
8890
}

0 commit comments

Comments
 (0)