First off, thanks for taking the time to contribute! 🎉
The following is a set of guidelines for contributing to @logkat/broker-parser. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
This project and everyone participating in it is governed by the Code of Conduct. By participating, you are expected to uphold this code.
- Ensure the bug was not already reported by searching on GitHub under Issues.
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as well as as much relevant information as possible.
- Open a new issue and clearly describe your suggestion.
- Explain why this enhancement would be useful to most users.
We love support for new brokers! To add one:
-
Create a Parser File: Create a new file in
src/parsers/(e.g.,src/parsers/mybroker.ts) implementing theBrokerParserinterface. -
** Implement Logic**:
name: Unique name of the broker.canParse(row): A function returningtrueif this row belongs to this broker. Be specific (check unique headers).parse(row): Map the CSV row to theParsedTransactioninterface.
-
Register: Add your parser to the registry in
src/parsers/index.ts(or wherevergetParsersis defined). -
Test: Add a test case in
tests/parser_brokers.test.tswith a sample transaction row.
- Fork the repo and create your branch from
main. - If you've added code that should be tested, add tests.
- Ensure the test suite passes (
pnpm test). - Make sure your code lints (
pnpm run type-check). - Issue that pull request!
- Use the present tense ("Add feature" not "Added feature").
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...").
- Limit the first line to 72 characters or less.