@bundle-stats/html-templates
Advanced tools
Comparing version 1.15.1 to 2.0.0-beta.1
@@ -15,5 +15,5 @@ module.exports = { | ||
'Fixtures/(.*)$': '<rootDir>/../../fixtures/$1', | ||
'@bundle-stats/(.*)/lib-esm': '@bundle-stats/$1/lib', | ||
'@bundle-stats/(.*)/lib-esm/(.*)': '@bundle-stats/$1/lib/$2', | ||
}, | ||
testEnvironment: 'node', | ||
}; |
{ | ||
"name": "@bundle-stats/html-templates", | ||
"version": "1.15.1", | ||
"version": "2.0.0-beta.1", | ||
"description": "HTML templates for report generation.", | ||
@@ -9,3 +9,2 @@ "main": "dist/index.html", | ||
"lint": "eslint . --ext .jsx,.js --cache --cache-location ./node_modules/.eslintcache", | ||
"prepublishOnly": "npm run lint && npm test && npm run build", | ||
"start": "cross-env NODE_ENV=development start-storybook -p 8090 -c build/storybook", | ||
@@ -35,4 +34,4 @@ "test": "jest build/storybook" | ||
"@babel/preset-react": "7.7.4", | ||
"@bundle-stats/ui": "^1.15.1", | ||
"@bundle-stats/utils": "^1.15.1", | ||
"@bundle-stats/ui": "^2.0.0-beta.1", | ||
"@bundle-stats/utils": "^2.0.0-beta.1", | ||
"@moonwalker/orbit-ui": "1.14.7", | ||
@@ -85,3 +84,4 @@ "@relative-ci/agent": "1.2.0", | ||
"whatwg-fetch": "3.0.0" | ||
} | ||
}, | ||
"gitHead": "f09d6d46d53efceeac4d4dbfd5285fc23e49cb56" | ||
} |
import PropTypes from 'prop-types'; | ||
import { createStatsSummary } from '@bundle-stats/utils'; | ||
import { Box } from '@bundle-stats/ui/lib-esm/ui/box'; | ||
@@ -37,11 +36,2 @@ import { Container } from '@bundle-stats/ui/lib-esm/ui/container'; | ||
const getSummaryData = (jobs) => { | ||
if (jobs.length <= 2) { | ||
return jobs[0].summary; | ||
} | ||
return createStatsSummary(jobs[jobs.length - 1].stats, jobs[0].stats); | ||
}; | ||
const StandaloneApp = ({ jobs }) => { | ||
@@ -69,3 +59,3 @@ if (jobs.length === 0) { | ||
<Summary | ||
data={getSummaryData(jobs)} | ||
data={jobs[0].summary} | ||
showSummaryItemDelta={jobs.length !== 1} | ||
@@ -75,5 +65,5 @@ showSummaryItemBaselineValue={jobs.length !== 1} | ||
</Container> | ||
{warnings && warnings.duplicatePackages && ( | ||
{warnings && warnings.webpack && warnings.webpack.duplicatePackages && ( | ||
<Container> | ||
<DuplicatePackagesWarning duplicatePackages={warnings.duplicatePackages} /> | ||
<DuplicatePackagesWarning duplicatePackages={warnings.webpack.duplicatePackages} /> | ||
</Container> | ||
@@ -150,2 +140,3 @@ )} | ||
warnings: PropTypes.object, | ||
summary: PropTypes.object, | ||
})), | ||
@@ -152,0 +143,0 @@ }; |
@@ -12,11 +12,13 @@ /* global module */ | ||
const JOBS = createJobs([ | ||
{ webpack: { stats: currentData.rawData.webpack.stats } }, | ||
{ webpack: { stats: baselineData.rawData.webpack.stats } }, | ||
{ webpack: currentData.rawData.webpack }, | ||
{ webpack: baselineData.rawData.webpack }, | ||
]); | ||
const MULTIPLE_JOBS = createJobs([ | ||
{ webpack: currentData.rawData.webpack }, | ||
{ webpack: baselineData.rawData.webpack }, | ||
{ | ||
webpack: { | ||
stats: { | ||
...baselineData.rawData.webpack.stats, | ||
assets: baselineData.rawData.webpack.stats.assets.filter((asset) => asset.name.match(/.(css|js)$/)), | ||
modules: baselineData.rawData.webpack.stats.modules.slice(0, 100), | ||
}, | ||
...baselineData.rawData.webpack, | ||
assets: baselineData.rawData.webpack.assets.filter((asset) => asset.name.match(/.(css|js)$/)), | ||
modules: baselineData.rawData.webpack.modules.slice(0, 100), | ||
}, | ||
@@ -56,3 +58,3 @@ }, | ||
stories.add('multiple baselines', () => ( | ||
<StandaloneApp jobs={JOBS} /> | ||
<StandaloneApp jobs={MULTIPLE_JOBS} /> | ||
)); | ||
@@ -59,0 +61,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
407454
466
1