Socket
Socket
Sign inDemoInstall

size-limit

Package Overview
Dependencies
Maintainers
1
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

size-limit - npm Package Compare versions

Comparing version 4.10.0 to 4.10.1

6

calc.js

@@ -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)
}

33

create-reporter.js

@@ -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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc