Generic templates for TradeTrust, where users can use any of these available templates to render their document.
Note: These are just some rendering templates that are made available for users to use, the configurations to use these templates are in the documentation of TradeTrust document creator.
Available Templates | url |
---|---|
Covering Letter | https://generic-templates.tradetrust.io |
Use any one of these urls in the forms[0].defaults.$template.url
field of the configuration file.
Note: To use these available templates, please ensure that you have the correct schema in the configuration file.
You can download or git clone
this repo
$ git clone https://github.com/TradeTrust/generic-templates.git
$ npm install
$ npm run storybook # open storybook and start editing your components
$ npm run storybook:build # generate docs
$ npm run test:watch # run tests with Jest
$ npm run test:coverage # run tests with coverage
$ npm run integration # run integration test with testcafe
$ npm run lint # lint code
$ npm run build # build component
$ npm run example:application # start embedded application
This template provides a simple application that is able to render documents built for the current renderer. To use it:
- Open
application/index.tsx
file and edit thedocuments
property of theApp
component to suit your needs (provide any document that is available locally, whether it's a javascript, JSON or typescript document). - Start your renderer:
npm run dev
- Start the local application:
npm run example:application
- Head to
http://localhost:3010/
, you should see the configured documents during step 1.
This repository has been configured to run end-to-end tests using Testcafe
. Visualisation testing is also configured through Percy
and tests are ran through Testcafe
.
To setup Percy
, you will need a token that you can find on Percy's dashboard(percy.io):
- For local development, type
export PERCY_TOKEN=<PERCY_TOKEN>
into command line before runningnpm run integration
. - For CircleCI, add an environment variable
PERCY_TOKEN
with the token value.
- React - A JavaScript library for building user interfaces.
- Webpack - Component bundler.
- React testing library - Simple and complete testing utilities that encourage good testing practices.
- Emotion - Library designed for writing css styles with JavaScript.
- Babel - Write next generation JavaScript today.
- Jest - JavaScript testing framework used by Facebook.
- Testcafe - A node.js tool to automate end-to-end web testing.
- Percy - Visualisation testing tool.
- ESLint - Make sure you are writing a quality code.
- Prettier - Enforces a consistent style by parsing your code and re-printing it.
- Typescript - JavaScript superset, providing optional static typing
- Circle CI - Automate tests and linting for every push or pull request.
- Storybook - Tool for developing UI components in isolation with documentation.
- Debug - JS debugging utility that works both in node.js and browsers.
GPL-3.0