File tree Expand file tree Collapse file tree 6 files changed +18
-95
lines changed
Expand file tree Collapse file tree 6 files changed +18
-95
lines changed Original file line number Diff line number Diff line change 5353 "dependencies" : {
5454 "chalk" : " ^4.1.0" ,
5555 "imagemin" : " ^7.0.1" ,
56+ "@bsmth/loader-progress" : " ^1.0.0" ,
5657 "imagemin-gifsicle" : " ^7.0.0" ,
5758 "imagemin-mozjpeg" : " ^9.0.0" ,
5859 "imagemin-pngquant" : " ^9.0.1" ,
Original file line number Diff line number Diff line change 77 read as cacheRead ,
88 getFilename ,
99} from '@bsmth/loader-cache' ;
10+ import { trackJob } from '@bsmth/loader-progress' ;
1011import type BasisOptions from '../types/BasisOptions' ;
11- import { trackJob , completeJob } from './jobTracker' ;
1212
1313const asyncExec = promisify ( exec ) ;
1414
@@ -115,7 +115,7 @@ export default async function createBasisFile({
115115 }
116116 }
117117
118- const job = trackJob ( {
118+ const completeJob = trackJob ( {
119119 reportName,
120120 text : 'compressing .basis' ,
121121 } ) ;
@@ -126,7 +126,7 @@ export default async function createBasisFile({
126126 if ( stderr ) {
127127 throw new Error ( `BASIS COMPRESSION FAILED: ${ stderr } ` ) ;
128128 } else {
129- completeJob ( job ) ;
129+ completeJob ( ) ;
130130 }
131131
132132
Original file line number Diff line number Diff line change 99 read as cacheRead ,
1010 write as cacheWrite ,
1111} from '@bsmth/loader-cache' ;
12+ import { trackJob } from '@bsmth/loader-progress' ;
1213import type { ImgLoaderQualityOptions } from '../types/ImgLoaderOptions' ;
13- import { completeJob , trackJob } from './jobTracker' ;
1414
1515
1616interface CreateImageFileProps {
@@ -52,7 +52,7 @@ export default async function createImageFile({
5252
5353 if ( cached ) return cached ;
5454
55- const job = trackJob ( {
55+ const completeJob = trackJob ( {
5656 reportName,
5757 text : `compressing .${ type } ` ,
5858 } ) ;
@@ -84,14 +84,14 @@ export default async function createImageFile({
8484 } ) ;
8585 }
8686
87- const path = await writeFile ( {
87+ const path = await cacheWrite ( {
8888 buffer : outBuffer ,
8989 options : relevantOptions ,
9090 inputHash,
9191 resource,
9292 } ) ;
9393
94- completeJob ( job ) ;
94+ completeJob ( ) ;
9595
9696 return {
9797 buffer : outBuffer ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44 read as cacheRead ,
55 write as cacheWrite ,
66} from '@bsmth/loader-cache' ;
7+ import { trackJob } from '@bsmth/loader-progress' ;
78import type { ImgLoaderInternalOptions } from '../types/ImgLoaderOptions' ;
8- import { completeJob , trackJob } from './jobTracker' ;
99
1010
1111interface ResizeProps {
@@ -41,7 +41,7 @@ export default async function resize({
4141
4242 if ( cached ) return cached ;
4343
44- const job = trackJob ( {
44+ const completeJob = trackJob ( {
4545 reportName,
4646 text : options . forcePowerOfTwo ? 'resizing to POT' : 'downscaling' ,
4747 } ) ;
@@ -61,7 +61,7 @@ export default async function resize({
6161 ...cacheOpts ,
6262 } ) ;
6363
64- completeJob ( job ) ;
64+ completeJob ( ) ;
6565
6666 return {
6767 buffer,
Original file line number Diff line number Diff line change 894894 version "0.4.0"
895895 resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.0.tgz#99cc0a0584d72f1df38b900fb062ba995f395547"
896896 integrity sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==
897+ " @bsmth/loader-progress@^1.0.0 " :
898+ version "1.0.0"
899+ resolved "https://registry.yarnpkg.com/@bsmth/loader-progress/-/loader-progress-1.0.0.tgz#bba93adc9b3aa9333930b71f1bfe7d29ecc5234e"
900+ integrity sha512-8lmNHLuK/HZdIUjSWzUSKMtRAez+HspqG3CXqlxkFS52ud6XdNbEavUGsEu/SRvITYfnNt8wmkMmuUOYvJPKag==
901+ dependencies :
902+ chalk "^4.1.1"
903+ ora "^5.4.0"
897904 dependencies :
898905 ajv "^6.12.4"
899906 debug "^4.1.1"
You can’t perform that action at this time.
0 commit comments