Skip to content

Commit

Permalink
fix: change cn workflow (#12)
Browse files Browse the repository at this point in the history
* fix: change cn workflow

* fix: ci jobs config
  • Loading branch information
korvin89 authored Jun 30, 2022
1 parent 796bdda commit aba5148
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 61 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ jobs:
- name: Typecheck
run: npm run typecheck

tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14.x'
cache: 'npm'
- name: Install Packages
run: npm ci
- name: Unit Tests
run: npm run test
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14.x'
cache: 'npm'
- name: Install Packages
run: npm ci
- name: Unit Tests
run: npm run test
5 changes: 3 additions & 2 deletions src/components/ChartKit.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import block from 'bem-cn-lite';
import {settings} from '../libs';
import {block, getRandomCKId} from '../utils';
import {getRandomCKId} from '../utils';
import type {ChartkitType, ChartKitProps} from '../types';
import {ErrorBoundary} from './ErrorBoundary/ErrorBoundary';
import {Loader} from './Loader/Loader';
Expand All @@ -9,7 +10,7 @@ import '@yandex-cloud/uikit/styles/styles.scss';
import '../styles/theme.scss';
import './ChartKit.scss';

const b = block();
const b = block('chartkit');

export const ChartKit = <T extends ChartkitType>(props: ChartKitProps<T>) => {
const {id = getRandomCKId(), type, data, onLoad, ...restProps} = props;
Expand Down
6 changes: 1 addition & 5 deletions src/components/ErrorView/ErrorView.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
@import '../../styles/variables';

$block: '.#{$ns}-error';

#{$block} {
.chartkit-error {
display: flex;
flex-direction: column;
width: 100%;
Expand Down
4 changes: 2 additions & 2 deletions src/components/ErrorView/ErrorView.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import block from 'bem-cn-lite';
import {dict} from '../../dict/dict';
import {settings} from '../../libs';
import {block} from '../../utils';

import './ErrorView.scss';

const b = block('error');
const b = block('chartkit-error');

export const ErrorView = () => {
const lang = settings.get('lang');
Expand Down
6 changes: 1 addition & 5 deletions src/components/Loader/Loader.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
@import '../../styles/variables';

$block: '.#{$ns}-loader';

#{$block} {
.chartkit-loader {
display: flex;
align-items: center;
justify-content: center;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Loader/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import block from 'bem-cn-lite';
import {Loader as BaseLoader, LoaderProps as BaseLoaderProps} from '@yandex-cloud/uikit';
import {block} from '../../utils';

import './Loader.scss';

const b = block('loader');
const b = block('chartkit-loader');

type LoaderProps = BaseLoaderProps;

Expand Down
13 changes: 0 additions & 13 deletions src/utils/__tests__/cn.test.ts

This file was deleted.

11 changes: 11 additions & 0 deletions src/utils/__tests__/common.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {getRandomCKId} from '../common';

// length of "ck." + 10 random symbols
const ID_LENGTH = 13;

describe('utils/getRandomCKId', () => {
it('Id should have 13 symbols', () => {
const result = getRandomCKId();
expect(result.length).toBe(ID_LENGTH);
});
});
13 changes: 0 additions & 13 deletions src/utils/cn.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export {getRandomCKId} from './common';
export {block} from './cn';
export type {CnBlock} from './cn';

0 comments on commit aba5148

Please sign in to comment.