DEPRECATED - Coop Trolley
This project is no longer maintained.
The Coop Trolley supply internal and external partners with Coop agnostic frontend tools to speed up development and improve reusability.
Packages can be included as React components or used in plain HTML with the Coop stylesheet.
Install from npm:
npm i @coop/trolley --save
Include the stylesheet once in your project
// In SASS;
Components can be used with React or - for static components - as plain HTML.
Use with React:
const MyComponent =<div><Button>My Button</Button></div>
Use with plain HTML:
Internal users can utilize
git subtree to push/pull components to project repositories. This allows for updating and improving components on the fly and commit changes to the Coop Trolley repo.
From project root.
git remote add -f -t master --no-tags coop-trolley https://github.com/theisof/coop-trolley
Add subtree, run
git subtree add --prefix path/to/folder coop-trolley/master --squash
Push to subtree, commit first and run
git subtree push --prefix=path/to/folder coop-trolley master
Pull from subtree, run
git subtree pull --prefix path/to/folder coop-trolley master --squash
Load fonts manually. Opens Sans and Roboto Slab can be loaded from Google Fonts.
Standard: 'MarkOT' or 'Open Sans'
Display: 'Soho Std' or 'Roboto Slab'
Todo: solution for new hosted font
Run local server on
npm i npm run start
To publish new version, increment version number in
package.json and run
npm run publish_all. Will update npm and Github demo page.
To only update Github pages run
npm run publish_demo
Get images from local folder by adding
?local-images to url
Use the following approach when testing:
- The goal is to eliminate the accidential removal of critical triggers, therefore...
- Apply smoke tests to key UI actions such as toggle buttons
- Don't test styling unless it impacts behaviour (like show/hiding a modal)
- Make snapshots for tested components
- Make unit tests