You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by Tiago Alves <tr...@gmail.com> on 2018/03/14 23:56:35 UTC

Install plugin from local folder or private repo

Hi!

I am developing a plugin that is not quite ready for the public, but still I would like to use internally in my project. Is there a way to install the plugin without publishing it on npm? After some tests and reading the relevant code*, it seems like it is not possible.

Other plugin systems (Cordova, NativeScript) allow installing plugins from a local path, directly from GitHub repo or npm. I can see several cases where it would be useful.

Possible syntax:
weexpack plugin add ~/mycode/weex-my-plugin
weexpack plugin add https://github.com/natjs/weex-nat-device-info
weexpack plugin add natjs/weex-nat-device-info (same as the previous command)
weexpack plugin add nat-device-info (the current way to install plugins)

(*) Relevant code, according to my research:
https://github.com/weexteam/weex-pack/blob/79dfa5d64c140898b8e3e06340f8f0ee7e44742e/src/plugin/install.js#L107
https://github.com/weexteam/weex-pack/blob/f5677abd9e34763c879f31f1bb6df79bee0a6f43/src/utils/index.js#L167

Thanks!
Tiago


Re: Install plugin from local folder or private repo

Posted by Dan <fa...@gmail.com>.
Hi!

For example, like ios project can pass "packagename":
path=>"../../node_modules/packagename/ios/" to include the package, it's
not using npm link, but a logic should be into the "weex plugin add"
command.

For now, if you want to publish your ios package, you have to publish your
ios plugin in cocoapod, and also declared in the npm "package.json", you
can see the document here
https://github.com/weexteam/weex-pack/blob/master/doc/en/how-to-devloping-weex-plugin.md#publish
.

Thanks

2018-03-15 11:27 GMT+08:00 Tiago Alves <tr...@gmail.com>:

> Hi!
>
> How does that local path link work? You mean npm link?
>
> Sure, after I figure this out In think I can help implementing the
> GitHub/local path plugin.
>
> I have another (probably noob) question: I also have to publish my plugin
> in cocoa pods, if it will be used on iOS, right?
>
> Tiago
>
> On 15 Mar 2018 03:25 +0000, Dan <fa...@gmail.com>, wrote:
> > Hi, Tiago
> >
> > I'm a developer of weexpack.
> >
> > It's a very useful suggestion, I very much agree with this scenes you
> said,
> > the plugin should support local and other remote paths which are also
> > planned to be implemented, we have implemented similar logic in `weex
> > create` command. What is needed is to modify the part of the plugin
> > accordingly.
> >
> > However, before implementing this feature, we also need to consider other
> > issues, such as allowing the plugin to also support local path link,
> that's
> > the RN/Cordova's way to link native components into the project, it's
> quite
> > easy to publish native package with npm package, some people would like
> > that and I decide to implement it first.
> >
> > If you are interested, you are also welcome to submit related PR together
> > to build,I will check it all the time.
> >
> > Thanks!
> >
> > 2018-03-15 7:56 GMT+08:00 Tiago Alves <tr...@gmail.com>:
> >
> > > Hi!
> > >
> > > I am developing a plugin that is not quite ready for the public, but
> still
> > > I would like to use internally in my project. Is there a way to
> install the
> > > plugin without publishing it on npm? After some tests and reading the
> > > relevant code*, it seems like it is not possible.
> > >
> > > Other plugin systems (Cordova, NativeScript) allow installing plugins
> from
> > > a local path, directly from GitHub repo or npm. I can see several cases
> > > where it would be useful.
> > >
> > > Possible syntax:
> > > weexpack plugin add ~/mycode/weex-my-plugin
> > > weexpack plugin add https://github.com/natjs/weex-nat-device-info
> > > weexpack plugin add natjs/weex-nat-device-info (same as the previous
> > > command)
> > > weexpack plugin add nat-device-info (the current way to install
> plugins)
> > >
> > > (*) Relevant code, according to my research:
> > > https://github.com/weexteam/weex-pack/blob/
> 79dfa5d64c140898b8e3e06340f8f0
> > > ee7e44742e/src/plugin/install.js#L107
> > > https://github.com/weexteam/weex-pack/blob/
> f5677abd9e34763c879f31f1bb6df7
> > > 9bee0a6f43/src/utils/index.js#L167
> > >
> > > Thanks!
> > > Tiago
> > >
> > >
>

