- Plugin names MUST be unique
- Create new git branch with a name of the form
feat/<retailer>-<country>
cd packages
cp -R <plugin-name>/ <new-plugin-name>/
- Open
package.json
in new plugin folder and update name and description values - Go back to plugin folder and open
src/index.ts
- Rename plugin class name and update merchant meta attributes
- Rename parser class name and update meta attributes
- Go to
packages/tsconfig.json
and add plugin path toreferences
section - Go to
cli-starter/
and add new plugin todependencies
inpackage.json
- Open
openreceipt.config.js
and add plugin name toplugins
section - Open
tsconfig.json
and add plugin path toreferences
section - Ensure you have emails in the
cli-starter/examples/
folder.ls -la examples/
- Run
yarn build --watch
- In a new terminal session, run
DEBUG=* yarn start run examples/<YOUR EML FILE>
- copy recieved from emails and add to meta src addresses
- extract html out of .eml file -------this.engine.log.info(this.engine.state.email.html)
yarn start run examples/.eml file
- copy html from console output into
file.html
- inspect the html file headers for important info such as order number, order items,quantity, tax and markers.
- comment out everything except the items property in the parse method of the parser.
-----------------now you have to find markers, extract text from between them, convert to dom (and back to strings!) when appropriate in order to reduce the html to the data that we need----------------
-----------------now examine nodes for unique properties and build the parser around them--------------------------------
Sometimes the composite builds seem to get cached and don't work correctly,
the easiest way to fix this is to go to the project root and run
yarn cleanup
.