From d87da684a959793593ec04f377a5f15d90f5a151 Mon Sep 17 00:00:00 2001 From: Tyler Long Date: Thu, 13 Apr 2017 22:35:27 +0800 Subject: [PATCH] eslint watch --- gulp/tasks/dev.js | 3 +-- package.json | 11 +++++++++- scripts/watch.sh | 4 +--- yarn.lock | 53 +++++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 61 insertions(+), 10 deletions(-) diff --git a/gulp/tasks/dev.js b/gulp/tasks/dev.js index 074b85220..be632dcb6 100644 --- a/gulp/tasks/dev.js +++ b/gulp/tasks/dev.js @@ -25,8 +25,7 @@ gulp.task('live-server', function () { gulp.task('watch2', ['live-server'], function () { return shell.task([ - 'watchify src/mermaid.js -s mermaid -o dist/mermaid.js', - 'node node_modules/eslint-watch/bin/esw src -w' + 'watchify src/mermaid.js -s mermaid -o dist/mermaid.js' ]) }) diff --git a/package.json b/package.json index 5046dabd7..343784fef 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,21 @@ "bin": { "mermaid": "./bin/mermaid.js" }, + "watch": { + "lint": { + "patterns": ["bin", "gulp", "lib", "src", "test", "*.js"], + "extensions": "js", + "ignore": ["src/d3.js", "**/parser/*.js"] + } + }, "scripts": { "upgrade": "ncu -ua && yarn upgrade", "live": "live-server ./test/examples", "lint": "node_modules/.bin/standard", "jison": "gulp jison_legacy", "karma": "node node_modules/karma/bin/karma start karma.conf.js --single-run", - "watch": "source ./scripts/watch.sh", + "watch": "npm-watch", + "old_watch": "source ./scripts/watch.sh", "doc": "rm -r build;rm -r dist/www;gulp vartree;cp dist/www/all.html ../mermaid-pages/index.html;cp dist/mermaid.js ../mermaid-pages/javascripts/lib;cp dist/mermaid.forest.css ../mermaid-pages/stylesheets", "tape": "node node_modules/tape/bin/tape test/cli_test-*.js", "jasmine": "yarn run jison && node node_modules/jasmine-es6/bin/jasmine.js", @@ -117,6 +125,7 @@ "marked": "^0.3.6", "mock-browser": "^0.92.14", "npm-check-updates": "^2.10.5", + "npm-watch": "^0.1.8", "path": "^0.12.7", "phantomjs": "^2.1.7", "proxyquire": "^1.7.11", diff --git a/scripts/watch.sh b/scripts/watch.sh index b38ba5dea..bd2ceb151 100644 --- a/scripts/watch.sh +++ b/scripts/watch.sh @@ -1,5 +1,3 @@ #!/usr/bin/env bash -watchify src/mermaid.js -s mermaid -o dist/mermaid.js & -gulp live-server & -node node_modules/eslint-watch/bin/esw src -w +watchify src/mermaid.js -s mermaid -o dist/mermaid.js & gulp live-server diff --git a/yarn.lock b/yarn.lock index b173bf0c4..cd41f64c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1583,7 +1583,7 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chokidar@^1.0.0, chokidar@^1.4.1, chokidar@^1.6.0, chokidar@^1.6.1: +chokidar@^1.0.0, chokidar@^1.4.1, chokidar@^1.4.3, chokidar@^1.6.0, chokidar@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" dependencies: @@ -2881,7 +2881,7 @@ event-emitter@~0.3.5: d "1" es5-ext "~0.10.14" -event-stream@^3.1.7, event-stream@^3.3.4, event-stream@latest: +event-stream@^3.1.7, event-stream@^3.3.4, event-stream@latest, event-stream@~3.3.0: version "3.3.4" resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" dependencies: @@ -4198,6 +4198,10 @@ iferr@^0.1.5, iferr@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" +ignore-by-default@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" + ignore@^3.0.11, ignore@^3.0.9, ignore@^3.2.0: version "3.2.7" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.7.tgz#4810ca5f1d8eca5595213a34b94f2eb4ed926bbd" @@ -5277,6 +5281,13 @@ lodash.cond@^4.3.0: version "4.5.2" resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" +lodash.defaults@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-3.1.2.tgz#c7308b18dbf8bc9372d701a73493c61192bd2e2c" + dependencies: + lodash.assign "^3.0.0" + lodash.restparam "^3.0.0" + lodash.defaults@^4.0.1: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" @@ -5892,6 +5903,21 @@ node-uuid@~1.4.7: version "1.4.8" resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" +nodemon@^1.3.8: + version "1.11.0" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.11.0.tgz#226c562bd2a7b13d3d7518b49ad4828a3623d06c" + dependencies: + chokidar "^1.4.3" + debug "^2.2.0" + es6-promise "^3.0.2" + ignore-by-default "^1.0.0" + lodash.defaults "^3.1.2" + minimatch "^3.0.0" + ps-tree "^1.0.1" + touch "1.0.0" + undefsafe "0.0.3" + update-notifier "0.5.0" + nomnom@1.5.2, "nomnom@>= 1.5.x": version "1.5.2" resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.5.2.tgz#f4345448a853cfbd5c0d26320f2477ab0526fe2f" @@ -5899,7 +5925,7 @@ nomnom@1.5.2, "nomnom@>= 1.5.x": colors "0.5.x" underscore "1.1.x" -nopt@1.0.10: +nopt@1.0.10, nopt@~1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" dependencies: @@ -5998,6 +6024,13 @@ npm-user-validate@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/npm-user-validate/-/npm-user-validate-0.1.5.tgz#52465d50c2d20294a57125b996baedbf56c5004b" +npm-watch@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/npm-watch/-/npm-watch-0.1.8.tgz#18caddb1f769e21c896e6ba79168aed8e0da7eb8" + dependencies: + nodemon "^1.3.8" + through2 "^2.0.0" + npm@^3, npm@^3.10.6: version "3.10.10" resolved "https://registry.yarnpkg.com/npm/-/npm-3.10.10.tgz#5b1d577e4c8869d6c8603bc89e9cd1637303e46e" @@ -6719,6 +6752,12 @@ prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" +ps-tree@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014" + dependencies: + event-stream "~3.3.0" + pseudomap@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -8242,6 +8281,12 @@ to-fast-properties@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" +touch@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/touch/-/touch-1.0.0.tgz#449cbe2dbae5a8c8038e30d71fa0ff464947c4de" + dependencies: + nopt "~1.0.10" + tough-cookie@^2.0.0, tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" @@ -8424,7 +8469,7 @@ unzip-response@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-1.0.2.tgz#b984f0877fc0a89c2c773cc1ef7b5b232b5b06fe" -update-notifier@^0.5.0: +update-notifier@0.5.0, update-notifier@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-0.5.0.tgz#07b5dc2066b3627ab3b4f530130f7eddda07a4cc" dependencies: