NativeScript / NativeScript/nativescript-cli

Plugin update won't work with locally developed plugin

Open
#3,519 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

plugins to-be-checked
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Hello,

Description

I created a tns app with tns create MyTnsApp --tsc and a plugin (with nativescript-plugin-seed) for it and put it to the plugins folder.

Here is the directory tree:

├── app
│   ├── package.json
│   └── <other files>
├── hooks
│   └── < ... >
├── node_modules
│   └── < ... >
├── package.json
├── platforms
│   └── < ... >
└── plugins
    └── nativescript-myplugin
        └── src
            ├── package.json
            └── < ... >

I can successfully add the plugin via: tns plugin add plugins/nativescript-myplugin/src/

I can successfully remove the plugin via: tns plugin remove nativescript-myplugin

The problem

Using tns plugin update nativescript-myplugin removes the plugin I want but it tries to get the source from https://registry.npmjs.org/nativescript-myplugin which drops a 404 error, of course.
So, the install fails.

Using tns plugin update plugins/nativescript-myplugin/src/ says "Plugin "plugins/nativescript-myplugin/src/" is not installed."

The expectation

I would like to update my plugin even if I develop it locally.
Either giving the path of the plugin or the name of it,update should work without a problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with tns plugin add plugins/nativescript-myplugin/src/, then run both tns plugin update nativescript-myplugin and the path-based update command. Trace the tns plugin update CLI entry point and compare how installed local plugins are recorded and resolved. Done means updating the local plugin by name or path without fetching an unavailable npm package.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.