Skip to content

Commit

Permalink
Merge branch 'master' into e.muhamethanov/7466/screen-spinner-remove-…
Browse files Browse the repository at this point in the history
…size

# Conflicts:
#	packages/vkui/src/components/ScreenSpinner/ScreenSpinner.tsx
#	packages/vkui/src/components/ScreenSpinner/ScreenSpinnerContainer.tsx
#	packages/vkui/src/components/ScreenSpinner/ScreenSpinnerLoader.tsx
#	packages/vkui/src/components/ScreenSpinner/context.ts
  • Loading branch information
EldarMuhamethanov committed Sep 14, 2024
2 parents e58c716 + 2ce4741 commit cb22fef
Show file tree
Hide file tree
Showing 271 changed files with 2,491 additions and 755 deletions.
16 changes: 8 additions & 8 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ChromeAndroid >= 57
iOS >= 10.3
Chrome >= 57
Firefox >= 54
Edge >= 18
Opera >= 44
Safari >= 10.1
Samsung >= 7.2
ChromeAndroid >= 63
iOS >= 12
Chrome >= 63
Firefox >= 55
Edge >= 79
Opera >= 50
Safari >= 12
Samsung >= 8.2
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"eqeqeq": "error", // Only type-safe equality operators
"unicorn/expiring-todo-comments": ["error"],
"no-console": "error",
"react-compiler/react-compiler": 2
"react-compiler/react-compiler": 2,
"no-useless-computed-key": "error"
}
}
8 changes: 6 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
* @VKCOM/vkui-core
.github/ @VKCOM/vk-sec
* @VKCOM/vkui-core
.github/CODEOWNERS @VKCOM/vk-sec
.github/actions/ @VKCOM/vk-sec
.github/workflows/ @VKCOM/vk-sec
.github/dependabot.yml @VKCOM/vk-sec
.github/file-filters.yml @VKCOM/vk-sec
46 changes: 46 additions & 0 deletions .github/actions/lfs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Workflow / Checkout LFS objects
description: Get lfs from cache

runs:
using: composite
steps:
# см. https://github.com/actions/checkout/issues/1169
- name: Set safe directory
shell: bash
run: git config --global --add safe.directory /__w/VKUI/VKUI

# см. https://github.com/microsoft/playwright/issues/21920
- name: Install git lfs
shell: bash
run: |
if git lfs > /dev/null ; then
echo "git-lfs installed"
else
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install -y git-lfs
fi
# см. https://github.com/actions/cache/issues/1455
- name: Install zstd
shell: bash
run: |
if zstd > /dev/null ; then
echo "zstd installed"
else
apt-get install -y zstd
fi
- name: Create LFS file list
shell: bash
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

- name: Restore LFS cache
uses: actions/cache@v4
with:
path: .git/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}
enableCrossOsArchive: 'true'

- name: Checkout LFS objects
shell: bash
run: git lfs pull
12 changes: 12 additions & 0 deletions .github/workflows/branch_test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ concurrency:
cancel-in-progress: true

jobs:
# Создаем кэш для LFS в мастере, чтобы другие ветки могли его получить.
# Кэш требуется для того, чтобы не превышать лимиты GitHub
lfs:
runs-on: ubuntu-latest
name: Create LFS cache
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout LFS objects
uses: ./.github/actions/lfs

test:
name: Call reusable unit tests workflow
uses: ./.github/workflows/reusable_workflow_test.yml
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/pr_close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,44 @@ jobs:
action: upload
override_pr_number: ${{ inputs.pr_number_by_workflow_dispatch }}

v6:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'v6')
concurrency: ci-stable
runs-on: ubuntu-latest
name: v6 Patch
steps:
- name: Checkout (for forked PR)
if: github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id
uses: actions/checkout@v4

- name: Checkout (for maintainer's PR)
if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
uses: actions/checkout@v4
with:
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}

- name: Enable Corepack
run: corepack enable
shell: bash

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Set Git credentials
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Make patch
uses: VKCOM/gh-actions/VKUI/patch@main
with:
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
directory: packages/vkui/
targetBranch: v6
needScreenshots: true

patch:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'patch')
concurrency: ci-stable
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pull_request_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
uses: actions/checkout@v4

- name: Patch
if: ${{ startsWith(github.event.pull_request.title, 'fix') }}
# TODO [>=7]: заменить условие после релиза v7 на ${ { startsWith(github.event.pull_request.title, 'fix') }}
if: false
uses: ./.github/actions/add-label-to-pull-request
with:
issue_number: ${{ github.event.pull_request.number }}
Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/reusable_workflow_test_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
with:
ref: ${{ inputs.ref }}

# Создаем кэш для ветки один раз
- name: Checkout LFS objects
uses: ./.github/actions/lfs

- uses: ./.github/actions/get-playwright-docker-image
id: result

Expand All @@ -42,27 +46,8 @@ jobs:
with:
ref: ${{ inputs.ref }}

# см. https://github.com/actions/checkout/issues/1169
- name: Set safe directory
run: git config --global --add safe.directory /__w/VKUI/VKUI

# см. https://github.com/microsoft/playwright/issues/21920
- name: Install git lfs
run: |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install -y git-lfs
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

- name: Restore LFS cache
uses: actions/cache@v4
with:
path: .git/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}

- name: Checkout LFS objects
run: git lfs pull
uses: ./.github/actions/lfs

- name: Node setup
uses: ./.github/actions/node-setup
Expand Down
35 changes: 8 additions & 27 deletions .github/workflows/update_screens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# Создаем кэш для ветки один раз
- name: Checkout LFS objects
uses: ./.github/actions/lfs

