size-limit
Advanced tools
Comparing version 4.5.5 to 4.5.6
module.exports = async function calc (plugins, config, createSpinner) { | ||
process.setMaxListeners(config.checks.reduce((a, i) => a + i.path.length, 1)) | ||
process.setMaxListeners(config.checks.reduce((a, i) => a + i.files.length, 1)) | ||
@@ -4,0 +4,0 @@ async function step (number) { |
@@ -77,2 +77,6 @@ let { green, red, yellow, bgRed, black, bold, gray } = require('colorette') | ||
if (check.files && !check.files.length && check.path) { | ||
print(yellow(`File not found: ${check.path}`)) | ||
} | ||
let sizeNote | ||
@@ -79,0 +83,0 @@ if (check.config) { |
@@ -92,3 +92,3 @@ let { isAbsolute, dirname, join, relative } = require('path') | ||
if (args.files.length > 0) { | ||
config.checks = [{ path: args.files }] | ||
config.checks = [{ files: args.files }] | ||
} else { | ||
@@ -113,10 +113,10 @@ let explorer = cosmiconfig('size-limit', { | ||
if (check.path) { | ||
check.path = await globby(check.path, { cwd: config.cwd }) | ||
check.files = await globby(check.path, { cwd: config.cwd }) | ||
} else if (!check.entry) { | ||
if (pkg.packageJson.main) { | ||
check.path = [ | ||
check.files = [ | ||
require.resolve(join(dirname(pkg.path), pkg.packageJson.main)) | ||
] | ||
} else { | ||
check.path = [join(dirname(pkg.path), 'index.js')] | ||
check.files = [join(dirname(pkg.path), 'index.js')] | ||
} | ||
@@ -133,3 +133,3 @@ } | ||
if (check.entry && !Array.isArray(check.entry)) check.entry = [check.entry] | ||
if (!check.name) check.name = toName(check.entry || check.path, config.cwd) | ||
if (!check.name) check.name = toName(check.entry || check.files, config.cwd) | ||
if (args.limit) check.limit = args.limit | ||
@@ -148,7 +148,9 @@ if (check.limit) { | ||
} | ||
if (check.path) check.path = check.path.map(i => toAbsolute(i, config.cwd)) | ||
if (check.files) { | ||
check.files = check.files.map(i => toAbsolute(i, config.cwd)) | ||
} | ||
if (check.config) check.config = toAbsolute(check.config, config.cwd) | ||
if (typeof check.import === 'string') { | ||
check.import = { | ||
[check.path[0]]: check.import | ||
[check.files[0]]: check.import | ||
} | ||
@@ -155,0 +157,0 @@ } |
@@ -15,3 +15,3 @@ let { Plugins } = require('./load-plugins') | ||
files = { | ||
checks: [{ path: files }] | ||
checks: [{ files }] | ||
} | ||
@@ -18,0 +18,0 @@ } |
{ | ||
"name": "size-limit", | ||
"version": "4.5.5", | ||
"version": "4.5.6", | ||
"description": "CLI tool for Size Limit", | ||
@@ -22,10 +22,10 @@ "keywords": [ | ||
"bytes": "^3.1.0", | ||
"chokidar": "^3.4.1", | ||
"chokidar": "^3.4.2", | ||
"ci-job-number": "^1.2.2", | ||
"colorette": "^1.2.1", | ||
"cosmiconfig": "^6.0.0", | ||
"cosmiconfig": "^7.0.0", | ||
"globby": "^11.0.1", | ||
"ora": "^4.0.4", | ||
"ora": "^5.0.0", | ||
"read-pkg-up": "^7.0.1" | ||
} | ||
} |
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
24662
693
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcosmiconfig@7.1.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-unicode-supported@0.1.0(transitive)
+ Addedlog-symbols@4.1.0(transitive)
+ Addedora@5.4.1(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedchalk@3.0.0(transitive)
- Removedcosmiconfig@6.0.0(transitive)
- Removedlog-symbols@3.0.0(transitive)
- Removedmute-stream@0.0.8(transitive)
- Removedora@4.1.1(transitive)
Updatedchokidar@^3.4.2
Updatedcosmiconfig@^7.0.0
Updatedora@^5.0.0