Details

      Description

      with the change to cordova-fetch for local paths, cordova plugin add SOMELOCALPATH --link doesn't work anymore.

      The plugin first gets `npm installed` into your cordova project (so it now lives in node_modules), and then it gets copied into your plugins directory. During the copy to your plugins directory step, that is when the symlink gets created. So the symlink points to your node_modules/PLUGINDIR and not the local path to your plugin.

      I believe the solution to fixing this would be to `npm link` the plugin instead of `npm install` when adding it with `--link` flag.

        Issue Links

          Activity

          Hide
          kerrishotts Kerri Shotts added a comment -

          Well, this explains a few things I've just run into. --nofetch works as a workaround for now, though.

          Show
          kerrishotts Kerri Shotts added a comment - Well, this explains a few things I've just run into. --nofetch works as a workaround for now, though.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user matrosov-nikita opened a pull request:

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

          CB-12787: Fix plugin installation with --link option

          <!--
          Please make sure the checklist boxes are all checked before submitting the PR. The checklist
          is intended as a quick reference, for complete details please see our Contributor Guidelines:

          http://cordova.apache.org/contribute/contribute_guidelines.html

          Thanks!
          -->

              1. Platforms affected
                all
              1. What does this PR do?
                Fix logic for installation plugins with `--link` option.
          • Use `npm link` instead of `npm install` during plugin fetch.
          • Find symbolic links in plugin's dir for plugin removal
              1. What testing has been done on this change?
              1. Checklist
          • [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
          • [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
          • [ ] Added automated test coverage as appropriate for this change.

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

          $ git pull https://github.com/matrosov-nikita/cordova-lib CB-12787

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

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


          commit 0eb176af7f6b00984f3d41320a1ff6f7f494928c
          Author: Nikita Matrosov <v-nimatr@microsoft.com>
          Date: 2017-05-12T11:26:05Z

          CB-12787: Fix plugin installation with --link option


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user matrosov-nikita opened a pull request: https://github.com/apache/cordova-lib/pull/557 CB-12787 : Fix plugin installation with --link option <!-- Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines: http://cordova.apache.org/contribute/contribute_guidelines.html Thanks! --> Platforms affected all What does this PR do? Fix logic for installation plugins with `--link` option. Use `npm link` instead of `npm install` during plugin fetch. Find symbolic links in plugin's dir for plugin removal What testing has been done on this change? Checklist [x] [Reported an issue] ( http://cordova.apache.org/contribute/issues.html ) in the JIRA database [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected. [ ] Added automated test coverage as appropriate for this change. You can merge this pull request into a Git repository by running: $ git pull https://github.com/matrosov-nikita/cordova-lib CB-12787 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-lib/pull/557.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 #557 commit 0eb176af7f6b00984f3d41320a1ff6f7f494928c Author: Nikita Matrosov <v-nimatr@microsoft.com> Date: 2017-05-12T11:26:05Z CB-12787 : Fix plugin installation with --link option
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user codecov-io commented on the issue:

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

          1. [Codecov](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=h1) Report
            > Merging 557(https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-lib/commit/3962053f7f5c7c65259f9926a220671595c6d944?src=pr&el=desc) will *increase* coverage by `0.68%`.
            > The diff coverage is `90%`.

          [![Impacted file tree graph](https://codecov.io/gh/apache/cordova-lib/pull/557/graphs/tree.svg?height=150&src=pr&token=KwBjKMXLqA&width=650)](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree)

          ```diff
          @@ Coverage Diff @@

            1. master #557 +/- ##
              ==========================================
              + Coverage 79.48% 80.17% +0.68%
              ==========================================
              Files 57 57
              Lines 3944 3950 +6
              Branches 828 829 +1
              ==========================================
              + Hits 3135 3167 +32
              + Misses 809 783 -26
              ```
          [Impacted Files](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree) Coverage Δ  
          [cordova-lib/src/cordova/util.js](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree#diff-Y29yZG92YS1saWIvc3JjL2NvcmRvdmEvdXRpbC5qcw==) `96.72% <90%> (-0.34%)` :arrow_down:
          [cordova-lib/src/cordova/platform.js](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree#diff-Y29yZG92YS1saWIvc3JjL2NvcmRvdmEvcGxhdGZvcm0uanM=) `75.05% <0%> (+0.47%)` :arrow_up:
          [cordova-lib/src/cordova/plugin.js](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree#diff-Y29yZG92YS1saWIvc3JjL2NvcmRvdmEvcGx1Z2luLmpz) `86.85% <0%> (+1.55%)` :arrow_up:
          [cordova-lib/src/cordova/restore-util.js](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree#diff-Y29yZG92YS1saWIvc3JjL2NvcmRvdmEvcmVzdG9yZS11dGlsLmpz) `89.76% <0%> (+8.37%)` :arrow_up:

          ------

          [Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=continue).
          > *Legend* - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
          > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
          > Powered by [Codecov](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=footer). Last update [3962053...0eb176a](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

          Show
          githubbot ASF GitHub Bot added a comment - Github user codecov-io commented on the issue: https://github.com/apache/cordova-lib/pull/557 [Codecov] ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=h1 ) Report > Merging 557 ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=desc ) into [master] ( https://codecov.io/gh/apache/cordova-lib/commit/3962053f7f5c7c65259f9926a220671595c6d944?src=pr&el=desc ) will * increase * coverage by `0.68%`. > The diff coverage is `90%`. [! [Impacted file tree graph] ( https://codecov.io/gh/apache/cordova-lib/pull/557/graphs/tree.svg?height=150&src=pr&token=KwBjKMXLqA&width=650)](https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree ) ```diff @@ Coverage Diff @@ master #557 +/- ## ========================================== + Coverage 79.48% 80.17% +0.68% ========================================== Files 57 57 Lines 3944 3950 +6 Branches 828 829 +1 ========================================== + Hits 3135 3167 +32 + Misses 809 783 -26 ``` [Impacted Files] ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree ) Coverage Δ   — — — [cordova-lib/src/cordova/util.js] ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree#diff-Y29yZG92YS1saWIvc3JjL2NvcmRvdmEvdXRpbC5qcw== ) `96.72% <90%> (-0.34%)` :arrow_down: [cordova-lib/src/cordova/platform.js] ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree#diff-Y29yZG92YS1saWIvc3JjL2NvcmRvdmEvcGxhdGZvcm0uanM= ) `75.05% <0%> (+0.47%)` :arrow_up: [cordova-lib/src/cordova/plugin.js] ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree#diff-Y29yZG92YS1saWIvc3JjL2NvcmRvdmEvcGx1Z2luLmpz ) `86.85% <0%> (+1.55%)` :arrow_up: [cordova-lib/src/cordova/restore-util.js] ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=tree#diff-Y29yZG92YS1saWIvc3JjL2NvcmRvdmEvcmVzdG9yZS11dGlsLmpz ) `89.76% <0%> (+8.37%)` :arrow_up: ------ [Continue to review full report at Codecov] ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=continue ). > * Legend * - [Click here to learn more] ( https://docs.codecov.io/docs/codecov-delta ) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov] ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=footer ). Last update [3962053...0eb176a] ( https://codecov.io/gh/apache/cordova-lib/pull/557?src=pr&el=lastupdated ). Read the [comment docs] ( https://docs.codecov.io/docs/pull-request-comments ).
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 546612060bdab16ea88ed3a6e3ee8c1f29ffab3d in cordova-lib's branch refs/heads/master from Nikita Matrosov
          [ https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;h=5466120 ]

          CB-12787: Fix plugin installation with --link option

          This closes #557

          Show
          jira-bot ASF subversion and git services added a comment - Commit 546612060bdab16ea88ed3a6e3ee8c1f29ffab3d in cordova-lib's branch refs/heads/master from Nikita Matrosov [ https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;h=5466120 ] CB-12787 : Fix plugin installation with --link option This closes #557
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

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

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/cordova-lib/pull/557
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user stevengill commented on the issue:

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

          merged

          Show
          githubbot ASF GitHub Bot added a comment - Github user stevengill commented on the issue: https://github.com/apache/cordova-lib/pull/557 merged
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 0352f8c8a47912144ae5380a72d0847cb51f4531 in cordova-fetch's branch refs/heads/master from Nikita Matrosov
          [ https://git-wip-us.apache.org/repos/asf?p=cordova-fetch.git;h=0352f8c ]

          CB-12787: Fix plugin installation with --link option

          This closes #557

          Show
          jira-bot ASF subversion and git services added a comment - Commit 0352f8c8a47912144ae5380a72d0847cb51f4531 in cordova-fetch's branch refs/heads/master from Nikita Matrosov [ https://git-wip-us.apache.org/repos/asf?p=cordova-fetch.git;h=0352f8c ] CB-12787 : Fix plugin installation with --link option This closes #557

            People

            • Assignee:
              Nikita Matrosov Nikita Matrosov
              Reporter:
              stevegill Steve Gill
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development