@@ -41,11 +41,6 @@ interface InstallOptions {
4141 * Registry URL (default: https://registry.npmjs.org)
4242 */
4343 registry ?: string ;
44-
45- /**
46- * Called when a package is being installed
47- */
48- onProgress ?: ( message : string ) => void ;
4944}
5045
5146interface InstallResult {
@@ -79,7 +74,7 @@ export async function installDependencies(
7974 files : Files ,
8075 options : InstallOptions = { }
8176) : Promise < InstallResult > {
82- const { dev = false , registry = NPM_REGISTRY , onProgress } = options ;
77+ const { dev = false , registry = NPM_REGISTRY } = options ;
8378
8479 const result : InstallResult = {
8580 files : { ...files } ,
@@ -119,15 +114,7 @@ export async function installDependencies(
119114 // Install all dependencies in parallel
120115 await Promise . all (
121116 Object . entries ( depsToInstall ) . map ( ( [ name , versionRange ] ) =>
122- installPackage (
123- name ,
124- versionRange ,
125- result ,
126- installedPackages ,
127- inProgress ,
128- registry ,
129- onProgress
130- )
117+ installPackage ( name , versionRange , result , installedPackages , inProgress , registry )
131118 )
132119 ) ;
133120
@@ -143,8 +130,7 @@ async function installPackage(
143130 result : InstallResult ,
144131 installedPackages : Map < string , string > ,
145132 inProgress : Map < string , Promise < void > > ,
146- registry : string ,
147- onProgress ?: ( message : string ) => void
133+ registry : string
148134) : Promise < void > {
149135 // Skip if already installed
150136 if ( installedPackages . has ( name ) ) {
@@ -193,15 +179,7 @@ async function installPackage(
193179 const deps = versionMetadata . dependencies ?? { } ;
194180 await Promise . all (
195181 Object . entries ( deps ) . map ( ( [ depName , depVersion ] ) =>
196- installPackage (
197- depName ,
198- depVersion ,
199- result ,
200- installedPackages ,
201- inProgress ,
202- registry ,
203- onProgress
204- )
182+ installPackage ( depName , depVersion , result , installedPackages , inProgress , registry )
205183 )
206184 ) ;
207185 } catch ( error ) {
0 commit comments