@@ -103,7 +103,7 @@ VVVVContext.init('./', 'full', function (vvvv) {
103
103
if ( req . command ) {
104
104
if ( ! edit_mode )
105
105
return ;
106
- console . log ( 'receiving patch update for ' + vvvv . Helpers . prepareFilePath ( req . patch ) ) ;
106
+ // console.log('receiving patch update for '+vvvv.Helpers.prepareFilePath(req.patch));
107
107
var patches = patch . executionContext . Patches [ vvvv . Helpers . prepareFilePath ( req . patch ) ] ;
108
108
var i = patches . length ;
109
109
while ( i -- ) {
@@ -173,42 +173,47 @@ VVVVContext.init('./', 'full', function (vvvv) {
173
173
if ( patch ) patch . destroy ( ) ;
174
174
patch = undefined ;
175
175
mainloop . stop ( ) ;
176
+ mainloop . disposing = true ;
176
177
mainloop = undefined ;
177
178
console . log ( "Connection closed" ) ;
178
179
} )
179
180
conn . on ( "error" , function ( err ) {
180
181
if ( patch ) patch . destroy ( ) ;
181
182
patch = undefined ;
182
183
if ( mainloop ) mainloop . stop ( ) ;
184
+ if ( mainloop ) mainloop . disposing = true ;
183
185
mainloop = undefined ;
184
186
console . log ( "Connection closed/reset" ) ;
185
187
} )
186
188
} ) . listen ( 5001 )
189
+ } ) ;
187
190
188
- if ( argv . e && VVVVContext . name == 'nodejs' ) {
189
- var npm = require ( 'npm' ) ;
190
- console . log ( 'Checking for installed Node.js packages ...' )
191
- npm . load ( { loglevel : 'silent' , depth : 0 } , function ( err ) {
192
- if ( err )
193
- console . log ( err ) ;
194
- else {
195
- npm . commands . list ( [ ] , function ( err , res ) {
196
- if ( err && err . indexOf ( "extraneous" ) !== 0 ) {
197
- console . log ( 'Fehler' , err ) ;
198
- return ;
199
- }
200
- for ( var package_name in res . dependencies ) {
191
+ // fetch and register installed node.js packages
192
+ if ( argv . e && VVVVContext . name == 'nodejs' ) {
193
+ var npm = require ( 'npm' ) ;
194
+ console . log ( 'Checking for installed Node.js packages ...' )
195
+ npm . load ( { loglevel : 'silent' , progress : false } , function ( err ) {
196
+ if ( err )
197
+ console . log ( err ) ;
198
+ else {
199
+ npm . commands . list ( [ ] , function ( err , res ) {
200
+ if ( err && err . indexOf ( "extraneous" ) !== 0 ) {
201
+ console . log ( err ) ;
202
+ return ;
203
+ }
204
+ ( function registerDeps ( p ) {
205
+ for ( var package_name in p . dependencies ) {
201
206
VVVVContext . LoadedLibs [ package_name ] = true ;
207
+ registerDeps ( p . dependencies [ package_name ] ) ;
202
208
}
203
- console . log ( 'done.\n' ) ;
204
- } )
205
- }
206
- } )
207
- }
208
-
209
-
210
- } ) ;
209
+ } ) ( res ) ;
210
+ console . log ( 'Node.js packages scanned. Ready if you are.\n' ) ;
211
+ } )
212
+ }
213
+ } )
214
+ }
211
215
216
+ // launch browser window in app mode
212
217
if ( argv . mode == 'app' ) {
213
218
var bl = require ( 'james-browser-launcher' ) ;
214
219
bl ( function ( err , launch ) {
0 commit comments