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

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

GitHub user kingnebby opened a pull request:

    https://github.com/apache/cordova-lib/pull/22

    Add platform 'web server' to cordova

    [CB-661](https://issues.apache.org/jira/browse/CB-6661)
    My team and I are finding it very useful to have a web server set up as a native platform. This is not just used for testing but also as a production front end for our application. This allows the same UI across all clients of the app and gives inspiring features to a native web server.
    
    Note: I need to update the .gitignore and revert the readme.

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

    $ git pull https://github.com/CollinearGroup/cordova-lib master

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

    https://github.com/apache/cordova-lib/pull/22.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 #22
    
----
commit 8f5dbe9254adf80a46489a36c1313077c515477a
Author: kingnebby <da...@gmail.com>
Date:   2014-05-13T19:06:50Z

    Update readme and add gitignore

commit 41062727f3ffee4ade9082734bdce50353065251
Author: kingnebby <da...@gmail.com>
Date:   2014-05-13T19:07:26Z

    add gitignore

commit e6c62a3ed4afd0c07045ae1c3a61543c1a625a7a
Author: kingnebby <da...@gmail.com>
Date:   2014-05-13T22:14:33Z

    Add web server test to ensure dir existance and package name.
    Add projects/ dir with sample info for use in tests.
    Update platforms.js to include the web-server platform.
    Created the actual web server platform skeleton.

commit 7ce97e3522da7fb8fa38d9d230450c14e920d6a9
Author: kingnebby <da...@gmail.com>
Date:   2014-05-15T00:19:19Z

    Add special case in lazy load for our repos. Add our platform definition and tag information. This does not run yet due to the web_server_parser missing.

commit 8b73b44d30280b4cc25e2c6fbaacfe1fd5a46a00
Author: kingnebby <da...@gmail.com>
Date:   2014-05-15T00:39:20Z

    Add minimalistic, untesting web_server_parser and web_server_parser.spec. This project now passes the inital check but has no scripts to create the project directorys.
    Update platforms.js comments.

commit 4b5d0752f2aa744638c0e7afa4d0186708a2fb39
Author: kingnebby <da...@gmail.com>
Date:   2014-05-15T20:09:50Z

    Add the basic functions that seem to be needed to allow a platform parser to run.
    Add a basic test to ensure that the constructor and update_from_config methods are working
    as expected.

commit b802cbd4cd077b4803bd0f4a45cb81694afe8669
Author: kingnebby <da...@gmail.com>
Date:   2014-05-16T21:09:35Z

    Rename files to correct bad references.
    Fix constructor to ensure correct project path. Add docs. Implement the config_xml method and cordovajs_path to be basic. Add verbose statements to help with debugging because I'm too lazy to figure out how to get sublimetext to do javascript debugging.

commit 0127abb1a696c9165c5a821d203057fb7eae5bc8
Author: kingnebby <da...@gmail.com>
Date:   2014-05-16T23:50:34Z

    Change to point to platform_www for package information and reduced some irrelevant method complexity

commit a0d654a6d40498b12ca864e208940fee691aae2c
Author: kingnebby <da...@gmail.com>
Date:   2014-06-02T21:02:13Z

    Merge remote-tracking branch 'upstream/master'

----


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13307842
  
    --- Diff: cordova-lib/src/cordova/lazy_load.js ---
    @@ -50,6 +50,11 @@ module.exports = {
             }
     
             var url = platforms[platform].url + ';a=snapshot;h=' + platforms[platform].version + ';sf=tgz';
    +        // This is probably not ok but since our platform is not hosted on apache yet.. 
    --- End diff --
    
    For testing purposes, you can give instructions using a config file which overrides this stuff (or you should be if my work has merged).


---
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.
---

[GitHub] cordova-lib pull request: CB-6661 Add platform 'web server' to cor...

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

    https://github.com/apache/cordova-lib/pull/22#issuecomment-46631277
  
    @kingnebby : those two corrections are right, but you should squash them into your other commits, and then you should rebase and resolve the merge conflicts.
    
    (Note: I'm not reviewing the feature at this time.)


---
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.
---

[GitHub] cordova-lib pull request: CB-6661 Add platform 'web server' to cor...

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

    https://github.com/apache/cordova-lib/pull/22


---
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-lib pull request: CB-6661 Add platform 'web server' to cor...

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13311148
  
    --- Diff: cordova-lib/src/cordova/platforms.js ---
    @@ -17,6 +17,10 @@
         under the License.
     */
     
    +/**
    --- End diff --
    
    it's unrelated, you're adding a platform. If we want such a comment, it should be its own distinct commit.
    
    And there's actually work that i have which should really preclude the need for this change for at least the testing bits...


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13307739
  
    --- Diff: .gitignore ---
    @@ -0,0 +1 @@
    +*sublime*
    --- End diff --
    
    I object.


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13307868
  
    --- Diff: cordova-lib/src/cordova/metadata/web_server_parser.js ---
    @@ -0,0 +1,119 @@
    +// src/cordova/metadata/web_server_parser.js
    +/**
    +    All parsers seem to implement the following methods:
    +        config_xml
    +        cordovajs_path
    +        update_from_config
    +        update_project
    +        update_www
    +        www_dir
    +    As well as the constructor and check_requirements methods.
    +
    +    These methods use lowercase and underscores. Methods special
    +    to this parser seem to have a camel case convention.
    +*/
    +var fs              = require('fs'),
    +    path            = require('path'),
    +    shell           = require('shelljs'),
    +    events          = require('../events'),
    +    util            = require('../util'),
    +    events          = require('../events'),
    +    Q               = require('q'),
    +    ConfigParser    = require('../ConfigParser');
    +    CordovaError 	= require('../../CordovaError');
    +
    +/**
    +    Gets run when creating a new platform.
    +
    +    @param the project directory?
    +*/
    +module.exports = function web_server_parser(project) {
    +    events.emit('verbose', "Project: " + project);
    +    this.path = path.join(project);
    +};
    +
    +/**
    +    Always gets run when adding a new platform. However some other
    +    script will do the actual checking of requirements.
    +    
    +    @return a promise.
    +*/
    +module.exports.check_requirements = function(project_root) {
    +    // Rely on platform's bin/create script to check requirements.
    +    return Q();
    +};
    +
    +/**
    +    Since each platform has it's own structure and resources each needs
    +    it's own parser to ensure that certain configs and folders are found.
    --- End diff --
    
    its


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13307757
  
    --- Diff: README.md ---
    @@ -24,7 +24,7 @@ Contains npm modules used primarily by [cordova](https://github.com/apache/cordo
     
     ## Setup
     * Clone this repository onto your local machine. 
    -    `git clone https://git-wip-us.apache.org/repos/asf/cordova-lib.git`
    +    `git clone https://github.com/CollinearGroup/cordova-lib.git`
    --- End diff --
    
    This shouldn't be part of the pull request.


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13308608
  
    --- Diff: cordova-lib/src/cordova/platforms.js ---
    @@ -17,6 +17,10 @@
         under the License.
     */
     
    +/**
    --- End diff --
    
    I don't think this should be included in your commit.


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13308596
  
    --- Diff: cordova-lib/src/cordova/platforms.js ---
    @@ -66,10 +70,16 @@ module.exports = {
             version: '3.5.0'
         },
         'firefoxos':{
    -        parser: './metadata/firefoxos_parser',
    +        parser : './metadata/firefoxos_parser',
             url    : 'https://git-wip-us.apache.org/repos/asf?p=cordova-firefoxos.git',
    --- End diff --
    
    please don't make random changes to other areas


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13308631
  
    --- Diff: cordova-lib/src/plugman/platforms/web_server.js ---
    @@ -0,0 +1,65 @@
    +/*
    + * Web server is meant to support standing up a simple web server as a native platform.
    + * 
    + * This was copied from android but was gutted and stubed every method. Need to now
    --- End diff --
    
    stubbed


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13309033
  
    --- Diff: cordova-lib/src/cordova/platforms.js ---
    @@ -17,6 +17,10 @@
         under the License.
     */
     
    +/**
    --- End diff --
    
    Thanks for giving my pull requests your time.
    Curious though, why is that?


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13307809
  
    --- Diff: cordova-lib/src/cordova/lazy_load.js ---
    @@ -50,6 +50,11 @@ module.exports = {
             }
     
             var url = platforms[platform].url + ';a=snapshot;h=' + platforms[platform].version + ';sf=tgz';
    +        // This is probably not ok but since our platform is not hosted on apache yet.. 
    --- End diff --
    
    This definitely shouldn't be part of the pull request


---
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.
---

[GitHub] cordova-lib pull request: Add platform 'web server' to cordova

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

    https://github.com/apache/cordova-lib/pull/22#discussion_r13307862
  
    --- Diff: cordova-lib/src/cordova/metadata/web_server_parser.js ---
    @@ -0,0 +1,119 @@
    +// src/cordova/metadata/web_server_parser.js
    +/**
    +    All parsers seem to implement the following methods:
    +        config_xml
    +        cordovajs_path
    +        update_from_config
    +        update_project
    +        update_www
    +        www_dir
    +    As well as the constructor and check_requirements methods.
    +
    +    These methods use lowercase and underscores. Methods special
    +    to this parser seem to have a camel case convention.
    +*/
    +var fs              = require('fs'),
    +    path            = require('path'),
    +    shell           = require('shelljs'),
    +    events          = require('../events'),
    +    util            = require('../util'),
    +    events          = require('../events'),
    +    Q               = require('q'),
    +    ConfigParser    = require('../ConfigParser');
    +    CordovaError 	= require('../../CordovaError');
    +
    +/**
    +    Gets run when creating a new platform.
    +
    +    @param the project directory?
    +*/
    +module.exports = function web_server_parser(project) {
    +    events.emit('verbose', "Project: " + project);
    +    this.path = path.join(project);
    +};
    +
    +/**
    +    Always gets run when adding a new platform. However some other
    +    script will do the actual checking of requirements.
    +    
    +    @return a promise.
    +*/
    +module.exports.check_requirements = function(project_root) {
    +    // Rely on platform's bin/create script to check requirements.
    +    return Q();
    +};
    +
    +/**
    +    Since each platform has it's own structure and resources each needs
    --- End diff --
    
    its


---
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.
---