Giter Club home page Giter Club logo

floweditor's Introduction

Flow Editor

Build Status codecov Maintainability

This is a standalone flow editing tool designed for use within the RapidPro suite of messaging tools but can be adopted for use outside of that ecosystem. The editor is a React component built with TypeScript and bundled with Webpack. It is open-sourced under the AGPL-3.0 license.

You can view and interact with the component here.

Prerequisites

yarn
Node.js >= 10.x

Installation

The flow editor is a non-ejected project based on create-react-app. We use yarn to manage dependencies.

% yarn install

Building

Webpack is used to transpile TypeScript and SASS. After invoking a build, the compiled results will arrive in /build.

% yarn run build

Development

To run the flow editor in development mode, it requires an asset server. This is what is responsible for serving up flow definitions, groups, contact fields, etc. This project includes an in memory asset server for testing purposes. These are the same lambda functions used by our netlify preview site.

First, compile and run the local version for a faux asset server.

% yarn lambda

Then you are ready to fire up the development server for the editor.

% yarn start

Localization

The project is fully localized using i18next and leans on react-i18next to integrate it inside components. To generate new keys and defaults for localization, we use i18next-scanner. Use the yarn command scan to update localization keys.

% yarn scan

This file is then uploaded to Transifex for broad language translations. Once a language reaches full translation, it will be merged into the project.

Running Tests

This project uses Jest for unit/snapshot testing and react-testing-library where we can. The project has some older more complex tests that use Enzyme. Typescript and Jest are integrated via ts-jest.

% yarn test

Note that running this locally will automatically multithread based on how many cores your box has. It will also run it in the interactive watch mode. This mode is what you can use to easily run only failed tests or update snapshots. When this same command is run on CI, the tests will be run without watch mode automatically.

You can also run tests locally without watch mode

% yarn test --watchAll=false

Formatting

Prettier is used to keep formatting consistent. We use huskey pre-commit hooks to run prettier on every commit.

It is possible to run prettify against the entire project without commits. This is only necessary if the project conventions change.

% yarn run prettify

Publishing

To publish, simply invoke the desired semver -- patch, minor or major. This will version the package and travis will publish it to the npm repository automatically.

% yarn version --patch
% git push --tags

Contributing

Please read CONTRIBUTING.md for details on this project's code of conduct, and the process for submitting pull requests to this repo.

floweditor's People

Contributors

ericnewcomer avatar ycleptkellan avatar rowanseymour avatar nicpottier avatar

Watchers

James Cloos avatar

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.