Skip to content

Commit

Permalink
Wd/split client (#546)
Browse files Browse the repository at this point in the history
* split react clients from components

* move api into client and remove client dependency from components
  • Loading branch information
willydouhard authored Nov 16, 2023
1 parent 57d14f9 commit e9aadf5
Show file tree
Hide file tree
Showing 212 changed files with 4,164 additions and 1,766 deletions.
10 changes: 5 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ I've copy/pasted the whole document there, without the previous two headings.
- [Install python dependencies](#install-python-dependencies)
- [Start the Chainlit server from source](#start-the-chainlit-server-from-source)
- [Start the UI from source](#start-the-ui-from-source)
- [Develop locally on `libs/components`](#develop-locally-on--libs-components-)
- [Develop locally on `libs/react-components`](#develop-locally-on-libsreact-components)
- [Run the tests](#run-the-tests)
- [Run one test](#run-one-test)

Expand Down Expand Up @@ -117,18 +117,18 @@ pnpm run dev --port 5174

If you visit `http://127.0.0.1:5174/`, it should connect to your local server. If the local server is not running, it should say that it can't connect to the server.

## Develop locally on `libs/components`
## Develop locally on `libs/react-components`

Reusable UI components are living in the separate npm package `libs/components`. The main Chainlit UI build and import that package automatically.
Reusable UI components are living in the separate npm package `libs/react-components`. The main Chainlit UI build and import that package automatically.

You can enable hot module replacement for development.

```sh
cd libs/components
cd libs/react-components
pnpm run build:watch
```

This will watch for file changes in `libs/components` and automatically rebuild the library as you develop.
This will watch for file changes in `libs/react-components` and automatically rebuild the library as you develop.

## Run the tests

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests-components.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Tests @chainlit/components
name: Tests @chainlit/react-components

# on:
# push:
# paths:
# - 'libs/components'
# - 'libs/react-components'

on: [workflow_call]

Expand All @@ -26,8 +26,8 @@ jobs:
- name: Install JS dependencies
run: pnpm install --no-frozen-lockfile
- name: Build components
run: pnpm run build:components
run: pnpm run build:react-components
- name: Lint components
run: pnpm run lint:components
run: pnpm run lint:react-components
- name: Run tests
run: pnpm test:components
run: pnpm test:react-components
8 changes: 3 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,23 @@
"format": "prettier src/**/*.{ts,tsx} --write --loglevel error"
},
"dependencies": {
"@chainlit/components": "workspace:^",
"@chainlit/react-components": "workspace:^",
"@chainlit/react-client": "workspace:^",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.9",
"@mui/lab": "^5.0.0-alpha.122",
"@mui/material": "^5.14.10",
"formik": "^2.4.3",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"react-hotkeys-hook": "^4.4.1",
"react-router-dom": "^6.15.0",
"react-speech-recognition": "^3.10.0",
"recoil": "^0.7.6",
"recoil": "^0.7.7",
"regenerator-runtime": "^0.14.0",
"socket.io-client": "^4.7.2",
"swr": "^2.2.2",
"usehooks-ts": "^2.9.1",
"uuid": "^9.0.0",
"yup": "^1.2.0"
Expand Down
Loading

0 comments on commit e9aadf5

Please sign in to comment.