Skip to content

Commit

Permalink
bump lz-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jul 25, 2024
1 parent 47bd6f5 commit 714b1da
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 34 deletions.
9 changes: 6 additions & 3 deletions lib/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Assets = {
const {
inline,
reportData,
jsFiles,
assetsPath,
outputDir,
htmlFile,
Expand All @@ -44,9 +45,11 @@ const Assets = {
const jsList = [];

// deps
jsList.push({
filename: 'monocart-coverage-app.js',
str: Assets.getFileContent('monocart-coverage-app')
jsFiles.forEach((id) => {
jsList.push({
filename: `${id}.js`,
str: Assets.getFileContent(id)
});
});

// html content
Expand Down
2 changes: 2 additions & 0 deletions lib/v8/v8.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,12 @@ const handleV8HtmlReport = async (reportData, reportOptions, options) => {
const outputDir = path.dirname(reportPath);
const htmlFile = path.basename(reportPath);

const jsFiles = ['monocart-coverage-app'];
// console.log(jsFiles);

const htmlOptions = {
reportData,
jsFiles,
inline,
assetsPath,
outputDir,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"istanbul-lib-coverage": "^3.2.2",
"istanbul-lib-report": "^3.0.1",
"istanbul-reports": "^3.1.7",
"lz-utils": "^2.0.2",
"lz-utils": "^2.1.0",
"minimatch": "9.0.5",
"monocart-locator": "^1.0.2"
},
Expand Down
12 changes: 0 additions & 12 deletions packages/loader/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/loader/src/index.js

This file was deleted.

12 changes: 2 additions & 10 deletions scripts/conf.cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const copyVendor = (EC, toPath) => {
};

const buildAssets = (EC, toPath) => {
const { deflateSync } = require('lz-utils');
const { createScriptLoader } = require('lz-utils');

const toJs = path.resolve(toPath, 'monocart-coverage-assets.js');

Expand All @@ -78,16 +78,8 @@ const buildAssets = (EC, toPath) => {
if (!fs.existsSync(appPath)) {
return;
}
const loaderPath = path.resolve(__dirname, '../packages/loader/dist/monocart-coverage-loader.js');
if (!fs.existsSync(loaderPath)) {
return;
}

const appContent = fs.readFileSync(appPath).toString('utf-8');
const loaderContent = fs.readFileSync(loaderPath).toString('utf-8');

return loaderContent.replace('{compressed_placeholder}', deflateSync(appContent));

return createScriptLoader(appContent);
}
}];

Expand Down
2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"mocha": "^10.7.0",
"open": "^10.1.0",
"playwright": "^1.45.3",
"puppeteer": "^22.13.1",
"puppeteer": "^22.14.0",
"rollup": "^4.19.0",
"swc-loader": "^0.2.6",
"ts-loader": "^9.5.1",
Expand Down
2 changes: 2 additions & 0 deletions test/test-merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const coverageOptions = {
'v8'
],

inline: true,

// merge from exists raw dirs
inputDir: './docs/node-vm/raw, ./docs/cli/raw, ./wrong-raw-dir',

Expand Down

0 comments on commit 714b1da

Please sign in to comment.