Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Muti-backend toolchain #69

Open
callstackexceed opened this issue Jul 6, 2021 · 0 comments
Open

Muti-backend toolchain #69

callstackexceed opened this issue Jul 6, 2021 · 0 comments
Assignees
Labels

Comments

@callstackexceed
Copy link
Member

callstackexceed commented Jul 6, 2021

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>]
  • norma-toolchain/
    • plugin/
      • plugins.json
      • hello/
        • index.js

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)

  • scripting: mcaddon file

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant