You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by nikhilkh <gi...@git.apache.org> on 2016/02/23 18:32:18 UTC

[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

GitHub user nikhilkh opened a pull request:

    https://github.com/apache/cordova-docs/pull/516

    Improve gulp watch perf and add --nofetch option

    Improves by reducing the set of files that we watch. Also, 'watch' was broken because of fetching behavior resulting an endless watch - change loop.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-docs gulp-updates

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-docs/pull/516.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #516
    
----
commit fdbb6827db937651e70f695cd01f507418e3f85c
Author: Nikhil Khandelwal <ni...@microsoft.com>
Date:   2016-02-23T17:30:18Z

    Improve gulp watch perf and add --nofetch option

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r53842391
  
    --- Diff: gulpfile.js ---
    @@ -236,7 +239,7 @@ gulp.task("serve", ["build"], function () {
         });
     });
     
    -gulp.task("build", ["configs", "data", "styles", "plugins"], function (done) {
    +gulp.task("build", [ "configs", "data", "styles", "plugins"], function (done) {
    --- End diff --
    
    Extra space there.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r54008241
  
    --- Diff: gulpfile.js ---
    @@ -280,7 +280,11 @@ gulp.task("defaults", function () {
     });
     
     gulp.task("toc", ["fetch"], function (done) {
    -    exec("node", [bin("toc.js"), DOCS_DIR, DATA_DIR], done);
    +    if(gutil.env.prod) {
    --- End diff --
    
    Nitpick: space after `if`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r54023297
  
    --- Diff: gulpfile.js ---
    @@ -193,14 +193,6 @@ gulp.task("watch", ["serve"], function () {
         );
         gulp.watch(
             [
    -            path.join(DOCS_DIR, "**", "*.md"),
    -            path.join(DOCS_DIR, "**", "*.html"),
    -        ],
    -        {interval: WATCH_INTERVAL},
    -        ["configs", "data"]
    --- End diff --
    
    Yup!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r54022552
  
    --- Diff: gulpfile.js ---
    @@ -193,14 +193,6 @@ gulp.task("watch", ["serve"], function () {
         );
         gulp.watch(
             [
    -            path.join(DOCS_DIR, "**", "*.md"),
    -            path.join(DOCS_DIR, "**", "*.html"),
    -        ],
    -        {interval: WATCH_INTERVAL},
    -        ["configs", "data"]
    --- End diff --
    
    Just making sure: this is to disable regeneration of toc/version data and configs while watching, correct?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-docs/pull/516


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r54022811
  
    --- Diff: gulpfile.js ---
    @@ -211,8 +203,10 @@ gulp.task("watch", ["serve"], function () {
         gulp.watch(
             [
                 path.join(ROOT_DIR, "**", "*.yml"),
    -            path.join(SOURCE_DIR, "**", "*.html"),
    -            path.join(SOURCE_DIR, "**", "*.md"),
    +            path.join(SOURCE_DIR, "**", "*.html") + "!" + path.join(DOCS_DIR, "**"),
    +            path.join(SOURCE_DIR, "**", "*.md") + "!" + path.join(DOCS_DIR, "**") ,
    --- End diff --
    
    This won't generate the site if the docs files change, and we want to have the site regenerate when a docs file changes. Please enclose these in `if (gutil.env.nodocs)`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-docs/pull/516#issuecomment-187806485
  
    @riknoll @dblotsky 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r53843179
  
    --- Diff: gulpfile.js ---
    @@ -210,9 +213,9 @@ gulp.task("watch", ["serve"], function () {
         );
         gulp.watch(
             [
    -            path.join(ROOT_DIR, "**", "*.yml"),
    -            path.join(SOURCE_DIR, "**", "*.html"),
    -            path.join(SOURCE_DIR, "**", "*.md"),
    +            path.join(DATA_DIR, "**", "*.yml"),
    --- End diff --
    
    We want to regenerate the site if the configs change too, and `DATA_DIR` doesn't include `CONFIG_DIR`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r54008179
  
    --- Diff: gulpfile.js ---
    @@ -249,7 +243,13 @@ gulp.task("regen", ["jekyll"], function () {
     });
     
     gulp.task("fetch", function (done) {
    -    exec("node", [bin("fetch_docs.js"), FETCH_CONFIG, FETCH_DIR], done);
    +    if (!fs.existsSync(FETCH_DIR)) {
    +        exec("node", [bin("fetch_docs.js"), FETCH_CONFIG, FETCH_DIR], done);
    +    } else {
    +        gutil.log(gutil.colors.yellow(
    +            "Skipping fetching external docs. Run 'gulp clean' first to initiate another fetch."));
    --- End diff --
    
    Nitpick: extraneous newline.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r54022946
  
    --- Diff: gulpfile.js ---
    @@ -211,8 +203,10 @@ gulp.task("watch", ["serve"], function () {
         gulp.watch(
             [
                 path.join(ROOT_DIR, "**", "*.yml"),
    -            path.join(SOURCE_DIR, "**", "*.html"),
    -            path.join(SOURCE_DIR, "**", "*.md"),
    +            path.join(SOURCE_DIR, "**", "*.html") + "!" + path.join(DOCS_DIR, "**"),
    +            path.join(SOURCE_DIR, "**", "*.md") + "!" + path.join(DOCS_DIR, "**") ,
    +            path.join(DOCS_DIR, "en", "dev", "**", "*.md") ,
    +            path.join(DOCS_DIR, "en", "dev", "**", "*.html"),
    --- End diff --
    
    I didn't realise that although the docs folder is excluded, the English folder is included explicitly. Could you please add a comment to draw attention to these two includes?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r53843081
  
    --- Diff: gulpfile.js ---
    @@ -210,9 +213,9 @@ gulp.task("watch", ["serve"], function () {
         );
         gulp.watch(
             [
    -            path.join(ROOT_DIR, "**", "*.yml"),
    -            path.join(SOURCE_DIR, "**", "*.html"),
    -            path.join(SOURCE_DIR, "**", "*.md"),
    +            path.join(DATA_DIR, "**", "*.yml"),
    +            path.join(SOURCE_DIR, "**", "*.html") + "!" + path.join(DOCS_DIR, "**"),
    +            path.join(SOURCE_DIR, "**", "*.md") + "!" + path.join(DOCS_DIR, "**") ,
    --- End diff --
    
    This won't regenerate the site if the docs change. Perhaps wrap this in `if (gutil.env.nodocs)`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r53842352
  
    --- Diff: gulpfile.js ---
    @@ -249,7 +252,14 @@ gulp.task("regen", ["jekyll"], function () {
     });
     
     gulp.task("fetch", function (done) {
    -    exec("node", [bin("fetch_docs.js"), FETCH_CONFIG, FETCH_DIR], done);
    +    if (!argv.nofetch) {
    --- End diff --
    
    This could also just check if the fetch directory exists. If you want to re-fetch, just run `gulp clean`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-docs/pull/516#issuecomment-188376934
  
    @dblotsky I made some updates - please take a look


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r53862395
  
    --- Diff: gulpfile.js ---
    @@ -210,9 +213,9 @@ gulp.task("watch", ["serve"], function () {
         );
         gulp.watch(
             [
    -            path.join(ROOT_DIR, "**", "*.yml"),
    -            path.join(SOURCE_DIR, "**", "*.html"),
    -            path.join(SOURCE_DIR, "**", "*.md"),
    +            path.join(DATA_DIR, "**", "*.yml"),
    --- End diff --
    
    Fair enough - I removed this change as it was not helping the perf.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r53842863
  
    --- Diff: gulpfile.js ---
    @@ -24,6 +24,8 @@ var uglify     = require("gulp-uglify");
     var envify     = require("envify");
     var htmllint   = require("gulp-htmllint");
     var crawler    = require("simplecrawler");
    +var argv       = require('yargs').argv;
    --- End diff --
    
    This file uses `gutil.env` for args parsing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-docs pull request: Improve gulp watch perf and add --nofet...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/516#discussion_r53842656
  
    --- Diff: gulpfile.js ---
    @@ -24,6 +24,8 @@ var uglify     = require("gulp-uglify");
     var envify     = require("envify");
     var htmllint   = require("gulp-htmllint");
     var crawler    = require("simplecrawler");
    +var argv       = require('yargs').argv;
    +var yaml       = require('js-yaml');
    --- End diff --
    
    These aren't used in the file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org