Skip to content

Commit

Permalink
move minimatch, diff-sequences, @bcoe/v8-coverage, @jridgewell/source…
Browse files Browse the repository at this point in the history
…map-codec from vendor
  • Loading branch information
cenfun committed Jul 8, 2024
1 parent 96f0fde commit e621c83
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 37 deletions.
4 changes: 3 additions & 1 deletion lib/converter/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const {
sortRanges, dedupeCountRanges, mergeRangesWith
} = require('../utils/dedupe.js');
const { getSourceType, initSourceMapSourcesPath } = require('../utils/source-path.js');
const { decode, minimatch } = require('../packages/monocart-coverage-vendor.js');

const { decode } = require('@jridgewell/sourcemap-codec');
const { minimatch } = require('minimatch');

const InfoBranch = require('./info-branch.js');
const InfoFunction = require('./info-function.js');
Expand Down
4 changes: 2 additions & 2 deletions lib/converter/find-original-range.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { diff } = require('../packages/monocart-coverage-vendor');
const diffSequence = require('diff-sequences').default;
const Util = require('../utils/util.js');
const EC = Util.EC;

Expand Down Expand Up @@ -79,7 +79,7 @@ const alignText = (gt, ot, info) => {
// console.log(ol);

const commonItems = [];
diff(gl.length, ol.length, (gi, oi) => {
diffSequence(gl.length, ol.length, (gi, oi) => {
return gl[gi].value === ol[oi].value;
}, (len, gi, oi) => {
commonItems.push([gi, oi, len]);
Expand Down
2 changes: 1 addition & 1 deletion lib/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { mergeV8Coverage, saveV8Report } = require('./v8/v8.js');
const { convertV8List } = require('./converter/converter.js');
const { resolveSourceMap } = require('./converter/collect-source-maps.js');

const { minimatch } = require('./packages/monocart-coverage-vendor.js');
const { minimatch } = require('minimatch');
const { getGroupedRows } = require('./utils/snapshot.js');
const generateMarkdownGrid = require('./utils/markdown.js');

Expand Down
4 changes: 3 additions & 1 deletion lib/v8/v8.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const path = require('path');
const EC = require('eight-colors');
const { minimatch } = require('minimatch');
const { mergeScriptCovs } = require('@bcoe/v8-coverage');

const Util = require('../utils/util.js');
const { getV8Summary } = require('./v8-summary.js');
const { dedupeFlatRanges } = require('../utils/dedupe.js');
const {
resolveAnonymousUrl, normalizeSourcePath, getSourcePathReplacer
} = require('../utils/source-path.js');
const { mergeScriptCovs, minimatch } = require('../packages/monocart-coverage-vendor.js');
const { collectSourceMaps } = require('../converter/collect-source-maps.js');
const version = require('../../package.json').version;

Expand Down
20 changes: 7 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,21 @@
"url": "git+https://github.com/cenfun/monocart-coverage-reports.git"
},
"dependencies": {
"@bcoe/v8-coverage": "^0.2.3",
"@jridgewell/sourcemap-codec": "^1.4.15",
"acorn": "^8.12.1",
"acorn-loose": "^8.4.0",
"acorn-walk": "^8.3.3",
"commander": "^12.1.0",
"console-grid": "^2.2.2",
"diff-sequences": "^29.6.3",
"eight-colors": "^1.3.0",
"foreground-child": "^3.2.1",
"istanbul-lib-coverage": "^3.2.2",
"istanbul-lib-report": "^3.0.1",
"istanbul-reports": "^3.1.7",
"lz-utils": "^2.0.2",
"minimatch": "^9.0.5",
"monocart-code-viewer": "^1.1.4",
"monocart-formatter": "^3.0.0",
"monocart-locator": "^1.0.2",
Expand All @@ -97,7 +101,6 @@
"eslint-plugin-html": "^8.1.1",
"eslint-plugin-vue": "^9.27.0",
"find-up": "^7.0.0",
"minimatch": "^9.0.5",
"starfall-cli": "^2.0.20",
"stylelint": "^16.6.1",
"stylelint-config-plus": "^1.1.2",
Expand Down
3 changes: 0 additions & 3 deletions packages/vendor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"license": "MIT",
"dependencies": {},
"devDependencies": {
"@bcoe/v8-coverage": "^0.2.3",
"@jridgewell/sourcemap-codec": "^1.4.15",
"convert-source-map": "^2.0.0",
"diff-sequences": "^29.6.3",
"postcss": "^8.4.39"
},
"platform": "node"
Expand Down
15 changes: 0 additions & 15 deletions packages/vendor/src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import * as convertSourceMap from 'convert-source-map';

import { decode } from '@jridgewell/sourcemap-codec';

import { mergeScriptCovs } from '@bcoe/v8-coverage';

import parseCss from 'postcss/lib/parse';

import { minimatch } from 'minimatch';

import WebSocket from 'ws';

import diff from 'diff-sequences';

import { findUpSync } from 'find-up';

import supportsColor from 'supports-color';
Expand All @@ -20,17 +12,10 @@ export {

convertSourceMap,

decode,

mergeScriptCovs,

parseCss,

minimatch,
WebSocket,

diff,

findUpSync,

supportsColor
Expand Down

0 comments on commit e621c83

Please sign in to comment.