11import debounce from 'debounce-promise' ;
2- import parcelWatcher , { subscribe } from '@parcel/watcher' ;
2+ import { subscribe as _subscribe } from '@parcel/watcher' ;
33import { AmplifySandboxExecutor } from './sandbox_executor.js' ;
44import {
55 BackendIdSandboxResolver ,
@@ -67,7 +67,7 @@ export const getBootstrapUrl = (region: string) =>
6767 * Runs a file watcher and deploys
6868 */
6969export class FileWatchingSandbox extends EventEmitter implements Sandbox {
70- private watcherSubscription : Awaited < ReturnType < typeof subscribe > > ;
70+ private watcherSubscription : Awaited < ReturnType < typeof _subscribe > > ;
7171 private outputFilesExcludedFromWatch = [ '.amplify' ] ;
7272 private filesChangesTracker : FilesChangesTracker ;
7373
@@ -80,7 +80,8 @@ export class FileWatchingSandbox extends EventEmitter implements Sandbox {
8080 private readonly ssmClient : SSMClient ,
8181 private readonly functionsLogStreamer : LambdaFunctionLogStreamer ,
8282 private readonly printer : Printer ,
83- private readonly open = _open
83+ private readonly open = _open ,
84+ private readonly subscribe = _subscribe
8485 ) {
8586 process . once ( 'SIGINT' , ( ) => void this . stop ( ) ) ;
8687 process . once ( 'SIGTERM' , ( ) => void this . stop ( ) ) ;
@@ -202,7 +203,7 @@ export class FileWatchingSandbox extends EventEmitter implements Sandbox {
202203 } ) ;
203204
204205 if ( watchForChanges ) {
205- this . watcherSubscription = await parcelWatcher . subscribe (
206+ this . watcherSubscription = await this . subscribe (
206207 watchDir ,
207208 async ( _ , events ) => {
208209 // Log and track file changes.
0 commit comments