Skip to content

Commit 2dcfbfb

Browse files
committed
🎉 chore: int project
0 parents  commit 2dcfbfb

25 files changed

+684
-0
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@lobehub/lint').eslint;

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.npmrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
lockfile=false
2+
public-hoist-pattern[]=*@umijs/lint*
3+
public-hoist-pattern[]=*changelog*
4+
public-hoist-pattern[]=*commitlint*
5+
public-hoist-pattern[]=*eslint*
6+
public-hoist-pattern[]=*postcss*
7+
public-hoist-pattern[]=*prettier*
8+
public-hoist-pattern[]=*remark*
9+
public-hoist-pattern[]=*semantic-release*
10+
public-hoist-pattern[]=*stylelint*

.prettierrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@lobehub/lint').prettier;

README.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<a name="readme-top"></a>
2+
3+
<div align="center">
4+
5+
<img height="120" src="https://registry.npmmirror.com/@lobehub/assets-emoji/1.3.0/files/assets/puzzle-piece.webp">
6+
<img height="120" src="https://gw.alipayobjects.com/zos/kitchen/qJ3l3EPsdW/split.svg">
7+
<img height="120" src="https://registry.npmmirror.com/@lobehub/assets-emoji/1.3.0/files/assets/one-o-clock.webp">
8+
9+
<h1>Clock Time<br/><sup>LobeChat Plugin</sup></h1>
10+
11+
This plugin show a clock of current time.
12+
13+
[Changelog](./CHANGELOG.md) · [Report Bug][issues-url] · [Request Feature][issues-url]
14+
15+
<!-- SHIELD GROUP -->
16+
17+
[![plugin][plugin-shield]][plugin-url]
18+
[![releaseDate][release-date-shield]][release-date-url]
19+
[![ciTest][ci-test-shield]][ci-test-url]
20+
[![ciRelease][ci-release-shield]][ci-release-url] <br/>
21+
[![contributors][contributors-shield]][contributors-url]
22+
[![forks][forks-shield]][forks-url]
23+
[![stargazers][stargazers-shield]][stargazers-url]
24+
[![issues][issues-shield]][issues-url]
25+
26+
![](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
27+
28+
</div>
29+
30+
<details>
31+
<summary><kbd>Table of contents</kbd></summary>
32+
33+
#### TOC
34+
35+
- [🤯 Usage](#-usage)
36+
- [⌨️ Local Development](#️-local-development)
37+
- [🤝 Contributing](#-contributing)
38+
39+
####
40+
41+
</details>
42+
43+
## 🤯 Usage
44+
45+
This is a function calling plugin for [Lobe Chat](https://github.com/lobehub/lobe-chat), you can install it in plugin setting page.
46+
47+
<div align="right">
48+
49+
[![][back-to-top]](#readme-top)
50+
51+
</div>
52+
53+
## ⌨️ Local Development
54+
55+
You can use Gitpod for online development:
56+
57+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][gitpod-url]
58+
59+
Or clone it for local development:
60+
61+
```bash
62+
$ git clone https://github.com/lobehub/chat-plugin-clock-time.git
63+
$ cd lobe-ui
64+
$ pnpm install
65+
$ pnpm start
66+
```
67+
68+
<div align="right">
69+
70+
[![][back-to-top]](#readme-top)
71+
72+
</div>
73+
74+
## 🤝 Contributing
75+
76+
<!-- CONTRIBUTION GROUP -->
77+
78+
> 📊 Total: <kbd>**3**</kbd>
79+
80+
<a href="https://github.com/arvinxx" title="arvinxx">
81+
<img src="https://avatars.githubusercontent.com/u/28616219?v=4" width="50" />
82+
</a>
83+
<a href="https://github.com/canisminor1990" title="canisminor1990">
84+
<img src="https://avatars.githubusercontent.com/u/17870709?v=4" width="50" />
85+
</a>
86+
<a href="https://github.com/lobehubbot" title="lobehubbot">
87+
<img src="https://avatars.githubusercontent.com/u/134299653?v=4" width="50" />
88+
</a>
89+
90+
<!-- CONTRIBUTION END -->
91+
92+
<div align="right">
93+
94+
[![][back-to-top]](#readme-top)
95+
96+
</div>
97+
98+
---
99+
100+
#### 📝 License
101+
102+
Copyright © 2023 [LobeHub][profile-url]. <br />
103+
This project is [MIT](./LICENSE) licensed.
104+
105+
<!-- LINK GROUP -->
106+
107+
[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
108+
[ci-release-shield]: https://github.com/lobehub/chat-plugin-clock-time/actions/workflows/release.yml/badge.svg
109+
[ci-release-url]: https://github.com/lobehub/chat-plugin-clock-time/actions/workflows/release.yml
110+
[ci-test-shield]: https://github.com/lobehub/chat-plugin-clock-time/actions/workflows/test.yml/badge.svg
111+
[ci-test-url]: https://github.com/lobehub/chat-plugin-clock-time/actions/workflows/test.yml
112+
[contributors-shield]: https://img.shields.io/github/contributors/lobehub/chat-plugin-clock-time.svg?style=flat
113+
[contributors-url]: https://github.com/lobehub/chat-plugin-clock-time/graphs/contributors
114+
[forks-shield]: https://img.shields.io/github/forks/lobehub/chat-plugin-clock-time.svg?style=flat
115+
[forks-url]: https://github.com/lobehub/chat-plugin-clock-time/network/members
116+
[gitpod-url]: https://gitpod.io/#https://github.com/lobehub/chat-plugin-clock-time
117+
[issues-shield]: https://img.shields.io/github/issues/lobehub/chat-plugin-clock-time.svg?style=flat
118+
[issues-url]: https://github.com/lobehub/chat-plugin-clock-time/issues/new/choose
119+
[plugin-shield]: https://img.shields.io/badge/%F0%9F%A4%AF_LobeChat-plugin-cyan
120+
[plugin-url]: https://github.com/lobehub/lobe-chat-plugins
121+
[profile-url]: https://github.com/lobehub
122+
[release-date-shield]: https://img.shields.io/github/release-date/lobehub/chat-plugin-clock-time?style=flat
123+
[release-date-url]: https://github.com/lobehub/chat-plugin-clock-time/releases
124+
[stargazers-shield]: https://img.shields.io/github/stars/lobehub/chat-plugin-clock-time.svg?style=flat
125+
[stargazers-url]: https://github.com/lobehub/chat-plugin-clock-time/stargazers

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>LobeChat Plugin Time</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/main.tsx"></script>
11+
</body>
12+
</html>

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "@lobehub/chat-plugin-clock-time",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"build": "tsc && vite build",
8+
"dev": "vite",
9+
"lint": "eslint \"{src,api,docs}/**/*.{js,jsx,ts,tsx}\" --fix",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"@lobehub/ui": "^1.108.2",
14+
"antd-style": "^3.5.1",
15+
"react": "^18.2.0",
16+
"react-dom": "^18.2.0",
17+
"react-layout-kit": "^1",
18+
"zustand": "^4",
19+
"zustand-utils": "^1"
20+
},
21+
"devDependencies": {
22+
"@lobehub/lint": "latest",
23+
"@types/react": "^18.2.15",
24+
"@types/react-dom": "^18.2.7",
25+
"@vitejs/plugin-react-swc": "^3.3.2",
26+
"eslint": "^8.45.0",
27+
"eslint-plugin-react-hooks": "^4.6.0",
28+
"eslint-plugin-react-refresh": "^0.4.3",
29+
"prettier": "^3.0.3",
30+
"typescript": "^5.0.2",
31+
"vite": "^4.4.5"
32+
}
33+
}

public/manifest-dev.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"api": [
3+
{
4+
"name": "getCurrentTime",
5+
"description": "获取当前时间",
6+
"parameters": {
7+
"type": "object",
8+
"properties": {}
9+
}
10+
}
11+
],
12+
"type": "standalone",
13+
"identifier": "date-time-dev",
14+
"ui": {
15+
"url": "http://localhost:5173/",
16+
"height": 350,
17+
"width": 400
18+
},
19+
"version": "1"
20+
}

public/manifest.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"api": [
3+
{
4+
"name": "getCurrentTime",
5+
"description": "获取当前时间",
6+
"parameters": {
7+
"type": "object",
8+
"properties": {}
9+
}
10+
}
11+
],
12+
"type": "standalone",
13+
"identifier": "clock-time",
14+
"ui": {
15+
"url": "http://localhost:5173/",
16+
"height": 350,
17+
"width": 400
18+
},
19+
"version": "1"
20+
}

src/app.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { FC, useEffect } from 'react';
2+
import { Center } from 'react-layout-kit';
3+
4+
import Clock from './components/clock';
5+
import Time from './components/time';
6+
import { useStore } from './store';
7+
8+
export const App: FC = () => {
9+
const { updateTimeAction } = useStore();
10+
11+
useEffect(() => {
12+
const id = setInterval(() => {
13+
updateTimeAction();
14+
}, 1000);
15+
16+
return () => {
17+
clearInterval(id);
18+
};
19+
}, []);
20+
21+
return (
22+
<div>
23+
<Center padding={32}>
24+
<Clock />
25+
</Center>
26+
<Time />
27+
</div>
28+
);
29+
};

0 commit comments

Comments
 (0)