size-limit
Advanced tools
Comparing version 4.10.0 to 4.10.1
@@ -55,4 +55,10 @@ module.exports = async function calc (plugins, config, createSpinner) { | ||
} | ||
if (check.files && !check.files.length && check.path) { | ||
check.missed = true | ||
check.sizeLimit = undefined | ||
check.timeLimit = undefined | ||
} | ||
} | ||
config.failed = config.checks.some(i => i.passed === false) | ||
config.missed = config.checks.some(i => i.missed === true) | ||
} |
@@ -39,2 +39,15 @@ let { | ||
function getFixText (prefix, config) { | ||
if (config.configPath) { | ||
if (config.configPath.endsWith('package.json')) { | ||
prefix += ` in ${bold('"size-limit"')} section of ` | ||
} else { | ||
prefix += ' at ' | ||
} | ||
prefix += bold(config.configPath) | ||
} | ||
return prefix | ||
} | ||
function createHumanReporter (process, isSilentMode = false) { | ||
@@ -95,4 +108,5 @@ function print (...lines) { | ||
if (check.files && !check.files.length && check.path) { | ||
print(yellow(`File not found: ${check.path}`)) | ||
if (check.missed) { | ||
print(red(`File not found: ${check.path}`)) | ||
continue | ||
} | ||
@@ -172,14 +186,11 @@ | ||
if (config.failed) { | ||
let fix = 'Try to reduce size or increase limit' | ||
if (config.configPath) { | ||
if (config.configPath.endsWith('package.json')) { | ||
fix += ` in ${bold('"size-limit"')} section of ` | ||
} else { | ||
fix += ' at ' | ||
} | ||
fix += bold(config.configPath) | ||
} | ||
let fix = getFixText('Try to reduce size or increase limit', config) | ||
print(yellow(fix)) | ||
} | ||
if (config.missed) { | ||
let fix = getFixText('Specify correct file path', config) | ||
print(yellow(fix)) | ||
} | ||
if (plugins.has('webpack') && config.saveBundle) { | ||
@@ -186,0 +197,0 @@ let statsFilepath = join(config.saveBundle, 'stats.json') |
{ | ||
"name": "size-limit", | ||
"version": "4.10.0", | ||
"version": "4.10.1", | ||
"description": "CLI tool for Size Limit", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -89,3 +89,3 @@ let readPkgUp = require('read-pkg-up') | ||
if (config.failed && !args.why) process.exit(1) | ||
if ((config.failed || config.missed) && !args.why) process.exit(1) | ||
} catch (e) { | ||
@@ -92,0 +92,0 @@ debug.error(process, args, config) |
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
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
27275
771