@@ -2,7 +2,7 @@ import path from 'path'
22import { blue , white , yellow , bold , underline } from '@colors/colors/safe'
33import AdmZip from 'adm-zip'
44import slugify from 'slugify'
5- import { BuildOptions } from '../extensionBuild'
5+ import { type BuildOptions } from '../extensionBuild'
66import fs from 'fs'
77import ignore from 'ignore'
88import { glob } from 'glob'
@@ -36,7 +36,10 @@ function getExtensionExtension(vendor: string): string {
3636 }
3737}
3838
39- function getPackageName ( manifest : any , options : BuildOptions ) : string {
39+ function getPackageName (
40+ manifest : Record < string , string > ,
41+ options : BuildOptions
42+ ) : string {
4043 const sanitizedStr = sanitizeString ( options . zipFilename || manifest . name )
4144 if ( options . zipFilename ) return sanitizedStr
4245
@@ -72,7 +75,9 @@ export default function generateZip(
7275 const outputDir = path . join ( projectDir , 'dist' , browser )
7376 // We collect data from the projectDir if the user wants to zip the source files.
7477 const dataDir = options . zipSource ? projectDir : outputDir
75- const manifest = require ( path . join ( dataDir , 'manifest.json' ) )
78+ const manifest : Record < string , string > = require (
79+ path . join ( dataDir , 'manifest.json' )
80+ )
7681 const name = getPackageName ( manifest , options )
7782 const ext = getExtensionExtension ( browser )
7883 const distZipPath = path . join ( outputDir , `${ name } .${ ext } ` )
@@ -86,9 +91,9 @@ export default function generateZip(
8691 )
8792 const zip = new AdmZip ( )
8893 const files = getFilesToZip ( projectDir )
89- files . forEach ( ( file ) =>
94+ files . forEach ( ( file ) => {
9095 zip . addLocalFile ( path . join ( projectDir , file ) , path . dirname ( file ) )
91- )
96+ } )
9297 zip . writeZip ( sourceZipPath )
9398 }
9499
0 commit comments