You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by stevengill <gi...@git.apache.org> on 2015/10/03 04:22:22 UTC

[GitHub] cordova-lib pull request: CB-9589 auto convert IDs to new style ID...

GitHub user stevengill opened a pull request:

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

    CB-9589 auto convert IDs to new style IDs if in registry mapper

    @nikhilkh @vladimir-kotikov take a look. Thoughts?

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

    $ git pull https://github.com/stevengill/cordova-lib CB-9589

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

    https://github.com/apache/cordova-lib/pull/313.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 #313
    
----
commit 83dba21e4c090e95d45901ad4f1e3c9a8d16abfb
Author: Steve Gill <st...@gmail.com>
Date:   2015-09-25T19:21:09Z

    CB-9589 auto convert old plugin ids to new npm ids

commit 61c909f97c146d0724aa1494110dbb192c18a34d
Author: Steve Gill <st...@gmail.com>
Date:   2015-10-03T02:08:16Z

    CB-9589 added test to check id conversion

----


---
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-9589 auto convert IDs to new style ID...

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

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


---
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-9589 auto convert IDs to new style ID...

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

    https://github.com/apache/cordova-lib/pull/313#issuecomment-146080750
  
    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.
---

---------------------------------------------------------------------
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-9589 auto convert IDs to new style ID...

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

    https://github.com/apache/cordova-lib/pull/313#discussion_r41121704
  
    --- Diff: cordova-lib/src/plugman/install.js ---
    @@ -79,6 +80,19 @@ module.exports = function installPlugin(platform, project_dir, id, plugins_dir,
     
         var current_stack = new action_stack();
     
    +    // Split @Version from the plugin id if it exists.
    +    var splitVersion = id.split('@');
    +    //Check if a mapping exists for the plugin id
    +    //if it does, convert id to new name id 
    +    var newId = pluginMapper[splitVersion[0]];
    +    if(newId) {
    +        events.emit('log', 'Notice: ' + id + ' has been automatically converted to ' + newId + ' and fetched from npm. This is due to our old plugins registry shutting down.');
    --- End diff --
    
    Shouldn't this be emitted with `warn` level to encourage users to switch to new plugin id instead of relying on plugin mapper?


---
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-9589 auto convert IDs to new style ID...

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

    https://github.com/apache/cordova-lib/pull/313#discussion_r41121964
  
    --- Diff: cordova-lib/src/plugman/uninstall.js ---
    @@ -142,8 +143,17 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) {
             var pluginInfo = pluginInfoProvider.get(depPluginDir);
             // TODO: Should remove dependencies in a separate step, since dependencies depend on platform.
             var deps = pluginInfo.getDependencies();
    +        var deps_path;
             deps.forEach(function (d) {
    -            if (toDelete.indexOf(d.id) === -1) {
    +            var splitVersion = d.id.split('@');
    +            deps_path = path.join(plugin_dir, '..', splitVersion[0]);
    +            if (!fs.existsSync(deps_path)) {
    +                var newId = pluginMapper[splitVersion[0]];
    +                if (newId && toDelete.indexOf(newId) === -1) {
    +                   toDelete.push(newId);
    --- End diff --
    
    IMHO it makes sense to add verbose message here to show to user what's happened.


---
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-9589 auto convert IDs to new style ID...

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

    https://github.com/apache/cordova-lib/pull/313#discussion_r41121974
  
    --- Diff: cordova-lib/src/plugman/uninstall.js ---
    @@ -256,6 +266,15 @@ function runUninstallPlatform(actions, platform, project_dir, plugin_dir, plugin
             promise = promiseutil.Q_chainmap(danglers, function(dangler) {
                 var dependent_path = path.join(plugins_dir, dangler);
     
    +            //try to convert ID if old-id path doesn't exist. 
    +            if (!fs.existsSync(dependent_path)) {
    +                var splitVersion = dangler.split('@');
    +                var newId = pluginMapper[splitVersion[0]];
    +                if(newId) {
    +                    dependent_path = path.join(plugins_dir, newId);
    --- End diff --
    
    Same here.


---
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-9589 auto convert IDs to new style ID...

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

    https://github.com/apache/cordova-lib/pull/313#discussion_r41121721
  
    --- Diff: cordova-lib/src/plugman/install.js ---
    @@ -404,6 +418,20 @@ function installDependencies(install, dependencies, options) {
         return dependencies.reduce(function(soFar, dep) {
             return soFar.then(
                 function() {
    +                // Split @Version from the plugin id if it exists.
    +                var splitVersion = dep.id.split('@');
    +                //Check if a mapping exists for the plugin id
    +                //if it does, convert id to new name id 
    +                var newId = pluginMapper[splitVersion[0]];
    +                if(newId) {
    +                    events.emit('log', 'Notice: ' + dep.id + ' has been automatically converted to ' + newId + ' and fetched from npm. This is due to our old plugins registry shutting down.');
    --- End diff --
    
    Shouldn't this be emitted with `warn` level to encourage users to switch to new plugin id instead of relying on plugin mapper?


---
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-9589 auto convert IDs to new style ID...

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

    https://github.com/apache/cordova-lib/pull/313#issuecomment-145759968
  
    @stevengill, looks good :+1: 


---
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-9589 auto convert IDs to new style ID...

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

    https://github.com/apache/cordova-lib/pull/313#issuecomment-145705106
  
    @vladimir-kotikov switched to warnings and added some verbose output. Also added a conversion step to fetch.js as it was needed in there since cordova-lib calls fetch instead of install. I originally had my ID conversion code in registry.js, but this lead to some failing checks in the code for what ID was expected and what was actually retrieved. i think it is all good now. Let me know if you have other thoughts before I merge. 


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