Giter Club home page Giter Club logo

uk-gov-mirror / ukforeignoffice.xgovformbuilder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ukforeignoffice/xgovformbuilder

0.0 0.0 0.0 26.03 MB

Exploring how to quickly and easily design/prototype/deploy high quality digital forms for UK Gov. Based on the excellent work by Defra.

Home Page: https://digital-form-builder-designer.herokuapp.com/

Shell 0.41% JavaScript 25.14% HTML 8.29% Dockerfile 0.17% SCSS 1.47% Gherkin 0.33% TypeScript 64.19%

ukforeignoffice.xgovformbuilder's Introduction

XGov Digital Form Builder

Gitter

This repository is a mono repo for

  • @xgovformbuilder/runner - Hapi server which can 'run' a form from a JSON file
  • @xgovformbuilder/designer - A React app to aide in form building
  • @xgovformbuilder/model - Serves the data model and other helpers

The repos are forked from DEFRA's digital form builder.

This is a (getting close to) zero-install yarn 2 workspaces repository. .yarnrc.yml allows us to align our yarn environments. Please commit any plugins in .yarn, but do not commit your .yarn/cache. CI will save and restore the caches.

Workspaces will deal with sym-linking the packages, so we do not have to manually run yarn link. It will also deal with hoisting the node_modules for any packages that are shared between the repos, thus decreasing any install times. Hopefully it all just works™️.

Setup

Always run scripts from the root directory.

  1. Make sure you are using node >=12. node --version.
  2. Make sure you have yarn 2.4+ installed.
  3. Run $ yarn command to install all dependencies in all workspaces.
  4. Run $ yarn build to build all workspaces (this is needed because dependencies can depend on each other).

As already mentioned, always run scripts from the root directory. because workspaces don't have scripts or packages you need to run from inside their folders and by running in the root directory yarn 2 can resolve the scripts/packages properly.

To learn more about workspaces, check these links:

I want to...

run a specific workspaces' script

$ yarn [runner|designer|model] name-of-script

eg.: yarn desginer start or yarn runner add babel-core --dev

run a script for each of the workspaces

$ yarn workspaces foreach run name-of-script

watch and build for changes across all repos

I wouldn't recommend it unless you have a beefy processor.

$ yarn watch

add a dependency to all workspaces

$ yarn add packagename

create a new workspace

  1. create a new directory for the workspace and yarn init it
    1. $ mkdir myNewLib
    2. $ cd myNewlib
    3. $ yarn init
  2. in the root package.json
    1. add myNewLib to the workspaces object.

Troubleshooting

If you have any problems, submit an issue or send a message via gitter.

Error: ENOENT: no such file or directory, scandir 'xxx/node_modules/node-sass/vendor'

/vendor is not present since it hasn't been built or rebuilt. You may also get this issue with core-js, fsevents, nodemailer etc. $ yarn rebuild to rebuild all the packages $ yarn rebuild only node-sass to rebuild just node-sass

CI

Build process

  1. Pushes to any branch will start the build process
  2. .circleci/circle_trigger.sh will check for any changes in our packages, and if builds have failed previously
  3. circle_trigger.sh will trigger a workflow via the API. It will pass the parameters model, runner, designer (bool) to the workflow.
  4. If there are any changes to a workspace, it will be built and tested.
  • If an upstream dependency, like model has changed, the downstream dependencies (runner, designer) will also be built and tested.

Development environment

The development workflow is triggered whenever a PR is merged into master and you can monitor it on the repository's action tab.

The workflow contains two separate jobs that run in parallel, one for the Runner and another for the Designer application.

Both jobs work as follows:

  1. Build the docker image with all dependencies.
  2. Push image to Heroku Container Registry.
  3. Release the latest image.

The latest releases will be running here: Runner / Designer.

contributions

Issues and pull requests are welcome. Please check CONTRIBUTING.md first!

ukforeignoffice.xgovformbuilder's People

Contributors

jenbutongit avatar superafroman avatar davidjamesstone avatar andymoody avatar bertrandmc avatar thespartan1980 avatar kakanisridhar avatar jonnywyatt avatar mileyd avatar james-sheppard-gov-uk avatar nattrass avatar pmshaw15 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.