jerryscript-project / iotjs

Platform for Internet of Things with JavaScript http://www.iotjs.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IoT.js extensions and third party libraries

LaszloLango opened this issue · comments

Based on discussions on #1436

The main question is where to put modules which are built on top of the common modules. If we decide to put them into a new repository, then we should discuss the details before we create it (file hierarchy, resources, etc.)

Good idea !

FYI, I naively reimplemented node's serialport on top of iotjs's uart, would that fit in iotjs extensions ?

Do we want to use git modules for each new iotjs modules ?
What about license mixing ? I would suggest to align to iotjs licencing.

What about nodejs compatible modules ?
Is there any similar project we can get inspiration from ?

Hi all,
from a user perspective it think it should be split on components and boards.
From components you can split similar to mbed like this:
https://os.mbed.com/components/

Cylon have chosen to go down the path of everything in one place with platforms at the top and devices below e.g.
https://cylonjs.com/

How this is delivered, good question! I like the idea of having a devices library where each device is stored under it's physical product name. A very flat structure. That device should know what library it needs. That way it's easy to manage - although may get very large! (That would be a nice problem to have!)
Mbed do it like this:
https://os.mbed.com/components/NeoPixel-LED-chain-using-high-speed-SPI/
But they have a compile environment in the cloud.
I like having a package manager as in having npm or pip. But also a place where you can view the details of this device (no harm in copying from the masters at mbed!) ;-) ...

Naively I would create an "iotjs_modules" tree than share the same hierachy as node_modules with expected files:

iotjs_modules/*/package.json
iotjs_modules/*/LICENSE
etc

Eventually each (or some) modules could be a gitmodule...

I'd like to suggest having a new repository for iotjs_modules. It has an iot.js module list, organizes structures we're discussing, and categorizes the modules. Each iot.js module needs to have its own git repository, and they also need to be registered as iotjs_modules submodule somehow. As the number of modules to manage increases, iotjs_modules could give a tool to easily search and selectively clone the modules registered.

The above new repository could be sub-moduled in 'iot.js', mother project, under the folder named iotjs_modules.

@daeyeon yes I confirm this what I also had in mind

The open question is where submodules will be hosted ?

For instance, now I have a couple of samples code to share would it be best to share them into iotjs's sample dir of demos modules ? well I can try to make PR to iotjs and if not accepted then try in iotjs_modules.

Note for later, It would be nice to also to note if submodules are compatibles with nodejs.

@rzr

Let's say we already have another repository for iotjs_modules.

i) Since the owner of your sample is you, you need to host your own repository for it.
ii) You can request pulling your commit to register your repository as a sub-module of iotjs_modules.
iii) If your sample or module is compatibles with nodejs, then you can also register your repository to npm.

Plus, I personally hope using npm for iot.js also. Users can download any module via npm. A module owner can add a specific field for iotjs in package.json. It indicates the module can be used in iotjs also. Iot.js user can config at runtime whether referring to node_modules also, or verifying the above filed for module loading. (e.g using environment variable)

There is a lot that could be added to the samples files. i.e. there are not that many good tutorials and examples for people to follow.

Hence if this is something that the IoTjs team do not have the bandwidth to do or maintain, it would be better to off load and have a separate repo in my opinion.

Good idea!

Hi, based on previous discussion with @daeyeon

I created this draft repo:

https://github.com/rzr/iotjs_modules

I'll might keep experimenting with a couple of new modules to see if there are any limitations,
but for now I am open to suggestions, then I'll add more details.

Regards

A new repository is created for extensions: https://github.com/Samsung/iotjs-modules