Skip to content

Commit

Permalink
move react-components codebase back into frontend (#829)
Browse files Browse the repository at this point in the history
- simplifies the codebase by removing the need for a separate package
  • Loading branch information
tpatel committed Mar 21, 2024
1 parent ce0b9cf commit f365e5b
Show file tree
Hide file tree
Showing 166 changed files with 5,878 additions and 7,014 deletions.
14 changes: 0 additions & 14 deletions .github/CONTRIBUTING.md
Expand Up @@ -18,7 +18,6 @@ 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/react-components`](#develop-locally-on-libsreact-components)
- [Run the tests](#run-the-tests)
- [Run one test](#run-one-test)

Expand Down Expand Up @@ -117,19 +116,6 @@ 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/react-components`

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/react-components
pnpm run build:watch
```

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

## Run the tests

Run `pnpm test`
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ci.yaml
Expand Up @@ -14,13 +14,10 @@ jobs:
tests:
uses: ./.github/workflows/tests.yaml
secrets: inherit
tests-components:
uses: ./.github/workflows/tests-components.yaml
secrets: inherit
ci:
runs-on: ubuntu-latest
name: Run CI
needs: [mypy, tests, tests-components]
needs: [mypy, tests]
steps:
- name: 'Done'
run: echo "Done"
33 changes: 0 additions & 33 deletions .github/workflows/tests-components.yaml

This file was deleted.

35 changes: 32 additions & 3 deletions frontend/package.json
Expand Up @@ -9,42 +9,71 @@
"build": "tsc && vite build",
"preview": "vite preview",
"lint": "eslint ./src --ext .ts,.tsx && tsc --noemit",
"format": "prettier src/**/*.{ts,tsx} --write --loglevel error"
"format": "prettier src/**/*.{ts,tsx} --write --loglevel error",
"test": "vitest run",
"prepublish": "pnpm run build && pnpm test"
},
"dependencies": {
"@chainlit/react-client": "workspace:^",
"@chainlit/react-components": "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",
"draft-js": "^0.11.7",
"formik": "^2.4.3",
"highlight.js": "^11.9.0",
"i18next": "^23.7.16",
"lodash": "^4.17.21",
"mui-chips-input": "2.0.0",
"plotly.js": "^2.27.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-file-icon": "^1.3.0",
"react-hotkeys-hook": "^4.4.1",
"react-i18next": "^14.0.0",
"react-markdown": "^9.0.1",
"react-password-checklist": "^1.5.0",
"react-plotly.js": "^2.6.0",
"react-resizable": "^3.0.5",
"react-router-dom": "^6.15.0",
"react-speech-recognition": "^3.10.0",
"recoil": "^0.7.7",
"regenerator-runtime": "^0.14.0",
"rehype-katex": "^7.0.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.0",
"remark-math": "^6.0.0",
"sonner": "^1.2.3",
"swr": "^2.2.2",
"usehooks-ts": "^2.9.1",
"uuid": "^9.0.0",
"yup": "^1.2.0"
},
"devDependencies": {
"@swc/core": "^1.3.86",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@types/draft-js": "^0.11.10",
"@types/lodash": "^4.14.199",
"@types/node": "^20.5.7",
"@types/react": "^18.2.0",
"@types/react-file-icon": "^1.0.2",
"@types/react-plotly.js": "^2.6.3",
"@types/react-resizable": "^3.0.4",
"@types/react-speech-recognition": "^3.9.2",
"@types/uuid": "^9.0.3",
"@vitejs/plugin-react": "^4.0.4",
"@vitejs/plugin-react-swc": "^3.3.2",
"immutable": "^4.3.4",
"jsdom": "^22.1.0",
"tslib": "^2.6.2",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.2.0"
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^0.34.4"
}
}

0 comments on commit f365e5b

Please sign in to comment.