From 7d6c1a88a10f02d3f00b6e0635f982bb74ce5708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lio=20A=2E=20Heckert?= Date: Tue, 15 Oct 2019 15:40:28 -0300 Subject: [PATCH] fix: Replace `jade` references by `pug` close #1595 --- README.md | 4 +- doc/cli/help.txt | 2 +- doc/cli/options.txt | 2 +- lib/config/exec.js | 2 +- package-lock.json | 70 +++++++++---------- test/cli/exec.test.js | 18 ++--- test/cli/parse.test.js | 8 +-- test/config/load.test.js | 4 +- test/fixtures/global/nodemon.json | 4 +- test/fixtures/packages/express4/package.json | 3 +- .../mime-types/node_modules/mime-db/db.json | 3 + test/monitor/match.test.js | 2 +- 12 files changed, 61 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 6f00bd9d..aeffea62 100644 --- a/README.md +++ b/README.md @@ -178,10 +178,10 @@ Don't use unix globbing to pass multiple directories, e.g `--watch ./lib/*`, it By default, nodemon looks for files with the `.js`, `.mjs`, `.coffee`, `.litcoffee`, and `.json` extensions. If you use the `--exec` option and monitor `app.py` nodemon will monitor files with the extension of `.py`. However, you can specify your own list with the `-e` (or `--ext`) switch like so: ```bash -nodemon -e js,jade +nodemon -e js,pug ``` -Now nodemon will restart on any changes to files in the directory (or subdirectories) with the extensions `.js`, `.jade`. +Now nodemon will restart on any changes to files in the directory (or subdirectories) with the extensions `.js`, `.pug`. ## Ignoring files diff --git a/doc/cli/help.txt b/doc/cli/help.txt index dd2ab811..4d34ae12 100644 --- a/doc/cli/help.txt +++ b/doc/cli/help.txt @@ -3,7 +3,7 @@ Options: --config file ............ alternate nodemon.json config file to use - -e, --ext ................ extensions to look for, ie. js,jade,hbs. + -e, --ext ................ extensions to look for, ie. js,pug,hbs. -x, --exec app ........... execute script with "app", ie. -x "python -v". -w, --watch path.......... watch directory "path" or files. use once for each directory or file to watch. diff --git a/doc/cli/options.txt b/doc/cli/options.txt index 70f41c4a..af0edb5a 100644 --- a/doc/cli/options.txt +++ b/doc/cli/options.txt @@ -12,7 +12,7 @@ Configuration Execution -C, --on-change-only ..... execute script on change only, not startup --cwd .............. change into before running the script - -e, --ext ................ extensions to look for, ie. "js,jade,hbs" + -e, --ext ................ extensions to look for, ie. "js,pug,hbs" -I, --no-stdin ........... nodemon passes stdin directly to child process --spawn .................. force nodemon to use spawn (over fork) [node only] -x, --exec app ........... execute script with "app", ie. -x "python -v" diff --git a/lib/config/exec.js b/lib/config/exec.js index 951ac7a1..68c2a2de 100644 --- a/lib/config/exec.js +++ b/lib/config/exec.js @@ -198,7 +198,7 @@ function exec(nodemonOptions, execMap) { } // allow users to make a mistake on the extension to monitor - // converts .js, jade => js,jade + // converts .js, pug => js,pug // BIG NOTE: user can't do this: nodemon -e *.js // because the terminal will automatically expand the glob against // the file system :( diff --git a/package-lock.json b/package-lock.json index 139bd221..bba5085e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -296,6 +296,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -1885,7 +1886,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -1903,11 +1905,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1920,15 +1924,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2031,7 +2038,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2041,6 +2049,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2053,17 +2062,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -2080,6 +2092,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2152,7 +2165,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2162,6 +2176,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2237,7 +2252,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -2267,6 +2283,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2284,6 +2301,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2322,11 +2340,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.3", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -3300,30 +3320,6 @@ "is-object": "^1.0.1" } }, - "jade": { - "version": "0.26.3", - "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", - "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", - "dev": true, - "requires": { - "commander": "0.6.1", - "mkdirp": "0.3.0" - }, - "dependencies": { - "commander": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", - "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", - "dev": true - }, - "mkdirp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", - "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", - "dev": true - } - } - }, "js-yaml": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", @@ -3746,7 +3742,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "loud-rejection": { "version": "1.6.0", @@ -3937,7 +3934,6 @@ "escape-string-regexp": "1.0.2", "glob": "3.2.11", "growl": "1.9.2", - "jade": "0.26.3", "mkdirp": "0.5.1", "supports-color": "1.2.0", "to-iso-string": "0.0.2" diff --git a/test/cli/exec.test.js b/test/cli/exec.test.js index 3a6482cb..f2b1a922 100644 --- a/test/cli/exec.test.js +++ b/test/cli/exec.test.js @@ -83,14 +83,14 @@ describe('nodemon exec', function () { }); it('should support multiple extensions', function () { - var options = exec({ script: 'app.js', ext: 'js, jade, hbs' }); + var options = exec({ script: 'app.js', ext: 'js, pug, hbs' }); var cmd = toCmd(options); assert(cmd.string === 'node app.js', cmd.string); - assert(options.ext.indexOf('jade') !== -1, 'comma separated string'); + assert(options.ext.indexOf('pug') !== -1, 'comma separated string'); - options = exec({ script: 'app.js', ext: 'js|jade|hbs' }); + options = exec({ script: 'app.js', ext: 'js|pug|hbs' }); assert(options.exec === 'node'); - assert(options.ext.indexOf('jade') !== -1, 'pipe separated string'); + assert(options.ext.indexOf('pug') !== -1, 'pipe separated string'); }); it('should support watching all extensions', function () { @@ -123,14 +123,14 @@ describe('nodemon exec', function () { }); it('should support extension maps', function () { - var options = exec({ script: 'template.jade' }, { 'jade': 'jade {{filename}} --out /tmp' }); + var options = exec({ script: 'template.pug' }, { 'pug': 'pug {{filename}} --out /tmp' }); var cmd = toCmd(options); - assert(cmd.string === 'jade template.jade --out /tmp', cmd.string); + assert(cmd.string === 'pug template.pug --out /tmp', cmd.string); }); it('should support input from argv#parse', function () { var parse = require('../../lib/cli/parse'); - parse('node /usr/local/bin/nodemon.js --debug -e js,jade,hbs app.js'.split(' ')); + parse('node /usr/local/bin/nodemon.js --debug -e js,pug,hbs app.js'.split(' ')); }); it('should use coffeescript on .coffee', function () { @@ -186,10 +186,10 @@ describe('nodemon exec', function () { }); it('should support single-level file extensions', function () { - var options = exec({ ext: '.js, jade' }); + var options = exec({ ext: '.js, pug' }); assert(options.ext.indexOf('js') !== -1); - assert(options.ext.indexOf('jade') !== -1); + assert(options.ext.indexOf('pug') !== -1); }); it('should expand app to app.js', function () { diff --git a/test/cli/parse.test.js b/test/cli/parse.test.js index 77cc83de..b2b63131 100644 --- a/test/cli/parse.test.js +++ b/test/cli/parse.test.js @@ -229,7 +229,7 @@ describe('nodemon argument parser', function () { }); it('should support short versions of flags', function () { - var settings = cli.parse('node nodemon -v -x java -I -V -q -w fixtures -i fixtures -d 5 -L -C -e jade -s SIGHUP'); + var settings = cli.parse('node nodemon -v -x java -I -V -q -w fixtures -i fixtures -d 5 -L -C -e pug -s SIGHUP'); assert(settings.version, 'version'); assert(settings.verbose, 'verbose'); assert(settings.exec === 'java', 'exec'); @@ -239,13 +239,13 @@ describe('nodemon argument parser', function () { assert(settings.ignore[0] === 'fixtures', 'ignore'); assert(settings.delay === 5000, 'delay 5 seconds'); assert(settings.runOnChangeOnly, 'run on change only'); - assert(settings.ext === 'jade', 'extension is jade'); + assert(settings.ext === 'pug', 'extension is pug'); assert(settings.signal === 'SIGHUP', 'signal is SIGHUP'); }); it('should support long versions of flags', function () { - var settings = cli.parse('node nodemon --version --exec java --verbose --quiet --watch fixtures --ignore fixtures --no-stdin --delay 5 --legacy-watch --exitcrash --on-change-only --ext jade --config my/.nodemon.json --signal SIGHUP'); + var settings = cli.parse('node nodemon --version --exec java --verbose --quiet --watch fixtures --ignore fixtures --no-stdin --delay 5 --legacy-watch --exitcrash --on-change-only --ext pug --config my/.nodemon.json --signal SIGHUP'); assert(settings.version, 'version'); assert(settings.verbose, 'verbose'); assert(settings.exec === 'java', 'exec'); @@ -256,7 +256,7 @@ describe('nodemon argument parser', function () { assert(settings.ignore[0] === 'fixtures', 'ignore'); assert(settings.delay === 5000, 'delay 5 seconds'); assert(settings.runOnChangeOnly, 'run on change only'); - assert(settings.ext === 'jade', 'extension is jade'); + assert(settings.ext === 'pug', 'extension is pug'); assert(settings.configFile === 'my/.nodemon.json', 'custom config file name is my/.nodemon.json'); assert(settings.signal === 'SIGHUP', 'signal is SIGHUP'); }); diff --git a/test/config/load.test.js b/test/config/load.test.js index 0ef8f9d3..083572d1 100644 --- a/test/config/load.test.js +++ b/test/config/load.test.js @@ -97,8 +97,8 @@ describe('config load', function () { assert(config.verbose, 'we are verbose'); // ensure global mapping works too - var options = exec({ script: 'template.jade' }, config.execMap); - assert(options.exec === 'bin/jade template.jade --out /tmp', 'exec used, should be "bin/jade": ' + options.exec); + var options = exec({ script: 'template.pug' }, config.execMap); + assert(options.exec === 'bin/pug template.pug --out /tmp', 'exec used, should be "bin/pug": ' + options.exec); done(); diff --git a/test/fixtures/global/nodemon.json b/test/fixtures/global/nodemon.json index 1cd7277a..f72b25ad 100644 --- a/test/fixtures/global/nodemon.json +++ b/test/fixtures/global/nodemon.json @@ -2,6 +2,6 @@ "verbose": true, "ignore": ["one", "two"], "execMap": { - "jade": "bin/jade {{filename}} --out /tmp" + "pug": "bin/pug {{filename}} --out /tmp" } -} \ No newline at end of file +} diff --git a/test/fixtures/packages/express4/package.json b/test/fixtures/packages/express4/package.json index c08b5921..395d65aa 100644 --- a/test/fixtures/packages/express4/package.json +++ b/test/fixtures/packages/express4/package.json @@ -12,6 +12,7 @@ "cookie-parser": "~1.0.1", "body-parser": "~1.0.0", "debug": "~0.7.4", - "jade": "~1.3.0" + "pug": "~2.0.4", + "pug-cli": "~1.0.0" } } diff --git a/test/fixtures/watch-count/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/db.json b/test/fixtures/watch-count/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/db.json index 5542caf7..253dcea2 100644 --- a/test/fixtures/watch-count/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/db.json +++ b/test/fixtures/watch-count/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/db.json @@ -5719,6 +5719,9 @@ "text/jade": { "extensions": ["jade"] }, + "text/pug": { + "extensions": ["pug"] + }, "text/javascript": { "source": "iana", "compressible": true diff --git a/test/monitor/match.test.js b/test/monitor/match.test.js index eebec6d5..ad30596d 100644 --- a/test/monitor/match.test.js +++ b/test/monitor/match.test.js @@ -222,7 +222,7 @@ describe('match', function() { it('should be specific about directories', function(done) { config.load( { - ext: 'js md jade', + ext: 'js md pug', watch: ['lib'], }, function(config) {