- uses: ./.github/actions/get-playwright-docker-image
id: result

Expand All @@ -37,35 +41,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# см. https://github.com/actions/checkout/issues/1169
- name: Set safe directory
run: git config --global --add safe.directory /__w/VKUI/VKUI

# см. https://github.com/microsoft/playwright/issues/21920
- name: Install git lfs
run: |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install -y git-lfs
- name: Install rsync
run: |
apt-get install -y rsync
- name: Checkout LFS objects
uses: ./.github/actions/lfs

- name: Install zip
- name: Install rsync && zip
run: |
apt-get install -y zip
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

- name: Restore LFS cache
uses: actions/cache@v4
with:
path: .git/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}

- name: Checkout LFS objects
run: git lfs pull
apt-get install -y rsync zip
- name: Node setup
uses: ./.github/actions/node-setup
Expand Down
6 changes: 3 additions & 3 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"runtime:start:ci": "yarn run -T playwright test --config runtime/playwright.config.ts"
},
"dependencies": {
"@playwright/test": "1.46.1",
"@playwright/test": "1.47.0",
"@swc/core": "^1.7.24",
"@vkontakte/vkui": "workspace:packages/vkui",
"cli-table3": "^0.6.1",
Expand All @@ -19,12 +19,12 @@
"finalhandler": "1.3.0",
"html-webpack-plugin": "^5.5.0",
"mini-css-extract-plugin": "^2.9.1",
"playwright": "1.46.1",
"playwright": "1.47.0",
"postcss": "^8.4.45",
"postcss-modules": "^6.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"serve-static": "1.15.0",
"serve-static": "1.16.2",
"swc-loader": "^0.2.6",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.94.0"
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"devDependencies": {
"@csstools/postcss-global-data": "3.0.0",
"@playwright/experimental-ct-react": "1.46.1",
"@playwright/test": "1.46.1",
"@playwright/experimental-ct-react": "1.47.0",
"@playwright/test": "1.47.0",
"@size-limit/file": "^11.1.5",
"@size-limit/webpack": "^11.1.5",
"@size-limit/webpack-css": "^11.1.5",
Expand Down Expand Up @@ -46,11 +46,11 @@
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-compat": "^6.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-compiler": "0.0.0-experimental-17e519c-20240806",
"eslint-plugin-react-compiler": "0.0.0-experimental-56229e1-20240813",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-unicorn": "^55.0.0",
"husky": "^9.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/codemods/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Command } from 'commander';
import prompts from 'prompts';
import { autoDetectVKUIVersion } from './autoDetectVKUIVersion';
import getAvailableCodemods from './getAvailableCodemods.js';
import logger from './helpers/logger.js';
import pkg from '../package.json';
import logger from './helpers/logger.js';

export interface CliOptions {
list: boolean;
Expand Down
3 changes: 2 additions & 1 deletion packages/vkui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "6.6.0",
"version": "6.7.0",
"name": "@vkontakte/vkui",
"description": "VKUI library",
"main": "dist/cjs/index.js",
Expand All @@ -13,6 +13,7 @@
"!./src/**/*.*.ts",
"!./src/**/*.*.tsx",
"!./src/vkui.js",
"!./src/styles/missedThemeTokens.css",
"!./src/testing/",
"!./src/storybook/"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/package.swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"runtime": "automatic"
}
},
"target": "es2015",
"target": "es2017",

"experimental": {
"plugins": [
Expand Down
2 changes: 2 additions & 0 deletions packages/vkui/shared.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const COMPONENTS_DIR = `${SRC_DIR}/components`;
const STYLES_DIR = `${SRC_DIR}/styles`;
const CSS_CONSTANTS = `${STYLES_DIR}/constants.css`;
const CSS_DYNAMIC_TOKENS = `${STYLES_DIR}/dynamicTokens.css`;
const CSS_MISSED_THEME_TOKENS = `${STYLES_DIR}/missedThemeTokens.css`;
const CSS_CUSTOM_MEDIAS = `${STYLES_DIR}/customMedias.generated.css`;
const TYPES_DIR = `${SRC_DIR}/types`;
const TEST_UTILS_DIR = `${SRC_DIR}/testing`;
Expand All @@ -34,6 +35,7 @@ module.exports.PATHS = {
STYLES_DIR,
CSS_CONSTANTS,
CSS_DYNAMIC_TOKENS,
CSS_MISSED_THEME_TOKENS,
CSS_CUSTOM_MEDIAS,
TYPES_DIR,
TEST_UTILS_DIR,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions packages/vkui/src/components/Alert/Alert.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,30 @@ describe('Alert', () => {
});
expect(onClose).toHaveBeenCalledTimes(1);
});

it('should call onClose last', async () => {
const callOrder: Array<'action' | 'onClose'> = [];
const action = jest.fn().mockImplementation(() => callOrder.push('action'));
const onClose = jest.fn().mockImplementation(() => callOrder.push('onClose'));
const result = render(
<Alert
onClose={onClose}
actions={[
{
action,
'title': 'Item',
'data-testid': '__action__',
'mode': 'default',
},
]}
/>,
);
await userEvent.click(result.getByTestId('__action__'));
await waitCSSKeyframesAnimation(result.getByRole('alertdialog'), {
runOnlyPendingTimers: true,
});
expect(callOrder).toEqual(['action', 'onClose']);
});
});

describe('calls action after close by default', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ export const Alert = ({
closing ? 'exit' : 'enter',
{
onExited() {
onClose();
itemActionCallbackRef.current();
itemActionCallbackRef.current = noop;
onClose();
},
},
);
Expand Down
Loading

0 comments on commit cb22fef

Please sign in to comment.