Skip to content

Commit

Permalink
[Part 2] Move components to @chainlit/component (Chainlit#366)
Browse files Browse the repository at this point in the history
* refactor: Move useIsDarkMode hooks to @chainlit/components/hooks

* refactor: Move <ClipboardCopy/> to @chainlit/components

* refactor: Move <Code/> to @chainlit/components

* feat: Add useApi hooks to @chainlit/components

* refactor: Move <TextElement/> to @chainlit/components

* refactor: Move <InlinedTextList/> to @chainlit/components

* refactor: Move <SelectInput/> to @chainlit/components

* refactor: Move <SelectCategoryInput/> to @chainlit/components

* refactor: Move <TagsInput/> to @chainlit/components

* refactor: Clean components

* refactor: Move <SliderInput/> to @chainlit/components

* refactor: Move <SwitchInput/> to @chainlit/components

* feat: Add custom omit to @chainlit/components

* refactor: Move <FormInput/> to @chainlit/components

* refactor: Move <Element/>, <ElementView/> and <ElementSideView/> to @chainlit/components

* build: Remove useless dependencies

* refactor: Move IMessage and dependant types to @chainlit/components

* refactor: Move IAction types to @chainlit/components

* refactor: Move File types to @chainlit/components

* refactor: Move useUpload hooks to @chainlit/components

* refactor: Move IAsk types to @chainlit/components

* refactor: Move <RegularButton/> to @chainlit/components

* refactor: Move <Collapse/> to @chainlit/components

* refactor: Move <InlinedElements/> to @chainlit/components

* refactor: index should be .ts instead .tsx on @chaintlit/component

* refactor: Move <MessageContainer/> and all related components to @chainlit/components

* refactor: Move front unit test to @chainlit/components

* build: Run @chainlit/components tests on CI
  • Loading branch information
alimtunc authored Sep 8, 2023
1 parent 7fee8e0 commit b28bad2
Show file tree
Hide file tree
Showing 116 changed files with 4,408 additions and 4,874 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ 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]
needs: [mypy, tests, tests-components]
steps:
- name: "Done"
- name: 'Done'
run: echo "Done"
33 changes: 33 additions & 0 deletions .github/workflows/tests-components.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests @chainlit/components

# on:
# push:
# paths:
# - 'libs/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:components
- name: Lint components
run: pnpm run lint:components
- name: Run tests
run: pnpm test:components
14 changes: 0 additions & 14 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"preinstall": "npx only-allow pnpm",
"dev": "vite",
"build": "tsc && vite build",
"test": "vitest run",
"preview": "vite preview",
"lint": "eslint ./src --ext .ts,.tsx && tsc --noemit",
"format": "prettier src/**/*.{ts,tsx} --write --loglevel error"
Expand All @@ -23,16 +22,13 @@
"draft-js": "^0.11.7",
"formik": "^2.4.3",
"lodash": "^4.17.21",
"mui-chips-input": "^2.1.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-hot-toast": "^2.4.1",
"react-hotkeys-hook": "^4.4.1",
"react-markdown": "^8.0.7",
"react-resizable": "^3.0.5",
"react-router-dom": "^6.15.0",
"react-syntax-highlighter": "^15.5.0",
"react-virtualized-auto-sizer": "^1.0.20",
"react-window": "^1.8.9",
"react-window-infinite-loader": "^1.0.9",
Expand All @@ -42,26 +38,16 @@
"swr": "^2.2.2",
"usehooks-ts": "^2.9.1",
"uuid": "^9.0.0",
"vitest": "^0.33.0",
"yup": "^1.2.0"
},
"devDependencies": {
"@babel/preset-env": "^7.22.14",
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.11",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@types/draft-js": "^0.11.10",
"@types/lodash": "^4.14.197",
"@types/node": "^20.5.7",
"@types/react-resizable": "^3.0.4",
"@types/react-syntax-highlighter": "^15.5.7",
"@types/react-window-infinite-loader": "^1.0.6",
"@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",
"vite": "^4.4.9",
"vite-tsconfig-paths": "^4.2.0"
}
Expand Down
Loading

0 comments on commit b28bad2

Please sign in to comment.