Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ on:
branches: [main, next]
pull_request:

concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
verify_files:
name: Verify Files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
Expand All @@ -34,14 +36,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: 'npm'
- name: Install Packages
run: npm ci
- name: Unit Tests
- uses: ./.github/actions/setup-playwright
- name: Tests
run: npm run test
2 changes: 0 additions & 2 deletions .github/workflows/main-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v6
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr-preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: PR Preview Build
on:
pull_request:

concurrency:
group: preview-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
build:
name: Build
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ on:
types:
- opened
- synchronize
- reopened
- edited

concurrency:
group: ${{github.workflow}}-${{github.ref}}
group: title-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/pr-visual-tests-report.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/pr-visual-tests.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- name: Install Packages
run: npm ci
- name: Lint Files
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Test
run: npm test
- name: Bump version
run: |
echo ${{ github.event.inputs.version }}
Expand Down
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ dist
storybook-static
.cache

# Playwright
playwright-report
playwright-report-docker
playwright/.cache-docker
playwright/.cache/
test-results
# Tests
reports

# System files
.DS_Store

.vitest-*
50 changes: 3 additions & 47 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,18 @@
import {defineMain} from '@storybook/react-webpack5/node';
import * as sass from 'sass';
import {defineMain} from '@storybook/react-vite/node';

export default defineMain({
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(ts|tsx)'],
addons: [
'@storybook/addon-docs',
'@storybook/addon-a11y',
import.meta.resolve('./theme-addon/theme-preset.ts'),
'@storybook/addon-webpack5-compiler-babel',
{
name: '@storybook/addon-styling-webpack',
options: {
rules: [
{
test: /\.css$/,
sideEffects: true,
use: ['style-loader', 'css-loader'],
},
{
test: /\.scss$/,
sideEffects: true,
use: [
'style-loader',
{
loader: 'css-loader',
options: {importLoaders: 1},
},
{
loader: 'sass-loader',
options: {implementation: sass},
},
],
},
],
},
},
'@storybook/addon-vitest',
],
framework: '@storybook/react-webpack5',
framework: {name: '@storybook/react-vite', options: {strictMode: true}},
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
},
core: {
disableTelemetry: true,
},
babel: {
presets: [
[
'@babel/preset-env',
{
targets: {
chrome: 100,
},
},
],
'@babel/preset-typescript',
['@babel/preset-react', {runtime: 'automatic'}],
],
},
});
2 changes: 1 addition & 1 deletion .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {addons} from 'storybook/manager-api';

import {themes} from './theme';
import {themes} from './theme.js';

addons.setConfig({
theme: themes.light,
Expand Down
48 changes: 28 additions & 20 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,34 @@ import '@gravity-ui/uikit/styles/fonts.scss';
// eslint-disable-next-line import/order
import '@gravity-ui/uikit/styles/styles.css';

import React from 'react';

import {settings} from '@gravity-ui/date-utils';
import {MobileProvider, ThemeProvider, ToasterComponent, ToasterProvider} from '@gravity-ui/uikit';
import {toaster} from '@gravity-ui/uikit/toaster-singleton';
import addonDocs from '@storybook/addon-docs';
import type {Decorator} from '@storybook/react-webpack5';
import {definePreview} from '@storybook/react-webpack5';
import type {Decorator} from '@storybook/react-vite';
import {definePreview} from '@storybook/react-vite';
import {MINIMAL_VIEWPORTS} from 'storybook/viewport';

import {DocsDecorator} from '../src/demo/DocsDecorator/DocsDecorator';
import {DocsDecorator} from '../src/demo/DocsDecorator/DocsDecorator.js';

import {themes} from './theme';

settings.loadLocale('ru');

const WithContextProvider: Decorator = (Story, context) => {
return (
<React.StrictMode>
<ThemeProvider
theme={context.globals.theme}
direction={context.globals.direction}
lang={context.globals.lang}
>
<MobileProvider mobile={context.globals.platform === 'mobile'}>
<ToasterProvider toaster={toaster}>
<Story {...context} />
<ToasterComponent />
</ToasterProvider>
</MobileProvider>
</ThemeProvider>
</React.StrictMode>
<ThemeProvider
theme={context.globals.theme}
direction={context.globals.direction}
lang={context.globals.lang}
>
<MobileProvider mobile={context.globals.platform === 'mobile'}>
<ToasterProvider toaster={toaster}>
<Story {...context} />
<ToasterComponent />
</ToasterProvider>
</MobileProvider>
</ThemeProvider>
);
};

Expand All @@ -45,16 +41,28 @@ export default definePreview({
theme: themes.light,
container: DocsDecorator,
codePanel: true,
source: {excludeDecorators: false},
},
jsx: {showFunctions: false}, // Do not show functions in sources

// Do not show functions in sources
jsx: {showFunctions: false},

viewport: {
options: MINIMAL_VIEWPORTS,
},

options: {
storySort: {
method: 'alphabetical',
},
},

a11y: {
// 'todo' - show a11y violations in the test UI only
// 'error' - fail CI on a11y violations
// 'off' - skip a11y checks entirely
test: 'todo',
},
},
decorators: [WithContextProvider],
globalTypes: {
Expand Down
10 changes: 10 additions & 0 deletions .storybook/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {beforeAll, expect} from 'vitest';
import type {ExpectStatic} from 'vitest';

declare global {
var vitestExpect: ExpectStatic | undefined;
}

beforeAll(() => {
globalThis.vitestExpect = expect;
});
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
const config = {
extends: ['@commitlint/config-conventional'],
};
module.exports = config;
export default config;
Loading
Loading