Skip to content

Commit

Permalink
feat: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasen-Zhang committed Dec 16, 2024
1 parent 4aa9956 commit 5772840
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 56 deletions.
4 changes: 4 additions & 0 deletions .dumi/global.less
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ body,
font-family: 'Poppins', apple-system, BlinkMacSystemFont, 'Segoe UI',
'PingFang SC', 'Hiragino Sans GB' !important;
}

.dumi-default-hero-title {
font-size: 44px !important;
}
16 changes: 15 additions & 1 deletion .dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ import { defineConfig } from 'dumi';
export default defineConfig({
outputPath: 'docs-dist',
themeConfig: {
name: 'databend-profile-ui',
prefersColor: {
switch: false
},
name: '',
footer: `<div>Copyright © ${new Date().getFullYear()} | <a href="https://www.databend.com" target="_blank">Databend Cloud</a></div>`,
socialLinks: {
github: 'https://github.com/databendcloud',
twitter: 'https://twitter.com/DatabendLabs',
zhihu: 'https://www.zhihu.com/org/datafuse',
weibo: 'https://github.com/databendcloud/databend-profile-ui'
},
},
logo: '/logo.svg',
favicons: [
'/favicon.svg'
]
});
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish to GitHub Packages

on:
push:
branches:
- main # Change this to your default branch if it's not 'main'

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18' # Change this to the Node.js version you're using
registry-url: 'https://npm.pkg.github.com'
scope: '@databendcloud' # Change this to your GitHub organization or username

- name: yarn Install dependencies
run: yarn


- name: Build dist
run: npm run build

- name: Build Docs
run: npm run docs:build

- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.DATABEND_CLOUD_NPM_TOKEN }}

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.DATABEND_CLOUD_NPM_TOKEN }}
publish_dir: ./docs-dist # Change this to the directory you want to deploy
45 changes: 12 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,22 @@
# databend-profile-ui

[![NPM version](https://img.shields.io/npm/v/databend-profile-ui.svg?style=flat)](https://npmjs.org/package/databend-profile-ui)
[![NPM downloads](http://img.shields.io/npm/dm/databend-profile-ui.svg?style=flat)](https://npmjs.org/package/databend-profile-ui)

A react library developed with dumi

## Usage

TODO

## Options

TODO

## Development
## Install

```bash
# install dependencies
$ yarn install

# develop library by docs demo
$ yarn start

# build library source code
$ yarn run build

# build library source code in watch mode
$ yarn run build:watch
yarn add databend-profile-ui
```

# build docs
$ yarn run docs:build
## Usage

# Locally preview the production build.
$ yarn run docs:preview
### styles

# check your project for potential problems
$ yarn run doctor
```typescript
//App.tsx:
import 'databend-profile-ui/dist/assets/css/profile.less';
```

## LICENSE
### import

MIT
```typescript
import { QueryProfile } from 'databend-profile-ui';
```
1 change: 0 additions & 1 deletion docs/guide.md

This file was deleted.

41 changes: 24 additions & 17 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
---
hero:
title: library
description: A react library developed with dumi
title: databend-profile-ui
description: profiles for databend
actions:
- text: Hello
link: /
- text: World
link: /
features:
- title: Hello
emoji: 💎
description: Put hello description here
- title: World
emoji: 🌈
description: Put world description here
- title: '!'
emoji: 🚀
description: Put ! description here
- text: Start
link: /components/query-profile
---

databend-profile-ui
## Install

```bash
yarn add databend-profile-ui
```

## Usage

### styles

```typescript
//App.tsx:
import 'databend-profile-ui/dist/assets/css/profile.less';
```

### import

```typescript
import { QueryProfile } from 'databend-profile-ui';
```
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "databend-profile-ui",
"version": "0.0.16",
"version": "0.0.17",
"description": "A react library developed with dumi",
"license": "MIT",
"module": "dist/index.js",
Expand Down
6 changes: 6 additions & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion src/QueryProfile/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,24 @@ export default () => (
```jsx
import { TestProfile } from 'databend-profile-ui';

export default () => <TestProfile isDemo isNeedMetrics={false} />;
export default () => <TestProfile isDemo />;
```

### QueryProfile props

```javascript

pileRef?: any;
queryDuration: number;
orgSlug?: string;
queryId?: string;
outValue?: string;
countShow?: number;
offsetWidth?: number;
offsetHeight?: number;
showTextArea?: boolean;
initLoading?: boolean;
isDemo?: boolean;
isLight?: boolean;

```

0 comments on commit 5772840

Please sign in to comment.