From 2308d4a379c6b28bd2639304108b7161676c0eaa Mon Sep 17 00:00:00 2001 From: cenfun Date: Fri, 15 Mar 2024 19:47:08 +0800 Subject: [PATCH 01/22] feat: support monocart report --- README.md | 7 ++ lib/commands/report.js | 7 ++ lib/monocart-report.js | 165 +++++++++++++++++++++++++ lib/parse-args.js | 5 + package-lock.json | 112 ++++++++++++++++- package.json | 1 + test/integration.js | 124 +++++++++++++++++++ test/integration.js.snap | 252 ++++++++++++++++++++++++++++++++++++++- 8 files changed, 661 insertions(+), 12 deletions(-) create mode 100644 lib/monocart-report.js diff --git a/README.md b/README.md index a266a1da..8cbf277f 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Here is a list of common options. Run `c8 --help` for the full list and document | `--per-file` | check thresholds per file | `boolean` | `false` | | `--temp-directory` | directory V8 coverage data is written to and read from | `string` | `process.env.NODE_V8_COVERAGE` | | `--clean` | should temp files be deleted before script execution | `boolean` | `true` | +| `--experimental-monocart` | see [section below](#using-monocart-coverage-reports-experimental) for more info | `boolean` | `false` | ## Checking for "full" source coverage using `--all` @@ -119,6 +120,12 @@ The `--100` flag can be set for the `check-coverage` as well: c8 check-coverage --100 ``` +## Using Monocart coverage reports (experimental) +[Monocart](https://github.com/cenfun/monocart-coverage-reports) will bring additional support for native V8 coverage reports, for example: +```sh +c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js +``` + ## Ignoring Uncovered Lines, Functions, and Blocks Sometimes you might find yourself wanting to ignore uncovered portions of your diff --git a/lib/commands/report.js b/lib/commands/report.js index 7bdc48c3..65e571eb 100644 --- a/lib/commands/report.js +++ b/lib/commands/report.js @@ -1,5 +1,6 @@ const { checkCoverages } = require('./check-coverage') const Report = require('../report') +const monocartReport = require('../monocart-report') exports.command = 'report' @@ -18,6 +19,12 @@ exports.outputReport = async function (argv) { argv.branches = 100 argv.statements = 100 } + + if (argv.experimentalMonocart || process.env.EXPERIMENTAL_MONOCART) { + await monocartReport(argv) + return + } + const report = Report({ include: argv.include, exclude: argv.exclude, diff --git a/lib/monocart-report.js b/lib/monocart-report.js new file mode 100644 index 00000000..914d2ac2 --- /dev/null +++ b/lib/monocart-report.js @@ -0,0 +1,165 @@ +const Exclude = require('test-exclude') +const path = require('path') +const { fileURLToPath } = require('url') + +const { CoverageReport } = require('monocart-coverage-reports') + +module.exports = async (argv) => { + // console.log(argv); + const exclude = new Exclude({ + exclude: argv.exclude, + include: argv.include, + extension: argv.extension, + relativePath: !argv.allowExternal, + excludeNodeModules: argv.excludeNodeModules + }) + + // adapt coverage options + const coverageOptions = getCoverageOptions(argv, exclude) + const coverageReport = new CoverageReport(coverageOptions) + coverageReport.cleanCache() + + // read v8 coverage data from tempDirectory + await coverageReport.addFromDir(argv.tempDirectory) + + // generate report + await coverageReport.generate() +} + +function getReports (argv) { + const reports = Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter] + const reporterOptions = argv.reporterOptions || {} + + return reports.map((reportName) => { + const reportOptions = { + ...reporterOptions[reportName] + } + if (reportName === 'text') { + reportOptions.skipEmpty = false + reportOptions.skipFull = argv.skipFull + reportOptions.maxCols = process.stdout.columns || 100 + } + return [reportName, reportOptions] + }) +} + +// --all: add empty coverage for all files +function getAllOptions (argv, exclude) { + if (!argv.all) { + return + } + + const src = argv.src + const workingDirs = Array.isArray(src) ? src : (typeof src === 'string' ? [src] : [process.cwd()]) + return { + dir: workingDirs, + filter: (filePath) => { + return exclude.shouldInstrument(filePath) + } + } +} + +function getEntryFilter (argv, exclude) { + if (argv.entryFilter) { + return argv.entryFilter + } + return (entry) => { + return exclude.shouldInstrument(fileURLToPath(entry.url)) + } +} + +function getSourceFilter (argv, exclude) { + if (argv.sourceFilter) { + return argv.sourceFilter + } + return (sourcePath) => { + if (argv.excludeAfterRemap) { + // console.log(sourcePath) + return exclude.shouldInstrument(sourcePath) + } + return true + } +} + +function getCoverageOptions (argv, exclude) { + const reports = getReports(argv) + const allOptions = getAllOptions(argv, exclude) + + return { + logging: argv.logging, + name: argv.name, + inline: argv.inline, + lcov: argv.lcov, + outputDir: argv.reportsDir, + clean: argv.clean, + + reports, + all: allOptions, + + // use default value for istanbul + defaultSummarizer: 'pkg', + + entryFilter: getEntryFilter(argv, exclude), + + sourceFilter: getSourceFilter(argv, exclude), + + // sourcePath: (filePath) => { + // return path.resolve(filePath); + // }, + + onEnd: (coverageResults) => { + // console.log(`Coverage report generated: ${coverageResults.reportPath}`); + + if (!argv.checkCoverage) { + return + } + + // check thresholds + const thresholds = {} + const metrics = ['bytes', 'statements', 'branches', 'functions', 'lines'] + metrics.forEach((k) => { + if (argv[k]) { + thresholds[k] = argv[k] + } + }) + + const { summary, files } = coverageResults + + if (argv.perFile) { + files.forEach((file) => { + checkCoverage(file.summary, thresholds, file) + }) + } else { + checkCoverage(summary, thresholds) + } + } + } +} + +function checkCoverage (summary, thresholds, file) { + if (file && file.empty) { + process.exitCode = 1 + console.error( + 'ERROR: Empty coverage (untested file) does not meet threshold for ' + + path.relative('./', file.sourcePath).replace(/\\/g, '/') + ) + return + } + Object.keys(thresholds).forEach(key => { + const coverage = summary[key].pct + if (typeof coverage !== 'number') { + return + } + if (coverage < thresholds[key]) { + process.exitCode = 1 + if (file) { + console.error( + 'ERROR: Coverage for ' + key + ' (' + coverage + '%) does not meet threshold (' + thresholds[key] + '%) for ' + + path.relative('./', file.sourcePath).replace(/\\/g, '/') // standardize path for Windows. + ) + } else { + console.error('ERROR: Coverage for ' + key + ' (' + coverage + '%) does not meet global threshold (' + thresholds[key] + '%)') + } + } + }) +} diff --git a/lib/parse-args.js b/lib/parse-args.js index 21a9cd7a..86199a2f 100644 --- a/lib/parse-args.js +++ b/lib/parse-args.js @@ -158,6 +158,11 @@ function buildYargs (withCommands = false) { describe: 'supplying --merge-async will merge all v8 coverage reports asynchronously and incrementally. ' + 'This is to avoid OOM issues with Node.js runtime.' }) + .option('experimental-monocart', { + default: false, + type: 'boolean', + describe: 'Using Monocart coverage reports' + }) .pkgConf('c8') .demandCommand(1) .check((argv) => { diff --git a/package-lock.json b/package-lock.json index 2c60c943..342a901f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", + "monocart-coverage-reports": "^2.7.2", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", @@ -670,6 +671,11 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/console-grid": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", + "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==" + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -817,6 +823,11 @@ "node": ">=6.0.0" } }, + "node_modules/eight-colors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", + "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==" + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -2399,9 +2410,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -2688,6 +2699,11 @@ "node": ">=10" } }, + "node_modules/lz-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", + "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==" + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -2858,6 +2874,39 @@ "node": ">=10" } }, + "node_modules/monocart-code-viewer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.2.tgz", + "integrity": "sha512-Yy9lpw8uG9NdxCrfRlVWmk3FPULWw21sn0TPbKCKvMNxl28hZHAfJOfDq4yRmkZQ9LL6QkLcTscQloAchxI5Vg==" + }, + "node_modules/monocart-coverage-reports": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.2.tgz", + "integrity": "sha512-gaaHSE7MDj96lnvSmOtRcnO1yOuQnll0w8afHRQA3dWLP4x2B1V9fjdiURAsIHB1u3NPXFqHixa4a1ZqTDH9uQ==", + "workspaces": [ + "packages/*", + "test" + ], + "dependencies": { + "console-grid": "^2.2.2", + "eight-colors": "^1.3.0", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.7", + "lz-utils": "^2.0.2", + "monocart-code-viewer": "^1.1.2", + "monocart-formatter": "^2.3.2", + "turbogrid": "^3.0.13" + }, + "bin": { + "mcr": "lib/cli.js" + } + }, + "node_modules/monocart-formatter": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-2.3.2.tgz", + "integrity": "sha512-Dr25minOW8yN6UVLP+6EHtJB0oHWimrssPUsPgfkBbSYUdQAnNZHltgHhST+EUNHI3Bl7uVwcIerL/kuBAoWYQ==" + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4209,6 +4258,11 @@ "strip-bom": "^3.0.0" } }, + "node_modules/turbogrid": { + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.0.13.tgz", + "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -5071,6 +5125,11 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "console-grid": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", + "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==" + }, "convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -5176,6 +5235,11 @@ "esutils": "^2.0.2" } }, + "eight-colors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", + "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==" + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -6319,9 +6383,9 @@ } }, "istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "requires": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -6559,6 +6623,11 @@ "yallist": "^4.0.0" } }, + "lz-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", + "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==" + }, "make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -6684,6 +6753,32 @@ } } }, + "monocart-code-viewer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.2.tgz", + "integrity": "sha512-Yy9lpw8uG9NdxCrfRlVWmk3FPULWw21sn0TPbKCKvMNxl28hZHAfJOfDq4yRmkZQ9LL6QkLcTscQloAchxI5Vg==" + }, + "monocart-coverage-reports": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.2.tgz", + "integrity": "sha512-gaaHSE7MDj96lnvSmOtRcnO1yOuQnll0w8afHRQA3dWLP4x2B1V9fjdiURAsIHB1u3NPXFqHixa4a1ZqTDH9uQ==", + "requires": { + "console-grid": "^2.2.2", + "eight-colors": "^1.3.0", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.7", + "lz-utils": "^2.0.2", + "monocart-code-viewer": "^1.1.2", + "monocart-formatter": "^2.3.2", + "turbogrid": "^3.0.13" + } + }, + "monocart-formatter": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-2.3.2.tgz", + "integrity": "sha512-Dr25minOW8yN6UVLP+6EHtJB0oHWimrssPUsPgfkBbSYUdQAnNZHltgHhST+EUNHI3Bl7uVwcIerL/kuBAoWYQ==" + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -7652,6 +7747,11 @@ "strip-bom": "^3.0.0" } }, + "turbogrid": { + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.0.13.tgz", + "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==" + }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 59446446..0ce33fd9 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", + "monocart-coverage-reports": "^2.7.2", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", diff --git a/test/integration.js b/test/integration.js index d4aaeb13..99723c00 100644 --- a/test/integration.js +++ b/test/integration.js @@ -685,6 +685,7 @@ beforeEach(function () { c8Path, '--all', '--exclude="test/*.js"', + '--exclude="tmp/monocart-*/**/*.js"', '--extension=.js', '--extension=.special', '--temp-directory=tmp/extension', @@ -696,5 +697,128 @@ beforeEach(function () { output.toString('utf8').should.matchSnapshot() }) }) + + describe('monocart report', () => { + it('monocart check normal', () => { + const { output } = spawnSync(nodePath, [ + c8Path, + '--experimental-monocart', + '--exclude="test/*.js"', + '--temp-directory=tmp/monocart-normal', + '--reports-dir=tmp/monocart-normal-reports', + '--reporter=v8', + '--reporter=console-details', + '--clean=false', + `--merge-async=${mergeAsync}`, + nodePath, + require.resolve('./fixtures/normal') + ]) + output.toString('utf8').should.matchSnapshot() + }) + + it('monocart check all', () => { + const { output } = spawnSync(nodePath, [ + c8Path, + '--experimental-monocart', + '--temp-directory=tmp/monocart-vanilla-all', + '--reports-dir=tmp/monocart-vanilla-all-reports', + '--reporter=v8', + '--reporter=console-details', + '--all', + '--include=test/fixtures/all/vanilla/**/*.js', + '--exclude=**/*.ts', + '--clean=false', + `--merge-async=${mergeAsync}`, + nodePath, + require.resolve('./fixtures/all/vanilla/main') + ]) + output.toString('utf8').should.matchSnapshot() + }) + + it('monocart check coverage', () => { + const { output, status } = spawnSync(nodePath, [ + c8Path, + '--experimental-monocart', + '--exclude="test/*.js"', + '--temp-directory=tmp/monocart-check-coverage', + '--reports-dir=tmp/monocart-check-coverage-reports', + '--reporter=v8', + '--reporter=console-details', + '--check-coverage', + '--statements=80', + '--branches=80', + '--lines=80', + '--clean=false', + `--merge-async=${mergeAsync}`, + nodePath, + require.resolve('./fixtures/normal') + ]) + status.should.equal(1) + output.toString('utf8').should.matchSnapshot() + }) + + it('monocart check coverage pre file', () => { + const { output, status } = spawnSync(nodePath, [ + c8Path, + '--experimental-monocart', + '--exclude="test/*.js"', + '--temp-directory=tmp/monocart-check-per-file', + '--reports-dir=tmp/monocart-check-per-file-reports', + '--reporter=v8', + '--reporter=console-details', + '--check-coverage', + '--statements=80', + '--branches=80', + '--lines=80', + '--per-file', + '--clean=false', + `--merge-async=${mergeAsync}`, + nodePath, + require.resolve('./fixtures/normal') + ]) + status.should.equal(1) + output.toString('utf8').should.matchSnapshot() + }) + + it('monocart check all and 100', () => { + const { output, status } = spawnSync(nodePath, [ + c8Path, + '--experimental-monocart', + '--temp-directory=tmp/monocart-all-100', + '--reports-dir=tmp/monocart-all-100-reports', + '--reporter=v8', + '--reporter=console-details', + '--all', + '--100', + '--per-file', + '--include=test/fixtures/all/vanilla/**/*.js', + '--exclude=**/*.ts', + '--clean=false', + `--merge-async=${mergeAsync}`, + nodePath, + require.resolve('./fixtures/all/vanilla/main') + ]) + status.should.equal(1) + output.toString('utf8').should.matchSnapshot() + }) + + it('check sourcemap', () => { + const { output } = spawnSync(nodePath, [ + c8Path, + '--experimental-monocart', + '--exclude="test/*.js"', + '--temp-directory=tmp/monocart-source-map', + '--reports-dir=tmp/monocart-source-map-reports', + '--reporter=v8', + '--reporter=text', + '--exclude-after-remap', + '--clean=false', + `--merge-async=${mergeAsync}`, + nodePath, + require.resolve('./fixtures/source-maps/branches/branches.typescript.js') + ]) + output.toString('utf8').should.matchSnapshot() + }) + }) }) }) diff --git a/test/integration.js.snap b/test/integration.js.snap index a9279c7e..8b3e4d6c 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -156,7 +156,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.52 | 12.5 | 6.52 | 3.52 | +All files | 3.17 | 12.24 | 6.38 | 3.17 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -166,12 +166,13 @@ All files | 3.52 | 12.5 | 6.52 | 3.52 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | - parse-args.js | 0 | 0 | 0 | 0 | 1-224 + monocart-report.js | 0 | 0 | 0 | 0 | 1-165 + parse-args.js | 0 | 0 | 0 | 0 | 1-229 report.js | 0 | 0 | 0 | 0 | 1-402 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 - report.js | 0 | 0 | 0 | 0 | 1-43 + report.js | 0 | 0 | 0 | 0 | 1-50 c8/test/fixtures | 30.97 | 37.5 | 21.42 | 30.97 | async.js | 100 | 100 | 100 | 100 | c8-ignore-next.js | 54.54 | 0 | 0 | 54.54 | 1,3-4,9,12,17-19,21-22 @@ -521,7 +522,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.52 | 12.5 | 6.52 | 3.52 | +All files | 3.17 | 12.24 | 6.38 | 3.17 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -531,12 +532,13 @@ All files | 3.52 | 12.5 | 6.52 | 3.52 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | - parse-args.js | 0 | 0 | 0 | 0 | 1-224 + monocart-report.js | 0 | 0 | 0 | 0 | 1-165 + parse-args.js | 0 | 0 | 0 | 0 | 1-229 report.js | 0 | 0 | 0 | 0 | 1-402 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 - report.js | 0 | 0 | 0 | 0 | 1-43 + report.js | 0 | 0 | 0 | 0 | 1-50 c8/test/fixtures | 30.97 | 37.5 | 21.42 | 30.97 | async.js | 100 | 100 | 100 | 100 | c8-ignore-next.js | 54.54 | 0 | 0 | 54.54 | 1,3-4,9,12,17-19,21-22 @@ -745,6 +747,125 @@ All files | 100 | 100 | 100 | 100 | ," `; +exports[`c8 mergeAsync monocart report check sourcemap 1`] = ` +",reachable +a = true +a = false +------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +------------------------|---------|----------|---------|---------|------------------- +All files | 82.35 | 70 | 100 | 81.25 | + branches.typescript.ts | 82.35 | 70 | 100 | 81.25 | 7,11,18 +------------------------|---------|----------|---------|---------|------------------- +," +`; + +exports[`c8 mergeAsync monocart report monocart check all 1`] = ` +",zero +positive +negative +┌───────────────────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures/all/vanilla │ │ │ │ │ │ │ +│ ├ dir │ │ │ │ │ │ │ +│ │ └ unloaded.js │ 0.00 % │ 0.00 % │ │ 0.00 % │ 0.00 % │ 1-5 │ +│ ├ main.js │ 100.00 % │ 100.00 % │ │ │ 100.00 % │ │ +│ └ loaded.js │ 80.41 % │ 80.00 % │ 75.00 % │ 100.00 % │ 68.42 % │ 3-5,16-18 │ +├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 65.64 % │ 70.59 % │ 75.00 % │ 50.00 % │ 62.96 % │ │ +└───────────────────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +," +`; + +exports[`c8 mergeAsync monocart report monocart check all and 100 1`] = ` +",zero +positive +negative +┌───────────────────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures/all/vanilla │ │ │ │ │ │ │ +│ ├ dir │ │ │ │ │ │ │ +│ │ └ unloaded.js │ 0.00 % │ 0.00 % │ │ 0.00 % │ 0.00 % │ 1-5 │ +│ ├ main.js │ 100.00 % │ 100.00 % │ │ │ 100.00 % │ │ +│ └ loaded.js │ 80.41 % │ 80.00 % │ 75.00 % │ 100.00 % │ 68.42 % │ 3-5,16-18 │ +├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 65.64 % │ 70.59 % │ 75.00 % │ 50.00 % │ 62.96 % │ │ +└───────────────────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +,ERROR: Empty coverage (untested file) does not meet threshold for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for lines (68.42%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +" +`; + +exports[`c8 mergeAsync monocart report monocart check coverage 1`] = ` +",hey +i am a line of code +what +hey +what +hey +what +hey +┌───────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures │ │ │ │ │ │ │ +│ ├ normal.js │ 77.99 % │ 83.33 % │ 62.50 % │ 33.33 % │ 70.59 % │ 9,14-20 │ +│ └ async.js │ 100.00 % │ 100.00 % │ │ 100.00 % │ 100.00 % │ │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ +└───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +,ERROR: Coverage for branches (62.5%) does not meet global threshold (80%) +" +`; + +exports[`c8 mergeAsync monocart report monocart check coverage pre file 1`] = ` +",hey +i am a line of code +what +hey +what +hey +what +hey +┌───────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures │ │ │ │ │ │ │ +│ ├ normal.js │ 77.99 % │ 83.33 % │ 62.50 % │ 33.33 % │ 70.59 % │ 9,14-20 │ +│ └ async.js │ 100.00 % │ 100.00 % │ │ 100.00 % │ 100.00 % │ │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ +└───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +,ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js +ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +" +`; + +exports[`c8 mergeAsync monocart report monocart check normal 1`] = ` +",hey +i am a line of code +what +hey +what +hey +what +hey +┌───────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures │ │ │ │ │ │ │ +│ ├ normal.js │ 77.99 % │ 83.33 % │ 62.50 % │ 33.33 % │ 70.59 % │ 9,14-20 │ +│ └ async.js │ 100.00 % │ 100.00 % │ │ 100.00 % │ 100.00 % │ │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ +└───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +," +`; + exports[`c8 mergeAsync report generates report from existing temporary files 1`] = ` ",-----------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s @@ -1017,6 +1138,125 @@ All files | 100 | 100 | 100 | 100 | ," `; +exports[`c8 monocart report check sourcemap 1`] = ` +",reachable +a = true +a = false +------------------------|---------|----------|---------|---------|------------------- +File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s +------------------------|---------|----------|---------|---------|------------------- +All files | 82.35 | 70 | 100 | 81.25 | + branches.typescript.ts | 82.35 | 70 | 100 | 81.25 | 7,11,18 +------------------------|---------|----------|---------|---------|------------------- +," +`; + +exports[`c8 monocart report monocart check all 1`] = ` +",zero +positive +negative +┌───────────────────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures/all/vanilla │ │ │ │ │ │ │ +│ ├ dir │ │ │ │ │ │ │ +│ │ └ unloaded.js │ 0.00 % │ 0.00 % │ │ 0.00 % │ 0.00 % │ 1-5 │ +│ ├ main.js │ 100.00 % │ 100.00 % │ │ │ 100.00 % │ │ +│ └ loaded.js │ 80.41 % │ 80.00 % │ 75.00 % │ 100.00 % │ 68.42 % │ 3-5,16-18 │ +├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 65.64 % │ 70.59 % │ 75.00 % │ 50.00 % │ 62.96 % │ │ +└───────────────────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +," +`; + +exports[`c8 monocart report monocart check all and 100 1`] = ` +",zero +positive +negative +┌───────────────────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures/all/vanilla │ │ │ │ │ │ │ +│ ├ dir │ │ │ │ │ │ │ +│ │ └ unloaded.js │ 0.00 % │ 0.00 % │ │ 0.00 % │ 0.00 % │ 1-5 │ +│ ├ main.js │ 100.00 % │ 100.00 % │ │ │ 100.00 % │ │ +│ └ loaded.js │ 80.41 % │ 80.00 % │ 75.00 % │ 100.00 % │ 68.42 % │ 3-5,16-18 │ +├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 65.64 % │ 70.59 % │ 75.00 % │ 50.00 % │ 62.96 % │ │ +└───────────────────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +,ERROR: Empty coverage (untested file) does not meet threshold for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for lines (68.42%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +" +`; + +exports[`c8 monocart report monocart check coverage 1`] = ` +",hey +i am a line of code +what +hey +what +hey +what +hey +┌───────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures │ │ │ │ │ │ │ +│ ├ normal.js │ 77.99 % │ 83.33 % │ 62.50 % │ 33.33 % │ 70.59 % │ 9,14-20 │ +│ └ async.js │ 100.00 % │ 100.00 % │ │ 100.00 % │ 100.00 % │ │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ +└───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +,ERROR: Coverage for branches (62.5%) does not meet global threshold (80%) +" +`; + +exports[`c8 monocart report monocart check coverage pre file 1`] = ` +",hey +i am a line of code +what +hey +what +hey +what +hey +┌───────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures │ │ │ │ │ │ │ +│ ├ normal.js │ 77.99 % │ 83.33 % │ 62.50 % │ 33.33 % │ 70.59 % │ 9,14-20 │ +│ └ async.js │ 100.00 % │ 100.00 % │ │ 100.00 % │ 100.00 % │ │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ +└───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +,ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js +ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +" +`; + +exports[`c8 monocart report monocart check normal 1`] = ` +",hey +i am a line of code +what +hey +what +hey +what +hey +┌───────────────┬──────────┬────────────┬──────────┬───────────┬──────────┬─────────────────┐ +│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ test/fixtures │ │ │ │ │ │ │ +│ ├ normal.js │ 77.99 % │ 83.33 % │ 62.50 % │ 33.33 % │ 70.59 % │ 9,14-20 │ +│ └ async.js │ 100.00 % │ 100.00 % │ │ 100.00 % │ 100.00 % │ │ +├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ +│ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ +└───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ +," +`; + exports[`c8 report generates report from existing temporary files 1`] = ` ",-----------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s From caae21ff88e757f8668fe6a674ddd31385fff753 Mon Sep 17 00:00:00 2001 From: cenfun Date: Sun, 17 Mar 2024 15:52:15 +0800 Subject: [PATCH 02/22] Update version 2.7.3 --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 342a901f..64f9a241 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.7.2", + "monocart-coverage-reports": "^2.7.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", @@ -2880,9 +2880,9 @@ "integrity": "sha512-Yy9lpw8uG9NdxCrfRlVWmk3FPULWw21sn0TPbKCKvMNxl28hZHAfJOfDq4yRmkZQ9LL6QkLcTscQloAchxI5Vg==" }, "node_modules/monocart-coverage-reports": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.2.tgz", - "integrity": "sha512-gaaHSE7MDj96lnvSmOtRcnO1yOuQnll0w8afHRQA3dWLP4x2B1V9fjdiURAsIHB1u3NPXFqHixa4a1ZqTDH9uQ==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.3.tgz", + "integrity": "sha512-5l9zn9aV+9ORBzmwAuqXD55x7v5sN7ICVS2YllG/G5PizUJMjhl54sHXTbqOw0DQS8WYkHkSztqEcmlnmFCmzQ==", "workspaces": [ "packages/*", "test" @@ -6759,9 +6759,9 @@ "integrity": "sha512-Yy9lpw8uG9NdxCrfRlVWmk3FPULWw21sn0TPbKCKvMNxl28hZHAfJOfDq4yRmkZQ9LL6QkLcTscQloAchxI5Vg==" }, "monocart-coverage-reports": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.2.tgz", - "integrity": "sha512-gaaHSE7MDj96lnvSmOtRcnO1yOuQnll0w8afHRQA3dWLP4x2B1V9fjdiURAsIHB1u3NPXFqHixa4a1ZqTDH9uQ==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.3.tgz", + "integrity": "sha512-5l9zn9aV+9ORBzmwAuqXD55x7v5sN7ICVS2YllG/G5PizUJMjhl54sHXTbqOw0DQS8WYkHkSztqEcmlnmFCmzQ==", "requires": { "console-grid": "^2.2.2", "eight-colors": "^1.3.0", diff --git a/package.json b/package.json index 0ce33fd9..30804a36 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.7.2", + "monocart-coverage-reports": "^2.7.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", From 1a7d020e654481e2da1be3c3ed054bf90fcb3397 Mon Sep 17 00:00:00 2001 From: cenfun Date: Wed, 8 May 2024 20:06:11 +0800 Subject: [PATCH 03/22] 2.7.10 --- package-lock.json | 61 +++++++++++++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 64f9a241..6303360e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.7.3", + "monocart-coverage-reports": "^2.7.10", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", @@ -2875,14 +2875,14 @@ } }, "node_modules/monocart-code-viewer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.2.tgz", - "integrity": "sha512-Yy9lpw8uG9NdxCrfRlVWmk3FPULWw21sn0TPbKCKvMNxl28hZHAfJOfDq4yRmkZQ9LL6QkLcTscQloAchxI5Vg==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", + "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" }, "node_modules/monocart-coverage-reports": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.3.tgz", - "integrity": "sha512-5l9zn9aV+9ORBzmwAuqXD55x7v5sN7ICVS2YllG/G5PizUJMjhl54sHXTbqOw0DQS8WYkHkSztqEcmlnmFCmzQ==", + "version": "2.7.10", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.10.tgz", + "integrity": "sha512-mh2MhJcnwxEew6Uje2qeUv5xG4NKVMNcr+Hv1m069+P9kS6Koz9oEqbC3whLJNkUjMWwNOVh0hdMXhT/SdqD1g==", "workspaces": [ "packages/*", "test" @@ -2894,8 +2894,9 @@ "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.7", "lz-utils": "^2.0.2", - "monocart-code-viewer": "^1.1.2", - "monocart-formatter": "^2.3.2", + "monocart-code-viewer": "^1.1.3", + "monocart-formatter": "^3.0.0", + "monocart-locator": "^1.0.0", "turbogrid": "^3.0.13" }, "bin": { @@ -2903,9 +2904,17 @@ } }, "node_modules/monocart-formatter": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-2.3.2.tgz", - "integrity": "sha512-Dr25minOW8yN6UVLP+6EHtJB0oHWimrssPUsPgfkBbSYUdQAnNZHltgHhST+EUNHI3Bl7uVwcIerL/kuBAoWYQ==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", + "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==", + "workspaces": [ + "packages/*" + ] + }, + "node_modules/monocart-locator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", + "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==" }, "node_modules/ms": { "version": "2.1.3", @@ -6754,14 +6763,14 @@ } }, "monocart-code-viewer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.2.tgz", - "integrity": "sha512-Yy9lpw8uG9NdxCrfRlVWmk3FPULWw21sn0TPbKCKvMNxl28hZHAfJOfDq4yRmkZQ9LL6QkLcTscQloAchxI5Vg==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", + "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" }, "monocart-coverage-reports": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.3.tgz", - "integrity": "sha512-5l9zn9aV+9ORBzmwAuqXD55x7v5sN7ICVS2YllG/G5PizUJMjhl54sHXTbqOw0DQS8WYkHkSztqEcmlnmFCmzQ==", + "version": "2.7.10", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.10.tgz", + "integrity": "sha512-mh2MhJcnwxEew6Uje2qeUv5xG4NKVMNcr+Hv1m069+P9kS6Koz9oEqbC3whLJNkUjMWwNOVh0hdMXhT/SdqD1g==", "requires": { "console-grid": "^2.2.2", "eight-colors": "^1.3.0", @@ -6769,15 +6778,21 @@ "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.7", "lz-utils": "^2.0.2", - "monocart-code-viewer": "^1.1.2", - "monocart-formatter": "^2.3.2", + "monocart-code-viewer": "^1.1.3", + "monocart-formatter": "^3.0.0", + "monocart-locator": "^1.0.0", "turbogrid": "^3.0.13" } }, "monocart-formatter": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-2.3.2.tgz", - "integrity": "sha512-Dr25minOW8yN6UVLP+6EHtJB0oHWimrssPUsPgfkBbSYUdQAnNZHltgHhST+EUNHI3Bl7uVwcIerL/kuBAoWYQ==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", + "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==" + }, + "monocart-locator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", + "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==" }, "ms": { "version": "2.1.3", diff --git a/package.json b/package.json index 30804a36..2712b9e2 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.7.3", + "monocart-coverage-reports": "^2.7.10", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", From 4e856a20f4748bb845721f01bc2906addc79a912 Mon Sep 17 00:00:00 2001 From: cenfun Date: Mon, 10 Jun 2024 14:38:14 +0800 Subject: [PATCH 04/22] better integration into the report.js --- lib/commands/report.js | 10 +-- lib/monocart-report.js | 165 --------------------------------------- lib/report.js | 130 +++++++++++++++++++++++++++++- package-lock.json | 14 ++-- package.json | 2 +- test/integration.js.snap | 38 ++++----- 6 files changed, 159 insertions(+), 200 deletions(-) delete mode 100644 lib/monocart-report.js diff --git a/lib/commands/report.js b/lib/commands/report.js index 65e571eb..ec6e7fcc 100644 --- a/lib/commands/report.js +++ b/lib/commands/report.js @@ -1,6 +1,5 @@ const { checkCoverages } = require('./check-coverage') const Report = require('../report') -const monocartReport = require('../monocart-report') exports.command = 'report' @@ -19,12 +18,6 @@ exports.outputReport = async function (argv) { argv.branches = 100 argv.statements = 100 } - - if (argv.experimentalMonocart || process.env.EXPERIMENTAL_MONOCART) { - await monocartReport(argv) - return - } - const report = Report({ include: argv.include, exclude: argv.exclude, @@ -43,7 +36,8 @@ exports.outputReport = async function (argv) { src: argv.src, skipFull: argv.skipFull, excludeNodeModules: argv.excludeNodeModules, - mergeAsync: argv.mergeAsync + mergeAsync: argv.mergeAsync, + monocartArgv: (argv.experimentalMonocart || process.env.EXPERIMENTAL_MONOCART) ? argv : null }) await report.run() if (argv.checkCoverage) await checkCoverages(argv, report) diff --git a/lib/monocart-report.js b/lib/monocart-report.js deleted file mode 100644 index 914d2ac2..00000000 --- a/lib/monocart-report.js +++ /dev/null @@ -1,165 +0,0 @@ -const Exclude = require('test-exclude') -const path = require('path') -const { fileURLToPath } = require('url') - -const { CoverageReport } = require('monocart-coverage-reports') - -module.exports = async (argv) => { - // console.log(argv); - const exclude = new Exclude({ - exclude: argv.exclude, - include: argv.include, - extension: argv.extension, - relativePath: !argv.allowExternal, - excludeNodeModules: argv.excludeNodeModules - }) - - // adapt coverage options - const coverageOptions = getCoverageOptions(argv, exclude) - const coverageReport = new CoverageReport(coverageOptions) - coverageReport.cleanCache() - - // read v8 coverage data from tempDirectory - await coverageReport.addFromDir(argv.tempDirectory) - - // generate report - await coverageReport.generate() -} - -function getReports (argv) { - const reports = Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter] - const reporterOptions = argv.reporterOptions || {} - - return reports.map((reportName) => { - const reportOptions = { - ...reporterOptions[reportName] - } - if (reportName === 'text') { - reportOptions.skipEmpty = false - reportOptions.skipFull = argv.skipFull - reportOptions.maxCols = process.stdout.columns || 100 - } - return [reportName, reportOptions] - }) -} - -// --all: add empty coverage for all files -function getAllOptions (argv, exclude) { - if (!argv.all) { - return - } - - const src = argv.src - const workingDirs = Array.isArray(src) ? src : (typeof src === 'string' ? [src] : [process.cwd()]) - return { - dir: workingDirs, - filter: (filePath) => { - return exclude.shouldInstrument(filePath) - } - } -} - -function getEntryFilter (argv, exclude) { - if (argv.entryFilter) { - return argv.entryFilter - } - return (entry) => { - return exclude.shouldInstrument(fileURLToPath(entry.url)) - } -} - -function getSourceFilter (argv, exclude) { - if (argv.sourceFilter) { - return argv.sourceFilter - } - return (sourcePath) => { - if (argv.excludeAfterRemap) { - // console.log(sourcePath) - return exclude.shouldInstrument(sourcePath) - } - return true - } -} - -function getCoverageOptions (argv, exclude) { - const reports = getReports(argv) - const allOptions = getAllOptions(argv, exclude) - - return { - logging: argv.logging, - name: argv.name, - inline: argv.inline, - lcov: argv.lcov, - outputDir: argv.reportsDir, - clean: argv.clean, - - reports, - all: allOptions, - - // use default value for istanbul - defaultSummarizer: 'pkg', - - entryFilter: getEntryFilter(argv, exclude), - - sourceFilter: getSourceFilter(argv, exclude), - - // sourcePath: (filePath) => { - // return path.resolve(filePath); - // }, - - onEnd: (coverageResults) => { - // console.log(`Coverage report generated: ${coverageResults.reportPath}`); - - if (!argv.checkCoverage) { - return - } - - // check thresholds - const thresholds = {} - const metrics = ['bytes', 'statements', 'branches', 'functions', 'lines'] - metrics.forEach((k) => { - if (argv[k]) { - thresholds[k] = argv[k] - } - }) - - const { summary, files } = coverageResults - - if (argv.perFile) { - files.forEach((file) => { - checkCoverage(file.summary, thresholds, file) - }) - } else { - checkCoverage(summary, thresholds) - } - } - } -} - -function checkCoverage (summary, thresholds, file) { - if (file && file.empty) { - process.exitCode = 1 - console.error( - 'ERROR: Empty coverage (untested file) does not meet threshold for ' + - path.relative('./', file.sourcePath).replace(/\\/g, '/') - ) - return - } - Object.keys(thresholds).forEach(key => { - const coverage = summary[key].pct - if (typeof coverage !== 'number') { - return - } - if (coverage < thresholds[key]) { - process.exitCode = 1 - if (file) { - console.error( - 'ERROR: Coverage for ' + key + ' (' + coverage + '%) does not meet threshold (' + thresholds[key] + '%) for ' + - path.relative('./', file.sourcePath).replace(/\\/g, '/') // standardize path for Windows. - ) - } else { - console.error('ERROR: Coverage for ' + key + ' (' + coverage + '%) does not meet global threshold (' + thresholds[key] + '%)') - } - } - }) -} diff --git a/lib/report.js b/lib/report.js index a69a5595..85df6cb4 100644 --- a/lib/report.js +++ b/lib/report.js @@ -16,6 +16,7 @@ const getSourceMapFromFile = require('./source-map-from-file') const v8toIstanbul = require('v8-to-istanbul') const util = require('util') const debuglog = util.debuglog('c8') +const { CoverageReport } = require('monocart-coverage-reports') class Report { constructor ({ @@ -36,7 +37,8 @@ class Report { allowExternal = false, skipFull, excludeNodeModules, - mergeAsync + mergeAsync, + monocartArgv }) { this.reporter = reporter this.reporterOptions = reporterOptions || {} @@ -60,6 +62,7 @@ class Report { this.src = this._getSrc(src) this.skipFull = skipFull this.mergeAsync = mergeAsync + this.monocartArgv = monocartArgv } _getSrc (src) { @@ -73,6 +76,9 @@ class Report { } async run () { + if (this.monocartArgv) { + return this.runMonocart() + } const context = libReport.createContext({ dir: this.reportsDirectory, watermarks: this.watermarks, @@ -89,6 +95,128 @@ class Report { } } + async runMonocart () { + const argv = this.monocartArgv + const exclude = this.exclude + + function getEntryFilter () { + if (argv.entryFilter) { + return argv.entryFilter + } + if (argv.filter) { + return argv.filter + } + return (entry) => { + return exclude.shouldInstrument(fileURLToPath(entry.url)) + } + } + + function getSourceFilter () { + if (argv.sourceFilter) { + return argv.sourceFilter + } + if (argv.filter) { + return argv.filter + } + return (sourcePath) => { + if (argv.excludeAfterRemap) { + // console.log(sourcePath) + return exclude.shouldInstrument(sourcePath) + } + return true + } + } + + function getReports () { + const reports = Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter] + const reporterOptions = argv.reporterOptions || {} + + return reports.map((reportName) => { + const reportOptions = { + ...reporterOptions[reportName] + } + if (reportName === 'text') { + reportOptions.skipEmpty = false + reportOptions.skipFull = argv.skipFull + reportOptions.maxCols = process.stdout.columns || 100 + } + return [reportName, reportOptions] + }) + } + + // --all: add empty coverage for all files + function getAllOptions () { + if (!argv.all) { + return + } + + const src = argv.src + const workingDirs = Array.isArray(src) ? src : (typeof src === 'string' ? [src] : [process.cwd()]) + return { + dir: workingDirs, + filter: (filePath) => { + return exclude.shouldInstrument(filePath) + } + } + } + + function initPct (summary) { + Object.keys(summary).forEach(k => { + if (summary[k].pct === '') { + summary[k].pct = 100 + } + }) + return summary + } + + // adapt coverage options + const coverageOptions = { + logging: argv.logging, + name: argv.name, + inline: argv.inline, + lcov: argv.lcov, + outputDir: argv.reportsDir, + clean: argv.clean, + + reports: getReports(), + all: getAllOptions(), + + // use default value for istanbul + defaultSummarizer: 'pkg', + + entryFilter: getEntryFilter(), + sourceFilter: getSourceFilter(), + + onEnd: (coverageResults) => { + // for check coverage + this._allCoverageFiles = { + files: () => { + return coverageResults.files.map(it => it.sourcePath) + }, + fileCoverageFor: (file) => { + const fileCoverage = coverageResults.files.find(it => it.sourcePath === file) + return { + toSummary: () => { + return initPct(fileCoverage.summary) + } + } + }, + getCoverageSummary: () => { + return initPct(coverageResults.summary) + } + } + } + } + const coverageReport = new CoverageReport(coverageOptions) + coverageReport.cleanCache() + + // read v8 coverage data from tempDirectory + await coverageReport.addFromDir(argv.tempDirectory) + + // generate report + await coverageReport.generate() + } + async getCoverageMapFromAllCoverageFiles () { // the merge process can be very expensive, and it's often the case that // check-coverage is called immediately after a report. We memoize the diff --git a/package-lock.json b/package-lock.json index 6303360e..737ec9f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.7.10", + "monocart-coverage-reports": "^2.8.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", @@ -2880,9 +2880,9 @@ "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" }, "node_modules/monocart-coverage-reports": { - "version": "2.7.10", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.10.tgz", - "integrity": "sha512-mh2MhJcnwxEew6Uje2qeUv5xG4NKVMNcr+Hv1m069+P9kS6Koz9oEqbC3whLJNkUjMWwNOVh0hdMXhT/SdqD1g==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", + "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", "workspaces": [ "packages/*", "test" @@ -6768,9 +6768,9 @@ "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" }, "monocart-coverage-reports": { - "version": "2.7.10", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.10.tgz", - "integrity": "sha512-mh2MhJcnwxEew6Uje2qeUv5xG4NKVMNcr+Hv1m069+P9kS6Koz9oEqbC3whLJNkUjMWwNOVh0hdMXhT/SdqD1g==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", + "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", "requires": { "console-grid": "^2.2.2", "eight-colors": "^1.3.0", diff --git a/package.json b/package.json index 2712b9e2..3b4c9015 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.7.10", + "monocart-coverage-reports": "^2.8.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", diff --git a/test/integration.js.snap b/test/integration.js.snap index 8b3e4d6c..1c7e17ca 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -156,7 +156,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.17 | 12.24 | 6.38 | 3.17 | +All files | 3.25 | 12.5 | 6.52 | 3.25 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -166,13 +166,12 @@ All files | 3.17 | 12.24 | 6.38 | 3.17 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | - monocart-report.js | 0 | 0 | 0 | 0 | 1-165 parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-402 + report.js | 0 | 0 | 0 | 0 | 1-530 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 - report.js | 0 | 0 | 0 | 0 | 1-50 + report.js | 0 | 0 | 0 | 0 | 1-44 c8/test/fixtures | 30.97 | 37.5 | 21.42 | 30.97 | async.js | 100 | 100 | 100 | 100 | c8-ignore-next.js | 54.54 | 0 | 0 | 54.54 | 1,3-4,9,12,17-19,21-22 @@ -522,7 +521,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.17 | 12.24 | 6.38 | 3.17 | +All files | 3.25 | 12.5 | 6.52 | 3.25 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -532,13 +531,12 @@ All files | 3.17 | 12.24 | 6.38 | 3.17 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | - monocart-report.js | 0 | 0 | 0 | 0 | 1-165 parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-402 + report.js | 0 | 0 | 0 | 0 | 1-530 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 - report.js | 0 | 0 | 0 | 0 | 1-50 + report.js | 0 | 0 | 0 | 0 | 1-44 c8/test/fixtures | 30.97 | 37.5 | 21.42 | 30.97 | async.js | 100 | 100 | 100 | 100 | c8-ignore-next.js | 54.54 | 0 | 0 | 54.54 | 1,3-4,9,12,17-19,21-22 @@ -793,10 +791,12 @@ negative ├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ │ Summary │ 65.64 % │ 70.59 % │ 75.00 % │ 50.00 % │ 62.96 % │ │ └───────────────────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ -,ERROR: Empty coverage (untested file) does not meet threshold for test/fixtures/all/vanilla/dir/unloaded.js -ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js -ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +,ERROR: Coverage for lines (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for functions (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for statements (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js ERROR: Coverage for lines (68.42%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js " `; @@ -840,8 +840,8 @@ hey ├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ │ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ └───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ -,ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js -ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +,ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js " `; @@ -1184,10 +1184,12 @@ negative ├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ │ Summary │ 65.64 % │ 70.59 % │ 75.00 % │ 50.00 % │ 62.96 % │ │ └───────────────────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ -,ERROR: Empty coverage (untested file) does not meet threshold for test/fixtures/all/vanilla/dir/unloaded.js -ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js -ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +,ERROR: Coverage for lines (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for functions (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for statements (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js ERROR: Coverage for lines (68.42%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js " `; @@ -1231,8 +1233,8 @@ hey ├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ │ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ └───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ -,ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js -ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +,ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js " `; From 28be91cc0e7c0f34feee3254415fcf46251605d3 Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 00:14:49 +0800 Subject: [PATCH 05/22] doc: explain for monocart --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8cbf277f..c633dc48 100644 --- a/README.md +++ b/README.md @@ -121,10 +121,15 @@ c8 check-coverage --100 ``` ## Using Monocart coverage reports (experimental) -[Monocart](https://github.com/cenfun/monocart-coverage-reports) will bring additional support for native V8 coverage reports, for example: +Monocart will bring additional support for native V8 coverage reports, for example: ```sh c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js ``` +There are some differences as follows: +- `c8` uses `v8-to-istanbul` by default to convert V8 coverage data and generate Istanbul reports. +- `c8 --experimental-monocart` will use Monocart's new converter to convert V8 coverage data and generate Istanbul reports, it could provide better data for reports. Moreover, it can also directly generate V8 coverage reports (based on Bytes), such as available reports: `v8`, `console-details`, etc. + +See [monocart-coverage-reports](https://github.com/cenfun/monocart-coverage-reports) for more info. ## Ignoring Uncovered Lines, Functions, and Blocks From 6c20c54da5542eacf04cebf4919c2827535174c9 Mon Sep 17 00:00:00 2001 From: CenFun Date: Tue, 11 Jun 2024 10:57:28 +0800 Subject: [PATCH 06/22] Update README.md Co-authored-by: Benjamin E. Coe --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c633dc48..045dd123 100644 --- a/README.md +++ b/README.md @@ -121,15 +121,14 @@ c8 check-coverage --100 ``` ## Using Monocart coverage reports (experimental) -Monocart will bring additional support for native V8 coverage reports, for example: +Monocart is an alternate library for outputting [v8 code coverage](https://v8.dev/blog/javascript-code-coverage) data as Istanbul reports. + +Monocart also provides reporters based directly on v8's byte-offset-based output. Such as, `console-details` and `v8`. This removes a complex transformation step and may be less bug prone for some environments. + +**Example usage:** + ```sh c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js -``` -There are some differences as follows: -- `c8` uses `v8-to-istanbul` by default to convert V8 coverage data and generate Istanbul reports. -- `c8 --experimental-monocart` will use Monocart's new converter to convert V8 coverage data and generate Istanbul reports, it could provide better data for reports. Moreover, it can also directly generate V8 coverage reports (based on Bytes), such as available reports: `v8`, `console-details`, etc. - -See [monocart-coverage-reports](https://github.com/cenfun/monocart-coverage-reports) for more info. ## Ignoring Uncovered Lines, Functions, and Blocks From 7e60c5c773a9248c0c1585f218745385244eeab6 Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 11:28:51 +0800 Subject: [PATCH 07/22] move MCR to peerDependencies --- README.md | 7 +++++++ package-lock.json | 46 ++++++++++++++++++++++++++++++++-------------- package.json | 4 +++- 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 045dd123..01d45794 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,13 @@ Monocart also provides reporters based directly on v8's byte-offset-based output ```sh c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js +``` + +NOTE: Monocart requires additional `monocart-coverage-reports` to be installed: + +```sh +npm i monocart-coverage-reports --save-dev +``` ## Ignoring Uncovered Lines, Functions, and Blocks diff --git a/package-lock.json b/package-lock.json index 737ec9f8..53447f3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.8.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", @@ -37,6 +36,9 @@ }, "engines": { "node": ">=14.14.0" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2.8.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -674,7 +676,8 @@ "node_modules/console-grid": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", - "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==" + "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==", + "peer": true }, "node_modules/convert-source-map": { "version": "2.0.0", @@ -826,7 +829,8 @@ "node_modules/eight-colors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", - "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==" + "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==", + "peer": true }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -2702,7 +2706,8 @@ "node_modules/lz-utils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", - "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==" + "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==", + "peer": true }, "node_modules/make-dir": { "version": "4.0.0", @@ -2877,12 +2882,14 @@ "node_modules/monocart-code-viewer": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", - "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" + "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==", + "peer": true }, "node_modules/monocart-coverage-reports": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", + "peer": true, "workspaces": [ "packages/*", "test" @@ -2907,6 +2914,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==", + "peer": true, "workspaces": [ "packages/*" ] @@ -2914,7 +2922,8 @@ "node_modules/monocart-locator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", - "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==" + "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==", + "peer": true }, "node_modules/ms": { "version": "2.1.3", @@ -4270,7 +4279,8 @@ "node_modules/turbogrid": { "version": "3.0.13", "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.0.13.tgz", - "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==" + "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==", + "peer": true }, "node_modules/type-check": { "version": "0.4.0", @@ -5137,7 +5147,8 @@ "console-grid": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", - "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==" + "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==", + "peer": true }, "convert-source-map": { "version": "2.0.0", @@ -5247,7 +5258,8 @@ "eight-colors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", - "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==" + "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==", + "peer": true }, "emoji-regex": { "version": "8.0.0", @@ -6635,7 +6647,8 @@ "lz-utils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", - "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==" + "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==", + "peer": true }, "make-dir": { "version": "4.0.0", @@ -6765,12 +6778,14 @@ "monocart-code-viewer": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", - "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" + "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==", + "peer": true }, "monocart-coverage-reports": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", + "peer": true, "requires": { "console-grid": "^2.2.2", "eight-colors": "^1.3.0", @@ -6787,12 +6802,14 @@ "monocart-formatter": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", - "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==" + "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==", + "peer": true }, "monocart-locator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", - "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==" + "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==", + "peer": true }, "ms": { "version": "2.1.3", @@ -7765,7 +7782,8 @@ "turbogrid": { "version": "3.0.13", "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.0.13.tgz", - "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==" + "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==", + "peer": true }, "type-check": { "version": "0.4.0", diff --git a/package.json b/package.json index 3b4c9015..6ad0487f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.8.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", @@ -56,6 +55,9 @@ "ts-node": "^10.7.0", "typescript": "^5.0.0" }, + "peerDependencies": { + "monocart-coverage-reports": "^2.8.3" + }, "engines": { "node": ">=14.14.0" }, From aecd2b3c2869e0a3a3392b5bc3ade94fadbee2f0 Mon Sep 17 00:00:00 2001 From: CenFun Date: Tue, 11 Jun 2024 11:56:21 +0800 Subject: [PATCH 08/22] Update lib/parse-args.js Co-authored-by: Benjamin E. Coe --- lib/parse-args.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parse-args.js b/lib/parse-args.js index 86199a2f..84ff8e3e 100644 --- a/lib/parse-args.js +++ b/lib/parse-args.js @@ -161,7 +161,7 @@ function buildYargs (withCommands = false) { .option('experimental-monocart', { default: false, type: 'boolean', - describe: 'Using Monocart coverage reports' + describe: 'Use Monocart coverage reports' }) .pkgConf('c8') .demandCommand(1) From 2192d25789a73aa21012f01abafae06b20e64653 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sun, 9 Jun 2024 16:32:36 -0700 Subject: [PATCH 09/22] doc(CONTRIBUTING): remove dead link, update broken link (#526) fixes #492 --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 366118dc..06591839 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,6 @@ The `c8` project welcomes all contributions from anyone willing to work in good ## Issues - You can open [issues here](https://github.com/bcoe/c8/issues), please follow the template guide. -- You can join the `node-tooling/c8` channel, [follow this link](https://devtoolscommunity.herokuapp.com/) to request for an invite. ## Pull Requests @@ -62,4 +61,4 @@ Pull Requests are the way concrete changes are made to the code, documentation, ## Note -This guide is adapted from the [Node.js project](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#dependencies), check it out for more details. +This guide is adapted from the [Node.js project](https://github.com/nodejs/node/blob/main/doc/contributing/pull-requests.md), check it out for more details. From 1a82a9564e9206d1d02020ef23d592e4de6bd845 Mon Sep 17 00:00:00 2001 From: cenfun Date: Mon, 10 Jun 2024 14:38:14 +0800 Subject: [PATCH 10/22] better integration into the report.js --- lib/commands/report.js | 10 +-- lib/monocart-report.js | 165 --------------------------------------- lib/report.js | 130 +++++++++++++++++++++++++++++- package-lock.json | 14 ++-- package.json | 2 +- test/integration.js.snap | 38 ++++----- 6 files changed, 159 insertions(+), 200 deletions(-) delete mode 100644 lib/monocart-report.js diff --git a/lib/commands/report.js b/lib/commands/report.js index 65e571eb..ec6e7fcc 100644 --- a/lib/commands/report.js +++ b/lib/commands/report.js @@ -1,6 +1,5 @@ const { checkCoverages } = require('./check-coverage') const Report = require('../report') -const monocartReport = require('../monocart-report') exports.command = 'report' @@ -19,12 +18,6 @@ exports.outputReport = async function (argv) { argv.branches = 100 argv.statements = 100 } - - if (argv.experimentalMonocart || process.env.EXPERIMENTAL_MONOCART) { - await monocartReport(argv) - return - } - const report = Report({ include: argv.include, exclude: argv.exclude, @@ -43,7 +36,8 @@ exports.outputReport = async function (argv) { src: argv.src, skipFull: argv.skipFull, excludeNodeModules: argv.excludeNodeModules, - mergeAsync: argv.mergeAsync + mergeAsync: argv.mergeAsync, + monocartArgv: (argv.experimentalMonocart || process.env.EXPERIMENTAL_MONOCART) ? argv : null }) await report.run() if (argv.checkCoverage) await checkCoverages(argv, report) diff --git a/lib/monocart-report.js b/lib/monocart-report.js deleted file mode 100644 index 914d2ac2..00000000 --- a/lib/monocart-report.js +++ /dev/null @@ -1,165 +0,0 @@ -const Exclude = require('test-exclude') -const path = require('path') -const { fileURLToPath } = require('url') - -const { CoverageReport } = require('monocart-coverage-reports') - -module.exports = async (argv) => { - // console.log(argv); - const exclude = new Exclude({ - exclude: argv.exclude, - include: argv.include, - extension: argv.extension, - relativePath: !argv.allowExternal, - excludeNodeModules: argv.excludeNodeModules - }) - - // adapt coverage options - const coverageOptions = getCoverageOptions(argv, exclude) - const coverageReport = new CoverageReport(coverageOptions) - coverageReport.cleanCache() - - // read v8 coverage data from tempDirectory - await coverageReport.addFromDir(argv.tempDirectory) - - // generate report - await coverageReport.generate() -} - -function getReports (argv) { - const reports = Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter] - const reporterOptions = argv.reporterOptions || {} - - return reports.map((reportName) => { - const reportOptions = { - ...reporterOptions[reportName] - } - if (reportName === 'text') { - reportOptions.skipEmpty = false - reportOptions.skipFull = argv.skipFull - reportOptions.maxCols = process.stdout.columns || 100 - } - return [reportName, reportOptions] - }) -} - -// --all: add empty coverage for all files -function getAllOptions (argv, exclude) { - if (!argv.all) { - return - } - - const src = argv.src - const workingDirs = Array.isArray(src) ? src : (typeof src === 'string' ? [src] : [process.cwd()]) - return { - dir: workingDirs, - filter: (filePath) => { - return exclude.shouldInstrument(filePath) - } - } -} - -function getEntryFilter (argv, exclude) { - if (argv.entryFilter) { - return argv.entryFilter - } - return (entry) => { - return exclude.shouldInstrument(fileURLToPath(entry.url)) - } -} - -function getSourceFilter (argv, exclude) { - if (argv.sourceFilter) { - return argv.sourceFilter - } - return (sourcePath) => { - if (argv.excludeAfterRemap) { - // console.log(sourcePath) - return exclude.shouldInstrument(sourcePath) - } - return true - } -} - -function getCoverageOptions (argv, exclude) { - const reports = getReports(argv) - const allOptions = getAllOptions(argv, exclude) - - return { - logging: argv.logging, - name: argv.name, - inline: argv.inline, - lcov: argv.lcov, - outputDir: argv.reportsDir, - clean: argv.clean, - - reports, - all: allOptions, - - // use default value for istanbul - defaultSummarizer: 'pkg', - - entryFilter: getEntryFilter(argv, exclude), - - sourceFilter: getSourceFilter(argv, exclude), - - // sourcePath: (filePath) => { - // return path.resolve(filePath); - // }, - - onEnd: (coverageResults) => { - // console.log(`Coverage report generated: ${coverageResults.reportPath}`); - - if (!argv.checkCoverage) { - return - } - - // check thresholds - const thresholds = {} - const metrics = ['bytes', 'statements', 'branches', 'functions', 'lines'] - metrics.forEach((k) => { - if (argv[k]) { - thresholds[k] = argv[k] - } - }) - - const { summary, files } = coverageResults - - if (argv.perFile) { - files.forEach((file) => { - checkCoverage(file.summary, thresholds, file) - }) - } else { - checkCoverage(summary, thresholds) - } - } - } -} - -function checkCoverage (summary, thresholds, file) { - if (file && file.empty) { - process.exitCode = 1 - console.error( - 'ERROR: Empty coverage (untested file) does not meet threshold for ' + - path.relative('./', file.sourcePath).replace(/\\/g, '/') - ) - return - } - Object.keys(thresholds).forEach(key => { - const coverage = summary[key].pct - if (typeof coverage !== 'number') { - return - } - if (coverage < thresholds[key]) { - process.exitCode = 1 - if (file) { - console.error( - 'ERROR: Coverage for ' + key + ' (' + coverage + '%) does not meet threshold (' + thresholds[key] + '%) for ' + - path.relative('./', file.sourcePath).replace(/\\/g, '/') // standardize path for Windows. - ) - } else { - console.error('ERROR: Coverage for ' + key + ' (' + coverage + '%) does not meet global threshold (' + thresholds[key] + '%)') - } - } - }) -} diff --git a/lib/report.js b/lib/report.js index a69a5595..85df6cb4 100644 --- a/lib/report.js +++ b/lib/report.js @@ -16,6 +16,7 @@ const getSourceMapFromFile = require('./source-map-from-file') const v8toIstanbul = require('v8-to-istanbul') const util = require('util') const debuglog = util.debuglog('c8') +const { CoverageReport } = require('monocart-coverage-reports') class Report { constructor ({ @@ -36,7 +37,8 @@ class Report { allowExternal = false, skipFull, excludeNodeModules, - mergeAsync + mergeAsync, + monocartArgv }) { this.reporter = reporter this.reporterOptions = reporterOptions || {} @@ -60,6 +62,7 @@ class Report { this.src = this._getSrc(src) this.skipFull = skipFull this.mergeAsync = mergeAsync + this.monocartArgv = monocartArgv } _getSrc (src) { @@ -73,6 +76,9 @@ class Report { } async run () { + if (this.monocartArgv) { + return this.runMonocart() + } const context = libReport.createContext({ dir: this.reportsDirectory, watermarks: this.watermarks, @@ -89,6 +95,128 @@ class Report { } } + async runMonocart () { + const argv = this.monocartArgv + const exclude = this.exclude + + function getEntryFilter () { + if (argv.entryFilter) { + return argv.entryFilter + } + if (argv.filter) { + return argv.filter + } + return (entry) => { + return exclude.shouldInstrument(fileURLToPath(entry.url)) + } + } + + function getSourceFilter () { + if (argv.sourceFilter) { + return argv.sourceFilter + } + if (argv.filter) { + return argv.filter + } + return (sourcePath) => { + if (argv.excludeAfterRemap) { + // console.log(sourcePath) + return exclude.shouldInstrument(sourcePath) + } + return true + } + } + + function getReports () { + const reports = Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter] + const reporterOptions = argv.reporterOptions || {} + + return reports.map((reportName) => { + const reportOptions = { + ...reporterOptions[reportName] + } + if (reportName === 'text') { + reportOptions.skipEmpty = false + reportOptions.skipFull = argv.skipFull + reportOptions.maxCols = process.stdout.columns || 100 + } + return [reportName, reportOptions] + }) + } + + // --all: add empty coverage for all files + function getAllOptions () { + if (!argv.all) { + return + } + + const src = argv.src + const workingDirs = Array.isArray(src) ? src : (typeof src === 'string' ? [src] : [process.cwd()]) + return { + dir: workingDirs, + filter: (filePath) => { + return exclude.shouldInstrument(filePath) + } + } + } + + function initPct (summary) { + Object.keys(summary).forEach(k => { + if (summary[k].pct === '') { + summary[k].pct = 100 + } + }) + return summary + } + + // adapt coverage options + const coverageOptions = { + logging: argv.logging, + name: argv.name, + inline: argv.inline, + lcov: argv.lcov, + outputDir: argv.reportsDir, + clean: argv.clean, + + reports: getReports(), + all: getAllOptions(), + + // use default value for istanbul + defaultSummarizer: 'pkg', + + entryFilter: getEntryFilter(), + sourceFilter: getSourceFilter(), + + onEnd: (coverageResults) => { + // for check coverage + this._allCoverageFiles = { + files: () => { + return coverageResults.files.map(it => it.sourcePath) + }, + fileCoverageFor: (file) => { + const fileCoverage = coverageResults.files.find(it => it.sourcePath === file) + return { + toSummary: () => { + return initPct(fileCoverage.summary) + } + } + }, + getCoverageSummary: () => { + return initPct(coverageResults.summary) + } + } + } + } + const coverageReport = new CoverageReport(coverageOptions) + coverageReport.cleanCache() + + // read v8 coverage data from tempDirectory + await coverageReport.addFromDir(argv.tempDirectory) + + // generate report + await coverageReport.generate() + } + async getCoverageMapFromAllCoverageFiles () { // the merge process can be very expensive, and it's often the case that // check-coverage is called immediately after a report. We memoize the diff --git a/package-lock.json b/package-lock.json index 6303360e..737ec9f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.7.10", + "monocart-coverage-reports": "^2.8.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", @@ -2880,9 +2880,9 @@ "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" }, "node_modules/monocart-coverage-reports": { - "version": "2.7.10", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.10.tgz", - "integrity": "sha512-mh2MhJcnwxEew6Uje2qeUv5xG4NKVMNcr+Hv1m069+P9kS6Koz9oEqbC3whLJNkUjMWwNOVh0hdMXhT/SdqD1g==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", + "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", "workspaces": [ "packages/*", "test" @@ -6768,9 +6768,9 @@ "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" }, "monocart-coverage-reports": { - "version": "2.7.10", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.7.10.tgz", - "integrity": "sha512-mh2MhJcnwxEew6Uje2qeUv5xG4NKVMNcr+Hv1m069+P9kS6Koz9oEqbC3whLJNkUjMWwNOVh0hdMXhT/SdqD1g==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", + "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", "requires": { "console-grid": "^2.2.2", "eight-colors": "^1.3.0", diff --git a/package.json b/package.json index 2712b9e2..3b4c9015 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.7.10", + "monocart-coverage-reports": "^2.8.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", diff --git a/test/integration.js.snap b/test/integration.js.snap index 8b3e4d6c..1c7e17ca 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -156,7 +156,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.17 | 12.24 | 6.38 | 3.17 | +All files | 3.25 | 12.5 | 6.52 | 3.25 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -166,13 +166,12 @@ All files | 3.17 | 12.24 | 6.38 | 3.17 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | - monocart-report.js | 0 | 0 | 0 | 0 | 1-165 parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-402 + report.js | 0 | 0 | 0 | 0 | 1-530 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 - report.js | 0 | 0 | 0 | 0 | 1-50 + report.js | 0 | 0 | 0 | 0 | 1-44 c8/test/fixtures | 30.97 | 37.5 | 21.42 | 30.97 | async.js | 100 | 100 | 100 | 100 | c8-ignore-next.js | 54.54 | 0 | 0 | 54.54 | 1,3-4,9,12,17-19,21-22 @@ -522,7 +521,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.17 | 12.24 | 6.38 | 3.17 | +All files | 3.25 | 12.5 | 6.52 | 3.25 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -532,13 +531,12 @@ All files | 3.17 | 12.24 | 6.38 | 3.17 prettify.js | 0 | 0 | 0 | 0 | 1-2 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | - monocart-report.js | 0 | 0 | 0 | 0 | 1-165 parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-402 + report.js | 0 | 0 | 0 | 0 | 1-530 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 - report.js | 0 | 0 | 0 | 0 | 1-50 + report.js | 0 | 0 | 0 | 0 | 1-44 c8/test/fixtures | 30.97 | 37.5 | 21.42 | 30.97 | async.js | 100 | 100 | 100 | 100 | c8-ignore-next.js | 54.54 | 0 | 0 | 54.54 | 1,3-4,9,12,17-19,21-22 @@ -793,10 +791,12 @@ negative ├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ │ Summary │ 65.64 % │ 70.59 % │ 75.00 % │ 50.00 % │ 62.96 % │ │ └───────────────────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ -,ERROR: Empty coverage (untested file) does not meet threshold for test/fixtures/all/vanilla/dir/unloaded.js -ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js -ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +,ERROR: Coverage for lines (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for functions (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for statements (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js ERROR: Coverage for lines (68.42%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js " `; @@ -840,8 +840,8 @@ hey ├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ │ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ └───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ -,ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js -ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +,ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js " `; @@ -1184,10 +1184,12 @@ negative ├───────────────────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ │ Summary │ 65.64 % │ 70.59 % │ 75.00 % │ 50.00 % │ 62.96 % │ │ └───────────────────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ -,ERROR: Empty coverage (untested file) does not meet threshold for test/fixtures/all/vanilla/dir/unloaded.js -ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js -ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +,ERROR: Coverage for lines (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for functions (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js +ERROR: Coverage for statements (0%) does not meet threshold (100%) for test/fixtures/all/vanilla/dir/unloaded.js ERROR: Coverage for lines (68.42%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for branches (75%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js +ERROR: Coverage for statements (80%) does not meet threshold (100%) for test/fixtures/all/vanilla/loaded.js " `; @@ -1231,8 +1233,8 @@ hey ├───────────────┼──────────┼────────────┼──────────┼───────────┼──────────┼─────────────────┤ │ Summary │ 84.60 % │ 88.89 % │ 62.50 % │ 66.67 % │ 80.77 % │ │ └───────────────┴──────────┴────────────┴──────────┴───────────┴──────────┴─────────────────┘ -,ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js -ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +,ERROR: Coverage for lines (70.59%) does not meet threshold (80%) for test/fixtures/normal.js +ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixtures/normal.js " `; From 4dbfe359da88c4e97bc909c25dd035520626e6a0 Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 00:14:49 +0800 Subject: [PATCH 11/22] doc: explain for monocart --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8cbf277f..c633dc48 100644 --- a/README.md +++ b/README.md @@ -121,10 +121,15 @@ c8 check-coverage --100 ``` ## Using Monocart coverage reports (experimental) -[Monocart](https://github.com/cenfun/monocart-coverage-reports) will bring additional support for native V8 coverage reports, for example: +Monocart will bring additional support for native V8 coverage reports, for example: ```sh c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js ``` +There are some differences as follows: +- `c8` uses `v8-to-istanbul` by default to convert V8 coverage data and generate Istanbul reports. +- `c8 --experimental-monocart` will use Monocart's new converter to convert V8 coverage data and generate Istanbul reports, it could provide better data for reports. Moreover, it can also directly generate V8 coverage reports (based on Bytes), such as available reports: `v8`, `console-details`, etc. + +See [monocart-coverage-reports](https://github.com/cenfun/monocart-coverage-reports) for more info. ## Ignoring Uncovered Lines, Functions, and Blocks From 27966b3e8af2f027ed263c7313c84fbccbe8fbfc Mon Sep 17 00:00:00 2001 From: CenFun Date: Tue, 11 Jun 2024 10:57:28 +0800 Subject: [PATCH 12/22] Update README.md Co-authored-by: Benjamin E. Coe --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c633dc48..045dd123 100644 --- a/README.md +++ b/README.md @@ -121,15 +121,14 @@ c8 check-coverage --100 ``` ## Using Monocart coverage reports (experimental) -Monocart will bring additional support for native V8 coverage reports, for example: +Monocart is an alternate library for outputting [v8 code coverage](https://v8.dev/blog/javascript-code-coverage) data as Istanbul reports. + +Monocart also provides reporters based directly on v8's byte-offset-based output. Such as, `console-details` and `v8`. This removes a complex transformation step and may be less bug prone for some environments. + +**Example usage:** + ```sh c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js -``` -There are some differences as follows: -- `c8` uses `v8-to-istanbul` by default to convert V8 coverage data and generate Istanbul reports. -- `c8 --experimental-monocart` will use Monocart's new converter to convert V8 coverage data and generate Istanbul reports, it could provide better data for reports. Moreover, it can also directly generate V8 coverage reports (based on Bytes), such as available reports: `v8`, `console-details`, etc. - -See [monocart-coverage-reports](https://github.com/cenfun/monocart-coverage-reports) for more info. ## Ignoring Uncovered Lines, Functions, and Blocks From 5aa4422fb9816644433905844288ab1d00a44617 Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 11:28:51 +0800 Subject: [PATCH 13/22] move MCR to peerDependencies --- README.md | 7 +++++++ package-lock.json | 46 ++++++++++++++++++++++++++++++++-------------- package.json | 4 +++- 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 045dd123..01d45794 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,13 @@ Monocart also provides reporters based directly on v8's byte-offset-based output ```sh c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js +``` + +NOTE: Monocart requires additional `monocart-coverage-reports` to be installed: + +```sh +npm i monocart-coverage-reports --save-dev +``` ## Ignoring Uncovered Lines, Functions, and Blocks diff --git a/package-lock.json b/package-lock.json index 737ec9f8..53447f3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.8.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", @@ -37,6 +36,9 @@ }, "engines": { "node": ">=14.14.0" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2.8.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -674,7 +676,8 @@ "node_modules/console-grid": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", - "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==" + "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==", + "peer": true }, "node_modules/convert-source-map": { "version": "2.0.0", @@ -826,7 +829,8 @@ "node_modules/eight-colors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", - "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==" + "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==", + "peer": true }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -2702,7 +2706,8 @@ "node_modules/lz-utils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", - "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==" + "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==", + "peer": true }, "node_modules/make-dir": { "version": "4.0.0", @@ -2877,12 +2882,14 @@ "node_modules/monocart-code-viewer": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", - "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" + "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==", + "peer": true }, "node_modules/monocart-coverage-reports": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", + "peer": true, "workspaces": [ "packages/*", "test" @@ -2907,6 +2914,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==", + "peer": true, "workspaces": [ "packages/*" ] @@ -2914,7 +2922,8 @@ "node_modules/monocart-locator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", - "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==" + "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==", + "peer": true }, "node_modules/ms": { "version": "2.1.3", @@ -4270,7 +4279,8 @@ "node_modules/turbogrid": { "version": "3.0.13", "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.0.13.tgz", - "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==" + "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==", + "peer": true }, "node_modules/type-check": { "version": "0.4.0", @@ -5137,7 +5147,8 @@ "console-grid": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", - "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==" + "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==", + "peer": true }, "convert-source-map": { "version": "2.0.0", @@ -5247,7 +5258,8 @@ "eight-colors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", - "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==" + "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==", + "peer": true }, "emoji-regex": { "version": "8.0.0", @@ -6635,7 +6647,8 @@ "lz-utils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", - "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==" + "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==", + "peer": true }, "make-dir": { "version": "4.0.0", @@ -6765,12 +6778,14 @@ "monocart-code-viewer": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", - "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==" + "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==", + "peer": true }, "monocart-coverage-reports": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", + "peer": true, "requires": { "console-grid": "^2.2.2", "eight-colors": "^1.3.0", @@ -6787,12 +6802,14 @@ "monocart-formatter": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", - "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==" + "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==", + "peer": true }, "monocart-locator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", - "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==" + "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==", + "peer": true }, "ms": { "version": "2.1.3", @@ -7765,7 +7782,8 @@ "turbogrid": { "version": "3.0.13", "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.0.13.tgz", - "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==" + "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==", + "peer": true }, "type-check": { "version": "0.4.0", diff --git a/package.json b/package.json index 3b4c9015..6ad0487f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "monocart-coverage-reports": "^2.8.3", "test-exclude": "^6.0.0", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", @@ -56,6 +55,9 @@ "ts-node": "^10.7.0", "typescript": "^5.0.0" }, + "peerDependencies": { + "monocart-coverage-reports": "^2.8.3" + }, "engines": { "node": ">=14.14.0" }, From 9566904081d43a8aca88a39315e19823a790a48a Mon Sep 17 00:00:00 2001 From: CenFun Date: Tue, 11 Jun 2024 11:56:21 +0800 Subject: [PATCH 14/22] Update lib/parse-args.js Co-authored-by: Benjamin E. Coe --- lib/parse-args.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parse-args.js b/lib/parse-args.js index 86199a2f..84ff8e3e 100644 --- a/lib/parse-args.js +++ b/lib/parse-args.js @@ -161,7 +161,7 @@ function buildYargs (withCommands = false) { .option('experimental-monocart', { default: false, type: 'boolean', - describe: 'Using Monocart coverage reports' + describe: 'Use Monocart coverage reports' }) .pkgConf('c8') .demandCommand(1) From 237d262795df9cabc5a2519f1bc3fe3805dbb34a Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 12:19:47 +0800 Subject: [PATCH 15/22] resolve conflicts --- package-lock.json | 668 ++++++++++++++++++++++++++++++++++------------ package.json | 9 +- 2 files changed, 501 insertions(+), 176 deletions(-) diff --git a/package-lock.json b/package-lock.json index 53447f3b..066c91c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "c8", - "version": "9.1.0", + "version": "10.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "c8", - "version": "9.1.0", + "version": "10.0.0", "license": "ISC", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", @@ -16,7 +16,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "test-exclude": "^6.0.0", + "test-exclude": "^7.0.1", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", "yargs-parser": "^21.1.1" @@ -35,10 +35,7 @@ "typescript": "^5.0.0" }, "engines": { - "node": ">=14.14.0" - }, - "peerDependencies": { - "monocart-coverage-reports": "^2.8.3" + "node": ">=18" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -158,6 +155,95 @@ "node": "*" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -189,6 +275,15 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -477,6 +572,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -671,13 +767,8 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/console-grid": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", - "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==", - "peer": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/convert-source-map": { "version": "2.0.0", @@ -826,11 +917,10 @@ "node": ">=6.0.0" } }, - "node_modules/eight-colors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", - "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==", - "peer": true + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -1723,7 +1813,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.3", @@ -1845,6 +1936,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1876,6 +1968,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -2087,6 +2180,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -2095,7 +2189,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/internal-slot": { "version": "1.0.6", @@ -2414,9 +2509,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -2425,6 +2520,23 @@ "node": ">=8" } }, + "node_modules/jackspeak": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", + "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jest-diff": { "version": "21.2.1", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-21.2.1.tgz", @@ -2703,12 +2815,6 @@ "node": ">=10" } }, - "node_modules/lz-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", - "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==", - "peer": true - }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -2750,6 +2856,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -2879,52 +2993,6 @@ "node": ">=10" } }, - "node_modules/monocart-code-viewer": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", - "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==", - "peer": true - }, - "node_modules/monocart-coverage-reports": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", - "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", - "peer": true, - "workspaces": [ - "packages/*", - "test" - ], - "dependencies": { - "console-grid": "^2.2.2", - "eight-colors": "^1.3.0", - "istanbul-lib-coverage": "^3.2.2", - "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.1.7", - "lz-utils": "^2.0.2", - "monocart-code-viewer": "^1.1.3", - "monocart-formatter": "^3.0.0", - "monocart-locator": "^1.0.0", - "turbogrid": "^3.0.13" - }, - "bin": { - "mcr": "lib/cli.js" - } - }, - "node_modules/monocart-formatter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", - "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==", - "peer": true, - "workspaces": [ - "packages/*" - ] - }, - "node_modules/monocart-locator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", - "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==", - "peer": true - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -3089,6 +3157,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -3184,6 +3253,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -3202,6 +3272,29 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "engines": { + "node": "14 || >=16.14" + } + }, "node_modules/path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", @@ -3992,6 +4085,20 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/string.prototype.matchall": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz", @@ -4068,6 +4175,26 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -4159,27 +4286,59 @@ "dev": true }, "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", "dependencies": { "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "glob": "^10.4.1", + "minimatch": "^9.0.4" }, "engines": { - "node": ">=8" + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/text-table": { @@ -4276,12 +4435,6 @@ "strip-bom": "^3.0.0" } }, - "node_modules/turbogrid": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.0.13.tgz", - "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==", - "peer": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -4535,6 +4688,53 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -4568,7 +4768,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/xdg-basedir": { "version": "4.0.0", @@ -4749,6 +4950,64 @@ } } }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" + }, + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "requires": { + "ansi-regex": "^6.0.1" + } + }, + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + } + } + } + }, "@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -4774,6 +5033,12 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true + }, "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -4993,6 +5258,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5142,13 +5408,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "console-grid": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", - "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==", - "peer": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "convert-source-map": { "version": "2.0.0", @@ -5255,11 +5516,10 @@ "esutils": "^2.0.2" } }, - "eight-colors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", - "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==", - "peer": true + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "emoji-regex": { "version": "8.0.0", @@ -5931,7 +6191,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "fsevents": { "version": "2.3.3", @@ -6013,6 +6274,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -6026,6 +6288,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -6179,6 +6442,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -6187,7 +6451,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "internal-slot": { "version": "1.0.6", @@ -6404,14 +6669,23 @@ } }, "istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "requires": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" } }, + "jackspeak": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", + "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } + }, "jest-diff": { "version": "21.2.1", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-21.2.1.tgz", @@ -6644,12 +6918,6 @@ "yallist": "^4.0.0" } }, - "lz-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", - "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==", - "peer": true - }, "make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -6679,6 +6947,11 @@ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + }, "mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -6775,42 +7048,6 @@ } } }, - "monocart-code-viewer": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", - "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==", - "peer": true - }, - "monocart-coverage-reports": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", - "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", - "peer": true, - "requires": { - "console-grid": "^2.2.2", - "eight-colors": "^1.3.0", - "istanbul-lib-coverage": "^3.2.2", - "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.1.7", - "lz-utils": "^2.0.2", - "monocart-code-viewer": "^1.1.3", - "monocart-formatter": "^3.0.0", - "monocart-locator": "^1.0.0", - "turbogrid": "^3.0.13" - } - }, - "monocart-formatter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", - "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==", - "peer": true - }, - "monocart-locator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", - "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==", - "peer": true - }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -6932,6 +7169,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "requires": { "wrappy": "1" } @@ -6999,7 +7237,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true }, "path-key": { "version": "3.1.1", @@ -7012,6 +7251,22 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "requires": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==" + } + } + }, "path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", @@ -7573,6 +7828,16 @@ "strip-ansi": "^6.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "string.prototype.matchall": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz", @@ -7638,6 +7903,21 @@ } } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + } + } + }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -7698,21 +7978,41 @@ } }, "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", "requires": { "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "glob": "^10.4.1", + "minimatch": "^9.0.4" }, "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "glob": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", + "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" + } + }, "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" } } } @@ -7779,12 +8079,6 @@ "strip-bom": "^3.0.0" } }, - "turbogrid": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.0.13.tgz", - "integrity": "sha512-8owt3hf29VDyW9excRMGccq/cmqspmvg8Zt6JgXw2uuq65drl50KXtGQpGevIbqQMnvltyfyLLJjzNnWK7tCVA==", - "peer": true - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -8002,10 +8296,44 @@ } } }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "xdg-basedir": { "version": "4.0.0", diff --git a/package.json b/package.json index 6ad0487f..730a9365 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "c8", - "version": "9.1.0", + "version": "10.0.0", "description": "output coverage reports using Node.js' built in coverage", "main": "./index.js", "types": "./index.d.ts", @@ -40,7 +40,7 @@ "istanbul-lib-coverage": "^3.2.0", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.6", - "test-exclude": "^6.0.0", + "test-exclude": "^7.0.1", "v8-to-istanbul": "^9.0.0", "yargs": "^17.7.2", "yargs-parser": "^21.1.1" @@ -55,11 +55,8 @@ "ts-node": "^10.7.0", "typescript": "^5.0.0" }, - "peerDependencies": { - "monocart-coverage-reports": "^2.8.3" - }, "engines": { - "node": ">=14.14.0" + "node": ">=18" }, "files": [ "index.js", From 1d2ff8814bc920800753747fba2163ba9f88311e Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 12:21:28 +0800 Subject: [PATCH 16/22] resolve conflicts --- package-lock.json | 145 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 3 + 2 files changed, 142 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 066c91c0..3a780a41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,9 @@ }, "engines": { "node": ">=18" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2.8.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -770,6 +773,12 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/console-grid": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", + "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==", + "peer": true + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -922,6 +931,12 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, + "node_modules/eight-colors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", + "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==", + "peer": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -2509,9 +2524,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -2815,6 +2830,12 @@ "node": ">=10" } }, + "node_modules/lz-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", + "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==", + "peer": true + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -2993,6 +3014,52 @@ "node": ">=10" } }, + "node_modules/monocart-code-viewer": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", + "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==", + "peer": true + }, + "node_modules/monocart-coverage-reports": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", + "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", + "peer": true, + "workspaces": [ + "packages/*", + "test" + ], + "dependencies": { + "console-grid": "^2.2.2", + "eight-colors": "^1.3.0", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.7", + "lz-utils": "^2.0.2", + "monocart-code-viewer": "^1.1.3", + "monocart-formatter": "^3.0.0", + "monocart-locator": "^1.0.0", + "turbogrid": "^3.0.13" + }, + "bin": { + "mcr": "lib/cli.js" + } + }, + "node_modules/monocart-formatter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", + "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==", + "peer": true, + "workspaces": [ + "packages/*" + ] + }, + "node_modules/monocart-locator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", + "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==", + "peer": true + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4435,6 +4502,12 @@ "strip-bom": "^3.0.0" } }, + "node_modules/turbogrid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.1.0.tgz", + "integrity": "sha512-IpNYGO26pJkd8c0qSOWVHfg8lYuVhbweaWboy7Xvg/KTI3WjhgYzPS6szPMoxXLEGAhykXagaQCRYl9pGapN6g==", + "peer": true + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -5411,6 +5484,12 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "console-grid": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/console-grid/-/console-grid-2.2.2.tgz", + "integrity": "sha512-ohlgXexdDTKLNsZz7DSJuCAwmRc8omSS61txOk39W3NOthgKGr1a1jJpZ5BCQe4PlrwMw01OvPQ1Bl3G7Y/uFg==", + "peer": true + }, "convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -5521,6 +5600,12 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, + "eight-colors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eight-colors/-/eight-colors-1.3.0.tgz", + "integrity": "sha512-hVoK898cR71ADj7L1LZWaECLaSkzzPtqGXIaKv4K6Pzb72QgjLVsQaNI+ELDQQshzFvgp5xTPkaYkPGqw3YR+g==", + "peer": true + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -6669,9 +6754,9 @@ } }, "istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "requires": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -6918,6 +7003,12 @@ "yallist": "^4.0.0" } }, + "lz-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lz-utils/-/lz-utils-2.0.2.tgz", + "integrity": "sha512-i1PJN4hNEevkrvLMqNWCCac1BcB5SRaghywG7HVzWOyVkFOasLCG19ND1sY1F/ZEsM6SnGtoXyBWnmfqOM5r6g==", + "peer": true + }, "make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -7048,6 +7139,42 @@ } } }, + "monocart-code-viewer": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/monocart-code-viewer/-/monocart-code-viewer-1.1.3.tgz", + "integrity": "sha512-v1dbT8fDr9vjyjEYE035JSC4JXBA/Z034mogVJWRO3khX0/guVwGb69iSIYSzTbR9+KpRKV/C/AscRAkUwP32w==", + "peer": true + }, + "monocart-coverage-reports": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/monocart-coverage-reports/-/monocart-coverage-reports-2.8.3.tgz", + "integrity": "sha512-F6SK6VqKofrnjGtM0Cu9BLgp1ZZPMJhHq8rd8l0vudj3amrVRb+H9UH5X9Xxp4JuGVSODg0XfTDpFOxVjIGjUw==", + "peer": true, + "requires": { + "console-grid": "^2.2.2", + "eight-colors": "^1.3.0", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.7", + "lz-utils": "^2.0.2", + "monocart-code-viewer": "^1.1.3", + "monocart-formatter": "^3.0.0", + "monocart-locator": "^1.0.0", + "turbogrid": "^3.0.13" + } + }, + "monocart-formatter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/monocart-formatter/-/monocart-formatter-3.0.0.tgz", + "integrity": "sha512-91OQpUb/9iDqvrblUv6ki11Jxi1d3Fp5u2jfVAPl3UdNp9TM+iBleLzXntUS51W0o+zoya3CJjZZ01z2XWn25g==", + "peer": true + }, + "monocart-locator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/monocart-locator/-/monocart-locator-1.0.0.tgz", + "integrity": "sha512-qIHJ7f99miF2HbVUWAFKR93SfgGYpFPUCQPmW9q1VXU9onxMUFJxhQDdG3HkEteogUbsKB7Gr5MRgjzcIxwTaQ==", + "peer": true + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -8079,6 +8206,12 @@ "strip-bom": "^3.0.0" } }, + "turbogrid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/turbogrid/-/turbogrid-3.1.0.tgz", + "integrity": "sha512-IpNYGO26pJkd8c0qSOWVHfg8lYuVhbweaWboy7Xvg/KTI3WjhgYzPS6szPMoxXLEGAhykXagaQCRYl9pGapN6g==", + "peer": true + }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 730a9365..96b077b0 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,9 @@ "ts-node": "^10.7.0", "typescript": "^5.0.0" }, + "peerDependencies": { + "monocart-coverage-reports": "^2.8.3" + }, "engines": { "node": ">=18" }, From 85303b4950d4b92a16d76f36458f6281ab21747f Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 12:42:17 +0800 Subject: [PATCH 17/22] move to try/catch --- lib/report.js | 19 +++++++++++++++++-- test/integration.js.snap | 8 ++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/report.js b/lib/report.js index 85df6cb4..64cc26b0 100644 --- a/lib/report.js +++ b/lib/report.js @@ -16,7 +16,6 @@ const getSourceMapFromFile = require('./source-map-from-file') const v8toIstanbul = require('v8-to-istanbul') const util = require('util') const debuglog = util.debuglog('c8') -const { CoverageReport } = require('monocart-coverage-reports') class Report { constructor ({ @@ -95,7 +94,23 @@ class Report { } } + async getMonocart () { + let MCR + try { + MCR = await import('monocart-coverage-reports') + } catch (e) { + console.error('ERROR: Failed to import module "monocart-coverage-reports". Please try to install it: npm i monocart-coverage-reports --save-dev') + process.exit(1) + } + return MCR + } + async runMonocart () { + const MCR = await this.getMonocart() + if (!MCR) { + return + } + const argv = this.monocartArgv const exclude = this.exclude @@ -207,7 +222,7 @@ class Report { } } } - const coverageReport = new CoverageReport(coverageOptions) + const coverageReport = new MCR.CoverageReport(coverageOptions) coverageReport.cleanCache() // read v8 coverage data from tempDirectory diff --git a/test/integration.js.snap b/test/integration.js.snap index 1c7e17ca..e20cbc63 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -156,7 +156,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.25 | 12.5 | 6.52 | 3.25 | +All files | 3.22 | 12.5 | 6.52 | 3.22 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -167,7 +167,7 @@ All files | 3.25 | 12.5 | 6.52 | 3.25 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-530 + report.js | 0 | 0 | 0 | 0 | 1-545 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 @@ -521,7 +521,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.25 | 12.5 | 6.52 | 3.25 | +All files | 3.22 | 12.5 | 6.52 | 3.22 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -532,7 +532,7 @@ All files | 3.25 | 12.5 | 6.52 | 3.25 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-530 + report.js | 0 | 0 | 0 | 0 | 1-545 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 From 714cdd67fb01f16072f3bd31459f3a6044bf2875 Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 13:05:25 +0800 Subject: [PATCH 18/22] test case for monocart installation --- test/integration.js | 30 +++++++++++++++++++++++++++++- test/integration.js.snap | 26 ++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/test/integration.js b/test/integration.js index 99723c00..1df37aa0 100644 --- a/test/integration.js +++ b/test/integration.js @@ -3,7 +3,7 @@ const { readFileSync } = require('fs') const { resolve } = require('path') const { spawnSync } = require('child_process') -const { statSync, rm } = require('fs') +const { statSync, rm, rename } = require('fs') const { dirname } = require('path') const c8Path = require.resolve('../bin/c8') const nodePath = process.execPath @@ -699,6 +699,34 @@ beforeEach(function () { }) describe('monocart report', () => { + it('monocart check install', () => { + // mock not-installed + const mcrPath = require.resolve('monocart-coverage-reports') + rename(mcrPath, mcrPath + '.bak', (err) => { + if (err) { throw err } + }) + + const { output, status } = spawnSync(nodePath, [ + c8Path, + '--experimental-monocart', + '--exclude="test/*.js"', + '--temp-directory=tmp/monocart-normal', + '--reports-dir=tmp/monocart-normal-reports', + '--reporter=v8', + '--reporter=console-details', + '--clean=false', + `--merge-async=${mergeAsync}`, + nodePath, + require.resolve('./fixtures/normal') + ]) + status.should.equal(1) + output.toString('utf8').should.matchSnapshot() + + rename(mcrPath + '.bak', mcrPath, (err) => { + if (err) { throw err } + }) + }) + it('monocart check normal', () => { const { output } = spawnSync(nodePath, [ c8Path, diff --git a/test/integration.js.snap b/test/integration.js.snap index e20cbc63..34908e1d 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -845,6 +845,19 @@ ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixt " `; +exports[`c8 mergeAsync monocart report monocart check install 1`] = ` +",hey +i am a line of code +what +hey +what +hey +what +hey +,ERROR: Failed to import module \\"monocart-coverage-reports\\". Please try to install it: npm i monocart-coverage-reports --save-dev +" +`; + exports[`c8 mergeAsync monocart report monocart check normal 1`] = ` ",hey i am a line of code @@ -1238,6 +1251,19 @@ ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixt " `; +exports[`c8 monocart report monocart check install 1`] = ` +",hey +i am a line of code +what +hey +what +hey +what +hey +,ERROR: Failed to import module \\"monocart-coverage-reports\\". Please try to install it: npm i monocart-coverage-reports --save-dev +" +`; + exports[`c8 monocart report monocart check normal 1`] = ` ",hey i am a line of code From c88abbf47f518f476105531c208dfb6cefa4fad7 Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 14:51:10 +0800 Subject: [PATCH 19/22] optimize arguments --- lib/report.js | 33 +++++++++++++-------------------- test/integration.js.snap | 8 ++++---- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/lib/report.js b/lib/report.js index 64cc26b0..08aba682 100644 --- a/lib/report.js +++ b/lib/report.js @@ -115,25 +115,13 @@ class Report { const exclude = this.exclude function getEntryFilter () { - if (argv.entryFilter) { - return argv.entryFilter - } - if (argv.filter) { - return argv.filter - } - return (entry) => { + return argv.entryFilter || argv.filter || function (entry) { return exclude.shouldInstrument(fileURLToPath(entry.url)) } } function getSourceFilter () { - if (argv.sourceFilter) { - return argv.sourceFilter - } - if (argv.filter) { - return argv.filter - } - return (sourcePath) => { + return argv.sourceFilter || argv.filter || function (sourcePath) { if (argv.excludeAfterRemap) { // console.log(sourcePath) return exclude.shouldInstrument(sourcePath) @@ -188,20 +176,25 @@ class Report { const coverageOptions = { logging: argv.logging, name: argv.name, + + reports: getReports(), + + outputDir: argv.reportsDir, + baseDir: argv.baseDir, + + entryFilter: getEntryFilter(), + sourceFilter: getSourceFilter(), + inline: argv.inline, lcov: argv.lcov, - outputDir: argv.reportsDir, - clean: argv.clean, - reports: getReports(), all: getAllOptions(), + clean: argv.clean, + // use default value for istanbul defaultSummarizer: 'pkg', - entryFilter: getEntryFilter(), - sourceFilter: getSourceFilter(), - onEnd: (coverageResults) => { // for check coverage this._allCoverageFiles = { diff --git a/test/integration.js.snap b/test/integration.js.snap index 34908e1d..ebc37f38 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -156,7 +156,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.22 | 12.5 | 6.52 | 3.22 | +All files | 3.24 | 12.5 | 6.52 | 3.24 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -167,7 +167,7 @@ All files | 3.22 | 12.5 | 6.52 | 3.22 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-545 + report.js | 0 | 0 | 0 | 0 | 1-538 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 @@ -521,7 +521,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.22 | 12.5 | 6.52 | 3.22 | +All files | 3.24 | 12.5 | 6.52 | 3.24 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -532,7 +532,7 @@ All files | 3.22 | 12.5 | 6.52 | 3.22 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-545 + report.js | 0 | 0 | 0 | 0 | 1-538 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 From 6fd00e5f6ff8878be21e3cc0e3a60201fdf66c1d Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 11 Jun 2024 10:07:32 -0400 Subject: [PATCH 20/22] Update lib/report.js --- lib/report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/report.js b/lib/report.js index 08aba682..f075c4a7 100644 --- a/lib/report.js +++ b/lib/report.js @@ -99,7 +99,7 @@ class Report { try { MCR = await import('monocart-coverage-reports') } catch (e) { - console.error('ERROR: Failed to import module "monocart-coverage-reports". Please try to install it: npm i monocart-coverage-reports --save-dev') + console.error('--experimental-monocart requires the plugin monocart-coverage-reports. Run: "npm i monocart-coverage-reports --save-dev"') process.exit(1) } return MCR From 4b0947ac7ed9a1b7c8c3ae91d0cf36964b941196 Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 22:22:05 +0800 Subject: [PATCH 21/22] fixed unit test --- test/integration.js.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration.js.snap b/test/integration.js.snap index ebc37f38..918a075d 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -854,7 +854,7 @@ what hey what hey -,ERROR: Failed to import module \\"monocart-coverage-reports\\". Please try to install it: npm i monocart-coverage-reports --save-dev +,--experimental-monocart requires the plugin monocart-coverage-reports. Run: \\"npm i monocart-coverage-reports --save-dev\\" " `; @@ -1260,7 +1260,7 @@ what hey what hey -,ERROR: Failed to import module \\"monocart-coverage-reports\\". Please try to install it: npm i monocart-coverage-reports --save-dev +,--experimental-monocart requires the plugin monocart-coverage-reports. Run: \\"npm i monocart-coverage-reports --save-dev\\" " `; From 67bbd5730c7258b1e5b995f4d6fc0a99d1a53e81 Mon Sep 17 00:00:00 2001 From: cenfun Date: Tue, 11 Jun 2024 23:13:18 +0800 Subject: [PATCH 22/22] updated the test case for import-mcr --- lib/report.js | 6 ++++- test/fixtures/import-mcr.js | 12 +++++++++ test/integration.js | 28 +++------------------ test/integration.js.snap | 50 +++++++++++++------------------------ 4 files changed, 38 insertions(+), 58 deletions(-) create mode 100644 test/fixtures/import-mcr.js diff --git a/lib/report.js b/lib/report.js index f075c4a7..d7220e03 100644 --- a/lib/report.js +++ b/lib/report.js @@ -94,10 +94,14 @@ class Report { } } + async importMonocart () { + return import('monocart-coverage-reports') + } + async getMonocart () { let MCR try { - MCR = await import('monocart-coverage-reports') + MCR = await this.importMonocart() } catch (e) { console.error('--experimental-monocart requires the plugin monocart-coverage-reports. Run: "npm i monocart-coverage-reports --save-dev"') process.exit(1) diff --git a/test/fixtures/import-mcr.js b/test/fixtures/import-mcr.js new file mode 100644 index 00000000..18969e60 --- /dev/null +++ b/test/fixtures/import-mcr.js @@ -0,0 +1,12 @@ +const importMCR = async () => { + const Report = require('../../lib/report') + const report = Report({ + monocartArgv: {} + }) + report.importMonocart = () => { + throw new Error('not found module') + } + await report.run() +} + +importMCR(); \ No newline at end of file diff --git a/test/integration.js b/test/integration.js index 1df37aa0..8e00be0b 100644 --- a/test/integration.js +++ b/test/integration.js @@ -3,7 +3,7 @@ const { readFileSync } = require('fs') const { resolve } = require('path') const { spawnSync } = require('child_process') -const { statSync, rm, rename } = require('fs') +const { statSync, rm } = require('fs') const { dirname } = require('path') const c8Path = require.resolve('../bin/c8') const nodePath = process.execPath @@ -699,32 +699,10 @@ beforeEach(function () { }) describe('monocart report', () => { - it('monocart check install', () => { - // mock not-installed - const mcrPath = require.resolve('monocart-coverage-reports') - rename(mcrPath, mcrPath + '.bak', (err) => { - if (err) { throw err } - }) - - const { output, status } = spawnSync(nodePath, [ - c8Path, - '--experimental-monocart', - '--exclude="test/*.js"', - '--temp-directory=tmp/monocart-normal', - '--reports-dir=tmp/monocart-normal-reports', - '--reporter=v8', - '--reporter=console-details', - '--clean=false', - `--merge-async=${mergeAsync}`, - nodePath, - require.resolve('./fixtures/normal') - ]) + it('check import monocart', async () => { + const { output, status } = spawnSync(nodePath, ['./test/fixtures/import-mcr.js']) status.should.equal(1) output.toString('utf8').should.matchSnapshot() - - rename(mcrPath + '.bak', mcrPath, (err) => { - if (err) { throw err } - }) }) it('monocart check normal', () => { diff --git a/test/integration.js.snap b/test/integration.js.snap index 918a075d..0c2c37ea 100644 --- a/test/integration.js.snap +++ b/test/integration.js.snap @@ -156,7 +156,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.24 | 12.5 | 6.52 | 3.24 | +All files | 3.21 | 12.24 | 6.38 | 3.21 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -167,18 +167,19 @@ All files | 3.24 | 12.5 | 6.52 | 3.24 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-538 + report.js | 0 | 0 | 0 | 0 | 1-542 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 report.js | 0 | 0 | 0 | 0 | 1-44 - c8/test/fixtures | 30.97 | 37.5 | 21.42 | 30.97 | + c8/test/fixtures | 29.08 | 35.29 | 20 | 29.08 | async.js | 100 | 100 | 100 | 100 | c8-ignore-next.js | 54.54 | 0 | 0 | 54.54 | 1,3-4,9,12,17-19,21-22 c8-ignore-start-stop.js | 61.9 | 0 | 0 | 61.9 | 1-4,10,16-18 computed-method.js | 0 | 0 | 0 | 0 | 1-15 custom-ext.special | 75 | 66.66 | 33.33 | 75 | 14-16,18-20 custom-ext2.special | 0 | 0 | 0 | 0 | 1-24 + import-mcr.js | 0 | 0 | 0 | 0 | 1-12 issue-254.js | 28.57 | 0 | 0 | 28.57 | 1-2,5-7 multiple-spawn.js | 0 | 0 | 0 | 0 | 1-12 normal.js | 0 | 0 | 0 | 0 | 1-24 @@ -521,7 +522,7 @@ hey ---------------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------------ -All files | 3.24 | 12.5 | 6.52 | 3.24 | +All files | 3.21 | 12.24 | 6.38 | 3.21 | c8 | 0 | 0 | 0 | 0 | index.js | 0 | 0 | 0 | 0 | 1 c8/bin | 0 | 0 | 0 | 0 | @@ -532,18 +533,19 @@ All files | 3.24 | 12.5 | 6.52 | 3.24 sorter.js | 0 | 0 | 0 | 0 | 1-196 c8/lib | 0 | 0 | 0 | 0 | parse-args.js | 0 | 0 | 0 | 0 | 1-229 - report.js | 0 | 0 | 0 | 0 | 1-538 + report.js | 0 | 0 | 0 | 0 | 1-542 source-map-from-file.js | 0 | 0 | 0 | 0 | 1-100 c8/lib/commands | 0 | 0 | 0 | 0 | check-coverage.js | 0 | 0 | 0 | 0 | 1-70 report.js | 0 | 0 | 0 | 0 | 1-44 - c8/test/fixtures | 30.97 | 37.5 | 21.42 | 30.97 | + c8/test/fixtures | 29.08 | 35.29 | 20 | 29.08 | async.js | 100 | 100 | 100 | 100 | c8-ignore-next.js | 54.54 | 0 | 0 | 54.54 | 1,3-4,9,12,17-19,21-22 c8-ignore-start-stop.js | 61.9 | 0 | 0 | 61.9 | 1-4,10,16-18 computed-method.js | 0 | 0 | 0 | 0 | 1-15 custom-ext.special | 75 | 66.66 | 33.33 | 75 | 14-16,18-20 custom-ext2.special | 0 | 0 | 0 | 0 | 1-24 + import-mcr.js | 0 | 0 | 0 | 0 | 1-12 issue-254.js | 28.57 | 0 | 0 | 28.57 | 1-2,5-7 multiple-spawn.js | 0 | 0 | 0 | 0 | 1-12 normal.js | 0 | 0 | 0 | 0 | 1-24 @@ -745,6 +747,11 @@ All files | 100 | 100 | 100 | 100 | ," `; +exports[`c8 mergeAsync monocart report check import monocart 1`] = ` +",,--experimental-monocart requires the plugin monocart-coverage-reports. Run: \\"npm i monocart-coverage-reports --save-dev\\" +" +`; + exports[`c8 mergeAsync monocart report check sourcemap 1`] = ` ",reachable a = true @@ -845,19 +852,6 @@ ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixt " `; -exports[`c8 mergeAsync monocart report monocart check install 1`] = ` -",hey -i am a line of code -what -hey -what -hey -what -hey -,--experimental-monocart requires the plugin monocart-coverage-reports. Run: \\"npm i monocart-coverage-reports --save-dev\\" -" -`; - exports[`c8 mergeAsync monocart report monocart check normal 1`] = ` ",hey i am a line of code @@ -1151,6 +1145,11 @@ All files | 100 | 100 | 100 | 100 | ," `; +exports[`c8 monocart report check import monocart 1`] = ` +",,--experimental-monocart requires the plugin monocart-coverage-reports. Run: \\"npm i monocart-coverage-reports --save-dev\\" +" +`; + exports[`c8 monocart report check sourcemap 1`] = ` ",reachable a = true @@ -1251,19 +1250,6 @@ ERROR: Coverage for branches (62.5%) does not meet threshold (80%) for test/fixt " `; -exports[`c8 monocart report monocart check install 1`] = ` -",hey -i am a line of code -what -hey -what -hey -what -hey -,--experimental-monocart requires the plugin monocart-coverage-reports. Run: \\"npm i monocart-coverage-reports --save-dev\\" -" -`; - exports[`c8 monocart report monocart check normal 1`] = ` ",hey i am a line of code