0.0.26 • Published 4 years ago

ueb-validate v0.0.26

Weekly downloads
91
License
-
Repository
-
Last release
4 years ago

ueb-validate

The original idea behind this package was handling front and back end validation in one centralized location. We also wanted to improve frontend validation by giving the user specific error messages to help them understand why what they are trying to save is invalid.

As of this update 9/9/19, this package is only being used in the frontend with the improved validation error messages.

Getting Started

Prerequisites

Node should be at least version 8.11

Installing

To install this package into your node project, simply run this command inside your project's folder:

npm i ueb-validate

Running the tests

Run npm test to run tests.

Deployment

To use this package, import whichever card data validator that you interested like this:

import cardValidator from "./ueb-validate/card-validate.js";

Then use this validator by calling it on a card. Take a look at /ueb-validate/src/card-validate.test.js to see how this works.

Development

Modifying or adding a new card-subschema

The javascript functions only act as a medium between the JSON schema validation and the error output. If you want to change or add a schema follow these steps:

  1. Clone the repo, cd ueb-validate, then create and checkout a new branch to work on your new schema in
  2. Run npm i to install the dependencies
  3. Think about what the required fields should be for your new card body type
  4. Implement the required fields as a schema based on the JSON schema specification
  5. Add your sweet new schema into the folder: ueb-validate/src/schemas/
  6. Then add your new schema to the: ueb-validate/src/CardSubSchemas.js card sub schema map
  7. Add tests to show how your new schema works to the file: ueb-validate/src/card-subschema-validate.js
  8. Once you're happy with your new schema and tests merge your branch with the master

Compiling and publishing the package to npm

  1. In the master branch run npm version <type> where <type> is either patch, minor or major
  2. Commit and push the version change to GitHub
  3. Push the new version tag to GitHub with: git push --tags
  4. Compile the package with babel by running the predefined npm script: npm run prepare
  5. Run npm publish to publish this new version to NPM package

README.md Updates

UpdateDate
Original1/4/19
First9/9/19
0.0.26

4 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago