Skip to content
Draft
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
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ jobs:
fail-fast: false
matrix:
variant:
- default
- alfasans
env:
CORE_COMPONENTS_VARIANT: ${{ matrix.variant }}
runs-on: ubuntu-latest
Expand All @@ -183,6 +183,11 @@ jobs:
with:
lfs: true

- name: Setup variant
uses: ./.github/actions/setup-variant
with:
variant: ${{ matrix.variant }}

- name: Setup CI
uses: ./.github/actions/ci-setup

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/pull-request-update-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:
description: Variant of core components
required: false
type: choice
default: default
default: alfasans
options:
- default
- alfasans

concurrency:
group: ${{ github.workflow }}-${{ inputs.pull-request }}-${{ inputs.variant }}
Expand Down Expand Up @@ -80,6 +80,11 @@ jobs:
token: ${{ steps.generate-token.outputs.token }}
lfs: true

- name: Setup variant
uses: ./.github/actions/setup-variant
with:
variant: ${{ inputs.variant }}

- name: Setup CI
uses: ./.github/actions/ci-setup

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/update-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ on:
description: Variant of core components
required: false
type: choice
default: default
default: alfasans
options:
- default
- alfasans

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.variant }}
Expand Down Expand Up @@ -47,6 +47,11 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
lfs: true

- name: Setup variant
uses: ./.github/actions/setup-variant
with:
variant: ${{ inputs.variant }}

- name: Setup CI
uses: ./.github/actions/ci-setup

Expand Down
6 changes: 3 additions & 3 deletions bin/run-screenshots-local.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

PLAYWRIGHT_VERSION=1.33.0
CONTAINER_NAME='playwright-'$PLAYWRIGHT_VERSION'-local'
PLAYWRIGHT_VERSION=1.60.0
CONTAINER_NAME="playwright-$PLAYWRIGHT_VERSION-local"

check_error () {
if [ ! "$?" -eq "0" ]
Expand All @@ -14,7 +14,7 @@ check_error () {
if [ ! "$(docker ps -a -q -f name=^/${CONTAINER_NAME}$)" ]
then
# Если контейнера нет, то создаем новый
docker run --name $CONTAINER_NAME -d -it --network=host --env STORYBOOK_URL=http://host.docker.internal:9009/iframe.html --ipc=host -v "$(pwd)":/core-components -w /core-components mcr.microsoft.com/playwright:v$PLAYWRIGHT_VERSION-jammy
docker run --name $CONTAINER_NAME -d -it --network=host --env STORYBOOK_URL=http://host.docker.internal:9009/iframe.html --ipc=host -v "$(pwd)":/core-components -w /core-components mcr.microsoft.com/playwright:v$PLAYWRIGHT_VERSION-noble
check_error
docker exec $CONTAINER_NAME bash -c "apt-get update; apt-get install fonts-inter -y; fc-cache -f"

Expand Down
6 changes: 3 additions & 3 deletions bin/run-screenshots.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

PLAYWRIGHT_VERSION=1.33.0
CONTAINER_NAME='playwright-'$PLAYWRIGHT_VERSION''
PLAYWRIGHT_VERSION=1.60.0
CONTAINER_NAME="playwright-$PLAYWRIGHT_VERSION"

check_error () {
if [ ! "$?" -eq "0" ]
Expand All @@ -21,7 +21,7 @@ fi
if [ ! "$(docker ps -a -q -f name=^/${CONTAINER_NAME}$)" ]
then
# Если контейнера нет, то создаем новый
docker run --name $CONTAINER_NAME -d -it --ipc=host -v "$(pwd)":/core-components -w /core-components mcr.microsoft.com/playwright:v$PLAYWRIGHT_VERSION-jammy
docker run --name $CONTAINER_NAME -d -it --ipc=host -v "$(pwd)":/core-components -w /core-components mcr.microsoft.com/playwright:v$PLAYWRIGHT_VERSION-noble
check_error
docker exec $CONTAINER_NAME bash -c "apt-get update; apt-get install fonts-inter -y; fc-cache -f"

Expand Down
21 changes: 9 additions & 12 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

/* eslint-disable import/no-extraneous-dependencies */

import fse from 'fs-extra';
import { defineConfig } from 'jest';
import path from 'node:path';
import * as process from 'node:process';
import slash from 'slash';
import { createJsWithTsEsmPreset, pathsToModuleNameMapper } from 'ts-jest';

import { resolveInternal } from './tools/resolve-internal.cjs';

const tsconfig = await fse.readJson(path.join(import.meta.dirname, 'tsconfig.test.json'), {
encoding: 'utf8',
});
import tsconfig from './tsconfig.test.json' with { type: 'json' };

const IGNORED_PACKAGES = ['@alfalab/core-components-codemod'];

Expand Down Expand Up @@ -72,10 +70,7 @@ const [initialProjectOptions] = [
},
];

/**
* @type {import('ts-jest').JestConfigWithTsJest}
*/
const config = {
export default defineConfig({
projects: [
{
...initialProjectOptions,
Expand All @@ -96,6 +91,8 @@ const config = {
},
],
coverageReporters: ['lcov', 'text', 'text-summary', 'clover'],
};

export default config;
reporters:
process.env.CI === 'true'
? [['github-actions', { silent: false }], 'summary']
: ['default'],
});
21 changes: 8 additions & 13 deletions jest.screenshots.config.mjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
// @ts-check

/* eslint-disable import/no-extraneous-dependencies */
import fse from 'fs-extra';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'jest';
import { createJsWithTsLegacyPreset, pathsToModuleNameMapper } from 'ts-jest';

const dirname = path.dirname(fileURLToPath(import.meta.url));

const tsconfig = fse.readJsonSync(path.join(dirname, 'tsconfig.test.json'), { encoding: 'utf8' });
import tsconfig from './tsconfig.test.json' with { type: 'json' };

const tsJestPreset = createJsWithTsLegacyPreset({ tsconfig: '<rootDir>/tsconfig.test.json' });

/**
* @type {import('ts-jest').JestConfigWithTsJest}
*/
const config = {
export default defineConfig({
...tsJestPreset,
testEnvironment: 'node',
setupFilesAfterEnv: ['<rootDir>/tools/jest/setupScreenshotsTests.ts'],
Expand All @@ -27,6 +20,8 @@ const config = {
testMatch: ['**/*.screenshots.test.ts?(x)'],
maxWorkers: 5,
testTimeout: 200000,
};

export default config;
reporters:
process.env.CI === 'true'
? [['github-actions', { silent: false }], 'summary']
: ['default'],
});
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@
"@storybook/react": "^7.6.2",
"@storybook/react-webpack5": "^7.6.2",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.7.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.6.1",
"@types/detect-browser": "^4.0.3",
"@types/element-closest": "^3.0.0",
"@types/eslint": "^8.56.12",
"@types/jest": "^30.0.0",
"@types/jest-image-snapshot": "^6.4.0",
"@types/jest-image-snapshot": "^6.4.1",
"@types/lodash": "^4.17.13",
"@types/lodash.throttle": "^4.1.7",
"@types/micromatch": "^4.0.9",
Expand Down Expand Up @@ -135,14 +135,14 @@
"http-server": "^0.12.3",
"husky": "^4.3.8",
"identity-obj-proxy": "^3.0.0",
"jest": "^30.0.5",
"jest-environment-jsdom": "^30.0.5",
"jest-environment-node": "^30.0.5",
"jest-image-snapshot": "^6.5.1",
"jest": "^30.4.2",
"jest-environment-jsdom": "^30.4.1",
"jest-environment-node": "^30.4.1",
"jest-image-snapshot": "^6.5.2",
"lint-staged": "^16.1.0",
"micromatch": "^4.0.8",
"mini-css-extract-plugin": "^2.9.2",
"playwright": "^1.33.0",
"playwright": "^1.60.0",
"postcss": "^8.5.3",
"postcss-color-mod-function": "^4.1.1",
"postcss-custom-media": "^8.0.2",
Expand Down Expand Up @@ -175,7 +175,7 @@
"stylelint": "^16.24.0",
"svgo": "^3.0.2",
"tinyglobby": "^0.2.14",
"ts-jest": "^29.4.1",
"ts-jest": "^29.4.11",
"typescript": "~5.5.4",
"ui-primitives": "^35.3.0",
"webpack": "^5.98.0",
Expand Down
Loading
Loading