# Forms

Bootcamp private npm package that renders forms that users save (surveys, ad-hoc, etc.).  It's 
built with reusable, responsive, accessible front end components written in React.

### How to use: 

    npm install --save @trilogyeducation/forms or npm install --save --save-exact @trilogyeducation/forms@x.x.x

    import { Form } from "@trilogyeducation/forms";

    <Form
        loading={loading}
        error={errorMsg}
        data={forms[0]}
        submitText={forms.length > 1 ? "Submit and Go to Next Survey" : "Submit"}
        onSubmit={this.handleSubmitForm}
        mapsApiKey={process.env.GoogleMapsApiKey}
    />

### Steps to publish production version:

* update version in package.json and package-lock.json
(first number is for major or breaking change, second number is for a minor change and 
third number is for patch releases ie 1.2.3)
* type `npm run lint`
* type `npm run test`
* create pull request against `staging` branch
* create pull request against client that consumes production version after production version is published

### Steps to publish test version:

* clone/download Forms repo
* cd into folder
* type `npm install`
* make changes / create tests
* update version in package.json and package-lock.json
(first number is a major or breaking change, second number is for each release, 
third number is each patch and rc extension is each test cycle prior to 
release "-rc.x.x.x") ie 1.2.3-rc.0.0.1
* type `npm run lint`
* type `npm run test`
* create pull request against `staging` branch
* create pull request against client that consumes test version after test version is published

### Steps to test npm package locally:

* clone/download Forms repo
* cd into folder
* type `npm install`
* type `npm run build` (creates dist/index.js file)
* clone/download client repo ie Canvas Login, Canvas LTI
* cd to folder
* type `npm install`
* type `sudo npm link <npm package path>/forms` (use unlink to remove)
* import form into any page `import { Form } from "@trilogyeducation/forms"`
* type `npm start` to locally launch client repo and view form component