More Adventures in Open Source

This week I continued to honor my resolution to contribute to a singular open source project for the time being (fast-dna).

There’s been a lot happening. The previous script I wrote required some revisions since there have been changes to other parts of the documentation build process, which created some new bugs.

Bug #1: copy readme script fails if packages folder name is missing

Bug #2: update title casing for consistency in page and navigation

The first bug of the two has been fixed. When I made a PR for it initially there was an error caught by the code climate bot.

Two blocks of code were doing the same thing so I went and created a new function to handle both tasks:

function createDirectory(dir) {    
if (!fs.existsSync(dir)) {
dryRun ? console.log(`...CREATE the '${dir}' folder.`) : fs.mkdirSync(dir);
}}

This way every time my script created a new directory there was a function ready to handle it.

Trying something new

Earlier I volunteered to help fix a bug that dealt with a part of the project I was interested in learning more about, and my progress on that continues.

The bug itself wasn’t difficult to replicate and doesn’t seem too difficult to fix:

Above is the offending code; it looks likethis.handledProps.hasOwnProperty is generating an error since this.handleProps doesn’t exist.

As it stands I’m learning more about this unhandledProps function and how it works inside the component it’s in. This is because I’m attempting a more test driven approach to this bug, and want to make sure I’m making values correctly. I’m planning on writing a failing test for this error before continuing and fixing it.

Writing a new script file

The Typedoc logo

Fast-dna is adding a lot more to their existing documentation, and doing more to automate their documentation generation process. I volunteered to help write a new script for this, this time dealing with typedoc API generation.

As it stands, the new document will be linked to in the readme.

API Reference references the Typedoc api page

This week I learned more about how typedoc worked, as well as finding out how it does so across all packages in fast-dna. Some existing issues that I’ll be looking to do this following week include:

  • Finding out how to host the new api docs through github pages
  • Finding out how to display the typedoc files in general
  • Making sure the build process for these files incorporates well with the existing documentation build process