Pages are prependended with a two or three digit number depending on whether they're part of the linear flow of application pages (2-digit) or other non-linear support pages (3-digit)
- Copy the contents of
boilerplate/blank-page-template.jsxto a new file (e.g.99-example.jsx) in thesrc/pagesfolder - Update the exported
metaobject with relevant information - Import and export the page in
src/pages/index.js - Start the server and navigate to the newly added route (set in the page's
metaobject) you should see the placeholder content from the boilerplate and in the console all the metadata and app data avaiable to the view. - If you need to prepare new data to add to
allWorkoutDataavailable to the page, that should be in done in a transformer (see below).
Transformers are pure functions which receive the raw JSON data array (parsed from user-provided CSV) and return an Object of any internal shape.
The result of the transformer should be (at least) snapshot tested in an adjacent test file to ensure any regressions are flagged in CI
- Copy the contents of
boilerplate/blank-transformer-template.jsto a new file (e.g.example.js) in thesrc/transformsfolder - Create a test file in
src/transforms/expample.test.js. - Import and export the transformer function in
src/transforms/index.js - Add the reference name as a constant to
TRANSFORMED_KEYSinsrc/constants.js
Soon: yarn hygen generator with-prompt new (via npx)