Skip to content

Commit 29f9ce0

Browse files
committed
refactor(cli-utils): writeBaseline - same param order as for writeFile
1 parent 71fbc35 commit 29f9ce0

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

packages/cli-utils/src/baseline.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export async function readBaseline(baselineFilepath: string): Promise<object> {
4242
return JSON.parse(file);
4343
}
4444

45-
export async function writeBaseline(data: JSON, baselineFilepath: string): Promise<void> {
45+
export async function writeBaseline(
46+
baselineFilepath: string,
47+
data: Record<string, unknown>,
48+
): Promise<void> {
4649
return fs.writeFile(baselineFilepath, JSON.stringify(data));
4750
}

packages/cli/src/run.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ export default async function run(options: RunOptions): Promise<void> {
6464
// Generate relative path relative to process.cwd()
6565
const baselinePath = getBaselineRelativePath(process.cwd(), '', baselineAbsolutePath);
6666

67-
console.log({
68-
dirname: __dirname,
69-
cwd: process.cwd(),
70-
baselineAbsolutePath,
71-
baselinePath,
72-
});
73-
7467
const tasks = new Listr([
7568
{
7669
title: 'Read Webpack stats files',
@@ -125,9 +118,9 @@ export default async function run(options: RunOptions): Promise<void> {
125118
title: 'Write baseline data',
126119
task: (ctx, task) => {
127120
const stats = get(ctx, 'sources[0]webpack');
128-
const filteredWebpackStats = webpackFilter(stats) as JSON;
121+
const filteredWebpackStats = webpackFilter(stats) as Record<string, unknown>;
129122

130-
return writeBaseline(filteredWebpackStats, baselineAbsolutePath).then(() => {
123+
return writeBaseline(baselineAbsolutePath, filteredWebpackStats).then(() => {
131124
// eslint-disable-next-line no-param-reassign
132125
task.title = `${task.title} (${baselinePath})`;
133126
});

0 commit comments

Comments
 (0)