remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.33k stars 1.73k forks source link

Hm... @1.0.6 stopped loading watch rules from nodemon.json? #258

Closed max-degterev closed 10 years ago

max-degterev commented 10 years ago

Sorry, I seem to have a lot of problems with 1.x release :(

I updated nodemon on my home machine today and here's the result:

[Tue, 07 Jan 2014 11:24:13 GMT] [Cake]: Spawning grunt watcher
[Tue, 07 Jan 2014 11:24:13 GMT] [Cake]: Spawning database
[Tue, 07 Jan 2014 11:24:13 GMT] [Cake]: Starting node
7 Jan 12:24:13 - [nodemon] v1.0.6
7 Jan 12:24:13 - [nodemon] to restart at any time, enter `rs`
7 Jan 12:24:13 - [nodemon] ignoring: \.git node_modules/* public/* npm-debug.log *.coffee
7 Jan 12:24:13 - [nodemon] watching: mp_homepage.coffee
7 Jan 12:24:13 - [nodemon] watching extensions: js,json,jade
7 Jan 12:24:13 - [nodemon] starting `coffee mp_homepage.coffee`
7 Jan 12:24:13 - [nodemon] child pid: 28268
[Tue, 07 Jan 2014 11:24:13 GMT] [app]: Starting worker 1
Running "watch" task
Waiting...[Tue, 07 Jan 2014 11:24:14 GMT] [app.server.channel_groups]: initialized
[Tue, 07 Jan 2014 11:24:14 GMT] [app.server]: initialized
[Tue, 07 Jan 2014 11:24:14 GMT] [app]: Server listening on http://dev.moviepilot.com:3003 (unbound)
[Tue, 07 Jan 2014 11:24:14 GMT] [app.server.channel_groups]: updated resource
7 Jan 12:24:19 - [nodemon] files triggering change check: app/server/channel_groups.coffee
7 Jan 12:24:19 - [nodemon] changes after filters (before/after): 1/0

Looks like local nodemon.json watch rule is not used at all, contents:

{
  "ignore": [
    "\\.git",
    "node_modules/*",
    "public/*",
    "npm-debug.log",
    "*.coffee"
  ],
  "ext": "js json jade",
  "verbose": true,
  "watch": [
    "app/server/*.*", "app/shared/*.*", "config/*.*", "views/server/*.*", "views/shared/*.*"
  ]
}

What am I doing wrong?

max-degterev commented 10 years ago

running with

nodemon -w mp_homepage.coffee mp_homepage.coffee

Rules not being merged correctly?

remy commented 10 years ago

http://buukkit.appspot.com/img/Nooooo-Squirrel.jpg

Can you drop me the output of --dump on this too?

max-degterev commented 10 years ago

https://www.dropbox.com/s/18bl739qy1nsnm9/Screenshot%202014-01-08%2015.31.16.png

hm...

remy commented 10 years ago

--dump should be used in addition to all the parameters you were using that caused the issue.

max-degterev commented 10 years ago

Here you go.

max@maxs-mbp:~/Repositories/express-boilerplate (master)$ nodemon -w app.coffee  app.coffee --dump
10 Jan 00:18:49 - [nodemon] v1.0.8
10 Jan 00:18:49 - [nodemon] reading config /Users/max/Repositories/express-boilerplate/nodemon.json
10 Jan 00:18:49 - [nodemon] to restart at any time, enter `rs`
10 Jan 00:18:49 - [nodemon] ignoring: \.git node_modules/* public/* npm-debug.log *.coffee
10 Jan 00:18:49 - [nodemon] watching: app.coffee
10 Jan 00:18:49 - [nodemon] watching extensions: js,json,jade
--------------
{ run: false,
  system:
   { cwd: '/Users/max/Repositories/express-boilerplate',
     useFind: true,
     useWatch: false,
     useWatchFile: false },
  required: false,
  dirs: [ '/Users/max/Repositories/express-boilerplate' ],
  timeout: 1000,
  options:
   { watch: [ 'app.coffee', re: /app\.coffee/ ],
     dump: true,
     script: 'app.coffee',
     args: [],
     ignore:
      [ '\\.git',
        'node_modules/*',
        'public/*',
        'npm-debug.log',
        '*.coffee',
        re: /\\\.git|node_modules/.*|public/.*|npm\-debug\.log|.*\.coffee/ ],
     ext: 'js,json,jade',
     verbose: true,
     restartable: 'rs',
     execMap: { py: 'python', rb: 'ruby' },
     stdin: true,
     execOptions:
      { script: 'app.coffee',
        exec: 'coffee',
        nodeArgs: undefined,
        ext: 'js,json,jade',
        execArgs: [] },
     monitor:
      [ 'app.coffee',
        '!\\.git',
        '!node_modules/*',
        '!public/*',
        '!npm-debug.log',
        '!*.coffee' ] },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [ '/Users/max/Repositories/express-boilerplate/nodemon.json' ] }
--------------
OS: darwin x64
node: v0.10.24
nodemon: v1.0.8
cwd: /Users/max/Repositories/express-boilerplate
command: node /usr/local/bin/nodemon -w app.coffee app.coffee --dump
--------------
10 Jan 00:18:49 - [nodemon] exiting
max@maxs-mbp:~/Repositories/express-boilerplate (master)$
max-degterev commented 10 years ago

looks like if there are command-line arguments, json rules are just ignored instead of being merged, because:

max@maxs-mbp:~/Repositories/express-boilerplate (master)$ nodemon app.coffee --dump
10 Jan 00:21:10 - [nodemon] v1.0.8
10 Jan 00:21:10 - [nodemon] reading config /Users/max/Repositories/express-boilerplate/nodemon.json
10 Jan 00:21:10 - [nodemon] to restart at any time, enter `rs`
10 Jan 00:21:10 - [nodemon] ignoring: \.git node_modules/* public/* npm-debug.log *.coffee
10 Jan 00:21:10 - [nodemon] watching: app/server/* app/shared/* config/* views/server/* views/shared/*
10 Jan 00:21:10 - [nodemon] watching extensions: js,json,jade
--------------
{ run: false,
  system:
   { cwd: '/Users/max/Repositories/express-boilerplate',
     useFind: true,
     useWatch: false,
     useWatchFile: false },
  required: false,
  dirs: [ '/Users/max/Repositories/express-boilerplate' ],
  timeout: 1000,
  options:
   { dump: true,
     script: 'app.coffee',
     args: [],
     ignore:
      [ '\\.git',
        'node_modules/*',
        'public/*',
        'npm-debug.log',
        '*.coffee',
        re: /\\\.git|node_modules/.*|public/.*|npm\-debug\.log|.*\.coffee/ ],
     ext: 'js,json,jade',
     verbose: true,
     watch:
      [ 'app/server/',
        'app/shared/',
        'config/',
        'views/server/',
        'views/shared/',
        re: /app/server/|app/shared/|config/|views/server/|views/shared// ],
     restartable: 'rs',
     execMap: { py: 'python', rb: 'ruby' },
     stdin: true,
     execOptions:
      { script: 'app.coffee',
        exec: 'coffee',
        nodeArgs: undefined,
        ext: 'js,json,jade',
        execArgs: [] },
     monitor:
      [ 'app/server/*',
        'app/shared/*',
        'config/*',
        'views/server/*',
        'views/shared/*',
        '!\\.git',
        '!node_modules/*',
        '!public/*',
        '!npm-debug.log',
        '!*.coffee' ] },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [ '/Users/max/Repositories/express-boilerplate/nodemon.json' ] }
--------------
OS: darwin x64
node: v0.10.24
nodemon: v1.0.8
cwd: /Users/max/Repositories/express-boilerplate
command: node /usr/local/bin/nodemon app.coffee --dump
--------------
10 Jan 00:21:10 - [nodemon] exiting
max@maxs-mbp:~/Repositories/express-boilerplate (master)$
max-degterev commented 10 years ago

@remy if you have time perhaps we can debug it over IRC and figure it out. Had to roll back to 0.7.10 for now :(

remy commented 10 years ago

Picking this up - sorry I've been slack!

remy commented 10 years ago

Ahh. I think I've got it. You're overriding the watch on the command line aren't you? I've just spotted you comment something to that effect too.

Yes, if you define watches or ignores on the CLI then they override any config found, rather than merge.

If you think this should be merged, it's a feature request - which I'm open to - but would like to get a few other opinions on the change of behaviour (and equally - do point out if 0.7.x used to also merge the ignores - it's highly likely I've forgotten!).