If you have Node Version Manager (nvm) installed, you can get started
by running script/setup from the root of the repository. You can then verify
your setup is successful by running script/test.
The script folder follows the "Scripts to Rule Them All" pattern;
for example you should be able to run script/update every time you pull new
changes or checkout a different branch.
Jest tests are in the test folder and can be run via script/test, or by
running npm test.
If you want to run the ocf2ocx CLI based on what is in your local code, there
are two ways.
npm run cliwill build the TypeScript and then invoke the build output. Note to pass options you will need a--to keepnpmfrom capturing them; e.g.:npm run cli --versionwill give you the version ofnpmyou are using,npm run cli -- --versionwill output the version of the CLI.npm linkwill makeocf2ocxglobally available -- but you will need to remember to runnpm run buildto apply your updates.
For initial development, at a high level we will be using Ship / Show /
Ask. (PRs submitted from forks are by definition "Ask".) Because of this,
CI is fully implemented using Husky and Git hooks; git push will trigger a
series of steps to ensure that:
- You are integrating with the latest code on
main. - Tests are passing
We will use https://github.com/phodal/adr to manage and document
Architecture Decision Records. This tool is not
included in the package.json as a dependency; you can run using npx adr. New
ADRs should always be proposed as "Ask" PRs.
The features of the OCX spreadsheet are defined by the Law Firm Working Group via reference documents. It is up to the developers to interpret these reference documents and break the work down into features. You can see the currently scoped feature work on the project issue tracker. When defining a new feature, one should first clearly identify the portion of the spreadsheet in scope. Taking a screenshot and marking what is in scope is an effective way to do this.
Once the scope is identified, several activities must be performed. Other than the first and last steps, they are in no particular order -- but you may find this order easiest.
Look at every cell in the feature. If the cell is an Excel formula, the desired outcome can generally be ascertained and documented in the GitHub issue. If the cell is a string or numeric value, however, we need to determine:
- Which OCF object(s) are involved in the calculation, and
- What is the algorithm?
Currently we are documenting these in a Google Document; we intend to move these into GitHub at some point.
If you are not confident in the answers to these questions, ask for help! It will generally be valuable to get buy-in from the Law Firm Working Group if there is any uncertainty. Submit a question via the Issue Tracker and add the label
law-firm-wg.
The ocf-package module is responsible for loading files referenced by the OCF
Manifest File. You should double-check that the necessary files are being
processed.
The model module is responsible for processing the objects defined and
presenting values and calculation interfaces to the workbook module.
The workbook module defines the interfaces it needs the model to satisfy. It
can be helpful to make these interfaces optional or use Partials to make testing
easier, although this approach is shifting somewhat as we improve our TDD utils
for the workbook.