Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import { storiesOf } from '@storybook/react';
import { createStats, createStatsSummary } from '@bundle-stats/utils';
import currentData from '../../../__mocks__/job.current.json';
import baselineData from '../../../__mocks__/job.baseline.json';
import { getWrapperDecorator } from '../../stories';
import { BundleAssetsTotalsChartBars as Component } from './bundle-assets-totals-chart-bars';
const currentStats = createStats(baselineData.rawData, currentData.rawData);
const baselineStats = createStats(null, baselineData.rawData);
const currentJob = {
...currentData,
stats: currentStats,
summary: createStatsSummary(baselineStats, currentStats),
};
const baselineJob = {
...baselineData,
stats: baselineStats,
summary: createStatsSummary(null, baselineStats),
};
const jobs = [currentJob, baselineJob];
const stories = storiesOf('Components/BundleAssetsTotalsChartBars', module);
import React from 'react';
import { storiesOf } from '@storybook/react';
import { createStats, createStatsSummary } from '@bundle-stats/utils';
import currentData from '../../../__mocks__/job.current.json';
import baselineData from '../../../__mocks__/job.baseline.json';
import { getWrapperDecorator } from '../../stories';
import { BundleAssetsTotalsChartPie as Component } from './bundle-assets-totals-chart-pie';
const currentStats = createStats(baselineData.rawData, currentData.rawData);
const baselineStats = createStats(null, baselineData.rawData);
const currentJob = {
...currentData,
stats: currentStats,
summary: createStatsSummary(baselineStats, currentStats),
};
const baselineJob = {
...baselineData,
stats: baselineStats,
summary: createStatsSummary(null, baselineStats),
};
const jobs = [currentJob, baselineJob];
})).reduce((agg, job) => {
const baseline = last(agg);
const stats = createStats(baseline && baseline.rawData, job.rawData);
const summary = createStatsSummary(baseline && baseline.stats, stats);
return [
...agg,
{
...job,
stats,
summary,
},
];
}, []);
import React from 'react';
import { storiesOf } from '@storybook/react';
import { createStats, createStatsSummary } from '@bundle-stats/utils';
import currentData from '../../../__mocks__/job.current.json';
import baselineData from '../../../__mocks__/job.baseline.json';
import { getWrapperDecorator } from '../../stories';
import { BundleModules } from './bundle-modules';
const currentStats = createStats(baselineData.rawData, currentData.rawData);
const baselineStats = createStats(null, baselineData.rawData);
const currentJob = {
...currentData,
stats: currentStats,
summary: createStatsSummary(baselineStats, currentStats),
};
const baselineJob = {
...baselineData,
stats: baselineStats,
summary: createStatsSummary(null, baselineStats),
};
const stories = storiesOf('Components/BundleModules', module);
stories.addDecorator(getWrapperDecorator());
import React from 'react';
import { storiesOf } from '@storybook/react';
import { createStats, createStatsSummary } from '@bundle-stats/utils';
import currentData from '../../../__mocks__/job.current.json';
import baselineData from '../../../__mocks__/job.baseline.json';
import { getWrapperDecorator } from '../../stories';
import { Summary } from '.';
const currentStats = createStats(baselineData.rawData, currentData.rawData);
const baselineStats = createStats(null, baselineData.rawData);
const currentJob = {
...currentData,
stats: currentStats,
summary: createStatsSummary(baselineStats, currentStats),
};
const stories = storiesOf('Components/Summary', module);
stories.addDecorator(getWrapperDecorator());
stories.add('default', () => (
<summary>
));
stories.add('loading', () => (</summary>
import React from 'react';
import { storiesOf } from '@storybook/react';
import { createStats, createStatsSummary } from '@bundle-stats/utils';
import browsertime from '../../../../../fixtures/browsertime.json';
import currentData from '../../../__mocks__/job.current.json';
import baselineData from '../../../__mocks__/job.baseline.json';
import { getWrapperDecorator } from '../../stories';
import { BrowsertimeTable } from '.';
const currentStats = createStats(baselineData.rawData, currentData.rawData);
const baselineStats = createStats(null, baselineData.rawData);
const currentJob = {
...currentData,
stats: currentStats,
summary: createStatsSummary(baselineStats, currentStats),
};
const baselineJob = {
...baselineData,
stats: baselineStats,
summary: createStatsSummary(null, baselineStats),
};
const stories = storiesOf('Components/BrowsertimeTable', module);
stories.addDecorator(getWrapperDecorator());
import React from 'react';
import { storiesOf } from '@storybook/react';
import { createStats, createStatsSummary } from '@bundle-stats/utils';
import browsertime from '../../../../../fixtures/browsertime.json';
import currentData from '../../../__mocks__/job.current.json';
import baselineData from '../../../__mocks__/job.baseline.json';
import { getWrapperDecorator } from '../../stories';
import { BrowsertimeTable } from '.';
const currentStats = createStats(baselineData.rawData, currentData.rawData);
const baselineStats = createStats(null, baselineData.rawData);
const currentJob = {
...currentData,
stats: currentStats,
summary: createStatsSummary(baselineStats, currentStats),
};
const baselineJob = {
...baselineData,
stats: baselineStats,
summary: createStatsSummary(null, baselineStats),
};
const stories = storiesOf('Components/BrowsertimeTable', module);
stories.addDecorator(getWrapperDecorator());
import React from 'react';
import { storiesOf } from '@storybook/react';
import { createStats } from '@bundle-stats/utils';
import currentData from '../../../__mocks__/job.current.json';
import baselineData from '../../../__mocks__/job.baseline.json';
import { getWrapperDecorator } from '../../stories';
import { BundleAssetsTotalsTable } from '.';
const currentJob = {
...currentData,
stats: createStats(baselineData.rawData, currentData.rawData),
};
const baselineJob = {
...baselineData,
stats: createStats(null, baselineData.rawData),
};
const stories = storiesOf('Components/BundleAssetsTotalsTable', module);
stories.addDecorator(getWrapperDecorator());
stories.add('default', () => (
));
stories.add('multiple jobs', () => (
import { storiesOf } from '@storybook/react';
import { createStats } from '@bundle-stats/utils';
import currentData from '../../../__mocks__/job.current.json';
import baselineData from '../../../__mocks__/job.baseline.json';
import { getWrapperDecorator } from '../../stories';
import { BundleAssetsTotalsTable } from '.';
const currentJob = {
...currentData,
stats: createStats(baselineData.rawData, currentData.rawData),
};
const baselineJob = {
...baselineData,
stats: createStats(null, baselineData.rawData),
};
const stories = storiesOf('Components/BundleAssetsTotalsTable', module);
stories.addDecorator(getWrapperDecorator());
stories.add('default', () => (
));
stories.add('multiple jobs', () => (
));
stories.add('empty baseline', () => (
));
import React from 'react';
import { storiesOf } from '@storybook/react';
import { createStats, createStatsSummary } from '@bundle-stats/utils';
import currentData from '../../../__mocks__/job.current.json';
import baselineData from '../../../__mocks__/job.baseline.json';
import { getWrapperDecorator } from '../../stories';
import { BundleModules } from './bundle-modules';
const currentStats = createStats(baselineData.rawData, currentData.rawData);
const baselineStats = createStats(null, baselineData.rawData);
const currentJob = {
...currentData,
stats: currentStats,
summary: createStatsSummary(baselineStats, currentStats),
};
const baselineJob = {
...baselineData,
stats: baselineStats,
summary: createStatsSummary(null, baselineStats),
};
const stories = storiesOf('Components/BundleModules', module);
stories.addDecorator(getWrapperDecorator());