diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 3c99630500..3a25a798a8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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) @@ -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` diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 204a0354e9..7cee9b2c25 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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" diff --git a/.github/workflows/tests-components.yaml b/.github/workflows/tests-components.yaml deleted file mode 100644 index 30c254d833..0000000000 --- a/.github/workflows/tests-components.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Tests @chainlit/react-components - -# on: -# push: -# paths: -# - 'libs/react-components' - -on: [workflow_call] - -jobs: - ci: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8.6.9 - - name: Use Node.js 16.15.0 - uses: actions/setup-node@v3 - with: - node-version: '16.15.0' - cache: 'pnpm' - - name: Install JS dependencies - run: pnpm install --no-frozen-lockfile - - name: Build components - run: pnpm run build:react-components - - name: Lint components - run: pnpm run lint:react-components - - name: Run tests - run: pnpm test:react-components diff --git a/package.json b/package.json index 8bf0197c78..c0c5ac58ec 100644 --- a/package.json +++ b/package.json @@ -19,16 +19,13 @@ "scripts": { "preinstall": "npx only-allow pnpm", "test": "pnpm exec ts-node ./cypress/support/e2e.ts", - "test:react-components": "cd libs/react-components && pnpm test", + "test:ui": "cd frontend && pnpm test", "prepare": "husky install", "lintUi": "cd frontend && pnpm run lint", "formatUi": "cd frontend && pnpm run format", - "lint:react-components": "cd libs/react-components && pnpm run lint", - "format:react-components": "cd libs/react-components && pnpm run format", "lintPython": "cd backend && poetry run mypy chainlit/", "formatPython": "black `git ls-files | grep '.py$'` && isort --profile=black .", - "buildUi": "cd libs/react-client && pnpm run build && cd ../react-components && pnpm run build && cd ../copilot && pnpm run build && cd ../../frontend && pnpm run build", - "build:react-components": "cd libs/react-client && pnpm build && cd ../react-components && pnpm build", + "buildUi": "cd libs/react-client && pnpm run build && cd ../copilot && pnpm run build && cd ../../frontend && pnpm run build", "build": "pnpm run buildUi && (mkdir -p backend/chainlit/frontend && cp -R frontend/dist backend/chainlit/frontend) && (mkdir -p backend/chainlit/copilot && cp -R libs/copilot/dist backend/chainlit/copilot) && (cd backend && poetry build)" } }