Re: Install plugin from local folder or private repo

Posted by Tiago Alves <tr...@gmail.com>.
Hi!

How does that local path link work? You mean npm link?

Sure, after I figure this out In think I can help implementing the GitHub/local path plugin.

I have another (probably noob) question: I also have to publish my plugin in cocoa pods, if it will be used on iOS, right?

Tiago

On 15 Mar 2018 03:25 +0000, Dan <fa...@gmail.com>, wrote:
> Hi, Tiago
>
> I'm a developer of weexpack.
>
> It's a very useful suggestion, I very much agree with this scenes you said,
> the plugin should support local and other remote paths which are also
> planned to be implemented, we have implemented similar logic in `weex
> create` command. What is needed is to modify the part of the plugin
> accordingly.
>
> However, before implementing this feature, we also need to consider other
> issues, such as allowing the plugin to also support local path link, that's
> the RN/Cordova's way to link native components into the project, it's quite
> easy to publish native package with npm package, some people would like
> that and I decide to implement it first.
>
> If you are interested, you are also welcome to submit related PR together
> to build,I will check it all the time.
>
> Thanks!
>
> 2018-03-15 7:56 GMT+08:00 Tiago Alves <tr...@gmail.com>:
>
> > Hi!
> >
> > I am developing a plugin that is not quite ready for the public, but still
> > I would like to use internally in my project. Is there a way to install the
> > plugin without publishing it on npm? After some tests and reading the
> > relevant code*, it seems like it is not possible.
> >
> > Other plugin systems (Cordova, NativeScript) allow installing plugins from
> > a local path, directly from GitHub repo or npm. I can see several cases
> > where it would be useful.
> >
> > Possible syntax:
> > weexpack plugin add ~/mycode/weex-my-plugin
> > weexpack plugin add https://github.com/natjs/weex-nat-device-info
> > weexpack plugin add natjs/weex-nat-device-info (same as the previous
> > command)
> > weexpack plugin add nat-device-info (the current way to install plugins)
> >
> > (*) Relevant code, according to my research:
> > https://github.com/weexteam/weex-pack/blob/79dfa5d64c140898b8e3e06340f8f0
> > ee7e44742e/src/plugin/install.js#L107
> > https://github.com/weexteam/weex-pack/blob/f5677abd9e34763c879f31f1bb6df7
> > 9bee0a6f43/src/utils/index.js#L167
> >
> > Thanks!
> > Tiago
> >
> >

Re: Install plugin from local folder or private repo

Posted by Dan <fa...@gmail.com>.
Hi, Tiago

I'm a developer of weexpack.

It's a very useful suggestion, I very much agree with this scenes you said,
the plugin should support local and other remote paths which are also
planned to be implemented, we have implemented similar logic in `weex
create` command. What is needed is to modify the part of the plugin
accordingly.

However, before implementing this feature, we also need to consider other
issues, such as allowing the plugin to also support local path link, that's
the RN/Cordova's way to link native components into the project, it's quite
easy to publish native package with npm package, some people would like
that and I decide to implement it first.

If you are interested, you are also welcome to submit related PR together
to build,I will check it all the time.

Thanks!

2018-03-15 7:56 GMT+08:00 Tiago Alves <tr...@gmail.com>:

> Hi!
>
> I am developing a plugin that is not quite ready for the public, but still
> I would like to use internally in my project. Is there a way to install the
> plugin without publishing it on npm? After some tests and reading the
> relevant code*, it seems like it is not possible.
>
> Other plugin systems (Cordova, NativeScript) allow installing plugins from
> a local path, directly from GitHub repo or npm. I can see several cases
> where it would be useful.
>
> Possible syntax:
> weexpack plugin add ~/mycode/weex-my-plugin
> weexpack plugin add https://github.com/natjs/weex-nat-device-info
> weexpack plugin add natjs/weex-nat-device-info (same as the previous
> command)
> weexpack plugin add nat-device-info (the current way to install plugins)
>
> (*) Relevant code, according to my research:
> https://github.com/weexteam/weex-pack/blob/79dfa5d64c140898b8e3e06340f8f0
> ee7e44742e/src/plugin/install.js#L107
> https://github.com/weexteam/weex-pack/blob/f5677abd9e34763c879f31f1bb6df7
> 9bee0a6f43/src/utils/index.js#L167
>
> Thanks!
> Tiago
>
>