draft version 3
Muti-backend toolchain issue
Introduction
We need a muti-backend toolchain, managing plugins and backends for an average developer (and maybe, core developers like callstackexceed). It should handle different kinds of plugins and backends, providing easy-to-use cli (made by gulp
and/or yargs
).
Plugins
A plugin can be from a inside folder (npm package or git rep is planed).
A plugin.json
store all information necessary.
npx gulp addplugin --npm <npm-package>
# npm install <plugin> --save
npm run addplugin -- --git <git-rep>
npm run addplugin -- --direct <folder>
npm run updateplugin -- -p <plugin>
npm run removeplugin -- -p <plugin>
npm run checkplugin -- [-p <plugin>]
A simple problem
There is a suggestion that we use plugin as its side effect. To make that possible, we must remove system.js
.
The suggestion is allready implemented, see NorthernOceanS/norma-core#32 and #73.
Another simple problem
With current toolchain, we can only use CJS style in npm package plugin, which is very uncomfortable. Using webpack or other packing tool with ESM to replace it can remove this problem.
The suggestion is still in consideration, it have its own issue in https://github.com/NorthernOceanS/NormaConstructor.
Backends
A backend can be from a git rep (npm package or git rep is planed).
npm run addbackend -- --git <git-rep>
npm run installbackend -- -p <backend>
npm run updatebackend -- -p <backend>
npm run removebackend -- -p <backend>
npm run setinstallposition -- -p <backend> --pos <path>
A backend should implement such script:
npm run build
npm run watch
npm run packageaddon
npm run deploy -- --pos <pos>
npm run test
build:
plugin
folder -> one or more .js
file
- scripting: one or two
.js
file
- lxl: one
.js
file
packageaddon:
plugin
folder -> mcaddon
file
only for scripting platform (may have a few backends)
deploy:
plugin
folder -> one or more .js
file -> place them in correct place
- scripting: deploy them into offical dir
- lxl:
.js
file, deploy them into correct dir