Skip to content

Commit

Permalink
Merge branch 'main' into feature/LC-3261
Browse files Browse the repository at this point in the history
  • Loading branch information
VadymBezpalko authored Nov 27, 2024
2 parents a1d452a + 93ef182 commit e38680e
Show file tree
Hide file tree
Showing 316 changed files with 19,757 additions and 31,882 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ dist
scripts
lib
.env
*.mdx
*.log
storybook-static
vite.config.js
!.storybook
17 changes: 16 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,31 @@
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:eslint-comments/recommended",
"plugin:storybook/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"project": "tsconfig.json"
},
"plugins": ["@typescript-eslint", "import"],
"plugins": ["@typescript-eslint", "import", "unused-imports", "eslint-plugin-react-compiler"],
"rules": {
"eslint-comments/no-unused-disable": "error",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"import/prefer-default-export": "off",
"import/no-named-as-default": "off",
"react-compiler/react-compiler": "error",
"unused-imports/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"prefer-const": "error",
"@typescript-eslint/no-unsafe-member-access": "off", // TODO: enable when design-system-icons will have proper types
"@typescript-eslint/no-unsafe-call": "warn",
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Check PR Title for Conventional Commits Format
on:
pull_request:
types: [ opened, edited, synchronize ]
branches:
- main
jobs:
check-for-cc:
runs-on: ubuntu-latest
Expand All @@ -10,4 +12,4 @@ jobs:
id: check-for-cc
uses: agenthunt/conventional-commit-checker-action@v2.0.0
with:
pr-title-regex: '^((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.+\))?: .{1,50})'
pr-title-regex: '^((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|tweak|icon)(\(.+\))?: .{1,50})'
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
push:
branches:
- release

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout current branch (release)
uses: actions/checkout@v2
with:
ref: release

- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Install modules
run: npm ci

- name: Build icons
run: npm run build:icons

- name: Configure npm authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Bump version with Lerna and publish
run: npm run deploy:auto
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }},
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Pull latest changes from remote
run: git pull origin release

- name: Check for changes between release and main
run: |
git fetch origin main
if [ "$(git rev-list --count release..origin/main)" -eq 0 ]; then
echo "No changes to merge. Skipping PR creation."
exit 0
fi
- name: Create merge-back PR to main using GitHub API
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"title":"Merge-back: release to main","body":"This is an automated PR to merge the release branch into main after version bump and publish.","head":"release","base":"main"}' \
https://api.github.com/repos/${{ github.repository }}/pulls
2 changes: 2 additions & 0 deletions .github/workflows/update-pr-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Update PR Description
on:
pull_request:
types: [opened]
branches:
- main
jobs:
update-description:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ storybook-static
.idea
.vscode/*
.nx/cache
.nx/workspace-data
.history
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npm run lint-staged

npm run type-check --w @livechat/design-system-react-components
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ npm start

If `Storybook` is not enough, you can additionaly run `npm start:example` which will run `example-react` package in `watch` mode. `example-react` is a simple [React](https://reactjs.org/) app based on [vite-react boilterplate](https://github.com/vitejs/vite/tree/main/packages/create-vite). It has a direct dependency on `react-components` package, so every change should be reflected in the app via auto-reload.

### 404 and disconnections problems
If you have problems with disconnects while working in the environment, make the following change to the file `packages/react-components/.storybook/main.ts`:
```
...
typescript: {
// reactDocgen: 'react-docgen-typescript',
check: false,
reactDocgen: false,
},
...
```
This is a problem that occurred after the last update of Storybook and related packages, we are currently looking for a solution for this.

**Be sure not to commit changes to this file along with other changes made to components.**

## Contributing

The guide that describes the contribution process is available [here](./docs/CONTRIBUTION.md).
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages": ["packages/*"],
"version": "1.33.7",
"version": "2.8.0",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
Loading

0 comments on commit e38680e

Please sign in to comment.