From 741db12f262f35250fa5b9f2b9a4e5d553337aa8 Mon Sep 17 00:00:00 2001 From: cenfun Date: Thu, 27 Jun 2024 12:32:26 +0800 Subject: [PATCH 1/5] add cache for diff results --- lib/converter/converter.js | 1 + lib/converter/find-original-range.js | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/converter/converter.js b/lib/converter/converter.js index 4ee199eb..0f40d9a1 100644 --- a/lib/converter/converter.js +++ b/lib/converter/converter.js @@ -1550,6 +1550,7 @@ const convertV8List = (v8list, options) => { maxContentLength, decodedMappings: [], cacheMap: new Map(), + diffCache: new Map(), // coverage info bytes: [], functions: [], diff --git a/lib/converter/find-original-range.js b/lib/converter/find-original-range.js index c2413b9e..deab7eed 100644 --- a/lib/converter/find-original-range.js +++ b/lib/converter/find-original-range.js @@ -39,7 +39,12 @@ const findMapping = (list, offset) => { // ======================================================================================================== -const alignText = (gt, ot) => { +const alignText = (gt, ot, diffCache) => { + + const key = gt + ot; + if (diffCache.has(key)) { + return diffCache.get(key); + } const toList = (s) => { return s.split('').map((v, i) => { @@ -115,6 +120,8 @@ const alignText = (gt, ot) => { mergeList(gList, oList); } + diffCache.set(key, gl); + // console.log(gl); return gl; }; @@ -136,7 +143,7 @@ const getWordEndPosition = (list, gp, direction) => { } }; -const getAlignPosition = (gt, gp, ot, direction) => { +const getAlignPosition = (gt, gp, ot, direction, diffCache) => { // there is no need to align for long text const maxLength = 500; @@ -162,7 +169,7 @@ const getAlignPosition = (gt, gp, ot, direction) => { // only for original first line text // exclusive - const list = alignText(gt, ot); + const list = alignText(gt, ot, diffCache); const item = list[gp]; if (item && item.original) { return { @@ -305,7 +312,7 @@ const getComparedPosition = (info, direction) => { // ============================= - return getAlignPosition(gt, gp, ot, direction); + return getAlignPosition(gt, gp, ot, direction, info.diffCache); }; @@ -506,6 +513,7 @@ const getFixedOriginalStart = (start, mappings, state, cache) => { const info = { fake: state.fake, + diffCache: state.diffCache, generatedText, generatedPos, originalText, @@ -559,6 +567,7 @@ const getFixedOriginalEnd = (end, mappings, state, cache) => { const info = { fake: state.fake, + diffCache: state.diffCache, offset: end, generatedText, generatedPos, From 5fe0630ab10e4568f26da40af3f4fb15a4c14338 Mon Sep 17 00:00:00 2001 From: cenfun Date: Thu, 27 Jun 2024 20:59:43 +0800 Subject: [PATCH 2/5] added cache and time log --- lib/converter/converter.js | 14 +++++--- lib/converter/find-original-range.js | 50 ++++++++++++++++++---------- lib/generate.js | 15 +++++++-- lib/index.js | 16 ++++++--- lib/istanbul/istanbul.js | 2 ++ lib/v8/v8.js | 2 ++ 6 files changed, 70 insertions(+), 29 deletions(-) diff --git a/lib/converter/converter.js b/lib/converter/converter.js index 0f40d9a1..43fc8b3e 100644 --- a/lib/converter/converter.js +++ b/lib/converter/converter.js @@ -1532,7 +1532,7 @@ const convertV8List = (v8list, options) => { delete item.ranges; } } - Util.logTime(`- parsed ast: ${sourcePath} (${EC.cyan(Util.BSF(maxContentLength))})`, time_start_ast); + Util.logTime(` ┌ [convert] parsed ast: ${sourcePath} (${EC.cyan(Util.BSF(maxContentLength))})`, time_start_ast); // console.log(sourcePath, astInfo.statements.length); // ============================ @@ -1549,8 +1549,9 @@ const convertV8List = (v8list, options) => { locator, maxContentLength, decodedMappings: [], - cacheMap: new Map(), + rangeCache: new Map(), diffCache: new Map(), + // cacheHits: 0, // coverage info bytes: [], functions: [], @@ -1567,7 +1568,7 @@ const convertV8List = (v8list, options) => { const time_start_unpack = Date.now(); unpackDistFile(item, state, options); const unpackedFiles = EC.cyan(`${state.originalList.length} files`); - Util.logTime(`- unpacked dist: ${sourcePath} (${unpackedFiles})`, time_start_unpack); + Util.logTime(` ┌ [convert] unpacked dist: ${sourcePath} (${unpackedFiles})`, time_start_unpack); stateList.push(state); @@ -1576,7 +1577,12 @@ const convertV8List = (v8list, options) => { const time_start_convert = Date.now(); const dataList = generateV8DataList(stateList, options); const dataFiles = EC.cyan(`${dataList.v8DataList.length} files`); - Util.logTime(`- generated data list (${dataFiles})`, time_start_convert); + + // stateList.forEach((st) => { + // console.log('diffCache', st.diffCache.size, 'cacheHits', st.cacheHits); + // }); + + Util.logTime(` ┌ [convert] converted data list (${dataFiles})`, time_start_convert); return dataList; }; diff --git a/lib/converter/find-original-range.js b/lib/converter/find-original-range.js index deab7eed..1d68a30e 100644 --- a/lib/converter/find-original-range.js +++ b/lib/converter/find-original-range.js @@ -39,11 +39,16 @@ const findMapping = (list, offset) => { // ======================================================================================================== -const alignText = (gt, ot, diffCache) => { +const alignText = (gt, ot, info) => { - const key = gt + ot; - if (diffCache.has(key)) { - return diffCache.get(key); + const { diffCache } = info.state; + + if (diffCache.has(gt)) { + const subMap = diffCache.get(gt); + if (subMap.has(ot)) { + // info.state.cacheHits += 1; + return subMap.get(ot); + } } const toList = (s) => { @@ -120,7 +125,14 @@ const alignText = (gt, ot, diffCache) => { mergeList(gList, oList); } - diffCache.set(key, gl); + if (diffCache.has(gt)) { + const subMap = diffCache.get(gt); + subMap.set(ot, gl); + } else { + const subMap = new Map(); + diffCache.set(gt, subMap); + subMap.set(ot, gl); + } // console.log(gl); return gl; @@ -143,7 +155,11 @@ const getWordEndPosition = (list, gp, direction) => { } }; -const getAlignPosition = (gt, gp, ot, direction, diffCache) => { +const getAlignPosition = (info, direction) => { + + const gt = info.generatedText; + const gp = info.generatedPos; + const ot = info.originalText; // there is no need to align for long text const maxLength = 500; @@ -169,7 +185,7 @@ const getAlignPosition = (gt, gp, ot, direction, diffCache) => { // only for original first line text // exclusive - const list = alignText(gt, ot, diffCache); + const list = alignText(gt, ot, info); const item = list[gp]; if (item && item.original) { return { @@ -312,7 +328,7 @@ const getComparedPosition = (info, direction) => { // ============================= - return getAlignPosition(gt, gp, ot, direction, info.diffCache); + return getAlignPosition(info, direction); }; @@ -332,7 +348,7 @@ const getSimilarPosition = (info, direction) => { } // no need comparison for fake source - if (info.fake) { + if (info.state.fake) { return; } @@ -512,8 +528,7 @@ const getFixedOriginalStart = (start, mappings, state, cache) => { const direction = 'start'; const info = { - fake: state.fake, - diffCache: state.diffCache, + state, generatedText, generatedPos, originalText, @@ -566,8 +581,7 @@ const getFixedOriginalEnd = (end, mappings, state, cache) => { const direction = 'end'; const info = { - fake: state.fake, - diffCache: state.diffCache, + state, offset: end, generatedText, generatedPos, @@ -835,11 +849,11 @@ const getMappingInfo = (start, end, state) => { const findOriginalRange = (start, end, state, originalMap) => { - const { sourcePath, cacheMap } = state; + const { sourcePath, rangeCache } = state; const key = `${start}_${end}`; - if (cacheMap.has(key)) { - return cacheMap.get(key); + if (rangeCache.has(key)) { + return rangeCache.get(key); } const createMappingError = (errors) => { @@ -852,7 +866,7 @@ const findOriginalRange = (start, end, state, originalMap) => { }; // cache error response - cacheMap.set(key, res); + rangeCache.set(key, res); return res; }; @@ -893,7 +907,7 @@ const findOriginalRange = (start, end, state, originalMap) => { }; // cache response - cacheMap.set(key, res); + rangeCache.set(key, res); return res; diff --git a/lib/generate.js b/lib/generate.js index 0c7b2c7d..40a8807a 100644 --- a/lib/generate.js +++ b/lib/generate.js @@ -21,7 +21,6 @@ const { getGroupedRows } = require('./utils/snapshot.js'); // maybe v8 or to istanbul reports const generateV8ListReports = async (v8list, coverageData, fileSources, options) => { - const time_start = Date.now(); let istanbulReportPath; // v8 to istanbul reports if (options.reportGroup.istanbul) { @@ -32,7 +31,6 @@ const generateV8ListReports = async (v8list, coverageData, fileSources, options) // v8 reports and v8 coverage results // could be no v8 or v8-json, but requires v8 coverage results const v8CoverageResults = await saveV8Report(v8list, options, istanbulReportPath); - Util.logTime('- saved coverage reports', time_start); return v8CoverageResults; }; @@ -434,9 +432,15 @@ const getCoverageResults = async (dataList, sourceCache, options) => { // v8list if (dataType === 'v8') { // merge v8list first + const t1 = Date.now(); const v8list = await mergeV8Coverage(dataList, sourceCache, options); + Util.logTime('┌ [generate] merged v8 coverage data', t1); // console.log('after merge', v8list.map((it) => it.url)); + + const t2 = Date.now(); const results = convertV8List(v8list, options); + Util.logTime('┌ [generate] converted coverage data', t2); + const { v8DataList, coverageData, fileSources } = results; @@ -444,9 +448,12 @@ const getCoverageResults = async (dataList, sourceCache, options) => { } // istanbul data + const t3 = Date.now(); const istanbulData = mergeIstanbulCoverage(dataList); const { coverageData, fileSources } = initIstanbulData(istanbulData, options); - return saveIstanbulReports(coverageData, fileSources, options); + Util.logTime('┌ [generate] prepared istanbul coverage data', t3); + const results = await saveIstanbulReports(coverageData, fileSources, options); + return results; }; const generateCoverageReports = async (dataList, sourceCache, options) => { @@ -468,11 +475,13 @@ const generateCoverageReports = async (dataList, sourceCache, options) => { for (const reportName of bothReports) { const reportOptions = bothGroup[reportName]; const buildInHandler = buildInBothReports[reportName]; + const t1 = Date.now(); if (buildInHandler) { await buildInHandler(coverageResults, reportOptions, options); } else { await Util.runCustomReporter(reportName, coverageResults, reportOptions, options); } + Util.logTime(`┌ [generate] saved report: ${reportName}`, t1); } } diff --git a/lib/index.js b/lib/index.js index 49f744f0..5a086ce8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -123,11 +123,17 @@ class CoverageReport { } // add coverage from dir - addFromDir(dir) { + async addFromDir(dir) { + const time_start = Date.now(); + const entryFilter = this.getEntryFilter(); - return readFromDir(dir, entryFilter, (coverageData) => { + const results = await readFromDir(dir, entryFilter, (coverageData) => { return this.add(coverageData); }); + + Util.logTime(`added from dir: ${dir}`, time_start); + + return results; } // generate report @@ -179,19 +185,21 @@ class CoverageReport { }); } + Util.logTime('┌ [generate] prepared coverage data', time_start); + const coverageResults = await generateCoverageReports(dataList, sourceCache, this.options); if (this.logging !== 'debug') { Util.rmSync(cacheDir); } - Util.logTime(`generated coverage reports: ${EC.cyan(coverageResults.reportPath)}`, time_start); - const onEnd = this.options.onEnd; if (typeof onEnd === 'function') { await onEnd.call(this, coverageResults); } + Util.logTime(`generated coverage reports: ${EC.cyan(coverageResults.reportPath)}`, time_start); + return coverageResults; } diff --git a/lib/istanbul/istanbul.js b/lib/istanbul/istanbul.js index 81facc7e..773efbbc 100644 --- a/lib/istanbul/istanbul.js +++ b/lib/istanbul/istanbul.js @@ -89,9 +89,11 @@ const saveIstanbulReports = (coverageData, fileSources, options) => { const istanbulGroup = options.reportGroup.istanbul; Object.keys(istanbulGroup).forEach((reportName) => { + const t1 = Date.now(); const reportOptions = istanbulGroup[reportName]; const report = istanbulReports.create(reportName, reportOptions); report.execute(context); + Util.logTime(`┌ [generate] saved report: ${reportName}`, t1); }); // add watermarks and color diff --git a/lib/v8/v8.js b/lib/v8/v8.js index 7f4f2072..60316402 100644 --- a/lib/v8/v8.js +++ b/lib/v8/v8.js @@ -391,11 +391,13 @@ const saveV8Report = async (v8list, options, istanbulReportPath) => { for (const reportName of v8Reports) { const reportOptions = v8Group[reportName]; const buildInHandler = buildInV8Reports[reportName]; + const t1 = Date.now(); if (buildInHandler) { outputs[reportName] = await buildInHandler(reportData, reportOptions, options); } else { outputs[reportName] = await Util.runCustomReporter(reportName, reportData, reportOptions, options); } + Util.logTime(`┌ [generate] saved report: ${reportName}`, t1); } } From f43278bf054fc152c3bf26b9f4858fe9af35188b Mon Sep 17 00:00:00 2001 From: cenfun Date: Fri, 28 Jun 2024 12:35:05 +0800 Subject: [PATCH 3/5] refactor --- lib/converter/collect-source-maps.js | 43 ++++----- lib/converter/converter.js | 2 +- lib/generate.js | 129 ++++++++++++++++++--------- lib/index.js | 36 ++------ lib/v8/v8.js | 23 ++++- 5 files changed, 136 insertions(+), 97 deletions(-) diff --git a/lib/converter/collect-source-maps.js b/lib/converter/collect-source-maps.js index 06fc0927..ed5e2f95 100644 --- a/lib/converter/collect-source-maps.js +++ b/lib/converter/collect-source-maps.js @@ -128,18 +128,6 @@ const resolveSourceMap = (data, url) => { }; -const saveSourceFile = async (filePath, data) => { - await Util.writeFile(filePath, JSON.stringify(data)); - - // save source and sourcemap file for debug - // https://evanw.github.io/source-map-visualization - // if (data.sourceMap) { - // await Util.writeFile(`${filePath}.js`, data.source); - // await Util.writeFile(`${filePath}.js.map`, JSON.stringify(data.sourceMap)); - // } - -}; - const getInlineSourceMap = (content) => { let smc; try { @@ -153,7 +141,8 @@ const getInlineSourceMap = (content) => { const collectSourceMaps = async (v8list, options) => { - const smList = []; + const sourceList = []; + const sourcemapList = []; const concurrency = new Concurrency(); for (const item of v8list) { @@ -192,11 +181,13 @@ const collectSourceMaps = async (v8list, options) => { const smc = getInlineSourceMap(source); if (smc) { sourceData.sourceMap = resolveSourceMap(smc.sourcemap, url); - smList.push({ + sourcemapList.push({ url, inline: true }); - await saveSourceFile(sourcePath, sourceData); + sourceList.push({ + sourcePath, sourceData + }); continue; } // from url async @@ -212,26 +203,38 @@ const collectSourceMaps = async (v8list, options) => { } // no need check sourceMap - await saveSourceFile(sourcePath, sourceData); + sourceList.push({ + sourcePath, sourceData + }); } // from url concurrency await concurrency.start(async (item) => { - const { sourceMapUrl, sourceData } = item; + const { + sourceMapUrl, sourcePath, sourceData + } = item; const { url } = sourceData; const data = await loadSourceMap(sourceMapUrl); if (data) { sourceData.sourceMap = resolveSourceMap(data, url); - smList.push({ + sourcemapList.push({ url, sourceMapUrl }); } - await saveSourceFile(item.sourcePath, sourceData); + + sourceList.push({ + sourcePath, + sourceData + }); + }); - return smList; + return { + sourceList, + sourcemapList + }; }; diff --git a/lib/converter/converter.js b/lib/converter/converter.js index 43fc8b3e..fed6095d 100644 --- a/lib/converter/converter.js +++ b/lib/converter/converter.js @@ -1568,7 +1568,7 @@ const convertV8List = (v8list, options) => { const time_start_unpack = Date.now(); unpackDistFile(item, state, options); const unpackedFiles = EC.cyan(`${state.originalList.length} files`); - Util.logTime(` ┌ [convert] unpacked dist: ${sourcePath} (${unpackedFiles})`, time_start_unpack); + Util.logTime(` ┌ [convert] unpacked sourcemap: ${sourcePath} (${unpackedFiles})`, time_start_unpack); stateList.push(state); diff --git a/lib/generate.js b/lib/generate.js index 40a8807a..da758f85 100644 --- a/lib/generate.js +++ b/lib/generate.js @@ -672,28 +672,92 @@ const getEmptyData = (all, dataList) => { // ======================================================================================================== +const getInputList = (mcr) => { + // get input dirs + const { inputDir, cacheDir } = mcr.options; -const getInputData = async (inputList, all, cacheDir, addHandler) => { - const dataList = []; - const sourceCache = new Map(); + const inputDirs = Util.toList(inputDir, ','); - const addJsonData = async (dir, filename) => { - const isCoverage = filename.startsWith('coverage-'); - const isSource = filename.startsWith('source-'); - if (isCoverage || isSource) { - const content = await Util.readFile(path.resolve(dir, filename)); + const inputList = inputDirs.filter((dir) => { + const hasDir = fs.existsSync(dir); + if (!hasDir) { + // could be empty + Util.logInfo(`Not found coverage data dir: ${Util.relativePath(dir)}`); + } + return hasDir; + }); + + if (mcr.hasCache()) { + inputList.push(cacheDir); + } + + return inputList; +}; + +const addJsonData = async (dataList, sourceCache, dir, filename) => { + const isCoverage = filename.startsWith('coverage-'); + const isSource = filename.startsWith('source-'); + if (isCoverage || isSource) { + const content = await Util.readFile(path.resolve(dir, filename)); + if (content) { + const json = JSON.parse(content); + if (isCoverage) { + dataList.push(json); + } else { + sourceCache.set(json.id, json); + } + } + } +}; + +const addEmptyData = async (mcr, dataList, sourceCache) => { + + const { all, cacheDir } = mcr.options; + // add empty coverage for all files + // dataList for data type, before `add` we don't which one is tested, because using hash id + const emptyData = getEmptyData(all, dataList); + if (!emptyData) { + return; + } + + Util.logDebug(`added "all" files with empty coverage: ${EC.yellow(emptyData.length)}`); + const coverageResults = await mcr.add(emptyData); + // after `add` + if (!coverageResults) { + return; + } + + dataList.push(coverageResults); + + if (coverageResults.type === 'v8') { + // sourceCache + coverageResults.data.forEach((entry) => { + const { id } = entry; + if (sourceCache.has(id)) { + // console.log('+', entry.sourcePath); + return; + } + // console.log('-', entry.sourcePath); + const sourcePath = Util.resolveCacheSourcePath(cacheDir, id); + const content = Util.readFileSync(sourcePath); if (content) { const json = JSON.parse(content); - if (isCoverage) { - dataList.push(json); - } else { - sourceCache.set(json.id, json); - } + sourceCache.set(json.id, json); } - } - }; + }); + } +}; + +const getInputData = async (mcr) => { + + const inputList = getInputList(mcr); + // console.log('input list', inputList); + + const dataList = []; + const sourceCache = new Map(); for (const dir of inputList) { + const allFiles = fs.readdirSync(dir); if (!allFiles.length) { continue; @@ -701,38 +765,17 @@ const getInputData = async (inputList, all, cacheDir, addHandler) => { for (const filename of allFiles) { // only json file if (filename.endsWith('.json')) { - await addJsonData(dir, filename); + await addJsonData(dataList, sourceCache, dir, filename); } } } - // add empty coverage for all files - // dataList for data type, before `add` we don't which one is tested, because using hash id - const emptyData = getEmptyData(all, dataList); - if (emptyData) { - Util.logDebug(`added empty files for all: ${EC.yellow(emptyData.length)}`); - const coverageResults = await addHandler(emptyData); - // after `add` - if (coverageResults) { - dataList.push(coverageResults); - if (coverageResults.type === 'v8') { - // sourceCache - coverageResults.data.forEach((entry) => { - const { id } = entry; - if (sourceCache.has(id)) { - // console.log('+', entry.sourcePath); - return; - } - // console.log('-', entry.sourcePath); - const sourcePath = Util.resolveCacheSourcePath(cacheDir, id); - const content = Util.readFileSync(sourcePath); - if (content) { - const json = JSON.parse(content); - sourceCache.set(json.id, json); - } - }); - } - } + await addEmptyData(mcr, dataList, sourceCache); + + if (!dataList.length) { + const dirs = inputList.map((dir) => Util.relativePath(dir)); + Util.logError(`Not found coverage data in dir(s): ${dirs.join(', ')}`); + return; } return { diff --git a/lib/index.js b/lib/index.js index 5a086ce8..fc0cfb8d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -107,15 +107,14 @@ class CoverageReport { if (Array.isArray(data)) { results.type = 'v8'; // could be empty list after entryFilter - results.data = await initV8ListAndSourcemap(data, this.options); + results.data = await initV8ListAndSourcemap(this, data); } else { results.type = 'istanbul'; results.data = data; } // save data to cache dir - const dataContent = JSON.stringify(results); - await Util.writeFile(dataPath, dataContent); + await Util.writeFile(dataPath, JSON.stringify(results)); Util.logTime(`added coverage data: ${results.type}`, time_start); @@ -143,34 +142,13 @@ class CoverageReport { this.initOptions(); - const { - all, inputDir, cacheDir - } = this.options; - - const inputDirs = Util.toList(inputDir, ','); - if (this.hasCache()) { - inputDirs.push(cacheDir); - } - - const inputList = inputDirs.filter((dir) => { - const hasDir = fs.existsSync(dir); - if (!hasDir) { - // could be empty - Util.logInfo(`Not found coverage data dir: ${Util.relativePath(dir)}`); - } - return hasDir; - }); - - const { dataList, sourceCache } = await getInputData(inputList, all, cacheDir, (emptyData) => { - return this.add(emptyData); - }); - - if (!dataList.length) { - const dirs = inputList.map((dir) => Util.relativePath(dir)); - Util.logError(`Not found coverage data in dir(s): ${dirs.join(', ')}`); + const inputData = await getInputData(this); + if (!inputData) { return; } + const { dataList, sourceCache } = inputData; + // empty output dir except cache dir before generate reports const outputDir = this.options.outputDir; @@ -190,7 +168,7 @@ class CoverageReport { const coverageResults = await generateCoverageReports(dataList, sourceCache, this.options); if (this.logging !== 'debug') { - Util.rmSync(cacheDir); + Util.rmSync(this.options.cacheDir); } const onEnd = this.options.onEnd; diff --git a/lib/v8/v8.js b/lib/v8/v8.js index 60316402..187ab164 100644 --- a/lib/v8/v8.js +++ b/lib/v8/v8.js @@ -65,7 +65,9 @@ const getEntryFilter = (options) => { return () => true; }; -const initV8ListAndSourcemap = async (v8list, options) => { +const initV8ListAndSourcemap = async (mcr, v8list) => { + + const { options } = mcr; // entry filter const entryFilter = getEntryFilter(options); @@ -172,13 +174,26 @@ const initV8ListAndSourcemap = async (v8list, options) => { // collect sourcemap first const time_start = Date.now(); - const smList = await collectSourceMaps(v8list, options); - if (smList.length) { + const { sourceList, sourcemapList } = await collectSourceMaps(v8list, options); + if (sourcemapList.length) { // debug level time - Util.logTime(`loaded sourcemaps: ${smList.length}`, time_start); + Util.logTime(`loaded sourcemaps: ${sourcemapList.length}`, time_start); // console.log(smList); } + // save source list + for (const item of sourceList) { + // sourcePath, sourceData + await Util.writeFile(item.sourcePath, JSON.stringify(item.sourceData)); + + // save source and sourcemap file for debug + // https://evanw.github.io/source-map-visualization + // if (data.sourceMap) { + // await Util.writeFile(`${filePath}.js`, data.source); + // await Util.writeFile(`${filePath}.js.map`, JSON.stringify(data.sourceMap)); + // } + } + return v8list; }; From be19bfb394d5972f5137680518135944c7d93f54 Mon Sep 17 00:00:00 2001 From: cenfun Date: Fri, 28 Jun 2024 12:39:30 +0800 Subject: [PATCH 4/5] bump dependencies --- package.json | 2 +- test/package.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 37d8ac9f..c0cbeefe 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "eslint-plugin-html": "^8.1.1", "eslint-plugin-vue": "^9.26.0", "find-up": "^7.0.0", - "minimatch": "^9.0.4", + "minimatch": "^9.0.5", "starfall-cli": "^2.0.19", "stylelint": "^16.6.1", "stylelint-config-plus": "^1.1.2", diff --git a/test/package.json b/test/package.json index 64a1fc8a..54409dfb 100644 --- a/test/package.json +++ b/test/package.json @@ -16,10 +16,10 @@ "foreground-child": "^3.2.1", "koa": "^2.15.3", "koa-static-resolver": "^1.0.6", - "mocha": "^10.4.0", + "mocha": "^10.5.2", "open": "^10.1.0", - "playwright": "^1.44.1", - "puppeteer": "^22.12.0", + "playwright": "^1.45.0", + "puppeteer": "^22.12.1", "rollup": "^4.18.0", "swc-loader": "^0.2.6", "ts-loader": "^9.5.1", From 8cf134fe3a3f2936f7753d08f251e09079444343 Mon Sep 17 00:00:00 2001 From: cenfun Date: Fri, 28 Jun 2024 13:34:12 +0800 Subject: [PATCH 5/5] fixed snapshot for new playwright anonymous --- test/snapshot/anonymous.snapshot.json | 22 +++++++++++----------- test/snapshot/css.snapshot.json | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/snapshot/anonymous.snapshot.json b/test/snapshot/anonymous.snapshot.json index 428d4f2f..8e00d2f0 100644 --- a/test/snapshot/anonymous.snapshot.json +++ b/test/snapshot/anonymous.snapshot.json @@ -1,20 +1,20 @@ { "type": "v8", "summary": { - "bytes": "34.23 %", - "statements": "29.27 %", - "branches": "15.33 %", - "functions": "52.00 %", - "lines": "27.97 %" + "bytes": "28.41 %", + "statements": "25.10 %", + "branches": "12.43 %", + "functions": "40.63 %", + "lines": "24.09 %" }, "files": { "anonymous-1.js": { - "functions": "47.83 %", - "branches": "15.33 %", - "statements": "27.14 %", - "lines": "25.10 %", - "bytes": "32.12 %", - "uncoveredLines": "5-19,21,34-62,65,68-83,85,87,89,91-98,106-107,111-205,225,229-235,240,246-248,250-255" + "functions": "36.67 %", + "branches": "12.43 %", + "statements": "23.18 %", + "lines": "21.50 %", + "bytes": "26.51 %", + "uncoveredLines": "5-19,21,34-62,65,68-83,85,87,89,91-98,106-107,111-205,218,229-235,240,246-248,250-255,258-299" }, "anonymous-2.js": { "functions": "100.00 %", diff --git a/test/snapshot/css.snapshot.json b/test/snapshot/css.snapshot.json index de62982c..49f39d97 100644 --- a/test/snapshot/css.snapshot.json +++ b/test/snapshot/css.snapshot.json @@ -8,20 +8,20 @@ "lines": "39.44 %" }, "files": { - "anonymous/style2.css": { + "anonymous/style1.css": { "functions": "", "branches": "", "statements": "", "lines": "50.00 %", - "bytes": "71.12 %", + "bytes": "70.81 %", "uncoveredLines": "7-9" }, - "anonymous/style1.css": { + "anonymous/style2.css": { "functions": "", "branches": "", "statements": "", "lines": "50.00 %", - "bytes": "70.81 %", + "bytes": "71.12 %", "uncoveredLines": "7-9" }, "anonymous/style3.css": {