Skip to content

Commit

Permalink
docs(readme.md contributing.md): init contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
BQXBQX committed Mar 23, 2024
1 parent 05776b2 commit 2ec994a
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 73 deletions.
131 changes: 131 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Contributing

Thanks for your interest in contributing to ui.sast.fun. We're happy to have you here.

Please take a moment to review this document before submitting your first pull request. We also strongly recommend that you check for open issues and pull requests to see if someone else is working on something similar.


## About this repository

This repository is a monorepo.

- We use [pnpm](https://pnpm.io) and [`workspaces`](https://pnpm.io/workspaces) for development.

## Structure

This repository is structured as follows:

```
packages
├── ui-react
│ └── lib
│ └── ${component-name}
│ ├── index.module.scss
│ └── index.tsx
└── ui-universal
└── lib
└──components
└── ${component-name}
├── index.module.scss
└── index.tsx
docs
└── docs
```

| Path | Description |
| ------------------------ | ---------------------------------------- |
| `packages/ui-react` | The React components for the website. |
| `packages/ui-universal` | The web components for the website. |
| `docs` | The docs for the components. |

## Development

### Fork this repo

You can fork this repo by clicking the fork button in the top right corner of this page.

### Clone on your local machine

```bash
git clone https://github.com/your-username/SAST-UI.git
```

### Navigate to project directory

```bash
cd SAST-UI
```

### Create a new Branch

```bash
git checkout -b my-new-branch
```

### Install dependencies

```bash
pnpm install
```

### Run a workspace

You can use the `pnpm --filter=[WORKSPACE]` command to start the development process for a workspace.

#### Examples

1. To run the `sast-ui-react.vercel.app` website:

```bash
pnpm run ui-react:dev
```

2. To run the `ui-react` package:

```bash
pnpm run ui-react:start
```

3. To run the `ui-universal` package:

```bash
pnpm run ui-uni:dev
```

## Documentation

The documentation for this project is located in the `docs` workspace. You can run the documentation locally by running the following command:

```bash
pnpm run docs:dev
```

Documentation is written using [MDX](https://mdxjs.com). You can find the documentation files in the `docs` directory.


## Commit Convention

Before you create a Pull Request, please check whether your commits comply with
the commit conventions used in this repository.

We don't allow git commits, please use pnpm commit and follow the steps to select your commit.
```bash
pnpm commit
```

## Requests for new components

If you have a request for a new component, please open a issue on GitHub. We'll be happy to help you out.


## Testing

Tests are written using [Vitest](https://vitest.dev). You can run all the tests from the root of the repository.

Currently only the react component library supports test, and the test code is in development

```bash
pnpm --filter @sast/ui-react test
```

Please ensure that the tests are passing when submitting a pull request. If you're adding new features, please include tests.
81 changes: 8 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,12 @@
# SAST UI
# Aurora UI Library

## Quick start
Accessible and customizable components that you can copy and paste into your apps. Free. Open Source. Use this to build your own component library.

```shell
git clone https://github.com/NJUPT-SAST/SAST-UI.git
![Logo](/public/README.jpg)

cd SAST-UI
## Documentation
Visit https://ui.sast.fun/ to view the universal documentation (developing).
Visit https://http://sast-ui-react.vercel.app/ to view the react documentation (beta).

pnpm i #安装依赖

pnpm run dev #vite build --watch

pnpm link --global #link
```

## Use in Vue

```shell
pnpm link --global sast-ui

# if the answer is
# + sast-ui ^0.0.1
# you are successfully
```

```js
// vite.config.js
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
// 将所有带短横线的标签名都视为自定义元素
isCustomElement: (tag) => tag.includes("-"),
},
},
}),
],
});
```

### Usage sample

```js
<script setup>
import { Sbutton } from "sast-ui";
</script>

<template>
<s-button>test</s-button>
</template>
```

## Use in React

See vue above for pnpm link methods

### Usage sample

```jsx
import { Button } from "sast-ui";

function App() {
return (
<>
<Button>test</Button>
</>
);
}

export default App;
```
## Contributing
Please read the [contributing guide](/CONTRIBUTING.md).
Binary file added public/README.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2ec994a

Please sign in to comment.