npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hedviginsurance/embark

v3.1.0

Published

Embark is Hedvigs framework for creating forms and user stories.

Downloads

164

Readme

Embark

Embark is Hedvigs framework for creating forms and user stories.

Core concepts

1. Embark flow

Embark flows describe forms used to get users necessary data during the onboarding process. They consist on a number of steps (a.k.a passages) presented in a question/answer manner with transitions from one to another in a non linear way, meaning that the next step might depend on users previous answer. Embark flows are created with the assistence of a tool called Angel.

2. Embark Server

Embark Server is responsible to serve Embark flows so Embark Clients like web-onboarding and ios/android apps can access them.

3. Embark Client

An Embark Client is responsible to access and display Embark flows.

What's inside?

This repository holds three things:

  • The implementation for the Embark Server. It simply consists on web server that exposes all the Embark Flows placed under angel-data folder. Its implementation can be found inside server.ts file.
  • The implementation of the Embark Client for the web: Embark Client Web. It consists on a set of React components and hooks.
  • A small React app used for previewing while developing Embark Flows with our custom tool: Angel. It's exposed via Embark Server under /client.js endpoint. More info about Angel can be found in its repository. For the content editor's documentation - see embark editor docs.

Getting Started

Prerequisites

Install Node with nvm

While one can install node by downloading it from their official website we recomend do it through nvm which is a tool that you can use to easily install and manage multiple node versions in your machine:

  1. Install nvm https://github.com/creationix/nvm
  2. nvm install (installs the node version specified in .nvmrc)
  3. nvm use (use version from .nvmrc)

Install Yarn v1

In order to instal yarn just follow their official installation steps

Install dependencies

yarn install # or simply yarn

Development

Embark Server

You probably will not be doing changes on the Embark Server. In any case, you can run it locally by executing

yarn start

Observe tho that it doesn't count with live reload so you would need to restart it for it to pick up any changes added after having it started.

Embark Client Web

There are a couple of options to choose for the development of Embark Client Web. The most suitable will depend on the nature of the changes you intend to insert:

  • If you want to add/update UI components used for displaying Embark flows in a isolated way, you probably want to use Storybook
  • If you want to add/update code related with Embark flows processing and/or verify your changes in the context of the whole flow, the best option would be run your flow locally with Angel

Developing with Storybook

To start Storybook just run

yarn storybook

and then access http://localhost:6010/. If your components are not Storybooked yet make sure to first storybookify them.

Developing with Angel

Make sure you have the Angel project ready in your machine. Check Angel - Getting Started for more details.

  1. Run Angel locally
cd <path-to-Angel-repo>
yarn watch
  1. Run Embark locally
cd <path-to-embark-repo>
yarn watch
  1. Access Angel locally by going into http://localhost:8080/ and load the desired flow in development mode.

With that done, any recent changes related with Embark Client Web code will be taken into account while previwing Embark flows in Angel.

Deploy

Embark Server

The Embark Server is dockerized and it is hosted on Hedvig's AWS plataform.

Staging

All you need to do to deploy Embark Server on staging is to merge your changes into master and wait for Codefresh to build the docker container. A message will be sent to #platform-deploy when the deployment process is finished.

Production

In order to deploy Embark Server on prod you'll need to use the prod-env/bin/help_me_deploy.py script; so make sure you:

  1. Have cloned prod-env repository;
  2. Have an AWS account configured by following this guide

Having met the prerequisites and after having deployed on staging and verfied your changes all you need to do is:

  • cd to the prod-env repo
  • Run help me to deploy script:
export AWS_PROFILE=dev
bin/help_me_deploy.py prod
  • Choose embark as the service you want to deploy
  • ...and follow the instructions. At some point you will be presented with a link to the diff between the commit you want to release vs. what's currently deployed in production. It's a good idea to look through all changes before proceeding with the deploy. You can follow the progress in the #platform-deploy Slack channel.

Embark Client Web

The Embark Client Web is distributed as a NPM package. It is published via a GitHub Action workflow to NPM.

Steps:

  • Go to the Publish to NPM under the "Actions" tab.
  • Trigger a new run with the version you want to publish, e.g. "4.2.1"
  • A PR is created for you so that you can merge the new version to the master branch
    • Check out the PR branch and update CHANGELOG with your changes