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
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"unit:clear": "jest --clearCache",
"build:css": "cross-env NODE_ENV=buildProduction postcss src/**/*.css --base src --dir dist/__internal__/src/",
"build:js": "cross-env NODE_ENV=buildProduction BUILDING_JS=true babel --extensions .ts,.tsx --config-file ./babel.config.js --source-maps --out-dir dist/__internal__/src/ ./src",
"build:types": "cross-env NODE_ENV=buildProduction tsc --declaration --outDir dist/__internal__/src/ --emitDeclarationOnly -p tsconfig.build.json",
"build:types": "cross-env NODE_ENV=buildProduction tsc --declaration --outDir dist/__internal__/src/ --emitDeclarationOnly -p tsconfig.build.json && node ./scripts/copy.js --src=./tsconfig.json --dest=./dist/__internal__/tsconfig.json && tsconfig-replace-paths -p ./dist/__internal__/tsconfig.json -s ./dist/__internal__ -o ./dist/__internal__ && node ./scripts/rm.js --path=./dist/__internal__/tsconfig.json",
"build:package.json": "node scripts/prepare-package-json.js",
"build:reexports": "node scripts/generateReExports.js --config=scripts/generateReExportsConfig.js",
"build:copy-assets": "node scripts/copyAssets.js",
Expand Down Expand Up @@ -50,13 +50,14 @@
],
"peerDependencies": {
"@amcharts/amcharts4-geodata": "4.1.9",
"@consta/icons": "^1.0.0",
"@consta/uikit": "^5.0.0",
"@consta/icons": "^1.5.0",
"@consta/uikit": "^5.28.0",
"@evless/react-textfit": "1.1.1",
"@types/d3": "5.7.2",
"@types/resize-observer-browser": "0.1.2",
"compute-scroll-into-view": "^3.1.1",
"d3": "5.12.0",
"date-fns": "2.9.0",
"date-fns": "^2.30.0",
"react-dnd": "9.3.2",
"react-dnd-html5-backend": "9.3.2",
"react-uid": "2.2.0"
Expand Down Expand Up @@ -106,19 +107,18 @@
"@bem-react/classnames": "^1.3.10",
"@bem/sdk.naming.cell.match": "^0.1.3",
"@bem/sdk.naming.presets": "^0.2.3",
"@consta/stand": "^0.0.150",
"@consta/uikit": "^5.0.0",
"@consta/stand": "^0.0.160",
"@mdx-js/loader": "^2.1.5",
"@oclif/command": "^1.8.16",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.0.0",
"@testing-library/react-hooks": "^7.0.2",
"@types/jest": "^27.4.1",
"@types/node": "^22.14.1",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@types/react-transition-group": "^4.4.5",
"@types/node": "^16.7.13",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-transition-group": "^4.4.12",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
"autoprefixer": "^10.4.4",
Expand All @@ -132,7 +132,6 @@
"camelcase": "^6.2.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
"commitizen": "^4.2.5",
"compute-scroll-into-view": "^1.0.17",
"cross-env": "^7.0.3",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.4.1",
Expand Down Expand Up @@ -201,6 +200,7 @@
"terser-webpack-plugin": "^5.2.5",
"ts-jest": "^28.0.7",
"ts-loader": "^9.2.8",
"tsconfig-replace-paths": "^0.0.14",
"typescript": "^5.8.3",
"typescript-eslint-parser": "^22.0.0",
"typescript-transform-paths": "^3.3.1",
Expand Down
49 changes: 49 additions & 0 deletions scripts/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const { copy } = require('fs-extra');

const { Command, flags } = require('@oclif/command');
const logSymbols = require('log-symbols');
const { remove } = require('fs-extra');

class GenerateCommand extends Command {
async safeInvokeHook(hook) {
if (hook !== undefined) {
if (typeof hook === 'function') {
this.log(`start executing ${hook.name}`);
await hook();
this.log(`finish executing ${hook.name}`);
} else {
this.error(`${hook.name} should be function!`);
}
}
}

async run() {
const hrstart = process.hrtime();
const { flags } = this.parse(GenerateCommand);

try {
await copy(flags.src, flags.dest, {
recursive: !!flags.recursive,
overwrite: !!flags.overwrite,
});
} catch (err) {
this.error(err);
}

const hrend = process.hrtime(hrstart);

this.log(logSymbols.success, `${flags.src} is copied!`);
this.log(`Execution time: ${hrend[0]}s`);
}
}

GenerateCommand.flags = {
src: flags.string(),
dest: flags.string(),
recursive: flags.boolean(),
overwrite: flags.boolean(),
};

GenerateCommand.description = 'removing file...';

GenerateCommand.run();
6 changes: 3 additions & 3 deletions src/components/CoreBarChart/renders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type RenderGroupsLabels = (props: {
showGroupsLabels?: boolean;
getGridAreaName: (index: number) => string;
formatGroupName?: FormatGroupName;
}) => React.ReactElement | null;
}) => React.ReactNode | null;

export const defaultRenderGroupsLabels: RenderGroupsLabels = ({ ...rest }) => {
return <CoreBarChartTicks {...rest} isLabel />;
Expand All @@ -36,7 +36,7 @@ export type RenderAxisValues = (props: {
position: Position;
formatValueForLabel?: FormatValue;
showGroupsLabels?: boolean;
}) => React.ReactElement | null;
}) => React.ReactNode | null;

export const defaultRenderAxisValues: RenderAxisValues = ({ ...rest }) => {
return <CoreBarChartTicks {...rest} />;
Expand Down Expand Up @@ -65,7 +65,7 @@ export type RenderGroup<T> = (props: {
getNumberGridTicks: (length: number) => void;
gridDomain: NumberRange;
limitMinimumStepSize?: boolean;
}) => React.ReactElement | null;
}) => React.ReactNode | null;

export const defaultRenderGroup: RenderGroup<GroupItem> = (props) => (
<CoreBarChartGroup {...props} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Legend/Legend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Props<ITEM> = PropsWithHTMLAttributesAndRef<
HTMLDivElement
>;

type Legend = <ITEM>(props: Props<ITEM>) => React.ReactElement | null;
type Legend = <ITEM>(props: Props<ITEM>) => React.ReactNode | null;

export const Legend: Legend = React.forwardRef((props, ref) => {
const {
Expand Down
2 changes: 1 addition & 1 deletion src/components/LegendItem/LegendItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type CommonProps = {

type LegendItem = (
props: PropsWithHTMLAttributesAndRef<CommonProps, HTMLDivElement>,
) => React.ReactElement | null;
) => React.ReactNode | null;

export const LegendItem: LegendItem = React.forwardRef((props, ref) => {
const {
Expand Down
3 changes: 1 addition & 2 deletions src/components/Stats/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TextPropSize } from '@consta/uikit/Text';
import { ReactElement } from 'react';

import { IconSize } from '##/utils/consta';

Expand All @@ -15,7 +14,7 @@ export type Status = typeof statuses[number];
export const iconsArrowRate = ['up', 'down', 'auto'] as const;
export type IconArrowRate = typeof iconsArrowRate[number];

export type IconTitle = (props: { size: IconSize }) => ReactElement | null;
export type IconTitle = (props: { size: IconSize }) => React.ReactNode | null;

export type FormatRate = (value: string) => string;

Expand Down
Loading
Loading