frontAnswerer/README.md
nflnkr 0d10f4a7da fix peer dependencies
export QuizView component from package
fix readme
2024-02-13 16:06:19 +03:00

50 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Виджет
### Сборка
```bash
yarn build:widget
```
### Использование
```html
<script type="module">
import widget from "https://s.hbpn.link/export/pub.js";
widget.create({
selector: "widget-container",
quizId: "...",
})
</script>
```
## Npm-пакет
### Перед использованием и публикацией
```bash
npm config set //penahub.gitlab.yandexcloud.net/api/v4/packages/npm/:_authToken=INSTANCE_TOKEN
npm config set //penahub.gitlab.yandexcloud.net/api/v4/projects/43/packages/npm/:_authToken=PROJECT_TOKEN
```
### Публикация
```bash
yarn publish
```
### Установка
Добавить в корень проекта файл .yarnrc с содержимым
```
"@frontend:registry" "https://penahub.gitlab.yandexcloud.net/api/v4/packages/npm/"
```
```bash
yarn add @frontend/squzanswerer
```
Peer dependencies:
```bash
yarn add @emoji-mart/data @emoji-mart/react @emotion/react @emotion/styled @mui/icons-material @mui/material @mui/x-date-pickers axios emoji-mart immer moment nanoid notistack react-dom react-error-boundary react-router-dom react swr use-debounce zustand
```
### Использование
```ts
import { QuizView } from "@frontend/squzanswerer";
export default function Component() {
// ...
return (
<QuizView quizId={quizId} />
}
}
```