- Use this template
- Git clone your repo to local
- Use
yarn && yarn dev
to start development - Use
yarn release
to publish - View the release in your cloud account
Remote module means you can dynamically load and run it from a remote URL for the Browser or Node.js.
So you can update project-code or hotload plugins without redeploying.
More Details in nodeVM ( MF's official runtime of remote module )
MfNodes developing must follow MF development specification, but it's very easy.
You only need to implement the interface below in your entry file.
interface mfNode {
email: string ## your email to identify who you are
name: string ## your node name
version: string ## version
urls: string ## release bundle url list or github repo url
author: string ## your name
description: string ## code description
icon: string ## code icon url (png)
categories: Array<string> ## categories for human
resources: object ## resources like github page or project website
proto: object ## rpc proto object
init(): void ## will be executed at the first startup
instance(): any ## return rpc functions
}
# More about `instance()` return, see details in: https://mali.js.org/api/#mali-%E2%87%90-emitter
This repo is both of a template and minimal mfNode example >> have a glance at the code in src
( lines < 35 )
src
├── hello.proto ## Grpc protobuf
├── index.js ## Entry
└── internel ## Logics, middlewares and your own code all here
├── index.js ##
└── logics ##
└── Greeter.js ## Service-file, one service-file can have many rpc-Functions
yarn dev
hotreload code dev, code compile to dist/bundle.js
yarn build
It will compile all your code to one file to build/index.js
. So we can upload it as a service plugin!🥳
yarn release
It will upload your node code to Cloud.
recent
-
mf-cli : gen code from internel dir and proto file, auto build-publish
-
rollup-plugin-gproto: a rollup plugin that can load proto file in compile time
plan
-
docs about how to create a mfNode
-
MF dev specification, interface between mf units
MIT