Skip to content

Commit

Permalink
feat: add logcat
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Oct 16, 2024
1 parent 1c6188f commit 84128eb
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 1 deletion.
9 changes: 9 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@
"install": false,
"react": false
},
"logcat": {
"version": "0.1.0",
"style": true,
"icon": false,
"test": true,
"install": false,
"react": false,
"dependencies": []
},
"lrc-player": {
"version": "0.1.0",
"style": true,
Expand Down
27 changes: 27 additions & 0 deletions src/logcat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Luna Logcat

Android logcat viewer.

## Demo

https://luna.liriliri.io/?path=/story/logcat

## Install

Add the following script and style to your page.

```html
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-logcat/luna-logcat.css" />
<script src="//cdn.jsdelivr.net/npm/luna-logcat/luna-logcat.js"></script>
```

You can also get it on npm.

```bash
npm install luna-logcat --save
```

```javascript
import 'luna-logcat/luna-logcat.css'
import LunaLogcat from 'luna-logcat'
```
15 changes: 15 additions & 0 deletions src/logcat/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Component from '../share/Component'
import { exportCjs } from '../share/util'

/**
* Android logcat viewer.
*/
export default class Logcat extends Component {
constructor(container: HTMLElement) {
super(container, { compName: 'logcat' })
}
}

if (typeof module !== 'undefined') {
exportCjs(module, Logcat)
}
5 changes: 5 additions & 0 deletions src/logcat/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "logcat",
"version": "0.1.0",
"description": "Android logcat viewer"
}
20 changes: 20 additions & 0 deletions src/logcat/story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'luna-logcat.css'
import Logcat from 'luna-logcat.js'
import readme from './README.md'
import story from '../share/story'

const def = story(
'logcat',
(container) => {
const logcat = new Logcat(container)

return logcat
},
{
readme,
story: __STORY__,
}
)

export default def
export const { logcat } = def
Empty file added src/logcat/style.scss
Empty file.
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"luna-painter": ["src/painter/index"],
"luna-mask-editor": ["src/mask-editor/index"],
"luna-image-list": ["src/image-list/index"],
"luna-lrc-player": ["src/lrc-player/index"]
"luna-lrc-player": ["src/lrc-player/index"],
"luna-logcat": ["src/logcat/index"]
}
}
}

0 comments on commit 84128eb

Please sign in to comment.