Giter VIP home page Giter VIP logo

turris-reforis-plugins-template's Introduction

reForis plugins template

Naming convetion

When creating new repository please use reforis_{{plugin_name}} format for the path. It should be the same name as for Python module that would be a part of the plugin.

Development installation

  1. Install cookiecutter

    $ pip3 install cookiecutter
  2. Install template and fill template variables

    $ cookiecutter https://gitlab.labs.nic.cz/turris/reforis/plugins-template

    If you want to use template from specific branch e.g. dev

    $ cookiecutter https://gitlab.labs.nic.cz/turris/reforis/plugins-template --checkout dev

    If cookiecutter command is not available try python3 -m cookiecutter.

  3. Install npm dependencies

    $ cd reforis_{{plugin_name}}
    $ make preapare-dev
  4. Initialize translation languages Check variable LANGS in Makefie for list of languages before initiate translations.

    $ make init-lang
  5. Build JS

    $ make build-js
  6. Sync plugin directory with router - copy repository to /tmp/reforis_{{plugin_name}}/

  7. Install plugin on the router

    $ cd /tmp/reforis_{{plugin_name}}/
    $ make install

Testing

To locally test example plugin you can use make commands:

  • test
  • lint
  • init-langs

Version control

Please note that the git repository is not automatically created. If you wish to use one it's advised to add repository section to package.json.

Dependencies

Foris JS

Foris JS is one of the plugin's dependencies. For the sake of developers convenience its version is set to latest (in package.json file). After creating new plugin with the template it is recommended to fix version, i.e. change latest to the actual version (e.g. 0.2.3) so that breaking changes in library won't affect the new plugin in an undesired way.

reForis

Most plugins would take advantage of reForis API utils, such as APIError exception or validate_json function. As a consequence, reForis is installed by setup.py (in Python's virtual environment) during development or testing (CI). If you find yourself not using those utilities, feel free to remove that dependency in your plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.